Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /******************************************************************************* |
| 2 | * |
| 3 | * Module Name: rsdump - Functions to display the resource structures. |
| 4 | * |
| 5 | ******************************************************************************/ |
| 6 | |
| 7 | /* |
Bob Moore | 6c9deb7 | 2007-02-02 19:48:24 +0300 | [diff] [blame] | 8 | * Copyright (C) 2000 - 2007, R. Byron Moore |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 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 Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 44 | #include <acpi/acpi.h> |
| 45 | #include <acpi/acresrc.h> |
| 46 | |
| 47 | #define _COMPONENT ACPI_RESOURCES |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 48 | ACPI_MODULE_NAME("rsdump") |
Robert Moore | 6f42ccf | 2005-05-13 00:00:00 -0400 | [diff] [blame] | 49 | #if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER) |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 50 | /* Local prototypes */ |
Robert Moore | bda663d | 2005-09-16 16:51:15 -0400 | [diff] [blame] | 51 | static void acpi_rs_out_string(char *title, char *value); |
| 52 | |
| 53 | static void acpi_rs_out_integer8(char *title, u8 value); |
| 54 | |
| 55 | static void acpi_rs_out_integer16(char *title, u16 value); |
| 56 | |
| 57 | static void acpi_rs_out_integer32(char *title, u32 value); |
| 58 | |
| 59 | static void acpi_rs_out_integer64(char *title, u64 value); |
| 60 | |
| 61 | static void acpi_rs_out_title(char *title); |
| 62 | |
Bob Moore | 0897831 | 2005-10-21 00:00:00 -0400 | [diff] [blame] | 63 | static void acpi_rs_dump_byte_list(u16 length, u8 * data); |
Robert Moore | bda663d | 2005-09-16 16:51:15 -0400 | [diff] [blame] | 64 | |
Bob Moore | 0897831 | 2005-10-21 00:00:00 -0400 | [diff] [blame] | 65 | static void acpi_rs_dump_dword_list(u8 length, u32 * data); |
Robert Moore | bda663d | 2005-09-16 16:51:15 -0400 | [diff] [blame] | 66 | |
Bob Moore | 0897831 | 2005-10-21 00:00:00 -0400 | [diff] [blame] | 67 | static void acpi_rs_dump_short_byte_list(u8 length, u8 * data); |
Robert Moore | bda663d | 2005-09-16 16:51:15 -0400 | [diff] [blame] | 68 | |
| 69 | static void |
| 70 | acpi_rs_dump_resource_source(struct acpi_resource_source *resource_source); |
| 71 | |
| 72 | static void acpi_rs_dump_address_common(union acpi_resource_data *resource); |
| 73 | |
Bob Moore | 0897831 | 2005-10-21 00:00:00 -0400 | [diff] [blame] | 74 | static void |
| 75 | acpi_rs_dump_descriptor(void *resource, struct acpi_rsdump_info *table); |
| 76 | |
| 77 | #define ACPI_RSD_OFFSET(f) (u8) ACPI_OFFSET (union acpi_resource_data,f) |
| 78 | #define ACPI_PRT_OFFSET(f) (u8) ACPI_OFFSET (struct acpi_pci_routing_table,f) |
| 79 | #define ACPI_RSD_TABLE_SIZE(name) (sizeof(name) / sizeof (struct acpi_rsdump_info)) |
| 80 | |
| 81 | /******************************************************************************* |
| 82 | * |
| 83 | * Resource Descriptor info tables |
| 84 | * |
| 85 | * Note: The first table entry must be a Title or Literal and must contain |
| 86 | * the table length (number of table entries) |
| 87 | * |
| 88 | ******************************************************************************/ |
| 89 | |
| 90 | struct acpi_rsdump_info acpi_rs_dump_irq[6] = { |
| 91 | {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE(acpi_rs_dump_irq), "IRQ", NULL}, |
| 92 | {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET(irq.triggering), "Triggering", |
Bob Moore | b229cf9 | 2006-04-21 17:15:00 -0400 | [diff] [blame] | 93 | acpi_gbl_he_decode}, |
Bob Moore | 0897831 | 2005-10-21 00:00:00 -0400 | [diff] [blame] | 94 | {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET(irq.polarity), "Polarity", |
Bob Moore | b229cf9 | 2006-04-21 17:15:00 -0400 | [diff] [blame] | 95 | acpi_gbl_ll_decode}, |
Bob Moore | 0897831 | 2005-10-21 00:00:00 -0400 | [diff] [blame] | 96 | {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET(irq.sharable), "Sharing", |
Bob Moore | b229cf9 | 2006-04-21 17:15:00 -0400 | [diff] [blame] | 97 | acpi_gbl_shr_decode}, |
Bob Moore | 0897831 | 2005-10-21 00:00:00 -0400 | [diff] [blame] | 98 | {ACPI_RSD_UINT8, ACPI_RSD_OFFSET(irq.interrupt_count), |
| 99 | "Interrupt Count", NULL}, |
| 100 | {ACPI_RSD_SHORTLIST, ACPI_RSD_OFFSET(irq.interrupts[0]), |
| 101 | "Interrupt List", NULL} |
| 102 | }; |
| 103 | |
| 104 | struct acpi_rsdump_info acpi_rs_dump_dma[6] = { |
| 105 | {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE(acpi_rs_dump_dma), "DMA", NULL}, |
| 106 | {ACPI_RSD_2BITFLAG, ACPI_RSD_OFFSET(dma.type), "Speed", |
Bob Moore | b229cf9 | 2006-04-21 17:15:00 -0400 | [diff] [blame] | 107 | acpi_gbl_typ_decode}, |
Bob Moore | 0897831 | 2005-10-21 00:00:00 -0400 | [diff] [blame] | 108 | {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET(dma.bus_master), "Mastering", |
Bob Moore | b229cf9 | 2006-04-21 17:15:00 -0400 | [diff] [blame] | 109 | acpi_gbl_bm_decode}, |
Bob Moore | 0897831 | 2005-10-21 00:00:00 -0400 | [diff] [blame] | 110 | {ACPI_RSD_2BITFLAG, ACPI_RSD_OFFSET(dma.transfer), "Transfer Type", |
Bob Moore | b229cf9 | 2006-04-21 17:15:00 -0400 | [diff] [blame] | 111 | acpi_gbl_siz_decode}, |
Bob Moore | 0897831 | 2005-10-21 00:00:00 -0400 | [diff] [blame] | 112 | {ACPI_RSD_UINT8, ACPI_RSD_OFFSET(dma.channel_count), "Channel Count", |
| 113 | NULL}, |
| 114 | {ACPI_RSD_SHORTLIST, ACPI_RSD_OFFSET(dma.channels[0]), "Channel List", |
| 115 | NULL} |
| 116 | }; |
| 117 | |
| 118 | struct acpi_rsdump_info acpi_rs_dump_start_dpf[3] = { |
| 119 | {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE(acpi_rs_dump_start_dpf), |
| 120 | "Start-Dependent-Functions", NULL}, |
| 121 | {ACPI_RSD_2BITFLAG, ACPI_RSD_OFFSET(start_dpf.compatibility_priority), |
| 122 | "Compatibility Priority", acpi_gbl_config_decode}, |
| 123 | {ACPI_RSD_2BITFLAG, ACPI_RSD_OFFSET(start_dpf.performance_robustness), |
| 124 | "Performance/Robustness", acpi_gbl_config_decode} |
| 125 | }; |
| 126 | |
| 127 | struct acpi_rsdump_info acpi_rs_dump_end_dpf[1] = { |
| 128 | {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE(acpi_rs_dump_end_dpf), |
| 129 | "End-Dependent-Functions", NULL} |
| 130 | }; |
| 131 | |
| 132 | struct acpi_rsdump_info acpi_rs_dump_io[6] = { |
| 133 | {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE(acpi_rs_dump_io), "I/O", NULL}, |
| 134 | {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET(io.io_decode), "Address Decoding", |
| 135 | acpi_gbl_io_decode}, |
| 136 | {ACPI_RSD_UINT16, ACPI_RSD_OFFSET(io.minimum), "Address Minimum", NULL}, |
| 137 | {ACPI_RSD_UINT16, ACPI_RSD_OFFSET(io.maximum), "Address Maximum", NULL}, |
| 138 | {ACPI_RSD_UINT8, ACPI_RSD_OFFSET(io.alignment), "Alignment", NULL}, |
| 139 | {ACPI_RSD_UINT8, ACPI_RSD_OFFSET(io.address_length), "Address Length", |
| 140 | NULL} |
| 141 | }; |
| 142 | |
| 143 | struct acpi_rsdump_info acpi_rs_dump_fixed_io[3] = { |
| 144 | {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE(acpi_rs_dump_fixed_io), |
| 145 | "Fixed I/O", NULL}, |
| 146 | {ACPI_RSD_UINT16, ACPI_RSD_OFFSET(fixed_io.address), "Address", NULL}, |
| 147 | {ACPI_RSD_UINT8, ACPI_RSD_OFFSET(fixed_io.address_length), |
| 148 | "Address Length", NULL} |
| 149 | }; |
| 150 | |
| 151 | struct acpi_rsdump_info acpi_rs_dump_vendor[3] = { |
| 152 | {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE(acpi_rs_dump_vendor), |
| 153 | "Vendor Specific", NULL}, |
| 154 | {ACPI_RSD_UINT16, ACPI_RSD_OFFSET(vendor.byte_length), "Length", NULL}, |
| 155 | {ACPI_RSD_LONGLIST, ACPI_RSD_OFFSET(vendor.byte_data[0]), "Vendor Data", |
| 156 | NULL} |
| 157 | }; |
| 158 | |
| 159 | struct acpi_rsdump_info acpi_rs_dump_end_tag[1] = { |
Bob Moore | b229cf9 | 2006-04-21 17:15:00 -0400 | [diff] [blame] | 160 | {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE(acpi_rs_dump_end_tag), "EndTag", |
Bob Moore | 0897831 | 2005-10-21 00:00:00 -0400 | [diff] [blame] | 161 | NULL} |
| 162 | }; |
| 163 | |
| 164 | struct acpi_rsdump_info acpi_rs_dump_memory24[6] = { |
| 165 | {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE(acpi_rs_dump_memory24), |
| 166 | "24-Bit Memory Range", NULL}, |
| 167 | {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET(memory24.write_protect), |
Bob Moore | b229cf9 | 2006-04-21 17:15:00 -0400 | [diff] [blame] | 168 | "Write Protect", acpi_gbl_rw_decode}, |
Bob Moore | 0897831 | 2005-10-21 00:00:00 -0400 | [diff] [blame] | 169 | {ACPI_RSD_UINT16, ACPI_RSD_OFFSET(memory24.minimum), "Address Minimum", |
| 170 | NULL}, |
| 171 | {ACPI_RSD_UINT16, ACPI_RSD_OFFSET(memory24.maximum), "Address Maximum", |
| 172 | NULL}, |
| 173 | {ACPI_RSD_UINT16, ACPI_RSD_OFFSET(memory24.alignment), "Alignment", |
| 174 | NULL}, |
| 175 | {ACPI_RSD_UINT16, ACPI_RSD_OFFSET(memory24.address_length), |
| 176 | "Address Length", NULL} |
| 177 | }; |
| 178 | |
| 179 | struct acpi_rsdump_info acpi_rs_dump_memory32[6] = { |
| 180 | {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE(acpi_rs_dump_memory32), |
| 181 | "32-Bit Memory Range", NULL}, |
| 182 | {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET(memory32.write_protect), |
Bob Moore | b229cf9 | 2006-04-21 17:15:00 -0400 | [diff] [blame] | 183 | "Write Protect", acpi_gbl_rw_decode}, |
Bob Moore | 0897831 | 2005-10-21 00:00:00 -0400 | [diff] [blame] | 184 | {ACPI_RSD_UINT32, ACPI_RSD_OFFSET(memory32.minimum), "Address Minimum", |
| 185 | NULL}, |
| 186 | {ACPI_RSD_UINT32, ACPI_RSD_OFFSET(memory32.maximum), "Address Maximum", |
| 187 | NULL}, |
| 188 | {ACPI_RSD_UINT32, ACPI_RSD_OFFSET(memory32.alignment), "Alignment", |
| 189 | NULL}, |
| 190 | {ACPI_RSD_UINT32, ACPI_RSD_OFFSET(memory32.address_length), |
| 191 | "Address Length", NULL} |
| 192 | }; |
| 193 | |
| 194 | struct acpi_rsdump_info acpi_rs_dump_fixed_memory32[4] = { |
| 195 | {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE(acpi_rs_dump_fixed_memory32), |
| 196 | "32-Bit Fixed Memory Range", NULL}, |
| 197 | {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET(fixed_memory32.write_protect), |
Bob Moore | b229cf9 | 2006-04-21 17:15:00 -0400 | [diff] [blame] | 198 | "Write Protect", acpi_gbl_rw_decode}, |
Bob Moore | 0897831 | 2005-10-21 00:00:00 -0400 | [diff] [blame] | 199 | {ACPI_RSD_UINT32, ACPI_RSD_OFFSET(fixed_memory32.address), "Address", |
| 200 | NULL}, |
| 201 | {ACPI_RSD_UINT32, ACPI_RSD_OFFSET(fixed_memory32.address_length), |
| 202 | "Address Length", NULL} |
| 203 | }; |
| 204 | |
| 205 | struct acpi_rsdump_info acpi_rs_dump_address16[8] = { |
| 206 | {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE(acpi_rs_dump_address16), |
| 207 | "16-Bit WORD Address Space", NULL}, |
| 208 | {ACPI_RSD_ADDRESS, 0, NULL, NULL}, |
| 209 | {ACPI_RSD_UINT16, ACPI_RSD_OFFSET(address16.granularity), "Granularity", |
| 210 | NULL}, |
| 211 | {ACPI_RSD_UINT16, ACPI_RSD_OFFSET(address16.minimum), "Address Minimum", |
| 212 | NULL}, |
| 213 | {ACPI_RSD_UINT16, ACPI_RSD_OFFSET(address16.maximum), "Address Maximum", |
| 214 | NULL}, |
| 215 | {ACPI_RSD_UINT16, ACPI_RSD_OFFSET(address16.translation_offset), |
| 216 | "Translation Offset", NULL}, |
| 217 | {ACPI_RSD_UINT16, ACPI_RSD_OFFSET(address16.address_length), |
| 218 | "Address Length", NULL}, |
| 219 | {ACPI_RSD_SOURCE, ACPI_RSD_OFFSET(address16.resource_source), NULL, NULL} |
| 220 | }; |
| 221 | |
| 222 | struct acpi_rsdump_info acpi_rs_dump_address32[8] = { |
| 223 | {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE(acpi_rs_dump_address32), |
| 224 | "32-Bit DWORD Address Space", NULL}, |
| 225 | {ACPI_RSD_ADDRESS, 0, NULL, NULL}, |
| 226 | {ACPI_RSD_UINT32, ACPI_RSD_OFFSET(address32.granularity), "Granularity", |
| 227 | NULL}, |
| 228 | {ACPI_RSD_UINT32, ACPI_RSD_OFFSET(address32.minimum), "Address Minimum", |
| 229 | NULL}, |
| 230 | {ACPI_RSD_UINT32, ACPI_RSD_OFFSET(address32.maximum), "Address Maximum", |
| 231 | NULL}, |
| 232 | {ACPI_RSD_UINT32, ACPI_RSD_OFFSET(address32.translation_offset), |
| 233 | "Translation Offset", NULL}, |
| 234 | {ACPI_RSD_UINT32, ACPI_RSD_OFFSET(address32.address_length), |
| 235 | "Address Length", NULL}, |
| 236 | {ACPI_RSD_SOURCE, ACPI_RSD_OFFSET(address32.resource_source), NULL, NULL} |
| 237 | }; |
| 238 | |
| 239 | struct acpi_rsdump_info acpi_rs_dump_address64[8] = { |
| 240 | {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE(acpi_rs_dump_address64), |
| 241 | "64-Bit QWORD Address Space", NULL}, |
| 242 | {ACPI_RSD_ADDRESS, 0, NULL, NULL}, |
| 243 | {ACPI_RSD_UINT64, ACPI_RSD_OFFSET(address64.granularity), "Granularity", |
| 244 | NULL}, |
| 245 | {ACPI_RSD_UINT64, ACPI_RSD_OFFSET(address64.minimum), "Address Minimum", |
| 246 | NULL}, |
| 247 | {ACPI_RSD_UINT64, ACPI_RSD_OFFSET(address64.maximum), "Address Maximum", |
| 248 | NULL}, |
| 249 | {ACPI_RSD_UINT64, ACPI_RSD_OFFSET(address64.translation_offset), |
| 250 | "Translation Offset", NULL}, |
| 251 | {ACPI_RSD_UINT64, ACPI_RSD_OFFSET(address64.address_length), |
| 252 | "Address Length", NULL}, |
| 253 | {ACPI_RSD_SOURCE, ACPI_RSD_OFFSET(address64.resource_source), NULL, NULL} |
| 254 | }; |
| 255 | |
| 256 | struct acpi_rsdump_info acpi_rs_dump_ext_address64[8] = { |
| 257 | {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE(acpi_rs_dump_ext_address64), |
| 258 | "64-Bit Extended Address Space", NULL}, |
| 259 | {ACPI_RSD_ADDRESS, 0, NULL, NULL}, |
| 260 | {ACPI_RSD_UINT64, ACPI_RSD_OFFSET(ext_address64.granularity), |
| 261 | "Granularity", NULL}, |
| 262 | {ACPI_RSD_UINT64, ACPI_RSD_OFFSET(ext_address64.minimum), |
| 263 | "Address Minimum", NULL}, |
| 264 | {ACPI_RSD_UINT64, ACPI_RSD_OFFSET(ext_address64.maximum), |
| 265 | "Address Maximum", NULL}, |
| 266 | {ACPI_RSD_UINT64, ACPI_RSD_OFFSET(ext_address64.translation_offset), |
| 267 | "Translation Offset", NULL}, |
| 268 | {ACPI_RSD_UINT64, ACPI_RSD_OFFSET(ext_address64.address_length), |
| 269 | "Address Length", NULL}, |
| 270 | {ACPI_RSD_UINT64, ACPI_RSD_OFFSET(ext_address64.type_specific), |
| 271 | "Type-Specific Attribute", NULL} |
| 272 | }; |
| 273 | |
| 274 | struct acpi_rsdump_info acpi_rs_dump_ext_irq[8] = { |
| 275 | {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE(acpi_rs_dump_ext_irq), |
| 276 | "Extended IRQ", NULL}, |
| 277 | {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET(extended_irq.producer_consumer), |
| 278 | "Type", acpi_gbl_consume_decode}, |
| 279 | {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET(extended_irq.triggering), |
Bob Moore | b229cf9 | 2006-04-21 17:15:00 -0400 | [diff] [blame] | 280 | "Triggering", acpi_gbl_he_decode}, |
Bob Moore | 0897831 | 2005-10-21 00:00:00 -0400 | [diff] [blame] | 281 | {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET(extended_irq.polarity), "Polarity", |
Bob Moore | b229cf9 | 2006-04-21 17:15:00 -0400 | [diff] [blame] | 282 | acpi_gbl_ll_decode}, |
Bob Moore | 0897831 | 2005-10-21 00:00:00 -0400 | [diff] [blame] | 283 | {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET(extended_irq.sharable), "Sharing", |
Bob Moore | b229cf9 | 2006-04-21 17:15:00 -0400 | [diff] [blame] | 284 | acpi_gbl_shr_decode}, |
Bob Moore | 0897831 | 2005-10-21 00:00:00 -0400 | [diff] [blame] | 285 | {ACPI_RSD_SOURCE, ACPI_RSD_OFFSET(extended_irq.resource_source), NULL, |
| 286 | NULL}, |
| 287 | {ACPI_RSD_UINT8, ACPI_RSD_OFFSET(extended_irq.interrupt_count), |
| 288 | "Interrupt Count", NULL}, |
| 289 | {ACPI_RSD_DWORDLIST, ACPI_RSD_OFFSET(extended_irq.interrupts[0]), |
| 290 | "Interrupt List", NULL} |
| 291 | }; |
| 292 | |
| 293 | struct acpi_rsdump_info acpi_rs_dump_generic_reg[6] = { |
| 294 | {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE(acpi_rs_dump_generic_reg), |
| 295 | "Generic Register", NULL}, |
| 296 | {ACPI_RSD_UINT8, ACPI_RSD_OFFSET(generic_reg.space_id), "Space ID", |
| 297 | NULL}, |
| 298 | {ACPI_RSD_UINT8, ACPI_RSD_OFFSET(generic_reg.bit_width), "Bit Width", |
| 299 | NULL}, |
| 300 | {ACPI_RSD_UINT8, ACPI_RSD_OFFSET(generic_reg.bit_offset), "Bit Offset", |
| 301 | NULL}, |
| 302 | {ACPI_RSD_UINT8, ACPI_RSD_OFFSET(generic_reg.access_size), |
| 303 | "Access Size", NULL}, |
| 304 | {ACPI_RSD_UINT64, ACPI_RSD_OFFSET(generic_reg.address), "Address", NULL} |
| 305 | }; |
| 306 | |
| 307 | /* |
| 308 | * Tables used for common address descriptor flag fields |
| 309 | */ |
| 310 | static struct acpi_rsdump_info acpi_rs_dump_general_flags[5] = { |
| 311 | {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE(acpi_rs_dump_general_flags), NULL, |
| 312 | NULL}, |
| 313 | {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET(address.producer_consumer), |
| 314 | "Consumer/Producer", acpi_gbl_consume_decode}, |
| 315 | {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET(address.decode), "Address Decode", |
Bob Moore | b229cf9 | 2006-04-21 17:15:00 -0400 | [diff] [blame] | 316 | acpi_gbl_dec_decode}, |
Bob Moore | 0897831 | 2005-10-21 00:00:00 -0400 | [diff] [blame] | 317 | {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET(address.min_address_fixed), |
| 318 | "Min Relocatability", acpi_gbl_min_decode}, |
| 319 | {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET(address.max_address_fixed), |
| 320 | "Max Relocatability", acpi_gbl_max_decode} |
| 321 | }; |
| 322 | |
| 323 | static struct acpi_rsdump_info acpi_rs_dump_memory_flags[5] = { |
| 324 | {ACPI_RSD_LITERAL, ACPI_RSD_TABLE_SIZE(acpi_rs_dump_memory_flags), |
Bob Moore | 96db255 | 2005-11-02 00:00:00 -0500 | [diff] [blame] | 325 | "Resource Type", (void *)"Memory Range"}, |
Bob Moore | 0897831 | 2005-10-21 00:00:00 -0400 | [diff] [blame] | 326 | {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET(address.info.mem.write_protect), |
Bob Moore | b229cf9 | 2006-04-21 17:15:00 -0400 | [diff] [blame] | 327 | "Write Protect", acpi_gbl_rw_decode}, |
Bob Moore | 0897831 | 2005-10-21 00:00:00 -0400 | [diff] [blame] | 328 | {ACPI_RSD_2BITFLAG, ACPI_RSD_OFFSET(address.info.mem.caching), |
Bob Moore | b229cf9 | 2006-04-21 17:15:00 -0400 | [diff] [blame] | 329 | "Caching", acpi_gbl_mem_decode}, |
Bob Moore | 0897831 | 2005-10-21 00:00:00 -0400 | [diff] [blame] | 330 | {ACPI_RSD_2BITFLAG, ACPI_RSD_OFFSET(address.info.mem.range_type), |
Bob Moore | b229cf9 | 2006-04-21 17:15:00 -0400 | [diff] [blame] | 331 | "Range Type", acpi_gbl_mtp_decode}, |
Bob Moore | 0897831 | 2005-10-21 00:00:00 -0400 | [diff] [blame] | 332 | {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET(address.info.mem.translation), |
Bob Moore | b229cf9 | 2006-04-21 17:15:00 -0400 | [diff] [blame] | 333 | "Translation", acpi_gbl_ttp_decode} |
Bob Moore | 0897831 | 2005-10-21 00:00:00 -0400 | [diff] [blame] | 334 | }; |
| 335 | |
| 336 | static struct acpi_rsdump_info acpi_rs_dump_io_flags[4] = { |
| 337 | {ACPI_RSD_LITERAL, ACPI_RSD_TABLE_SIZE(acpi_rs_dump_io_flags), |
Bob Moore | 96db255 | 2005-11-02 00:00:00 -0500 | [diff] [blame] | 338 | "Resource Type", (void *)"I/O Range"}, |
Bob Moore | 0897831 | 2005-10-21 00:00:00 -0400 | [diff] [blame] | 339 | {ACPI_RSD_2BITFLAG, ACPI_RSD_OFFSET(address.info.io.range_type), |
Bob Moore | b229cf9 | 2006-04-21 17:15:00 -0400 | [diff] [blame] | 340 | "Range Type", acpi_gbl_rng_decode}, |
Bob Moore | 0897831 | 2005-10-21 00:00:00 -0400 | [diff] [blame] | 341 | {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET(address.info.io.translation), |
Bob Moore | b229cf9 | 2006-04-21 17:15:00 -0400 | [diff] [blame] | 342 | "Translation", acpi_gbl_ttp_decode}, |
Bob Moore | 0897831 | 2005-10-21 00:00:00 -0400 | [diff] [blame] | 343 | {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET(address.info.io.translation_type), |
Bob Moore | b229cf9 | 2006-04-21 17:15:00 -0400 | [diff] [blame] | 344 | "Translation Type", acpi_gbl_trs_decode} |
Bob Moore | 0897831 | 2005-10-21 00:00:00 -0400 | [diff] [blame] | 345 | }; |
| 346 | |
| 347 | /* |
| 348 | * Table used to dump _PRT contents |
| 349 | */ |
| 350 | static struct acpi_rsdump_info acpi_rs_dump_prt[5] = { |
| 351 | {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE(acpi_rs_dump_prt), NULL, NULL}, |
| 352 | {ACPI_RSD_UINT64, ACPI_PRT_OFFSET(address), "Address", NULL}, |
| 353 | {ACPI_RSD_UINT32, ACPI_PRT_OFFSET(pin), "Pin", NULL}, |
| 354 | {ACPI_RSD_STRING, ACPI_PRT_OFFSET(source[0]), "Source", NULL}, |
| 355 | {ACPI_RSD_UINT32, ACPI_PRT_OFFSET(source_index), "Source Index", NULL} |
| 356 | }; |
| 357 | |
| 358 | /******************************************************************************* |
| 359 | * |
| 360 | * FUNCTION: acpi_rs_dump_descriptor |
| 361 | * |
| 362 | * PARAMETERS: Resource |
| 363 | * |
| 364 | * RETURN: None |
| 365 | * |
| 366 | * DESCRIPTION: |
| 367 | * |
| 368 | ******************************************************************************/ |
| 369 | |
| 370 | static void |
| 371 | acpi_rs_dump_descriptor(void *resource, struct acpi_rsdump_info *table) |
| 372 | { |
Bob Moore | 96db255 | 2005-11-02 00:00:00 -0500 | [diff] [blame] | 373 | u8 *target = NULL; |
| 374 | u8 *previous_target; |
Bob Moore | 0897831 | 2005-10-21 00:00:00 -0400 | [diff] [blame] | 375 | char *name; |
| 376 | u8 count; |
| 377 | |
| 378 | /* First table entry must contain the table length (# of table entries) */ |
| 379 | |
| 380 | count = table->offset; |
| 381 | |
| 382 | while (count) { |
| 383 | previous_target = target; |
Bob Moore | c51a4de | 2005-11-17 13:07:00 -0500 | [diff] [blame] | 384 | target = ACPI_ADD_PTR(u8, resource, table->offset); |
Bob Moore | 0897831 | 2005-10-21 00:00:00 -0400 | [diff] [blame] | 385 | name = table->name; |
| 386 | |
| 387 | switch (table->opcode) { |
| 388 | case ACPI_RSD_TITLE: |
| 389 | /* |
| 390 | * Optional resource title |
| 391 | */ |
| 392 | if (table->name) { |
| 393 | acpi_os_printf("%s Resource\n", name); |
| 394 | } |
| 395 | break; |
| 396 | |
| 397 | /* Strings */ |
| 398 | |
| 399 | case ACPI_RSD_LITERAL: |
Bob Moore | 96db255 | 2005-11-02 00:00:00 -0500 | [diff] [blame] | 400 | acpi_rs_out_string(name, |
| 401 | ACPI_CAST_PTR(char, table->pointer)); |
Bob Moore | 0897831 | 2005-10-21 00:00:00 -0400 | [diff] [blame] | 402 | break; |
| 403 | |
| 404 | case ACPI_RSD_STRING: |
Bob Moore | 96db255 | 2005-11-02 00:00:00 -0500 | [diff] [blame] | 405 | acpi_rs_out_string(name, ACPI_CAST_PTR(char, target)); |
Bob Moore | 0897831 | 2005-10-21 00:00:00 -0400 | [diff] [blame] | 406 | break; |
| 407 | |
| 408 | /* Data items, 8/16/32/64 bit */ |
| 409 | |
| 410 | case ACPI_RSD_UINT8: |
Bob Moore | c51a4de | 2005-11-17 13:07:00 -0500 | [diff] [blame] | 411 | acpi_rs_out_integer8(name, ACPI_GET8(target)); |
Bob Moore | 0897831 | 2005-10-21 00:00:00 -0400 | [diff] [blame] | 412 | break; |
| 413 | |
| 414 | case ACPI_RSD_UINT16: |
Bob Moore | c51a4de | 2005-11-17 13:07:00 -0500 | [diff] [blame] | 415 | acpi_rs_out_integer16(name, ACPI_GET16(target)); |
Bob Moore | 0897831 | 2005-10-21 00:00:00 -0400 | [diff] [blame] | 416 | break; |
| 417 | |
| 418 | case ACPI_RSD_UINT32: |
Bob Moore | c51a4de | 2005-11-17 13:07:00 -0500 | [diff] [blame] | 419 | acpi_rs_out_integer32(name, ACPI_GET32(target)); |
Bob Moore | 0897831 | 2005-10-21 00:00:00 -0400 | [diff] [blame] | 420 | break; |
| 421 | |
| 422 | case ACPI_RSD_UINT64: |
Bob Moore | c51a4de | 2005-11-17 13:07:00 -0500 | [diff] [blame] | 423 | acpi_rs_out_integer64(name, ACPI_GET64(target)); |
Bob Moore | 0897831 | 2005-10-21 00:00:00 -0400 | [diff] [blame] | 424 | break; |
| 425 | |
| 426 | /* Flags: 1-bit and 2-bit flags supported */ |
| 427 | |
| 428 | case ACPI_RSD_1BITFLAG: |
Bob Moore | 96db255 | 2005-11-02 00:00:00 -0500 | [diff] [blame] | 429 | acpi_rs_out_string(name, ACPI_CAST_PTR(char, |
| 430 | table-> |
| 431 | pointer[*target & |
| 432 | 0x01])); |
Bob Moore | 0897831 | 2005-10-21 00:00:00 -0400 | [diff] [blame] | 433 | break; |
| 434 | |
| 435 | case ACPI_RSD_2BITFLAG: |
Bob Moore | 96db255 | 2005-11-02 00:00:00 -0500 | [diff] [blame] | 436 | acpi_rs_out_string(name, ACPI_CAST_PTR(char, |
| 437 | table-> |
| 438 | pointer[*target & |
| 439 | 0x03])); |
Bob Moore | 0897831 | 2005-10-21 00:00:00 -0400 | [diff] [blame] | 440 | break; |
| 441 | |
| 442 | case ACPI_RSD_SHORTLIST: |
| 443 | /* |
| 444 | * Short byte list (single line output) for DMA and IRQ resources |
| 445 | * Note: The list length is obtained from the previous table entry |
| 446 | */ |
| 447 | if (previous_target) { |
| 448 | acpi_rs_out_title(name); |
Bob Moore | 96db255 | 2005-11-02 00:00:00 -0500 | [diff] [blame] | 449 | acpi_rs_dump_short_byte_list(*previous_target, |
| 450 | target); |
Bob Moore | 0897831 | 2005-10-21 00:00:00 -0400 | [diff] [blame] | 451 | } |
| 452 | break; |
| 453 | |
| 454 | case ACPI_RSD_LONGLIST: |
| 455 | /* |
| 456 | * Long byte list for Vendor resource data |
| 457 | * Note: The list length is obtained from the previous table entry |
| 458 | */ |
| 459 | if (previous_target) { |
Bob Moore | c51a4de | 2005-11-17 13:07:00 -0500 | [diff] [blame] | 460 | acpi_rs_dump_byte_list(ACPI_GET16 |
| 461 | (previous_target), |
Bob Moore | 96db255 | 2005-11-02 00:00:00 -0500 | [diff] [blame] | 462 | target); |
Bob Moore | 0897831 | 2005-10-21 00:00:00 -0400 | [diff] [blame] | 463 | } |
| 464 | break; |
| 465 | |
| 466 | case ACPI_RSD_DWORDLIST: |
| 467 | /* |
| 468 | * Dword list for Extended Interrupt resources |
| 469 | * Note: The list length is obtained from the previous table entry |
| 470 | */ |
| 471 | if (previous_target) { |
Bob Moore | 96db255 | 2005-11-02 00:00:00 -0500 | [diff] [blame] | 472 | acpi_rs_dump_dword_list(*previous_target, |
| 473 | ACPI_CAST_PTR(u32, |
| 474 | target)); |
Bob Moore | 0897831 | 2005-10-21 00:00:00 -0400 | [diff] [blame] | 475 | } |
| 476 | break; |
| 477 | |
| 478 | case ACPI_RSD_ADDRESS: |
| 479 | /* |
| 480 | * Common flags for all Address resources |
| 481 | */ |
Bob Moore | 96db255 | 2005-11-02 00:00:00 -0500 | [diff] [blame] | 482 | acpi_rs_dump_address_common(ACPI_CAST_PTR |
| 483 | (union acpi_resource_data, |
| 484 | target)); |
Bob Moore | 0897831 | 2005-10-21 00:00:00 -0400 | [diff] [blame] | 485 | break; |
| 486 | |
| 487 | case ACPI_RSD_SOURCE: |
| 488 | /* |
| 489 | * Optional resource_source for Address resources |
| 490 | */ |
Len Brown | fd35094 | 2007-05-09 23:34:35 -0400 | [diff] [blame] | 491 | acpi_rs_dump_resource_source(ACPI_CAST_PTR(struct |
| 492 | acpi_resource_source, |
| 493 | target)); |
Bob Moore | 0897831 | 2005-10-21 00:00:00 -0400 | [diff] [blame] | 494 | break; |
| 495 | |
| 496 | default: |
| 497 | acpi_os_printf("**** Invalid table opcode [%X] ****\n", |
| 498 | table->opcode); |
| 499 | return; |
| 500 | } |
| 501 | |
| 502 | table++; |
| 503 | count--; |
| 504 | } |
| 505 | } |
| 506 | |
| 507 | /******************************************************************************* |
| 508 | * |
| 509 | * FUNCTION: acpi_rs_dump_resource_source |
| 510 | * |
| 511 | * PARAMETERS: resource_source - Pointer to a Resource Source struct |
| 512 | * |
| 513 | * RETURN: None |
| 514 | * |
| 515 | * DESCRIPTION: Common routine for dumping the optional resource_source and the |
| 516 | * corresponding resource_source_index. |
| 517 | * |
| 518 | ******************************************************************************/ |
| 519 | |
| 520 | static void |
| 521 | acpi_rs_dump_resource_source(struct acpi_resource_source *resource_source) |
| 522 | { |
| 523 | ACPI_FUNCTION_ENTRY(); |
| 524 | |
| 525 | if (resource_source->index == 0xFF) { |
| 526 | return; |
| 527 | } |
| 528 | |
| 529 | acpi_rs_out_integer8("Resource Source Index", resource_source->index); |
| 530 | |
| 531 | acpi_rs_out_string("Resource Source", |
| 532 | resource_source->string_ptr ? |
| 533 | resource_source->string_ptr : "[Not Specified]"); |
| 534 | } |
| 535 | |
| 536 | /******************************************************************************* |
| 537 | * |
| 538 | * FUNCTION: acpi_rs_dump_address_common |
| 539 | * |
| 540 | * PARAMETERS: Resource - Pointer to an internal resource descriptor |
| 541 | * |
| 542 | * RETURN: None |
| 543 | * |
| 544 | * DESCRIPTION: Dump the fields that are common to all Address resource |
| 545 | * descriptors |
| 546 | * |
| 547 | ******************************************************************************/ |
| 548 | |
| 549 | static void acpi_rs_dump_address_common(union acpi_resource_data *resource) |
| 550 | { |
| 551 | ACPI_FUNCTION_ENTRY(); |
| 552 | |
| 553 | /* Decode the type-specific flags */ |
| 554 | |
| 555 | switch (resource->address.resource_type) { |
| 556 | case ACPI_MEMORY_RANGE: |
| 557 | |
| 558 | acpi_rs_dump_descriptor(resource, acpi_rs_dump_memory_flags); |
| 559 | break; |
| 560 | |
| 561 | case ACPI_IO_RANGE: |
| 562 | |
| 563 | acpi_rs_dump_descriptor(resource, acpi_rs_dump_io_flags); |
| 564 | break; |
| 565 | |
| 566 | case ACPI_BUS_NUMBER_RANGE: |
| 567 | |
| 568 | acpi_rs_out_string("Resource Type", "Bus Number Range"); |
| 569 | break; |
| 570 | |
| 571 | default: |
| 572 | |
| 573 | acpi_rs_out_integer8("Resource Type", |
| 574 | (u8) resource->address.resource_type); |
| 575 | break; |
| 576 | } |
| 577 | |
| 578 | /* Decode the general flags */ |
| 579 | |
| 580 | acpi_rs_dump_descriptor(resource, acpi_rs_dump_general_flags); |
| 581 | } |
| 582 | |
| 583 | /******************************************************************************* |
| 584 | * |
| 585 | * FUNCTION: acpi_rs_dump_resource_list |
| 586 | * |
| 587 | * PARAMETERS: resource_list - Pointer to a resource descriptor list |
| 588 | * |
| 589 | * RETURN: None |
| 590 | * |
| 591 | * DESCRIPTION: Dispatches the structure to the correct dump routine. |
| 592 | * |
| 593 | ******************************************************************************/ |
| 594 | |
| 595 | void acpi_rs_dump_resource_list(struct acpi_resource *resource_list) |
| 596 | { |
| 597 | u32 count = 0; |
| 598 | u32 type; |
| 599 | |
| 600 | ACPI_FUNCTION_ENTRY(); |
| 601 | |
| 602 | if (!(acpi_dbg_level & ACPI_LV_RESOURCES) |
| 603 | || !(_COMPONENT & acpi_dbg_layer)) { |
| 604 | return; |
| 605 | } |
| 606 | |
| 607 | /* Walk list and dump all resource descriptors (END_TAG terminates) */ |
| 608 | |
| 609 | do { |
| 610 | acpi_os_printf("\n[%02X] ", count); |
| 611 | count++; |
| 612 | |
| 613 | /* Validate Type before dispatch */ |
| 614 | |
| 615 | type = resource_list->type; |
| 616 | if (type > ACPI_RESOURCE_TYPE_MAX) { |
| 617 | acpi_os_printf |
| 618 | ("Invalid descriptor type (%X) in resource list\n", |
| 619 | resource_list->type); |
| 620 | return; |
| 621 | } |
| 622 | |
| 623 | /* Dump the resource descriptor */ |
| 624 | |
| 625 | acpi_rs_dump_descriptor(&resource_list->data, |
| 626 | acpi_gbl_dump_resource_dispatch[type]); |
| 627 | |
| 628 | /* Point to the next resource structure */ |
| 629 | |
| 630 | resource_list = |
Bob Moore | c51a4de | 2005-11-17 13:07:00 -0500 | [diff] [blame] | 631 | ACPI_ADD_PTR(struct acpi_resource, resource_list, |
Bob Moore | 0897831 | 2005-10-21 00:00:00 -0400 | [diff] [blame] | 632 | resource_list->length); |
| 633 | |
| 634 | /* Exit when END_TAG descriptor is reached */ |
| 635 | |
| 636 | } while (type != ACPI_RESOURCE_TYPE_END_TAG); |
| 637 | } |
| 638 | |
| 639 | /******************************************************************************* |
| 640 | * |
| 641 | * FUNCTION: acpi_rs_dump_irq_list |
| 642 | * |
| 643 | * PARAMETERS: route_table - Pointer to the routing table to dump. |
| 644 | * |
| 645 | * RETURN: None |
| 646 | * |
| 647 | * DESCRIPTION: Print IRQ routing table |
| 648 | * |
| 649 | ******************************************************************************/ |
| 650 | |
| 651 | void acpi_rs_dump_irq_list(u8 * route_table) |
| 652 | { |
| 653 | struct acpi_pci_routing_table *prt_element; |
| 654 | u8 count; |
| 655 | |
| 656 | ACPI_FUNCTION_ENTRY(); |
| 657 | |
| 658 | if (!(acpi_dbg_level & ACPI_LV_RESOURCES) |
| 659 | || !(_COMPONENT & acpi_dbg_layer)) { |
| 660 | return; |
| 661 | } |
| 662 | |
| 663 | prt_element = ACPI_CAST_PTR(struct acpi_pci_routing_table, route_table); |
| 664 | |
| 665 | /* Dump all table elements, Exit on zero length element */ |
| 666 | |
| 667 | for (count = 0; prt_element->length; count++) { |
| 668 | acpi_os_printf("\n[%02X] PCI IRQ Routing Table Package\n", |
| 669 | count); |
| 670 | acpi_rs_dump_descriptor(prt_element, acpi_rs_dump_prt); |
| 671 | |
Bob Moore | c51a4de | 2005-11-17 13:07:00 -0500 | [diff] [blame] | 672 | prt_element = ACPI_ADD_PTR(struct acpi_pci_routing_table, |
| 673 | prt_element, prt_element->length); |
Bob Moore | 0897831 | 2005-10-21 00:00:00 -0400 | [diff] [blame] | 674 | } |
| 675 | } |
| 676 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 677 | /******************************************************************************* |
| 678 | * |
Robert Moore | bda663d | 2005-09-16 16:51:15 -0400 | [diff] [blame] | 679 | * FUNCTION: acpi_rs_out* |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 680 | * |
Robert Moore | bda663d | 2005-09-16 16:51:15 -0400 | [diff] [blame] | 681 | * PARAMETERS: Title - Name of the resource field |
| 682 | * Value - Value of the resource field |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 683 | * |
| 684 | * RETURN: None |
| 685 | * |
Robert Moore | bda663d | 2005-09-16 16:51:15 -0400 | [diff] [blame] | 686 | * DESCRIPTION: Miscellaneous helper functions to consistently format the |
| 687 | * output of the resource dump routines |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 688 | * |
| 689 | ******************************************************************************/ |
| 690 | |
Robert Moore | bda663d | 2005-09-16 16:51:15 -0400 | [diff] [blame] | 691 | static void acpi_rs_out_string(char *title, char *value) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 692 | { |
Bob Moore | b8e4d89 | 2006-01-27 16:43:00 -0500 | [diff] [blame] | 693 | acpi_os_printf("%27s : %s", title, value); |
| 694 | if (!*value) { |
| 695 | acpi_os_printf("[NULL NAMESTRING]"); |
| 696 | } |
| 697 | acpi_os_printf("\n"); |
Robert Moore | bda663d | 2005-09-16 16:51:15 -0400 | [diff] [blame] | 698 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 699 | |
Robert Moore | bda663d | 2005-09-16 16:51:15 -0400 | [diff] [blame] | 700 | static void acpi_rs_out_integer8(char *title, u8 value) |
| 701 | { |
Bob Moore | 50eca3e | 2005-09-30 19:03:00 -0400 | [diff] [blame] | 702 | acpi_os_printf("%27s : %2.2X\n", title, value); |
Robert Moore | bda663d | 2005-09-16 16:51:15 -0400 | [diff] [blame] | 703 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 704 | |
Robert Moore | bda663d | 2005-09-16 16:51:15 -0400 | [diff] [blame] | 705 | static void acpi_rs_out_integer16(char *title, u16 value) |
| 706 | { |
Bob Moore | 50eca3e | 2005-09-30 19:03:00 -0400 | [diff] [blame] | 707 | acpi_os_printf("%27s : %4.4X\n", title, value); |
Robert Moore | bda663d | 2005-09-16 16:51:15 -0400 | [diff] [blame] | 708 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 709 | |
Robert Moore | bda663d | 2005-09-16 16:51:15 -0400 | [diff] [blame] | 710 | static void acpi_rs_out_integer32(char *title, u32 value) |
| 711 | { |
Bob Moore | 50eca3e | 2005-09-30 19:03:00 -0400 | [diff] [blame] | 712 | acpi_os_printf("%27s : %8.8X\n", title, value); |
Robert Moore | bda663d | 2005-09-16 16:51:15 -0400 | [diff] [blame] | 713 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 714 | |
Robert Moore | bda663d | 2005-09-16 16:51:15 -0400 | [diff] [blame] | 715 | static void acpi_rs_out_integer64(char *title, u64 value) |
| 716 | { |
Bob Moore | 50eca3e | 2005-09-30 19:03:00 -0400 | [diff] [blame] | 717 | acpi_os_printf("%27s : %8.8X%8.8X\n", title, ACPI_FORMAT_UINT64(value)); |
Robert Moore | bda663d | 2005-09-16 16:51:15 -0400 | [diff] [blame] | 718 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 719 | |
Robert Moore | bda663d | 2005-09-16 16:51:15 -0400 | [diff] [blame] | 720 | static void acpi_rs_out_title(char *title) |
| 721 | { |
Bob Moore | 50eca3e | 2005-09-30 19:03:00 -0400 | [diff] [blame] | 722 | acpi_os_printf("%27s : ", title); |
Robert Moore | bda663d | 2005-09-16 16:51:15 -0400 | [diff] [blame] | 723 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 724 | |
Robert Moore | bda663d | 2005-09-16 16:51:15 -0400 | [diff] [blame] | 725 | /******************************************************************************* |
| 726 | * |
| 727 | * FUNCTION: acpi_rs_dump*List |
| 728 | * |
| 729 | * PARAMETERS: Length - Number of elements in the list |
| 730 | * Data - Start of the list |
| 731 | * |
| 732 | * RETURN: None |
| 733 | * |
| 734 | * DESCRIPTION: Miscellaneous functions to dump lists of raw data |
| 735 | * |
| 736 | ******************************************************************************/ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 737 | |
Bob Moore | 0897831 | 2005-10-21 00:00:00 -0400 | [diff] [blame] | 738 | static void acpi_rs_dump_byte_list(u16 length, u8 * data) |
Robert Moore | bda663d | 2005-09-16 16:51:15 -0400 | [diff] [blame] | 739 | { |
Bob Moore | 0897831 | 2005-10-21 00:00:00 -0400 | [diff] [blame] | 740 | u8 i; |
Robert Moore | bda663d | 2005-09-16 16:51:15 -0400 | [diff] [blame] | 741 | |
| 742 | for (i = 0; i < length; i++) { |
Bob Moore | 50eca3e | 2005-09-30 19:03:00 -0400 | [diff] [blame] | 743 | acpi_os_printf("%25s%2.2X : %2.2X\n", "Byte", i, data[i]); |
Robert Moore | bda663d | 2005-09-16 16:51:15 -0400 | [diff] [blame] | 744 | } |
| 745 | } |
| 746 | |
Bob Moore | 0897831 | 2005-10-21 00:00:00 -0400 | [diff] [blame] | 747 | static void acpi_rs_dump_short_byte_list(u8 length, u8 * data) |
Robert Moore | bda663d | 2005-09-16 16:51:15 -0400 | [diff] [blame] | 748 | { |
Bob Moore | 0897831 | 2005-10-21 00:00:00 -0400 | [diff] [blame] | 749 | u8 i; |
Robert Moore | bda663d | 2005-09-16 16:51:15 -0400 | [diff] [blame] | 750 | |
| 751 | for (i = 0; i < length; i++) { |
| 752 | acpi_os_printf("%X ", data[i]); |
| 753 | } |
| 754 | acpi_os_printf("\n"); |
| 755 | } |
| 756 | |
Bob Moore | 0897831 | 2005-10-21 00:00:00 -0400 | [diff] [blame] | 757 | static void acpi_rs_dump_dword_list(u8 length, u32 * data) |
Bob Moore | 50eca3e | 2005-09-30 19:03:00 -0400 | [diff] [blame] | 758 | { |
Bob Moore | 0897831 | 2005-10-21 00:00:00 -0400 | [diff] [blame] | 759 | u8 i; |
Bob Moore | 50eca3e | 2005-09-30 19:03:00 -0400 | [diff] [blame] | 760 | |
Bob Moore | 0897831 | 2005-10-21 00:00:00 -0400 | [diff] [blame] | 761 | for (i = 0; i < length; i++) { |
| 762 | acpi_os_printf("%25s%2.2X : %8.8X\n", "Dword", i, data[i]); |
Robert Moore | bda663d | 2005-09-16 16:51:15 -0400 | [diff] [blame] | 763 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 764 | } |
| 765 | |
| 766 | #endif |