blob: ed679264c12c96debab75b04eaf91eb7168415aa [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/******************************************************************************
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
48/*
49 * Function prototypes called from Acpi* APIs
50 */
Linus Torvalds1da177e2005-04-16 15:20:36 -070051acpi_status
52acpi_rs_get_prt_method_data (
53 acpi_handle handle,
54 struct acpi_buffer *ret_buffer);
55
56
57acpi_status
58acpi_rs_get_crs_method_data (
59 acpi_handle handle,
60 struct acpi_buffer *ret_buffer);
61
Robert Moore44f6c012005-04-18 22:49:35 -040062#ifdef ACPI_FUTURE_USAGE
Linus Torvalds1da177e2005-04-16 15:20:36 -070063acpi_status
64acpi_rs_get_prs_method_data (
65 acpi_handle handle,
66 struct acpi_buffer *ret_buffer);
Robert Moore44f6c012005-04-18 22:49:35 -040067#endif /* ACPI_FUTURE_USAGE */
Linus Torvalds1da177e2005-04-16 15:20:36 -070068
69acpi_status
70acpi_rs_get_method_data (
71 acpi_handle handle,
72 char *path,
73 struct acpi_buffer *ret_buffer);
74
75acpi_status
76acpi_rs_set_srs_method_data (
77 acpi_handle handle,
78 struct acpi_buffer *ret_buffer);
79
80acpi_status
81acpi_rs_create_resource_list (
82 union acpi_operand_object *byte_stream_buffer,
83 struct acpi_buffer *output_buffer);
84
85acpi_status
86acpi_rs_create_byte_stream (
87 struct acpi_resource *linked_list_buffer,
88 struct acpi_buffer *output_buffer);
89
90acpi_status
91acpi_rs_create_pci_routing_table (
92 union acpi_operand_object *package_object,
93 struct acpi_buffer *output_buffer);
94
95
96/*
Robert Moore44f6c012005-04-18 22:49:35 -040097 * rsdump
Linus Torvalds1da177e2005-04-16 15:20:36 -070098 */
Robert Moore44f6c012005-04-18 22:49:35 -040099#ifdef ACPI_FUTURE_USAGE
Linus Torvalds1da177e2005-04-16 15:20:36 -0700100void
101acpi_rs_dump_resource_list (
102 struct acpi_resource *resource);
103
104void
105acpi_rs_dump_irq_list (
106 u8 *route_table);
Robert Moore44f6c012005-04-18 22:49:35 -0400107#endif /* ACPI_FUTURE_USAGE */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700108
Robert Moore44f6c012005-04-18 22:49:35 -0400109
110/*
111 * rscalc
112 */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700113acpi_status
114acpi_rs_get_byte_stream_start (
115 u8 *byte_stream_buffer,
116 u8 **byte_stream_start,
117 u32 *size);
118
119acpi_status
120acpi_rs_get_list_length (
121 u8 *byte_stream_buffer,
122 u32 byte_stream_buffer_length,
123 acpi_size *size_needed);
124
125acpi_status
126acpi_rs_get_byte_stream_length (
127 struct acpi_resource *linked_list_buffer,
128 acpi_size *size_needed);
129
130acpi_status
131acpi_rs_get_pci_routing_table_length (
132 union acpi_operand_object *package_object,
133 acpi_size *buffer_size_needed);
134
135acpi_status
136acpi_rs_byte_stream_to_list (
137 u8 *byte_stream_buffer,
138 u32 byte_stream_buffer_length,
139 u8 *output_buffer);
140
141acpi_status
142acpi_rs_list_to_byte_stream (
143 struct acpi_resource *linked_list,
144 acpi_size byte_stream_size_needed,
145 u8 *output_buffer);
146
147acpi_status
148acpi_rs_io_resource (
149 u8 *byte_stream_buffer,
150 acpi_size *bytes_consumed,
151 u8 **output_buffer,
152 acpi_size *structure_size);
153
154acpi_status
155acpi_rs_fixed_io_resource (
156 u8 *byte_stream_buffer,
157 acpi_size *bytes_consumed,
158 u8 **output_buffer,
159 acpi_size *structure_size);
160
161acpi_status
162acpi_rs_io_stream (
163 struct acpi_resource *linked_list,
164 u8 **output_buffer,
165 acpi_size *bytes_consumed);
166
167acpi_status
168acpi_rs_fixed_io_stream (
169 struct acpi_resource *linked_list,
170 u8 **output_buffer,
171 acpi_size *bytes_consumed);
172
173acpi_status
174acpi_rs_irq_resource (
175 u8 *byte_stream_buffer,
176 acpi_size *bytes_consumed,
177 u8 **output_buffer,
178 acpi_size *structure_size);
179
180acpi_status
181acpi_rs_irq_stream (
182 struct acpi_resource *linked_list,
183 u8 **output_buffer,
184 acpi_size *bytes_consumed);
185
186acpi_status
187acpi_rs_dma_resource (
188 u8 *byte_stream_buffer,
189 acpi_size *bytes_consumed,
190 u8 **output_buffer,
191 acpi_size *structure_size);
192
193acpi_status
194acpi_rs_dma_stream (
195 struct acpi_resource *linked_list,
196 u8 **output_buffer,
197 acpi_size *bytes_consumed);
198
199acpi_status
200acpi_rs_address16_resource (
201 u8 *byte_stream_buffer,
202 acpi_size *bytes_consumed,
203 u8 **output_buffer,
204 acpi_size *structure_size);
205
206acpi_status
207acpi_rs_address16_stream (
208 struct acpi_resource *linked_list,
209 u8 **output_buffer,
210 acpi_size *bytes_consumed);
211
212acpi_status
213acpi_rs_address32_resource (
214 u8 *byte_stream_buffer,
215 acpi_size *bytes_consumed,
216 u8 **output_buffer,
217 acpi_size *structure_size);
218
219acpi_status
220acpi_rs_address32_stream (
221 struct acpi_resource *linked_list,
222 u8 **output_buffer,
223 acpi_size *bytes_consumed);
224
225acpi_status
226acpi_rs_address64_resource (
227 u8 *byte_stream_buffer,
228 acpi_size *bytes_consumed,
229 u8 **output_buffer,
230 acpi_size *structure_size);
231
232acpi_status
233acpi_rs_address64_stream (
234 struct acpi_resource *linked_list,
235 u8 **output_buffer,
236 acpi_size *bytes_consumed);
237
238acpi_status
239acpi_rs_start_depend_fns_resource (
240 u8 *byte_stream_buffer,
241 acpi_size *bytes_consumed,
242 u8 **output_buffer,
243 acpi_size *structure_size);
244
245acpi_status
246acpi_rs_end_depend_fns_resource (
247 u8 *byte_stream_buffer,
248 acpi_size *bytes_consumed,
249 u8 **output_buffer,
250 acpi_size *structure_size);
251
252acpi_status
253acpi_rs_start_depend_fns_stream (
254 struct acpi_resource *linked_list,
255 u8 **output_buffer,
256 acpi_size *bytes_consumed);
257
258acpi_status
259acpi_rs_end_depend_fns_stream (
260 struct acpi_resource *linked_list,
261 u8 **output_buffer,
262 acpi_size *bytes_consumed);
263
264acpi_status
265acpi_rs_memory24_resource (
266 u8 *byte_stream_buffer,
267 acpi_size *bytes_consumed,
268 u8 **output_buffer,
269 acpi_size *structure_size);
270
271acpi_status
272acpi_rs_memory24_stream (
273 struct acpi_resource *linked_list,
274 u8 **output_buffer,
275 acpi_size *bytes_consumed);
276
277acpi_status
278acpi_rs_memory32_range_resource (
279 u8 *byte_stream_buffer,
280 acpi_size *bytes_consumed,
281 u8 **output_buffer,
282 acpi_size *structure_size);
283
284acpi_status
285acpi_rs_fixed_memory32_resource (
286 u8 *byte_stream_buffer,
287 acpi_size *bytes_consumed,
288 u8 **output_buffer,
289 acpi_size *structure_size);
290
291acpi_status
292acpi_rs_memory32_range_stream (
293 struct acpi_resource *linked_list,
294 u8 **output_buffer,
295 acpi_size *bytes_consumed);
296
297acpi_status
298acpi_rs_fixed_memory32_stream (
299 struct acpi_resource *linked_list,
300 u8 **output_buffer,
301 acpi_size *bytes_consumed);
302
303acpi_status
304acpi_rs_extended_irq_resource (
305 u8 *byte_stream_buffer,
306 acpi_size *bytes_consumed,
307 u8 **output_buffer,
308 acpi_size *structure_size);
309
310acpi_status
311acpi_rs_extended_irq_stream (
312 struct acpi_resource *linked_list,
313 u8 **output_buffer,
314 acpi_size *bytes_consumed);
315
316acpi_status
317acpi_rs_end_tag_resource (
318 u8 *byte_stream_buffer,
319 acpi_size *bytes_consumed,
320 u8 **output_buffer,
321 acpi_size *structure_size);
322
323acpi_status
324acpi_rs_end_tag_stream (
325 struct acpi_resource *linked_list,
326 u8 **output_buffer,
327 acpi_size *bytes_consumed);
328
329acpi_status
330acpi_rs_vendor_resource (
331 u8 *byte_stream_buffer,
332 acpi_size *bytes_consumed,
333 u8 **output_buffer,
334 acpi_size *structure_size);
335
336acpi_status
337acpi_rs_vendor_stream (
338 struct acpi_resource *linked_list,
339 u8 **output_buffer,
340 acpi_size *bytes_consumed);
341
342u8
343acpi_rs_get_resource_type (
344 u8 resource_start_byte);
345
346#endif /* __ACRESRC_H__ */