blob: 75bd34d1783f6495660d6d595c2ca2f24d6ead51 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*******************************************************************************
2 *
3 * Module Name: rsdump - Functions to display the resource structures.
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
Linus Torvalds1da177e2005-04-16 15:20:36 -070044#include <acpi/acpi.h>
45#include <acpi/acresrc.h>
46
47#define _COMPONENT ACPI_RESOURCES
Len Brown4be44fc2005-08-05 00:44:28 -040048ACPI_MODULE_NAME("rsdump")
Robert Moore6f42ccf2005-05-13 00:00:00 -040049
50#if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER)
Robert Moore44f6c012005-04-18 22:49:35 -040051/* Local prototypes */
Len Brown4be44fc2005-08-05 00:44:28 -040052static void acpi_rs_dump_irq(union acpi_resource_data *data);
Robert Moore44f6c012005-04-18 22:49:35 -040053
Len Brown4be44fc2005-08-05 00:44:28 -040054static void acpi_rs_dump_address16(union acpi_resource_data *data);
Robert Moore44f6c012005-04-18 22:49:35 -040055
Len Brown4be44fc2005-08-05 00:44:28 -040056static void acpi_rs_dump_address32(union acpi_resource_data *data);
Robert Moore44f6c012005-04-18 22:49:35 -040057
Len Brown4be44fc2005-08-05 00:44:28 -040058static void acpi_rs_dump_address64(union acpi_resource_data *data);
Robert Moore44f6c012005-04-18 22:49:35 -040059
Len Brown4be44fc2005-08-05 00:44:28 -040060static void acpi_rs_dump_dma(union acpi_resource_data *data);
Robert Moore44f6c012005-04-18 22:49:35 -040061
Len Brown4be44fc2005-08-05 00:44:28 -040062static void acpi_rs_dump_io(union acpi_resource_data *data);
Robert Moore44f6c012005-04-18 22:49:35 -040063
Len Brown4be44fc2005-08-05 00:44:28 -040064static void acpi_rs_dump_extended_irq(union acpi_resource_data *data);
Robert Moore44f6c012005-04-18 22:49:35 -040065
Len Brown4be44fc2005-08-05 00:44:28 -040066static void acpi_rs_dump_fixed_io(union acpi_resource_data *data);
Robert Moore44f6c012005-04-18 22:49:35 -040067
Len Brown4be44fc2005-08-05 00:44:28 -040068static void acpi_rs_dump_fixed_memory32(union acpi_resource_data *data);
Robert Moore44f6c012005-04-18 22:49:35 -040069
Len Brown4be44fc2005-08-05 00:44:28 -040070static void acpi_rs_dump_memory24(union acpi_resource_data *data);
Robert Moore44f6c012005-04-18 22:49:35 -040071
Len Brown4be44fc2005-08-05 00:44:28 -040072static void acpi_rs_dump_memory32(union acpi_resource_data *data);
Robert Moore44f6c012005-04-18 22:49:35 -040073
Len Brown4be44fc2005-08-05 00:44:28 -040074static void acpi_rs_dump_start_depend_fns(union acpi_resource_data *data);
Robert Moore44f6c012005-04-18 22:49:35 -040075
Len Brown4be44fc2005-08-05 00:44:28 -040076static void acpi_rs_dump_vendor_specific(union acpi_resource_data *data);
Linus Torvalds1da177e2005-04-16 15:20:36 -070077
Linus Torvalds1da177e2005-04-16 15:20:36 -070078/*******************************************************************************
79 *
80 * FUNCTION: acpi_rs_dump_irq
81 *
82 * PARAMETERS: Data - pointer to the resource structure to dump.
83 *
84 * RETURN: None
85 *
86 * DESCRIPTION: Prints out the various members of the Data structure type.
87 *
88 ******************************************************************************/
89
Len Brown4be44fc2005-08-05 00:44:28 -040090static void acpi_rs_dump_irq(union acpi_resource_data *data)
Linus Torvalds1da177e2005-04-16 15:20:36 -070091{
Len Brown4be44fc2005-08-05 00:44:28 -040092 struct acpi_resource_irq *irq_data = (struct acpi_resource_irq *)data;
93 u8 index = 0;
Linus Torvalds1da177e2005-04-16 15:20:36 -070094
Len Brown4be44fc2005-08-05 00:44:28 -040095 ACPI_FUNCTION_ENTRY();
Linus Torvalds1da177e2005-04-16 15:20:36 -070096
Len Brown4be44fc2005-08-05 00:44:28 -040097 acpi_os_printf("IRQ Resource\n");
Linus Torvalds1da177e2005-04-16 15:20:36 -070098
Len Brown4be44fc2005-08-05 00:44:28 -040099 acpi_os_printf(" %s Triggered\n",
100 ACPI_LEVEL_SENSITIVE ==
101 irq_data->edge_level ? "Level" : "Edge");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700102
Len Brown4be44fc2005-08-05 00:44:28 -0400103 acpi_os_printf(" Active %s\n",
104 ACPI_ACTIVE_LOW ==
105 irq_data->active_high_low ? "Low" : "High");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700106
Len Brown4be44fc2005-08-05 00:44:28 -0400107 acpi_os_printf(" %s\n",
108 ACPI_SHARED ==
109 irq_data->shared_exclusive ? "Shared" : "Exclusive");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700110
Len Brown4be44fc2005-08-05 00:44:28 -0400111 acpi_os_printf(" %X Interrupts ( ", irq_data->number_of_interrupts);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700112
113 for (index = 0; index < irq_data->number_of_interrupts; index++) {
Len Brown4be44fc2005-08-05 00:44:28 -0400114 acpi_os_printf("%X ", irq_data->interrupts[index]);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700115 }
116
Len Brown4be44fc2005-08-05 00:44:28 -0400117 acpi_os_printf(")\n");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700118 return;
119}
120
Linus Torvalds1da177e2005-04-16 15:20:36 -0700121/*******************************************************************************
122 *
123 * FUNCTION: acpi_rs_dump_dma
124 *
125 * PARAMETERS: Data - pointer to the resource structure to dump.
126 *
127 * RETURN: None
128 *
129 * DESCRIPTION: Prints out the various members of the Data structure type.
130 *
131 ******************************************************************************/
132
Len Brown4be44fc2005-08-05 00:44:28 -0400133static void acpi_rs_dump_dma(union acpi_resource_data *data)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700134{
Len Brown4be44fc2005-08-05 00:44:28 -0400135 struct acpi_resource_dma *dma_data = (struct acpi_resource_dma *)data;
136 u8 index = 0;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700137
Len Brown4be44fc2005-08-05 00:44:28 -0400138 ACPI_FUNCTION_ENTRY();
Linus Torvalds1da177e2005-04-16 15:20:36 -0700139
Len Brown4be44fc2005-08-05 00:44:28 -0400140 acpi_os_printf("DMA Resource\n");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700141
142 switch (dma_data->type) {
143 case ACPI_COMPATIBILITY:
Len Brown4be44fc2005-08-05 00:44:28 -0400144 acpi_os_printf(" Compatibility mode\n");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700145 break;
146
147 case ACPI_TYPE_A:
Len Brown4be44fc2005-08-05 00:44:28 -0400148 acpi_os_printf(" Type A\n");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700149 break;
150
151 case ACPI_TYPE_B:
Len Brown4be44fc2005-08-05 00:44:28 -0400152 acpi_os_printf(" Type B\n");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700153 break;
154
155 case ACPI_TYPE_F:
Len Brown4be44fc2005-08-05 00:44:28 -0400156 acpi_os_printf(" Type F\n");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700157 break;
158
159 default:
Len Brown4be44fc2005-08-05 00:44:28 -0400160 acpi_os_printf(" Invalid DMA type\n");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700161 break;
162 }
163
Len Brown4be44fc2005-08-05 00:44:28 -0400164 acpi_os_printf(" %sBus Master\n",
165 ACPI_BUS_MASTER == dma_data->bus_master ? "" : "Not a ");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700166
167 switch (dma_data->transfer) {
168 case ACPI_TRANSFER_8:
Len Brown4be44fc2005-08-05 00:44:28 -0400169 acpi_os_printf(" 8-bit only transfer\n");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700170 break;
171
172 case ACPI_TRANSFER_8_16:
Len Brown4be44fc2005-08-05 00:44:28 -0400173 acpi_os_printf(" 8 and 16-bit transfer\n");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700174 break;
175
176 case ACPI_TRANSFER_16:
Len Brown4be44fc2005-08-05 00:44:28 -0400177 acpi_os_printf(" 16 bit only transfer\n");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700178 break;
179
180 default:
Len Brown4be44fc2005-08-05 00:44:28 -0400181 acpi_os_printf(" Invalid transfer preference\n");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700182 break;
183 }
184
Len Brown4be44fc2005-08-05 00:44:28 -0400185 acpi_os_printf(" Number of Channels: %X ( ",
186 dma_data->number_of_channels);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700187
188 for (index = 0; index < dma_data->number_of_channels; index++) {
Len Brown4be44fc2005-08-05 00:44:28 -0400189 acpi_os_printf("%X ", dma_data->channels[index]);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700190 }
191
Len Brown4be44fc2005-08-05 00:44:28 -0400192 acpi_os_printf(")\n");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700193 return;
194}
195
Linus Torvalds1da177e2005-04-16 15:20:36 -0700196/*******************************************************************************
197 *
198 * FUNCTION: acpi_rs_dump_start_depend_fns
199 *
200 * PARAMETERS: Data - pointer to the resource structure to dump.
201 *
202 * RETURN: None
203 *
204 * DESCRIPTION: Prints out the various members of the Data structure type.
205 *
206 ******************************************************************************/
207
Len Brown4be44fc2005-08-05 00:44:28 -0400208static void acpi_rs_dump_start_depend_fns(union acpi_resource_data *data)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700209{
Len Brown4be44fc2005-08-05 00:44:28 -0400210 struct acpi_resource_start_dpf *sdf_data =
211 (struct acpi_resource_start_dpf *)data;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700212
Len Brown4be44fc2005-08-05 00:44:28 -0400213 ACPI_FUNCTION_ENTRY();
Linus Torvalds1da177e2005-04-16 15:20:36 -0700214
Len Brown4be44fc2005-08-05 00:44:28 -0400215 acpi_os_printf("Start Dependent Functions Resource\n");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700216
217 switch (sdf_data->compatibility_priority) {
218 case ACPI_GOOD_CONFIGURATION:
Len Brown4be44fc2005-08-05 00:44:28 -0400219 acpi_os_printf(" Good configuration\n");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700220 break;
221
222 case ACPI_ACCEPTABLE_CONFIGURATION:
Len Brown4be44fc2005-08-05 00:44:28 -0400223 acpi_os_printf(" Acceptable configuration\n");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700224 break;
225
226 case ACPI_SUB_OPTIMAL_CONFIGURATION:
Len Brown4be44fc2005-08-05 00:44:28 -0400227 acpi_os_printf(" Sub-optimal configuration\n");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700228 break;
229
230 default:
Len Brown4be44fc2005-08-05 00:44:28 -0400231 acpi_os_printf(" Invalid compatibility priority\n");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700232 break;
233 }
234
Len Brown4be44fc2005-08-05 00:44:28 -0400235 switch (sdf_data->performance_robustness) {
Linus Torvalds1da177e2005-04-16 15:20:36 -0700236 case ACPI_GOOD_CONFIGURATION:
Len Brown4be44fc2005-08-05 00:44:28 -0400237 acpi_os_printf(" Good configuration\n");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700238 break;
239
240 case ACPI_ACCEPTABLE_CONFIGURATION:
Len Brown4be44fc2005-08-05 00:44:28 -0400241 acpi_os_printf(" Acceptable configuration\n");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700242 break;
243
244 case ACPI_SUB_OPTIMAL_CONFIGURATION:
Len Brown4be44fc2005-08-05 00:44:28 -0400245 acpi_os_printf(" Sub-optimal configuration\n");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700246 break;
247
248 default:
Len Brown4be44fc2005-08-05 00:44:28 -0400249 acpi_os_printf(" Invalid performance robustness preference\n");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700250 break;
251 }
252
253 return;
254}
255
Linus Torvalds1da177e2005-04-16 15:20:36 -0700256/*******************************************************************************
257 *
258 * FUNCTION: acpi_rs_dump_io
259 *
260 * PARAMETERS: Data - pointer to the resource structure to dump.
261 *
262 * RETURN: None
263 *
264 * DESCRIPTION: Prints out the various members of the Data structure type.
265 *
266 ******************************************************************************/
267
Len Brown4be44fc2005-08-05 00:44:28 -0400268static void acpi_rs_dump_io(union acpi_resource_data *data)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700269{
Len Brown4be44fc2005-08-05 00:44:28 -0400270 struct acpi_resource_io *io_data = (struct acpi_resource_io *)data;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700271
Len Brown4be44fc2005-08-05 00:44:28 -0400272 ACPI_FUNCTION_ENTRY();
Linus Torvalds1da177e2005-04-16 15:20:36 -0700273
Len Brown4be44fc2005-08-05 00:44:28 -0400274 acpi_os_printf("Io Resource\n");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700275
Len Brown4be44fc2005-08-05 00:44:28 -0400276 acpi_os_printf(" %d bit decode\n",
277 ACPI_DECODE_16 == io_data->io_decode ? 16 : 10);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700278
Len Brown4be44fc2005-08-05 00:44:28 -0400279 acpi_os_printf(" Range minimum base: %08X\n",
280 io_data->min_base_address);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700281
Len Brown4be44fc2005-08-05 00:44:28 -0400282 acpi_os_printf(" Range maximum base: %08X\n",
283 io_data->max_base_address);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700284
Len Brown4be44fc2005-08-05 00:44:28 -0400285 acpi_os_printf(" Alignment: %08X\n", io_data->alignment);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700286
Len Brown4be44fc2005-08-05 00:44:28 -0400287 acpi_os_printf(" Range Length: %08X\n", io_data->range_length);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700288
289 return;
290}
291
Linus Torvalds1da177e2005-04-16 15:20:36 -0700292/*******************************************************************************
293 *
294 * FUNCTION: acpi_rs_dump_fixed_io
295 *
296 * PARAMETERS: Data - pointer to the resource structure to dump.
297 *
298 * RETURN: None
299 *
300 * DESCRIPTION: Prints out the various members of the Data structure type.
301 *
302 ******************************************************************************/
303
Len Brown4be44fc2005-08-05 00:44:28 -0400304static void acpi_rs_dump_fixed_io(union acpi_resource_data *data)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700305{
Len Brown4be44fc2005-08-05 00:44:28 -0400306 struct acpi_resource_fixed_io *fixed_io_data =
307 (struct acpi_resource_fixed_io *)data;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700308
Len Brown4be44fc2005-08-05 00:44:28 -0400309 ACPI_FUNCTION_ENTRY();
Linus Torvalds1da177e2005-04-16 15:20:36 -0700310
Len Brown4be44fc2005-08-05 00:44:28 -0400311 acpi_os_printf("Fixed Io Resource\n");
312 acpi_os_printf(" Range base address: %08X",
313 fixed_io_data->base_address);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700314
Len Brown4be44fc2005-08-05 00:44:28 -0400315 acpi_os_printf(" Range length: %08X", fixed_io_data->range_length);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700316
317 return;
318}
319
Linus Torvalds1da177e2005-04-16 15:20:36 -0700320/*******************************************************************************
321 *
322 * FUNCTION: acpi_rs_dump_vendor_specific
323 *
324 * PARAMETERS: Data - pointer to the resource structure to dump.
325 *
326 * RETURN: None
327 *
328 * DESCRIPTION: Prints out the various members of the Data structure type.
329 *
330 ******************************************************************************/
331
Len Brown4be44fc2005-08-05 00:44:28 -0400332static void acpi_rs_dump_vendor_specific(union acpi_resource_data *data)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700333{
Len Brown4be44fc2005-08-05 00:44:28 -0400334 struct acpi_resource_vendor *vendor_data =
335 (struct acpi_resource_vendor *)data;
336 u16 index = 0;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700337
Len Brown4be44fc2005-08-05 00:44:28 -0400338 ACPI_FUNCTION_ENTRY();
Linus Torvalds1da177e2005-04-16 15:20:36 -0700339
Len Brown4be44fc2005-08-05 00:44:28 -0400340 acpi_os_printf("Vendor Specific Resource\n");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700341
Len Brown4be44fc2005-08-05 00:44:28 -0400342 acpi_os_printf(" Length: %08X\n", vendor_data->length);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700343
344 for (index = 0; index < vendor_data->length; index++) {
Len Brown4be44fc2005-08-05 00:44:28 -0400345 acpi_os_printf(" Byte %X: %08X\n",
346 index, vendor_data->reserved[index]);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700347 }
348
349 return;
350}
351
Linus Torvalds1da177e2005-04-16 15:20:36 -0700352/*******************************************************************************
353 *
354 * FUNCTION: acpi_rs_dump_memory24
355 *
356 * PARAMETERS: Data - pointer to the resource structure to dump.
357 *
358 * RETURN: None
359 *
360 * DESCRIPTION: Prints out the various members of the Data structure type.
361 *
362 ******************************************************************************/
363
Len Brown4be44fc2005-08-05 00:44:28 -0400364static void acpi_rs_dump_memory24(union acpi_resource_data *data)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700365{
Len Brown4be44fc2005-08-05 00:44:28 -0400366 struct acpi_resource_mem24 *memory24_data =
367 (struct acpi_resource_mem24 *)data;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700368
Len Brown4be44fc2005-08-05 00:44:28 -0400369 ACPI_FUNCTION_ENTRY();
Linus Torvalds1da177e2005-04-16 15:20:36 -0700370
Len Brown4be44fc2005-08-05 00:44:28 -0400371 acpi_os_printf("24-Bit Memory Range Resource\n");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700372
Len Brown4be44fc2005-08-05 00:44:28 -0400373 acpi_os_printf(" Read%s\n",
374 ACPI_READ_WRITE_MEMORY ==
375 memory24_data->read_write_attribute ?
376 "/Write" : " only");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700377
Len Brown4be44fc2005-08-05 00:44:28 -0400378 acpi_os_printf(" Range minimum base: %08X\n",
379 memory24_data->min_base_address);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700380
Len Brown4be44fc2005-08-05 00:44:28 -0400381 acpi_os_printf(" Range maximum base: %08X\n",
382 memory24_data->max_base_address);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700383
Len Brown4be44fc2005-08-05 00:44:28 -0400384 acpi_os_printf(" Alignment: %08X\n", memory24_data->alignment);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700385
Len Brown4be44fc2005-08-05 00:44:28 -0400386 acpi_os_printf(" Range length: %08X\n", memory24_data->range_length);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700387
388 return;
389}
390
Linus Torvalds1da177e2005-04-16 15:20:36 -0700391/*******************************************************************************
392 *
393 * FUNCTION: acpi_rs_dump_memory32
394 *
395 * PARAMETERS: Data - pointer to the resource structure to dump.
396 *
397 * RETURN: None
398 *
399 * DESCRIPTION: Prints out the various members of the Data structure type.
400 *
401 ******************************************************************************/
402
Len Brown4be44fc2005-08-05 00:44:28 -0400403static void acpi_rs_dump_memory32(union acpi_resource_data *data)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700404{
Len Brown4be44fc2005-08-05 00:44:28 -0400405 struct acpi_resource_mem32 *memory32_data =
406 (struct acpi_resource_mem32 *)data;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700407
Len Brown4be44fc2005-08-05 00:44:28 -0400408 ACPI_FUNCTION_ENTRY();
Linus Torvalds1da177e2005-04-16 15:20:36 -0700409
Len Brown4be44fc2005-08-05 00:44:28 -0400410 acpi_os_printf("32-Bit Memory Range Resource\n");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700411
Len Brown4be44fc2005-08-05 00:44:28 -0400412 acpi_os_printf(" Read%s\n",
413 ACPI_READ_WRITE_MEMORY ==
414 memory32_data->read_write_attribute ?
415 "/Write" : " only");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700416
Len Brown4be44fc2005-08-05 00:44:28 -0400417 acpi_os_printf(" Range minimum base: %08X\n",
418 memory32_data->min_base_address);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700419
Len Brown4be44fc2005-08-05 00:44:28 -0400420 acpi_os_printf(" Range maximum base: %08X\n",
421 memory32_data->max_base_address);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700422
Len Brown4be44fc2005-08-05 00:44:28 -0400423 acpi_os_printf(" Alignment: %08X\n", memory32_data->alignment);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700424
Len Brown4be44fc2005-08-05 00:44:28 -0400425 acpi_os_printf(" Range length: %08X\n", memory32_data->range_length);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700426
427 return;
428}
429
Linus Torvalds1da177e2005-04-16 15:20:36 -0700430/*******************************************************************************
431 *
432 * FUNCTION: acpi_rs_dump_fixed_memory32
433 *
434 * PARAMETERS: Data - pointer to the resource structure to dump.
435 *
436 * RETURN:
437 *
438 * DESCRIPTION: Prints out the various members of the Data structure type.
439 *
440 ******************************************************************************/
441
Len Brown4be44fc2005-08-05 00:44:28 -0400442static void acpi_rs_dump_fixed_memory32(union acpi_resource_data *data)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700443{
Len Brown4be44fc2005-08-05 00:44:28 -0400444 struct acpi_resource_fixed_mem32 *fixed_memory32_data =
445 (struct acpi_resource_fixed_mem32 *)data;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700446
Len Brown4be44fc2005-08-05 00:44:28 -0400447 ACPI_FUNCTION_ENTRY();
Linus Torvalds1da177e2005-04-16 15:20:36 -0700448
Len Brown4be44fc2005-08-05 00:44:28 -0400449 acpi_os_printf("32-Bit Fixed Location Memory Range Resource\n");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700450
Len Brown4be44fc2005-08-05 00:44:28 -0400451 acpi_os_printf(" Read%s\n",
452 ACPI_READ_WRITE_MEMORY ==
453 fixed_memory32_data->
454 read_write_attribute ? "/Write" : " Only");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700455
Len Brown4be44fc2005-08-05 00:44:28 -0400456 acpi_os_printf(" Range base address: %08X\n",
457 fixed_memory32_data->range_base_address);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700458
Len Brown4be44fc2005-08-05 00:44:28 -0400459 acpi_os_printf(" Range length: %08X\n",
460 fixed_memory32_data->range_length);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700461
462 return;
463}
464
Linus Torvalds1da177e2005-04-16 15:20:36 -0700465/*******************************************************************************
466 *
467 * FUNCTION: acpi_rs_dump_address16
468 *
469 * PARAMETERS: Data - pointer to the resource structure to dump.
470 *
471 * RETURN: None
472 *
473 * DESCRIPTION: Prints out the various members of the Data structure type.
474 *
475 ******************************************************************************/
476
Len Brown4be44fc2005-08-05 00:44:28 -0400477static void acpi_rs_dump_address16(union acpi_resource_data *data)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700478{
Len Brown4be44fc2005-08-05 00:44:28 -0400479 struct acpi_resource_address16 *address16_data =
480 (struct acpi_resource_address16 *)data;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700481
Len Brown4be44fc2005-08-05 00:44:28 -0400482 ACPI_FUNCTION_ENTRY();
Linus Torvalds1da177e2005-04-16 15:20:36 -0700483
Len Brown4be44fc2005-08-05 00:44:28 -0400484 acpi_os_printf("16-Bit Address Space Resource\n");
485 acpi_os_printf(" Resource Type: ");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700486
487 switch (address16_data->resource_type) {
488 case ACPI_MEMORY_RANGE:
489
Len Brown4be44fc2005-08-05 00:44:28 -0400490 acpi_os_printf("Memory Range\n");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700491
492 switch (address16_data->attribute.memory.cache_attribute) {
493 case ACPI_NON_CACHEABLE_MEMORY:
Len Brown4be44fc2005-08-05 00:44:28 -0400494 acpi_os_printf
495 (" Type Specific: Noncacheable memory\n");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700496 break;
497
498 case ACPI_CACHABLE_MEMORY:
Len Brown4be44fc2005-08-05 00:44:28 -0400499 acpi_os_printf(" Type Specific: Cacheable memory\n");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700500 break;
501
502 case ACPI_WRITE_COMBINING_MEMORY:
Len Brown4be44fc2005-08-05 00:44:28 -0400503 acpi_os_printf
504 (" Type Specific: Write-combining memory\n");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700505 break;
506
507 case ACPI_PREFETCHABLE_MEMORY:
Len Brown4be44fc2005-08-05 00:44:28 -0400508 acpi_os_printf
509 (" Type Specific: Prefetchable memory\n");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700510 break;
511
512 default:
Len Brown4be44fc2005-08-05 00:44:28 -0400513 acpi_os_printf
514 (" Type Specific: Invalid cache attribute\n");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700515 break;
516 }
517
Len Brown4be44fc2005-08-05 00:44:28 -0400518 acpi_os_printf(" Type Specific: Read%s\n",
519 ACPI_READ_WRITE_MEMORY ==
520 address16_data->attribute.memory.
521 read_write_attribute ? "/Write" : " Only");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700522 break;
523
524 case ACPI_IO_RANGE:
525
Len Brown4be44fc2005-08-05 00:44:28 -0400526 acpi_os_printf("I/O Range\n");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700527
528 switch (address16_data->attribute.io.range_attribute) {
529 case ACPI_NON_ISA_ONLY_RANGES:
Len Brown4be44fc2005-08-05 00:44:28 -0400530 acpi_os_printf
531 (" Type Specific: Non-ISA Io Addresses\n");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700532 break;
533
534 case ACPI_ISA_ONLY_RANGES:
Len Brown4be44fc2005-08-05 00:44:28 -0400535 acpi_os_printf(" Type Specific: ISA Io Addresses\n");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700536 break;
537
538 case ACPI_ENTIRE_RANGE:
Len Brown4be44fc2005-08-05 00:44:28 -0400539 acpi_os_printf
540 (" Type Specific: ISA and non-ISA Io Addresses\n");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700541 break;
542
543 default:
Len Brown4be44fc2005-08-05 00:44:28 -0400544 acpi_os_printf
545 (" Type Specific: Invalid range attribute\n");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700546 break;
547 }
548
Len Brown4be44fc2005-08-05 00:44:28 -0400549 acpi_os_printf(" Type Specific: %s Translation\n",
550 ACPI_SPARSE_TRANSLATION ==
551 address16_data->attribute.io.
552 translation_attribute ? "Sparse" : "Dense");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700553 break;
554
555 case ACPI_BUS_NUMBER_RANGE:
556
Len Brown4be44fc2005-08-05 00:44:28 -0400557 acpi_os_printf("Bus Number Range\n");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700558 break;
559
560 default:
561
Len Brown4be44fc2005-08-05 00:44:28 -0400562 acpi_os_printf("0x%2.2X\n", address16_data->resource_type);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700563 break;
564 }
565
Len Brown4be44fc2005-08-05 00:44:28 -0400566 acpi_os_printf(" Resource %s\n",
567 ACPI_CONSUMER == address16_data->producer_consumer ?
568 "Consumer" : "Producer");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700569
Len Brown4be44fc2005-08-05 00:44:28 -0400570 acpi_os_printf(" %s decode\n",
571 ACPI_SUB_DECODE == address16_data->decode ?
572 "Subtractive" : "Positive");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700573
Len Brown4be44fc2005-08-05 00:44:28 -0400574 acpi_os_printf(" Min address is %s fixed\n",
575 ACPI_ADDRESS_FIXED == address16_data->min_address_fixed ?
576 "" : "not");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700577
Len Brown4be44fc2005-08-05 00:44:28 -0400578 acpi_os_printf(" Max address is %s fixed\n",
579 ACPI_ADDRESS_FIXED == address16_data->max_address_fixed ?
580 "" : "not");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700581
Len Brown4be44fc2005-08-05 00:44:28 -0400582 acpi_os_printf(" Granularity: %08X\n", address16_data->granularity);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700583
Len Brown4be44fc2005-08-05 00:44:28 -0400584 acpi_os_printf(" Address range min: %08X\n",
585 address16_data->min_address_range);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700586
Len Brown4be44fc2005-08-05 00:44:28 -0400587 acpi_os_printf(" Address range max: %08X\n",
588 address16_data->max_address_range);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700589
Len Brown4be44fc2005-08-05 00:44:28 -0400590 acpi_os_printf(" Address translation offset: %08X\n",
591 address16_data->address_translation_offset);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700592
Len Brown4be44fc2005-08-05 00:44:28 -0400593 acpi_os_printf(" Address Length: %08X\n",
594 address16_data->address_length);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700595
596 if (0xFF != address16_data->resource_source.index) {
Len Brown4be44fc2005-08-05 00:44:28 -0400597 acpi_os_printf(" Resource Source Index: %X\n",
598 address16_data->resource_source.index);
Robert Moore44f6c012005-04-18 22:49:35 -0400599
Len Brown4be44fc2005-08-05 00:44:28 -0400600 acpi_os_printf(" Resource Source: %s\n",
601 address16_data->resource_source.string_ptr);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700602 }
603
604 return;
605}
606
Linus Torvalds1da177e2005-04-16 15:20:36 -0700607/*******************************************************************************
608 *
609 * FUNCTION: acpi_rs_dump_address32
610 *
611 * PARAMETERS: Data - pointer to the resource structure to dump.
612 *
613 * RETURN: None
614 *
615 * DESCRIPTION: Prints out the various members of the Data structure type.
616 *
617 ******************************************************************************/
618
Len Brown4be44fc2005-08-05 00:44:28 -0400619static void acpi_rs_dump_address32(union acpi_resource_data *data)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700620{
Len Brown4be44fc2005-08-05 00:44:28 -0400621 struct acpi_resource_address32 *address32_data =
622 (struct acpi_resource_address32 *)data;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700623
Len Brown4be44fc2005-08-05 00:44:28 -0400624 ACPI_FUNCTION_ENTRY();
Linus Torvalds1da177e2005-04-16 15:20:36 -0700625
Len Brown4be44fc2005-08-05 00:44:28 -0400626 acpi_os_printf("32-Bit Address Space Resource\n");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700627
628 switch (address32_data->resource_type) {
629 case ACPI_MEMORY_RANGE:
630
Len Brown4be44fc2005-08-05 00:44:28 -0400631 acpi_os_printf(" Resource Type: Memory Range\n");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700632
633 switch (address32_data->attribute.memory.cache_attribute) {
634 case ACPI_NON_CACHEABLE_MEMORY:
Len Brown4be44fc2005-08-05 00:44:28 -0400635 acpi_os_printf
636 (" Type Specific: Noncacheable memory\n");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700637 break;
638
639 case ACPI_CACHABLE_MEMORY:
Len Brown4be44fc2005-08-05 00:44:28 -0400640 acpi_os_printf(" Type Specific: Cacheable memory\n");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700641 break;
642
643 case ACPI_WRITE_COMBINING_MEMORY:
Len Brown4be44fc2005-08-05 00:44:28 -0400644 acpi_os_printf
645 (" Type Specific: Write-combining memory\n");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700646 break;
647
648 case ACPI_PREFETCHABLE_MEMORY:
Len Brown4be44fc2005-08-05 00:44:28 -0400649 acpi_os_printf
650 (" Type Specific: Prefetchable memory\n");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700651 break;
652
653 default:
Len Brown4be44fc2005-08-05 00:44:28 -0400654 acpi_os_printf
655 (" Type Specific: Invalid cache attribute\n");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700656 break;
657 }
658
Len Brown4be44fc2005-08-05 00:44:28 -0400659 acpi_os_printf(" Type Specific: Read%s\n",
660 ACPI_READ_WRITE_MEMORY ==
661 address32_data->attribute.memory.
662 read_write_attribute ? "/Write" : " Only");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700663 break;
664
665 case ACPI_IO_RANGE:
666
Len Brown4be44fc2005-08-05 00:44:28 -0400667 acpi_os_printf(" Resource Type: Io Range\n");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700668
669 switch (address32_data->attribute.io.range_attribute) {
670 case ACPI_NON_ISA_ONLY_RANGES:
Len Brown4be44fc2005-08-05 00:44:28 -0400671 acpi_os_printf
672 (" Type Specific: Non-ISA Io Addresses\n");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700673 break;
674
675 case ACPI_ISA_ONLY_RANGES:
Len Brown4be44fc2005-08-05 00:44:28 -0400676 acpi_os_printf(" Type Specific: ISA Io Addresses\n");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700677 break;
678
679 case ACPI_ENTIRE_RANGE:
Len Brown4be44fc2005-08-05 00:44:28 -0400680 acpi_os_printf
681 (" Type Specific: ISA and non-ISA Io Addresses\n");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700682 break;
683
684 default:
Len Brown4be44fc2005-08-05 00:44:28 -0400685 acpi_os_printf
686 (" Type Specific: Invalid Range attribute");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700687 break;
688 }
689
Len Brown4be44fc2005-08-05 00:44:28 -0400690 acpi_os_printf(" Type Specific: %s Translation\n",
691 ACPI_SPARSE_TRANSLATION ==
692 address32_data->attribute.io.
693 translation_attribute ? "Sparse" : "Dense");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700694 break;
695
696 case ACPI_BUS_NUMBER_RANGE:
697
Len Brown4be44fc2005-08-05 00:44:28 -0400698 acpi_os_printf(" Resource Type: Bus Number Range\n");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700699 break;
700
701 default:
702
Len Brown4be44fc2005-08-05 00:44:28 -0400703 acpi_os_printf(" Resource Type: 0x%2.2X\n",
704 address32_data->resource_type);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700705 break;
706 }
707
Len Brown4be44fc2005-08-05 00:44:28 -0400708 acpi_os_printf(" Resource %s\n",
709 ACPI_CONSUMER == address32_data->producer_consumer ?
710 "Consumer" : "Producer");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700711
Len Brown4be44fc2005-08-05 00:44:28 -0400712 acpi_os_printf(" %s decode\n",
713 ACPI_SUB_DECODE == address32_data->decode ?
714 "Subtractive" : "Positive");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700715
Len Brown4be44fc2005-08-05 00:44:28 -0400716 acpi_os_printf(" Min address is %s fixed\n",
717 ACPI_ADDRESS_FIXED == address32_data->min_address_fixed ?
718 "" : "not ");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700719
Len Brown4be44fc2005-08-05 00:44:28 -0400720 acpi_os_printf(" Max address is %s fixed\n",
721 ACPI_ADDRESS_FIXED == address32_data->max_address_fixed ?
722 "" : "not ");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700723
Len Brown4be44fc2005-08-05 00:44:28 -0400724 acpi_os_printf(" Granularity: %08X\n", address32_data->granularity);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700725
Len Brown4be44fc2005-08-05 00:44:28 -0400726 acpi_os_printf(" Address range min: %08X\n",
727 address32_data->min_address_range);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700728
Len Brown4be44fc2005-08-05 00:44:28 -0400729 acpi_os_printf(" Address range max: %08X\n",
730 address32_data->max_address_range);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700731
Len Brown4be44fc2005-08-05 00:44:28 -0400732 acpi_os_printf(" Address translation offset: %08X\n",
733 address32_data->address_translation_offset);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700734
Len Brown4be44fc2005-08-05 00:44:28 -0400735 acpi_os_printf(" Address Length: %08X\n",
736 address32_data->address_length);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700737
Len Brown4be44fc2005-08-05 00:44:28 -0400738 if (0xFF != address32_data->resource_source.index) {
739 acpi_os_printf(" Resource Source Index: %X\n",
740 address32_data->resource_source.index);
Robert Moore44f6c012005-04-18 22:49:35 -0400741
Len Brown4be44fc2005-08-05 00:44:28 -0400742 acpi_os_printf(" Resource Source: %s\n",
743 address32_data->resource_source.string_ptr);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700744 }
745
746 return;
747}
748
Linus Torvalds1da177e2005-04-16 15:20:36 -0700749/*******************************************************************************
750 *
751 * FUNCTION: acpi_rs_dump_address64
752 *
753 * PARAMETERS: Data - pointer to the resource structure to dump.
754 *
755 * RETURN: None
756 *
757 * DESCRIPTION: Prints out the various members of the Data structure type.
758 *
759 ******************************************************************************/
760
Len Brown4be44fc2005-08-05 00:44:28 -0400761static void acpi_rs_dump_address64(union acpi_resource_data *data)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700762{
Len Brown4be44fc2005-08-05 00:44:28 -0400763 struct acpi_resource_address64 *address64_data =
764 (struct acpi_resource_address64 *)data;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700765
Len Brown4be44fc2005-08-05 00:44:28 -0400766 ACPI_FUNCTION_ENTRY();
Linus Torvalds1da177e2005-04-16 15:20:36 -0700767
Len Brown4be44fc2005-08-05 00:44:28 -0400768 acpi_os_printf("64-Bit Address Space Resource\n");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700769
770 switch (address64_data->resource_type) {
771 case ACPI_MEMORY_RANGE:
772
Len Brown4be44fc2005-08-05 00:44:28 -0400773 acpi_os_printf(" Resource Type: Memory Range\n");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700774
775 switch (address64_data->attribute.memory.cache_attribute) {
776 case ACPI_NON_CACHEABLE_MEMORY:
Len Brown4be44fc2005-08-05 00:44:28 -0400777 acpi_os_printf
778 (" Type Specific: Noncacheable memory\n");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700779 break;
780
781 case ACPI_CACHABLE_MEMORY:
Len Brown4be44fc2005-08-05 00:44:28 -0400782 acpi_os_printf(" Type Specific: Cacheable memory\n");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700783 break;
784
785 case ACPI_WRITE_COMBINING_MEMORY:
Len Brown4be44fc2005-08-05 00:44:28 -0400786 acpi_os_printf
787 (" Type Specific: Write-combining memory\n");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700788 break;
789
790 case ACPI_PREFETCHABLE_MEMORY:
Len Brown4be44fc2005-08-05 00:44:28 -0400791 acpi_os_printf
792 (" Type Specific: Prefetchable memory\n");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700793 break;
794
795 default:
Len Brown4be44fc2005-08-05 00:44:28 -0400796 acpi_os_printf
797 (" Type Specific: Invalid cache attribute\n");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700798 break;
799 }
800
Len Brown4be44fc2005-08-05 00:44:28 -0400801 acpi_os_printf(" Type Specific: Read%s\n",
802 ACPI_READ_WRITE_MEMORY ==
803 address64_data->attribute.memory.
804 read_write_attribute ? "/Write" : " Only");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700805 break;
806
807 case ACPI_IO_RANGE:
808
Len Brown4be44fc2005-08-05 00:44:28 -0400809 acpi_os_printf(" Resource Type: Io Range\n");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700810
811 switch (address64_data->attribute.io.range_attribute) {
812 case ACPI_NON_ISA_ONLY_RANGES:
Len Brown4be44fc2005-08-05 00:44:28 -0400813 acpi_os_printf
814 (" Type Specific: Non-ISA Io Addresses\n");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700815 break;
816
817 case ACPI_ISA_ONLY_RANGES:
Len Brown4be44fc2005-08-05 00:44:28 -0400818 acpi_os_printf(" Type Specific: ISA Io Addresses\n");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700819 break;
820
821 case ACPI_ENTIRE_RANGE:
Len Brown4be44fc2005-08-05 00:44:28 -0400822 acpi_os_printf
823 (" Type Specific: ISA and non-ISA Io Addresses\n");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700824 break;
825
826 default:
Len Brown4be44fc2005-08-05 00:44:28 -0400827 acpi_os_printf
828 (" Type Specific: Invalid Range attribute");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700829 break;
830 }
831
Len Brown4be44fc2005-08-05 00:44:28 -0400832 acpi_os_printf(" Type Specific: %s Translation\n",
833 ACPI_SPARSE_TRANSLATION ==
834 address64_data->attribute.io.
835 translation_attribute ? "Sparse" : "Dense");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700836 break;
837
838 case ACPI_BUS_NUMBER_RANGE:
839
Len Brown4be44fc2005-08-05 00:44:28 -0400840 acpi_os_printf(" Resource Type: Bus Number Range\n");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700841 break;
842
843 default:
844
Len Brown4be44fc2005-08-05 00:44:28 -0400845 acpi_os_printf(" Resource Type: 0x%2.2X\n",
846 address64_data->resource_type);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700847 break;
848 }
849
Len Brown4be44fc2005-08-05 00:44:28 -0400850 acpi_os_printf(" Resource %s\n",
851 ACPI_CONSUMER == address64_data->producer_consumer ?
852 "Consumer" : "Producer");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700853
Len Brown4be44fc2005-08-05 00:44:28 -0400854 acpi_os_printf(" %s decode\n",
855 ACPI_SUB_DECODE == address64_data->decode ?
856 "Subtractive" : "Positive");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700857
Len Brown4be44fc2005-08-05 00:44:28 -0400858 acpi_os_printf(" Min address is %s fixed\n",
859 ACPI_ADDRESS_FIXED == address64_data->min_address_fixed ?
860 "" : "not ");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700861
Len Brown4be44fc2005-08-05 00:44:28 -0400862 acpi_os_printf(" Max address is %s fixed\n",
863 ACPI_ADDRESS_FIXED == address64_data->max_address_fixed ?
864 "" : "not ");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700865
Len Brown4be44fc2005-08-05 00:44:28 -0400866 acpi_os_printf(" Granularity: %8.8X%8.8X\n",
867 ACPI_FORMAT_UINT64(address64_data->granularity));
Linus Torvalds1da177e2005-04-16 15:20:36 -0700868
Len Brown4be44fc2005-08-05 00:44:28 -0400869 acpi_os_printf(" Address range min: %8.8X%8.8X\n",
870 ACPI_FORMAT_UINT64(address64_data->min_address_range));
Linus Torvalds1da177e2005-04-16 15:20:36 -0700871
Len Brown4be44fc2005-08-05 00:44:28 -0400872 acpi_os_printf(" Address range max: %8.8X%8.8X\n",
873 ACPI_FORMAT_UINT64(address64_data->max_address_range));
Linus Torvalds1da177e2005-04-16 15:20:36 -0700874
Len Brown4be44fc2005-08-05 00:44:28 -0400875 acpi_os_printf(" Address translation offset: %8.8X%8.8X\n",
876 ACPI_FORMAT_UINT64(address64_data->
877 address_translation_offset));
Linus Torvalds1da177e2005-04-16 15:20:36 -0700878
Len Brown4be44fc2005-08-05 00:44:28 -0400879 acpi_os_printf(" Address Length: %8.8X%8.8X\n",
880 ACPI_FORMAT_UINT64(address64_data->address_length));
Linus Torvalds1da177e2005-04-16 15:20:36 -0700881
Len Brown4be44fc2005-08-05 00:44:28 -0400882 acpi_os_printf(" Type Specific Attributes: %8.8X%8.8X\n",
883 ACPI_FORMAT_UINT64(address64_data->
884 type_specific_attributes));
Linus Torvalds1da177e2005-04-16 15:20:36 -0700885
886 if (0xFF != address64_data->resource_source.index) {
Len Brown4be44fc2005-08-05 00:44:28 -0400887 acpi_os_printf(" Resource Source Index: %X\n",
888 address64_data->resource_source.index);
Robert Moore44f6c012005-04-18 22:49:35 -0400889
Len Brown4be44fc2005-08-05 00:44:28 -0400890 acpi_os_printf(" Resource Source: %s\n",
891 address64_data->resource_source.string_ptr);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700892 }
893
894 return;
895}
896
Linus Torvalds1da177e2005-04-16 15:20:36 -0700897/*******************************************************************************
898 *
899 * FUNCTION: acpi_rs_dump_extended_irq
900 *
901 * PARAMETERS: Data - pointer to the resource structure to dump.
902 *
903 * RETURN: None
904 *
905 * DESCRIPTION: Prints out the various members of the Data structure type.
906 *
907 ******************************************************************************/
908
Len Brown4be44fc2005-08-05 00:44:28 -0400909static void acpi_rs_dump_extended_irq(union acpi_resource_data *data)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700910{
Len Brown4be44fc2005-08-05 00:44:28 -0400911 struct acpi_resource_ext_irq *ext_irq_data =
912 (struct acpi_resource_ext_irq *)data;
913 u8 index = 0;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700914
Len Brown4be44fc2005-08-05 00:44:28 -0400915 ACPI_FUNCTION_ENTRY();
Linus Torvalds1da177e2005-04-16 15:20:36 -0700916
Len Brown4be44fc2005-08-05 00:44:28 -0400917 acpi_os_printf("Extended IRQ Resource\n");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700918
Len Brown4be44fc2005-08-05 00:44:28 -0400919 acpi_os_printf(" Resource %s\n",
920 ACPI_CONSUMER == ext_irq_data->producer_consumer ?
921 "Consumer" : "Producer");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700922
Len Brown4be44fc2005-08-05 00:44:28 -0400923 acpi_os_printf(" %s\n",
924 ACPI_LEVEL_SENSITIVE == ext_irq_data->edge_level ?
925 "Level" : "Edge");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700926
Len Brown4be44fc2005-08-05 00:44:28 -0400927 acpi_os_printf(" Active %s\n",
928 ACPI_ACTIVE_LOW == ext_irq_data->active_high_low ?
929 "low" : "high");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700930
Len Brown4be44fc2005-08-05 00:44:28 -0400931 acpi_os_printf(" %s\n",
932 ACPI_SHARED == ext_irq_data->shared_exclusive ?
933 "Shared" : "Exclusive");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700934
Len Brown4be44fc2005-08-05 00:44:28 -0400935 acpi_os_printf(" Interrupts : %X ( ",
936 ext_irq_data->number_of_interrupts);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700937
938 for (index = 0; index < ext_irq_data->number_of_interrupts; index++) {
Len Brown4be44fc2005-08-05 00:44:28 -0400939 acpi_os_printf("%X ", ext_irq_data->interrupts[index]);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700940 }
941
Len Brown4be44fc2005-08-05 00:44:28 -0400942 acpi_os_printf(")\n");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700943
Len Brown4be44fc2005-08-05 00:44:28 -0400944 if (0xFF != ext_irq_data->resource_source.index) {
945 acpi_os_printf(" Resource Source Index: %X",
946 ext_irq_data->resource_source.index);
Robert Moore44f6c012005-04-18 22:49:35 -0400947
Len Brown4be44fc2005-08-05 00:44:28 -0400948 acpi_os_printf(" Resource Source: %s",
949 ext_irq_data->resource_source.string_ptr);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700950 }
951
952 return;
953}
954
Linus Torvalds1da177e2005-04-16 15:20:36 -0700955/*******************************************************************************
956 *
957 * FUNCTION: acpi_rs_dump_resource_list
958 *
Robert Moore44f6c012005-04-18 22:49:35 -0400959 * PARAMETERS: Resource - pointer to the resource structure to dump.
Linus Torvalds1da177e2005-04-16 15:20:36 -0700960 *
961 * RETURN: None
962 *
963 * DESCRIPTION: Dispatches the structure to the correct dump routine.
964 *
965 ******************************************************************************/
966
Len Brown4be44fc2005-08-05 00:44:28 -0400967void acpi_rs_dump_resource_list(struct acpi_resource *resource)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700968{
Len Brown4be44fc2005-08-05 00:44:28 -0400969 u8 count = 0;
970 u8 done = FALSE;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700971
Len Brown4be44fc2005-08-05 00:44:28 -0400972 ACPI_FUNCTION_ENTRY();
Linus Torvalds1da177e2005-04-16 15:20:36 -0700973
974 if (acpi_dbg_level & ACPI_LV_RESOURCES && _COMPONENT & acpi_dbg_layer) {
975 while (!done) {
Len Brown4be44fc2005-08-05 00:44:28 -0400976 acpi_os_printf("Resource structure %X.\n", count++);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700977
978 switch (resource->id) {
979 case ACPI_RSTYPE_IRQ:
Len Brown4be44fc2005-08-05 00:44:28 -0400980 acpi_rs_dump_irq(&resource->data);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700981 break;
982
983 case ACPI_RSTYPE_DMA:
Len Brown4be44fc2005-08-05 00:44:28 -0400984 acpi_rs_dump_dma(&resource->data);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700985 break;
986
987 case ACPI_RSTYPE_START_DPF:
Len Brown4be44fc2005-08-05 00:44:28 -0400988 acpi_rs_dump_start_depend_fns(&resource->data);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700989 break;
990
991 case ACPI_RSTYPE_END_DPF:
Len Brown4be44fc2005-08-05 00:44:28 -0400992 acpi_os_printf
993 ("end_dependent_functions Resource\n");
994 /* acpi_rs_dump_end_dependent_functions (Resource->Data); */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700995 break;
996
997 case ACPI_RSTYPE_IO:
Len Brown4be44fc2005-08-05 00:44:28 -0400998 acpi_rs_dump_io(&resource->data);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700999 break;
1000
1001 case ACPI_RSTYPE_FIXED_IO:
Len Brown4be44fc2005-08-05 00:44:28 -04001002 acpi_rs_dump_fixed_io(&resource->data);
Linus Torvalds1da177e2005-04-16 15:20:36 -07001003 break;
1004
1005 case ACPI_RSTYPE_VENDOR:
Len Brown4be44fc2005-08-05 00:44:28 -04001006 acpi_rs_dump_vendor_specific(&resource->data);
Linus Torvalds1da177e2005-04-16 15:20:36 -07001007 break;
1008
1009 case ACPI_RSTYPE_END_TAG:
Len Brown4be44fc2005-08-05 00:44:28 -04001010 /*rs_dump_end_tag (Resource->Data); */
1011 acpi_os_printf("end_tag Resource\n");
Linus Torvalds1da177e2005-04-16 15:20:36 -07001012 done = TRUE;
1013 break;
1014
1015 case ACPI_RSTYPE_MEM24:
Len Brown4be44fc2005-08-05 00:44:28 -04001016 acpi_rs_dump_memory24(&resource->data);
Linus Torvalds1da177e2005-04-16 15:20:36 -07001017 break;
1018
1019 case ACPI_RSTYPE_MEM32:
Len Brown4be44fc2005-08-05 00:44:28 -04001020 acpi_rs_dump_memory32(&resource->data);
Linus Torvalds1da177e2005-04-16 15:20:36 -07001021 break;
1022
1023 case ACPI_RSTYPE_FIXED_MEM32:
Len Brown4be44fc2005-08-05 00:44:28 -04001024 acpi_rs_dump_fixed_memory32(&resource->data);
Linus Torvalds1da177e2005-04-16 15:20:36 -07001025 break;
1026
1027 case ACPI_RSTYPE_ADDRESS16:
Len Brown4be44fc2005-08-05 00:44:28 -04001028 acpi_rs_dump_address16(&resource->data);
Linus Torvalds1da177e2005-04-16 15:20:36 -07001029 break;
1030
1031 case ACPI_RSTYPE_ADDRESS32:
Len Brown4be44fc2005-08-05 00:44:28 -04001032 acpi_rs_dump_address32(&resource->data);
Linus Torvalds1da177e2005-04-16 15:20:36 -07001033 break;
1034
1035 case ACPI_RSTYPE_ADDRESS64:
Len Brown4be44fc2005-08-05 00:44:28 -04001036 acpi_rs_dump_address64(&resource->data);
Linus Torvalds1da177e2005-04-16 15:20:36 -07001037 break;
1038
1039 case ACPI_RSTYPE_EXT_IRQ:
Len Brown4be44fc2005-08-05 00:44:28 -04001040 acpi_rs_dump_extended_irq(&resource->data);
Linus Torvalds1da177e2005-04-16 15:20:36 -07001041 break;
1042
1043 default:
Len Brown4be44fc2005-08-05 00:44:28 -04001044 acpi_os_printf("Invalid resource type\n");
Linus Torvalds1da177e2005-04-16 15:20:36 -07001045 break;
1046
1047 }
1048
Len Brown4be44fc2005-08-05 00:44:28 -04001049 resource =
1050 ACPI_PTR_ADD(struct acpi_resource, resource,
1051 resource->length);
Linus Torvalds1da177e2005-04-16 15:20:36 -07001052 }
1053 }
1054
1055 return;
1056}
1057
1058/*******************************************************************************
1059 *
1060 * FUNCTION: acpi_rs_dump_irq_list
1061 *
Robert Moore44f6c012005-04-18 22:49:35 -04001062 * PARAMETERS: route_table - pointer to the routing table to dump.
Linus Torvalds1da177e2005-04-16 15:20:36 -07001063 *
1064 * RETURN: None
1065 *
1066 * DESCRIPTION: Dispatches the structures to the correct dump routine.
1067 *
1068 ******************************************************************************/
1069
Len Brown4be44fc2005-08-05 00:44:28 -04001070void acpi_rs_dump_irq_list(u8 * route_table)
Linus Torvalds1da177e2005-04-16 15:20:36 -07001071{
Len Brown4be44fc2005-08-05 00:44:28 -04001072 u8 *buffer = route_table;
1073 u8 count = 0;
1074 u8 done = FALSE;
1075 struct acpi_pci_routing_table *prt_element;
Linus Torvalds1da177e2005-04-16 15:20:36 -07001076
Len Brown4be44fc2005-08-05 00:44:28 -04001077 ACPI_FUNCTION_ENTRY();
Linus Torvalds1da177e2005-04-16 15:20:36 -07001078
1079 if (acpi_dbg_level & ACPI_LV_RESOURCES && _COMPONENT & acpi_dbg_layer) {
Len Brown4be44fc2005-08-05 00:44:28 -04001080 prt_element =
1081 ACPI_CAST_PTR(struct acpi_pci_routing_table, buffer);
Linus Torvalds1da177e2005-04-16 15:20:36 -07001082
1083 while (!done) {
Len Brown4be44fc2005-08-05 00:44:28 -04001084 acpi_os_printf("PCI IRQ Routing Table structure %X.\n",
1085 count++);
Linus Torvalds1da177e2005-04-16 15:20:36 -07001086
Len Brown4be44fc2005-08-05 00:44:28 -04001087 acpi_os_printf(" Address: %8.8X%8.8X\n",
1088 ACPI_FORMAT_UINT64(prt_element->
1089 address));
Linus Torvalds1da177e2005-04-16 15:20:36 -07001090
Len Brown4be44fc2005-08-05 00:44:28 -04001091 acpi_os_printf(" Pin: %X\n", prt_element->pin);
Linus Torvalds1da177e2005-04-16 15:20:36 -07001092
Len Brown4be44fc2005-08-05 00:44:28 -04001093 acpi_os_printf(" Source: %s\n", prt_element->source);
Linus Torvalds1da177e2005-04-16 15:20:36 -07001094
Len Brown4be44fc2005-08-05 00:44:28 -04001095 acpi_os_printf(" source_index: %X\n",
1096 prt_element->source_index);
Linus Torvalds1da177e2005-04-16 15:20:36 -07001097
1098 buffer += prt_element->length;
Len Brown4be44fc2005-08-05 00:44:28 -04001099 prt_element =
1100 ACPI_CAST_PTR(struct acpi_pci_routing_table,
1101 buffer);
Robert Moore44f6c012005-04-18 22:49:35 -04001102 if (0 == prt_element->length) {
Linus Torvalds1da177e2005-04-16 15:20:36 -07001103 done = TRUE;
1104 }
1105 }
1106 }
1107
1108 return;
1109}
1110
1111#endif