[ACPI] ACPICA 20050930
[deliverable/linux.git] / include / acpi / acresrc.h
CommitLineData
1da177e4
LT
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
50eca3eb
BM
47/* Need the AML resource descriptor structs */
48
49#include "amlresrc.h"
50
51/*
52 * Resource dispatch and info tables
53 */
54struct 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
68typedef acpi_status(*ACPI_SET_RESOURCE_HANDLER) (struct acpi_resource *
69 resource,
70 union aml_resource * aml);
71
72typedef acpi_status(*ACPI_GET_RESOURCE_HANDLER) (union aml_resource * aml,
73 u16 aml_resource_length,
74 struct acpi_resource *
75 resource);
76
77typedef void (*ACPI_DUMP_RESOURCE_HANDLER) (union acpi_resource_data * data);
78
79/* Tables indexed by internal resource type */
80
81extern u8 acpi_gbl_aml_resource_sizes[];
82extern ACPI_SET_RESOURCE_HANDLER acpi_gbl_set_resource_dispatch[];
83extern ACPI_DUMP_RESOURCE_HANDLER acpi_gbl_dump_resource_dispatch[];
84
85/* Tables indexed by raw AML resource descriptor type */
86
87extern struct acpi_resource_info acpi_gbl_sm_resource_info[];
88extern struct acpi_resource_info acpi_gbl_lg_resource_info[];
89extern ACPI_GET_RESOURCE_HANDLER acpi_gbl_sm_get_resource_dispatch[];
90extern ACPI_GET_RESOURCE_HANDLER acpi_gbl_lg_get_resource_dispatch[];
91
1da177e4
LT
92/*
93 * Function prototypes called from Acpi* APIs
94 */
1da177e4 95acpi_status
4be44fcd 96acpi_rs_get_prt_method_data(acpi_handle handle, struct acpi_buffer *ret_buffer);
1da177e4
LT
97
98acpi_status
4be44fcd 99acpi_rs_get_crs_method_data(acpi_handle handle, struct acpi_buffer *ret_buffer);
1da177e4 100
44f6c012 101#ifdef ACPI_FUTURE_USAGE
1da177e4 102acpi_status
4be44fcd
LB
103acpi_rs_get_prs_method_data(acpi_handle handle, struct acpi_buffer *ret_buffer);
104#endif /* ACPI_FUTURE_USAGE */
1da177e4
LT
105
106acpi_status
4be44fcd
LB
107acpi_rs_get_method_data(acpi_handle handle,
108 char *path, struct acpi_buffer *ret_buffer);
1da177e4
LT
109
110acpi_status
4be44fcd 111acpi_rs_set_srs_method_data(acpi_handle handle, struct acpi_buffer *ret_buffer);
1da177e4
LT
112
113acpi_status
50eca3eb 114acpi_rs_create_resource_list(union acpi_operand_object *aml_buffer,
4be44fcd 115 struct acpi_buffer *output_buffer);
1da177e4
LT
116
117acpi_status
50eca3eb
BM
118acpi_rs_create_aml_resources(struct acpi_resource *linked_list_buffer,
119 struct acpi_buffer *output_buffer);
1da177e4
LT
120
121acpi_status
4be44fcd
LB
122acpi_rs_create_pci_routing_table(union acpi_operand_object *package_object,
123 struct acpi_buffer *output_buffer);
1da177e4
LT
124
125/*
44f6c012 126 * rsdump
1da177e4 127 */
44f6c012 128#ifdef ACPI_FUTURE_USAGE
4be44fcd 129void acpi_rs_dump_resource_list(struct acpi_resource *resource);
1da177e4 130
4be44fcd
LB
131void acpi_rs_dump_irq_list(u8 * route_table);
132#endif /* ACPI_FUTURE_USAGE */
44f6c012
RM
133
134/*
135 * rscalc
136 */
1da177e4 137acpi_status
50eca3eb
BM
138acpi_rs_get_list_length(u8 * aml_buffer,
139 u32 aml_buffer_length, acpi_size * size_needed);
1da177e4
LT
140
141acpi_status
50eca3eb
BM
142acpi_rs_get_aml_length(struct acpi_resource *linked_list_buffer,
143 acpi_size * size_needed);
1da177e4
LT
144
145acpi_status
4be44fcd
LB
146acpi_rs_get_pci_routing_table_length(union acpi_operand_object *package_object,
147 acpi_size * buffer_size_needed);
1da177e4
LT
148
149acpi_status
50eca3eb
BM
150acpi_rs_convert_aml_to_resources(u8 * aml_buffer,
151 u32 aml_buffer_length, u8 * output_buffer);
1da177e4
LT
152
153acpi_status
50eca3eb
BM
154acpi_rs_convert_resources_to_aml(struct acpi_resource *resource,
155 acpi_size aml_size_needed, u8 * output_buffer);
1da177e4 156
50eca3eb
BM
157/*
158 * rsio
159 */
1da177e4 160acpi_status
50eca3eb
BM
161acpi_rs_get_io(union aml_resource *aml,
162 u16 aml_resource_length, struct acpi_resource *resource);
1da177e4
LT
163
164acpi_status
50eca3eb 165acpi_rs_set_io(struct acpi_resource *resource, union aml_resource *aml);
1da177e4
LT
166
167acpi_status
50eca3eb
BM
168acpi_rs_get_fixed_io(union aml_resource *aml,
169 u16 aml_resource_length, struct acpi_resource *resource);
1da177e4
LT
170
171acpi_status
50eca3eb 172acpi_rs_set_fixed_io(struct acpi_resource *resource, union aml_resource *aml);
1da177e4
LT
173
174acpi_status
50eca3eb
BM
175acpi_rs_get_dma(union aml_resource *aml,
176 u16 aml_resource_length, struct acpi_resource *resource);
1da177e4
LT
177
178acpi_status
50eca3eb 179acpi_rs_set_dma(struct acpi_resource *resource, union aml_resource *aml);
1da177e4 180
50eca3eb
BM
181/*
182 * rsirq
183 */
1da177e4 184acpi_status
50eca3eb
BM
185acpi_rs_get_irq(union aml_resource *aml,
186 u16 aml_resource_length, struct acpi_resource *resource);
1da177e4
LT
187
188acpi_status
50eca3eb 189acpi_rs_set_irq(struct acpi_resource *resource, union aml_resource *aml);
1da177e4
LT
190
191acpi_status
50eca3eb
BM
192acpi_rs_get_ext_irq(union aml_resource *aml,
193 u16 aml_resource_length, struct acpi_resource *resource);
1da177e4
LT
194
195acpi_status
50eca3eb
BM
196acpi_rs_set_ext_irq(struct acpi_resource *resource, union aml_resource *aml);
197
198/*
199 * rsaddr
200 */
201acpi_status
202acpi_rs_get_address16(union aml_resource *aml,
203 u16 aml_resource_length, struct acpi_resource *resource);
1da177e4
LT
204
205acpi_status
50eca3eb 206acpi_rs_set_address16(struct acpi_resource *resource, union aml_resource *aml);
1da177e4
LT
207
208acpi_status
50eca3eb
BM
209acpi_rs_get_address32(union aml_resource *aml,
210 u16 aml_resource_length, struct acpi_resource *resource);
1da177e4
LT
211
212acpi_status
50eca3eb 213acpi_rs_set_address32(struct acpi_resource *resource, union aml_resource *aml);
1da177e4
LT
214
215acpi_status
50eca3eb
BM
216acpi_rs_get_address64(union aml_resource *aml,
217 u16 aml_resource_length, struct acpi_resource *resource);
1da177e4
LT
218
219acpi_status
50eca3eb
BM
220acpi_rs_set_address64(struct acpi_resource *resource, union aml_resource *aml);
221
222acpi_status
223acpi_rs_get_ext_address64(union aml_resource *aml,
224 u16 aml_resource_length,
225 struct acpi_resource *resource);
226
227acpi_status
228acpi_rs_set_ext_address64(struct acpi_resource *resource,
229 union aml_resource *aml);
230
231/*
232 * rsmemory
233 */
234acpi_status
235acpi_rs_get_memory24(union aml_resource *aml,
236 u16 aml_resource_length, struct acpi_resource *resource);
1da177e4
LT
237
238acpi_status
50eca3eb 239acpi_rs_set_memory24(struct acpi_resource *resource, union aml_resource *aml);
1da177e4
LT
240
241acpi_status
50eca3eb
BM
242acpi_rs_get_memory32(union aml_resource *aml,
243 u16 aml_resource_length, struct acpi_resource *resource);
1da177e4
LT
244
245acpi_status
50eca3eb 246acpi_rs_set_memory32(struct acpi_resource *resource, union aml_resource *aml);
1da177e4
LT
247
248acpi_status
50eca3eb
BM
249acpi_rs_get_fixed_memory32(union aml_resource *aml,
250 u16 aml_resource_length,
251 struct acpi_resource *resource);
1da177e4
LT
252
253acpi_status
50eca3eb
BM
254acpi_rs_set_fixed_memory32(struct acpi_resource *resource,
255 union aml_resource *aml);
1da177e4 256
50eca3eb
BM
257/*
258 * rsmisc
259 */
1da177e4 260acpi_status
50eca3eb
BM
261acpi_rs_get_generic_reg(union aml_resource *aml,
262 u16 aml_resource_length,
263 struct acpi_resource *resource);
1da177e4
LT
264
265acpi_status
50eca3eb
BM
266acpi_rs_set_generic_reg(struct acpi_resource *resource,
267 union aml_resource *aml);
1da177e4
LT
268
269acpi_status
50eca3eb
BM
270acpi_rs_get_vendor(union aml_resource *aml,
271 u16 aml_resource_length, struct acpi_resource *resource);
1da177e4
LT
272
273acpi_status
50eca3eb 274acpi_rs_set_vendor(struct acpi_resource *resource, union aml_resource *aml);
1da177e4
LT
275
276acpi_status
50eca3eb
BM
277acpi_rs_get_start_dpf(union aml_resource *aml,
278 u16 aml_resource_length, struct acpi_resource *resource);
1da177e4
LT
279
280acpi_status
50eca3eb 281acpi_rs_set_start_dpf(struct acpi_resource *resource, union aml_resource *aml);
1da177e4
LT
282
283acpi_status
50eca3eb
BM
284acpi_rs_get_end_dpf(union aml_resource *aml,
285 u16 aml_resource_length, struct acpi_resource *resource);
1da177e4
LT
286
287acpi_status
50eca3eb 288acpi_rs_set_end_dpf(struct acpi_resource *resource, union aml_resource *aml);
1da177e4
LT
289
290acpi_status
50eca3eb
BM
291acpi_rs_get_end_tag(union aml_resource *aml,
292 u16 aml_resource_length, struct acpi_resource *resource);
1da177e4
LT
293
294acpi_status
50eca3eb
BM
295acpi_rs_set_end_tag(struct acpi_resource *resource, union aml_resource *aml);
296
297/*
298 * rsutils
299 */
300void
301acpi_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
311u16
312acpi_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
317acpi_size
318acpi_rs_set_resource_source(union aml_resource *aml,
319 acpi_size minimum_length,
320 struct acpi_resource_source *resource_source);
1da177e4 321
4be44fcd 322u8 acpi_rs_get_resource_type(u8 resource_start_byte);
1da177e4 323
50eca3eb
BM
324u32 acpi_rs_get_descriptor_length(union aml_resource *aml);
325
326u16 acpi_rs_get_resource_length(union aml_resource *aml);
327
328void
329acpi_rs_set_resource_header(u8 descriptor_type,
330 acpi_size total_length, union aml_resource *aml);
331
332struct acpi_resource_info *acpi_rs_get_resource_info(u8 resource_type);
333
334#if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER)
bda663d3 335/*
50eca3eb 336 * rsdump
bda663d3 337 */
50eca3eb 338void acpi_rs_dump_irq(union acpi_resource_data *resource);
bda663d3 339
50eca3eb
BM
340void acpi_rs_dump_address16(union acpi_resource_data *resource);
341
342void acpi_rs_dump_address32(union acpi_resource_data *resource);
343
344void acpi_rs_dump_address64(union acpi_resource_data *resource);
345
346void acpi_rs_dump_ext_address64(union acpi_resource_data *resource);
347
348void acpi_rs_dump_dma(union acpi_resource_data *resource);
349
350void acpi_rs_dump_io(union acpi_resource_data *resource);
351
352void acpi_rs_dump_ext_irq(union acpi_resource_data *resource);
353
354void acpi_rs_dump_fixed_io(union acpi_resource_data *resource);
355
356void acpi_rs_dump_fixed_memory32(union acpi_resource_data *resource);
357
358void acpi_rs_dump_memory24(union acpi_resource_data *resource);
359
360void acpi_rs_dump_memory32(union acpi_resource_data *resource);
361
362void acpi_rs_dump_start_dpf(union acpi_resource_data *resource);
363
364void acpi_rs_dump_vendor(union acpi_resource_data *resource);
365
366void acpi_rs_dump_generic_reg(union acpi_resource_data *resource);
367
368void acpi_rs_dump_end_dpf(union acpi_resource_data *resource);
369
370void acpi_rs_dump_end_tag(union acpi_resource_data *resource);
371
372#endif
bda663d3 373
4be44fcd 374#endif /* __ACRESRC_H__ */
This page took 0.069595 seconds and 5 git commands to generate.