[ACPI] ACPICA 20050930
[deliverable/linux.git] / include / acpi / acresrc.h
1 /******************************************************************************
2 *
3 * Name: acresrc.h - Resource Manager function prototypes
4 *
5 *****************************************************************************/
6
7 /*
8 * Copyright (C) 2000 - 2005, R. Byron Moore
9 * All rights reserved.
10 *
11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions
13 * are met:
14 * 1. Redistributions of source code must retain the above copyright
15 * notice, this list of conditions, and the following disclaimer,
16 * without modification.
17 * 2. Redistributions in binary form must reproduce at minimum a disclaimer
18 * substantially similar to the "NO WARRANTY" disclaimer below
19 * ("Disclaimer") and any redistribution must be conditioned upon
20 * including a substantially similar Disclaimer requirement for further
21 * binary redistribution.
22 * 3. Neither the names of the above-listed copyright holders nor the names
23 * of any contributors may be used to endorse or promote products derived
24 * from this software without specific prior written permission.
25 *
26 * Alternatively, this software may be distributed under the terms of the
27 * GNU General Public License ("GPL") version 2 as published by the Free
28 * Software Foundation.
29 *
30 * NO WARRANTY
31 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
32 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
33 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
34 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
35 * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
36 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
37 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
38 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
39 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
40 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
41 * POSSIBILITY OF SUCH DAMAGES.
42 */
43
44 #ifndef __ACRESRC_H__
45 #define __ACRESRC_H__
46
47 /* Need the AML resource descriptor structs */
48
49 #include "amlresrc.h"
50
51 /*
52 * Resource dispatch and info tables
53 */
54 struct acpi_resource_info {
55 u8 length_type;
56 u8 minimum_aml_resource_length;
57 u8 minimum_internal_struct_length;
58 };
59
60 /* Types for length_type above */
61
62 #define ACPI_FIXED_LENGTH 0
63 #define ACPI_VARIABLE_LENGTH 1
64 #define ACPI_SMALL_VARIABLE_LENGTH 2
65
66 /* Handlers */
67
68 typedef acpi_status(*ACPI_SET_RESOURCE_HANDLER) (struct acpi_resource *
69 resource,
70 union aml_resource * aml);
71
72 typedef acpi_status(*ACPI_GET_RESOURCE_HANDLER) (union aml_resource * aml,
73 u16 aml_resource_length,
74 struct acpi_resource *
75 resource);
76
77 typedef void (*ACPI_DUMP_RESOURCE_HANDLER) (union acpi_resource_data * data);
78
79 /* Tables indexed by internal resource type */
80
81 extern u8 acpi_gbl_aml_resource_sizes[];
82 extern ACPI_SET_RESOURCE_HANDLER acpi_gbl_set_resource_dispatch[];
83 extern ACPI_DUMP_RESOURCE_HANDLER acpi_gbl_dump_resource_dispatch[];
84
85 /* Tables indexed by raw AML resource descriptor type */
86
87 extern struct acpi_resource_info acpi_gbl_sm_resource_info[];
88 extern struct acpi_resource_info acpi_gbl_lg_resource_info[];
89 extern ACPI_GET_RESOURCE_HANDLER acpi_gbl_sm_get_resource_dispatch[];
90 extern ACPI_GET_RESOURCE_HANDLER acpi_gbl_lg_get_resource_dispatch[];
91
92 /*
93 * Function prototypes called from Acpi* APIs
94 */
95 acpi_status
96 acpi_rs_get_prt_method_data(acpi_handle handle, struct acpi_buffer *ret_buffer);
97
98 acpi_status
99 acpi_rs_get_crs_method_data(acpi_handle handle, struct acpi_buffer *ret_buffer);
100
101 #ifdef ACPI_FUTURE_USAGE
102 acpi_status
103 acpi_rs_get_prs_method_data(acpi_handle handle, struct acpi_buffer *ret_buffer);
104 #endif /* ACPI_FUTURE_USAGE */
105
106 acpi_status
107 acpi_rs_get_method_data(acpi_handle handle,
108 char *path, struct acpi_buffer *ret_buffer);
109
110 acpi_status
111 acpi_rs_set_srs_method_data(acpi_handle handle, struct acpi_buffer *ret_buffer);
112
113 acpi_status
114 acpi_rs_create_resource_list(union acpi_operand_object *aml_buffer,
115 struct acpi_buffer *output_buffer);
116
117 acpi_status
118 acpi_rs_create_aml_resources(struct acpi_resource *linked_list_buffer,
119 struct acpi_buffer *output_buffer);
120
121 acpi_status
122 acpi_rs_create_pci_routing_table(union acpi_operand_object *package_object,
123 struct acpi_buffer *output_buffer);
124
125 /*
126 * rsdump
127 */
128 #ifdef ACPI_FUTURE_USAGE
129 void acpi_rs_dump_resource_list(struct acpi_resource *resource);
130
131 void acpi_rs_dump_irq_list(u8 * route_table);
132 #endif /* ACPI_FUTURE_USAGE */
133
134 /*
135 * rscalc
136 */
137 acpi_status
138 acpi_rs_get_list_length(u8 * aml_buffer,
139 u32 aml_buffer_length, acpi_size * size_needed);
140
141 acpi_status
142 acpi_rs_get_aml_length(struct acpi_resource *linked_list_buffer,
143 acpi_size * size_needed);
144
145 acpi_status
146 acpi_rs_get_pci_routing_table_length(union acpi_operand_object *package_object,
147 acpi_size * buffer_size_needed);
148
149 acpi_status
150 acpi_rs_convert_aml_to_resources(u8 * aml_buffer,
151 u32 aml_buffer_length, u8 * output_buffer);
152
153 acpi_status
154 acpi_rs_convert_resources_to_aml(struct acpi_resource *resource,
155 acpi_size aml_size_needed, u8 * output_buffer);
156
157 /*
158 * rsio
159 */
160 acpi_status
161 acpi_rs_get_io(union aml_resource *aml,
162 u16 aml_resource_length, struct acpi_resource *resource);
163
164 acpi_status
165 acpi_rs_set_io(struct acpi_resource *resource, union aml_resource *aml);
166
167 acpi_status
168 acpi_rs_get_fixed_io(union aml_resource *aml,
169 u16 aml_resource_length, struct acpi_resource *resource);
170
171 acpi_status
172 acpi_rs_set_fixed_io(struct acpi_resource *resource, union aml_resource *aml);
173
174 acpi_status
175 acpi_rs_get_dma(union aml_resource *aml,
176 u16 aml_resource_length, struct acpi_resource *resource);
177
178 acpi_status
179 acpi_rs_set_dma(struct acpi_resource *resource, union aml_resource *aml);
180
181 /*
182 * rsirq
183 */
184 acpi_status
185 acpi_rs_get_irq(union aml_resource *aml,
186 u16 aml_resource_length, struct acpi_resource *resource);
187
188 acpi_status
189 acpi_rs_set_irq(struct acpi_resource *resource, union aml_resource *aml);
190
191 acpi_status
192 acpi_rs_get_ext_irq(union aml_resource *aml,
193 u16 aml_resource_length, struct acpi_resource *resource);
194
195 acpi_status
196 acpi_rs_set_ext_irq(struct acpi_resource *resource, union aml_resource *aml);
197
198 /*
199 * rsaddr
200 */
201 acpi_status
202 acpi_rs_get_address16(union aml_resource *aml,
203 u16 aml_resource_length, struct acpi_resource *resource);
204
205 acpi_status
206 acpi_rs_set_address16(struct acpi_resource *resource, union aml_resource *aml);
207
208 acpi_status
209 acpi_rs_get_address32(union aml_resource *aml,
210 u16 aml_resource_length, struct acpi_resource *resource);
211
212 acpi_status
213 acpi_rs_set_address32(struct acpi_resource *resource, union aml_resource *aml);
214
215 acpi_status
216 acpi_rs_get_address64(union aml_resource *aml,
217 u16 aml_resource_length, struct acpi_resource *resource);
218
219 acpi_status
220 acpi_rs_set_address64(struct acpi_resource *resource, union aml_resource *aml);
221
222 acpi_status
223 acpi_rs_get_ext_address64(union aml_resource *aml,
224 u16 aml_resource_length,
225 struct acpi_resource *resource);
226
227 acpi_status
228 acpi_rs_set_ext_address64(struct acpi_resource *resource,
229 union aml_resource *aml);
230
231 /*
232 * rsmemory
233 */
234 acpi_status
235 acpi_rs_get_memory24(union aml_resource *aml,
236 u16 aml_resource_length, struct acpi_resource *resource);
237
238 acpi_status
239 acpi_rs_set_memory24(struct acpi_resource *resource, union aml_resource *aml);
240
241 acpi_status
242 acpi_rs_get_memory32(union aml_resource *aml,
243 u16 aml_resource_length, struct acpi_resource *resource);
244
245 acpi_status
246 acpi_rs_set_memory32(struct acpi_resource *resource, union aml_resource *aml);
247
248 acpi_status
249 acpi_rs_get_fixed_memory32(union aml_resource *aml,
250 u16 aml_resource_length,
251 struct acpi_resource *resource);
252
253 acpi_status
254 acpi_rs_set_fixed_memory32(struct acpi_resource *resource,
255 union aml_resource *aml);
256
257 /*
258 * rsmisc
259 */
260 acpi_status
261 acpi_rs_get_generic_reg(union aml_resource *aml,
262 u16 aml_resource_length,
263 struct acpi_resource *resource);
264
265 acpi_status
266 acpi_rs_set_generic_reg(struct acpi_resource *resource,
267 union aml_resource *aml);
268
269 acpi_status
270 acpi_rs_get_vendor(union aml_resource *aml,
271 u16 aml_resource_length, struct acpi_resource *resource);
272
273 acpi_status
274 acpi_rs_set_vendor(struct acpi_resource *resource, union aml_resource *aml);
275
276 acpi_status
277 acpi_rs_get_start_dpf(union aml_resource *aml,
278 u16 aml_resource_length, struct acpi_resource *resource);
279
280 acpi_status
281 acpi_rs_set_start_dpf(struct acpi_resource *resource, union aml_resource *aml);
282
283 acpi_status
284 acpi_rs_get_end_dpf(union aml_resource *aml,
285 u16 aml_resource_length, struct acpi_resource *resource);
286
287 acpi_status
288 acpi_rs_set_end_dpf(struct acpi_resource *resource, union aml_resource *aml);
289
290 acpi_status
291 acpi_rs_get_end_tag(union aml_resource *aml,
292 u16 aml_resource_length, struct acpi_resource *resource);
293
294 acpi_status
295 acpi_rs_set_end_tag(struct acpi_resource *resource, union aml_resource *aml);
296
297 /*
298 * rsutils
299 */
300 void
301 acpi_rs_move_data(void *destination,
302 void *source, u16 item_count, u8 move_type);
303
304 /* Types used in move_type above */
305
306 #define ACPI_MOVE_TYPE_16_TO_32 0
307 #define ACPI_MOVE_TYPE_32_TO_16 1
308 #define ACPI_MOVE_TYPE_32_TO_32 2
309 #define ACPI_MOVE_TYPE_64_TO_64 3
310
311 u16
312 acpi_rs_get_resource_source(u16 resource_length,
313 acpi_size minimum_length,
314 struct acpi_resource_source *resource_source,
315 union aml_resource *aml, char *string_ptr);
316
317 acpi_size
318 acpi_rs_set_resource_source(union aml_resource *aml,
319 acpi_size minimum_length,
320 struct acpi_resource_source *resource_source);
321
322 u8 acpi_rs_get_resource_type(u8 resource_start_byte);
323
324 u32 acpi_rs_get_descriptor_length(union aml_resource *aml);
325
326 u16 acpi_rs_get_resource_length(union aml_resource *aml);
327
328 void
329 acpi_rs_set_resource_header(u8 descriptor_type,
330 acpi_size total_length, union aml_resource *aml);
331
332 struct acpi_resource_info *acpi_rs_get_resource_info(u8 resource_type);
333
334 #if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER)
335 /*
336 * rsdump
337 */
338 void acpi_rs_dump_irq(union acpi_resource_data *resource);
339
340 void acpi_rs_dump_address16(union acpi_resource_data *resource);
341
342 void acpi_rs_dump_address32(union acpi_resource_data *resource);
343
344 void acpi_rs_dump_address64(union acpi_resource_data *resource);
345
346 void acpi_rs_dump_ext_address64(union acpi_resource_data *resource);
347
348 void acpi_rs_dump_dma(union acpi_resource_data *resource);
349
350 void acpi_rs_dump_io(union acpi_resource_data *resource);
351
352 void acpi_rs_dump_ext_irq(union acpi_resource_data *resource);
353
354 void acpi_rs_dump_fixed_io(union acpi_resource_data *resource);
355
356 void acpi_rs_dump_fixed_memory32(union acpi_resource_data *resource);
357
358 void acpi_rs_dump_memory24(union acpi_resource_data *resource);
359
360 void acpi_rs_dump_memory32(union acpi_resource_data *resource);
361
362 void acpi_rs_dump_start_dpf(union acpi_resource_data *resource);
363
364 void acpi_rs_dump_vendor(union acpi_resource_data *resource);
365
366 void acpi_rs_dump_generic_reg(union acpi_resource_data *resource);
367
368 void acpi_rs_dump_end_dpf(union acpi_resource_data *resource);
369
370 void acpi_rs_dump_end_tag(union acpi_resource_data *resource);
371
372 #endif
373
374 #endif /* __ACRESRC_H__ */
This page took 0.078817 seconds and 5 git commands to generate.