Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
acresrc.h
Go to the documentation of this file.
1 /******************************************************************************
2  *
3  * Name: acresrc.h - Resource Manager function prototypes
4  *
5  *****************************************************************************/
6 
7 /*
8  * Copyright (C) 2000 - 2012, Intel Corp.
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  * If possible, pack the following structures to byte alignment, since we
53  * don't care about performance for debug output. Two cases where we cannot
54  * pack the structures:
55  *
56  * 1) Hardware does not support misaligned memory transfers
57  * 2) Compiler does not support pointers within packed structures
58  */
59 #if (!defined(ACPI_MISALIGNMENT_NOT_SUPPORTED) && !defined(ACPI_PACKED_POINTERS_NOT_SUPPORTED))
60 #pragma pack(1)
61 #endif
62 
63 /*
64  * Individual entry for the resource conversion tables
65  */
66 typedef const struct acpi_rsconvert_info {
71 
73 
74 /* Resource conversion opcodes */
75 
76 typedef enum {
110 
111 /* Resource Conversion sub-opcodes */
112 
113 #define ACPI_RSC_COMPARE_AML_LENGTH 0
114 #define ACPI_RSC_COMPARE_VALUE 1
115 
116 #define ACPI_RSC_TABLE_SIZE(d) (sizeof (d) / sizeof (struct acpi_rsconvert_info))
117 
118 #define ACPI_RS_OFFSET(f) (u8) ACPI_OFFSET (struct acpi_resource,f)
119 #define AML_OFFSET(f) (u8) ACPI_OFFSET (union aml_resource,f)
120 
121 /*
122  * Individual entry for the resource dump tables
123  */
124 typedef const struct acpi_rsdump_info {
127  char *name;
128  const char **pointer;
129 
131 
132 /* Values for the Opcode field above */
133 
134 typedef enum {
153 
154 /* restore default alignment */
155 
156 #pragma pack()
157 
158 /* Resource tables indexed by internal resource type */
159 
160 extern const u8 acpi_gbl_aml_resource_sizes[];
163 
164 /* Resource tables indexed by raw AML resource descriptor type */
165 
166 extern const u8 acpi_gbl_resource_struct_sizes[];
169 
170 extern struct acpi_rsconvert_info
172 
177 };
178 
179 /*
180  * rscreate
181  */
184  struct acpi_buffer *output_buffer);
185 
187 acpi_rs_create_aml_resources(struct acpi_resource *linked_list_buffer,
188  struct acpi_buffer *output_buffer);
189 
192  struct acpi_buffer *output_buffer);
193 
194 /*
195  * rsutils
196  */
197 
200  struct acpi_buffer *ret_buffer);
201 
204  struct acpi_buffer *ret_buffer);
205 
208  struct acpi_buffer *ret_buffer);
209 
212  char *path, struct acpi_buffer *ret_buffer);
213 
216  struct acpi_buffer *ret_buffer);
217 
220  struct acpi_buffer *ret_buffer);
221 
222 /*
223  * rscalc
224  */
226 acpi_rs_get_list_length(u8 * aml_buffer,
227  u32 aml_buffer_length, acpi_size * size_needed);
228 
230 acpi_rs_get_aml_length(struct acpi_resource *linked_list_buffer,
231  acpi_size * size_needed);
232 
235  acpi_size * buffer_size_needed);
236 
239  u32 length,
240  u32 offset, u8 resource_index, void **context);
241 
244  acpi_size aml_size_needed, u8 * output_buffer);
245 
246 /*
247  * rsaddr
248  */
249 void
251  struct acpi_resource *resource);
252 
253 u8
255  union aml_resource *aml);
256 
257 /*
258  * rsmisc
259  */
262  union aml_resource *aml,
263  struct acpi_rsconvert_info *info);
264 
267  union aml_resource *aml,
268  struct acpi_rsconvert_info *info);
269 
270 /*
271  * rsutils
272  */
273 void
274 acpi_rs_move_data(void *destination,
275  void *source, u16 item_count, u8 move_type);
276 
278 
280 
283  acpi_rs_length minimum_length,
284  struct acpi_resource_source *resource_source,
285  union aml_resource *aml, char *string_ptr);
286 
289  acpi_rs_length minimum_length,
290  struct acpi_resource_source *resource_source);
291 
292 void
293 acpi_rs_set_resource_header(u8 descriptor_type,
294  acpi_rsdesc_size total_length,
295  union aml_resource *aml);
296 
297 void
299  union aml_resource *aml);
300 
301 /*
302  * rsdump
303  */
305 
306 void acpi_rs_dump_irq_list(u8 * route_table);
307 
308 /*
309  * Resource conversion tables
310  */
330 
331 /* These resources require separate get/set tables */
332 
333 extern struct acpi_rsconvert_info acpi_rs_get_irq[];
337 
338 extern struct acpi_rsconvert_info acpi_rs_set_irq[];
341 
342 #if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER)
343 /*
344  * rsinfo
345  */
346 extern struct acpi_rsdump_info *acpi_gbl_dump_resource_dispatch[];
347 extern struct acpi_rsdump_info *acpi_gbl_dump_serial_bus_dispatch[];
348 
349 /*
350  * rsdump
351  */
352 extern struct acpi_rsdump_info acpi_rs_dump_irq[];
353 extern struct acpi_rsdump_info acpi_rs_dump_dma[];
354 extern struct acpi_rsdump_info acpi_rs_dump_start_dpf[];
355 extern struct acpi_rsdump_info acpi_rs_dump_end_dpf[];
356 extern struct acpi_rsdump_info acpi_rs_dump_io[];
357 extern struct acpi_rsdump_info acpi_rs_dump_fixed_io[];
358 extern struct acpi_rsdump_info acpi_rs_dump_vendor[];
359 extern struct acpi_rsdump_info acpi_rs_dump_end_tag[];
360 extern struct acpi_rsdump_info acpi_rs_dump_memory24[];
361 extern struct acpi_rsdump_info acpi_rs_dump_memory32[];
362 extern struct acpi_rsdump_info acpi_rs_dump_fixed_memory32[];
363 extern struct acpi_rsdump_info acpi_rs_dump_address16[];
364 extern struct acpi_rsdump_info acpi_rs_dump_address32[];
365 extern struct acpi_rsdump_info acpi_rs_dump_address64[];
366 extern struct acpi_rsdump_info acpi_rs_dump_ext_address64[];
367 extern struct acpi_rsdump_info acpi_rs_dump_ext_irq[];
368 extern struct acpi_rsdump_info acpi_rs_dump_generic_reg[];
369 extern struct acpi_rsdump_info acpi_rs_dump_gpio[];
370 extern struct acpi_rsdump_info acpi_rs_dump_fixed_dma[];
371 extern struct acpi_rsdump_info acpi_rs_dump_common_serial_bus[];
372 extern struct acpi_rsdump_info acpi_rs_dump_i2c_serial_bus[];
373 extern struct acpi_rsdump_info acpi_rs_dump_spi_serial_bus[];
374 extern struct acpi_rsdump_info acpi_rs_dump_uart_serial_bus[];
375 #endif
376 
377 #endif /* __ACRESRC_H__ */