diff options
Diffstat (limited to 'include')
96 files changed, 2352 insertions, 1232 deletions
diff --git a/include/acpi/acconfig.h b/include/acpi/acconfig.h index e27dc8f29972..b9beceb33141 100644 --- a/include/acpi/acconfig.h +++ b/include/acpi/acconfig.h | |||
@@ -63,7 +63,7 @@ | |||
63 | 63 | ||
64 | /* Current ACPICA subsystem version in YYYYMMDD format */ | 64 | /* Current ACPICA subsystem version in YYYYMMDD format */ |
65 | 65 | ||
66 | #define ACPI_CA_VERSION 0x20060127 | 66 | #define ACPI_CA_VERSION 0x20060608 |
67 | 67 | ||
68 | /* | 68 | /* |
69 | * OS name, used for the _OS object. The _OS object is essentially obsolete, | 69 | * OS name, used for the _OS object. The _OS object is essentially obsolete, |
@@ -81,6 +81,7 @@ | |||
81 | #define ACPI_MAX_PARSE_CACHE_DEPTH 96 /* Parse tree objects */ | 81 | #define ACPI_MAX_PARSE_CACHE_DEPTH 96 /* Parse tree objects */ |
82 | #define ACPI_MAX_EXTPARSE_CACHE_DEPTH 96 /* Parse tree objects */ | 82 | #define ACPI_MAX_EXTPARSE_CACHE_DEPTH 96 /* Parse tree objects */ |
83 | #define ACPI_MAX_OBJECT_CACHE_DEPTH 96 /* Interpreter operand objects */ | 83 | #define ACPI_MAX_OBJECT_CACHE_DEPTH 96 /* Interpreter operand objects */ |
84 | #define ACPI_MAX_NAMESPACE_CACHE_DEPTH 96 /* Namespace objects */ | ||
84 | 85 | ||
85 | /* | 86 | /* |
86 | * Should the subsystem abort the loading of an ACPI table if the | 87 | * Should the subsystem abort the loading of an ACPI table if the |
@@ -102,9 +103,9 @@ | |||
102 | 103 | ||
103 | #define ACPI_MAX_SEMAPHORE_COUNT 256 | 104 | #define ACPI_MAX_SEMAPHORE_COUNT 256 |
104 | 105 | ||
105 | /* Max reference count (for debug only) */ | 106 | /* Maximum object reference count (detects object deletion issues) */ |
106 | 107 | ||
107 | #define ACPI_MAX_REFERENCE_COUNT 0x400 | 108 | #define ACPI_MAX_REFERENCE_COUNT 0x800 |
108 | 109 | ||
109 | /* Size of cached memory mapping for system memory operation region */ | 110 | /* Size of cached memory mapping for system memory operation region */ |
110 | 111 | ||
@@ -171,12 +172,7 @@ | |||
171 | 172 | ||
172 | /* Array sizes. Used for range checking also */ | 173 | /* Array sizes. Used for range checking also */ |
173 | 174 | ||
174 | #define ACPI_NUM_ACCESS_TYPES 6 | 175 | #define ACPI_MAX_MATCH_OPCODE 5 |
175 | #define ACPI_NUM_UPDATE_RULES 3 | ||
176 | #define ACPI_NUM_LOCK_RULES 2 | ||
177 | #define ACPI_NUM_MATCH_OPS 6 | ||
178 | #define ACPI_NUM_OPCODES 256 | ||
179 | #define ACPI_NUM_FIELD_NAMES 2 | ||
180 | 176 | ||
181 | /* RSDP checksums */ | 177 | /* RSDP checksums */ |
182 | 178 | ||
@@ -187,10 +183,6 @@ | |||
187 | 183 | ||
188 | #define ACPI_SMBUS_BUFFER_SIZE 34 | 184 | #define ACPI_SMBUS_BUFFER_SIZE 34 |
189 | 185 | ||
190 | /* Number of strings associated with the _OSI reserved method */ | ||
191 | |||
192 | #define ACPI_NUM_OSI_STRINGS 10 | ||
193 | |||
194 | /****************************************************************************** | 186 | /****************************************************************************** |
195 | * | 187 | * |
196 | * ACPI AML Debugger | 188 | * ACPI AML Debugger |
diff --git a/include/acpi/acdisasm.h b/include/acpi/acdisasm.h index 11a8fe39cb04..9a7d6921f534 100644 --- a/include/acpi/acdisasm.h +++ b/include/acpi/acdisasm.h | |||
@@ -50,26 +50,72 @@ | |||
50 | #define BLOCK_PAREN 1 | 50 | #define BLOCK_PAREN 1 |
51 | #define BLOCK_BRACE 2 | 51 | #define BLOCK_BRACE 2 |
52 | #define BLOCK_COMMA_LIST 4 | 52 | #define BLOCK_COMMA_LIST 4 |
53 | #define ACPI_DEFAULT_RESNAME *(u32 *) "__RD" | ||
53 | 54 | ||
54 | struct acpi_external_list { | 55 | struct acpi_external_list { |
55 | char *path; | 56 | char *path; |
57 | char *internal_path; | ||
56 | struct acpi_external_list *next; | 58 | struct acpi_external_list *next; |
59 | u32 value; | ||
60 | u16 length; | ||
61 | u8 type; | ||
57 | }; | 62 | }; |
58 | 63 | ||
59 | extern struct acpi_external_list *acpi_gbl_external_list; | 64 | extern struct acpi_external_list *acpi_gbl_external_list; |
60 | 65 | ||
61 | /* Strings used for decoding flags to ASL keywords */ | 66 | typedef const struct acpi_dmtable_info { |
67 | u8 opcode; | ||
68 | u8 offset; | ||
69 | char *name; | ||
70 | |||
71 | } acpi_dmtable_info; | ||
72 | |||
73 | /* | ||
74 | * Values for Opcode above. | ||
75 | * Note: 0-7 must not change, used as a flag shift value | ||
76 | */ | ||
77 | #define ACPI_DMT_FLAG0 0 | ||
78 | #define ACPI_DMT_FLAG1 1 | ||
79 | #define ACPI_DMT_FLAG2 2 | ||
80 | #define ACPI_DMT_FLAG3 3 | ||
81 | #define ACPI_DMT_FLAG4 4 | ||
82 | #define ACPI_DMT_FLAG5 5 | ||
83 | #define ACPI_DMT_FLAG6 6 | ||
84 | #define ACPI_DMT_FLAG7 7 | ||
85 | #define ACPI_DMT_FLAGS0 8 | ||
86 | #define ACPI_DMT_FLAGS2 9 | ||
87 | #define ACPI_DMT_UINT8 10 | ||
88 | #define ACPI_DMT_UINT16 11 | ||
89 | #define ACPI_DMT_UINT24 12 | ||
90 | #define ACPI_DMT_UINT32 13 | ||
91 | #define ACPI_DMT_UINT56 14 | ||
92 | #define ACPI_DMT_UINT64 15 | ||
93 | #define ACPI_DMT_STRING 16 | ||
94 | #define ACPI_DMT_NAME4 17 | ||
95 | #define ACPI_DMT_NAME6 18 | ||
96 | #define ACPI_DMT_NAME8 19 | ||
97 | #define ACPI_DMT_CHKSUM 20 | ||
98 | #define ACPI_DMT_SPACEID 21 | ||
99 | #define ACPI_DMT_GAS 22 | ||
100 | #define ACPI_DMT_MADT 23 | ||
101 | #define ACPI_DMT_SRAT 24 | ||
102 | #define ACPI_DMT_EXIT 25 | ||
62 | 103 | ||
63 | extern const char *acpi_gbl_word_decode[4]; | 104 | typedef |
64 | extern const char *acpi_gbl_irq_decode[2]; | 105 | void (*ACPI_TABLE_HANDLER) (struct acpi_table_header * table); |
65 | extern const char *acpi_gbl_lock_rule[ACPI_NUM_LOCK_RULES]; | 106 | |
66 | extern const char *acpi_gbl_access_types[ACPI_NUM_ACCESS_TYPES]; | 107 | struct acpi_dmtable_data { |
67 | extern const char *acpi_gbl_update_rules[ACPI_NUM_UPDATE_RULES]; | 108 | char *signature; |
68 | extern const char *acpi_gbl_match_ops[ACPI_NUM_MATCH_OPS]; | 109 | struct acpi_dmtable_info *table_info; |
110 | ACPI_TABLE_HANDLER table_handler; | ||
111 | }; | ||
69 | 112 | ||
70 | struct acpi_op_walk_info { | 113 | struct acpi_op_walk_info { |
71 | u32 level; | 114 | u32 level; |
115 | u32 last_level; | ||
116 | u32 count; | ||
72 | u32 bit_offset; | 117 | u32 bit_offset; |
118 | u32 flags; | ||
73 | struct acpi_walk_state *walk_state; | 119 | struct acpi_walk_state *walk_state; |
74 | }; | 120 | }; |
75 | 121 | ||
@@ -77,6 +123,100 @@ typedef | |||
77 | acpi_status(*asl_walk_callback) (union acpi_parse_object * op, | 123 | acpi_status(*asl_walk_callback) (union acpi_parse_object * op, |
78 | u32 level, void *context); | 124 | u32 level, void *context); |
79 | 125 | ||
126 | struct acpi_resource_tag { | ||
127 | u32 bit_index; | ||
128 | char *tag; | ||
129 | }; | ||
130 | |||
131 | /* Strings used for decoding flags to ASL keywords */ | ||
132 | |||
133 | extern const char *acpi_gbl_word_decode[]; | ||
134 | extern const char *acpi_gbl_irq_decode[]; | ||
135 | extern const char *acpi_gbl_lock_rule[]; | ||
136 | extern const char *acpi_gbl_access_types[]; | ||
137 | extern const char *acpi_gbl_update_rules[]; | ||
138 | extern const char *acpi_gbl_match_ops[]; | ||
139 | |||
140 | extern struct acpi_dmtable_info acpi_dm_table_info_asf0[]; | ||
141 | extern struct acpi_dmtable_info acpi_dm_table_info_asf1[]; | ||
142 | extern struct acpi_dmtable_info acpi_dm_table_info_asf2[]; | ||
143 | extern struct acpi_dmtable_info acpi_dm_table_info_asf3[]; | ||
144 | extern struct acpi_dmtable_info acpi_dm_table_info_asf4[]; | ||
145 | extern struct acpi_dmtable_info acpi_dm_table_info_asf_hdr[]; | ||
146 | extern struct acpi_dmtable_info acpi_dm_table_info_boot[]; | ||
147 | extern struct acpi_dmtable_info acpi_dm_table_info_cpep[]; | ||
148 | extern struct acpi_dmtable_info acpi_dm_table_info_cpep0[]; | ||
149 | extern struct acpi_dmtable_info acpi_dm_table_info_dbgp[]; | ||
150 | extern struct acpi_dmtable_info acpi_dm_table_info_ecdt[]; | ||
151 | extern struct acpi_dmtable_info acpi_dm_table_info_facs[]; | ||
152 | extern struct acpi_dmtable_info acpi_dm_table_info_fadt1[]; | ||
153 | extern struct acpi_dmtable_info acpi_dm_table_info_fadt2[]; | ||
154 | extern struct acpi_dmtable_info acpi_dm_table_info_gas[]; | ||
155 | extern struct acpi_dmtable_info acpi_dm_table_info_header[]; | ||
156 | extern struct acpi_dmtable_info acpi_dm_table_info_hpet[]; | ||
157 | extern struct acpi_dmtable_info acpi_dm_table_info_madt[]; | ||
158 | extern struct acpi_dmtable_info acpi_dm_table_info_madt0[]; | ||
159 | extern struct acpi_dmtable_info acpi_dm_table_info_madt1[]; | ||
160 | extern struct acpi_dmtable_info acpi_dm_table_info_madt2[]; | ||
161 | extern struct acpi_dmtable_info acpi_dm_table_info_madt3[]; | ||
162 | extern struct acpi_dmtable_info acpi_dm_table_info_madt4[]; | ||
163 | extern struct acpi_dmtable_info acpi_dm_table_info_madt5[]; | ||
164 | extern struct acpi_dmtable_info acpi_dm_table_info_madt6[]; | ||
165 | extern struct acpi_dmtable_info acpi_dm_table_info_madt7[]; | ||
166 | extern struct acpi_dmtable_info acpi_dm_table_info_madt8[]; | ||
167 | extern struct acpi_dmtable_info acpi_dm_table_info_madt_hdr[]; | ||
168 | extern struct acpi_dmtable_info acpi_dm_table_info_mcfg[]; | ||
169 | extern struct acpi_dmtable_info acpi_dm_table_info_mcfg0[]; | ||
170 | extern struct acpi_dmtable_info acpi_dm_table_info_rsdp1[]; | ||
171 | extern struct acpi_dmtable_info acpi_dm_table_info_rsdp2[]; | ||
172 | extern struct acpi_dmtable_info acpi_dm_table_info_sbst[]; | ||
173 | extern struct acpi_dmtable_info acpi_dm_table_info_slit[]; | ||
174 | extern struct acpi_dmtable_info acpi_dm_table_info_spcr[]; | ||
175 | extern struct acpi_dmtable_info acpi_dm_table_info_spmi[]; | ||
176 | extern struct acpi_dmtable_info acpi_dm_table_info_srat[]; | ||
177 | extern struct acpi_dmtable_info acpi_dm_table_info_srat0[]; | ||
178 | extern struct acpi_dmtable_info acpi_dm_table_info_srat1[]; | ||
179 | extern struct acpi_dmtable_info acpi_dm_table_info_tcpa[]; | ||
180 | extern struct acpi_dmtable_info acpi_dm_table_info_wdrt[]; | ||
181 | |||
182 | /* | ||
183 | * dmtable | ||
184 | */ | ||
185 | void acpi_dm_dump_data_table(struct acpi_table_header *table); | ||
186 | |||
187 | void | ||
188 | acpi_dm_dump_table(u32 table_length, | ||
189 | u32 table_offset, | ||
190 | void *table, | ||
191 | u32 sub_table_length, struct acpi_dmtable_info *info); | ||
192 | |||
193 | void acpi_dm_line_header(u32 offset, u32 byte_length, char *name); | ||
194 | |||
195 | void acpi_dm_line_header2(u32 offset, u32 byte_length, char *name, u32 value); | ||
196 | |||
197 | /* | ||
198 | * dmtbdump | ||
199 | */ | ||
200 | void acpi_dm_dump_asf(struct acpi_table_header *table); | ||
201 | |||
202 | void acpi_dm_dump_cpep(struct acpi_table_header *table); | ||
203 | |||
204 | void acpi_dm_dump_fadt(struct acpi_table_header *table); | ||
205 | |||
206 | void acpi_dm_dump_srat(struct acpi_table_header *table); | ||
207 | |||
208 | void acpi_dm_dump_mcfg(struct acpi_table_header *table); | ||
209 | |||
210 | void acpi_dm_dump_madt(struct acpi_table_header *table); | ||
211 | |||
212 | u32 acpi_dm_dump_rsdp(struct acpi_table_header *table); | ||
213 | |||
214 | void acpi_dm_dump_rsdt(struct acpi_table_header *table); | ||
215 | |||
216 | void acpi_dm_dump_slit(struct acpi_table_header *table); | ||
217 | |||
218 | void acpi_dm_dump_xsdt(struct acpi_table_header *table); | ||
219 | |||
80 | /* | 220 | /* |
81 | * dmwalk | 221 | * dmwalk |
82 | */ | 222 | */ |
@@ -84,6 +224,11 @@ void | |||
84 | acpi_dm_disassemble(struct acpi_walk_state *walk_state, | 224 | acpi_dm_disassemble(struct acpi_walk_state *walk_state, |
85 | union acpi_parse_object *origin, u32 num_opcodes); | 225 | union acpi_parse_object *origin, u32 num_opcodes); |
86 | 226 | ||
227 | void | ||
228 | acpi_dm_walk_parse_tree(union acpi_parse_object *op, | ||
229 | asl_walk_callback descending_callback, | ||
230 | asl_walk_callback ascending_callback, void *context); | ||
231 | |||
87 | /* | 232 | /* |
88 | * dmopcode | 233 | * dmopcode |
89 | */ | 234 | */ |
@@ -166,6 +311,7 @@ void acpi_dm_dump_integer64(u64 value, char *name); | |||
166 | 311 | ||
167 | void | 312 | void |
168 | acpi_dm_resource_template(struct acpi_op_walk_info *info, | 313 | acpi_dm_resource_template(struct acpi_op_walk_info *info, |
314 | union acpi_parse_object *op, | ||
169 | u8 * byte_data, u32 byte_count); | 315 | u8 * byte_data, u32 byte_count); |
170 | 316 | ||
171 | u8 acpi_dm_is_resource_template(union acpi_parse_object *op); | 317 | u8 acpi_dm_is_resource_template(union acpi_parse_object *op); |
@@ -176,6 +322,8 @@ void acpi_dm_bit_list(u16 mask); | |||
176 | 322 | ||
177 | void acpi_dm_decode_attribute(u8 attribute); | 323 | void acpi_dm_decode_attribute(u8 attribute); |
178 | 324 | ||
325 | void acpi_dm_descriptor_name(void); | ||
326 | |||
179 | /* | 327 | /* |
180 | * dmresrcl | 328 | * dmresrcl |
181 | */ | 329 | */ |
@@ -248,6 +396,15 @@ acpi_dm_vendor_small_descriptor(union aml_resource *resource, | |||
248 | /* | 396 | /* |
249 | * dmutils | 397 | * dmutils |
250 | */ | 398 | */ |
251 | void acpi_dm_add_to_external_list(char *path); | 399 | void acpi_dm_add_to_external_list(char *path, u8 type, u32 value); |
400 | |||
401 | /* | ||
402 | * dmrestag | ||
403 | */ | ||
404 | void acpi_dm_find_resources(union acpi_parse_object *root); | ||
405 | |||
406 | void | ||
407 | acpi_dm_check_resource_reference(union acpi_parse_object *op, | ||
408 | struct acpi_walk_state *walk_state); | ||
252 | 409 | ||
253 | #endif /* __ACDISASM_H__ */ | 410 | #endif /* __ACDISASM_H__ */ |
diff --git a/include/acpi/acdispat.h b/include/acpi/acdispat.h index c41a926ff317..288f84903af7 100644 --- a/include/acpi/acdispat.h +++ b/include/acpi/acdispat.h | |||
@@ -194,7 +194,9 @@ acpi_status | |||
194 | acpi_ds_restart_control_method(struct acpi_walk_state *walk_state, | 194 | acpi_ds_restart_control_method(struct acpi_walk_state *walk_state, |
195 | union acpi_operand_object *return_desc); | 195 | union acpi_operand_object *return_desc); |
196 | 196 | ||
197 | void acpi_ds_terminate_control_method(struct acpi_walk_state *walk_state); | 197 | void |
198 | acpi_ds_terminate_control_method(union acpi_operand_object *method_desc, | ||
199 | struct acpi_walk_state *walk_state); | ||
198 | 200 | ||
199 | acpi_status | 201 | acpi_status |
200 | acpi_ds_begin_method_execution(struct acpi_namespace_node *method_node, | 202 | acpi_ds_begin_method_execution(struct acpi_namespace_node *method_node, |
@@ -302,7 +304,7 @@ acpi_ds_init_aml_walk(struct acpi_walk_state *walk_state, | |||
302 | struct acpi_namespace_node *method_node, | 304 | struct acpi_namespace_node *method_node, |
303 | u8 * aml_start, | 305 | u8 * aml_start, |
304 | u32 aml_length, | 306 | u32 aml_length, |
305 | struct acpi_parameter_info *info, u8 pass_number); | 307 | struct acpi_evaluate_info *info, u8 pass_number); |
306 | 308 | ||
307 | acpi_status | 309 | acpi_status |
308 | acpi_ds_obj_stack_pop_and_delete(u32 pop_count, | 310 | acpi_ds_obj_stack_pop_and_delete(u32 pop_count, |
diff --git a/include/acpi/acevents.h b/include/acpi/acevents.h index f2717be4fe0d..234142828e1a 100644 --- a/include/acpi/acevents.h +++ b/include/acpi/acevents.h | |||
@@ -93,7 +93,7 @@ struct acpi_gpe_event_info *acpi_ev_get_gpe_event_info(acpi_handle gpe_device, | |||
93 | */ | 93 | */ |
94 | u8 acpi_ev_valid_gpe_event(struct acpi_gpe_event_info *gpe_event_info); | 94 | u8 acpi_ev_valid_gpe_event(struct acpi_gpe_event_info *gpe_event_info); |
95 | 95 | ||
96 | acpi_status acpi_ev_walk_gpe_list(ACPI_GPE_CALLBACK gpe_walk_callback); | 96 | acpi_status acpi_ev_walk_gpe_list(acpi_gpe_callback gpe_walk_callback); |
97 | 97 | ||
98 | acpi_status | 98 | acpi_status |
99 | acpi_ev_delete_gpe_handlers(struct acpi_gpe_xrupt_info *gpe_xrupt_info, | 99 | acpi_ev_delete_gpe_handlers(struct acpi_gpe_xrupt_info *gpe_xrupt_info, |
@@ -138,7 +138,7 @@ acpi_status | |||
138 | acpi_ev_address_space_dispatch(union acpi_operand_object *region_obj, | 138 | acpi_ev_address_space_dispatch(union acpi_operand_object *region_obj, |
139 | u32 function, | 139 | u32 function, |
140 | acpi_physical_address address, | 140 | acpi_physical_address address, |
141 | u32 bit_width, void *value); | 141 | u32 bit_width, acpi_integer * value); |
142 | 142 | ||
143 | acpi_status | 143 | acpi_status |
144 | acpi_ev_attach_region(union acpi_operand_object *handler_obj, | 144 | acpi_ev_attach_region(union acpi_operand_object *handler_obj, |
diff --git a/include/acpi/acexcep.h b/include/acpi/acexcep.h index dc768aa580e4..797ca1ea5214 100644 --- a/include/acpi/acexcep.h +++ b/include/acpi/acexcep.h | |||
@@ -160,8 +160,9 @@ | |||
160 | #define AE_AML_BAD_RESOURCE_VALUE (acpi_status) (0x001F | AE_CODE_AML) | 160 | #define AE_AML_BAD_RESOURCE_VALUE (acpi_status) (0x001F | AE_CODE_AML) |
161 | #define AE_AML_CIRCULAR_REFERENCE (acpi_status) (0x0020 | AE_CODE_AML) | 161 | #define AE_AML_CIRCULAR_REFERENCE (acpi_status) (0x0020 | AE_CODE_AML) |
162 | #define AE_AML_BAD_RESOURCE_LENGTH (acpi_status) (0x0021 | AE_CODE_AML) | 162 | #define AE_AML_BAD_RESOURCE_LENGTH (acpi_status) (0x0021 | AE_CODE_AML) |
163 | #define AE_AML_ILLEGAL_ADDRESS (acpi_status) (0x0022 | AE_CODE_AML) | ||
163 | 164 | ||
164 | #define AE_CODE_AML_MAX 0x0021 | 165 | #define AE_CODE_AML_MAX 0x0022 |
165 | 166 | ||
166 | /* | 167 | /* |
167 | * Internal exceptions used for control | 168 | * Internal exceptions used for control |
@@ -275,7 +276,8 @@ char const *acpi_gbl_exception_names_aml[] = { | |||
275 | "AE_AML_NO_RESOURCE_END_TAG", | 276 | "AE_AML_NO_RESOURCE_END_TAG", |
276 | "AE_AML_BAD_RESOURCE_VALUE", | 277 | "AE_AML_BAD_RESOURCE_VALUE", |
277 | "AE_AML_CIRCULAR_REFERENCE", | 278 | "AE_AML_CIRCULAR_REFERENCE", |
278 | "AE_AML_BAD_RESOURCE_LENGTH" | 279 | "AE_AML_BAD_RESOURCE_LENGTH", |
280 | "AE_AML_ILLEGAL_ADDRESS" | ||
279 | }; | 281 | }; |
280 | 282 | ||
281 | char const *acpi_gbl_exception_names_ctrl[] = { | 283 | char const *acpi_gbl_exception_names_ctrl[] = { |
diff --git a/include/acpi/acglobal.h b/include/acpi/acglobal.h index 734cc77bf2c7..14531d48f6b6 100644 --- a/include/acpi/acglobal.h +++ b/include/acpi/acglobal.h | |||
@@ -107,6 +107,7 @@ ACPI_EXTERN u32 acpi_gbl_trace_flags; | |||
107 | * 3) Allow access to uninitialized locals/args (auto-init to integer 0) | 107 | * 3) Allow access to uninitialized locals/args (auto-init to integer 0) |
108 | * 4) Allow ANY object type to be a source operand for the Store() operator | 108 | * 4) Allow ANY object type to be a source operand for the Store() operator |
109 | * 5) Allow unresolved references (invalid target name) in package objects | 109 | * 5) Allow unresolved references (invalid target name) in package objects |
110 | * 6) Enable warning messages for behavior that is not ACPI spec compliant | ||
110 | */ | 111 | */ |
111 | ACPI_EXTERN u8 ACPI_INIT_GLOBAL(acpi_gbl_enable_interpreter_slack, FALSE); | 112 | ACPI_EXTERN u8 ACPI_INIT_GLOBAL(acpi_gbl_enable_interpreter_slack, FALSE); |
112 | 113 | ||
@@ -114,7 +115,7 @@ ACPI_EXTERN u8 ACPI_INIT_GLOBAL(acpi_gbl_enable_interpreter_slack, FALSE); | |||
114 | * Automatically serialize ALL control methods? Default is FALSE, meaning | 115 | * Automatically serialize ALL control methods? Default is FALSE, meaning |
115 | * to use the Serialized/not_serialized method flags on a per method basis. | 116 | * to use the Serialized/not_serialized method flags on a per method basis. |
116 | * Only change this if the ASL code is poorly written and cannot handle | 117 | * Only change this if the ASL code is poorly written and cannot handle |
117 | * reentrancy even though methods are marked "not_serialized". | 118 | * reentrancy even though methods are marked "NotSerialized". |
118 | */ | 119 | */ |
119 | ACPI_EXTERN u8 ACPI_INIT_GLOBAL(acpi_gbl_all_methods_serialized, FALSE); | 120 | ACPI_EXTERN u8 ACPI_INIT_GLOBAL(acpi_gbl_all_methods_serialized, FALSE); |
120 | 121 | ||
@@ -149,10 +150,10 @@ ACPI_EXTERN u8 ACPI_INIT_GLOBAL(acpi_gbl_leave_wake_gpes_disabled, TRUE); | |||
149 | ACPI_EXTERN u32 acpi_gbl_table_flags; | 150 | ACPI_EXTERN u32 acpi_gbl_table_flags; |
150 | ACPI_EXTERN u32 acpi_gbl_rsdt_table_count; | 151 | ACPI_EXTERN u32 acpi_gbl_rsdt_table_count; |
151 | ACPI_EXTERN struct rsdp_descriptor *acpi_gbl_RSDP; | 152 | ACPI_EXTERN struct rsdp_descriptor *acpi_gbl_RSDP; |
152 | ACPI_EXTERN XSDT_DESCRIPTOR *acpi_gbl_XSDT; | 153 | ACPI_EXTERN struct xsdt_descriptor *acpi_gbl_XSDT; |
153 | ACPI_EXTERN FADT_DESCRIPTOR *acpi_gbl_FADT; | 154 | ACPI_EXTERN struct fadt_descriptor *acpi_gbl_FADT; |
154 | ACPI_EXTERN struct acpi_table_header *acpi_gbl_DSDT; | 155 | ACPI_EXTERN struct acpi_table_header *acpi_gbl_DSDT; |
155 | ACPI_EXTERN FACS_DESCRIPTOR *acpi_gbl_FACS; | 156 | ACPI_EXTERN struct facs_descriptor *acpi_gbl_FACS; |
156 | ACPI_EXTERN struct acpi_common_facs acpi_gbl_common_fACS; | 157 | ACPI_EXTERN struct acpi_common_facs acpi_gbl_common_fACS; |
157 | /* | 158 | /* |
158 | * Since there may be multiple SSDTs and PSDTs, a single pointer is not | 159 | * Since there may be multiple SSDTs and PSDTs, a single pointer is not |
@@ -177,15 +178,15 @@ ACPI_EXTERN u8 acpi_gbl_integer_nybble_width; | |||
177 | /* | 178 | /* |
178 | * ACPI Table info arrays | 179 | * ACPI Table info arrays |
179 | */ | 180 | */ |
180 | extern struct acpi_table_list acpi_gbl_table_lists[NUM_ACPI_TABLE_TYPES]; | 181 | extern struct acpi_table_list acpi_gbl_table_lists[ACPI_TABLE_ID_MAX + 1]; |
181 | extern struct acpi_table_support acpi_gbl_table_data[NUM_ACPI_TABLE_TYPES]; | 182 | extern struct acpi_table_support acpi_gbl_table_data[ACPI_TABLE_ID_MAX + 1]; |
182 | 183 | ||
183 | /* | 184 | /* |
184 | * Predefined mutex objects. This array contains the | 185 | * Predefined mutex objects. This array contains the |
185 | * actual OS mutex handles, indexed by the local ACPI_MUTEX_HANDLEs. | 186 | * actual OS mutex handles, indexed by the local ACPI_MUTEX_HANDLEs. |
186 | * (The table maps local handles to the real OS handles) | 187 | * (The table maps local handles to the real OS handles) |
187 | */ | 188 | */ |
188 | ACPI_EXTERN struct acpi_mutex_info acpi_gbl_mutex_info[NUM_MUTEX]; | 189 | ACPI_EXTERN struct acpi_mutex_info acpi_gbl_mutex_info[ACPI_NUM_MUTEX]; |
189 | 190 | ||
190 | /***************************************************************************** | 191 | /***************************************************************************** |
191 | * | 192 | * |
@@ -203,6 +204,7 @@ ACPI_EXTERN struct acpi_memory_list *acpi_gbl_ns_node_list; | |||
203 | 204 | ||
204 | /* Object caches */ | 205 | /* Object caches */ |
205 | 206 | ||
207 | ACPI_EXTERN acpi_cache_t *acpi_gbl_namespace_cache; | ||
206 | ACPI_EXTERN acpi_cache_t *acpi_gbl_state_cache; | 208 | ACPI_EXTERN acpi_cache_t *acpi_gbl_state_cache; |
207 | ACPI_EXTERN acpi_cache_t *acpi_gbl_ps_node_cache; | 209 | ACPI_EXTERN acpi_cache_t *acpi_gbl_ps_node_cache; |
208 | ACPI_EXTERN acpi_cache_t *acpi_gbl_ps_node_ext_cache; | 210 | ACPI_EXTERN acpi_cache_t *acpi_gbl_ps_node_ext_cache; |
@@ -244,7 +246,6 @@ extern const char *acpi_gbl_sleep_state_names[ACPI_S_STATE_COUNT]; | |||
244 | extern const char *acpi_gbl_highest_dstate_names[4]; | 246 | extern const char *acpi_gbl_highest_dstate_names[4]; |
245 | extern const struct acpi_opcode_info acpi_gbl_aml_op_info[AML_NUM_OPCODES]; | 247 | extern const struct acpi_opcode_info acpi_gbl_aml_op_info[AML_NUM_OPCODES]; |
246 | extern const char *acpi_gbl_region_types[ACPI_NUM_PREDEFINED_REGIONS]; | 248 | extern const char *acpi_gbl_region_types[ACPI_NUM_PREDEFINED_REGIONS]; |
247 | extern const char *acpi_gbl_valid_osi_strings[ACPI_NUM_OSI_STRINGS]; | ||
248 | 249 | ||
249 | /***************************************************************************** | 250 | /***************************************************************************** |
250 | * | 251 | * |
@@ -291,14 +292,6 @@ ACPI_EXTERN u8 acpi_gbl_cm_single_step; | |||
291 | 292 | ||
292 | /***************************************************************************** | 293 | /***************************************************************************** |
293 | * | 294 | * |
294 | * Parser globals | ||
295 | * | ||
296 | ****************************************************************************/ | ||
297 | |||
298 | ACPI_EXTERN union acpi_parse_object *acpi_gbl_parsed_namespace_root; | ||
299 | |||
300 | /***************************************************************************** | ||
301 | * | ||
302 | * Hardware globals | 295 | * Hardware globals |
303 | * | 296 | * |
304 | ****************************************************************************/ | 297 | ****************************************************************************/ |
@@ -321,7 +314,11 @@ ACPI_EXTERN struct acpi_fixed_event_handler | |||
321 | ACPI_EXTERN struct acpi_gpe_xrupt_info *acpi_gbl_gpe_xrupt_list_head; | 314 | ACPI_EXTERN struct acpi_gpe_xrupt_info *acpi_gbl_gpe_xrupt_list_head; |
322 | ACPI_EXTERN struct acpi_gpe_block_info | 315 | ACPI_EXTERN struct acpi_gpe_block_info |
323 | *acpi_gbl_gpe_fadt_blocks[ACPI_MAX_GPE_BLOCKS]; | 316 | *acpi_gbl_gpe_fadt_blocks[ACPI_MAX_GPE_BLOCKS]; |
317 | |||
318 | /* Spinlocks */ | ||
319 | |||
324 | ACPI_EXTERN acpi_handle acpi_gbl_gpe_lock; | 320 | ACPI_EXTERN acpi_handle acpi_gbl_gpe_lock; |
321 | ACPI_EXTERN acpi_handle acpi_gbl_hardware_lock; | ||
325 | 322 | ||
326 | /***************************************************************************** | 323 | /***************************************************************************** |
327 | * | 324 | * |
diff --git a/include/acpi/aclocal.h b/include/acpi/aclocal.h index 8361820d2970..1eeca7adca95 100644 --- a/include/acpi/aclocal.h +++ b/include/acpi/aclocal.h | |||
@@ -44,7 +44,10 @@ | |||
44 | #ifndef __ACLOCAL_H__ | 44 | #ifndef __ACLOCAL_H__ |
45 | #define __ACLOCAL_H__ | 45 | #define __ACLOCAL_H__ |
46 | 46 | ||
47 | /* acpisrc:struct_defs -- for acpisrc conversion */ | ||
48 | |||
47 | #define ACPI_WAIT_FOREVER 0xFFFF /* u16, as per ACPI spec */ | 49 | #define ACPI_WAIT_FOREVER 0xFFFF /* u16, as per ACPI spec */ |
50 | #define ACPI_INFINITE_CONCURRENCY 0xFF | ||
48 | 51 | ||
49 | typedef void *acpi_mutex; | 52 | typedef void *acpi_mutex; |
50 | typedef u32 acpi_mutex_handle; | 53 | typedef u32 acpi_mutex_handle; |
@@ -69,52 +72,55 @@ union acpi_parse_object; | |||
69 | * Predefined handles for the mutex objects used within the subsystem | 72 | * Predefined handles for the mutex objects used within the subsystem |
70 | * All mutex objects are automatically created by acpi_ut_mutex_initialize. | 73 | * All mutex objects are automatically created by acpi_ut_mutex_initialize. |
71 | * | 74 | * |
72 | * The acquire/release ordering protocol is implied via this list. Mutexes | 75 | * The acquire/release ordering protocol is implied via this list. Mutexes |
73 | * with a lower value must be acquired before mutexes with a higher value. | 76 | * with a lower value must be acquired before mutexes with a higher value. |
74 | * | 77 | * |
75 | * NOTE: any changes here must be reflected in the acpi_gbl_mutex_names table also! | 78 | * NOTE: any changes here must be reflected in the acpi_gbl_mutex_names |
79 | * table below also! | ||
76 | */ | 80 | */ |
77 | #define ACPI_MTX_EXECUTE 0 | 81 | #define ACPI_MTX_INTERPRETER 0 /* AML Interpreter, main lock */ |
78 | #define ACPI_MTX_INTERPRETER 1 | 82 | #define ACPI_MTX_CONTROL_METHOD 1 /* Control method termination [TBD: may no longer be necessary] */ |
79 | #define ACPI_MTX_PARSER 2 | 83 | #define ACPI_MTX_TABLES 2 /* Data for ACPI tables */ |
80 | #define ACPI_MTX_DISPATCHER 3 | 84 | #define ACPI_MTX_NAMESPACE 3 /* ACPI Namespace */ |
81 | #define ACPI_MTX_TABLES 4 | 85 | #define ACPI_MTX_EVENTS 4 /* Data for ACPI events */ |
82 | #define ACPI_MTX_OP_REGIONS 5 | 86 | #define ACPI_MTX_CACHES 5 /* Internal caches, general purposes */ |
83 | #define ACPI_MTX_NAMESPACE 6 | 87 | #define ACPI_MTX_MEMORY 6 /* Debug memory tracking lists */ |
84 | #define ACPI_MTX_EVENTS 7 | 88 | #define ACPI_MTX_DEBUG_CMD_COMPLETE 7 /* AML debugger */ |
85 | #define ACPI_MTX_HARDWARE 8 | 89 | #define ACPI_MTX_DEBUG_CMD_READY 8 /* AML debugger */ |
86 | #define ACPI_MTX_CACHES 9 | 90 | |
87 | #define ACPI_MTX_MEMORY 10 | 91 | #define ACPI_MAX_MUTEX 8 |
88 | #define ACPI_MTX_DEBUG_CMD_COMPLETE 11 | 92 | #define ACPI_NUM_MUTEX ACPI_MAX_MUTEX+1 |
89 | #define ACPI_MTX_DEBUG_CMD_READY 12 | ||
90 | |||
91 | #define MAX_MUTEX 12 | ||
92 | #define NUM_MUTEX MAX_MUTEX+1 | ||
93 | 93 | ||
94 | #if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER) | 94 | #if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER) |
95 | #ifdef DEFINE_ACPI_GLOBALS | 95 | #ifdef DEFINE_ACPI_GLOBALS |
96 | 96 | ||
97 | /* Names for the mutexes used in the subsystem */ | 97 | /* Debug names for the mutexes above */ |
98 | 98 | ||
99 | static char *acpi_gbl_mutex_names[] = { | 99 | static char *acpi_gbl_mutex_names[ACPI_NUM_MUTEX] = { |
100 | "ACPI_MTX_Execute", | ||
101 | "ACPI_MTX_Interpreter", | 100 | "ACPI_MTX_Interpreter", |
102 | "ACPI_MTX_Parser", | 101 | "ACPI_MTX_Method", |
103 | "ACPI_MTX_Dispatcher", | ||
104 | "ACPI_MTX_Tables", | 102 | "ACPI_MTX_Tables", |
105 | "ACPI_MTX_op_regions", | ||
106 | "ACPI_MTX_Namespace", | 103 | "ACPI_MTX_Namespace", |
107 | "ACPI_MTX_Events", | 104 | "ACPI_MTX_Events", |
108 | "ACPI_MTX_Hardware", | ||
109 | "ACPI_MTX_Caches", | 105 | "ACPI_MTX_Caches", |
110 | "ACPI_MTX_Memory", | 106 | "ACPI_MTX_Memory", |
111 | "ACPI_MTX_debug_cmd_complete", | 107 | "ACPI_MTX_DebugCmdComplete", |
112 | "ACPI_MTX_debug_cmd_ready", | 108 | "ACPI_MTX_DebugCmdReady" |
113 | }; | 109 | }; |
114 | 110 | ||
115 | #endif | 111 | #endif |
116 | #endif | 112 | #endif |
117 | 113 | ||
114 | /* | ||
115 | * Predefined handles for spinlocks used within the subsystem. | ||
116 | * These spinlocks are created by acpi_ut_mutex_initialize | ||
117 | */ | ||
118 | #define ACPI_LOCK_GPES 0 | ||
119 | #define ACPI_LOCK_HARDWARE 1 | ||
120 | |||
121 | #define ACPI_MAX_LOCK 1 | ||
122 | #define ACPI_NUM_LOCK ACPI_MAX_LOCK+1 | ||
123 | |||
118 | /* Owner IDs are used to track namespace nodes for selective deletion */ | 124 | /* Owner IDs are used to track namespace nodes for selective deletion */ |
119 | 125 | ||
120 | typedef u8 acpi_owner_id; | 126 | typedef u8 acpi_owner_id; |
@@ -129,7 +135,7 @@ typedef u8 acpi_owner_id; | |||
129 | struct acpi_mutex_info { | 135 | struct acpi_mutex_info { |
130 | acpi_mutex mutex; | 136 | acpi_mutex mutex; |
131 | u32 use_count; | 137 | u32 use_count; |
132 | u32 thread_id; | 138 | acpi_thread_id thread_id; |
133 | }; | 139 | }; |
134 | 140 | ||
135 | /* Lock flag parameter for various interfaces */ | 141 | /* Lock flag parameter for various interfaces */ |
@@ -144,6 +150,8 @@ struct acpi_mutex_info { | |||
144 | #define ACPI_FIELD_DWORD_GRANULARITY 4 | 150 | #define ACPI_FIELD_DWORD_GRANULARITY 4 |
145 | #define ACPI_FIELD_QWORD_GRANULARITY 8 | 151 | #define ACPI_FIELD_QWORD_GRANULARITY 8 |
146 | 152 | ||
153 | #define ACPI_ENTRY_NOT_FOUND NULL | ||
154 | |||
147 | /***************************************************************************** | 155 | /***************************************************************************** |
148 | * | 156 | * |
149 | * Namespace typedefs and structs | 157 | * Namespace typedefs and structs |
@@ -158,49 +166,55 @@ typedef enum { | |||
158 | ACPI_IMODE_EXECUTE = 0x0E | 166 | ACPI_IMODE_EXECUTE = 0x0E |
159 | } acpi_interpreter_mode; | 167 | } acpi_interpreter_mode; |
160 | 168 | ||
161 | /* | ||
162 | * The Node describes a named object that appears in the AML | ||
163 | * An acpi_node is used to store Nodes. | ||
164 | * | ||
165 | * data_type is used to differentiate between internal descriptors, and MUST | ||
166 | * be the first byte in this structure. | ||
167 | */ | ||
168 | union acpi_name_union { | 169 | union acpi_name_union { |
169 | u32 integer; | 170 | u32 integer; |
170 | char ascii[4]; | 171 | char ascii[4]; |
171 | }; | 172 | }; |
172 | 173 | ||
174 | /* | ||
175 | * The Namespace Node describes a named object that appears in the AML. | ||
176 | * descriptor_type is used to differentiate between internal descriptors. | ||
177 | * | ||
178 | * The node is optimized for both 32-bit and 64-bit platforms: | ||
179 | * 20 bytes for the 32-bit case, 32 bytes for the 64-bit case. | ||
180 | * | ||
181 | * Note: The descriptor_type and Type fields must appear in the identical | ||
182 | * position in both the struct acpi_namespace_node and union acpi_operand_object | ||
183 | * structures. | ||
184 | */ | ||
173 | struct acpi_namespace_node { | 185 | struct acpi_namespace_node { |
174 | u8 descriptor; /* Used to differentiate object descriptor types */ | 186 | union acpi_operand_object *object; /* Interpreter object */ |
175 | u8 type; /* Type associated with this name */ | 187 | u8 descriptor_type; /* Differentiate object descriptor types */ |
176 | u16 reference_count; /* Current count of references and children */ | 188 | u8 type; /* ACPI Type associated with this name */ |
189 | u8 flags; /* Miscellaneous flags */ | ||
190 | acpi_owner_id owner_id; /* Node creator */ | ||
177 | union acpi_name_union name; /* ACPI Name, always 4 chars per ACPI spec */ | 191 | union acpi_name_union name; /* ACPI Name, always 4 chars per ACPI spec */ |
178 | union acpi_operand_object *object; /* Pointer to attached ACPI object (optional) */ | ||
179 | struct acpi_namespace_node *child; /* First child */ | 192 | struct acpi_namespace_node *child; /* First child */ |
180 | struct acpi_namespace_node *peer; /* Next peer */ | 193 | struct acpi_namespace_node *peer; /* Peer. Parent if ANOBJ_END_OF_PEER_LIST set */ |
181 | u8 owner_id; /* Who created this node */ | ||
182 | u8 flags; | ||
183 | |||
184 | /* Fields used by the ASL compiler only */ | ||
185 | 194 | ||
186 | #ifdef ACPI_ASL_COMPILER | 195 | /* |
187 | u32 value; | 196 | * The following fields are used by the ASL compiler and disassembler only |
197 | */ | ||
198 | #ifdef ACPI_LARGE_NAMESPACE_NODE | ||
188 | union acpi_parse_object *op; | 199 | union acpi_parse_object *op; |
200 | u32 value; | ||
201 | u32 length; | ||
189 | #endif | 202 | #endif |
190 | }; | 203 | }; |
191 | 204 | ||
192 | #define ACPI_ENTRY_NOT_FOUND NULL | 205 | /* Namespace Node flags */ |
193 | 206 | ||
194 | /* Node flags */ | 207 | #define ANOBJ_END_OF_PEER_LIST 0x01 /* End-of-list, Peer field points to parent */ |
208 | #define ANOBJ_DATA_WIDTH_32 0x02 /* Parent table uses 32-bit math */ | ||
209 | #define ANOBJ_METHOD_ARG 0x04 /* Node is a method argument */ | ||
210 | #define ANOBJ_METHOD_LOCAL 0x08 /* Node is a method local */ | ||
211 | #define ANOBJ_SUBTREE_HAS_INI 0x10 /* Used to optimize device initialization */ | ||
195 | 212 | ||
196 | #define ANOBJ_RESERVED 0x01 | 213 | #define ANOBJ_IS_EXTERNAL 0x08 /* i_aSL only: This object created via External() */ |
197 | #define ANOBJ_END_OF_PEER_LIST 0x02 | 214 | #define ANOBJ_METHOD_NO_RETVAL 0x10 /* i_aSL only: Method has no return value */ |
198 | #define ANOBJ_DATA_WIDTH_32 0x04 /* Parent table is 64-bits */ | 215 | #define ANOBJ_METHOD_SOME_NO_RETVAL 0x20 /* i_aSL only: Method has at least one return value */ |
199 | #define ANOBJ_METHOD_ARG 0x08 | 216 | #define ANOBJ_IS_BIT_OFFSET 0x40 /* i_aSL only: Reference is a bit offset */ |
200 | #define ANOBJ_METHOD_LOCAL 0x10 | 217 | #define ANOBJ_IS_REFERENCED 0x80 /* i_aSL only: Object was referenced */ |
201 | #define ANOBJ_METHOD_NO_RETVAL 0x20 | ||
202 | #define ANOBJ_METHOD_SOME_NO_RETVAL 0x40 | ||
203 | #define ANOBJ_IS_BIT_OFFSET 0x80 | ||
204 | 218 | ||
205 | /* | 219 | /* |
206 | * ACPI Table Descriptor. One per ACPI table | 220 | * ACPI Table Descriptor. One per ACPI table |
@@ -212,8 +226,8 @@ struct acpi_table_desc { | |||
212 | struct acpi_table_header *pointer; | 226 | struct acpi_table_header *pointer; |
213 | u8 *aml_start; | 227 | u8 *aml_start; |
214 | u64 physical_address; | 228 | u64 physical_address; |
215 | u32 aml_length; | ||
216 | acpi_size length; | 229 | acpi_size length; |
230 | u32 aml_length; | ||
217 | acpi_owner_id owner_id; | 231 | acpi_owner_id owner_id; |
218 | u8 type; | 232 | u8 type; |
219 | u8 allocation; | 233 | u8 allocation; |
@@ -276,6 +290,9 @@ struct acpi_create_field_info { | |||
276 | u8 field_type; | 290 | u8 field_type; |
277 | }; | 291 | }; |
278 | 292 | ||
293 | typedef | ||
294 | acpi_status(*ACPI_INTERNAL_METHOD) (struct acpi_walk_state * walk_state); | ||
295 | |||
279 | /* | 296 | /* |
280 | * Bitmapped ACPI types. Used internally only | 297 | * Bitmapped ACPI types. Used internally only |
281 | */ | 298 | */ |
@@ -377,7 +394,7 @@ struct acpi_gpe_walk_info { | |||
377 | struct acpi_gpe_block_info *gpe_block; | 394 | struct acpi_gpe_block_info *gpe_block; |
378 | }; | 395 | }; |
379 | 396 | ||
380 | typedef acpi_status(*ACPI_GPE_CALLBACK) (struct acpi_gpe_xrupt_info * | 397 | typedef acpi_status(*acpi_gpe_callback) (struct acpi_gpe_xrupt_info * |
381 | gpe_xrupt_info, | 398 | gpe_xrupt_info, |
382 | struct acpi_gpe_block_info * | 399 | struct acpi_gpe_block_info * |
383 | gpe_block); | 400 | gpe_block); |
@@ -416,13 +433,14 @@ struct acpi_field_info { | |||
416 | #define ACPI_CONTROL_PREDICATE_FALSE 0xC3 | 433 | #define ACPI_CONTROL_PREDICATE_FALSE 0xC3 |
417 | #define ACPI_CONTROL_PREDICATE_TRUE 0xC4 | 434 | #define ACPI_CONTROL_PREDICATE_TRUE 0xC4 |
418 | 435 | ||
419 | #define ACPI_STATE_COMMON /* Two 32-bit fields and a pointer */\ | 436 | #define ACPI_STATE_COMMON \ |
420 | u8 data_type; /* To differentiate various internal objs */\ | 437 | void *next; \ |
421 | u8 flags; \ | 438 | u8 descriptor_type; /* To differentiate various internal objs */\ |
422 | u16 value; \ | 439 | u8 flags; \ |
423 | u16 state; \ | 440 | u16 value; \ |
424 | u16 reserved; \ | 441 | u16 state; |
425 | void *next; | 442 | |
443 | /* There are 2 bytes available here until the next natural alignment boundary */ | ||
426 | 444 | ||
427 | struct acpi_common_state { | 445 | struct acpi_common_state { |
428 | ACPI_STATE_COMMON}; | 446 | ACPI_STATE_COMMON}; |
@@ -438,12 +456,12 @@ struct acpi_update_state { | |||
438 | * Pkg state - used to traverse nested package structures | 456 | * Pkg state - used to traverse nested package structures |
439 | */ | 457 | */ |
440 | struct acpi_pkg_state { | 458 | struct acpi_pkg_state { |
441 | ACPI_STATE_COMMON union acpi_operand_object *source_object; | 459 | ACPI_STATE_COMMON u16 index; |
460 | union acpi_operand_object *source_object; | ||
442 | union acpi_operand_object *dest_object; | 461 | union acpi_operand_object *dest_object; |
443 | struct acpi_walk_state *walk_state; | 462 | struct acpi_walk_state *walk_state; |
444 | void *this_target_obj; | 463 | void *this_target_obj; |
445 | u32 num_packages; | 464 | u32 num_packages; |
446 | u16 index; | ||
447 | }; | 465 | }; |
448 | 466 | ||
449 | /* | 467 | /* |
@@ -451,10 +469,10 @@ struct acpi_pkg_state { | |||
451 | * Allows nesting of these constructs | 469 | * Allows nesting of these constructs |
452 | */ | 470 | */ |
453 | struct acpi_control_state { | 471 | struct acpi_control_state { |
454 | ACPI_STATE_COMMON union acpi_parse_object *predicate_op; | 472 | ACPI_STATE_COMMON u16 opcode; |
473 | union acpi_parse_object *predicate_op; | ||
455 | u8 *aml_predicate_start; /* Start of if/while predicate */ | 474 | u8 *aml_predicate_start; /* Start of if/while predicate */ |
456 | u8 *package_end; /* End of if/while block */ | 475 | u8 *package_end; /* End of if/while block */ |
457 | u16 opcode; | ||
458 | }; | 476 | }; |
459 | 477 | ||
460 | /* | 478 | /* |
@@ -465,11 +483,11 @@ struct acpi_scope_state { | |||
465 | }; | 483 | }; |
466 | 484 | ||
467 | struct acpi_pscope_state { | 485 | struct acpi_pscope_state { |
468 | ACPI_STATE_COMMON union acpi_parse_object *op; /* Current op being parsed */ | 486 | ACPI_STATE_COMMON u32 arg_count; /* Number of fixed arguments */ |
487 | union acpi_parse_object *op; /* Current op being parsed */ | ||
469 | u8 *arg_end; /* Current argument end */ | 488 | u8 *arg_end; /* Current argument end */ |
470 | u8 *pkg_end; /* Current package end */ | 489 | u8 *pkg_end; /* Current package end */ |
471 | u32 arg_list; /* Next argument to parse */ | 490 | u32 arg_list; /* Next argument to parse */ |
472 | u32 arg_count; /* Number of fixed arguments */ | ||
473 | }; | 491 | }; |
474 | 492 | ||
475 | /* | 493 | /* |
@@ -477,10 +495,10 @@ struct acpi_pscope_state { | |||
477 | * states are created when there are nested control methods executing. | 495 | * states are created when there are nested control methods executing. |
478 | */ | 496 | */ |
479 | struct acpi_thread_state { | 497 | struct acpi_thread_state { |
480 | ACPI_STATE_COMMON struct acpi_walk_state *walk_state_list; /* Head of list of walk_states for this thread */ | 498 | ACPI_STATE_COMMON u8 current_sync_level; /* Mutex Sync (nested acquire) level */ |
499 | struct acpi_walk_state *walk_state_list; /* Head of list of walk_states for this thread */ | ||
481 | union acpi_operand_object *acquired_mutex_list; /* List of all currently acquired mutexes */ | 500 | union acpi_operand_object *acquired_mutex_list; /* List of all currently acquired mutexes */ |
482 | u32 thread_id; /* Running thread ID */ | 501 | acpi_thread_id thread_id; /* Running thread ID */ |
483 | u8 current_sync_level; /* Mutex Sync (nested acquire) level */ | ||
484 | }; | 502 | }; |
485 | 503 | ||
486 | /* | 504 | /* |
@@ -488,10 +506,9 @@ struct acpi_thread_state { | |||
488 | * AML arguments | 506 | * AML arguments |
489 | */ | 507 | */ |
490 | struct acpi_result_values { | 508 | struct acpi_result_values { |
491 | ACPI_STATE_COMMON | 509 | ACPI_STATE_COMMON u8 num_results; |
492 | union acpi_operand_object *obj_desc[ACPI_OBJ_NUM_OPERANDS]; | ||
493 | u8 num_results; | ||
494 | u8 last_insert; | 510 | u8 last_insert; |
511 | union acpi_operand_object *obj_desc[ACPI_OBJ_NUM_OPERANDS]; | ||
495 | }; | 512 | }; |
496 | 513 | ||
497 | typedef | 514 | typedef |
@@ -546,7 +563,7 @@ struct acpi_opcode_info { | |||
546 | #endif | 563 | #endif |
547 | u32 parse_args; /* Grammar/Parse time arguments */ | 564 | u32 parse_args; /* Grammar/Parse time arguments */ |
548 | u32 runtime_args; /* Interpret time arguments */ | 565 | u32 runtime_args; /* Interpret time arguments */ |
549 | u32 flags; /* Misc flags */ | 566 | u16 flags; /* Misc flags */ |
550 | u8 object_type; /* Corresponding internal object type */ | 567 | u8 object_type; /* Corresponding internal object type */ |
551 | u8 class; /* Opcode class */ | 568 | u8 class; /* Opcode class */ |
552 | u8 type; /* Opcode type */ | 569 | u8 type; /* Opcode type */ |
@@ -563,29 +580,31 @@ union acpi_parse_value { | |||
563 | }; | 580 | }; |
564 | 581 | ||
565 | #define ACPI_PARSE_COMMON \ | 582 | #define ACPI_PARSE_COMMON \ |
566 | u8 data_type; /* To differentiate various internal objs */\ | 583 | union acpi_parse_object *parent; /* Parent op */\ |
567 | u8 flags; /* Type of Op */\ | 584 | u8 descriptor_type; /* To differentiate various internal objs */\ |
568 | u16 aml_opcode; /* AML opcode */\ | 585 | u8 flags; /* Type of Op */\ |
569 | u32 aml_offset; /* Offset of declaration in AML */\ | 586 | u16 aml_opcode; /* AML opcode */\ |
570 | union acpi_parse_object *parent; /* Parent op */\ | 587 | u32 aml_offset; /* Offset of declaration in AML */\ |
571 | union acpi_parse_object *next; /* Next op */\ | 588 | union acpi_parse_object *next; /* Next op */\ |
589 | struct acpi_namespace_node *node; /* For use by interpreter */\ | ||
590 | union acpi_parse_value value; /* Value or args associated with the opcode */\ | ||
572 | ACPI_DISASM_ONLY_MEMBERS (\ | 591 | ACPI_DISASM_ONLY_MEMBERS (\ |
573 | u8 disasm_flags; /* Used during AML disassembly */\ | 592 | u8 disasm_flags; /* Used during AML disassembly */\ |
574 | u8 disasm_opcode; /* Subtype used for disassembly */\ | 593 | u8 disasm_opcode; /* Subtype used for disassembly */\ |
575 | char aml_op_name[16]) /* Op name (debug only) */\ | 594 | char aml_op_name[16]) /* Op name (debug only) */ |
576 | /* NON-DEBUG members below: */\ | 595 | |
577 | struct acpi_namespace_node *node; /* For use by interpreter */\ | 596 | #define ACPI_DASM_BUFFER 0x00 |
578 | union acpi_parse_value value; /* Value or args associated with the opcode */ | 597 | #define ACPI_DASM_RESOURCE 0x01 |
579 | 598 | #define ACPI_DASM_STRING 0x02 | |
580 | #define ACPI_DASM_BUFFER 0x00 | 599 | #define ACPI_DASM_UNICODE 0x03 |
581 | #define ACPI_DASM_RESOURCE 0x01 | 600 | #define ACPI_DASM_EISAID 0x04 |
582 | #define ACPI_DASM_STRING 0x02 | 601 | #define ACPI_DASM_MATCHOP 0x05 |
583 | #define ACPI_DASM_UNICODE 0x03 | 602 | #define ACPI_DASM_LNOT_PREFIX 0x06 |
584 | #define ACPI_DASM_EISAID 0x04 | 603 | #define ACPI_DASM_LNOT_SUFFIX 0x07 |
585 | #define ACPI_DASM_MATCHOP 0x05 | 604 | #define ACPI_DASM_IGNORE 0x08 |
586 | 605 | ||
587 | /* | 606 | /* |
588 | * generic operation (for example: If, While, Store) | 607 | * Generic operation (for example: If, While, Store) |
589 | */ | 608 | */ |
590 | struct acpi_parse_obj_common { | 609 | struct acpi_parse_obj_common { |
591 | ACPI_PARSE_COMMON}; | 610 | ACPI_PARSE_COMMON}; |
@@ -601,7 +620,7 @@ struct acpi_parse_obj_named { | |||
601 | u32 name; /* 4-byte name or zero if no name */ | 620 | u32 name; /* 4-byte name or zero if no name */ |
602 | }; | 621 | }; |
603 | 622 | ||
604 | /* The parse node is the fundamental element of the parse tree */ | 623 | /* This version is used by the i_aSL compiler only */ |
605 | 624 | ||
606 | #define ACPI_MAX_PARSEOP_NAME 20 | 625 | #define ACPI_MAX_PARSEOP_NAME 20 |
607 | 626 | ||
@@ -643,7 +662,6 @@ union acpi_parse_object { | |||
643 | * method. | 662 | * method. |
644 | */ | 663 | */ |
645 | struct acpi_parse_state { | 664 | struct acpi_parse_state { |
646 | u32 aml_size; | ||
647 | u8 *aml_start; /* First AML byte */ | 665 | u8 *aml_start; /* First AML byte */ |
648 | u8 *aml; /* Next AML byte */ | 666 | u8 *aml; /* Next AML byte */ |
649 | u8 *aml_end; /* (last + 1) AML byte */ | 667 | u8 *aml_end; /* (last + 1) AML byte */ |
@@ -653,22 +671,23 @@ struct acpi_parse_state { | |||
653 | struct acpi_namespace_node *start_node; | 671 | struct acpi_namespace_node *start_node; |
654 | union acpi_generic_state *scope; /* Current scope */ | 672 | union acpi_generic_state *scope; /* Current scope */ |
655 | union acpi_parse_object *start_scope; | 673 | union acpi_parse_object *start_scope; |
674 | u32 aml_size; | ||
656 | }; | 675 | }; |
657 | 676 | ||
658 | /* Parse object flags */ | 677 | /* Parse object flags */ |
659 | 678 | ||
660 | #define ACPI_PARSEOP_GENERIC 0x01 | 679 | #define ACPI_PARSEOP_GENERIC 0x01 |
661 | #define ACPI_PARSEOP_NAMED 0x02 | 680 | #define ACPI_PARSEOP_NAMED 0x02 |
662 | #define ACPI_PARSEOP_DEFERRED 0x04 | 681 | #define ACPI_PARSEOP_DEFERRED 0x04 |
663 | #define ACPI_PARSEOP_BYTELIST 0x08 | 682 | #define ACPI_PARSEOP_BYTELIST 0x08 |
664 | #define ACPI_PARSEOP_IN_CACHE 0x80 | 683 | #define ACPI_PARSEOP_IN_CACHE 0x80 |
665 | 684 | ||
666 | /* Parse object disasm_flags */ | 685 | /* Parse object disasm_flags */ |
667 | 686 | ||
668 | #define ACPI_PARSEOP_IGNORE 0x01 | 687 | #define ACPI_PARSEOP_IGNORE 0x01 |
669 | #define ACPI_PARSEOP_PARAMLIST 0x02 | 688 | #define ACPI_PARSEOP_PARAMLIST 0x02 |
670 | #define ACPI_PARSEOP_EMPTY_TERMLIST 0x04 | 689 | #define ACPI_PARSEOP_EMPTY_TERMLIST 0x04 |
671 | #define ACPI_PARSEOP_SPECIAL 0x10 | 690 | #define ACPI_PARSEOP_SPECIAL 0x10 |
672 | 691 | ||
673 | /***************************************************************************** | 692 | /***************************************************************************** |
674 | * | 693 | * |
@@ -676,8 +695,8 @@ struct acpi_parse_state { | |||
676 | * | 695 | * |
677 | ****************************************************************************/ | 696 | ****************************************************************************/ |
678 | 697 | ||
679 | #define PCI_ROOT_HID_STRING "PNP0A03" | 698 | #define PCI_ROOT_HID_STRING "PNP0A03" |
680 | #define PCI_EXPRESS_ROOT_HID_STRING "PNP0A08" | 699 | #define PCI_EXPRESS_ROOT_HID_STRING "PNP0A08" |
681 | 700 | ||
682 | struct acpi_bit_register_info { | 701 | struct acpi_bit_register_info { |
683 | u8 parent_register; | 702 | u8 parent_register; |
@@ -710,13 +729,14 @@ struct acpi_bit_register_info { | |||
710 | #define ACPI_BITMASK_PCIEXP_WAKE_STATUS 0x4000 /* ACPI 3.0 */ | 729 | #define ACPI_BITMASK_PCIEXP_WAKE_STATUS 0x4000 /* ACPI 3.0 */ |
711 | #define ACPI_BITMASK_WAKE_STATUS 0x8000 | 730 | #define ACPI_BITMASK_WAKE_STATUS 0x8000 |
712 | 731 | ||
713 | #define ACPI_BITMASK_ALL_FIXED_STATUS (ACPI_BITMASK_TIMER_STATUS | \ | 732 | #define ACPI_BITMASK_ALL_FIXED_STATUS (\ |
714 | ACPI_BITMASK_BUS_MASTER_STATUS | \ | 733 | ACPI_BITMASK_TIMER_STATUS | \ |
715 | ACPI_BITMASK_GLOBAL_LOCK_STATUS | \ | 734 | ACPI_BITMASK_BUS_MASTER_STATUS | \ |
716 | ACPI_BITMASK_POWER_BUTTON_STATUS | \ | 735 | ACPI_BITMASK_GLOBAL_LOCK_STATUS | \ |
717 | ACPI_BITMASK_SLEEP_BUTTON_STATUS | \ | 736 | ACPI_BITMASK_POWER_BUTTON_STATUS | \ |
718 | ACPI_BITMASK_RT_CLOCK_STATUS | \ | 737 | ACPI_BITMASK_SLEEP_BUTTON_STATUS | \ |
719 | ACPI_BITMASK_WAKE_STATUS) | 738 | ACPI_BITMASK_RT_CLOCK_STATUS | \ |
739 | ACPI_BITMASK_WAKE_STATUS) | ||
720 | 740 | ||
721 | #define ACPI_BITMASK_TIMER_ENABLE 0x0001 | 741 | #define ACPI_BITMASK_TIMER_ENABLE 0x0001 |
722 | #define ACPI_BITMASK_GLOBAL_LOCK_ENABLE 0x0020 | 742 | #define ACPI_BITMASK_GLOBAL_LOCK_ENABLE 0x0020 |
@@ -820,7 +840,7 @@ struct acpi_bit_register_info { | |||
820 | * | 840 | * |
821 | ****************************************************************************/ | 841 | ****************************************************************************/ |
822 | 842 | ||
823 | #define ACPI_ASCII_ZERO 0x30 | 843 | #define ACPI_ASCII_ZERO 0x30 |
824 | 844 | ||
825 | /***************************************************************************** | 845 | /***************************************************************************** |
826 | * | 846 | * |
@@ -842,9 +862,9 @@ struct acpi_integrity_info { | |||
842 | u32 objects; | 862 | u32 objects; |
843 | }; | 863 | }; |
844 | 864 | ||
845 | #define ACPI_DB_REDIRECTABLE_OUTPUT 0x01 | 865 | #define ACPI_DB_REDIRECTABLE_OUTPUT 0x01 |
846 | #define ACPI_DB_CONSOLE_OUTPUT 0x02 | 866 | #define ACPI_DB_CONSOLE_OUTPUT 0x02 |
847 | #define ACPI_DB_DUPLICATE_OUTPUT 0x03 | 867 | #define ACPI_DB_DUPLICATE_OUTPUT 0x03 |
848 | 868 | ||
849 | /***************************************************************************** | 869 | /***************************************************************************** |
850 | * | 870 | * |
@@ -854,18 +874,18 @@ struct acpi_integrity_info { | |||
854 | 874 | ||
855 | /* Entry for a memory allocation (debug only) */ | 875 | /* Entry for a memory allocation (debug only) */ |
856 | 876 | ||
857 | #define ACPI_MEM_MALLOC 0 | 877 | #define ACPI_MEM_MALLOC 0 |
858 | #define ACPI_MEM_CALLOC 1 | 878 | #define ACPI_MEM_CALLOC 1 |
859 | #define ACPI_MAX_MODULE_NAME 16 | 879 | #define ACPI_MAX_MODULE_NAME 16 |
860 | 880 | ||
861 | #define ACPI_COMMON_DEBUG_MEM_HEADER \ | 881 | #define ACPI_COMMON_DEBUG_MEM_HEADER \ |
862 | struct acpi_debug_mem_block *previous; \ | 882 | struct acpi_debug_mem_block *previous; \ |
863 | struct acpi_debug_mem_block *next; \ | 883 | struct acpi_debug_mem_block *next; \ |
864 | u32 size; \ | 884 | u32 size; \ |
865 | u32 component; \ | 885 | u32 component; \ |
866 | u32 line; \ | 886 | u32 line; \ |
867 | char module[ACPI_MAX_MODULE_NAME]; \ | 887 | char module[ACPI_MAX_MODULE_NAME]; \ |
868 | u8 alloc_type; | 888 | u8 alloc_type; |
869 | 889 | ||
870 | struct acpi_debug_mem_header { | 890 | struct acpi_debug_mem_header { |
871 | ACPI_COMMON_DEBUG_MEM_HEADER}; | 891 | ACPI_COMMON_DEBUG_MEM_HEADER}; |
diff --git a/include/acpi/acmacros.h b/include/acpi/acmacros.h index f2be2a881730..38f9aa4bef00 100644 --- a/include/acpi/acmacros.h +++ b/include/acpi/acmacros.h | |||
@@ -56,6 +56,10 @@ | |||
56 | #define ACPI_CLEAR_BIT(target,bit) ((target) &= ~(bit)) | 56 | #define ACPI_CLEAR_BIT(target,bit) ((target) &= ~(bit)) |
57 | #define ACPI_MIN(a,b) (((a)<(b))?(a):(b)) | 57 | #define ACPI_MIN(a,b) (((a)<(b))?(a):(b)) |
58 | 58 | ||
59 | /* Size calculation */ | ||
60 | |||
61 | #define ACPI_ARRAY_LENGTH(x) (sizeof(x) / sizeof((x)[0])) | ||
62 | |||
59 | #if ACPI_MACHINE_WIDTH == 16 | 63 | #if ACPI_MACHINE_WIDTH == 16 |
60 | 64 | ||
61 | /* | 65 | /* |
@@ -99,7 +103,7 @@ | |||
99 | * printf() format helpers | 103 | * printf() format helpers |
100 | */ | 104 | */ |
101 | 105 | ||
102 | /* Split 64-bit integer into two 32-bit values. Use with %8.8X%8.8X */ | 106 | /* Split 64-bit integer into two 32-bit values. Use with %8.8_x%8.8_x */ |
103 | 107 | ||
104 | #define ACPI_FORMAT_UINT64(i) ACPI_HIDWORD(i),ACPI_LODWORD(i) | 108 | #define ACPI_FORMAT_UINT64(i) ACPI_HIDWORD(i),ACPI_LODWORD(i) |
105 | 109 | ||
@@ -130,7 +134,6 @@ | |||
130 | #define ACPI_TO_POINTER(i) ACPI_ADD_PTR (void,(void *) NULL,(acpi_native_uint) i) | 134 | #define ACPI_TO_POINTER(i) ACPI_ADD_PTR (void,(void *) NULL,(acpi_native_uint) i) |
131 | #define ACPI_TO_INTEGER(p) ACPI_PTR_DIFF (p,(void *) NULL) | 135 | #define ACPI_TO_INTEGER(p) ACPI_PTR_DIFF (p,(void *) NULL) |
132 | #define ACPI_OFFSET(d,f) (acpi_size) ACPI_PTR_DIFF (&(((d *)0)->f),(void *) NULL) | 136 | #define ACPI_OFFSET(d,f) (acpi_size) ACPI_PTR_DIFF (&(((d *)0)->f),(void *) NULL) |
133 | #define ACPI_FADT_OFFSET(f) ACPI_OFFSET (FADT_DESCRIPTOR, f) | ||
134 | 137 | ||
135 | #if ACPI_MACHINE_WIDTH == 16 | 138 | #if ACPI_MACHINE_WIDTH == 16 |
136 | #define ACPI_STORE_POINTER(d,s) ACPI_MOVE_32_TO_32(d,s) | 139 | #define ACPI_STORE_POINTER(d,s) ACPI_MOVE_32_TO_32(d,s) |
@@ -141,6 +144,12 @@ | |||
141 | #define ACPI_PTR_TO_PHYSADDR(i) ACPI_TO_INTEGER(i) | 144 | #define ACPI_PTR_TO_PHYSADDR(i) ACPI_TO_INTEGER(i) |
142 | #endif | 145 | #endif |
143 | 146 | ||
147 | #ifndef ACPI_MISALIGNMENT_NOT_SUPPORTED | ||
148 | #define ACPI_COMPARE_NAME(a,b) (*ACPI_CAST_PTR (u32,(a)) == *ACPI_CAST_PTR (u32,(b))) | ||
149 | #else | ||
150 | #define ACPI_COMPARE_NAME(a,b) (!ACPI_STRNCMP (ACPI_CAST_PTR (char,(a)), ACPI_CAST_PTR (char,(b)), ACPI_NAME_SIZE)) | ||
151 | #endif | ||
152 | |||
144 | /* | 153 | /* |
145 | * Macros for moving data around to/from buffers that are possibly unaligned. | 154 | * Macros for moving data around to/from buffers that are possibly unaligned. |
146 | * If the hardware supports the transfer of unaligned data, just do the store. | 155 | * If the hardware supports the transfer of unaligned data, just do the store. |
@@ -341,29 +350,33 @@ | |||
341 | /* | 350 | /* |
342 | * Rounding macros (Power of two boundaries only) | 351 | * Rounding macros (Power of two boundaries only) |
343 | */ | 352 | */ |
344 | #define ACPI_ROUND_DOWN(value,boundary) (((acpi_native_uint)(value)) & \ | 353 | #define ACPI_ROUND_DOWN(value,boundary) (((acpi_native_uint)(value)) & \ |
345 | (~(((acpi_native_uint) boundary)-1))) | 354 | (~(((acpi_native_uint) boundary)-1))) |
346 | 355 | ||
347 | #define ACPI_ROUND_UP(value,boundary) ((((acpi_native_uint)(value)) + \ | 356 | #define ACPI_ROUND_UP(value,boundary) ((((acpi_native_uint)(value)) + \ |
348 | (((acpi_native_uint) boundary)-1)) & \ | 357 | (((acpi_native_uint) boundary)-1)) & \ |
349 | (~(((acpi_native_uint) boundary)-1))) | 358 | (~(((acpi_native_uint) boundary)-1))) |
350 | 359 | ||
351 | #define ACPI_ROUND_DOWN_TO_32_BITS(a) ACPI_ROUND_DOWN(a,4) | 360 | /* Note: sizeof(acpi_native_uint) evaluates to either 2, 4, or 8 */ |
352 | #define ACPI_ROUND_DOWN_TO_64_BITS(a) ACPI_ROUND_DOWN(a,8) | 361 | |
353 | #define ACPI_ROUND_DOWN_TO_NATIVE_WORD(a) ACPI_ROUND_DOWN(a,ALIGNED_ADDRESS_BOUNDARY) | 362 | #define ACPI_ROUND_DOWN_TO_32BIT(a) ACPI_ROUND_DOWN(a,4) |
363 | #define ACPI_ROUND_DOWN_TO_64BIT(a) ACPI_ROUND_DOWN(a,8) | ||
364 | #define ACPI_ROUND_DOWN_TO_NATIVE_WORD(a) ACPI_ROUND_DOWN(a,sizeof(acpi_native_uint)) | ||
354 | 365 | ||
355 | #define ACPI_ROUND_UP_to_32_bITS(a) ACPI_ROUND_UP(a,4) | 366 | #define ACPI_ROUND_UP_TO_32BIT(a) ACPI_ROUND_UP(a,4) |
356 | #define ACPI_ROUND_UP_to_64_bITS(a) ACPI_ROUND_UP(a,8) | 367 | #define ACPI_ROUND_UP_TO_64BIT(a) ACPI_ROUND_UP(a,8) |
357 | #define ACPI_ROUND_UP_TO_NATIVE_WORD(a) ACPI_ROUND_UP(a,ALIGNED_ADDRESS_BOUNDARY) | 368 | #define ACPI_ROUND_UP_TO_NATIVE_WORD(a) ACPI_ROUND_UP(a,sizeof(acpi_native_uint)) |
358 | 369 | ||
359 | #define ACPI_ROUND_BITS_UP_TO_BYTES(a) ACPI_DIV_8((a) + 7) | 370 | #define ACPI_ROUND_BITS_UP_TO_BYTES(a) ACPI_DIV_8((a) + 7) |
360 | #define ACPI_ROUND_BITS_DOWN_TO_BYTES(a) ACPI_DIV_8((a)) | 371 | #define ACPI_ROUND_BITS_DOWN_TO_BYTES(a) ACPI_DIV_8((a)) |
361 | 372 | ||
362 | #define ACPI_ROUND_UP_TO_1K(a) (((a) + 1023) >> 10) | 373 | #define ACPI_ROUND_UP_TO_1K(a) (((a) + 1023) >> 10) |
363 | 374 | ||
364 | /* Generic (non-power-of-two) rounding */ | 375 | /* Generic (non-power-of-two) rounding */ |
365 | 376 | ||
366 | #define ACPI_ROUND_UP_TO(value,boundary) (((value) + ((boundary)-1)) / (boundary)) | 377 | #define ACPI_ROUND_UP_TO(value,boundary) (((value) + ((boundary)-1)) / (boundary)) |
378 | |||
379 | #define ACPI_IS_MISALIGNED(value) (((acpi_native_uint)value) & (sizeof(acpi_native_uint)-1)) | ||
367 | 380 | ||
368 | /* | 381 | /* |
369 | * Bitmask creation | 382 | * Bitmask creation |
@@ -371,10 +384,10 @@ | |||
371 | * MASK_BITS_ABOVE creates a mask starting AT the position and above | 384 | * MASK_BITS_ABOVE creates a mask starting AT the position and above |
372 | * MASK_BITS_BELOW creates a mask starting one bit BELOW the position | 385 | * MASK_BITS_BELOW creates a mask starting one bit BELOW the position |
373 | */ | 386 | */ |
374 | #define ACPI_MASK_BITS_ABOVE(position) (~((ACPI_INTEGER_MAX) << ((u32) (position)))) | 387 | #define ACPI_MASK_BITS_ABOVE(position) (~((ACPI_INTEGER_MAX) << ((u32) (position)))) |
375 | #define ACPI_MASK_BITS_BELOW(position) ((ACPI_INTEGER_MAX) << ((u32) (position))) | 388 | #define ACPI_MASK_BITS_BELOW(position) ((ACPI_INTEGER_MAX) << ((u32) (position))) |
376 | 389 | ||
377 | #define ACPI_IS_OCTAL_DIGIT(d) (((char)(d) >= '0') && ((char)(d) <= '7')) | 390 | #define ACPI_IS_OCTAL_DIGIT(d) (((char)(d) >= '0') && ((char)(d) <= '7')) |
378 | 391 | ||
379 | /* Bitfields within ACPI registers */ | 392 | /* Bitfields within ACPI registers */ |
380 | 393 | ||
@@ -396,8 +409,8 @@ | |||
396 | * | 409 | * |
397 | * The "Descriptor" field is the first field in both structures. | 410 | * The "Descriptor" field is the first field in both structures. |
398 | */ | 411 | */ |
399 | #define ACPI_GET_DESCRIPTOR_TYPE(d) (((union acpi_descriptor *)(void *)(d))->descriptor_id) | 412 | #define ACPI_GET_DESCRIPTOR_TYPE(d) (((union acpi_descriptor *)(void *)(d))->common.descriptor_type) |
400 | #define ACPI_SET_DESCRIPTOR_TYPE(d,t) (((union acpi_descriptor *)(void *)(d))->descriptor_id = t) | 413 | #define ACPI_SET_DESCRIPTOR_TYPE(d,t) (((union acpi_descriptor *)(void *)(d))->common.descriptor_type = t) |
401 | 414 | ||
402 | /* Macro to test the object type */ | 415 | /* Macro to test the object type */ |
403 | 416 | ||
@@ -486,7 +499,6 @@ | |||
486 | #define ACPI_ERROR(plist) | 499 | #define ACPI_ERROR(plist) |
487 | #define ACPI_ERROR_NAMESPACE(s,e) | 500 | #define ACPI_ERROR_NAMESPACE(s,e) |
488 | #define ACPI_ERROR_METHOD(s,n,p,e) | 501 | #define ACPI_ERROR_METHOD(s,n,p,e) |
489 | |||
490 | #endif | 502 | #endif |
491 | 503 | ||
492 | /* | 504 | /* |
@@ -514,12 +526,12 @@ | |||
514 | #define ACPI_GET_FUNCTION_NAME _acpi_function_name | 526 | #define ACPI_GET_FUNCTION_NAME _acpi_function_name |
515 | /* | 527 | /* |
516 | * The Name parameter should be the procedure name as a quoted string. | 528 | * The Name parameter should be the procedure name as a quoted string. |
517 | * This is declared as a local string ("my_function_name") so that it can | 529 | * This is declared as a local string ("MyFunctionName") so that it can |
518 | * be also used by the function exit macros below. | 530 | * be also used by the function exit macros below. |
519 | * Note: (const char) is used to be compatible with the debug interfaces | 531 | * Note: (const char) is used to be compatible with the debug interfaces |
520 | * and macros such as __FUNCTION__. | 532 | * and macros such as __FUNCTION__. |
521 | */ | 533 | */ |
522 | #define ACPI_FUNCTION_NAME(name) const char *_acpi_function_name = name; | 534 | #define ACPI_FUNCTION_NAME(name) const char *_acpi_function_name = #name; |
523 | 535 | ||
524 | #else | 536 | #else |
525 | /* Compiler supports __FUNCTION__ (or equivalent) -- Ignore this macro */ | 537 | /* Compiler supports __FUNCTION__ (or equivalent) -- Ignore this macro */ |
@@ -528,13 +540,13 @@ | |||
528 | #endif | 540 | #endif |
529 | 541 | ||
530 | #define ACPI_FUNCTION_TRACE(a) ACPI_FUNCTION_NAME(a) \ | 542 | #define ACPI_FUNCTION_TRACE(a) ACPI_FUNCTION_NAME(a) \ |
531 | acpi_ut_trace(ACPI_DEBUG_PARAMETERS) | 543 | acpi_ut_trace(ACPI_DEBUG_PARAMETERS) |
532 | #define ACPI_FUNCTION_TRACE_PTR(a,b) ACPI_FUNCTION_NAME(a) \ | 544 | #define ACPI_FUNCTION_TRACE_PTR(a,b) ACPI_FUNCTION_NAME(a) \ |
533 | acpi_ut_trace_ptr(ACPI_DEBUG_PARAMETERS,(void *)b) | 545 | acpi_ut_trace_ptr(ACPI_DEBUG_PARAMETERS,(void *)b) |
534 | #define ACPI_FUNCTION_TRACE_U32(a,b) ACPI_FUNCTION_NAME(a) \ | 546 | #define ACPI_FUNCTION_TRACE_U32(a,b) ACPI_FUNCTION_NAME(a) \ |
535 | acpi_ut_trace_u32(ACPI_DEBUG_PARAMETERS,(u32)b) | 547 | acpi_ut_trace_u32(ACPI_DEBUG_PARAMETERS,(u32)b) |
536 | #define ACPI_FUNCTION_TRACE_STR(a,b) ACPI_FUNCTION_NAME(a) \ | 548 | #define ACPI_FUNCTION_TRACE_STR(a,b) ACPI_FUNCTION_NAME(a) \ |
537 | acpi_ut_trace_str(ACPI_DEBUG_PARAMETERS,(char *)b) | 549 | acpi_ut_trace_str(ACPI_DEBUG_PARAMETERS,(char *)b) |
538 | 550 | ||
539 | #define ACPI_FUNCTION_ENTRY() acpi_ut_track_stack_ptr() | 551 | #define ACPI_FUNCTION_ENTRY() acpi_ut_track_stack_ptr() |
540 | 552 | ||
@@ -543,7 +555,7 @@ | |||
543 | * WARNING: These macros include a return statement. This is usually considered | 555 | * WARNING: These macros include a return statement. This is usually considered |
544 | * bad form, but having a separate exit macro is very ugly and difficult to maintain. | 556 | * bad form, but having a separate exit macro is very ugly and difficult to maintain. |
545 | * One of the FUNCTION_TRACE macros above must be used in conjunction with these macros | 557 | * One of the FUNCTION_TRACE macros above must be used in conjunction with these macros |
546 | * so that "_acpi_function_name" is defined. | 558 | * so that "_AcpiFunctionName" is defined. |
547 | * | 559 | * |
548 | * Note: the DO_WHILE0 macro is used to prevent some compilers from complaining | 560 | * Note: the DO_WHILE0 macro is used to prevent some compilers from complaining |
549 | * about these constructs. | 561 | * about these constructs. |
@@ -654,6 +666,7 @@ | |||
654 | #define ACPI_DUMP_STACK_ENTRY(a) | 666 | #define ACPI_DUMP_STACK_ENTRY(a) |
655 | #define ACPI_DUMP_OPERANDS(a,b,c,d,e) | 667 | #define ACPI_DUMP_OPERANDS(a,b,c,d,e) |
656 | #define ACPI_DUMP_ENTRY(a,b) | 668 | #define ACPI_DUMP_ENTRY(a,b) |
669 | #define ACPI_DUMP_TABLES(a,b) | ||
657 | #define ACPI_DUMP_PATHNAME(a,b,c,d) | 670 | #define ACPI_DUMP_PATHNAME(a,b,c,d) |
658 | #define ACPI_DUMP_RESOURCE_LIST(a) | 671 | #define ACPI_DUMP_RESOURCE_LIST(a) |
659 | #define ACPI_DUMP_BUFFER(a,b) | 672 | #define ACPI_DUMP_BUFFER(a,b) |
@@ -709,19 +722,19 @@ | |||
709 | 722 | ||
710 | /* Memory allocation */ | 723 | /* Memory allocation */ |
711 | 724 | ||
712 | #define ACPI_MEM_ALLOCATE(a) acpi_ut_allocate((acpi_size)(a),_COMPONENT,_acpi_module_name,__LINE__) | 725 | #define ACPI_ALLOCATE(a) acpi_ut_allocate((acpi_size)(a),_COMPONENT,_acpi_module_name,__LINE__) |
713 | #define ACPI_MEM_CALLOCATE(a) acpi_ut_callocate((acpi_size)(a), _COMPONENT,_acpi_module_name,__LINE__) | 726 | #define ACPI_ALLOCATE_ZEROED(a) acpi_ut_allocate_zeroed((acpi_size)(a), _COMPONENT,_acpi_module_name,__LINE__) |
714 | #define ACPI_MEM_FREE(a) acpi_os_free(a) | 727 | #define ACPI_FREE(a) acpi_os_free(a) |
715 | #define ACPI_MEM_TRACKING(a) | 728 | #define ACPI_MEM_TRACKING(a) |
716 | 729 | ||
717 | #else | 730 | #else |
718 | 731 | ||
719 | /* Memory allocation */ | 732 | /* Memory allocation */ |
720 | 733 | ||
721 | #define ACPI_MEM_ALLOCATE(a) acpi_ut_allocate_and_track((acpi_size)(a),_COMPONENT,_acpi_module_name,__LINE__) | 734 | #define ACPI_ALLOCATE(a) acpi_ut_allocate_and_track((acpi_size)(a),_COMPONENT,_acpi_module_name,__LINE__) |
722 | #define ACPI_MEM_CALLOCATE(a) acpi_ut_callocate_and_track((acpi_size)(a), _COMPONENT,_acpi_module_name,__LINE__) | 735 | #define ACPI_ALLOCATE_ZEROED(a) acpi_ut_allocate_zeroed_and_track((acpi_size)(a), _COMPONENT,_acpi_module_name,__LINE__) |
723 | #define ACPI_MEM_FREE(a) acpi_ut_free_and_track(a,_COMPONENT,_acpi_module_name,__LINE__) | 736 | #define ACPI_FREE(a) acpi_ut_free_and_track(a,_COMPONENT,_acpi_module_name,__LINE__) |
724 | #define ACPI_MEM_TRACKING(a) a | 737 | #define ACPI_MEM_TRACKING(a) a |
725 | 738 | ||
726 | #endif /* ACPI_DBG_TRACK_ALLOCATIONS */ | 739 | #endif /* ACPI_DBG_TRACK_ALLOCATIONS */ |
727 | 740 | ||
diff --git a/include/acpi/acnamesp.h b/include/acpi/acnamesp.h index b667a804fc8a..83b52f9f899a 100644 --- a/include/acpi/acnamesp.h +++ b/include/acpi/acnamesp.h | |||
@@ -63,6 +63,8 @@ | |||
63 | #define ACPI_NS_DONT_OPEN_SCOPE 0x02 | 63 | #define ACPI_NS_DONT_OPEN_SCOPE 0x02 |
64 | #define ACPI_NS_NO_PEER_SEARCH 0x04 | 64 | #define ACPI_NS_NO_PEER_SEARCH 0x04 |
65 | #define ACPI_NS_ERROR_IF_FOUND 0x08 | 65 | #define ACPI_NS_ERROR_IF_FOUND 0x08 |
66 | #define ACPI_NS_PREFIX_IS_SCOPE 0x10 | ||
67 | #define ACPI_NS_EXTERNAL 0x20 | ||
66 | 68 | ||
67 | #define ACPI_NS_WALK_UNLOCK TRUE | 69 | #define ACPI_NS_WALK_UNLOCK TRUE |
68 | #define ACPI_NS_WALK_NO_UNLOCK FALSE | 70 | #define ACPI_NS_WALK_NO_UNLOCK FALSE |
@@ -171,19 +173,17 @@ acpi_ns_dump_objects(acpi_object_type type, | |||
171 | /* | 173 | /* |
172 | * nseval - Namespace evaluation functions | 174 | * nseval - Namespace evaluation functions |
173 | */ | 175 | */ |
174 | acpi_status acpi_ns_evaluate_by_handle(struct acpi_parameter_info *info); | 176 | acpi_status acpi_ns_evaluate(struct acpi_evaluate_info *info); |
175 | |||
176 | acpi_status | ||
177 | acpi_ns_evaluate_by_name(char *pathname, struct acpi_parameter_info *info); | ||
178 | |||
179 | acpi_status | ||
180 | acpi_ns_evaluate_relative(char *pathname, struct acpi_parameter_info *info); | ||
181 | 177 | ||
182 | /* | 178 | /* |
183 | * nsnames - Name and Scope manipulation | 179 | * nsnames - Name and Scope manipulation |
184 | */ | 180 | */ |
185 | u32 acpi_ns_opens_scope(acpi_object_type type); | 181 | u32 acpi_ns_opens_scope(acpi_object_type type); |
186 | 182 | ||
183 | void | ||
184 | acpi_ns_build_external_path(struct acpi_namespace_node *node, | ||
185 | acpi_size size, char *name_buffer); | ||
186 | |||
187 | char *acpi_ns_get_external_pathname(struct acpi_namespace_node *node); | 187 | char *acpi_ns_get_external_pathname(struct acpi_namespace_node *node); |
188 | 188 | ||
189 | char *acpi_ns_name_of_current_scope(struct acpi_walk_state *walk_state); | 189 | char *acpi_ns_name_of_current_scope(struct acpi_walk_state *walk_state); |
@@ -196,9 +196,9 @@ u8 | |||
196 | acpi_ns_pattern_match(struct acpi_namespace_node *obj_node, char *search_for); | 196 | acpi_ns_pattern_match(struct acpi_namespace_node *obj_node, char *search_for); |
197 | 197 | ||
198 | acpi_status | 198 | acpi_status |
199 | acpi_ns_get_node_by_path(char *external_pathname, | 199 | acpi_ns_get_node(struct acpi_namespace_node *prefix_node, |
200 | struct acpi_namespace_node *in_prefix_node, | 200 | char *external_pathname, |
201 | u32 flags, struct acpi_namespace_node **out_node); | 201 | u32 flags, struct acpi_namespace_node **out_node); |
202 | 202 | ||
203 | acpi_size acpi_ns_get_pathname_length(struct acpi_namespace_node *node); | 203 | acpi_size acpi_ns_get_pathname_length(struct acpi_namespace_node *node); |
204 | 204 | ||
@@ -241,10 +241,10 @@ acpi_ns_search_and_enter(u32 entry_name, | |||
241 | u32 flags, struct acpi_namespace_node **ret_node); | 241 | u32 flags, struct acpi_namespace_node **ret_node); |
242 | 242 | ||
243 | acpi_status | 243 | acpi_status |
244 | acpi_ns_search_node(u32 entry_name, | 244 | acpi_ns_search_one_scope(u32 entry_name, |
245 | struct acpi_namespace_node *node, | 245 | struct acpi_namespace_node *node, |
246 | acpi_object_type type, | 246 | acpi_object_type type, |
247 | struct acpi_namespace_node **ret_node); | 247 | struct acpi_namespace_node **ret_node); |
248 | 248 | ||
249 | void | 249 | void |
250 | acpi_ns_install_node(struct acpi_walk_state *walk_state, | 250 | acpi_ns_install_node(struct acpi_walk_state *walk_state, |
diff --git a/include/acpi/acobject.h b/include/acpi/acobject.h index d130cfed8d55..1747d94084d8 100644 --- a/include/acpi/acobject.h +++ b/include/acpi/acobject.h | |||
@@ -1,7 +1,7 @@ | |||
1 | 1 | ||
2 | /****************************************************************************** | 2 | /****************************************************************************** |
3 | * | 3 | * |
4 | * Name: acobject.h - Definition of union acpi_operand_object (Internal object only) | 4 | * Name: acobject.h - Definition of union acpi_operand_object (Internal object only) |
5 | * | 5 | * |
6 | *****************************************************************************/ | 6 | *****************************************************************************/ |
7 | 7 | ||
@@ -45,10 +45,12 @@ | |||
45 | #ifndef _ACOBJECT_H | 45 | #ifndef _ACOBJECT_H |
46 | #define _ACOBJECT_H | 46 | #define _ACOBJECT_H |
47 | 47 | ||
48 | /* acpisrc:struct_defs -- for acpisrc conversion */ | ||
49 | |||
48 | /* | 50 | /* |
49 | * The union acpi_operand_object is used to pass AML operands from the dispatcher | 51 | * The union acpi_operand_object is used to pass AML operands from the dispatcher |
50 | * to the interpreter, and to keep track of the various handlers such as | 52 | * to the interpreter, and to keep track of the various handlers such as |
51 | * address space handlers and notify handlers. The object is a constant | 53 | * address space handlers and notify handlers. The object is a constant |
52 | * size in order to allow it to be cached and reused. | 54 | * size in order to allow it to be cached and reused. |
53 | */ | 55 | */ |
54 | 56 | ||
@@ -61,17 +63,25 @@ | |||
61 | /* | 63 | /* |
62 | * Common area for all objects. | 64 | * Common area for all objects. |
63 | * | 65 | * |
64 | * data_type is used to differentiate between internal descriptors, and MUST | 66 | * descriptor_type is used to differentiate between internal descriptors, and |
65 | * be the first byte in this structure. | 67 | * must be in the same place across all descriptors |
68 | * | ||
69 | * Note: The descriptor_type and Type fields must appear in the identical | ||
70 | * position in both the struct acpi_namespace_node and union acpi_operand_object | ||
71 | * structures. | ||
66 | */ | 72 | */ |
67 | #define ACPI_OBJECT_COMMON_HEADER /* SIZE/ALIGNMENT: 32 bits, one ptr plus trailing 8-bit flag */\ | 73 | #define ACPI_OBJECT_COMMON_HEADER \ |
68 | u8 descriptor; /* To differentiate various internal objs */\ | 74 | union acpi_operand_object *next_object; /* Objects linked to parent NS node */\ |
69 | u8 type; /* acpi_object_type */\ | 75 | u8 descriptor_type; /* To differentiate various internal objs */\ |
70 | u16 reference_count; /* For object deletion management */\ | 76 | u8 type; /* acpi_object_type */\ |
71 | union acpi_operand_object *next_object; /* Objects linked to parent NS node */\ | 77 | u16 reference_count; /* For object deletion management */\ |
72 | u8 flags; | 78 | u8 flags; |
73 | 79 | /* | |
74 | /* Values for flag byte above */ | 80 | * Note: There are 3 bytes available here before the |
81 | * next natural alignment boundary (for both 32/64 cases) | ||
82 | */ | ||
83 | |||
84 | /* Values for Flag byte above */ | ||
75 | 85 | ||
76 | #define AOPOBJ_AML_CONSTANT 0x01 | 86 | #define AOPOBJ_AML_CONSTANT 0x01 |
77 | #define AOPOBJ_STATIC_POINTER 0x02 | 87 | #define AOPOBJ_STATIC_POINTER 0x02 |
@@ -79,36 +89,7 @@ | |||
79 | #define AOPOBJ_OBJECT_INITIALIZED 0x08 | 89 | #define AOPOBJ_OBJECT_INITIALIZED 0x08 |
80 | #define AOPOBJ_SETUP_COMPLETE 0x10 | 90 | #define AOPOBJ_SETUP_COMPLETE 0x10 |
81 | #define AOPOBJ_SINGLE_DATUM 0x20 | 91 | #define AOPOBJ_SINGLE_DATUM 0x20 |
82 | 92 | #define AOPOBJ_INVALID 0x40 /* Used if host OS won't allow an op_region address */ | |
83 | /* | ||
84 | * Common bitfield for the field objects | ||
85 | * "Field Datum" -- a datum from the actual field object | ||
86 | * "Buffer Datum" -- a datum from a user buffer, read from or to be written to the field | ||
87 | */ | ||
88 | #define ACPI_COMMON_FIELD_INFO /* SIZE/ALIGNMENT: 24 bits + three 32-bit values */\ | ||
89 | u8 field_flags; /* Access, update, and lock bits */\ | ||
90 | u8 attribute; /* From access_as keyword */\ | ||
91 | u8 access_byte_width; /* Read/Write size in bytes */\ | ||
92 | u32 bit_length; /* Length of field in bits */\ | ||
93 | u32 base_byte_offset; /* Byte offset within containing object */\ | ||
94 | u8 start_field_bit_offset;/* Bit offset within first field datum (0-63) */\ | ||
95 | u8 access_bit_width; /* Read/Write size in bits (8-64) */\ | ||
96 | u32 value; /* Value to store into the Bank or Index register */\ | ||
97 | struct acpi_namespace_node *node; /* Link back to parent node */ | ||
98 | |||
99 | /* | ||
100 | * Fields common to both Strings and Buffers | ||
101 | */ | ||
102 | #define ACPI_COMMON_BUFFER_INFO \ | ||
103 | u32 length; | ||
104 | |||
105 | /* | ||
106 | * Common fields for objects that support ASL notifications | ||
107 | */ | ||
108 | #define ACPI_COMMON_NOTIFY_INFO \ | ||
109 | union acpi_operand_object *system_notify; /* Handler for system notifies */\ | ||
110 | union acpi_operand_object *device_notify; /* Handler for driver notifies */\ | ||
111 | union acpi_operand_object *handler; /* Handler for Address space */ | ||
112 | 93 | ||
113 | /****************************************************************************** | 94 | /****************************************************************************** |
114 | * | 95 | * |
@@ -125,25 +106,31 @@ struct acpi_object_integer { | |||
125 | 106 | ||
126 | /* | 107 | /* |
127 | * Note: The String and Buffer object must be identical through the Pointer | 108 | * Note: The String and Buffer object must be identical through the Pointer |
128 | * element. There is code that depends on this. | 109 | * and length elements. There is code that depends on this. |
110 | * | ||
111 | * Fields common to both Strings and Buffers | ||
129 | */ | 112 | */ |
113 | #define ACPI_COMMON_BUFFER_INFO(_type) \ | ||
114 | _type *pointer; \ | ||
115 | u32 length; | ||
116 | |||
130 | struct acpi_object_string { /* Null terminated, ASCII characters only */ | 117 | struct acpi_object_string { /* Null terminated, ASCII characters only */ |
131 | ACPI_OBJECT_COMMON_HEADER ACPI_COMMON_BUFFER_INFO char *pointer; /* String in AML stream or allocated string */ | 118 | ACPI_OBJECT_COMMON_HEADER ACPI_COMMON_BUFFER_INFO(char) /* String in AML stream or allocated string */ |
132 | }; | 119 | }; |
133 | 120 | ||
134 | struct acpi_object_buffer { | 121 | struct acpi_object_buffer { |
135 | ACPI_OBJECT_COMMON_HEADER ACPI_COMMON_BUFFER_INFO u8 * pointer; /* Buffer in AML stream or allocated buffer */ | 122 | ACPI_OBJECT_COMMON_HEADER ACPI_COMMON_BUFFER_INFO(u8) /* Buffer in AML stream or allocated buffer */ |
136 | struct acpi_namespace_node *node; /* Link back to parent node */ | ||
137 | u8 *aml_start; | ||
138 | u32 aml_length; | 123 | u32 aml_length; |
124 | u8 *aml_start; | ||
125 | struct acpi_namespace_node *node; /* Link back to parent node */ | ||
139 | }; | 126 | }; |
140 | 127 | ||
141 | struct acpi_object_package { | 128 | struct acpi_object_package { |
142 | ACPI_OBJECT_COMMON_HEADER u32 count; /* # of elements in package */ | 129 | ACPI_OBJECT_COMMON_HEADER struct acpi_namespace_node *node; /* Link back to parent node */ |
143 | u32 aml_length; | ||
144 | u8 *aml_start; | ||
145 | struct acpi_namespace_node *node; /* Link back to parent node */ | ||
146 | union acpi_operand_object **elements; /* Array of pointers to acpi_objects */ | 130 | union acpi_operand_object **elements; /* Array of pointers to acpi_objects */ |
131 | u8 *aml_start; | ||
132 | u32 aml_length; | ||
133 | u32 count; /* # of elements in package */ | ||
147 | }; | 134 | }; |
148 | 135 | ||
149 | /****************************************************************************** | 136 | /****************************************************************************** |
@@ -156,23 +143,6 @@ struct acpi_object_event { | |||
156 | ACPI_OBJECT_COMMON_HEADER void *semaphore; | 143 | ACPI_OBJECT_COMMON_HEADER void *semaphore; |
157 | }; | 144 | }; |
158 | 145 | ||
159 | #define ACPI_INFINITE_CONCURRENCY 0xFF | ||
160 | |||
161 | typedef | ||
162 | acpi_status(*ACPI_INTERNAL_METHOD) (struct acpi_walk_state * walk_state); | ||
163 | |||
164 | struct acpi_object_method { | ||
165 | ACPI_OBJECT_COMMON_HEADER u8 method_flags; | ||
166 | u8 param_count; | ||
167 | u32 aml_length; | ||
168 | void *semaphore; | ||
169 | u8 *aml_start; | ||
170 | ACPI_INTERNAL_METHOD implementation; | ||
171 | u8 concurrency; | ||
172 | u8 thread_count; | ||
173 | acpi_owner_id owner_id; | ||
174 | }; | ||
175 | |||
176 | struct acpi_object_mutex { | 146 | struct acpi_object_mutex { |
177 | ACPI_OBJECT_COMMON_HEADER u8 sync_level; /* 0-15, specified in Mutex() call */ | 147 | ACPI_OBJECT_COMMON_HEADER u8 sync_level; /* 0-15, specified in Mutex() call */ |
178 | u16 acquisition_depth; /* Allow multiple Acquires, same thread */ | 148 | u16 acquisition_depth; /* Allow multiple Acquires, same thread */ |
@@ -186,11 +156,23 @@ struct acpi_object_mutex { | |||
186 | 156 | ||
187 | struct acpi_object_region { | 157 | struct acpi_object_region { |
188 | ACPI_OBJECT_COMMON_HEADER u8 space_id; | 158 | ACPI_OBJECT_COMMON_HEADER u8 space_id; |
189 | union acpi_operand_object *handler; /* Handler for region access */ | ||
190 | struct acpi_namespace_node *node; /* Containing namespace node */ | 159 | struct acpi_namespace_node *node; /* Containing namespace node */ |
160 | union acpi_operand_object *handler; /* Handler for region access */ | ||
191 | union acpi_operand_object *next; | 161 | union acpi_operand_object *next; |
192 | u32 length; | ||
193 | acpi_physical_address address; | 162 | acpi_physical_address address; |
163 | u32 length; | ||
164 | }; | ||
165 | |||
166 | struct acpi_object_method { | ||
167 | ACPI_OBJECT_COMMON_HEADER u8 method_flags; | ||
168 | u8 param_count; | ||
169 | u8 concurrency; | ||
170 | void *semaphore; | ||
171 | u8 *aml_start; | ||
172 | ACPI_INTERNAL_METHOD implementation; | ||
173 | u32 aml_length; | ||
174 | u8 thread_count; | ||
175 | acpi_owner_id owner_id; | ||
194 | }; | 176 | }; |
195 | 177 | ||
196 | /****************************************************************************** | 178 | /****************************************************************************** |
@@ -199,6 +181,14 @@ struct acpi_object_region { | |||
199 | * | 181 | * |
200 | *****************************************************************************/ | 182 | *****************************************************************************/ |
201 | 183 | ||
184 | /* | ||
185 | * Common fields for objects that support ASL notifications | ||
186 | */ | ||
187 | #define ACPI_COMMON_NOTIFY_INFO \ | ||
188 | union acpi_operand_object *system_notify; /* Handler for system notifies */\ | ||
189 | union acpi_operand_object *device_notify; /* Handler for driver notifies */\ | ||
190 | union acpi_operand_object *handler; /* Handler for Address space */ | ||
191 | |||
202 | struct acpi_object_notify_common { /* COMMON NOTIFY for POWER, PROCESSOR, DEVICE, and THERMAL */ | 192 | struct acpi_object_notify_common { /* COMMON NOTIFY for POWER, PROCESSOR, DEVICE, and THERMAL */ |
203 | ACPI_OBJECT_COMMON_HEADER ACPI_COMMON_NOTIFY_INFO}; | 193 | ACPI_OBJECT_COMMON_HEADER ACPI_COMMON_NOTIFY_INFO}; |
204 | 194 | ||
@@ -213,9 +203,9 @@ struct acpi_object_power_resource { | |||
213 | }; | 203 | }; |
214 | 204 | ||
215 | struct acpi_object_processor { | 205 | struct acpi_object_processor { |
216 | ACPI_OBJECT_COMMON_HEADER ACPI_COMMON_NOTIFY_INFO u32 proc_id; | 206 | ACPI_OBJECT_COMMON_HEADER u8 proc_id; |
217 | u32 length; | 207 | u8 length; |
218 | acpi_io_address address; | 208 | ACPI_COMMON_NOTIFY_INFO acpi_io_address address; |
219 | }; | 209 | }; |
220 | 210 | ||
221 | struct acpi_object_thermal_zone { | 211 | struct acpi_object_thermal_zone { |
@@ -227,9 +217,24 @@ ACPI_OBJECT_COMMON_HEADER ACPI_COMMON_NOTIFY_INFO}; | |||
227 | * | 217 | * |
228 | *****************************************************************************/ | 218 | *****************************************************************************/ |
229 | 219 | ||
220 | /* | ||
221 | * Common bitfield for the field objects | ||
222 | * "Field Datum" -- a datum from the actual field object | ||
223 | * "Buffer Datum" -- a datum from a user buffer, read from or to be written to the field | ||
224 | */ | ||
225 | #define ACPI_COMMON_FIELD_INFO \ | ||
226 | u8 field_flags; /* Access, update, and lock bits */\ | ||
227 | u8 attribute; /* From access_as keyword */\ | ||
228 | u8 access_byte_width; /* Read/Write size in bytes */\ | ||
229 | struct acpi_namespace_node *node; /* Link back to parent node */\ | ||
230 | u32 bit_length; /* Length of field in bits */\ | ||
231 | u32 base_byte_offset; /* Byte offset within containing object */\ | ||
232 | u32 value; /* Value to store into the Bank or Index register */\ | ||
233 | u8 start_field_bit_offset;/* Bit offset within first field datum (0-63) */\ | ||
234 | u8 access_bit_width; /* Read/Write size in bits (8-64) */ | ||
235 | |||
230 | struct acpi_object_field_common { /* COMMON FIELD (for BUFFER, REGION, BANK, and INDEX fields) */ | 236 | struct acpi_object_field_common { /* COMMON FIELD (for BUFFER, REGION, BANK, and INDEX fields) */ |
231 | ACPI_OBJECT_COMMON_HEADER ACPI_COMMON_FIELD_INFO union acpi_operand_object *region_obj; /* Containing Operation Region object */ | 237 | ACPI_OBJECT_COMMON_HEADER ACPI_COMMON_FIELD_INFO union acpi_operand_object *region_obj; /* Parent Operation Region object (REGION/BANK fields only) */ |
232 | /* (REGION/BANK fields only) */ | ||
233 | }; | 238 | }; |
234 | 239 | ||
235 | struct acpi_object_region_field { | 240 | struct acpi_object_region_field { |
@@ -244,7 +249,7 @@ struct acpi_object_bank_field { | |||
244 | struct acpi_object_index_field { | 249 | struct acpi_object_index_field { |
245 | ACPI_OBJECT_COMMON_HEADER ACPI_COMMON_FIELD_INFO | 250 | ACPI_OBJECT_COMMON_HEADER ACPI_COMMON_FIELD_INFO |
246 | /* | 251 | /* |
247 | * No "region_obj" pointer needed since the Index and Data registers | 252 | * No "RegionObj" pointer needed since the Index and Data registers |
248 | * are each field definitions unto themselves. | 253 | * are each field definitions unto themselves. |
249 | */ | 254 | */ |
250 | union acpi_operand_object *index_obj; /* Index register */ | 255 | union acpi_operand_object *index_obj; /* Index register */ |
@@ -269,13 +274,9 @@ struct acpi_object_notify_handler { | |||
269 | void *context; | 274 | void *context; |
270 | }; | 275 | }; |
271 | 276 | ||
272 | /* Flags for address handler */ | ||
273 | |||
274 | #define ACPI_ADDR_HANDLER_DEFAULT_INSTALLED 0x1 | ||
275 | |||
276 | struct acpi_object_addr_handler { | 277 | struct acpi_object_addr_handler { |
277 | ACPI_OBJECT_COMMON_HEADER u8 space_id; | 278 | ACPI_OBJECT_COMMON_HEADER u8 space_id; |
278 | u16 hflags; | 279 | u8 handler_flags; |
279 | acpi_adr_space_handler handler; | 280 | acpi_adr_space_handler handler; |
280 | struct acpi_namespace_node *node; /* Parent device */ | 281 | struct acpi_namespace_node *node; /* Parent device */ |
281 | void *context; | 282 | void *context; |
@@ -284,6 +285,10 @@ struct acpi_object_addr_handler { | |||
284 | union acpi_operand_object *next; | 285 | union acpi_operand_object *next; |
285 | }; | 286 | }; |
286 | 287 | ||
288 | /* Flags for address handler (handler_flags) */ | ||
289 | |||
290 | #define ACPI_ADDR_HANDLER_DEFAULT_INSTALLED 0x01 | ||
291 | |||
287 | /****************************************************************************** | 292 | /****************************************************************************** |
288 | * | 293 | * |
289 | * Special internal objects | 294 | * Special internal objects |
@@ -297,10 +302,10 @@ struct acpi_object_addr_handler { | |||
297 | struct acpi_object_reference { | 302 | struct acpi_object_reference { |
298 | ACPI_OBJECT_COMMON_HEADER u8 target_type; /* Used for index_op */ | 303 | ACPI_OBJECT_COMMON_HEADER u8 target_type; /* Used for index_op */ |
299 | u16 opcode; | 304 | u16 opcode; |
300 | u32 offset; /* Used for arg_op, local_op, and index_op */ | 305 | void *object; /* name_op=>HANDLE to obj, index_op=>union acpi_operand_object */ |
301 | void *object; /* name_op=>HANDLE to obj, index_op=>union acpi_operand_object */ | ||
302 | struct acpi_namespace_node *node; | 306 | struct acpi_namespace_node *node; |
303 | union acpi_operand_object **where; | 307 | union acpi_operand_object **where; |
308 | u32 offset; /* Used for arg_op, local_op, and index_op */ | ||
304 | }; | 309 | }; |
305 | 310 | ||
306 | /* | 311 | /* |
@@ -311,12 +316,10 @@ struct acpi_object_reference { | |||
311 | * Currently: Region and field_unit types | 316 | * Currently: Region and field_unit types |
312 | */ | 317 | */ |
313 | struct acpi_object_extra { | 318 | struct acpi_object_extra { |
314 | ACPI_OBJECT_COMMON_HEADER u8 byte_fill1; | 319 | ACPI_OBJECT_COMMON_HEADER struct acpi_namespace_node *method_REG; /* _REG method for this region (if any) */ |
315 | u16 word_fill1; | ||
316 | u32 aml_length; | ||
317 | u8 *aml_start; | ||
318 | struct acpi_namespace_node *method_REG; /* _REG method for this region (if any) */ | ||
319 | void *region_context; /* Region-specific data */ | 320 | void *region_context; /* Region-specific data */ |
321 | u8 *aml_start; | ||
322 | u32 aml_length; | ||
320 | }; | 323 | }; |
321 | 324 | ||
322 | /* Additional data that can be attached to namespace nodes */ | 325 | /* Additional data that can be attached to namespace nodes */ |
@@ -391,8 +394,13 @@ union acpi_operand_object { | |||
391 | #define ACPI_DESC_TYPE_NAMED 0x0F | 394 | #define ACPI_DESC_TYPE_NAMED 0x0F |
392 | #define ACPI_DESC_TYPE_MAX 0x0F | 395 | #define ACPI_DESC_TYPE_MAX 0x0F |
393 | 396 | ||
397 | struct acpi_common_descriptor { | ||
398 | void *common_pointer; | ||
399 | u8 descriptor_type; /* To differentiate various internal objs */ | ||
400 | }; | ||
401 | |||
394 | union acpi_descriptor { | 402 | union acpi_descriptor { |
395 | u8 descriptor_id; /* To differentiate various internal objs */ | 403 | struct acpi_common_descriptor common; |
396 | union acpi_operand_object object; | 404 | union acpi_operand_object object; |
397 | struct acpi_namespace_node node; | 405 | struct acpi_namespace_node node; |
398 | union acpi_parse_object op; | 406 | union acpi_parse_object op; |
diff --git a/include/acpi/acopcode.h b/include/acpi/acopcode.h index e6d78bd9e90a..7659a46bc432 100644 --- a/include/acpi/acopcode.h +++ b/include/acpi/acopcode.h | |||
@@ -94,7 +94,7 @@ | |||
94 | #define ARGP_CONCAT_RES_OP ARGP_LIST3 (ARGP_TERMARG, ARGP_TERMARG, ARGP_TARGET) | 94 | #define ARGP_CONCAT_RES_OP ARGP_LIST3 (ARGP_TERMARG, ARGP_TERMARG, ARGP_TARGET) |
95 | #define ARGP_COND_REF_OF_OP ARGP_LIST2 (ARGP_SUPERNAME, ARGP_SUPERNAME) | 95 | #define ARGP_COND_REF_OF_OP ARGP_LIST2 (ARGP_SUPERNAME, ARGP_SUPERNAME) |
96 | #define ARGP_CONTINUE_OP ARG_NONE | 96 | #define ARGP_CONTINUE_OP ARG_NONE |
97 | #define ARGP_COPY_OP ARGP_LIST2 (ARGP_SUPERNAME, ARGP_SIMPLENAME) | 97 | #define ARGP_COPY_OP ARGP_LIST2 (ARGP_TERMARG, ARGP_SIMPLENAME) |
98 | #define ARGP_CREATE_BIT_FIELD_OP ARGP_LIST3 (ARGP_TERMARG, ARGP_TERMARG, ARGP_NAME) | 98 | #define ARGP_CREATE_BIT_FIELD_OP ARGP_LIST3 (ARGP_TERMARG, ARGP_TERMARG, ARGP_NAME) |
99 | #define ARGP_CREATE_BYTE_FIELD_OP ARGP_LIST3 (ARGP_TERMARG, ARGP_TERMARG, ARGP_NAME) | 99 | #define ARGP_CREATE_BYTE_FIELD_OP ARGP_LIST3 (ARGP_TERMARG, ARGP_TERMARG, ARGP_NAME) |
100 | #define ARGP_CREATE_DWORD_FIELD_OP ARGP_LIST3 (ARGP_TERMARG, ARGP_TERMARG, ARGP_NAME) | 100 | #define ARGP_CREATE_DWORD_FIELD_OP ARGP_LIST3 (ARGP_TERMARG, ARGP_TERMARG, ARGP_NAME) |
diff --git a/include/acpi/acoutput.h b/include/acpi/acoutput.h index 7785d481dc3e..8d5039d0b430 100644 --- a/include/acpi/acoutput.h +++ b/include/acpi/acoutput.h | |||
@@ -50,7 +50,7 @@ | |||
50 | * component basis and a per-exception-type basis. | 50 | * component basis and a per-exception-type basis. |
51 | */ | 51 | */ |
52 | 52 | ||
53 | /* Component IDs are used in the global "debug_layer" */ | 53 | /* Component IDs are used in the global "DebugLayer" */ |
54 | 54 | ||
55 | #define ACPI_UTILITIES 0x00000001 | 55 | #define ACPI_UTILITIES 0x00000001 |
56 | #define ACPI_HARDWARE 0x00000002 | 56 | #define ACPI_HARDWARE 0x00000002 |
@@ -121,7 +121,7 @@ | |||
121 | #define ACPI_LV_INTERRUPTS 0x08000000 | 121 | #define ACPI_LV_INTERRUPTS 0x08000000 |
122 | #define ACPI_LV_VERBOSITY3 0x0F000000 | ACPI_LV_VERBOSITY2 | 122 | #define ACPI_LV_VERBOSITY3 0x0F000000 | ACPI_LV_VERBOSITY2 |
123 | 123 | ||
124 | /* Exceptionally verbose output -- also used in the global "debug_level" */ | 124 | /* Exceptionally verbose output -- also used in the global "DebugLevel" */ |
125 | 125 | ||
126 | #define ACPI_LV_AML_DISASSEMBLE 0x10000000 | 126 | #define ACPI_LV_AML_DISASSEMBLE 0x10000000 |
127 | #define ACPI_LV_VERBOSE_INFO 0x20000000 | 127 | #define ACPI_LV_VERBOSE_INFO 0x20000000 |
@@ -135,7 +135,7 @@ | |||
135 | */ | 135 | */ |
136 | #define ACPI_DEBUG_LEVEL(dl) (u32) dl,ACPI_DEBUG_PARAMETERS | 136 | #define ACPI_DEBUG_LEVEL(dl) (u32) dl,ACPI_DEBUG_PARAMETERS |
137 | 137 | ||
138 | /* Exception level -- used in the global "debug_level" */ | 138 | /* Exception level -- used in the global "DebugLevel" */ |
139 | 139 | ||
140 | #define ACPI_DB_INIT ACPI_DEBUG_LEVEL (ACPI_LV_INIT) | 140 | #define ACPI_DB_INIT ACPI_DEBUG_LEVEL (ACPI_LV_INIT) |
141 | #define ACPI_DB_DEBUG_OBJECT ACPI_DEBUG_LEVEL (ACPI_LV_DEBUG_OBJECT) | 141 | #define ACPI_DB_DEBUG_OBJECT ACPI_DEBUG_LEVEL (ACPI_LV_DEBUG_OBJECT) |
@@ -144,13 +144,13 @@ | |||
144 | 144 | ||
145 | /* | 145 | /* |
146 | * These two levels are essentially obsolete, all instances in the | 146 | * These two levels are essentially obsolete, all instances in the |
147 | * ACPICA core code have been replaced by REPORT_ERROR and REPORT_WARNING | 147 | * ACPICA core code have been replaced by ACPI_ERROR and ACPI_WARNING |
148 | * (Kept here because some drivers may still use them) | 148 | * (Kept here because some drivers may still use them) |
149 | */ | 149 | */ |
150 | #define ACPI_DB_ERROR ACPI_DEBUG_LEVEL (ACPI_LV_ERROR) | 150 | #define ACPI_DB_ERROR ACPI_DEBUG_LEVEL (ACPI_LV_ERROR) |
151 | #define ACPI_DB_WARN ACPI_DEBUG_LEVEL (ACPI_LV_WARN) | 151 | #define ACPI_DB_WARN ACPI_DEBUG_LEVEL (ACPI_LV_WARN) |
152 | 152 | ||
153 | /* Trace level -- also used in the global "debug_level" */ | 153 | /* Trace level -- also used in the global "DebugLevel" */ |
154 | 154 | ||
155 | #define ACPI_DB_INIT_NAMES ACPI_DEBUG_LEVEL (ACPI_LV_INIT_NAMES) | 155 | #define ACPI_DB_INIT_NAMES ACPI_DEBUG_LEVEL (ACPI_LV_INIT_NAMES) |
156 | #define ACPI_DB_THREADS ACPI_DEBUG_LEVEL (ACPI_LV_THREADS) | 156 | #define ACPI_DB_THREADS ACPI_DEBUG_LEVEL (ACPI_LV_THREADS) |
diff --git a/include/acpi/acparser.h b/include/acpi/acparser.h index 5a1ff484af33..9d49d3c41cd9 100644 --- a/include/acpi/acparser.h +++ b/include/acpi/acparser.h | |||
@@ -46,7 +46,7 @@ | |||
46 | 46 | ||
47 | #define OP_HAS_RETURN_VALUE 1 | 47 | #define OP_HAS_RETURN_VALUE 1 |
48 | 48 | ||
49 | /* variable # arguments */ | 49 | /* Variable number of arguments. This field must be 32 bits */ |
50 | 50 | ||
51 | #define ACPI_VAR_ARGS ACPI_UINT32_MAX | 51 | #define ACPI_VAR_ARGS ACPI_UINT32_MAX |
52 | 52 | ||
@@ -71,7 +71,7 @@ | |||
71 | /* | 71 | /* |
72 | * psxface - Parser external interfaces | 72 | * psxface - Parser external interfaces |
73 | */ | 73 | */ |
74 | acpi_status acpi_ps_execute_method(struct acpi_parameter_info *info); | 74 | acpi_status acpi_ps_execute_method(struct acpi_evaluate_info *info); |
75 | 75 | ||
76 | /* | 76 | /* |
77 | * psargs - Parse AML opcode arguments | 77 | * psargs - Parse AML opcode arguments |
diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h index 7f8ed9dbc7b2..a2b3e390a503 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, |
@@ -329,7 +329,7 @@ int acpi_bus_set_power(acpi_handle handle, int state); | |||
329 | int acpi_bus_generate_event(struct acpi_device *device, u8 type, int data); | 329 | int acpi_bus_generate_event(struct acpi_device *device, u8 type, int data); |
330 | int acpi_bus_receive_event(struct acpi_bus_event *event); | 330 | int acpi_bus_receive_event(struct acpi_bus_event *event); |
331 | int acpi_bus_register_driver(struct acpi_driver *driver); | 331 | int acpi_bus_register_driver(struct acpi_driver *driver); |
332 | int acpi_bus_unregister_driver(struct acpi_driver *driver); | 332 | void acpi_bus_unregister_driver(struct acpi_driver *driver); |
333 | int acpi_bus_add(struct acpi_device **child, struct acpi_device *parent, | 333 | int acpi_bus_add(struct acpi_device **child, struct acpi_device *parent, |
334 | acpi_handle handle, int type); | 334 | acpi_handle handle, int type); |
335 | int acpi_bus_trim(struct acpi_device *start, int rmdevice); | 335 | int acpi_bus_trim(struct acpi_device *start, int rmdevice); |
diff --git a/include/acpi/acpiosxf.h b/include/acpi/acpiosxf.h index 970e9a6372c3..8f473c83b7c4 100644 --- a/include/acpi/acpiosxf.h +++ b/include/acpi/acpiosxf.h | |||
@@ -50,12 +50,16 @@ | |||
50 | #include "platform/acenv.h" | 50 | #include "platform/acenv.h" |
51 | #include "actypes.h" | 51 | #include "actypes.h" |
52 | 52 | ||
53 | /* Priorities for acpi_os_queue_for_execution */ | 53 | /* Types for acpi_os_execute */ |
54 | 54 | ||
55 | #define OSD_PRIORITY_GPE 1 | 55 | typedef enum { |
56 | #define OSD_PRIORITY_HIGH 2 | 56 | OSL_GLOBAL_LOCK_HANDLER, |
57 | #define OSD_PRIORITY_MED 3 | 57 | OSL_NOTIFY_HANDLER, |
58 | #define OSD_PRIORITY_LO 4 | 58 | OSL_GPE_HANDLER, |
59 | OSL_DEBUGGER_THREAD, | ||
60 | OSL_EC_POLL_HANDLER, | ||
61 | OSL_EC_BURST_HANDLER | ||
62 | } acpi_execute_type; | ||
59 | 63 | ||
60 | #define ACPI_NO_UNIT_LIMIT ((u32) -1) | 64 | #define ACPI_NO_UNIT_LIMIT ((u32) -1) |
61 | #define ACPI_MUTEX_SEM 1 | 65 | #define ACPI_MUTEX_SEM 1 |
@@ -161,13 +165,11 @@ acpi_os_remove_interrupt_handler(u32 gsi, acpi_osd_handler service_routine); | |||
161 | /* | 165 | /* |
162 | * Threads and Scheduling | 166 | * Threads and Scheduling |
163 | */ | 167 | */ |
164 | u32 acpi_os_get_thread_id(void); | 168 | acpi_thread_id acpi_os_get_thread_id(void); |
165 | 169 | ||
166 | acpi_status | 170 | acpi_status |
167 | acpi_os_queue_for_execution(u32 priority, | 171 | acpi_os_execute(acpi_execute_type type, |
168 | acpi_osd_exec_callback function, void *context); | 172 | acpi_osd_exec_callback function, void *context); |
169 | |||
170 | void acpi_os_wait_events_complete(void *context); | ||
171 | 173 | ||
172 | void acpi_os_wait_events_complete(void *context); | 174 | void acpi_os_wait_events_complete(void *context); |
173 | 175 | ||
@@ -214,6 +216,12 @@ acpi_os_derive_pci_id(acpi_handle rhandle, | |||
214 | /* | 216 | /* |
215 | * Miscellaneous | 217 | * Miscellaneous |
216 | */ | 218 | */ |
219 | acpi_status acpi_os_validate_interface(char *interface); | ||
220 | |||
221 | acpi_status | ||
222 | acpi_os_validate_address(u8 space_id, | ||
223 | acpi_physical_address address, acpi_size length); | ||
224 | |||
217 | u8 acpi_os_readable(void *pointer, acpi_size length); | 225 | u8 acpi_os_readable(void *pointer, acpi_size length); |
218 | 226 | ||
219 | #ifdef ACPI_FUTURE_USAGE | 227 | #ifdef ACPI_FUTURE_USAGE |
@@ -255,11 +263,4 @@ char *acpi_os_get_next_filename(void *dir_handle); | |||
255 | 263 | ||
256 | void acpi_os_close_directory(void *dir_handle); | 264 | void acpi_os_close_directory(void *dir_handle); |
257 | 265 | ||
258 | /* | ||
259 | * Debug | ||
260 | */ | ||
261 | void | ||
262 | acpi_os_dbg_assert(void *failed_assertion, | ||
263 | void *file_name, u32 line_number, char *message); | ||
264 | |||
265 | #endif /* __ACPIOSXF_H__ */ | 266 | #endif /* __ACPIOSXF_H__ */ |
diff --git a/include/acpi/acpixf.h b/include/acpi/acpixf.h index 66cf2ecef57a..049e9aa1b867 100644 --- a/include/acpi/acpixf.h +++ b/include/acpi/acpixf.h | |||
@@ -268,7 +268,7 @@ acpi_status acpi_remove_gpe_block(acpi_handle gpe_device); | |||
268 | * Resource interfaces | 268 | * Resource interfaces |
269 | */ | 269 | */ |
270 | typedef | 270 | typedef |
271 | acpi_status(*ACPI_WALK_RESOURCE_CALLBACK) (struct acpi_resource * resource, | 271 | acpi_status(*acpi_walk_resource_callback) (struct acpi_resource * resource, |
272 | void *context); | 272 | void *context); |
273 | 273 | ||
274 | acpi_status | 274 | acpi_status |
@@ -290,7 +290,7 @@ acpi_get_possible_resources(acpi_handle device_handle, | |||
290 | acpi_status | 290 | acpi_status |
291 | acpi_walk_resources(acpi_handle device_handle, | 291 | acpi_walk_resources(acpi_handle device_handle, |
292 | char *name, | 292 | char *name, |
293 | ACPI_WALK_RESOURCE_CALLBACK user_function, void *context); | 293 | acpi_walk_resource_callback user_function, void *context); |
294 | 294 | ||
295 | acpi_status | 295 | acpi_status |
296 | acpi_set_current_resources(acpi_handle device_handle, | 296 | acpi_set_current_resources(acpi_handle device_handle, |
diff --git a/include/acpi/acresrc.h b/include/acpi/acresrc.h index fa02e8083381..ad11fc13fbef 100644 --- a/include/acpi/acresrc.h +++ b/include/acpi/acresrc.h | |||
@@ -164,23 +164,26 @@ acpi_rs_create_pci_routing_table(union acpi_operand_object *package_object, | |||
164 | /* | 164 | /* |
165 | * rsutils | 165 | * rsutils |
166 | */ | 166 | */ |
167 | |||
167 | acpi_status | 168 | acpi_status |
168 | acpi_rs_get_prt_method_data(acpi_handle handle, struct acpi_buffer *ret_buffer); | 169 | acpi_rs_get_prt_method_data(struct acpi_namespace_node *node, |
170 | struct acpi_buffer *ret_buffer); | ||
169 | 171 | ||
170 | acpi_status | 172 | acpi_status |
171 | acpi_rs_get_crs_method_data(acpi_handle handle, struct acpi_buffer *ret_buffer); | 173 | acpi_rs_get_crs_method_data(struct acpi_namespace_node *node, |
174 | struct acpi_buffer *ret_buffer); | ||
172 | 175 | ||
173 | #ifdef ACPI_FUTURE_USAGE | ||
174 | acpi_status | 176 | acpi_status |
175 | acpi_rs_get_prs_method_data(acpi_handle handle, struct acpi_buffer *ret_buffer); | 177 | acpi_rs_get_prs_method_data(struct acpi_namespace_node *node, |
176 | #endif /* ACPI_FUTURE_USAGE */ | 178 | struct acpi_buffer *ret_buffer); |
177 | 179 | ||
178 | acpi_status | 180 | acpi_status |
179 | acpi_rs_get_method_data(acpi_handle handle, | 181 | acpi_rs_get_method_data(acpi_handle handle, |
180 | char *path, struct acpi_buffer *ret_buffer); | 182 | char *path, struct acpi_buffer *ret_buffer); |
181 | 183 | ||
182 | acpi_status | 184 | acpi_status |
183 | acpi_rs_set_srs_method_data(acpi_handle handle, struct acpi_buffer *ret_buffer); | 185 | acpi_rs_set_srs_method_data(struct acpi_namespace_node *node, |
186 | struct acpi_buffer *ret_buffer); | ||
184 | 187 | ||
185 | /* | 188 | /* |
186 | * rscalc | 189 | * rscalc |
@@ -198,8 +201,9 @@ acpi_rs_get_pci_routing_table_length(union acpi_operand_object *package_object, | |||
198 | acpi_size * buffer_size_needed); | 201 | acpi_size * buffer_size_needed); |
199 | 202 | ||
200 | acpi_status | 203 | acpi_status |
201 | acpi_rs_convert_aml_to_resources(u8 * aml_buffer, | 204 | acpi_rs_convert_aml_to_resources(u8 * aml, |
202 | u32 aml_buffer_length, u8 * output_buffer); | 205 | u32 length, |
206 | u32 offset, u8 resource_index, void **context); | ||
203 | 207 | ||
204 | acpi_status | 208 | acpi_status |
205 | acpi_rs_convert_resources_to_aml(struct acpi_resource *resource, | 209 | acpi_rs_convert_resources_to_aml(struct acpi_resource *resource, |
diff --git a/include/acpi/acstruct.h b/include/acpi/acstruct.h index d8c1c2cdac0c..5e8095f0f78f 100644 --- a/include/acpi/acstruct.h +++ b/include/acpi/acstruct.h | |||
@@ -44,6 +44,8 @@ | |||
44 | #ifndef __ACSTRUCT_H__ | 44 | #ifndef __ACSTRUCT_H__ |
45 | #define __ACSTRUCT_H__ | 45 | #define __ACSTRUCT_H__ |
46 | 46 | ||
47 | /* acpisrc:struct_defs -- for acpisrc conversion */ | ||
48 | |||
47 | /***************************************************************************** | 49 | /***************************************************************************** |
48 | * | 50 | * |
49 | * Tree walking typedefs and structs | 51 | * Tree walking typedefs and structs |
@@ -51,67 +53,76 @@ | |||
51 | ****************************************************************************/ | 53 | ****************************************************************************/ |
52 | 54 | ||
53 | /* | 55 | /* |
54 | * Walk state - current state of a parse tree walk. Used for both a leisurely stroll through | 56 | * Walk state - current state of a parse tree walk. Used for both a leisurely |
55 | * the tree (for whatever reason), and for control method execution. | 57 | * stroll through the tree (for whatever reason), and for control method |
58 | * execution. | ||
56 | */ | 59 | */ |
57 | #define ACPI_NEXT_OP_DOWNWARD 1 | 60 | #define ACPI_NEXT_OP_DOWNWARD 1 |
58 | #define ACPI_NEXT_OP_UPWARD 2 | 61 | #define ACPI_NEXT_OP_UPWARD 2 |
59 | 62 | ||
63 | /* | ||
64 | * Groups of definitions for walk_type used for different implementations of | ||
65 | * walkers (never simultaneously) - flags for interpreter: | ||
66 | */ | ||
60 | #define ACPI_WALK_NON_METHOD 0 | 67 | #define ACPI_WALK_NON_METHOD 0 |
61 | #define ACPI_WALK_METHOD 1 | 68 | #define ACPI_WALK_METHOD 0x01 |
62 | #define ACPI_WALK_METHOD_RESTART 2 | 69 | #define ACPI_WALK_METHOD_RESTART 0x02 |
63 | #define ACPI_WALK_CONST_REQUIRED 3 | 70 | |
64 | #define ACPI_WALK_CONST_OPTIONAL 4 | 71 | /* Flags for i_aSL compiler only */ |
72 | |||
73 | #define ACPI_WALK_CONST_REQUIRED 0x10 | ||
74 | #define ACPI_WALK_CONST_OPTIONAL 0x20 | ||
65 | 75 | ||
66 | struct acpi_walk_state { | 76 | struct acpi_walk_state { |
67 | u8 data_type; /* To differentiate various internal objs MUST BE FIRST! */ | 77 | struct acpi_walk_state *next; /* Next walk_state in list */ |
78 | u8 descriptor_type; /* To differentiate various internal objs */ | ||
68 | u8 walk_type; | 79 | u8 walk_type; |
69 | acpi_owner_id owner_id; /* Owner of objects created during the walk */ | 80 | u16 opcode; /* Current AML opcode */ |
70 | u8 last_predicate; /* Result of last predicate */ | ||
71 | u8 current_result; /* */ | ||
72 | u8 next_op_info; /* Info about next_op */ | 81 | u8 next_op_info; /* Info about next_op */ |
73 | u8 num_operands; /* Stack pointer for Operands[] array */ | 82 | u8 num_operands; /* Stack pointer for Operands[] array */ |
83 | acpi_owner_id owner_id; /* Owner of objects created during the walk */ | ||
84 | u8 last_predicate; /* Result of last predicate */ | ||
85 | u8 current_result; | ||
74 | u8 return_used; | 86 | u8 return_used; |
75 | u16 opcode; /* Current AML opcode */ | ||
76 | u8 scope_depth; | 87 | u8 scope_depth; |
77 | u8 pass_number; /* Parse pass during table load */ | 88 | u8 pass_number; /* Parse pass during table load */ |
78 | u32 arg_count; /* push for fixed or var args */ | ||
79 | u32 aml_offset; | 89 | u32 aml_offset; |
80 | u32 arg_types; | 90 | u32 arg_types; |
81 | u32 method_breakpoint; /* For single stepping */ | 91 | u32 method_breakpoint; /* For single stepping */ |
82 | u32 user_breakpoint; /* User AML breakpoint */ | 92 | u32 user_breakpoint; /* User AML breakpoint */ |
83 | u32 parse_flags; | 93 | u32 parse_flags; |
94 | |||
95 | struct acpi_parse_state parser_state; /* Current state of parser */ | ||
84 | u32 prev_arg_types; | 96 | u32 prev_arg_types; |
97 | u32 arg_count; /* push for fixed or var args */ | ||
85 | 98 | ||
86 | u8 *aml_last_while; | ||
87 | struct acpi_namespace_node arguments[ACPI_METHOD_NUM_ARGS]; /* Control method arguments */ | 99 | struct acpi_namespace_node arguments[ACPI_METHOD_NUM_ARGS]; /* Control method arguments */ |
100 | struct acpi_namespace_node local_variables[ACPI_METHOD_NUM_LOCALS]; /* Control method locals */ | ||
101 | union acpi_operand_object *operands[ACPI_OBJ_NUM_OPERANDS + 1]; /* Operands passed to the interpreter (+1 for NULL terminator) */ | ||
102 | union acpi_operand_object **params; | ||
103 | |||
104 | u8 *aml_last_while; | ||
88 | union acpi_operand_object **caller_return_desc; | 105 | union acpi_operand_object **caller_return_desc; |
89 | union acpi_generic_state *control_state; /* List of control states (nested IFs) */ | 106 | union acpi_generic_state *control_state; /* List of control states (nested IFs) */ |
90 | struct acpi_namespace_node *deferred_node; /* Used when executing deferred opcodes */ | 107 | struct acpi_namespace_node *deferred_node; /* Used when executing deferred opcodes */ |
91 | struct acpi_gpe_event_info *gpe_event_info; /* Info for GPE (_Lxx/_Exx methods only */ | 108 | struct acpi_gpe_event_info *gpe_event_info; /* Info for GPE (_Lxx/_Exx methods only */ |
92 | union acpi_operand_object *implicit_return_obj; | 109 | union acpi_operand_object *implicit_return_obj; |
93 | struct acpi_namespace_node local_variables[ACPI_METHOD_NUM_LOCALS]; /* Control method locals */ | ||
94 | struct acpi_namespace_node *method_call_node; /* Called method Node */ | 110 | struct acpi_namespace_node *method_call_node; /* Called method Node */ |
95 | union acpi_parse_object *method_call_op; /* method_call Op if running a method */ | 111 | union acpi_parse_object *method_call_op; /* method_call Op if running a method */ |
96 | union acpi_operand_object *method_desc; /* Method descriptor if running a method */ | 112 | union acpi_operand_object *method_desc; /* Method descriptor if running a method */ |
97 | struct acpi_namespace_node *method_node; /* Method node if running a method. */ | 113 | struct acpi_namespace_node *method_node; /* Method node if running a method. */ |
98 | union acpi_parse_object *op; /* Current parser op */ | 114 | union acpi_parse_object *op; /* Current parser op */ |
99 | union acpi_operand_object *operands[ACPI_OBJ_NUM_OPERANDS + 1]; /* Operands passed to the interpreter (+1 for NULL terminator) */ | ||
100 | const struct acpi_opcode_info *op_info; /* Info on current opcode */ | 115 | const struct acpi_opcode_info *op_info; /* Info on current opcode */ |
101 | union acpi_parse_object *origin; /* Start of walk [Obsolete] */ | 116 | union acpi_parse_object *origin; /* Start of walk [Obsolete] */ |
102 | union acpi_operand_object **params; | ||
103 | struct acpi_parse_state parser_state; /* Current state of parser */ | ||
104 | union acpi_operand_object *result_obj; | 117 | union acpi_operand_object *result_obj; |
105 | union acpi_generic_state *results; /* Stack of accumulated results */ | 118 | union acpi_generic_state *results; /* Stack of accumulated results */ |
106 | union acpi_operand_object *return_desc; /* Return object, if any */ | 119 | union acpi_operand_object *return_desc; /* Return object, if any */ |
107 | union acpi_generic_state *scope_info; /* Stack of nested scopes */ | 120 | union acpi_generic_state *scope_info; /* Stack of nested scopes */ |
108 | |||
109 | union acpi_parse_object *prev_op; /* Last op that was processed */ | 121 | union acpi_parse_object *prev_op; /* Last op that was processed */ |
110 | union acpi_parse_object *next_op; /* next op to be processed */ | 122 | union acpi_parse_object *next_op; /* next op to be processed */ |
123 | struct acpi_thread_state *thread; | ||
111 | acpi_parse_downwards descending_callback; | 124 | acpi_parse_downwards descending_callback; |
112 | acpi_parse_upwards ascending_callback; | 125 | acpi_parse_upwards ascending_callback; |
113 | struct acpi_thread_state *thread; | ||
114 | struct acpi_walk_state *next; /* Next walk_state in list */ | ||
115 | }; | 126 | }; |
116 | 127 | ||
117 | /* Info used by acpi_ps_init_objects */ | 128 | /* Info used by acpi_ps_init_objects */ |
@@ -131,32 +142,6 @@ struct acpi_init_walk_info { | |||
131 | struct acpi_table_desc *table_desc; | 142 | struct acpi_table_desc *table_desc; |
132 | }; | 143 | }; |
133 | 144 | ||
134 | /* Info used by acpi_ns_initialize_devices */ | ||
135 | |||
136 | struct acpi_device_walk_info { | ||
137 | u16 device_count; | ||
138 | u16 num_STA; | ||
139 | u16 num_INI; | ||
140 | struct acpi_table_desc *table_desc; | ||
141 | }; | ||
142 | |||
143 | /* TBD: [Restructure] Merge with struct above */ | ||
144 | |||
145 | struct acpi_walk_info { | ||
146 | u32 debug_level; | ||
147 | u32 count; | ||
148 | acpi_owner_id owner_id; | ||
149 | u8 display_type; | ||
150 | }; | ||
151 | |||
152 | /* Display Types */ | ||
153 | |||
154 | #define ACPI_DISPLAY_SUMMARY (u8) 0 | ||
155 | #define ACPI_DISPLAY_OBJECTS (u8) 1 | ||
156 | #define ACPI_DISPLAY_MASK (u8) 1 | ||
157 | |||
158 | #define ACPI_DISPLAY_SHORT (u8) 2 | ||
159 | |||
160 | struct acpi_get_devices_info { | 145 | struct acpi_get_devices_info { |
161 | acpi_walk_callback user_function; | 146 | acpi_walk_callback user_function; |
162 | void *context; | 147 | void *context; |
@@ -189,16 +174,21 @@ union acpi_aml_operands { | |||
189 | } mid; | 174 | } mid; |
190 | }; | 175 | }; |
191 | 176 | ||
192 | /* Internal method parameter list */ | 177 | /* |
193 | 178 | * Structure used to pass object evaluation parameters. | |
194 | struct acpi_parameter_info { | 179 | * Purpose is to reduce CPU stack use. |
195 | struct acpi_namespace_node *node; | 180 | */ |
181 | struct acpi_evaluate_info { | ||
182 | struct acpi_namespace_node *prefix_node; | ||
183 | char *pathname; | ||
196 | union acpi_operand_object *obj_desc; | 184 | union acpi_operand_object *obj_desc; |
197 | union acpi_operand_object **parameters; | 185 | union acpi_operand_object **parameters; |
186 | struct acpi_namespace_node *resolved_node; | ||
198 | union acpi_operand_object *return_object; | 187 | union acpi_operand_object *return_object; |
199 | u8 pass_number; | 188 | u8 pass_number; |
200 | u8 parameter_type; | 189 | u8 parameter_type; |
201 | u8 return_object_type; | 190 | u8 return_object_type; |
191 | u8 flags; | ||
202 | }; | 192 | }; |
203 | 193 | ||
204 | /* Types for parameter_type above */ | 194 | /* Types for parameter_type above */ |
@@ -206,4 +196,35 @@ struct acpi_parameter_info { | |||
206 | #define ACPI_PARAM_ARGS 0 | 196 | #define ACPI_PARAM_ARGS 0 |
207 | #define ACPI_PARAM_GPE 1 | 197 | #define ACPI_PARAM_GPE 1 |
208 | 198 | ||
199 | /* Values for Flags above */ | ||
200 | |||
201 | #define ACPI_IGNORE_RETURN_VALUE 1 | ||
202 | |||
203 | /* Info used by acpi_ns_initialize_devices */ | ||
204 | |||
205 | struct acpi_device_walk_info { | ||
206 | u16 device_count; | ||
207 | u16 num_STA; | ||
208 | u16 num_INI; | ||
209 | struct acpi_table_desc *table_desc; | ||
210 | struct acpi_evaluate_info *evaluate_info; | ||
211 | }; | ||
212 | |||
213 | /* TBD: [Restructure] Merge with struct above */ | ||
214 | |||
215 | struct acpi_walk_info { | ||
216 | u32 debug_level; | ||
217 | u32 count; | ||
218 | acpi_owner_id owner_id; | ||
219 | u8 display_type; | ||
220 | }; | ||
221 | |||
222 | /* Display Types */ | ||
223 | |||
224 | #define ACPI_DISPLAY_SUMMARY (u8) 0 | ||
225 | #define ACPI_DISPLAY_OBJECTS (u8) 1 | ||
226 | #define ACPI_DISPLAY_MASK (u8) 1 | ||
227 | |||
228 | #define ACPI_DISPLAY_SHORT (u8) 2 | ||
229 | |||
209 | #endif | 230 | #endif |
diff --git a/include/acpi/actables.h b/include/acpi/actables.h index 30a47542e1c8..4dbaf02fe526 100644 --- a/include/acpi/actables.h +++ b/include/acpi/actables.h | |||
@@ -136,7 +136,11 @@ acpi_status acpi_tb_is_table_installed(struct acpi_table_desc *new_table_desc); | |||
136 | acpi_status | 136 | acpi_status |
137 | acpi_tb_verify_table_checksum(struct acpi_table_header *table_header); | 137 | acpi_tb_verify_table_checksum(struct acpi_table_header *table_header); |
138 | 138 | ||
139 | u8 acpi_tb_generate_checksum(void *buffer, u32 length); | 139 | u8 acpi_tb_sum_table(void *buffer, u32 length); |
140 | |||
141 | u8 acpi_tb_generate_checksum(struct acpi_table_header *table); | ||
142 | |||
143 | void acpi_tb_set_checksum(struct acpi_table_header *table); | ||
140 | 144 | ||
141 | acpi_status | 145 | acpi_status |
142 | acpi_tb_validate_table_header(struct acpi_table_header *table_header); | 146 | acpi_tb_validate_table_header(struct acpi_table_header *table_header); |
diff --git a/include/acpi/actbl.h b/include/acpi/actbl.h index ed53f842dad4..b125ceed9cb7 100644 --- a/include/acpi/actbl.h +++ b/include/acpi/actbl.h | |||
@@ -1,6 +1,6 @@ | |||
1 | /****************************************************************************** | 1 | /****************************************************************************** |
2 | * | 2 | * |
3 | * Name: actbl.h - Table data structures defined in ACPI specification | 3 | * Name: actbl.h - Basic ACPI Table Definitions |
4 | * | 4 | * |
5 | *****************************************************************************/ | 5 | *****************************************************************************/ |
6 | 6 | ||
@@ -45,66 +45,45 @@ | |||
45 | #define __ACTBL_H__ | 45 | #define __ACTBL_H__ |
46 | 46 | ||
47 | /* | 47 | /* |
48 | * Note about bitfields: The u8 type is used for bitfields in ACPI tables. | 48 | * Values for description table header signatures. Useful because they make |
49 | * This is the only type that is even remotely portable. Anything else is not | 49 | * it more difficult to inadvertently type in the wrong signature. |
50 | * portable, so do not use any other bitfield types. | ||
51 | */ | ||
52 | |||
53 | /* | ||
54 | * Values for description table header signatures | ||
55 | */ | 50 | */ |
56 | #define RSDP_NAME "RSDP" | ||
57 | #define RSDP_SIG "RSD PTR " /* RSDT Pointer signature */ | ||
58 | #define APIC_SIG "APIC" /* Multiple APIC Description Table */ | ||
59 | #define DSDT_SIG "DSDT" /* Differentiated System Description Table */ | 51 | #define DSDT_SIG "DSDT" /* Differentiated System Description Table */ |
60 | #define FADT_SIG "FACP" /* Fixed ACPI Description Table */ | 52 | #define FADT_SIG "FACP" /* Fixed ACPI Description Table */ |
61 | #define FACS_SIG "FACS" /* Firmware ACPI Control Structure */ | 53 | #define FACS_SIG "FACS" /* Firmware ACPI Control Structure */ |
62 | #define PSDT_SIG "PSDT" /* Persistent System Description Table */ | 54 | #define PSDT_SIG "PSDT" /* Persistent System Description Table */ |
55 | #define RSDP_SIG "RSD PTR " /* Root System Description Pointer */ | ||
63 | #define RSDT_SIG "RSDT" /* Root System Description Table */ | 56 | #define RSDT_SIG "RSDT" /* Root System Description Table */ |
64 | #define XSDT_SIG "XSDT" /* Extended System Description Table */ | 57 | #define XSDT_SIG "XSDT" /* Extended System Description Table */ |
65 | #define SSDT_SIG "SSDT" /* Secondary System Description Table */ | 58 | #define SSDT_SIG "SSDT" /* Secondary System Description Table */ |
66 | #define SBST_SIG "SBST" /* Smart Battery Specification Table */ | 59 | #define RSDP_NAME "RSDP" |
67 | #define SPIC_SIG "SPIC" /* IOSAPIC table */ | ||
68 | #define BOOT_SIG "BOOT" /* Boot table */ | ||
69 | |||
70 | #define GL_OWNED 0x02 /* Ownership of global lock is bit 1 */ | ||
71 | 60 | ||
72 | /* | 61 | /* |
73 | * Common table types. The base code can remain | 62 | * All tables and structures must be byte-packed to match the ACPI |
74 | * constant if the underlying tables are changed | 63 | * specification, since the tables are provided by the system BIOS |
75 | */ | 64 | */ |
76 | #define RSDT_DESCRIPTOR struct rsdt_descriptor_rev2 | ||
77 | #define XSDT_DESCRIPTOR struct xsdt_descriptor_rev2 | ||
78 | #define FACS_DESCRIPTOR struct facs_descriptor_rev2 | ||
79 | #define FADT_DESCRIPTOR struct fadt_descriptor_rev2 | ||
80 | |||
81 | #pragma pack(1) | 65 | #pragma pack(1) |
82 | 66 | ||
83 | /* | 67 | /* |
84 | * ACPI Version-independent tables | 68 | * These are the ACPI tables that are directly consumed by the subsystem. |
69 | * | ||
70 | * The RSDP and FACS do not use the common ACPI table header. All other ACPI | ||
71 | * tables use the header. | ||
85 | * | 72 | * |
86 | * NOTE: The tables that are specific to ACPI versions (1.0, 2.0, etc.) | 73 | * Note about bitfields: The u8 type is used for bitfields in ACPI tables. |
87 | * are in separate files. | 74 | * This is the only type that is even remotely portable. Anything else is not |
75 | * portable, so do not use any other bitfield types. | ||
88 | */ | 76 | */ |
89 | struct rsdp_descriptor { /* Root System Descriptor Pointer */ | ||
90 | char signature[8]; /* ACPI signature, contains "RSD PTR " */ | ||
91 | u8 checksum; /* ACPI 1.0 checksum */ | ||
92 | char oem_id[6]; /* OEM identification */ | ||
93 | u8 revision; /* Must be (0) for ACPI 1.0 or (2) for ACPI 2.0+ */ | ||
94 | u32 rsdt_physical_address; /* 32-bit physical address of the RSDT */ | ||
95 | u32 length; /* XSDT Length in bytes, including header */ | ||
96 | u64 xsdt_physical_address; /* 64-bit physical address of the XSDT */ | ||
97 | u8 extended_checksum; /* Checksum of entire table (ACPI 2.0) */ | ||
98 | char reserved[3]; /* Reserved, must be zero */ | ||
99 | }; | ||
100 | 77 | ||
101 | struct acpi_common_facs { /* Common FACS for internal use */ | 78 | /******************************************************************************* |
102 | u32 *global_lock; | 79 | * |
103 | u64 *firmware_waking_vector; | 80 | * ACPI Table Header. This common header is used by all tables except the |
104 | u8 vector_width; | 81 | * RSDP and FACS. The define is used for direct inclusion of header into |
105 | }; | 82 | * other ACPI tables |
83 | * | ||
84 | ******************************************************************************/ | ||
106 | 85 | ||
107 | #define ACPI_TABLE_HEADER_DEF /* ACPI common table header */ \ | 86 | #define ACPI_TABLE_HEADER_DEF \ |
108 | char signature[4]; /* ASCII table signature */\ | 87 | char signature[4]; /* ASCII table signature */\ |
109 | u32 length; /* Length of table in bytes, including this header */\ | 88 | u32 length; /* Length of table in bytes, including this header */\ |
110 | u8 revision; /* ACPI Specification minor version # */\ | 89 | u8 revision; /* ACPI Specification minor version # */\ |
@@ -112,154 +91,239 @@ struct acpi_common_facs { /* Common FACS for internal use */ | |||
112 | char oem_id[6]; /* ASCII OEM identification */\ | 91 | char oem_id[6]; /* ASCII OEM identification */\ |
113 | char oem_table_id[8]; /* ASCII OEM table identification */\ | 92 | char oem_table_id[8]; /* ASCII OEM table identification */\ |
114 | u32 oem_revision; /* OEM revision number */\ | 93 | u32 oem_revision; /* OEM revision number */\ |
115 | char asl_compiler_id [4]; /* ASCII ASL compiler vendor ID */\ | 94 | char asl_compiler_id[4]; /* ASCII ASL compiler vendor ID */\ |
116 | u32 asl_compiler_revision; /* ASL compiler version */ | 95 | u32 asl_compiler_revision; /* ASL compiler version */ |
117 | 96 | ||
118 | struct acpi_table_header { /* ACPI common table header */ | 97 | struct acpi_table_header { |
119 | ACPI_TABLE_HEADER_DEF}; | 98 | ACPI_TABLE_HEADER_DEF}; |
120 | 99 | ||
121 | /* | 100 | /* |
122 | * MADT values and structures | 101 | * GAS - Generic Address Structure (ACPI 2.0+) |
123 | */ | 102 | */ |
103 | struct acpi_generic_address { | ||
104 | u8 address_space_id; /* Address space where struct or register exists */ | ||
105 | u8 register_bit_width; /* Size in bits of given register */ | ||
106 | u8 register_bit_offset; /* Bit offset within the register */ | ||
107 | u8 access_width; /* Minimum Access size (ACPI 3.0) */ | ||
108 | u64 address; /* 64-bit address of struct or register */ | ||
109 | }; | ||
124 | 110 | ||
125 | /* Values for MADT PCATCompat */ | 111 | /******************************************************************************* |
112 | * | ||
113 | * RSDP - Root System Description Pointer (Signature is "RSD PTR ") | ||
114 | * | ||
115 | ******************************************************************************/ | ||
116 | |||
117 | struct rsdp_descriptor { | ||
118 | char signature[8]; /* ACPI signature, contains "RSD PTR " */ | ||
119 | u8 checksum; /* ACPI 1.0 checksum */ | ||
120 | char oem_id[6]; /* OEM identification */ | ||
121 | u8 revision; /* Must be (0) for ACPI 1.0 or (2) for ACPI 2.0+ */ | ||
122 | u32 rsdt_physical_address; /* 32-bit physical address of the RSDT */ | ||
123 | u32 length; /* Table length in bytes, including header (ACPI 2.0+) */ | ||
124 | u64 xsdt_physical_address; /* 64-bit physical address of the XSDT (ACPI 2.0+) */ | ||
125 | u8 extended_checksum; /* Checksum of entire table (ACPI 2.0+) */ | ||
126 | u8 reserved[3]; /* Reserved, must be zero */ | ||
127 | }; | ||
126 | 128 | ||
127 | #define DUAL_PIC 0 | 129 | #define ACPI_RSDP_REV0_SIZE 20 /* Size of original ACPI 1.0 RSDP */ |
128 | #define MULTIPLE_APIC 1 | ||
129 | 130 | ||
130 | /* Master MADT */ | 131 | /******************************************************************************* |
132 | * | ||
133 | * RSDT/XSDT - Root System Description Tables | ||
134 | * | ||
135 | ******************************************************************************/ | ||
131 | 136 | ||
132 | struct multiple_apic_table { | 137 | struct rsdt_descriptor { |
133 | ACPI_TABLE_HEADER_DEF /* ACPI common table header */ | 138 | ACPI_TABLE_HEADER_DEF u32 table_offset_entry[1]; /* Array of pointers to ACPI tables */ |
134 | u32 local_apic_address; /* Physical address of local APIC */ | 139 | }; |
140 | |||
141 | struct xsdt_descriptor { | ||
142 | ACPI_TABLE_HEADER_DEF u64 table_offset_entry[1]; /* Array of pointers to ACPI tables */ | ||
143 | }; | ||
144 | |||
145 | /******************************************************************************* | ||
146 | * | ||
147 | * FACS - Firmware ACPI Control Structure (FACS) | ||
148 | * | ||
149 | ******************************************************************************/ | ||
150 | |||
151 | struct facs_descriptor { | ||
152 | char signature[4]; /* ASCII table signature */ | ||
153 | u32 length; /* Length of structure, in bytes */ | ||
154 | u32 hardware_signature; /* Hardware configuration signature */ | ||
155 | u32 firmware_waking_vector; /* 32-bit physical address of the Firmware Waking Vector */ | ||
156 | u32 global_lock; /* Global Lock for shared hardware resources */ | ||
135 | 157 | ||
136 | /* Flags (32 bits) */ | 158 | /* Flags (32 bits) */ |
137 | 159 | ||
138 | u8 PCATcompat:1; /* 00: System also has dual 8259s */ | 160 | u8 S4bios_f:1; /* 00: S4BIOS support is present */ |
139 | u8:7; /* 01-07: Reserved, must be zero */ | 161 | u8:7; /* 01-07: Reserved, must be zero */ |
140 | u8 reserved1[3]; /* 08-31: Reserved, must be zero */ | 162 | u8 reserved1[3]; /* 08-31: Reserved, must be zero */ |
141 | }; | ||
142 | 163 | ||
143 | /* Values for Type in APIC_HEADER_DEF */ | 164 | u64 xfirmware_waking_vector; /* 64-bit version of the Firmware Waking Vector (ACPI 2.0+) */ |
165 | u8 version; /* Version of this table (ACPI 2.0+) */ | ||
166 | u8 reserved[31]; /* Reserved, must be zero */ | ||
167 | }; | ||
144 | 168 | ||
145 | #define APIC_PROCESSOR 0 | 169 | #define ACPI_GLOCK_PENDING 0x01 /* 00: Pending global lock ownership */ |
146 | #define APIC_IO 1 | 170 | #define ACPI_GLOCK_OWNED 0x02 /* 01: Global lock is owned */ |
147 | #define APIC_XRUPT_OVERRIDE 2 | ||
148 | #define APIC_NMI 3 | ||
149 | #define APIC_LOCAL_NMI 4 | ||
150 | #define APIC_ADDRESS_OVERRIDE 5 | ||
151 | #define APIC_IO_SAPIC 6 | ||
152 | #define APIC_LOCAL_SAPIC 7 | ||
153 | #define APIC_XRUPT_SOURCE 8 | ||
154 | #define APIC_RESERVED 9 /* 9 and greater are reserved */ | ||
155 | 171 | ||
156 | /* | 172 | /* |
157 | * MADT sub-structures (Follow MULTIPLE_APIC_DESCRIPTION_TABLE) | 173 | * Common FACS - This is a version-independent FACS structure used for internal use only |
158 | */ | 174 | */ |
159 | #define APIC_HEADER_DEF /* Common APIC sub-structure header */\ | 175 | struct acpi_common_facs { |
160 | u8 type; \ | 176 | u32 *global_lock; |
161 | u8 length; | 177 | u64 *firmware_waking_vector; |
162 | 178 | u8 vector_width; | |
163 | struct apic_header { | ||
164 | APIC_HEADER_DEF}; | ||
165 | |||
166 | /* Values for MPS INTI flags */ | ||
167 | |||
168 | #define POLARITY_CONFORMS 0 | ||
169 | #define POLARITY_ACTIVE_HIGH 1 | ||
170 | #define POLARITY_RESERVED 2 | ||
171 | #define POLARITY_ACTIVE_LOW 3 | ||
172 | |||
173 | #define TRIGGER_CONFORMS 0 | ||
174 | #define TRIGGER_EDGE 1 | ||
175 | #define TRIGGER_RESERVED 2 | ||
176 | #define TRIGGER_LEVEL 3 | ||
177 | |||
178 | /* Common flag definitions (16 bits each) */ | ||
179 | |||
180 | #define MPS_INTI_FLAGS \ | ||
181 | u8 polarity : 2; /* 00-01: Polarity of APIC I/O input signals */\ | ||
182 | u8 trigger_mode : 2; /* 02-03: Trigger mode of APIC input signals */\ | ||
183 | u8 : 4; /* 04-07: Reserved, must be zero */\ | ||
184 | u8 reserved1; /* 08-15: Reserved, must be zero */ | ||
185 | |||
186 | #define LOCAL_APIC_FLAGS \ | ||
187 | u8 processor_enabled: 1; /* 00: Processor is usable if set */\ | ||
188 | u8 : 7; /* 01-07: Reserved, must be zero */\ | ||
189 | u8 reserved2; /* 08-15: Reserved, must be zero */ | ||
190 | |||
191 | /* Sub-structures for MADT */ | ||
192 | |||
193 | struct madt_processor_apic { | ||
194 | APIC_HEADER_DEF u8 processor_id; /* ACPI processor id */ | ||
195 | u8 local_apic_id; /* Processor's local APIC id */ | ||
196 | LOCAL_APIC_FLAGS}; | ||
197 | |||
198 | struct madt_io_apic { | ||
199 | APIC_HEADER_DEF u8 io_apic_id; /* I/O APIC ID */ | ||
200 | u8 reserved; /* Reserved - must be zero */ | ||
201 | u32 address; /* APIC physical address */ | ||
202 | u32 interrupt; /* Global system interrupt where INTI | ||
203 | * lines start */ | ||
204 | }; | 179 | }; |
205 | 180 | ||
206 | struct madt_interrupt_override { | 181 | /******************************************************************************* |
207 | APIC_HEADER_DEF u8 bus; /* 0 - ISA */ | 182 | * |
208 | u8 source; /* Interrupt source (IRQ) */ | 183 | * FADT - Fixed ACPI Description Table (Signature "FACP") |
209 | u32 interrupt; /* Global system interrupt */ | 184 | * |
210 | MPS_INTI_FLAGS}; | 185 | ******************************************************************************/ |
186 | |||
187 | /* Fields common to all versions of the FADT */ | ||
188 | |||
189 | #define ACPI_FADT_COMMON \ | ||
190 | ACPI_TABLE_HEADER_DEF \ | ||
191 | u32 V1_firmware_ctrl; /* 32-bit physical address of FACS */ \ | ||
192 | u32 V1_dsdt; /* 32-bit physical address of DSDT */ \ | ||
193 | u8 reserved1; /* System Interrupt Model isn't used in ACPI 2.0*/ \ | ||
194 | u8 prefer_PM_profile; /* Conveys preferred power management profile to OSPM. */ \ | ||
195 | u16 sci_int; /* System vector of SCI interrupt */ \ | ||
196 | u32 smi_cmd; /* Port address of SMI command port */ \ | ||
197 | u8 acpi_enable; /* Value to write to smi_cmd to enable ACPI */ \ | ||
198 | u8 acpi_disable; /* Value to write to smi_cmd to disable ACPI */ \ | ||
199 | u8 S4bios_req; /* Value to write to SMI CMD to enter S4BIOS state */ \ | ||
200 | u8 pstate_cnt; /* Processor performance state control*/ \ | ||
201 | u32 V1_pm1a_evt_blk; /* Port address of Power Mgt 1a Event Reg Blk */ \ | ||
202 | u32 V1_pm1b_evt_blk; /* Port address of Power Mgt 1b Event Reg Blk */ \ | ||
203 | u32 V1_pm1a_cnt_blk; /* Port address of Power Mgt 1a Control Reg Blk */ \ | ||
204 | u32 V1_pm1b_cnt_blk; /* Port address of Power Mgt 1b Control Reg Blk */ \ | ||
205 | u32 V1_pm2_cnt_blk; /* Port address of Power Mgt 2 Control Reg Blk */ \ | ||
206 | u32 V1_pm_tmr_blk; /* Port address of Power Mgt Timer Ctrl Reg Blk */ \ | ||
207 | u32 V1_gpe0_blk; /* Port addr of General Purpose acpi_event 0 Reg Blk */ \ | ||
208 | u32 V1_gpe1_blk; /* Port addr of General Purpose acpi_event 1 Reg Blk */ \ | ||
209 | u8 pm1_evt_len; /* Byte Length of ports at pm1_x_evt_blk */ \ | ||
210 | u8 pm1_cnt_len; /* Byte Length of ports at pm1_x_cnt_blk */ \ | ||
211 | u8 pm2_cnt_len; /* Byte Length of ports at pm2_cnt_blk */ \ | ||
212 | u8 pm_tm_len; /* Byte Length of ports at pm_tm_blk */ \ | ||
213 | u8 gpe0_blk_len; /* Byte Length of ports at gpe0_blk */ \ | ||
214 | u8 gpe1_blk_len; /* Byte Length of ports at gpe1_blk */ \ | ||
215 | u8 gpe1_base; /* Offset in gpe model where gpe1 events start */ \ | ||
216 | u8 cst_cnt; /* Support for the _CST object and C States change notification.*/ \ | ||
217 | u16 plvl2_lat; /* Worst case HW latency to enter/exit C2 state */ \ | ||
218 | u16 plvl3_lat; /* Worst case HW latency to enter/exit C3 state */ \ | ||
219 | u16 flush_size; /* Processor's memory cache line width, in bytes */ \ | ||
220 | u16 flush_stride; /* Number of flush strides that need to be read */ \ | ||
221 | u8 duty_offset; /* Processor's duty cycle index in processor's P_CNT reg*/ \ | ||
222 | u8 duty_width; /* Processor's duty cycle value bit width in P_CNT register.*/ \ | ||
223 | u8 day_alrm; /* Index to day-of-month alarm in RTC CMOS RAM */ \ | ||
224 | u8 mon_alrm; /* Index to month-of-year alarm in RTC CMOS RAM */ \ | ||
225 | u8 century; /* Index to century in RTC CMOS RAM */ \ | ||
226 | u16 iapc_boot_arch; /* IA-PC Boot Architecture Flags. See Table 5-10 for description*/ \ | ||
227 | u8 reserved2; /* Reserved, must be zero */ | ||
211 | 228 | ||
212 | struct madt_nmi_source { | 229 | /* |
213 | APIC_HEADER_DEF MPS_INTI_FLAGS u32 interrupt; /* Global system interrupt */ | 230 | * ACPI 2.0+ FADT |
231 | */ | ||
232 | struct fadt_descriptor { | ||
233 | ACPI_FADT_COMMON | ||
234 | /* Flags (32 bits) */ | ||
235 | u8 wb_invd:1; /* 00: The wbinvd instruction works properly */ | ||
236 | u8 wb_invd_flush:1; /* 01: The wbinvd flushes but does not invalidate */ | ||
237 | u8 proc_c1:1; /* 02: All processors support C1 state */ | ||
238 | u8 plvl2_up:1; /* 03: C2 state works on MP system */ | ||
239 | u8 pwr_button:1; /* 04: Power button is handled as a generic feature */ | ||
240 | u8 sleep_button:1; /* 05: Sleep button is handled as a generic feature, or not present */ | ||
241 | u8 fixed_rTC:1; /* 06: RTC wakeup stat not in fixed register space */ | ||
242 | u8 rtcs4:1; /* 07: RTC wakeup stat not possible from S4 */ | ||
243 | u8 tmr_val_ext:1; /* 08: tmr_val is 32 bits 0=24-bits */ | ||
244 | u8 dock_cap:1; /* 09: Docking supported */ | ||
245 | u8 reset_reg_sup:1; /* 10: System reset via the FADT RESET_REG supported */ | ||
246 | u8 sealed_case:1; /* 11: No internal expansion capabilities and case is sealed */ | ||
247 | u8 headless:1; /* 12: No local video capabilities or local input devices */ | ||
248 | u8 cpu_sw_sleep:1; /* 13: Must execute native instruction after writing SLP_TYPx register */ | ||
249 | |||
250 | u8 pci_exp_wak:1; /* 14: System supports PCIEXP_WAKE (STS/EN) bits (ACPI 3.0) */ | ||
251 | u8 use_platform_clock:1; /* 15: OSPM should use platform-provided timer (ACPI 3.0) */ | ||
252 | u8 S4rtc_sts_valid:1; /* 16: Contents of RTC_STS valid after S4 wake (ACPI 3.0) */ | ||
253 | u8 remote_power_on_capable:1; /* 17: System is compatible with remote power on (ACPI 3.0) */ | ||
254 | u8 force_apic_cluster_model:1; /* 18: All local APICs must use cluster model (ACPI 3.0) */ | ||
255 | u8 force_apic_physical_destination_mode:1; /* 19: All local x_aPICs must use physical dest mode (ACPI 3.0) */ | ||
256 | u8:4; /* 20-23: Reserved, must be zero */ | ||
257 | u8 reserved3; /* 24-31: Reserved, must be zero */ | ||
258 | |||
259 | struct acpi_generic_address reset_register; /* Reset register address in GAS format */ | ||
260 | u8 reset_value; /* Value to write to the reset_register port to reset the system */ | ||
261 | u8 reserved4[3]; /* These three bytes must be zero */ | ||
262 | u64 xfirmware_ctrl; /* 64-bit physical address of FACS */ | ||
263 | u64 Xdsdt; /* 64-bit physical address of DSDT */ | ||
264 | struct acpi_generic_address xpm1a_evt_blk; /* Extended Power Mgt 1a acpi_event Reg Blk address */ | ||
265 | struct acpi_generic_address xpm1b_evt_blk; /* Extended Power Mgt 1b acpi_event Reg Blk address */ | ||
266 | struct acpi_generic_address xpm1a_cnt_blk; /* Extended Power Mgt 1a Control Reg Blk address */ | ||
267 | struct acpi_generic_address xpm1b_cnt_blk; /* Extended Power Mgt 1b Control Reg Blk address */ | ||
268 | struct acpi_generic_address xpm2_cnt_blk; /* Extended Power Mgt 2 Control Reg Blk address */ | ||
269 | struct acpi_generic_address xpm_tmr_blk; /* Extended Power Mgt Timer Ctrl Reg Blk address */ | ||
270 | struct acpi_generic_address xgpe0_blk; /* Extended General Purpose acpi_event 0 Reg Blk address */ | ||
271 | struct acpi_generic_address xgpe1_blk; /* Extended General Purpose acpi_event 1 Reg Blk address */ | ||
214 | }; | 272 | }; |
215 | 273 | ||
216 | struct madt_local_apic_nmi { | 274 | /* |
217 | APIC_HEADER_DEF u8 processor_id; /* ACPI processor id */ | 275 | * "Down-revved" ACPI 2.0 FADT descriptor |
218 | MPS_INTI_FLAGS u8 lint; /* LINTn to which NMI is connected */ | 276 | * Defined here to allow compiler to generate the length of the struct |
277 | */ | ||
278 | struct fadt_descriptor_rev2_minus { | ||
279 | ACPI_FADT_COMMON u32 flags; | ||
280 | struct acpi_generic_address reset_register; /* Reset register address in GAS format */ | ||
281 | u8 reset_value; /* Value to write to the reset_register port to reset the system. */ | ||
282 | u8 reserved7[3]; /* Reserved, must be zero */ | ||
219 | }; | 283 | }; |
220 | 284 | ||
221 | struct madt_address_override { | 285 | /* |
222 | APIC_HEADER_DEF u16 reserved; /* Reserved, must be zero */ | 286 | * ACPI 1.0 FADT |
223 | u64 address; /* APIC physical address */ | 287 | * Defined here to allow compiler to generate the length of the struct |
288 | */ | ||
289 | struct fadt_descriptor_rev1 { | ||
290 | ACPI_FADT_COMMON u32 flags; | ||
224 | }; | 291 | }; |
225 | 292 | ||
226 | struct madt_io_sapic { | 293 | /* FADT: Prefered Power Management Profiles */ |
227 | APIC_HEADER_DEF u8 io_sapic_id; /* I/O SAPIC ID */ | ||
228 | u8 reserved; /* Reserved, must be zero */ | ||
229 | u32 interrupt_base; /* Glocal interrupt for SAPIC start */ | ||
230 | u64 address; /* SAPIC physical address */ | ||
231 | }; | ||
232 | 294 | ||
233 | struct madt_local_sapic { | 295 | #define PM_UNSPECIFIED 0 |
234 | APIC_HEADER_DEF u8 processor_id; /* ACPI processor id */ | 296 | #define PM_DESKTOP 1 |
235 | u8 local_sapic_id; /* SAPIC ID */ | 297 | #define PM_MOBILE 2 |
236 | u8 local_sapic_eid; /* SAPIC EID */ | 298 | #define PM_WORKSTATION 3 |
237 | u8 reserved[3]; /* Reserved, must be zero */ | 299 | #define PM_ENTERPRISE_SERVER 4 |
238 | LOCAL_APIC_FLAGS u32 processor_uID; /* Numeric UID - ACPI 3.0 */ | 300 | #define PM_SOHO_SERVER 5 |
239 | char processor_uIDstring[1]; /* String UID - ACPI 3.0 */ | 301 | #define PM_APPLIANCE_PC 6 |
240 | }; | ||
241 | 302 | ||
242 | struct madt_interrupt_source { | 303 | /* FADT: Boot Arch Flags */ |
243 | APIC_HEADER_DEF MPS_INTI_FLAGS u8 interrupt_type; /* 1=PMI, 2=INIT, 3=corrected */ | ||
244 | u8 processor_id; /* Processor ID */ | ||
245 | u8 processor_eid; /* Processor EID */ | ||
246 | u8 io_sapic_vector; /* Vector value for PMI interrupts */ | ||
247 | u32 interrupt; /* Global system interrupt */ | ||
248 | u32 flags; /* Interrupt Source Flags */ | ||
249 | }; | ||
250 | 304 | ||
251 | /* | 305 | #define BAF_LEGACY_DEVICES 0x0001 |
252 | * Smart Battery | 306 | #define BAF_8042_KEYBOARD_CONTROLLER 0x0002 |
253 | */ | 307 | |
254 | struct smart_battery_table { | 308 | #define FADT2_REVISION_ID 3 |
255 | ACPI_TABLE_HEADER_DEF u32 warning_level; | 309 | #define FADT2_MINUS_REVISION_ID 2 |
256 | u32 low_level; | 310 | |
257 | u32 critical_level; | 311 | /* Reset to default packing */ |
258 | }; | ||
259 | 312 | ||
260 | #pragma pack() | 313 | #pragma pack() |
261 | 314 | ||
262 | /* | 315 | /* |
316 | * This macro is temporary until the table bitfield flag definitions | ||
317 | * are removed and replaced by a Flags field. | ||
318 | */ | ||
319 | #define ACPI_FLAG_OFFSET(d,f,o) (u8) (ACPI_OFFSET (d,f) + \ | ||
320 | sizeof(((d *)0)->f) + o) | ||
321 | /* | ||
322 | * Get the remaining ACPI tables | ||
323 | */ | ||
324 | #include "actbl1.h" | ||
325 | |||
326 | /* | ||
263 | * ACPI Table information. We save the table address, length, | 327 | * ACPI Table information. We save the table address, length, |
264 | * and type of memory allocation (mapped or allocated) for each | 328 | * and type of memory allocation (mapped or allocated) for each |
265 | * table for 1) when we exit, and 2) if a new table is installed | 329 | * table for 1) when we exit, and 2) if a new table is installed |
@@ -290,27 +354,17 @@ struct acpi_table_support { | |||
290 | u8 flags; | 354 | u8 flags; |
291 | }; | 355 | }; |
292 | 356 | ||
293 | /* | ||
294 | * Get the ACPI version-specific tables | ||
295 | */ | ||
296 | #include "actbl1.h" /* Acpi 1.0 table definitions */ | ||
297 | #include "actbl2.h" /* Acpi 2.0 table definitions */ | ||
298 | |||
299 | extern u8 acpi_fadt_is_v1; /* is set to 1 if FADT is revision 1, | 357 | extern u8 acpi_fadt_is_v1; /* is set to 1 if FADT is revision 1, |
300 | * needed for certain workarounds */ | 358 | * needed for certain workarounds */ |
359 | /* Macros used to generate offsets to specific table fields */ | ||
301 | 360 | ||
302 | #pragma pack(1) | 361 | #define ACPI_FACS_OFFSET(f) (u8) ACPI_OFFSET (struct facs_descriptor,f) |
303 | /* | 362 | #define ACPI_FADT_OFFSET(f) (u8) ACPI_OFFSET (struct fadt_descriptor, f) |
304 | * High performance timer | 363 | #define ACPI_GAS_OFFSET(f) (u8) ACPI_OFFSET (struct acpi_generic_address,f) |
305 | */ | 364 | #define ACPI_HDR_OFFSET(f) (u8) ACPI_OFFSET (struct acpi_table_header,f) |
306 | struct hpet_table { | 365 | #define ACPI_RSDP_OFFSET(f) (u8) ACPI_OFFSET (struct rsdp_descriptor,f) |
307 | ACPI_TABLE_HEADER_DEF u32 hardware_id; | ||
308 | struct acpi_generic_address base_address; | ||
309 | u8 hpet_number; | ||
310 | u16 clock_tick; | ||
311 | u8 attributes; | ||
312 | }; | ||
313 | 366 | ||
314 | #pragma pack() | 367 | #define ACPI_FADT_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (struct fadt_descriptor,f,o) |
368 | #define ACPI_FACS_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (struct facs_descriptor,f,o) | ||
315 | 369 | ||
316 | #endif /* __ACTBL_H__ */ | 370 | #endif /* __ACTBL_H__ */ |
diff --git a/include/acpi/actbl1.h b/include/acpi/actbl1.h index cd428d57add0..745a6445a4f9 100644 --- a/include/acpi/actbl1.h +++ b/include/acpi/actbl1.h | |||
@@ -1,6 +1,6 @@ | |||
1 | /****************************************************************************** | 1 | /****************************************************************************** |
2 | * | 2 | * |
3 | * Name: actbl1.h - ACPI 1.0 tables | 3 | * Name: actbl1.h - Additional ACPI table definitions |
4 | * | 4 | * |
5 | *****************************************************************************/ | 5 | *****************************************************************************/ |
6 | 6 | ||
@@ -44,92 +44,599 @@ | |||
44 | #ifndef __ACTBL1_H__ | 44 | #ifndef __ACTBL1_H__ |
45 | #define __ACTBL1_H__ | 45 | #define __ACTBL1_H__ |
46 | 46 | ||
47 | /******************************************************************************* | ||
48 | * | ||
49 | * Additional ACPI Tables | ||
50 | * | ||
51 | * These tables are not consumed directly by the ACPICA subsystem, but are | ||
52 | * included here to support device drivers and the AML disassembler. | ||
53 | * | ||
54 | ******************************************************************************/ | ||
55 | |||
56 | /* | ||
57 | * Values for description table header signatures. Useful because they make | ||
58 | * it more difficult to inadvertently type in the wrong signature. | ||
59 | */ | ||
60 | #define ACPI_SIG_ASF "ASF!" /* Alert Standard Format table */ | ||
61 | #define ACPI_SIG_BOOT "BOOT" /* Simple Boot Flag Table */ | ||
62 | #define ACPI_SIG_CPEP "CPEP" /* Corrected Platform Error Polling table */ | ||
63 | #define ACPI_SIG_DBGP "DBGP" /* Debug Port table */ | ||
64 | #define ACPI_SIG_ECDT "ECDT" /* Embedded Controller Boot Resources Table */ | ||
65 | #define ACPI_SIG_HPET "HPET" /* High Precision Event Timer table */ | ||
66 | #define ACPI_SIG_MADT "APIC" /* Multiple APIC Description Table */ | ||
67 | #define ACPI_SIG_MCFG "MCFG" /* PCI Memory Mapped Configuration table */ | ||
68 | #define ACPI_SIG_SBST "SBST" /* Smart Battery Specification Table */ | ||
69 | #define ACPI_SIG_SLIT "SLIT" /* System Locality Distance Information Table */ | ||
70 | #define ACPI_SIG_SPCR "SPCR" /* Serial Port Console Redirection table */ | ||
71 | #define ACPI_SIG_SPMI "SPMI" /* Server Platform Management Interface table */ | ||
72 | #define ACPI_SIG_SRAT "SRAT" /* System Resource Affinity Table */ | ||
73 | #define ACPI_SIG_TCPA "TCPA" /* Trusted Computing Platform Alliance table */ | ||
74 | #define ACPI_SIG_WDRT "WDRT" /* Watchdog Resource Table */ | ||
75 | |||
76 | /* Legacy names */ | ||
77 | |||
78 | #define APIC_SIG "APIC" /* Multiple APIC Description Table */ | ||
79 | #define BOOT_SIG "BOOT" /* Simple Boot Flag Table */ | ||
80 | #define SBST_SIG "SBST" /* Smart Battery Specification Table */ | ||
81 | |||
82 | /* | ||
83 | * All tables must be byte-packed to match the ACPI specification, since | ||
84 | * the tables are provided by the system BIOS. | ||
85 | */ | ||
47 | #pragma pack(1) | 86 | #pragma pack(1) |
48 | 87 | ||
49 | /* | 88 | /* |
50 | * ACPI 1.0 Root System Description Table (RSDT) | 89 | * Note about bitfields: The u8 type is used for bitfields in ACPI tables. |
90 | * This is the only type that is even remotely portable. Anything else is not | ||
91 | * portable, so do not use any other bitfield types. | ||
51 | */ | 92 | */ |
52 | struct rsdt_descriptor_rev1 { | 93 | |
53 | ACPI_TABLE_HEADER_DEF /* ACPI common table header */ | 94 | /******************************************************************************* |
54 | u32 table_offset_entry[1]; /* Array of pointers to ACPI tables */ | 95 | * |
55 | }; | 96 | * ASF - Alert Standard Format table (Signature "ASF!") |
97 | * | ||
98 | ******************************************************************************/ | ||
99 | |||
100 | struct acpi_table_asf { | ||
101 | ACPI_TABLE_HEADER_DEF}; | ||
102 | |||
103 | #define ACPI_ASF_HEADER_DEF \ | ||
104 | u8 type; \ | ||
105 | u8 reserved; \ | ||
106 | u16 length; | ||
107 | |||
108 | struct acpi_asf_header { | ||
109 | ACPI_ASF_HEADER_DEF}; | ||
110 | |||
111 | /* Values for Type field */ | ||
112 | |||
113 | #define ASF_INFO 0 | ||
114 | #define ASF_ALERT 1 | ||
115 | #define ASF_CONTROL 2 | ||
116 | #define ASF_BOOT 3 | ||
117 | #define ASF_ADDRESS 4 | ||
118 | #define ASF_RESERVED 5 | ||
56 | 119 | ||
57 | /* | 120 | /* |
58 | * ACPI 1.0 Firmware ACPI Control Structure (FACS) | 121 | * ASF subtables |
59 | */ | 122 | */ |
60 | struct facs_descriptor_rev1 { | 123 | |
61 | char signature[4]; /* ASCII table signature */ | 124 | /* 0: ASF Information */ |
62 | u32 length; /* Length of structure in bytes */ | 125 | |
63 | u32 hardware_signature; /* Hardware configuration signature */ | 126 | struct acpi_asf_info { |
64 | u32 firmware_waking_vector; /* ACPI OS waking vector */ | 127 | ACPI_ASF_HEADER_DEF u8 min_reset_value; |
65 | u32 global_lock; /* Global Lock */ | 128 | u8 min_poll_interval; |
129 | u16 system_id; | ||
130 | u32 mfg_id; | ||
131 | u8 flags; | ||
132 | u8 reserved2[3]; | ||
133 | }; | ||
134 | |||
135 | /* 1: ASF Alerts */ | ||
136 | |||
137 | struct acpi_asf_alert { | ||
138 | ACPI_ASF_HEADER_DEF u8 assert_mask; | ||
139 | u8 deassert_mask; | ||
140 | u8 alerts; | ||
141 | u8 data_length; | ||
142 | u8 array[1]; | ||
143 | }; | ||
144 | |||
145 | /* 2: ASF Remote Control */ | ||
146 | |||
147 | struct acpi_asf_remote { | ||
148 | ACPI_ASF_HEADER_DEF u8 controls; | ||
149 | u8 data_length; | ||
150 | u16 reserved2; | ||
151 | u8 array[1]; | ||
152 | }; | ||
153 | |||
154 | /* 3: ASF RMCP Boot Options */ | ||
155 | |||
156 | struct acpi_asf_rmcp { | ||
157 | ACPI_ASF_HEADER_DEF u8 capabilities[7]; | ||
158 | u8 completion_code; | ||
159 | u32 enterprise_id; | ||
160 | u8 command; | ||
161 | u16 parameter; | ||
162 | u16 boot_options; | ||
163 | u16 oem_parameters; | ||
164 | }; | ||
165 | |||
166 | /* 4: ASF Address */ | ||
167 | |||
168 | struct acpi_asf_address { | ||
169 | ACPI_ASF_HEADER_DEF u8 eprom_address; | ||
170 | u8 devices; | ||
171 | u8 smbus_addresses[1]; | ||
172 | }; | ||
173 | |||
174 | /******************************************************************************* | ||
175 | * | ||
176 | * BOOT - Simple Boot Flag Table | ||
177 | * | ||
178 | ******************************************************************************/ | ||
179 | |||
180 | struct acpi_table_boot { | ||
181 | ACPI_TABLE_HEADER_DEF u8 cmos_index; /* Index in CMOS RAM for the boot register */ | ||
182 | u8 reserved[3]; | ||
183 | }; | ||
184 | |||
185 | /******************************************************************************* | ||
186 | * | ||
187 | * CPEP - Corrected Platform Error Polling table | ||
188 | * | ||
189 | ******************************************************************************/ | ||
190 | |||
191 | struct acpi_table_cpep { | ||
192 | ACPI_TABLE_HEADER_DEF u64 reserved; | ||
193 | }; | ||
194 | |||
195 | /* Subtable */ | ||
196 | |||
197 | struct acpi_cpep_polling { | ||
198 | u8 type; | ||
199 | u8 length; | ||
200 | u8 processor_id; /* Processor ID */ | ||
201 | u8 processor_eid; /* Processor EID */ | ||
202 | u32 polling_interval; /* Polling interval (msec) */ | ||
203 | }; | ||
204 | |||
205 | /******************************************************************************* | ||
206 | * | ||
207 | * DBGP - Debug Port table | ||
208 | * | ||
209 | ******************************************************************************/ | ||
210 | |||
211 | struct acpi_table_dbgp { | ||
212 | ACPI_TABLE_HEADER_DEF u8 interface_type; /* 0=full 16550, 1=subset of 16550 */ | ||
213 | u8 reserved[3]; | ||
214 | struct acpi_generic_address debug_port; | ||
215 | }; | ||
216 | |||
217 | /******************************************************************************* | ||
218 | * | ||
219 | * ECDT - Embedded Controller Boot Resources Table | ||
220 | * | ||
221 | ******************************************************************************/ | ||
222 | |||
223 | struct ec_boot_resources { | ||
224 | ACPI_TABLE_HEADER_DEF struct acpi_generic_address ec_control; /* Address of EC command/status register */ | ||
225 | struct acpi_generic_address ec_data; /* Address of EC data register */ | ||
226 | u32 uid; /* Unique ID - must be same as the EC _UID method */ | ||
227 | u8 gpe_bit; /* The GPE for the EC */ | ||
228 | u8 ec_id[1]; /* Full namepath of the EC in the ACPI namespace */ | ||
229 | }; | ||
230 | |||
231 | /******************************************************************************* | ||
232 | * | ||
233 | * HPET - High Precision Event Timer table | ||
234 | * | ||
235 | ******************************************************************************/ | ||
236 | |||
237 | struct acpi_hpet_table { | ||
238 | ACPI_TABLE_HEADER_DEF u32 hardware_id; /* Hardware ID of event timer block */ | ||
239 | struct acpi_generic_address base_address; /* Address of event timer block */ | ||
240 | u8 hpet_number; /* HPET sequence number */ | ||
241 | u16 clock_tick; /* Main counter min tick, periodic mode */ | ||
242 | u8 attributes; | ||
243 | }; | ||
244 | |||
245 | #if 0 /* HPET flags to be converted to macros */ | ||
246 | struct { /* Flags (8 bits) */ | ||
247 | u8 page_protect:1; /* 00: No page protection */ | ||
248 | u8 page_protect4:1; /* 01: 4_kB page protected */ | ||
249 | u8 page_protect64:1; /* 02: 64_kB page protected */ | ||
250 | u8:5; /* 03-07: Reserved, must be zero */ | ||
251 | } flags; | ||
252 | #endif | ||
253 | |||
254 | /******************************************************************************* | ||
255 | * | ||
256 | * MADT - Multiple APIC Description Table | ||
257 | * | ||
258 | ******************************************************************************/ | ||
259 | |||
260 | struct multiple_apic_table { | ||
261 | ACPI_TABLE_HEADER_DEF u32 local_apic_address; /* Physical address of local APIC */ | ||
66 | 262 | ||
67 | /* Flags (32 bits) */ | 263 | /* Flags (32 bits) */ |
68 | 264 | ||
69 | u8 S4bios_f:1; /* 00: S4BIOS support is present */ | 265 | u8 PCATcompat:1; /* 00: System also has dual 8259s */ |
70 | u8:7; /* 01-07: Reserved, must be zero */ | 266 | u8:7; /* 01-07: Reserved, must be zero */ |
71 | u8 reserved1[3]; /* 08-31: Reserved, must be zero */ | 267 | u8 reserved1[3]; /* 08-31: Reserved, must be zero */ |
72 | |||
73 | u8 reserved2[40]; /* Reserved, must be zero */ | ||
74 | }; | 268 | }; |
75 | 269 | ||
270 | /* Values for MADT PCATCompat */ | ||
271 | |||
272 | #define DUAL_PIC 0 | ||
273 | #define MULTIPLE_APIC 1 | ||
274 | |||
275 | /* Common MADT Sub-table header */ | ||
276 | |||
277 | #define APIC_HEADER_DEF \ | ||
278 | u8 type; \ | ||
279 | u8 length; | ||
280 | |||
281 | struct apic_header { | ||
282 | APIC_HEADER_DEF}; | ||
283 | |||
284 | /* Values for Type in struct apic_header */ | ||
285 | |||
286 | #define APIC_PROCESSOR 0 | ||
287 | #define APIC_IO 1 | ||
288 | #define APIC_XRUPT_OVERRIDE 2 | ||
289 | #define APIC_NMI 3 | ||
290 | #define APIC_LOCAL_NMI 4 | ||
291 | #define APIC_ADDRESS_OVERRIDE 5 | ||
292 | #define APIC_IO_SAPIC 6 | ||
293 | #define APIC_LOCAL_SAPIC 7 | ||
294 | #define APIC_XRUPT_SOURCE 8 | ||
295 | #define APIC_RESERVED 9 /* 9 and greater are reserved */ | ||
296 | |||
297 | /* Flag definitions for MADT sub-tables */ | ||
298 | |||
299 | #define ACPI_MADT_IFLAGS /* INTI flags (16 bits) */ \ | ||
300 | u8 polarity : 2; /* 00-01: Polarity of APIC I/O input signals */\ | ||
301 | u8 trigger_mode : 2; /* 02-03: Trigger mode of APIC input signals */\ | ||
302 | u8 : 4; /* 04-07: Reserved, must be zero */\ | ||
303 | u8 reserved1; /* 08-15: Reserved, must be zero */ | ||
304 | |||
305 | #define ACPI_MADT_LFLAGS /* Local Sapic flags (32 bits) */ \ | ||
306 | u8 processor_enabled: 1; /* 00: Processor is usable if set */\ | ||
307 | u8 : 7; /* 01-07: Reserved, must be zero */\ | ||
308 | u8 reserved2[3]; /* 08-31: Reserved, must be zero */ | ||
309 | |||
310 | /* Values for MPS INTI flags */ | ||
311 | |||
312 | #define POLARITY_CONFORMS 0 | ||
313 | #define POLARITY_ACTIVE_HIGH 1 | ||
314 | #define POLARITY_RESERVED 2 | ||
315 | #define POLARITY_ACTIVE_LOW 3 | ||
316 | |||
317 | #define TRIGGER_CONFORMS 0 | ||
318 | #define TRIGGER_EDGE 1 | ||
319 | #define TRIGGER_RESERVED 2 | ||
320 | #define TRIGGER_LEVEL 3 | ||
321 | |||
76 | /* | 322 | /* |
77 | * ACPI 1.0 Fixed ACPI Description Table (FADT) | 323 | * MADT Sub-tables, correspond to Type in struct apic_header |
78 | */ | 324 | */ |
79 | struct fadt_descriptor_rev1 { | 325 | |
80 | ACPI_TABLE_HEADER_DEF /* ACPI common table header */ | 326 | /* 0: processor APIC */ |
81 | u32 firmware_ctrl; /* Physical address of FACS */ | 327 | |
82 | u32 dsdt; /* Physical address of DSDT */ | 328 | struct madt_processor_apic { |
83 | u8 model; /* System Interrupt Model */ | 329 | APIC_HEADER_DEF u8 processor_id; /* ACPI processor id */ |
84 | u8 reserved1; /* Reserved, must be zero */ | 330 | u8 local_apic_id; /* Processor's local APIC id */ |
85 | u16 sci_int; /* System vector of SCI interrupt */ | 331 | ACPI_MADT_LFLAGS}; |
86 | u32 smi_cmd; /* Port address of SMI command port */ | 332 | |
87 | u8 acpi_enable; /* Value to write to smi_cmd to enable ACPI */ | 333 | /* 1: IO APIC */ |
88 | u8 acpi_disable; /* Value to write to smi_cmd to disable ACPI */ | 334 | |
89 | u8 S4bios_req; /* Value to write to SMI CMD to enter S4BIOS state */ | 335 | struct madt_io_apic { |
90 | u8 reserved2; /* Reserved, must be zero */ | 336 | APIC_HEADER_DEF u8 io_apic_id; /* I/O APIC ID */ |
91 | u32 pm1a_evt_blk; /* Port address of Power Mgt 1a acpi_event Reg Blk */ | 337 | u8 reserved; /* Reserved - must be zero */ |
92 | u32 pm1b_evt_blk; /* Port address of Power Mgt 1b acpi_event Reg Blk */ | 338 | u32 address; /* APIC physical address */ |
93 | u32 pm1a_cnt_blk; /* Port address of Power Mgt 1a Control Reg Blk */ | 339 | u32 interrupt; /* Global system interrupt where INTI lines start */ |
94 | u32 pm1b_cnt_blk; /* Port address of Power Mgt 1b Control Reg Blk */ | 340 | }; |
95 | u32 pm2_cnt_blk; /* Port address of Power Mgt 2 Control Reg Blk */ | 341 | |
96 | u32 pm_tmr_blk; /* Port address of Power Mgt Timer Ctrl Reg Blk */ | 342 | /* 2: Interrupt Override */ |
97 | u32 gpe0_blk; /* Port addr of General Purpose acpi_event 0 Reg Blk */ | 343 | |
98 | u32 gpe1_blk; /* Port addr of General Purpose acpi_event 1 Reg Blk */ | 344 | struct madt_interrupt_override { |
99 | u8 pm1_evt_len; /* Byte length of ports at pm1_x_evt_blk */ | 345 | APIC_HEADER_DEF u8 bus; /* 0 - ISA */ |
100 | u8 pm1_cnt_len; /* Byte length of ports at pm1_x_cnt_blk */ | 346 | u8 source; /* Interrupt source (IRQ) */ |
101 | u8 pm2_cnt_len; /* Byte Length of ports at pm2_cnt_blk */ | 347 | u32 interrupt; /* Global system interrupt */ |
102 | u8 pm_tm_len; /* Byte Length of ports at pm_tm_blk */ | 348 | ACPI_MADT_IFLAGS}; |
103 | u8 gpe0_blk_len; /* Byte Length of ports at gpe0_blk */ | 349 | |
104 | u8 gpe1_blk_len; /* Byte Length of ports at gpe1_blk */ | 350 | /* 3: NMI Sources */ |
105 | u8 gpe1_base; /* Offset in gpe model where gpe1 events start */ | 351 | |
106 | u8 reserved3; /* Reserved, must be zero */ | 352 | struct madt_nmi_source { |
107 | u16 plvl2_lat; /* Worst case HW latency to enter/exit C2 state */ | 353 | APIC_HEADER_DEF ACPI_MADT_IFLAGS u32 interrupt; /* Global system interrupt */ |
108 | u16 plvl3_lat; /* Worst case HW latency to enter/exit C3 state */ | 354 | }; |
109 | u16 flush_size; /* Size of area read to flush caches */ | 355 | |
110 | u16 flush_stride; /* Stride used in flushing caches */ | 356 | /* 4: Local APIC NMI */ |
111 | u8 duty_offset; /* Bit location of duty cycle field in p_cnt reg */ | 357 | |
112 | u8 duty_width; /* Bit width of duty cycle field in p_cnt reg */ | 358 | struct madt_local_apic_nmi { |
113 | u8 day_alrm; /* Index to day-of-month alarm in RTC CMOS RAM */ | 359 | APIC_HEADER_DEF u8 processor_id; /* ACPI processor id */ |
114 | u8 mon_alrm; /* Index to month-of-year alarm in RTC CMOS RAM */ | 360 | ACPI_MADT_IFLAGS u8 lint; /* LINTn to which NMI is connected */ |
115 | u8 century; /* Index to century in RTC CMOS RAM */ | 361 | }; |
116 | u8 reserved4[3]; /* Reserved, must be zero */ | 362 | |
363 | /* 5: Address Override */ | ||
364 | |||
365 | struct madt_address_override { | ||
366 | APIC_HEADER_DEF u16 reserved; /* Reserved, must be zero */ | ||
367 | u64 address; /* APIC physical address */ | ||
368 | }; | ||
369 | |||
370 | /* 6: I/O Sapic */ | ||
371 | |||
372 | struct madt_io_sapic { | ||
373 | APIC_HEADER_DEF u8 io_sapic_id; /* I/O SAPIC ID */ | ||
374 | u8 reserved; /* Reserved, must be zero */ | ||
375 | u32 interrupt_base; /* Glocal interrupt for SAPIC start */ | ||
376 | u64 address; /* SAPIC physical address */ | ||
377 | }; | ||
378 | |||
379 | /* 7: Local Sapic */ | ||
380 | |||
381 | struct madt_local_sapic { | ||
382 | APIC_HEADER_DEF u8 processor_id; /* ACPI processor id */ | ||
383 | u8 local_sapic_id; /* SAPIC ID */ | ||
384 | u8 local_sapic_eid; /* SAPIC EID */ | ||
385 | u8 reserved[3]; /* Reserved, must be zero */ | ||
386 | ACPI_MADT_LFLAGS u32 processor_uID; /* Numeric UID - ACPI 3.0 */ | ||
387 | char processor_uIDstring[1]; /* String UID - ACPI 3.0 */ | ||
388 | }; | ||
389 | |||
390 | /* 8: Platform Interrupt Source */ | ||
391 | |||
392 | struct madt_interrupt_source { | ||
393 | APIC_HEADER_DEF ACPI_MADT_IFLAGS u8 interrupt_type; /* 1=PMI, 2=INIT, 3=corrected */ | ||
394 | u8 processor_id; /* Processor ID */ | ||
395 | u8 processor_eid; /* Processor EID */ | ||
396 | u8 io_sapic_vector; /* Vector value for PMI interrupts */ | ||
397 | u32 interrupt; /* Global system interrupt */ | ||
398 | u32 flags; /* Interrupt Source Flags */ | ||
399 | }; | ||
400 | |||
401 | #ifdef DUPLICATE_DEFINITION_WITH_LINUX_ACPI_H | ||
402 | /******************************************************************************* | ||
403 | * | ||
404 | * MCFG - PCI Memory Mapped Configuration table and sub-table | ||
405 | * | ||
406 | ******************************************************************************/ | ||
407 | |||
408 | struct acpi_table_mcfg { | ||
409 | ACPI_TABLE_HEADER_DEF u8 reserved[8]; | ||
410 | }; | ||
411 | |||
412 | struct acpi_mcfg_allocation { | ||
413 | u64 base_address; /* Base address, processor-relative */ | ||
414 | u16 pci_segment; /* PCI segment group number */ | ||
415 | u8 start_bus_number; /* Starting PCI Bus number */ | ||
416 | u8 end_bus_number; /* Final PCI Bus number */ | ||
417 | u32 reserved; | ||
418 | }; | ||
419 | #endif | ||
420 | |||
421 | /******************************************************************************* | ||
422 | * | ||
423 | * SBST - Smart Battery Specification Table | ||
424 | * | ||
425 | ******************************************************************************/ | ||
426 | |||
427 | struct smart_battery_table { | ||
428 | ACPI_TABLE_HEADER_DEF u32 warning_level; | ||
429 | u32 low_level; | ||
430 | u32 critical_level; | ||
431 | }; | ||
432 | |||
433 | /******************************************************************************* | ||
434 | * | ||
435 | * SLIT - System Locality Distance Information Table | ||
436 | * | ||
437 | ******************************************************************************/ | ||
438 | |||
439 | struct system_locality_info { | ||
440 | ACPI_TABLE_HEADER_DEF u64 locality_count; | ||
441 | u8 entry[1][1]; | ||
442 | }; | ||
443 | |||
444 | /******************************************************************************* | ||
445 | * | ||
446 | * SPCR - Serial Port Console Redirection table | ||
447 | * | ||
448 | ******************************************************************************/ | ||
449 | |||
450 | struct acpi_table_spcr { | ||
451 | ACPI_TABLE_HEADER_DEF u8 interface_type; /* 0=full 16550, 1=subset of 16550 */ | ||
452 | u8 reserved[3]; | ||
453 | struct acpi_generic_address serial_port; | ||
454 | u8 interrupt_type; | ||
455 | u8 pc_interrupt; | ||
456 | u32 interrupt; | ||
457 | u8 baud_rate; | ||
458 | u8 parity; | ||
459 | u8 stop_bits; | ||
460 | u8 flow_control; | ||
461 | u8 terminal_type; | ||
462 | u8 reserved2; | ||
463 | u16 pci_device_id; | ||
464 | u16 pci_vendor_id; | ||
465 | u8 pci_bus; | ||
466 | u8 pci_device; | ||
467 | u8 pci_function; | ||
468 | u32 pci_flags; | ||
469 | u8 pci_segment; | ||
470 | u32 reserved3; | ||
471 | }; | ||
472 | |||
473 | /******************************************************************************* | ||
474 | * | ||
475 | * SPMI - Server Platform Management Interface table | ||
476 | * | ||
477 | ******************************************************************************/ | ||
478 | |||
479 | struct acpi_table_spmi { | ||
480 | ACPI_TABLE_HEADER_DEF u8 reserved; | ||
481 | u8 interface_type; | ||
482 | u16 spec_revision; /* Version of IPMI */ | ||
483 | u8 interrupt_type; | ||
484 | u8 gpe_number; /* GPE assigned */ | ||
485 | u8 reserved2; | ||
486 | u8 pci_device_flag; | ||
487 | u32 interrupt; | ||
488 | struct acpi_generic_address ipmi_register; | ||
489 | u8 pci_segment; | ||
490 | u8 pci_bus; | ||
491 | u8 pci_device; | ||
492 | u8 pci_function; | ||
493 | }; | ||
494 | |||
495 | /******************************************************************************* | ||
496 | * | ||
497 | * SRAT - System Resource Affinity Table | ||
498 | * | ||
499 | ******************************************************************************/ | ||
500 | |||
501 | struct system_resource_affinity { | ||
502 | ACPI_TABLE_HEADER_DEF u32 reserved1; /* Must be value '1' */ | ||
503 | u64 reserved2; /* Reserved, must be zero */ | ||
504 | }; | ||
505 | |||
506 | /* SRAT common sub-table header */ | ||
507 | |||
508 | #define SRAT_SUBTABLE_HEADER \ | ||
509 | u8 type; \ | ||
510 | u8 length; | ||
511 | |||
512 | /* Values for Type above */ | ||
513 | |||
514 | #define SRAT_CPU_AFFINITY 0 | ||
515 | #define SRAT_MEMORY_AFFINITY 1 | ||
516 | #define SRAT_RESERVED 2 | ||
517 | |||
518 | /* SRAT sub-tables */ | ||
519 | |||
520 | struct static_resource_alloc { | ||
521 | SRAT_SUBTABLE_HEADER u8 proximity_domain_lo; | ||
522 | u8 apic_id; | ||
523 | |||
524 | /* Flags (32 bits) */ | ||
525 | |||
526 | u8 enabled:1; /* 00: Use affinity structure */ | ||
527 | u8:7; /* 01-07: Reserved, must be zero */ | ||
528 | u8 reserved3[3]; /* 08-31: Reserved, must be zero */ | ||
529 | |||
530 | u8 local_sapic_eid; | ||
531 | u8 proximity_domain_hi[3]; | ||
532 | u32 reserved4; /* Reserved, must be zero */ | ||
533 | }; | ||
534 | |||
535 | struct memory_affinity { | ||
536 | SRAT_SUBTABLE_HEADER u32 proximity_domain; | ||
537 | u16 reserved3; | ||
538 | u64 base_address; | ||
539 | u64 address_length; | ||
540 | u32 reserved4; | ||
117 | 541 | ||
118 | /* Flags (32 bits) */ | 542 | /* Flags (32 bits) */ |
119 | 543 | ||
120 | u8 wb_invd:1; /* 00: The wbinvd instruction works properly */ | 544 | u8 enabled:1; /* 00: Use affinity structure */ |
121 | u8 wb_invd_flush:1; /* 01: The wbinvd flushes but does not invalidate */ | 545 | u8 hot_pluggable:1; /* 01: Memory region is hot pluggable */ |
122 | u8 proc_c1:1; /* 02: All processors support C1 state */ | 546 | u8 non_volatile:1; /* 02: Memory is non-volatile */ |
123 | u8 plvl2_up:1; /* 03: C2 state works on MP system */ | 547 | u8:5; /* 03-07: Reserved, must be zero */ |
124 | u8 pwr_button:1; /* 04: Power button is handled as a generic feature */ | 548 | u8 reserved5[3]; /* 08-31: Reserved, must be zero */ |
125 | u8 sleep_button:1; /* 05: Sleep button is handled as a generic feature, or not present */ | 549 | |
126 | u8 fixed_rTC:1; /* 06: RTC wakeup stat not in fixed register space */ | 550 | u64 reserved6; /* Reserved, must be zero */ |
127 | u8 rtcs4:1; /* 07: RTC wakeup stat not possible from S4 */ | 551 | }; |
128 | u8 tmr_val_ext:1; /* 08: tmr_val width is 32 bits (0 = 24 bits) */ | 552 | |
129 | u8:7; /* 09-15: Reserved, must be zero */ | 553 | /******************************************************************************* |
130 | u8 reserved5[2]; /* 16-31: Reserved, must be zero */ | 554 | * |
555 | * TCPA - Trusted Computing Platform Alliance table | ||
556 | * | ||
557 | ******************************************************************************/ | ||
558 | |||
559 | struct acpi_table_tcpa { | ||
560 | ACPI_TABLE_HEADER_DEF u16 reserved; | ||
561 | u32 max_log_length; /* Maximum length for the event log area */ | ||
562 | u64 log_address; /* Address of the event log area */ | ||
131 | }; | 563 | }; |
132 | 564 | ||
565 | /******************************************************************************* | ||
566 | * | ||
567 | * WDRT - Watchdog Resource Table | ||
568 | * | ||
569 | ******************************************************************************/ | ||
570 | |||
571 | struct acpi_table_wdrt { | ||
572 | ACPI_TABLE_HEADER_DEF u32 header_length; /* Watchdog Header Length */ | ||
573 | u8 pci_segment; /* PCI Segment number */ | ||
574 | u8 pci_bus; /* PCI Bus number */ | ||
575 | u8 pci_device; /* PCI Device number */ | ||
576 | u8 pci_function; /* PCI Function number */ | ||
577 | u32 timer_period; /* Period of one timer count (msec) */ | ||
578 | u32 max_count; /* Maximum counter value supported */ | ||
579 | u32 min_count; /* Minimum counter value */ | ||
580 | u8 flags; | ||
581 | u8 reserved[3]; | ||
582 | u32 entries; /* Number of watchdog entries that follow */ | ||
583 | }; | ||
584 | |||
585 | #if 0 /* Flags, will be converted to macros */ | ||
586 | u8 enabled:1; /* 00: Timer enabled */ | ||
587 | u8:6; /* 01-06: Reserved */ | ||
588 | u8 sleep_stop:1; /* 07: Timer stopped in sleep state */ | ||
589 | #endif | ||
590 | |||
591 | /* Macros used to generate offsets to specific table fields */ | ||
592 | |||
593 | #define ACPI_ASF0_OFFSET(f) (u8) ACPI_OFFSET (struct acpi_asf_info,f) | ||
594 | #define ACPI_ASF1_OFFSET(f) (u8) ACPI_OFFSET (struct acpi_asf_alert,f) | ||
595 | #define ACPI_ASF2_OFFSET(f) (u8) ACPI_OFFSET (struct acpi_asf_remote,f) | ||
596 | #define ACPI_ASF3_OFFSET(f) (u8) ACPI_OFFSET (struct acpi_asf_rmcp,f) | ||
597 | #define ACPI_ASF4_OFFSET(f) (u8) ACPI_OFFSET (struct acpi_asf_address,f) | ||
598 | #define ACPI_BOOT_OFFSET(f) (u8) ACPI_OFFSET (struct acpi_table_boot,f) | ||
599 | #define ACPI_CPEP_OFFSET(f) (u8) ACPI_OFFSET (struct acpi_table_cpep,f) | ||
600 | #define ACPI_CPEP0_OFFSET(f) (u8) ACPI_OFFSET (struct acpi_cpep_polling,f) | ||
601 | #define ACPI_DBGP_OFFSET(f) (u8) ACPI_OFFSET (struct acpi_table_dbgp,f) | ||
602 | #define ACPI_ECDT_OFFSET(f) (u8) ACPI_OFFSET (struct ec_boot_resources,f) | ||
603 | #define ACPI_HPET_OFFSET(f) (u8) ACPI_OFFSET (struct hpet_table,f) | ||
604 | #define ACPI_MADT_OFFSET(f) (u8) ACPI_OFFSET (struct multiple_apic_table,f) | ||
605 | #define ACPI_MADT0_OFFSET(f) (u8) ACPI_OFFSET (struct madt_processor_apic,f) | ||
606 | #define ACPI_MADT1_OFFSET(f) (u8) ACPI_OFFSET (struct madt_io_apic,f) | ||
607 | #define ACPI_MADT2_OFFSET(f) (u8) ACPI_OFFSET (struct madt_interrupt_override,f) | ||
608 | #define ACPI_MADT3_OFFSET(f) (u8) ACPI_OFFSET (struct madt_nmi_source,f) | ||
609 | #define ACPI_MADT4_OFFSET(f) (u8) ACPI_OFFSET (struct madt_local_apic_nmi,f) | ||
610 | #define ACPI_MADT5_OFFSET(f) (u8) ACPI_OFFSET (struct madt_address_override,f) | ||
611 | #define ACPI_MADT6_OFFSET(f) (u8) ACPI_OFFSET (struct madt_io_sapic,f) | ||
612 | #define ACPI_MADT7_OFFSET(f) (u8) ACPI_OFFSET (struct madt_local_sapic,f) | ||
613 | #define ACPI_MADT8_OFFSET(f) (u8) ACPI_OFFSET (struct madt_interrupt_source,f) | ||
614 | #define ACPI_MADTH_OFFSET(f) (u8) ACPI_OFFSET (struct apic_header,f) | ||
615 | #define ACPI_MCFG_OFFSET(f) (u8) ACPI_OFFSET (struct acpi_table_mcfg,f) | ||
616 | #define ACPI_MCFG0_OFFSET(f) (u8) ACPI_OFFSET (struct acpi_mcfg_allocation,f) | ||
617 | #define ACPI_SBST_OFFSET(f) (u8) ACPI_OFFSET (struct smart_battery_table,f) | ||
618 | #define ACPI_SLIT_OFFSET(f) (u8) ACPI_OFFSET (struct system_locality_info,f) | ||
619 | #define ACPI_SPCR_OFFSET(f) (u8) ACPI_OFFSET (struct acpi_table_spcr,f) | ||
620 | #define ACPI_SPMI_OFFSET(f) (u8) ACPI_OFFSET (struct acpi_table_spmi,f) | ||
621 | #define ACPI_SRAT_OFFSET(f) (u8) ACPI_OFFSET (struct system_resource_affinity,f) | ||
622 | #define ACPI_SRAT0_OFFSET(f) (u8) ACPI_OFFSET (struct static_resource_alloc,f) | ||
623 | #define ACPI_SRAT1_OFFSET(f) (u8) ACPI_OFFSET (struct memory_affinity,f) | ||
624 | #define ACPI_TCPA_OFFSET(f) (u8) ACPI_OFFSET (struct acpi_table_tcpa,f) | ||
625 | #define ACPI_WDRT_OFFSET(f) (u8) ACPI_OFFSET (struct acpi_table_wdrt,f) | ||
626 | |||
627 | #define ACPI_HPET_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (struct hpet_table,f,o) | ||
628 | #define ACPI_SRAT0_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (struct static_resource_alloc,f,o) | ||
629 | #define ACPI_SRAT1_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (struct memory_affinity,f,o) | ||
630 | #define ACPI_MADT_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (struct multiple_apic_table,f,o) | ||
631 | #define ACPI_MADT0_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (struct madt_processor_apic,f,o) | ||
632 | #define ACPI_MADT2_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (struct madt_interrupt_override,f,o) | ||
633 | #define ACPI_MADT3_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (struct madt_nmi_source,f,o) | ||
634 | #define ACPI_MADT4_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (struct madt_local_apic_nmi,f,o) | ||
635 | #define ACPI_MADT7_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (struct madt_local_sapic,f,o) | ||
636 | #define ACPI_MADT8_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (struct madt_interrupt_source,f,o) | ||
637 | |||
638 | /* Reset to default packing */ | ||
639 | |||
133 | #pragma pack() | 640 | #pragma pack() |
134 | 641 | ||
135 | #endif /* __ACTBL1_H__ */ | 642 | #endif /* __ACTBL1_H__ */ |
diff --git a/include/acpi/actbl2.h b/include/acpi/actbl2.h index dfc7ac1094bb..67efe6cad27b 100644 --- a/include/acpi/actbl2.h +++ b/include/acpi/actbl2.h | |||
@@ -44,234 +44,6 @@ | |||
44 | #ifndef __ACTBL2_H__ | 44 | #ifndef __ACTBL2_H__ |
45 | #define __ACTBL2_H__ | 45 | #define __ACTBL2_H__ |
46 | 46 | ||
47 | /* | 47 | /* Code moved to both actbl.h and actbl1.h */ |
48 | * Prefered Power Management Profiles | ||
49 | */ | ||
50 | #define PM_UNSPECIFIED 0 | ||
51 | #define PM_DESKTOP 1 | ||
52 | #define PM_MOBILE 2 | ||
53 | #define PM_WORKSTATION 3 | ||
54 | #define PM_ENTERPRISE_SERVER 4 | ||
55 | #define PM_SOHO_SERVER 5 | ||
56 | #define PM_APPLIANCE_PC 6 | ||
57 | |||
58 | /* | ||
59 | * ACPI Boot Arch Flags | ||
60 | */ | ||
61 | #define BAF_LEGACY_DEVICES 0x0001 | ||
62 | #define BAF_8042_KEYBOARD_CONTROLLER 0x0002 | ||
63 | |||
64 | #define FADT2_REVISION_ID 3 | ||
65 | #define FADT2_MINUS_REVISION_ID 2 | ||
66 | |||
67 | #pragma pack(1) | ||
68 | |||
69 | /* | ||
70 | * ACPI 2.0 Root System Description Table (RSDT) | ||
71 | */ | ||
72 | struct rsdt_descriptor_rev2 { | ||
73 | ACPI_TABLE_HEADER_DEF /* ACPI common table header */ | ||
74 | u32 table_offset_entry[1]; /* Array of pointers to ACPI tables */ | ||
75 | }; | ||
76 | |||
77 | /* | ||
78 | * ACPI 2.0 Extended System Description Table (XSDT) | ||
79 | */ | ||
80 | struct xsdt_descriptor_rev2 { | ||
81 | ACPI_TABLE_HEADER_DEF /* ACPI common table header */ | ||
82 | u64 table_offset_entry[1]; /* Array of pointers to ACPI tables */ | ||
83 | }; | ||
84 | |||
85 | /* | ||
86 | * ACPI 2.0 Firmware ACPI Control Structure (FACS) | ||
87 | */ | ||
88 | struct facs_descriptor_rev2 { | ||
89 | char signature[4]; /* ASCII table signature */ | ||
90 | u32 length; /* Length of structure, in bytes */ | ||
91 | u32 hardware_signature; /* Hardware configuration signature */ | ||
92 | u32 firmware_waking_vector; /* 32-bit physical address of the Firmware Waking Vector. */ | ||
93 | u32 global_lock; /* Global Lock used to synchronize access to shared hardware resources */ | ||
94 | |||
95 | /* Flags (32 bits) */ | ||
96 | |||
97 | u8 S4bios_f:1; /* 00: S4BIOS support is present */ | ||
98 | u8:7; /* 01-07: Reserved, must be zero */ | ||
99 | u8 reserved1[3]; /* 08-31: Reserved, must be zero */ | ||
100 | |||
101 | u64 xfirmware_waking_vector; /* 64-bit physical address of the Firmware Waking Vector. */ | ||
102 | u8 version; /* Version of this table */ | ||
103 | u8 reserved3[31]; /* Reserved, must be zero */ | ||
104 | }; | ||
105 | |||
106 | /* | ||
107 | * ACPI 2.0+ Generic Address Structure (GAS) | ||
108 | */ | ||
109 | struct acpi_generic_address { | ||
110 | u8 address_space_id; /* Address space where struct or register exists. */ | ||
111 | u8 register_bit_width; /* Size in bits of given register */ | ||
112 | u8 register_bit_offset; /* Bit offset within the register */ | ||
113 | u8 access_width; /* Minimum Access size (ACPI 3.0) */ | ||
114 | u64 address; /* 64-bit address of struct or register */ | ||
115 | }; | ||
116 | |||
117 | #define FADT_REV2_COMMON \ | ||
118 | u32 V1_firmware_ctrl; /* 32-bit physical address of FACS */ \ | ||
119 | u32 V1_dsdt; /* 32-bit physical address of DSDT */ \ | ||
120 | u8 reserved1; /* System Interrupt Model isn't used in ACPI 2.0*/ \ | ||
121 | u8 prefer_PM_profile; /* Conveys preferred power management profile to OSPM. */ \ | ||
122 | u16 sci_int; /* System vector of SCI interrupt */ \ | ||
123 | u32 smi_cmd; /* Port address of SMI command port */ \ | ||
124 | u8 acpi_enable; /* Value to write to smi_cmd to enable ACPI */ \ | ||
125 | u8 acpi_disable; /* Value to write to smi_cmd to disable ACPI */ \ | ||
126 | u8 S4bios_req; /* Value to write to SMI CMD to enter S4BIOS state */ \ | ||
127 | u8 pstate_cnt; /* Processor performance state control*/ \ | ||
128 | u32 V1_pm1a_evt_blk; /* Port address of Power Mgt 1a acpi_event Reg Blk */ \ | ||
129 | u32 V1_pm1b_evt_blk; /* Port address of Power Mgt 1b acpi_event Reg Blk */ \ | ||
130 | u32 V1_pm1a_cnt_blk; /* Port address of Power Mgt 1a Control Reg Blk */ \ | ||
131 | u32 V1_pm1b_cnt_blk; /* Port address of Power Mgt 1b Control Reg Blk */ \ | ||
132 | u32 V1_pm2_cnt_blk; /* Port address of Power Mgt 2 Control Reg Blk */ \ | ||
133 | u32 V1_pm_tmr_blk; /* Port address of Power Mgt Timer Ctrl Reg Blk */ \ | ||
134 | u32 V1_gpe0_blk; /* Port addr of General Purpose acpi_event 0 Reg Blk */ \ | ||
135 | u32 V1_gpe1_blk; /* Port addr of General Purpose acpi_event 1 Reg Blk */ \ | ||
136 | u8 pm1_evt_len; /* Byte length of ports at pm1_x_evt_blk */ \ | ||
137 | u8 pm1_cnt_len; /* Byte length of ports at pm1_x_cnt_blk */ \ | ||
138 | u8 pm2_cnt_len; /* Byte Length of ports at pm2_cnt_blk */ \ | ||
139 | u8 pm_tm_len; /* Byte Length of ports at pm_tm_blk */ \ | ||
140 | u8 gpe0_blk_len; /* Byte Length of ports at gpe0_blk */ \ | ||
141 | u8 gpe1_blk_len; /* Byte Length of ports at gpe1_blk */ \ | ||
142 | u8 gpe1_base; /* Offset in gpe model where gpe1 events start */ \ | ||
143 | u8 cst_cnt; /* Support for the _CST object and C States change notification.*/ \ | ||
144 | u16 plvl2_lat; /* Worst case HW latency to enter/exit C2 state */ \ | ||
145 | u16 plvl3_lat; /* Worst case HW latency to enter/exit C3 state */ \ | ||
146 | u16 flush_size; /* Number of flush strides that need to be read */ \ | ||
147 | u16 flush_stride; /* Processor's memory cache line width, in bytes */ \ | ||
148 | u8 duty_offset; /* Processor's duty cycle index in processor's P_CNT reg*/ \ | ||
149 | u8 duty_width; /* Processor's duty cycle value bit width in P_CNT register.*/ \ | ||
150 | u8 day_alrm; /* Index to day-of-month alarm in RTC CMOS RAM */ \ | ||
151 | u8 mon_alrm; /* Index to month-of-year alarm in RTC CMOS RAM */ \ | ||
152 | u8 century; /* Index to century in RTC CMOS RAM */ \ | ||
153 | u16 iapc_boot_arch; /* IA-PC Boot Architecture Flags. See Table 5-10 for description*/ | ||
154 | |||
155 | /* | ||
156 | * ACPI 2.0+ Fixed ACPI Description Table (FADT) | ||
157 | */ | ||
158 | struct fadt_descriptor_rev2 { | ||
159 | ACPI_TABLE_HEADER_DEF /* ACPI common table header */ | ||
160 | FADT_REV2_COMMON u8 reserved2; /* Reserved, must be zero */ | ||
161 | |||
162 | /* Flags (32 bits) */ | ||
163 | |||
164 | u8 wb_invd:1; /* 00: The wbinvd instruction works properly */ | ||
165 | u8 wb_invd_flush:1; /* 01: The wbinvd flushes but does not invalidate */ | ||
166 | u8 proc_c1:1; /* 02: All processors support C1 state */ | ||
167 | u8 plvl2_up:1; /* 03: C2 state works on MP system */ | ||
168 | u8 pwr_button:1; /* 04: Power button is handled as a generic feature */ | ||
169 | u8 sleep_button:1; /* 05: Sleep button is handled as a generic feature, or not present */ | ||
170 | u8 fixed_rTC:1; /* 06: RTC wakeup stat not in fixed register space */ | ||
171 | u8 rtcs4:1; /* 07: RTC wakeup stat not possible from S4 */ | ||
172 | u8 tmr_val_ext:1; /* 08: tmr_val is 32 bits 0=24-bits */ | ||
173 | u8 dock_cap:1; /* 09: Docking supported */ | ||
174 | u8 reset_reg_sup:1; /* 10: System reset via the FADT RESET_REG supported */ | ||
175 | u8 sealed_case:1; /* 11: No internal expansion capabilities and case is sealed */ | ||
176 | u8 headless:1; /* 12: No local video capabilities or local input devices */ | ||
177 | u8 cpu_sw_sleep:1; /* 13: Must execute native instruction after writing SLP_TYPx register */ | ||
178 | |||
179 | u8 pci_exp_wak:1; /* 14: System supports PCIEXP_WAKE (STS/EN) bits (ACPI 3.0) */ | ||
180 | u8 use_platform_clock:1; /* 15: OSPM should use platform-provided timer (ACPI 3.0) */ | ||
181 | u8 S4rtc_sts_valid:1; /* 16: Contents of RTC_STS valid after S4 wake (ACPI 3.0) */ | ||
182 | u8 remote_power_on_capable:1; /* 17: System is compatible with remote power on (ACPI 3.0) */ | ||
183 | u8 force_apic_cluster_model:1; /* 18: All local APICs must use cluster model (ACPI 3.0) */ | ||
184 | u8 force_apic_physical_destination_mode:1; /* 19: all local x_aPICs must use physical dest mode (ACPI 3.0) */ | ||
185 | u8:4; /* 20-23: Reserved, must be zero */ | ||
186 | u8 reserved3; /* 24-31: Reserved, must be zero */ | ||
187 | |||
188 | struct acpi_generic_address reset_register; /* Reset register address in GAS format */ | ||
189 | u8 reset_value; /* Value to write to the reset_register port to reset the system */ | ||
190 | u8 reserved4[3]; /* These three bytes must be zero */ | ||
191 | u64 xfirmware_ctrl; /* 64-bit physical address of FACS */ | ||
192 | u64 Xdsdt; /* 64-bit physical address of DSDT */ | ||
193 | struct acpi_generic_address xpm1a_evt_blk; /* Extended Power Mgt 1a acpi_event Reg Blk address */ | ||
194 | struct acpi_generic_address xpm1b_evt_blk; /* Extended Power Mgt 1b acpi_event Reg Blk address */ | ||
195 | struct acpi_generic_address xpm1a_cnt_blk; /* Extended Power Mgt 1a Control Reg Blk address */ | ||
196 | struct acpi_generic_address xpm1b_cnt_blk; /* Extended Power Mgt 1b Control Reg Blk address */ | ||
197 | struct acpi_generic_address xpm2_cnt_blk; /* Extended Power Mgt 2 Control Reg Blk address */ | ||
198 | struct acpi_generic_address xpm_tmr_blk; /* Extended Power Mgt Timer Ctrl Reg Blk address */ | ||
199 | struct acpi_generic_address xgpe0_blk; /* Extended General Purpose acpi_event 0 Reg Blk address */ | ||
200 | struct acpi_generic_address xgpe1_blk; /* Extended General Purpose acpi_event 1 Reg Blk address */ | ||
201 | }; | ||
202 | |||
203 | /* "Down-revved" ACPI 2.0 FADT descriptor */ | ||
204 | |||
205 | struct fadt_descriptor_rev2_minus { | ||
206 | ACPI_TABLE_HEADER_DEF /* ACPI common table header */ | ||
207 | FADT_REV2_COMMON u8 reserved2; /* Reserved, must be zero */ | ||
208 | u32 flags; | ||
209 | struct acpi_generic_address reset_register; /* Reset register address in GAS format */ | ||
210 | u8 reset_value; /* Value to write to the reset_register port to reset the system. */ | ||
211 | u8 reserved7[3]; /* Reserved, must be zero */ | ||
212 | }; | ||
213 | |||
214 | /* ECDT - Embedded Controller Boot Resources Table */ | ||
215 | |||
216 | struct ec_boot_resources { | ||
217 | ACPI_TABLE_HEADER_DEF struct acpi_generic_address ec_control; /* Address of EC command/status register */ | ||
218 | struct acpi_generic_address ec_data; /* Address of EC data register */ | ||
219 | u32 uid; /* Unique ID - must be same as the EC _UID method */ | ||
220 | u8 gpe_bit; /* The GPE for the EC */ | ||
221 | u8 ec_id[1]; /* Full namepath of the EC in the ACPI namespace */ | ||
222 | }; | ||
223 | |||
224 | /* SRAT - System Resource Affinity Table */ | ||
225 | |||
226 | struct static_resource_alloc { | ||
227 | u8 type; | ||
228 | u8 length; | ||
229 | u8 proximity_domain_lo; | ||
230 | u8 apic_id; | ||
231 | |||
232 | /* Flags (32 bits) */ | ||
233 | |||
234 | u8 enabled:1; /* 00: Use affinity structure */ | ||
235 | u8:7; /* 01-07: Reserved, must be zero */ | ||
236 | u8 reserved3[3]; /* 08-31: Reserved, must be zero */ | ||
237 | |||
238 | u8 local_sapic_eid; | ||
239 | u8 proximity_domain_hi[3]; | ||
240 | u32 reserved4; /* Reserved, must be zero */ | ||
241 | }; | ||
242 | |||
243 | struct memory_affinity { | ||
244 | u8 type; | ||
245 | u8 length; | ||
246 | u32 proximity_domain; | ||
247 | u16 reserved3; | ||
248 | u64 base_address; | ||
249 | u64 address_length; | ||
250 | u32 reserved4; | ||
251 | |||
252 | /* Flags (32 bits) */ | ||
253 | |||
254 | u8 enabled:1; /* 00: Use affinity structure */ | ||
255 | u8 hot_pluggable:1; /* 01: Memory region is hot pluggable */ | ||
256 | u8 non_volatile:1; /* 02: Memory is non-volatile */ | ||
257 | u8:5; /* 03-07: Reserved, must be zero */ | ||
258 | u8 reserved5[3]; /* 08-31: Reserved, must be zero */ | ||
259 | |||
260 | u64 reserved6; /* Reserved, must be zero */ | ||
261 | }; | ||
262 | |||
263 | struct system_resource_affinity { | ||
264 | ACPI_TABLE_HEADER_DEF u32 reserved1; /* Must be value '1' */ | ||
265 | u64 reserved2; /* Reserved, must be zero */ | ||
266 | }; | ||
267 | |||
268 | /* SLIT - System Locality Distance Information Table */ | ||
269 | |||
270 | struct system_locality_info { | ||
271 | ACPI_TABLE_HEADER_DEF u64 locality_count; | ||
272 | u8 entry[1][1]; | ||
273 | }; | ||
274 | |||
275 | #pragma pack() | ||
276 | 48 | ||
277 | #endif /* __ACTBL2_H__ */ | 49 | #endif /* __ACTBL2_H__ */ |
diff --git a/include/acpi/actypes.h b/include/acpi/actypes.h index 7ca89cde706e..77cf1236b05a 100644 --- a/include/acpi/actypes.h +++ b/include/acpi/actypes.h | |||
@@ -44,6 +44,8 @@ | |||
44 | #ifndef __ACTYPES_H__ | 44 | #ifndef __ACTYPES_H__ |
45 | #define __ACTYPES_H__ | 45 | #define __ACTYPES_H__ |
46 | 46 | ||
47 | /* acpisrc:struct_defs -- for acpisrc conversion */ | ||
48 | |||
47 | /* | 49 | /* |
48 | * ACPI_MACHINE_WIDTH must be specified in an OS- or compiler-dependent header | 50 | * ACPI_MACHINE_WIDTH must be specified in an OS- or compiler-dependent header |
49 | * and must be either 16, 32, or 64 | 51 | * and must be either 16, 32, or 64 |
@@ -154,7 +156,6 @@ typedef u64 acpi_physical_address; | |||
154 | #define ACPI_MAX_PTR ACPI_UINT64_MAX | 156 | #define ACPI_MAX_PTR ACPI_UINT64_MAX |
155 | #define ACPI_SIZE_MAX ACPI_UINT64_MAX | 157 | #define ACPI_SIZE_MAX ACPI_UINT64_MAX |
156 | 158 | ||
157 | #define ALIGNED_ADDRESS_BOUNDARY 0x00000008 | ||
158 | #define ACPI_USE_NATIVE_DIVIDE /* Has native 64-bit integer support */ | 159 | #define ACPI_USE_NATIVE_DIVIDE /* Has native 64-bit integer support */ |
159 | 160 | ||
160 | /* | 161 | /* |
@@ -195,8 +196,6 @@ typedef u64 acpi_physical_address; | |||
195 | #define ACPI_MAX_PTR ACPI_UINT32_MAX | 196 | #define ACPI_MAX_PTR ACPI_UINT32_MAX |
196 | #define ACPI_SIZE_MAX ACPI_UINT32_MAX | 197 | #define ACPI_SIZE_MAX ACPI_UINT32_MAX |
197 | 198 | ||
198 | #define ALIGNED_ADDRESS_BOUNDARY 0x00000004 | ||
199 | |||
200 | /******************************************************************************* | 199 | /******************************************************************************* |
201 | * | 200 | * |
202 | * Types specific to 16-bit targets | 201 | * Types specific to 16-bit targets |
@@ -223,7 +222,6 @@ typedef char *acpi_physical_address; | |||
223 | #define ACPI_MAX_PTR ACPI_UINT16_MAX | 222 | #define ACPI_MAX_PTR ACPI_UINT16_MAX |
224 | #define ACPI_SIZE_MAX ACPI_UINT16_MAX | 223 | #define ACPI_SIZE_MAX ACPI_UINT16_MAX |
225 | 224 | ||
226 | #define ALIGNED_ADDRESS_BOUNDARY 0x00000002 | ||
227 | #define ACPI_USE_NATIVE_DIVIDE /* No 64-bit integers, ok to use native divide */ | 225 | #define ACPI_USE_NATIVE_DIVIDE /* No 64-bit integers, ok to use native divide */ |
228 | 226 | ||
229 | /* 64-bit integers cannot be supported */ | 227 | /* 64-bit integers cannot be supported */ |
@@ -254,7 +252,7 @@ typedef acpi_native_uint acpi_size; | |||
254 | /* Use C99 uintptr_t for pointer casting if available, "void *" otherwise */ | 252 | /* Use C99 uintptr_t for pointer casting if available, "void *" otherwise */ |
255 | 253 | ||
256 | #ifndef acpi_uintptr_t | 254 | #ifndef acpi_uintptr_t |
257 | #define acpi_uintptr_t void * | 255 | #define acpi_uintptr_t void * |
258 | #endif | 256 | #endif |
259 | 257 | ||
260 | /* | 258 | /* |
@@ -263,7 +261,7 @@ typedef acpi_native_uint acpi_size; | |||
263 | * manager implementation is to be used (ACPI_USE_LOCAL_CACHE) | 261 | * manager implementation is to be used (ACPI_USE_LOCAL_CACHE) |
264 | */ | 262 | */ |
265 | #ifndef acpi_cache_t | 263 | #ifndef acpi_cache_t |
266 | #define acpi_cache_t struct acpi_memory_list | 264 | #define acpi_cache_t struct acpi_memory_list |
267 | #endif | 265 | #endif |
268 | 266 | ||
269 | /* | 267 | /* |
@@ -271,7 +269,7 @@ typedef acpi_native_uint acpi_size; | |||
271 | * lock and unlock OSL interfaces. | 269 | * lock and unlock OSL interfaces. |
272 | */ | 270 | */ |
273 | #ifndef acpi_cpu_flags | 271 | #ifndef acpi_cpu_flags |
274 | #define acpi_cpu_flags acpi_native_uint | 272 | #define acpi_cpu_flags acpi_native_uint |
275 | #endif | 273 | #endif |
276 | 274 | ||
277 | /* | 275 | /* |
@@ -292,6 +290,21 @@ typedef acpi_native_uint acpi_size; | |||
292 | #define ACPI_UNUSED_VAR | 290 | #define ACPI_UNUSED_VAR |
293 | #endif | 291 | #endif |
294 | 292 | ||
293 | /* | ||
294 | * All ACPICA functions that are available to the rest of the kernel are | ||
295 | * tagged with this macro which can be defined as appropriate for the host. | ||
296 | */ | ||
297 | #ifndef ACPI_EXPORT_SYMBOL | ||
298 | #define ACPI_EXPORT_SYMBOL(symbol) | ||
299 | #endif | ||
300 | |||
301 | /* | ||
302 | * thread_id is returned by acpi_os_get_thread_id. | ||
303 | */ | ||
304 | #ifndef acpi_thread_id | ||
305 | #define acpi_thread_id acpi_native_uint | ||
306 | #endif | ||
307 | |||
295 | /******************************************************************************* | 308 | /******************************************************************************* |
296 | * | 309 | * |
297 | * Independent types | 310 | * Independent types |
@@ -477,15 +490,15 @@ typedef u64 acpi_integer; | |||
477 | */ | 490 | */ |
478 | typedef u32 acpi_table_type; | 491 | typedef u32 acpi_table_type; |
479 | 492 | ||
480 | #define ACPI_TABLE_RSDP (acpi_table_type) 0 | 493 | #define ACPI_TABLE_ID_RSDP (acpi_table_type) 0 |
481 | #define ACPI_TABLE_DSDT (acpi_table_type) 1 | 494 | #define ACPI_TABLE_ID_DSDT (acpi_table_type) 1 |
482 | #define ACPI_TABLE_FADT (acpi_table_type) 2 | 495 | #define ACPI_TABLE_ID_FADT (acpi_table_type) 2 |
483 | #define ACPI_TABLE_FACS (acpi_table_type) 3 | 496 | #define ACPI_TABLE_ID_FACS (acpi_table_type) 3 |
484 | #define ACPI_TABLE_PSDT (acpi_table_type) 4 | 497 | #define ACPI_TABLE_ID_PSDT (acpi_table_type) 4 |
485 | #define ACPI_TABLE_SSDT (acpi_table_type) 5 | 498 | #define ACPI_TABLE_ID_SSDT (acpi_table_type) 5 |
486 | #define ACPI_TABLE_XSDT (acpi_table_type) 6 | 499 | #define ACPI_TABLE_ID_XSDT (acpi_table_type) 6 |
487 | #define ACPI_TABLE_MAX 6 | 500 | #define ACPI_TABLE_ID_MAX 6 |
488 | #define NUM_ACPI_TABLE_TYPES (ACPI_TABLE_MAX+1) | 501 | #define ACPI_NUM_TABLE_TYPES (ACPI_TABLE_ID_MAX+1) |
489 | 502 | ||
490 | /* | 503 | /* |
491 | * Types associated with ACPI names and objects. The first group of | 504 | * Types associated with ACPI names and objects. The first group of |
@@ -816,7 +829,7 @@ struct acpi_system_info { | |||
816 | u32 debug_level; | 829 | u32 debug_level; |
817 | u32 debug_layer; | 830 | u32 debug_layer; |
818 | u32 num_table_types; | 831 | u32 num_table_types; |
819 | struct acpi_table_info table_info[NUM_ACPI_TABLE_TYPES]; | 832 | struct acpi_table_info table_info[ACPI_TABLE_ID_MAX + 1]; |
820 | }; | 833 | }; |
821 | 834 | ||
822 | /* | 835 | /* |
@@ -858,7 +871,7 @@ acpi_status(*acpi_adr_space_handler) (u32 function, | |||
858 | void *handler_context, | 871 | void *handler_context, |
859 | void *region_context); | 872 | void *region_context); |
860 | 873 | ||
861 | #define ACPI_DEFAULT_HANDLER NULL | 874 | #define ACPI_DEFAULT_HANDLER NULL |
862 | 875 | ||
863 | typedef | 876 | typedef |
864 | acpi_status(*acpi_adr_space_setup) (acpi_handle region_handle, | 877 | acpi_status(*acpi_adr_space_setup) (acpi_handle region_handle, |
@@ -911,12 +924,13 @@ struct acpi_compatible_id_list { | |||
911 | #define ACPI_STA_DEVICE_PRESENT 0x01 | 924 | #define ACPI_STA_DEVICE_PRESENT 0x01 |
912 | #define ACPI_STA_DEVICE_ENABLED 0x02 | 925 | #define ACPI_STA_DEVICE_ENABLED 0x02 |
913 | #define ACPI_STA_DEVICE_UI 0x04 | 926 | #define ACPI_STA_DEVICE_UI 0x04 |
914 | #define ACPI_STA_DEVICE_OK 0x08 | 927 | #define ACPI_STA_DEVICE_FUNCTIONING 0x08 |
928 | #define ACPI_STA_DEVICE_OK 0x08 /* Synonym */ | ||
915 | #define ACPI_STA_BATTERY_PRESENT 0x10 | 929 | #define ACPI_STA_BATTERY_PRESENT 0x10 |
916 | 930 | ||
917 | #define ACPI_COMMON_OBJ_INFO \ | 931 | #define ACPI_COMMON_OBJ_INFO \ |
918 | acpi_object_type type; /* ACPI object type */ \ | 932 | acpi_object_type type; /* ACPI object type */ \ |
919 | acpi_name name /* ACPI object Name */ | 933 | acpi_name name /* ACPI object Name */ |
920 | 934 | ||
921 | struct acpi_obj_info_header { | 935 | struct acpi_obj_info_header { |
922 | ACPI_COMMON_OBJ_INFO; | 936 | ACPI_COMMON_OBJ_INFO; |
@@ -957,7 +971,7 @@ struct acpi_mem_space_context { | |||
957 | * Definitions for Resource Attributes | 971 | * Definitions for Resource Attributes |
958 | */ | 972 | */ |
959 | typedef u16 acpi_rs_length; /* Resource Length field is fixed at 16 bits */ | 973 | typedef u16 acpi_rs_length; /* Resource Length field is fixed at 16 bits */ |
960 | typedef u32 acpi_rsdesc_size; /* Max Resource Descriptor size is (length+3) = (64_k-1)+3 */ | 974 | typedef u32 acpi_rsdesc_size; /* Max Resource Descriptor size is (Length+3) = (64_k-1)+3 */ |
961 | 975 | ||
962 | /* | 976 | /* |
963 | * Memory Attributes | 977 | * Memory Attributes |
@@ -972,8 +986,8 @@ typedef u32 acpi_rsdesc_size; /* Max Resource Descriptor size is (length+3) = (6 | |||
972 | 986 | ||
973 | /* | 987 | /* |
974 | * IO Attributes | 988 | * IO Attributes |
975 | * The ISA Io ranges are: n000-n0_ffh, n400-n4_ffh, n800-n8_ffh, n_c00-n_cFFh. | 989 | * The ISA IO ranges are: n000-n0_fFh, n400-n4_fFh, n800-n8_fFh, n_c00-n_cFFh. |
976 | * The non-ISA Io ranges are: n100-n3_ffh, n500-n7_ffh, n900-n_bFfh, n_cd0-n_fFFh. | 990 | * The non-ISA IO ranges are: n100-n3_fFh, n500-n7_fFh, n900-n_bFFh, n_cd0-n_fFFh. |
977 | */ | 991 | */ |
978 | #define ACPI_NON_ISA_ONLY_RANGES (u8) 0x01 | 992 | #define ACPI_NON_ISA_ONLY_RANGES (u8) 0x01 |
979 | #define ACPI_ISA_ONLY_RANGES (u8) 0x02 | 993 | #define ACPI_ISA_ONLY_RANGES (u8) 0x02 |
@@ -1171,12 +1185,12 @@ struct acpi_resource_source { | |||
1171 | /* Fields common to all address descriptors, 16/32/64 bit */ | 1185 | /* Fields common to all address descriptors, 16/32/64 bit */ |
1172 | 1186 | ||
1173 | #define ACPI_RESOURCE_ADDRESS_COMMON \ | 1187 | #define ACPI_RESOURCE_ADDRESS_COMMON \ |
1174 | u8 resource_type; \ | 1188 | u8 resource_type; \ |
1175 | u8 producer_consumer; \ | 1189 | u8 producer_consumer; \ |
1176 | u8 decode; \ | 1190 | u8 decode; \ |
1177 | u8 min_address_fixed; \ | 1191 | u8 min_address_fixed; \ |
1178 | u8 max_address_fixed; \ | 1192 | u8 max_address_fixed; \ |
1179 | union acpi_resource_attribute info; | 1193 | union acpi_resource_attribute info; |
1180 | 1194 | ||
1181 | struct acpi_resource_address { | 1195 | struct acpi_resource_address { |
1182 | ACPI_RESOURCE_ADDRESS_COMMON}; | 1196 | ACPI_RESOURCE_ADDRESS_COMMON}; |
@@ -1297,16 +1311,6 @@ struct acpi_resource { | |||
1297 | 1311 | ||
1298 | #define ACPI_NEXT_RESOURCE(res) (struct acpi_resource *)((u8 *) res + res->length) | 1312 | #define ACPI_NEXT_RESOURCE(res) (struct acpi_resource *)((u8 *) res + res->length) |
1299 | 1313 | ||
1300 | #ifndef ACPI_MISALIGNMENT_NOT_SUPPORTED | ||
1301 | #define ACPI_ALIGN_RESOURCE_SIZE(length) (length) | ||
1302 | #else | ||
1303 | #define ACPI_ALIGN_RESOURCE_SIZE(length) ACPI_ROUND_UP_TO_NATIVE_WORD(length) | ||
1304 | #endif | ||
1305 | |||
1306 | /* | ||
1307 | * END: of definitions for Resource Attributes | ||
1308 | */ | ||
1309 | |||
1310 | struct acpi_pci_routing_table { | 1314 | struct acpi_pci_routing_table { |
1311 | u32 length; | 1315 | u32 length; |
1312 | u32 pin; | 1316 | u32 pin; |
@@ -1315,8 +1319,4 @@ struct acpi_pci_routing_table { | |||
1315 | char source[4]; /* pad to 64 bits so sizeof() works in all cases */ | 1319 | char source[4]; /* pad to 64 bits so sizeof() works in all cases */ |
1316 | }; | 1320 | }; |
1317 | 1321 | ||
1318 | /* | ||
1319 | * END: of definitions for PCI Routing tables | ||
1320 | */ | ||
1321 | |||
1322 | #endif /* __ACTYPES_H__ */ | 1322 | #endif /* __ACTYPES_H__ */ |
diff --git a/include/acpi/acutils.h b/include/acpi/acutils.h index 0927765df6aa..ba039ea1a057 100644 --- a/include/acpi/acutils.h +++ b/include/acpi/acutils.h | |||
@@ -50,24 +50,24 @@ extern const u8 acpi_gbl_resource_aml_sizes[]; | |||
50 | 50 | ||
51 | #if defined(ACPI_DISASSEMBLER) || defined (ACPI_DEBUGGER) | 51 | #if defined(ACPI_DISASSEMBLER) || defined (ACPI_DEBUGGER) |
52 | 52 | ||
53 | extern const char *acpi_gbl_BMdecode[2]; | 53 | extern const char *acpi_gbl_bm_decode[]; |
54 | extern const char *acpi_gbl_config_decode[4]; | 54 | extern const char *acpi_gbl_config_decode[]; |
55 | extern const char *acpi_gbl_consume_decode[2]; | 55 | extern const char *acpi_gbl_consume_decode[]; |
56 | extern const char *acpi_gbl_DECdecode[2]; | 56 | extern const char *acpi_gbl_dec_decode[]; |
57 | extern const char *acpi_gbl_HEdecode[2]; | 57 | extern const char *acpi_gbl_he_decode[]; |
58 | extern const char *acpi_gbl_io_decode[2]; | 58 | extern const char *acpi_gbl_io_decode[]; |
59 | extern const char *acpi_gbl_LLdecode[2]; | 59 | extern const char *acpi_gbl_ll_decode[]; |
60 | extern const char *acpi_gbl_max_decode[2]; | 60 | extern const char *acpi_gbl_max_decode[]; |
61 | extern const char *acpi_gbl_MEMdecode[4]; | 61 | extern const char *acpi_gbl_mem_decode[]; |
62 | extern const char *acpi_gbl_min_decode[2]; | 62 | extern const char *acpi_gbl_min_decode[]; |
63 | extern const char *acpi_gbl_MTPdecode[4]; | 63 | extern const char *acpi_gbl_mtp_decode[]; |
64 | extern const char *acpi_gbl_RNGdecode[4]; | 64 | extern const char *acpi_gbl_rng_decode[]; |
65 | extern const char *acpi_gbl_RWdecode[2]; | 65 | extern const char *acpi_gbl_rw_decode[]; |
66 | extern const char *acpi_gbl_SHRdecode[2]; | 66 | extern const char *acpi_gbl_shr_decode[]; |
67 | extern const char *acpi_gbl_SIZdecode[4]; | 67 | extern const char *acpi_gbl_siz_decode[]; |
68 | extern const char *acpi_gbl_TRSdecode[2]; | 68 | extern const char *acpi_gbl_trs_decode[]; |
69 | extern const char *acpi_gbl_TTPdecode[2]; | 69 | extern const char *acpi_gbl_ttp_decode[]; |
70 | extern const char *acpi_gbl_TYPdecode[4]; | 70 | extern const char *acpi_gbl_typ_decode[]; |
71 | #endif | 71 | #endif |
72 | 72 | ||
73 | /* Types for Resource descriptor entries */ | 73 | /* Types for Resource descriptor entries */ |
@@ -78,6 +78,12 @@ extern const char *acpi_gbl_TYPdecode[4]; | |||
78 | #define ACPI_SMALL_VARIABLE_LENGTH 3 | 78 | #define ACPI_SMALL_VARIABLE_LENGTH 3 |
79 | 79 | ||
80 | typedef | 80 | typedef |
81 | acpi_status(*acpi_walk_aml_callback) (u8 * aml, | ||
82 | u32 length, | ||
83 | u32 offset, | ||
84 | u8 resource_index, void **context); | ||
85 | |||
86 | typedef | ||
81 | acpi_status(*acpi_pkg_callback) (u8 object_type, | 87 | acpi_status(*acpi_pkg_callback) (u8 object_type, |
82 | union acpi_operand_object * source_object, | 88 | union acpi_operand_object * source_object, |
83 | union acpi_generic_state * state, | 89 | union acpi_generic_state * state, |
@@ -277,6 +283,8 @@ acpi_ut_ptr_exit(u32 line_number, | |||
277 | 283 | ||
278 | void acpi_ut_dump_buffer(u8 * buffer, u32 count, u32 display, u32 component_id); | 284 | void acpi_ut_dump_buffer(u8 * buffer, u32 count, u32 display, u32 component_id); |
279 | 285 | ||
286 | void acpi_ut_dump_buffer2(u8 * buffer, u32 count, u32 display); | ||
287 | |||
280 | void acpi_ut_report_error(char *module_name, u32 line_number); | 288 | void acpi_ut_report_error(char *module_name, u32 line_number); |
281 | 289 | ||
282 | void acpi_ut_report_info(char *module_name, u32 line_number); | 290 | void acpi_ut_report_info(char *module_name, u32 line_number); |
@@ -445,6 +453,8 @@ acpi_ut_short_divide(acpi_integer in_dividend, | |||
445 | /* | 453 | /* |
446 | * utmisc | 454 | * utmisc |
447 | */ | 455 | */ |
456 | u8 acpi_ut_is_aml_table(struct acpi_table_header *table); | ||
457 | |||
448 | acpi_status acpi_ut_allocate_owner_id(acpi_owner_id * owner_id); | 458 | acpi_status acpi_ut_allocate_owner_id(acpi_owner_id * owner_id); |
449 | 459 | ||
450 | void acpi_ut_release_owner_id(acpi_owner_id * owner_id); | 460 | void acpi_ut_release_owner_id(acpi_owner_id * owner_id); |
@@ -460,7 +470,9 @@ void acpi_ut_print_string(char *string, u8 max_length); | |||
460 | 470 | ||
461 | u8 acpi_ut_valid_acpi_name(u32 name); | 471 | u8 acpi_ut_valid_acpi_name(u32 name); |
462 | 472 | ||
463 | u8 acpi_ut_valid_acpi_character(char character); | 473 | acpi_name acpi_ut_repair_name(acpi_name name); |
474 | |||
475 | u8 acpi_ut_valid_acpi_char(char character, acpi_native_uint position); | ||
464 | 476 | ||
465 | acpi_status | 477 | acpi_status |
466 | acpi_ut_strtoul64(char *string, u32 base, acpi_integer * ret_integer); | 478 | acpi_ut_strtoul64(char *string, u32 base, acpi_integer * ret_integer); |
@@ -469,6 +481,25 @@ acpi_ut_strtoul64(char *string, u32 base, acpi_integer * ret_integer); | |||
469 | 481 | ||
470 | #define ACPI_ANY_BASE 0 | 482 | #define ACPI_ANY_BASE 0 |
471 | 483 | ||
484 | u32 acpi_ut_dword_byte_swap(u32 value); | ||
485 | |||
486 | void acpi_ut_set_integer_width(u8 revision); | ||
487 | |||
488 | #ifdef ACPI_DEBUG_OUTPUT | ||
489 | void | ||
490 | acpi_ut_display_init_pathname(u8 type, | ||
491 | struct acpi_namespace_node *obj_handle, | ||
492 | char *path); | ||
493 | #endif | ||
494 | |||
495 | /* | ||
496 | * utresrc | ||
497 | */ | ||
498 | acpi_status | ||
499 | acpi_ut_walk_aml_resources(u8 * aml, | ||
500 | acpi_size aml_length, | ||
501 | acpi_walk_aml_callback user_function, void **context); | ||
502 | |||
472 | acpi_status acpi_ut_validate_resource(void *aml, u8 * return_index); | 503 | acpi_status acpi_ut_validate_resource(void *aml, u8 * return_index); |
473 | 504 | ||
474 | u32 acpi_ut_get_descriptor_length(void *aml); | 505 | u32 acpi_ut_get_descriptor_length(void *aml); |
@@ -483,20 +514,6 @@ acpi_status | |||
483 | acpi_ut_get_resource_end_tag(union acpi_operand_object *obj_desc, | 514 | acpi_ut_get_resource_end_tag(union acpi_operand_object *obj_desc, |
484 | u8 ** end_tag); | 515 | u8 ** end_tag); |
485 | 516 | ||
486 | u8 acpi_ut_generate_checksum(u8 * buffer, u32 length); | ||
487 | |||
488 | u32 acpi_ut_dword_byte_swap(u32 value); | ||
489 | |||
490 | void acpi_ut_set_integer_width(u8 revision); | ||
491 | |||
492 | #ifdef ACPI_DEBUG_OUTPUT | ||
493 | void | ||
494 | acpi_ut_display_init_pathname(u8 type, | ||
495 | struct acpi_namespace_node *obj_handle, | ||
496 | char *path); | ||
497 | |||
498 | #endif | ||
499 | |||
500 | /* | 517 | /* |
501 | * utmutex - mutex support | 518 | * utmutex - mutex support |
502 | */ | 519 | */ |
@@ -523,14 +540,15 @@ acpi_ut_initialize_buffer(struct acpi_buffer *buffer, | |||
523 | 540 | ||
524 | void *acpi_ut_allocate(acpi_size size, u32 component, char *module, u32 line); | 541 | void *acpi_ut_allocate(acpi_size size, u32 component, char *module, u32 line); |
525 | 542 | ||
526 | void *acpi_ut_callocate(acpi_size size, u32 component, char *module, u32 line); | 543 | void *acpi_ut_allocate_zeroed(acpi_size size, |
544 | u32 component, char *module, u32 line); | ||
527 | 545 | ||
528 | #ifdef ACPI_DBG_TRACK_ALLOCATIONS | 546 | #ifdef ACPI_DBG_TRACK_ALLOCATIONS |
529 | void *acpi_ut_allocate_and_track(acpi_size size, | 547 | void *acpi_ut_allocate_and_track(acpi_size size, |
530 | u32 component, char *module, u32 line); | 548 | u32 component, char *module, u32 line); |
531 | 549 | ||
532 | void *acpi_ut_callocate_and_track(acpi_size size, | 550 | void *acpi_ut_allocate_zeroed_and_track(acpi_size size, |
533 | u32 component, char *module, u32 line); | 551 | u32 component, char *module, u32 line); |
534 | 552 | ||
535 | void | 553 | void |
536 | acpi_ut_free_and_track(void *address, u32 component, char *module, u32 line); | 554 | acpi_ut_free_and_track(void *address, u32 component, char *module, u32 line); |
@@ -540,6 +558,11 @@ void acpi_ut_dump_allocation_info(void); | |||
540 | #endif /* ACPI_FUTURE_USAGE */ | 558 | #endif /* ACPI_FUTURE_USAGE */ |
541 | 559 | ||
542 | void acpi_ut_dump_allocations(u32 component, char *module); | 560 | void acpi_ut_dump_allocations(u32 component, char *module); |
561 | |||
562 | acpi_status | ||
563 | acpi_ut_create_list(char *list_name, | ||
564 | u16 object_size, struct acpi_memory_list **return_cache); | ||
565 | |||
543 | #endif | 566 | #endif |
544 | 567 | ||
545 | #endif /* _ACUTILS_H */ | 568 | #endif /* _ACUTILS_H */ |
diff --git a/include/acpi/amlcode.h b/include/acpi/amlcode.h index 37964a59aef8..cf18426a87b1 100644 --- a/include/acpi/amlcode.h +++ b/include/acpi/amlcode.h | |||
@@ -180,8 +180,10 @@ | |||
180 | #define AML_BANK_FIELD_OP (u16) 0x5b87 | 180 | #define AML_BANK_FIELD_OP (u16) 0x5b87 |
181 | #define AML_DATA_REGION_OP (u16) 0x5b88 /* ACPI 2.0 */ | 181 | #define AML_DATA_REGION_OP (u16) 0x5b88 /* ACPI 2.0 */ |
182 | 182 | ||
183 | /* Bogus opcodes (they are actually two separate opcodes) */ | 183 | /* |
184 | 184 | * Combination opcodes (actually two one-byte opcodes) | |
185 | * Used by the disassembler and i_aSL compiler | ||
186 | */ | ||
185 | #define AML_LGREATEREQUAL_OP (u16) 0x9295 | 187 | #define AML_LGREATEREQUAL_OP (u16) 0x9295 |
186 | #define AML_LLESSEQUAL_OP (u16) 0x9294 | 188 | #define AML_LLESSEQUAL_OP (u16) 0x9294 |
187 | #define AML_LNOTEQUAL_OP (u16) 0x9293 | 189 | #define AML_LNOTEQUAL_OP (u16) 0x9293 |
diff --git a/include/acpi/amlresrc.h b/include/acpi/amlresrc.h index fb4735315ad3..be03818af9d1 100644 --- a/include/acpi/amlresrc.h +++ b/include/acpi/amlresrc.h | |||
@@ -42,39 +42,45 @@ | |||
42 | * POSSIBILITY OF SUCH DAMAGES. | 42 | * POSSIBILITY OF SUCH DAMAGES. |
43 | */ | 43 | */ |
44 | 44 | ||
45 | /* acpisrc:struct_defs -- for acpisrc conversion */ | ||
46 | |||
45 | #ifndef __AMLRESRC_H | 47 | #ifndef __AMLRESRC_H |
46 | #define __AMLRESRC_H | 48 | #define __AMLRESRC_H |
47 | 49 | ||
48 | #define ASL_RESNAME_ADDRESS "_ADR" | 50 | /* |
49 | #define ASL_RESNAME_ALIGNMENT "_ALN" | 51 | * Resource descriptor tags, as defined in the ACPI specification. |
50 | #define ASL_RESNAME_ADDRESSSPACE "_ASI" | 52 | * Used to symbolically reference fields within a descriptor. |
51 | #define ASL_RESNAME_ACCESSSIZE "_ASZ" | 53 | */ |
52 | #define ASL_RESNAME_TYPESPECIFICATTRIBUTES "_ATT" | 54 | #define ACPI_RESTAG_ADDRESS "_ADR" |
53 | #define ASL_RESNAME_BASEADDRESS "_BAS" | 55 | #define ACPI_RESTAG_ALIGNMENT "_ALN" |
54 | #define ASL_RESNAME_BUSMASTER "_BM_" /* Master(1), Slave(0) */ | 56 | #define ACPI_RESTAG_ADDRESSSPACE "_ASI" |
55 | #define ASL_RESNAME_DECODE "_DEC" | 57 | #define ACPI_RESTAG_ACCESSSIZE "_ASZ" |
56 | #define ASL_RESNAME_DMA "_DMA" | 58 | #define ACPI_RESTAG_TYPESPECIFICATTRIBUTES "_ATT" |
57 | #define ASL_RESNAME_DMATYPE "_TYP" /* Compatible(0), A(1), B(2), F(3) */ | 59 | #define ACPI_RESTAG_BASEADDRESS "_BAS" |
58 | #define ASL_RESNAME_GRANULARITY "_GRA" | 60 | #define ACPI_RESTAG_BUSMASTER "_BM_" /* Master(1), Slave(0) */ |
59 | #define ASL_RESNAME_INTERRUPT "_INT" | 61 | #define ACPI_RESTAG_DECODE "_DEC" |
60 | #define ASL_RESNAME_INTERRUPTLEVEL "_LL_" /* active_lo(1), active_hi(0) */ | 62 | #define ACPI_RESTAG_DMA "_DMA" |
61 | #define ASL_RESNAME_INTERRUPTSHARE "_SHR" /* Shareable(1), no_share(0) */ | 63 | #define ACPI_RESTAG_DMATYPE "_TYP" /* Compatible(0), A(1), B(2), F(3) */ |
62 | #define ASL_RESNAME_INTERRUPTTYPE "_HE_" /* Edge(1), Level(0) */ | 64 | #define ACPI_RESTAG_GRANULARITY "_GRA" |
63 | #define ASL_RESNAME_LENGTH "_LEN" | 65 | #define ACPI_RESTAG_INTERRUPT "_INT" |
64 | #define ASL_RESNAME_MEMATTRIBUTES "_MTP" /* Memory(0), Reserved(1), ACPI(2), NVS(3) */ | 66 | #define ACPI_RESTAG_INTERRUPTLEVEL "_LL_" /* active_lo(1), active_hi(0) */ |
65 | #define ASL_RESNAME_MEMTYPE "_MEM" /* non_cache(0), Cacheable(1) Cache+combine(2), Cache+prefetch(3) */ | 67 | #define ACPI_RESTAG_INTERRUPTSHARE "_SHR" /* Shareable(1), no_share(0) */ |
66 | #define ASL_RESNAME_MAXADDR "_MAX" | 68 | #define ACPI_RESTAG_INTERRUPTTYPE "_HE_" /* Edge(1), Level(0) */ |
67 | #define ASL_RESNAME_MINADDR "_MIN" | 69 | #define ACPI_RESTAG_LENGTH "_LEN" |
68 | #define ASL_RESNAME_MAXTYPE "_MAF" | 70 | #define ACPI_RESTAG_MEMATTRIBUTES "_MTP" /* Memory(0), Reserved(1), ACPI(2), NVS(3) */ |
69 | #define ASL_RESNAME_MINTYPE "_MIF" | 71 | #define ACPI_RESTAG_MEMTYPE "_MEM" /* non_cache(0), Cacheable(1) Cache+combine(2), Cache+prefetch(3) */ |
70 | #define ASL_RESNAME_REGISTERBITOFFSET "_RBO" | 72 | #define ACPI_RESTAG_MAXADDR "_MAX" |
71 | #define ASL_RESNAME_REGISTERBITWIDTH "_RBW" | 73 | #define ACPI_RESTAG_MINADDR "_MIN" |
72 | #define ASL_RESNAME_RANGETYPE "_RNG" | 74 | #define ACPI_RESTAG_MAXTYPE "_MAF" |
73 | #define ASL_RESNAME_READWRITETYPE "_RW_" /* read_only(0), Writeable (1) */ | 75 | #define ACPI_RESTAG_MINTYPE "_MIF" |
74 | #define ASL_RESNAME_TRANSLATION "_TRA" | 76 | #define ACPI_RESTAG_REGISTERBITOFFSET "_RBO" |
75 | #define ASL_RESNAME_TRANSTYPE "_TRS" /* Sparse(1), Dense(0) */ | 77 | #define ACPI_RESTAG_REGISTERBITWIDTH "_RBW" |
76 | #define ASL_RESNAME_TYPE "_TTP" /* Translation(1), Static (0) */ | 78 | #define ACPI_RESTAG_RANGETYPE "_RNG" |
77 | #define ASL_RESNAME_XFERTYPE "_SIz" /* 8(0), 8_and16(1), 16(2) */ | 79 | #define ACPI_RESTAG_READWRITETYPE "_RW_" /* read_only(0), Writeable (1) */ |
80 | #define ACPI_RESTAG_TRANSLATION "_TRA" | ||
81 | #define ACPI_RESTAG_TRANSTYPE "_TRS" /* Sparse(1), Dense(0) */ | ||
82 | #define ACPI_RESTAG_TYPE "_TTP" /* Translation(1), Static (0) */ | ||
83 | #define ACPI_RESTAG_XFERTYPE "_SIZ" /* 8(0), 8_and16(1), 16(2) */ | ||
78 | 84 | ||
79 | /* Default sizes for "small" resource descriptors */ | 85 | /* Default sizes for "small" resource descriptors */ |
80 | 86 | ||
@@ -109,7 +115,7 @@ struct asl_resource_node { | |||
109 | * SMALL descriptors | 115 | * SMALL descriptors |
110 | */ | 116 | */ |
111 | #define AML_RESOURCE_SMALL_HEADER_COMMON \ | 117 | #define AML_RESOURCE_SMALL_HEADER_COMMON \ |
112 | u8 descriptor_type; | 118 | u8 descriptor_type; |
113 | 119 | ||
114 | struct aml_resource_small_header { | 120 | struct aml_resource_small_header { |
115 | AML_RESOURCE_SMALL_HEADER_COMMON}; | 121 | AML_RESOURCE_SMALL_HEADER_COMMON}; |
@@ -162,8 +168,8 @@ struct aml_resource_end_tag { | |||
162 | * LARGE descriptors | 168 | * LARGE descriptors |
163 | */ | 169 | */ |
164 | #define AML_RESOURCE_LARGE_HEADER_COMMON \ | 170 | #define AML_RESOURCE_LARGE_HEADER_COMMON \ |
165 | u8 descriptor_type;\ | 171 | u8 descriptor_type;\ |
166 | u16 resource_length; | 172 | u16 resource_length; |
167 | 173 | ||
168 | struct aml_resource_large_header { | 174 | struct aml_resource_large_header { |
169 | AML_RESOURCE_LARGE_HEADER_COMMON}; | 175 | AML_RESOURCE_LARGE_HEADER_COMMON}; |
@@ -194,9 +200,9 @@ struct aml_resource_fixed_memory32 { | |||
194 | }; | 200 | }; |
195 | 201 | ||
196 | #define AML_RESOURCE_ADDRESS_COMMON \ | 202 | #define AML_RESOURCE_ADDRESS_COMMON \ |
197 | u8 resource_type; \ | 203 | u8 resource_type; \ |
198 | u8 flags; \ | 204 | u8 flags; \ |
199 | u8 specific_flags; | 205 | u8 specific_flags; |
200 | 206 | ||
201 | struct aml_resource_address { | 207 | struct aml_resource_address { |
202 | AML_RESOURCE_LARGE_HEADER_COMMON AML_RESOURCE_ADDRESS_COMMON}; | 208 | AML_RESOURCE_LARGE_HEADER_COMMON AML_RESOURCE_ADDRESS_COMMON}; |
@@ -266,6 +272,7 @@ struct aml_resource_generic_register { | |||
266 | union aml_resource { | 272 | union aml_resource { |
267 | /* Descriptor headers */ | 273 | /* Descriptor headers */ |
268 | 274 | ||
275 | u8 descriptor_type; | ||
269 | struct aml_resource_small_header small_header; | 276 | struct aml_resource_small_header small_header; |
270 | struct aml_resource_large_header large_header; | 277 | struct aml_resource_large_header large_header; |
271 | 278 | ||
@@ -296,9 +303,9 @@ union aml_resource { | |||
296 | /* Utility overlays */ | 303 | /* Utility overlays */ |
297 | 304 | ||
298 | struct aml_resource_address address; | 305 | struct aml_resource_address address; |
299 | u32 u32_item; | 306 | u32 dword_item; |
300 | u16 u16_item; | 307 | u16 word_item; |
301 | u8 U8item; | 308 | u8 byte_item; |
302 | }; | 309 | }; |
303 | 310 | ||
304 | #endif | 311 | #endif |
diff --git a/include/acpi/platform/acenv.h b/include/acpi/platform/acenv.h index 223ec6467108..453a469fd397 100644 --- a/include/acpi/platform/acenv.h +++ b/include/acpi/platform/acenv.h | |||
@@ -49,33 +49,41 @@ | |||
49 | */ | 49 | */ |
50 | 50 | ||
51 | #ifdef ACPI_LIBRARY | 51 | #ifdef ACPI_LIBRARY |
52 | /* | ||
53 | * Note: The non-debug version of the acpi_library does not contain any | ||
54 | * debug support, for minimimal size. The debug version uses ACPI_FULL_DEBUG | ||
55 | */ | ||
52 | #define ACPI_USE_LOCAL_CACHE | 56 | #define ACPI_USE_LOCAL_CACHE |
53 | #endif | 57 | #endif |
54 | 58 | ||
55 | #ifdef ACPI_DUMP_APP | 59 | #ifdef ACPI_ASL_COMPILER |
56 | #ifndef MSDOS | ||
57 | #define ACPI_DEBUG_OUTPUT | 60 | #define ACPI_DEBUG_OUTPUT |
58 | #endif | ||
59 | #define ACPI_APPLICATION | 61 | #define ACPI_APPLICATION |
60 | #define ACPI_DISASSEMBLER | 62 | #define ACPI_DISASSEMBLER |
61 | #define ACPI_NO_METHOD_EXECUTION | 63 | #define ACPI_CONSTANT_EVAL_ONLY |
64 | #define ACPI_LARGE_NAMESPACE_NODE | ||
65 | #define ACPI_DATA_TABLE_DISASSEMBLY | ||
62 | #endif | 66 | #endif |
63 | 67 | ||
64 | #ifdef ACPI_EXEC_APP | 68 | #ifdef ACPI_EXEC_APP |
65 | #undef DEBUGGER_THREADING | 69 | #undef DEBUGGER_THREADING |
66 | #define DEBUGGER_THREADING DEBUGGER_SINGLE_THREADED | 70 | #define DEBUGGER_THREADING DEBUGGER_SINGLE_THREADED |
67 | #define ACPI_DEBUG_OUTPUT | 71 | #define ACPI_FULL_DEBUG |
68 | #define ACPI_APPLICATION | 72 | #define ACPI_APPLICATION |
69 | #define ACPI_DEBUGGER | 73 | #define ACPI_DEBUGGER |
70 | #define ACPI_DISASSEMBLER | ||
71 | #define ACPI_MUTEX_DEBUG | 74 | #define ACPI_MUTEX_DEBUG |
75 | #define ACPI_DBG_TRACK_ALLOCATIONS | ||
72 | #endif | 76 | #endif |
73 | 77 | ||
74 | #ifdef ACPI_ASL_COMPILER | 78 | #ifdef ACPI_DASM_APP |
79 | #ifndef MSDOS | ||
75 | #define ACPI_DEBUG_OUTPUT | 80 | #define ACPI_DEBUG_OUTPUT |
81 | #endif | ||
76 | #define ACPI_APPLICATION | 82 | #define ACPI_APPLICATION |
77 | #define ACPI_DISASSEMBLER | 83 | #define ACPI_DISASSEMBLER |
78 | #define ACPI_CONSTANT_EVAL_ONLY | 84 | #define ACPI_NO_METHOD_EXECUTION |
85 | #define ACPI_LARGE_NAMESPACE_NODE | ||
86 | #define ACPI_DATA_TABLE_DISASSEMBLY | ||
79 | #endif | 87 | #endif |
80 | 88 | ||
81 | #ifdef ACPI_APPLICATION | 89 | #ifdef ACPI_APPLICATION |
@@ -83,6 +91,12 @@ | |||
83 | #define ACPI_USE_LOCAL_CACHE | 91 | #define ACPI_USE_LOCAL_CACHE |
84 | #endif | 92 | #endif |
85 | 93 | ||
94 | #ifdef ACPI_FULL_DEBUG | ||
95 | #define ACPI_DEBUGGER | ||
96 | #define ACPI_DEBUG_OUTPUT | ||
97 | #define ACPI_DISASSEMBLER | ||
98 | #endif | ||
99 | |||
86 | /* | 100 | /* |
87 | * Environment configuration. The purpose of this file is to interface to the | 101 | * Environment configuration. The purpose of this file is to interface to the |
88 | * local generation environment. | 102 | * local generation environment. |
@@ -137,7 +151,7 @@ | |||
137 | #elif defined(MSDOS) /* Must appear after WIN32 and WIN64 check */ | 151 | #elif defined(MSDOS) /* Must appear after WIN32 and WIN64 check */ |
138 | #include "acdos16.h" | 152 | #include "acdos16.h" |
139 | 153 | ||
140 | #elif defined(__FreeBSD__) | 154 | #elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) |
141 | #include "acfreebsd.h" | 155 | #include "acfreebsd.h" |
142 | 156 | ||
143 | #elif defined(__NetBSD__) | 157 | #elif defined(__NetBSD__) |
@@ -163,17 +177,6 @@ | |||
163 | 177 | ||
164 | #endif | 178 | #endif |
165 | 179 | ||
166 | /* | ||
167 | * Memory allocation tracking. Used only if | ||
168 | * 1) This is the debug version | ||
169 | * 2) This is NOT a 16-bit version of the code (not enough real-mode memory) | ||
170 | */ | ||
171 | #ifdef ACPI_DEBUG_OUTPUT | ||
172 | #if ACPI_MACHINE_WIDTH != 16 | ||
173 | #define ACPI_DBG_TRACK_ALLOCATIONS | ||
174 | #endif | ||
175 | #endif | ||
176 | |||
177 | /*! [End] no source code translation !*/ | 180 | /*! [End] no source code translation !*/ |
178 | 181 | ||
179 | /* | 182 | /* |
@@ -271,8 +274,8 @@ typedef char *va_list; | |||
271 | /* | 274 | /* |
272 | * Storage alignment properties | 275 | * Storage alignment properties |
273 | */ | 276 | */ |
274 | #define _AUPBND (sizeof (acpi_native_uint) - 1) | 277 | #define _AUPBND (sizeof (acpi_native_int) - 1) |
275 | #define _ADNBND (sizeof (acpi_native_uint) - 1) | 278 | #define _ADNBND (sizeof (acpi_native_int) - 1) |
276 | 279 | ||
277 | /* | 280 | /* |
278 | * Variable argument list macro definitions | 281 | * Variable argument list macro definitions |
diff --git a/include/acpi/platform/aclinux.h b/include/acpi/platform/aclinux.h index 2e6d54569ee8..b5655a665ba8 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/smp.h b/include/asm-alpha/smp.h index 9950706abdf8..e1432102be05 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 f4837fa29420..5541101b58ae 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-ixp23xx/memory.h b/include/asm-arm/arch-ixp23xx/memory.h index 6e19f46d54d1..c85fc06a043c 100644 --- a/include/asm-arm/arch-ixp23xx/memory.h +++ b/include/asm-arm/arch-ixp23xx/memory.h | |||
@@ -49,7 +49,7 @@ static inline int __ixp23xx_arch_is_coherent(void) | |||
49 | { | 49 | { |
50 | extern unsigned int processor_id; | 50 | extern unsigned int processor_id; |
51 | 51 | ||
52 | if (((processor_id & 15) >= 2) || machine_is_roadrunner()) | 52 | if (((processor_id & 15) >= 4) || machine_is_roadrunner()) |
53 | return 1; | 53 | return 1; |
54 | 54 | ||
55 | return 0; | 55 | return 0; |
diff --git a/include/asm-arm/arch-l7200/serial_l7200.h b/include/asm-arm/arch-l7200/serial_l7200.h index 238c595d97ea..b1008a9d23e5 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 9fcd40aee3e3..04be2a088639 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-pxa/ohci.h b/include/asm-arm/arch-pxa/ohci.h index 7da89569061e..e848a47128cd 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 000000000000..915590c391c8 --- /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-s3c2410/spi-gpio.h b/include/asm-arm/arch-s3c2410/spi-gpio.h new file mode 100644 index 000000000000..258c00bca270 --- /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 000000000000..4029a1a1ab40 --- /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/procinfo.h b/include/asm-arm/procinfo.h index a9c75b2c314f..842526055225 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 43ad4e55878c..406ca97a8ab2 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 95b3abf4851b..7c9568d30307 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-generic/pgtable.h b/include/asm-generic/pgtable.h index 358e4d309ceb..c2059a3a0621 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-i386/apicdef.h b/include/asm-i386/apicdef.h index 5e4a35af2921..9f6995341fdc 100644 --- a/include/asm-i386/apicdef.h +++ b/include/asm-i386/apicdef.h | |||
@@ -121,7 +121,6 @@ | |||
121 | */ | 121 | */ |
122 | #define u32 unsigned int | 122 | #define u32 unsigned int |
123 | 123 | ||
124 | #define lapic ((volatile struct local_apic *)APIC_BASE) | ||
125 | 124 | ||
126 | struct local_apic { | 125 | struct local_apic { |
127 | 126 | ||
diff --git a/include/asm-mips/addrspace.h b/include/asm-mips/addrspace.h index 42520cc84b0f..1386af1cb7d9 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/cpu.h b/include/asm-mips/cpu.h index 818b9a97e214..dff2a0a52f8f 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 64dd45150f64..928f30f8c45c 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/futex.h b/include/asm-mips/futex.h index a554089991f2..12d118f1bc9c 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/inst.h b/include/asm-mips/inst.h index e0745f4ff624..1ed8d0f62577 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/mipsregs.h b/include/asm-mips/mipsregs.h index a2ef579f6b1a..5af7517fce8a 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 | ||
diff --git a/include/asm-mips/page.h b/include/asm-mips/page.h index a1eab136ff6c..4035ec79ecd4 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 4d6bc45df594..087c20769256 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 82166b254b27..2faf5c9ff127 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 702a28fa7a34..d0af2a3b0152 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/sigcontext.h b/include/asm-mips/sigcontext.h index 8edabb0be23f..cefa657dd04a 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 75c6fe7c2126..e14e4b69de21 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/sparsemem.h b/include/asm-mips/sparsemem.h new file mode 100644 index 000000000000..795ac6c23203 --- /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-powerpc/termbits.h b/include/asm-powerpc/termbits.h index ebf6055481dc..6d533b07aaf5 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/unistd.h b/include/asm-powerpc/unistd.h index 908acb44cb8a..edde2462bf52 100644 --- a/include/asm-powerpc/unistd.h +++ b/include/asm-powerpc/unistd.h | |||
@@ -321,8 +321,10 @@ | |||
321 | #define __NR_readlinkat 296 | 321 | #define __NR_readlinkat 296 |
322 | #define __NR_fchmodat 297 | 322 | #define __NR_fchmodat 297 |
323 | #define __NR_faccessat 298 | 323 | #define __NR_faccessat 298 |
324 | #define __NR_get_robust_list 299 | ||
325 | #define __NR_set_robust_list 300 | ||
324 | 326 | ||
325 | #define __NR_syscalls 299 | 327 | #define __NR_syscalls 301 |
326 | 328 | ||
327 | #ifdef __KERNEL__ | 329 | #ifdef __KERNEL__ |
328 | #define __NR__exit __NR_exit | 330 | #define __NR__exit __NR_exit |
diff --git a/include/asm-s390/futex.h b/include/asm-s390/futex.h index 40c25e166a9b..1802775568b9 100644 --- a/include/asm-s390/futex.h +++ b/include/asm-s390/futex.h | |||
@@ -11,23 +11,24 @@ | |||
11 | #define __futex_atomic_fixup \ | 11 | #define __futex_atomic_fixup \ |
12 | ".section __ex_table,\"a\"\n" \ | 12 | ".section __ex_table,\"a\"\n" \ |
13 | " .align 4\n" \ | 13 | " .align 4\n" \ |
14 | " .long 0b,2b,1b,2b\n" \ | 14 | " .long 0b,4b,2b,4b,3b,4b\n" \ |
15 | ".previous" | 15 | ".previous" |
16 | #else /* __s390x__ */ | 16 | #else /* __s390x__ */ |
17 | #define __futex_atomic_fixup \ | 17 | #define __futex_atomic_fixup \ |
18 | ".section __ex_table,\"a\"\n" \ | 18 | ".section __ex_table,\"a\"\n" \ |
19 | " .align 8\n" \ | 19 | " .align 8\n" \ |
20 | " .quad 0b,2b,1b,2b\n" \ | 20 | " .quad 0b,4b,2b,4b,3b,4b\n" \ |
21 | ".previous" | 21 | ".previous" |
22 | #endif /* __s390x__ */ | 22 | #endif /* __s390x__ */ |
23 | 23 | ||
24 | #define __futex_atomic_op(insn, ret, oldval, newval, uaddr, oparg) \ | 24 | #define __futex_atomic_op(insn, ret, oldval, newval, uaddr, oparg) \ |
25 | asm volatile(" l %1,0(%6)\n" \ | 25 | asm volatile(" sacf 256\n" \ |
26 | "0: " insn \ | 26 | "0: l %1,0(%6)\n" \ |
27 | " cs %1,%2,0(%6)\n" \ | 27 | "1: " insn \ |
28 | "1: jl 0b\n" \ | 28 | "2: cs %1,%2,0(%6)\n" \ |
29 | "3: jl 1b\n" \ | ||
29 | " lhi %0,0\n" \ | 30 | " lhi %0,0\n" \ |
30 | "2:\n" \ | 31 | "4: sacf 0\n" \ |
31 | __futex_atomic_fixup \ | 32 | __futex_atomic_fixup \ |
32 | : "=d" (ret), "=&d" (oldval), "=&d" (newval), \ | 33 | : "=d" (ret), "=&d" (oldval), "=&d" (newval), \ |
33 | "=m" (*uaddr) \ | 34 | "=m" (*uaddr) \ |
diff --git a/include/asm-s390/lowcore.h b/include/asm-s390/lowcore.h index db0606c1abd4..bea727904287 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 657d582e8149..41c2792ff6b0 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-sparc/unistd.h b/include/asm-sparc/unistd.h index f5611a721fbd..45a576507785 100644 --- a/include/asm-sparc/unistd.h +++ b/include/asm-sparc/unistd.h | |||
@@ -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-sparc64/dma-mapping.h b/include/asm-sparc64/dma-mapping.h index c7d5804ba76d..a8d39f23d43b 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 7c5a589ea437..e1ea67bc32f2 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/pgtable.h b/include/asm-sparc64/pgtable.h index c44e7466534e..cd464f469a2c 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/unistd.h b/include/asm-sparc64/unistd.h index 68705748bec0..998ef4ab0e06 100644 --- a/include/asm-sparc64/unistd.h +++ b/include/asm-sparc64/unistd.h | |||
@@ -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 000000000000..659b9abdfdba --- /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/uaccess.h b/include/asm-um/uaccess.h index bea5a015f667..16c734af9193 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-x86_64/acpi.h b/include/asm-x86_64/acpi.h index aa1c7b2e438c..2c95a319c056 100644 --- a/include/asm-x86_64/acpi.h +++ b/include/asm-x86_64/acpi.h | |||
@@ -162,6 +162,8 @@ extern int acpi_pci_disabled; | |||
162 | 162 | ||
163 | extern u8 x86_acpiid_to_apicid[]; | 163 | extern u8 x86_acpiid_to_apicid[]; |
164 | 164 | ||
165 | #define ARCH_HAS_POWER_INIT 1 | ||
166 | |||
165 | extern int acpi_skip_timer_override; | 167 | extern int acpi_skip_timer_override; |
166 | 168 | ||
167 | #endif /*__KERNEL__*/ | 169 | #endif /*__KERNEL__*/ |
diff --git a/include/asm-x86_64/apicdef.h b/include/asm-x86_64/apicdef.h index 5a48e9bcf218..1dd40067c67c 100644 --- a/include/asm-x86_64/apicdef.h +++ b/include/asm-x86_64/apicdef.h | |||
@@ -137,8 +137,6 @@ | |||
137 | */ | 137 | */ |
138 | #define u32 unsigned int | 138 | #define u32 unsigned int |
139 | 139 | ||
140 | #define lapic ((volatile struct local_apic *)APIC_BASE) | ||
141 | |||
142 | struct local_apic { | 140 | struct local_apic { |
143 | 141 | ||
144 | /*000*/ struct { u32 __reserved[4]; } __reserved_01; | 142 | /*000*/ struct { u32 __reserved[4]; } __reserved_01; |
diff --git a/include/asm-x86_64/elf.h b/include/asm-x86_64/elf.h index c98633af07d2..b4f8f4a41a6e 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/linux/elevator.h b/include/linux/elevator.h index ad133fcfb239..1713ace808bf 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 2d716080be4a..33d8f2087b6e 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 3de2bfb2410f..f813bc8266aa 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,9 +762,6 @@ 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 | unsigned int flags); | 766 | unsigned int flags); |
766 | 767 | ||
diff --git a/include/linux/fsl_devices.h b/include/linux/fsl_devices.h index a3a0e078f79d..16fbe59edeb1 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/i2o.h b/include/linux/i2o.h index dd7d627bf66f..c115e9e840b4 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/input.h b/include/linux/input.h index 50e338d2ffda..ce1a756c4c30 100644 --- a/include/linux/input.h +++ b/include/linux/input.h | |||
@@ -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 |
@@ -577,14 +579,9 @@ struct input_absinfo { | |||
577 | * Switch events | 579 | * Switch events |
578 | */ | 580 | */ |
579 | 581 | ||
580 | #define SW_0 0x00 | 582 | #define SW_LID 0x00 /* set = lid shut */ |
581 | #define SW_1 0x01 | 583 | #define SW_TABLET_MODE 0x01 /* set = tablet mode */ |
582 | #define SW_2 0x02 | 584 | #define SW_HEADPHONE_INSERT 0x02 /* set = inserted */ |
583 | #define SW_3 0x03 | ||
584 | #define SW_4 0x04 | ||
585 | #define SW_5 0x05 | ||
586 | #define SW_6 0x06 | ||
587 | #define SW_7 0x07 | ||
588 | #define SW_MAX 0x0f | 585 | #define SW_MAX 0x0f |
589 | 586 | ||
590 | /* | 587 | /* |
diff --git a/include/linux/kernel.h b/include/linux/kernel.h index e1bd0842f6a1..f4fc576ed4c4 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); |
diff --git a/include/linux/m48t86.h b/include/linux/m48t86.h index 9065199319d0..915d6b4f0f89 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/mempolicy.h b/include/linux/mempolicy.h index 6a7621b2b12b..f5fdca1d67e6 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/mmc/mmc.h b/include/linux/mmc/mmc.h index bdc556d88498..03a14a30c46a 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 b5c21122c299..2d8337150493 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/pci-acpi.h b/include/linux/pci-acpi.h index 4877e35ae202..936ef82ed76a 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_ids.h b/include/linux/pci_ids.h index d6fe048376ab..590dc6dca315 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h | |||
@@ -1231,6 +1231,7 @@ | |||
1231 | #define PCI_DEVICE_ID_VIA_8380_0 0x0204 | 1231 | #define PCI_DEVICE_ID_VIA_8380_0 0x0204 |
1232 | #define PCI_DEVICE_ID_VIA_3238_0 0x0238 | 1232 | #define PCI_DEVICE_ID_VIA_3238_0 0x0238 |
1233 | #define PCI_DEVICE_ID_VIA_PT880 0x0258 | 1233 | #define PCI_DEVICE_ID_VIA_PT880 0x0258 |
1234 | #define PCI_DEVICE_ID_VIA_PT880ULTRA 0x0308 | ||
1234 | #define PCI_DEVICE_ID_VIA_PX8X0_0 0x0259 | 1235 | #define PCI_DEVICE_ID_VIA_PX8X0_0 0x0259 |
1235 | #define PCI_DEVICE_ID_VIA_3269_0 0x0269 | 1236 | #define PCI_DEVICE_ID_VIA_3269_0 0x0269 |
1236 | #define PCI_DEVICE_ID_VIA_K8T800PRO_0 0x0282 | 1237 | #define PCI_DEVICE_ID_VIA_K8T800PRO_0 0x0282 |
diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h index 5673008b61e1..970284f571a6 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/slab.h b/include/linux/slab.h index 3af03b19c983..2d985d59c7b8 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/spi.h b/include/linux/spi/spi.h index b05f1463a267..e928c0dcc297 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 c961fe9bf3eb..16ce178f54d7 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/swap.h b/include/linux/swap.h index 5b1fdf1cff4f..f03c24719302 100644 --- a/include/linux/swap.h +++ b/include/linux/swap.h | |||
@@ -296,7 +296,7 @@ static inline void disable_swap_token(void) | |||
296 | #define read_swap_cache_async(swp,vma,addr) NULL | 296 | #define read_swap_cache_async(swp,vma,addr) NULL |
297 | #define lookup_swap_cache(swp) NULL | 297 | #define lookup_swap_cache(swp) NULL |
298 | #define valid_swaphandles(swp, off) 0 | 298 | #define valid_swaphandles(swp, off) 0 |
299 | #define can_share_swap_page(p) 0 | 299 | #define can_share_swap_page(p) (page_mapcount(p) == 1) |
300 | #define move_to_swap_cache(p, swp) 1 | 300 | #define move_to_swap_cache(p, swp) 1 |
301 | #define move_from_swap_cache(p, i, m) 1 | 301 | #define move_from_swap_cache(p, i, m) 1 |
302 | #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 3996960fc565..60d49e5456e7 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> |
@@ -581,5 +582,10 @@ asmlinkage long sys_tee(int fdin, int fdout, size_t len, unsigned int flags); | |||
581 | 582 | ||
582 | 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, |
583 | unsigned 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); | ||
584 | 590 | ||
585 | #endif | 591 | #endif |
diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h index d7670ec1ec1e..ad7fa9c86c10 100644 --- a/include/linux/videodev2.h +++ b/include/linux/videodev2.h | |||
@@ -1141,8 +1141,13 @@ extern char *v4l2_type_names[]; | |||
1141 | /* Compatibility layer interface -- v4l1-compat module */ | 1141 | /* Compatibility layer interface -- v4l1-compat module */ |
1142 | typedef int (*v4l2_kioctl)(struct inode *inode, struct file *file, | 1142 | typedef int (*v4l2_kioctl)(struct inode *inode, struct file *file, |
1143 | unsigned int cmd, void *arg); | 1143 | unsigned int cmd, void *arg); |
1144 | |||
1145 | #ifdef CONFIG_VIDEO_V4L1_COMPAT | ||
1144 | int v4l_compat_translate_ioctl(struct inode *inode, struct file *file, | 1146 | int v4l_compat_translate_ioctl(struct inode *inode, struct file *file, |
1145 | 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 | ||
1146 | 1151 | ||
1147 | /* 32 Bits compatibility layer for 64 bits processors */ | 1152 | /* 32 Bits compatibility layer for 64 bits processors */ |
1148 | 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 530ae3f4248c..fab5aed8ca31 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/net/compat.h b/include/net/compat.h index 8662b8f43df5..e65cbedb6abc 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/irda/irlmp.h b/include/net/irda/irlmp.h index 86aefb1fda5e..c0c895d379ba 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 b0666d66293f..4901ee446879 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/sctp/command.h b/include/net/sctp/command.h index 34a1a09e5aef..807d6f1ef4b5 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 e673b2c984e9..aa6033ca7cd8 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 | ||