rsdump.c 29 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168
  1. /*******************************************************************************
  2. *
  3. * Module Name: rsdump - Functions to display the resource structures.
  4. *
  5. ******************************************************************************/
  6. /*
  7. * Copyright (C) 2000 - 2005, R. Byron Moore
  8. * All rights reserved.
  9. *
  10. * Redistribution and use in source and binary forms, with or without
  11. * modification, are permitted provided that the following conditions
  12. * are met:
  13. * 1. Redistributions of source code must retain the above copyright
  14. * notice, this list of conditions, and the following disclaimer,
  15. * without modification.
  16. * 2. Redistributions in binary form must reproduce at minimum a disclaimer
  17. * substantially similar to the "NO WARRANTY" disclaimer below
  18. * ("Disclaimer") and any redistribution must be conditioned upon
  19. * including a substantially similar Disclaimer requirement for further
  20. * binary redistribution.
  21. * 3. Neither the names of the above-listed copyright holders nor the names
  22. * of any contributors may be used to endorse or promote products derived
  23. * from this software without specific prior written permission.
  24. *
  25. * Alternatively, this software may be distributed under the terms of the
  26. * GNU General Public License ("GPL") version 2 as published by the Free
  27. * Software Foundation.
  28. *
  29. * NO WARRANTY
  30. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  31. * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  32. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
  33. * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  34. * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  35. * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  36. * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  37. * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
  38. * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
  39. * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  40. * POSSIBILITY OF SUCH DAMAGES.
  41. */
  42. #include <acpi/acpi.h>
  43. #include <acpi/acresrc.h>
  44. #define _COMPONENT ACPI_RESOURCES
  45. ACPI_MODULE_NAME ("rsdump")
  46. /* Local prototypes */
  47. static void
  48. acpi_rs_dump_irq (
  49. union acpi_resource_data *data);
  50. static void
  51. acpi_rs_dump_address16 (
  52. union acpi_resource_data *data);
  53. static void
  54. acpi_rs_dump_address32 (
  55. union acpi_resource_data *data);
  56. static void
  57. acpi_rs_dump_address64 (
  58. union acpi_resource_data *data);
  59. static void
  60. acpi_rs_dump_dma (
  61. union acpi_resource_data *data);
  62. static void
  63. acpi_rs_dump_io (
  64. union acpi_resource_data *data);
  65. static void
  66. acpi_rs_dump_extended_irq (
  67. union acpi_resource_data *data);
  68. static void
  69. acpi_rs_dump_fixed_io (
  70. union acpi_resource_data *data);
  71. static void
  72. acpi_rs_dump_fixed_memory32 (
  73. union acpi_resource_data *data);
  74. static void
  75. acpi_rs_dump_memory24 (
  76. union acpi_resource_data *data);
  77. static void
  78. acpi_rs_dump_memory32 (
  79. union acpi_resource_data *data);
  80. static void
  81. acpi_rs_dump_start_depend_fns (
  82. union acpi_resource_data *data);
  83. static void
  84. acpi_rs_dump_vendor_specific (
  85. union acpi_resource_data *data);
  86. #if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER)
  87. /*******************************************************************************
  88. *
  89. * FUNCTION: acpi_rs_dump_irq
  90. *
  91. * PARAMETERS: Data - pointer to the resource structure to dump.
  92. *
  93. * RETURN: None
  94. *
  95. * DESCRIPTION: Prints out the various members of the Data structure type.
  96. *
  97. ******************************************************************************/
  98. static void
  99. acpi_rs_dump_irq (
  100. union acpi_resource_data *data)
  101. {
  102. struct acpi_resource_irq *irq_data = (struct acpi_resource_irq *) data;
  103. u8 index = 0;
  104. ACPI_FUNCTION_ENTRY ();
  105. acpi_os_printf ("IRQ Resource\n");
  106. acpi_os_printf (" %s Triggered\n",
  107. ACPI_LEVEL_SENSITIVE == irq_data->edge_level ? "Level" : "Edge");
  108. acpi_os_printf (" Active %s\n",
  109. ACPI_ACTIVE_LOW == irq_data->active_high_low ? "Low" : "High");
  110. acpi_os_printf (" %s\n",
  111. ACPI_SHARED == irq_data->shared_exclusive ? "Shared" : "Exclusive");
  112. acpi_os_printf (" %X Interrupts ( ", irq_data->number_of_interrupts);
  113. for (index = 0; index < irq_data->number_of_interrupts; index++) {
  114. acpi_os_printf ("%X ", irq_data->interrupts[index]);
  115. }
  116. acpi_os_printf (")\n");
  117. return;
  118. }
  119. /*******************************************************************************
  120. *
  121. * FUNCTION: acpi_rs_dump_dma
  122. *
  123. * PARAMETERS: Data - pointer to the resource structure to dump.
  124. *
  125. * RETURN: None
  126. *
  127. * DESCRIPTION: Prints out the various members of the Data structure type.
  128. *
  129. ******************************************************************************/
  130. static void
  131. acpi_rs_dump_dma (
  132. union acpi_resource_data *data)
  133. {
  134. struct acpi_resource_dma *dma_data = (struct acpi_resource_dma *) data;
  135. u8 index = 0;
  136. ACPI_FUNCTION_ENTRY ();
  137. acpi_os_printf ("DMA Resource\n");
  138. switch (dma_data->type) {
  139. case ACPI_COMPATIBILITY:
  140. acpi_os_printf (" Compatibility mode\n");
  141. break;
  142. case ACPI_TYPE_A:
  143. acpi_os_printf (" Type A\n");
  144. break;
  145. case ACPI_TYPE_B:
  146. acpi_os_printf (" Type B\n");
  147. break;
  148. case ACPI_TYPE_F:
  149. acpi_os_printf (" Type F\n");
  150. break;
  151. default:
  152. acpi_os_printf (" Invalid DMA type\n");
  153. break;
  154. }
  155. acpi_os_printf (" %sBus Master\n",
  156. ACPI_BUS_MASTER == dma_data->bus_master ? "" : "Not a ");
  157. switch (dma_data->transfer) {
  158. case ACPI_TRANSFER_8:
  159. acpi_os_printf (" 8-bit only transfer\n");
  160. break;
  161. case ACPI_TRANSFER_8_16:
  162. acpi_os_printf (" 8 and 16-bit transfer\n");
  163. break;
  164. case ACPI_TRANSFER_16:
  165. acpi_os_printf (" 16 bit only transfer\n");
  166. break;
  167. default:
  168. acpi_os_printf (" Invalid transfer preference\n");
  169. break;
  170. }
  171. acpi_os_printf (" Number of Channels: %X ( ",
  172. dma_data->number_of_channels);
  173. for (index = 0; index < dma_data->number_of_channels; index++) {
  174. acpi_os_printf ("%X ", dma_data->channels[index]);
  175. }
  176. acpi_os_printf (")\n");
  177. return;
  178. }
  179. /*******************************************************************************
  180. *
  181. * FUNCTION: acpi_rs_dump_start_depend_fns
  182. *
  183. * PARAMETERS: Data - pointer to the resource structure to dump.
  184. *
  185. * RETURN: None
  186. *
  187. * DESCRIPTION: Prints out the various members of the Data structure type.
  188. *
  189. ******************************************************************************/
  190. static void
  191. acpi_rs_dump_start_depend_fns (
  192. union acpi_resource_data *data)
  193. {
  194. struct acpi_resource_start_dpf *sdf_data = (struct acpi_resource_start_dpf *) data;
  195. ACPI_FUNCTION_ENTRY ();
  196. acpi_os_printf ("Start Dependent Functions Resource\n");
  197. switch (sdf_data->compatibility_priority) {
  198. case ACPI_GOOD_CONFIGURATION:
  199. acpi_os_printf (" Good configuration\n");
  200. break;
  201. case ACPI_ACCEPTABLE_CONFIGURATION:
  202. acpi_os_printf (" Acceptable configuration\n");
  203. break;
  204. case ACPI_SUB_OPTIMAL_CONFIGURATION:
  205. acpi_os_printf (" Sub-optimal configuration\n");
  206. break;
  207. default:
  208. acpi_os_printf (" Invalid compatibility priority\n");
  209. break;
  210. }
  211. switch(sdf_data->performance_robustness) {
  212. case ACPI_GOOD_CONFIGURATION:
  213. acpi_os_printf (" Good configuration\n");
  214. break;
  215. case ACPI_ACCEPTABLE_CONFIGURATION:
  216. acpi_os_printf (" Acceptable configuration\n");
  217. break;
  218. case ACPI_SUB_OPTIMAL_CONFIGURATION:
  219. acpi_os_printf (" Sub-optimal configuration\n");
  220. break;
  221. default:
  222. acpi_os_printf (" Invalid performance robustness preference\n");
  223. break;
  224. }
  225. return;
  226. }
  227. /*******************************************************************************
  228. *
  229. * FUNCTION: acpi_rs_dump_io
  230. *
  231. * PARAMETERS: Data - pointer to the resource structure to dump.
  232. *
  233. * RETURN: None
  234. *
  235. * DESCRIPTION: Prints out the various members of the Data structure type.
  236. *
  237. ******************************************************************************/
  238. static void
  239. acpi_rs_dump_io (
  240. union acpi_resource_data *data)
  241. {
  242. struct acpi_resource_io *io_data = (struct acpi_resource_io *) data;
  243. ACPI_FUNCTION_ENTRY ();
  244. acpi_os_printf ("Io Resource\n");
  245. acpi_os_printf (" %d bit decode\n",
  246. ACPI_DECODE_16 == io_data->io_decode ? 16 : 10);
  247. acpi_os_printf (" Range minimum base: %08X\n", io_data->min_base_address);
  248. acpi_os_printf (" Range maximum base: %08X\n", io_data->max_base_address);
  249. acpi_os_printf (" Alignment: %08X\n", io_data->alignment);
  250. acpi_os_printf (" Range Length: %08X\n", io_data->range_length);
  251. return;
  252. }
  253. /*******************************************************************************
  254. *
  255. * FUNCTION: acpi_rs_dump_fixed_io
  256. *
  257. * PARAMETERS: Data - pointer to the resource structure to dump.
  258. *
  259. * RETURN: None
  260. *
  261. * DESCRIPTION: Prints out the various members of the Data structure type.
  262. *
  263. ******************************************************************************/
  264. static void
  265. acpi_rs_dump_fixed_io (
  266. union acpi_resource_data *data)
  267. {
  268. struct acpi_resource_fixed_io *fixed_io_data = (struct acpi_resource_fixed_io *) data;
  269. ACPI_FUNCTION_ENTRY ();
  270. acpi_os_printf ("Fixed Io Resource\n");
  271. acpi_os_printf (" Range base address: %08X", fixed_io_data->base_address);
  272. acpi_os_printf (" Range length: %08X", fixed_io_data->range_length);
  273. return;
  274. }
  275. /*******************************************************************************
  276. *
  277. * FUNCTION: acpi_rs_dump_vendor_specific
  278. *
  279. * PARAMETERS: Data - pointer to the resource structure to dump.
  280. *
  281. * RETURN: None
  282. *
  283. * DESCRIPTION: Prints out the various members of the Data structure type.
  284. *
  285. ******************************************************************************/
  286. static void
  287. acpi_rs_dump_vendor_specific (
  288. union acpi_resource_data *data)
  289. {
  290. struct acpi_resource_vendor *vendor_data = (struct acpi_resource_vendor *) data;
  291. u16 index = 0;
  292. ACPI_FUNCTION_ENTRY ();
  293. acpi_os_printf ("Vendor Specific Resource\n");
  294. acpi_os_printf (" Length: %08X\n", vendor_data->length);
  295. for (index = 0; index < vendor_data->length; index++) {
  296. acpi_os_printf (" Byte %X: %08X\n",
  297. index, vendor_data->reserved[index]);
  298. }
  299. return;
  300. }
  301. /*******************************************************************************
  302. *
  303. * FUNCTION: acpi_rs_dump_memory24
  304. *
  305. * PARAMETERS: Data - pointer to the resource structure to dump.
  306. *
  307. * RETURN: None
  308. *
  309. * DESCRIPTION: Prints out the various members of the Data structure type.
  310. *
  311. ******************************************************************************/
  312. static void
  313. acpi_rs_dump_memory24 (
  314. union acpi_resource_data *data)
  315. {
  316. struct acpi_resource_mem24 *memory24_data = (struct acpi_resource_mem24 *) data;
  317. ACPI_FUNCTION_ENTRY ();
  318. acpi_os_printf ("24-Bit Memory Range Resource\n");
  319. acpi_os_printf (" Read%s\n",
  320. ACPI_READ_WRITE_MEMORY ==
  321. memory24_data->read_write_attribute ?
  322. "/Write" : " only");
  323. acpi_os_printf (" Range minimum base: %08X\n",
  324. memory24_data->min_base_address);
  325. acpi_os_printf (" Range maximum base: %08X\n",
  326. memory24_data->max_base_address);
  327. acpi_os_printf (" Alignment: %08X\n", memory24_data->alignment);
  328. acpi_os_printf (" Range length: %08X\n", memory24_data->range_length);
  329. return;
  330. }
  331. /*******************************************************************************
  332. *
  333. * FUNCTION: acpi_rs_dump_memory32
  334. *
  335. * PARAMETERS: Data - pointer to the resource structure to dump.
  336. *
  337. * RETURN: None
  338. *
  339. * DESCRIPTION: Prints out the various members of the Data structure type.
  340. *
  341. ******************************************************************************/
  342. static void
  343. acpi_rs_dump_memory32 (
  344. union acpi_resource_data *data)
  345. {
  346. struct acpi_resource_mem32 *memory32_data = (struct acpi_resource_mem32 *) data;
  347. ACPI_FUNCTION_ENTRY ();
  348. acpi_os_printf ("32-Bit Memory Range Resource\n");
  349. acpi_os_printf (" Read%s\n",
  350. ACPI_READ_WRITE_MEMORY ==
  351. memory32_data->read_write_attribute ?
  352. "/Write" : " only");
  353. acpi_os_printf (" Range minimum base: %08X\n",
  354. memory32_data->min_base_address);
  355. acpi_os_printf (" Range maximum base: %08X\n",
  356. memory32_data->max_base_address);
  357. acpi_os_printf (" Alignment: %08X\n", memory32_data->alignment);
  358. acpi_os_printf (" Range length: %08X\n", memory32_data->range_length);
  359. return;
  360. }
  361. /*******************************************************************************
  362. *
  363. * FUNCTION: acpi_rs_dump_fixed_memory32
  364. *
  365. * PARAMETERS: Data - pointer to the resource structure to dump.
  366. *
  367. * RETURN:
  368. *
  369. * DESCRIPTION: Prints out the various members of the Data structure type.
  370. *
  371. ******************************************************************************/
  372. static void
  373. acpi_rs_dump_fixed_memory32 (
  374. union acpi_resource_data *data)
  375. {
  376. struct acpi_resource_fixed_mem32 *fixed_memory32_data =
  377. (struct acpi_resource_fixed_mem32 *) data;
  378. ACPI_FUNCTION_ENTRY ();
  379. acpi_os_printf ("32-Bit Fixed Location Memory Range Resource\n");
  380. acpi_os_printf (" Read%s\n",
  381. ACPI_READ_WRITE_MEMORY ==
  382. fixed_memory32_data->read_write_attribute ? "/Write" : " Only");
  383. acpi_os_printf (" Range base address: %08X\n",
  384. fixed_memory32_data->range_base_address);
  385. acpi_os_printf (" Range length: %08X\n",
  386. fixed_memory32_data->range_length);
  387. return;
  388. }
  389. /*******************************************************************************
  390. *
  391. * FUNCTION: acpi_rs_dump_address16
  392. *
  393. * PARAMETERS: Data - pointer to the resource structure to dump.
  394. *
  395. * RETURN: None
  396. *
  397. * DESCRIPTION: Prints out the various members of the Data structure type.
  398. *
  399. ******************************************************************************/
  400. static void
  401. acpi_rs_dump_address16 (
  402. union acpi_resource_data *data)
  403. {
  404. struct acpi_resource_address16 *address16_data = (struct acpi_resource_address16 *) data;
  405. ACPI_FUNCTION_ENTRY ();
  406. acpi_os_printf ("16-Bit Address Space Resource\n");
  407. acpi_os_printf (" Resource Type: ");
  408. switch (address16_data->resource_type) {
  409. case ACPI_MEMORY_RANGE:
  410. acpi_os_printf ("Memory Range\n");
  411. switch (address16_data->attribute.memory.cache_attribute) {
  412. case ACPI_NON_CACHEABLE_MEMORY:
  413. acpi_os_printf (" Type Specific: Noncacheable memory\n");
  414. break;
  415. case ACPI_CACHABLE_MEMORY:
  416. acpi_os_printf (" Type Specific: Cacheable memory\n");
  417. break;
  418. case ACPI_WRITE_COMBINING_MEMORY:
  419. acpi_os_printf (" Type Specific: Write-combining memory\n");
  420. break;
  421. case ACPI_PREFETCHABLE_MEMORY:
  422. acpi_os_printf (" Type Specific: Prefetchable memory\n");
  423. break;
  424. default:
  425. acpi_os_printf (" Type Specific: Invalid cache attribute\n");
  426. break;
  427. }
  428. acpi_os_printf (" Type Specific: Read%s\n",
  429. ACPI_READ_WRITE_MEMORY ==
  430. address16_data->attribute.memory.read_write_attribute ?
  431. "/Write" : " Only");
  432. break;
  433. case ACPI_IO_RANGE:
  434. acpi_os_printf ("I/O Range\n");
  435. switch (address16_data->attribute.io.range_attribute) {
  436. case ACPI_NON_ISA_ONLY_RANGES:
  437. acpi_os_printf (" Type Specific: Non-ISA Io Addresses\n");
  438. break;
  439. case ACPI_ISA_ONLY_RANGES:
  440. acpi_os_printf (" Type Specific: ISA Io Addresses\n");
  441. break;
  442. case ACPI_ENTIRE_RANGE:
  443. acpi_os_printf (" Type Specific: ISA and non-ISA Io Addresses\n");
  444. break;
  445. default:
  446. acpi_os_printf (" Type Specific: Invalid range attribute\n");
  447. break;
  448. }
  449. acpi_os_printf (" Type Specific: %s Translation\n",
  450. ACPI_SPARSE_TRANSLATION ==
  451. address16_data->attribute.io.translation_attribute ?
  452. "Sparse" : "Dense");
  453. break;
  454. case ACPI_BUS_NUMBER_RANGE:
  455. acpi_os_printf ("Bus Number Range\n");
  456. break;
  457. default:
  458. acpi_os_printf ("0x%2.2X\n", address16_data->resource_type);
  459. break;
  460. }
  461. acpi_os_printf (" Resource %s\n",
  462. ACPI_CONSUMER == address16_data->producer_consumer ?
  463. "Consumer" : "Producer");
  464. acpi_os_printf (" %s decode\n",
  465. ACPI_SUB_DECODE == address16_data->decode ?
  466. "Subtractive" : "Positive");
  467. acpi_os_printf (" Min address is %s fixed\n",
  468. ACPI_ADDRESS_FIXED == address16_data->min_address_fixed ?
  469. "" : "not");
  470. acpi_os_printf (" Max address is %s fixed\n",
  471. ACPI_ADDRESS_FIXED == address16_data->max_address_fixed ?
  472. "" : "not");
  473. acpi_os_printf (" Granularity: %08X\n",
  474. address16_data->granularity);
  475. acpi_os_printf (" Address range min: %08X\n",
  476. address16_data->min_address_range);
  477. acpi_os_printf (" Address range max: %08X\n",
  478. address16_data->max_address_range);
  479. acpi_os_printf (" Address translation offset: %08X\n",
  480. address16_data->address_translation_offset);
  481. acpi_os_printf (" Address Length: %08X\n",
  482. address16_data->address_length);
  483. if (0xFF != address16_data->resource_source.index) {
  484. acpi_os_printf (" Resource Source Index: %X\n",
  485. address16_data->resource_source.index);
  486. acpi_os_printf (" Resource Source: %s\n",
  487. address16_data->resource_source.string_ptr);
  488. }
  489. return;
  490. }
  491. /*******************************************************************************
  492. *
  493. * FUNCTION: acpi_rs_dump_address32
  494. *
  495. * PARAMETERS: Data - pointer to the resource structure to dump.
  496. *
  497. * RETURN: None
  498. *
  499. * DESCRIPTION: Prints out the various members of the Data structure type.
  500. *
  501. ******************************************************************************/
  502. static void
  503. acpi_rs_dump_address32 (
  504. union acpi_resource_data *data)
  505. {
  506. struct acpi_resource_address32 *address32_data = (struct acpi_resource_address32 *) data;
  507. ACPI_FUNCTION_ENTRY ();
  508. acpi_os_printf ("32-Bit Address Space Resource\n");
  509. switch (address32_data->resource_type) {
  510. case ACPI_MEMORY_RANGE:
  511. acpi_os_printf (" Resource Type: Memory Range\n");
  512. switch (address32_data->attribute.memory.cache_attribute) {
  513. case ACPI_NON_CACHEABLE_MEMORY:
  514. acpi_os_printf (" Type Specific: Noncacheable memory\n");
  515. break;
  516. case ACPI_CACHABLE_MEMORY:
  517. acpi_os_printf (" Type Specific: Cacheable memory\n");
  518. break;
  519. case ACPI_WRITE_COMBINING_MEMORY:
  520. acpi_os_printf (" Type Specific: Write-combining memory\n");
  521. break;
  522. case ACPI_PREFETCHABLE_MEMORY:
  523. acpi_os_printf (" Type Specific: Prefetchable memory\n");
  524. break;
  525. default:
  526. acpi_os_printf (" Type Specific: Invalid cache attribute\n");
  527. break;
  528. }
  529. acpi_os_printf (" Type Specific: Read%s\n",
  530. ACPI_READ_WRITE_MEMORY ==
  531. address32_data->attribute.memory.read_write_attribute ?
  532. "/Write" : " Only");
  533. break;
  534. case ACPI_IO_RANGE:
  535. acpi_os_printf (" Resource Type: Io Range\n");
  536. switch (address32_data->attribute.io.range_attribute) {
  537. case ACPI_NON_ISA_ONLY_RANGES:
  538. acpi_os_printf (" Type Specific: Non-ISA Io Addresses\n");
  539. break;
  540. case ACPI_ISA_ONLY_RANGES:
  541. acpi_os_printf (" Type Specific: ISA Io Addresses\n");
  542. break;
  543. case ACPI_ENTIRE_RANGE:
  544. acpi_os_printf (" Type Specific: ISA and non-ISA Io Addresses\n");
  545. break;
  546. default:
  547. acpi_os_printf (" Type Specific: Invalid Range attribute");
  548. break;
  549. }
  550. acpi_os_printf (" Type Specific: %s Translation\n",
  551. ACPI_SPARSE_TRANSLATION ==
  552. address32_data->attribute.io.translation_attribute ?
  553. "Sparse" : "Dense");
  554. break;
  555. case ACPI_BUS_NUMBER_RANGE:
  556. acpi_os_printf (" Resource Type: Bus Number Range\n");
  557. break;
  558. default:
  559. acpi_os_printf (" Resource Type: 0x%2.2X\n",
  560. address32_data->resource_type);
  561. break;
  562. }
  563. acpi_os_printf (" Resource %s\n",
  564. ACPI_CONSUMER == address32_data->producer_consumer ?
  565. "Consumer" : "Producer");
  566. acpi_os_printf (" %s decode\n",
  567. ACPI_SUB_DECODE == address32_data->decode ?
  568. "Subtractive" : "Positive");
  569. acpi_os_printf (" Min address is %s fixed\n",
  570. ACPI_ADDRESS_FIXED == address32_data->min_address_fixed ?
  571. "" : "not ");
  572. acpi_os_printf (" Max address is %s fixed\n",
  573. ACPI_ADDRESS_FIXED == address32_data->max_address_fixed ?
  574. "" : "not ");
  575. acpi_os_printf (" Granularity: %08X\n",
  576. address32_data->granularity);
  577. acpi_os_printf (" Address range min: %08X\n",
  578. address32_data->min_address_range);
  579. acpi_os_printf (" Address range max: %08X\n",
  580. address32_data->max_address_range);
  581. acpi_os_printf (" Address translation offset: %08X\n",
  582. address32_data->address_translation_offset);
  583. acpi_os_printf (" Address Length: %08X\n",
  584. address32_data->address_length);
  585. if(0xFF != address32_data->resource_source.index) {
  586. acpi_os_printf (" Resource Source Index: %X\n",
  587. address32_data->resource_source.index);
  588. acpi_os_printf (" Resource Source: %s\n",
  589. address32_data->resource_source.string_ptr);
  590. }
  591. return;
  592. }
  593. /*******************************************************************************
  594. *
  595. * FUNCTION: acpi_rs_dump_address64
  596. *
  597. * PARAMETERS: Data - pointer to the resource structure to dump.
  598. *
  599. * RETURN: None
  600. *
  601. * DESCRIPTION: Prints out the various members of the Data structure type.
  602. *
  603. ******************************************************************************/
  604. static void
  605. acpi_rs_dump_address64 (
  606. union acpi_resource_data *data)
  607. {
  608. struct acpi_resource_address64 *address64_data = (struct acpi_resource_address64 *) data;
  609. ACPI_FUNCTION_ENTRY ();
  610. acpi_os_printf ("64-Bit Address Space Resource\n");
  611. switch (address64_data->resource_type) {
  612. case ACPI_MEMORY_RANGE:
  613. acpi_os_printf (" Resource Type: Memory Range\n");
  614. switch (address64_data->attribute.memory.cache_attribute) {
  615. case ACPI_NON_CACHEABLE_MEMORY:
  616. acpi_os_printf (" Type Specific: Noncacheable memory\n");
  617. break;
  618. case ACPI_CACHABLE_MEMORY:
  619. acpi_os_printf (" Type Specific: Cacheable memory\n");
  620. break;
  621. case ACPI_WRITE_COMBINING_MEMORY:
  622. acpi_os_printf (" Type Specific: Write-combining memory\n");
  623. break;
  624. case ACPI_PREFETCHABLE_MEMORY:
  625. acpi_os_printf (" Type Specific: Prefetchable memory\n");
  626. break;
  627. default:
  628. acpi_os_printf (" Type Specific: Invalid cache attribute\n");
  629. break;
  630. }
  631. acpi_os_printf (" Type Specific: Read%s\n",
  632. ACPI_READ_WRITE_MEMORY ==
  633. address64_data->attribute.memory.read_write_attribute ?
  634. "/Write" : " Only");
  635. break;
  636. case ACPI_IO_RANGE:
  637. acpi_os_printf (" Resource Type: Io Range\n");
  638. switch (address64_data->attribute.io.range_attribute) {
  639. case ACPI_NON_ISA_ONLY_RANGES:
  640. acpi_os_printf (" Type Specific: Non-ISA Io Addresses\n");
  641. break;
  642. case ACPI_ISA_ONLY_RANGES:
  643. acpi_os_printf (" Type Specific: ISA Io Addresses\n");
  644. break;
  645. case ACPI_ENTIRE_RANGE:
  646. acpi_os_printf (" Type Specific: ISA and non-ISA Io Addresses\n");
  647. break;
  648. default:
  649. acpi_os_printf (" Type Specific: Invalid Range attribute");
  650. break;
  651. }
  652. acpi_os_printf (" Type Specific: %s Translation\n",
  653. ACPI_SPARSE_TRANSLATION ==
  654. address64_data->attribute.io.translation_attribute ?
  655. "Sparse" : "Dense");
  656. break;
  657. case ACPI_BUS_NUMBER_RANGE:
  658. acpi_os_printf (" Resource Type: Bus Number Range\n");
  659. break;
  660. default:
  661. acpi_os_printf (" Resource Type: 0x%2.2X\n",
  662. address64_data->resource_type);
  663. break;
  664. }
  665. acpi_os_printf (" Resource %s\n",
  666. ACPI_CONSUMER == address64_data->producer_consumer ?
  667. "Consumer" : "Producer");
  668. acpi_os_printf (" %s decode\n",
  669. ACPI_SUB_DECODE == address64_data->decode ?
  670. "Subtractive" : "Positive");
  671. acpi_os_printf (" Min address is %s fixed\n",
  672. ACPI_ADDRESS_FIXED == address64_data->min_address_fixed ?
  673. "" : "not ");
  674. acpi_os_printf (" Max address is %s fixed\n",
  675. ACPI_ADDRESS_FIXED == address64_data->max_address_fixed ?
  676. "" : "not ");
  677. acpi_os_printf (" Granularity: %8.8X%8.8X\n",
  678. ACPI_FORMAT_UINT64 (address64_data->granularity));
  679. acpi_os_printf (" Address range min: %8.8X%8.8X\n",
  680. ACPI_FORMAT_UINT64 (address64_data->min_address_range));
  681. acpi_os_printf (" Address range max: %8.8X%8.8X\n",
  682. ACPI_FORMAT_UINT64 (address64_data->max_address_range));
  683. acpi_os_printf (" Address translation offset: %8.8X%8.8X\n",
  684. ACPI_FORMAT_UINT64 (address64_data->address_translation_offset));
  685. acpi_os_printf (" Address Length: %8.8X%8.8X\n",
  686. ACPI_FORMAT_UINT64 (address64_data->address_length));
  687. acpi_os_printf (" Type Specific Attributes: %8.8X%8.8X\n",
  688. ACPI_FORMAT_UINT64 (address64_data->type_specific_attributes));
  689. if (0xFF != address64_data->resource_source.index) {
  690. acpi_os_printf (" Resource Source Index: %X\n",
  691. address64_data->resource_source.index);
  692. acpi_os_printf (" Resource Source: %s\n",
  693. address64_data->resource_source.string_ptr);
  694. }
  695. return;
  696. }
  697. /*******************************************************************************
  698. *
  699. * FUNCTION: acpi_rs_dump_extended_irq
  700. *
  701. * PARAMETERS: Data - pointer to the resource structure to dump.
  702. *
  703. * RETURN: None
  704. *
  705. * DESCRIPTION: Prints out the various members of the Data structure type.
  706. *
  707. ******************************************************************************/
  708. static void
  709. acpi_rs_dump_extended_irq (
  710. union acpi_resource_data *data)
  711. {
  712. struct acpi_resource_ext_irq *ext_irq_data = (struct acpi_resource_ext_irq *) data;
  713. u8 index = 0;
  714. ACPI_FUNCTION_ENTRY ();
  715. acpi_os_printf ("Extended IRQ Resource\n");
  716. acpi_os_printf (" Resource %s\n",
  717. ACPI_CONSUMER == ext_irq_data->producer_consumer ?
  718. "Consumer" : "Producer");
  719. acpi_os_printf (" %s\n",
  720. ACPI_LEVEL_SENSITIVE == ext_irq_data->edge_level ?
  721. "Level" : "Edge");
  722. acpi_os_printf (" Active %s\n",
  723. ACPI_ACTIVE_LOW == ext_irq_data->active_high_low ?
  724. "low" : "high");
  725. acpi_os_printf (" %s\n",
  726. ACPI_SHARED == ext_irq_data->shared_exclusive ?
  727. "Shared" : "Exclusive");
  728. acpi_os_printf (" Interrupts : %X ( ", ext_irq_data->number_of_interrupts);
  729. for (index = 0; index < ext_irq_data->number_of_interrupts; index++) {
  730. acpi_os_printf ("%X ", ext_irq_data->interrupts[index]);
  731. }
  732. acpi_os_printf (")\n");
  733. if(0xFF != ext_irq_data->resource_source.index) {
  734. acpi_os_printf (" Resource Source Index: %X",
  735. ext_irq_data->resource_source.index);
  736. acpi_os_printf (" Resource Source: %s",
  737. ext_irq_data->resource_source.string_ptr);
  738. }
  739. return;
  740. }
  741. /*******************************************************************************
  742. *
  743. * FUNCTION: acpi_rs_dump_resource_list
  744. *
  745. * PARAMETERS: Resource - pointer to the resource structure to dump.
  746. *
  747. * RETURN: None
  748. *
  749. * DESCRIPTION: Dispatches the structure to the correct dump routine.
  750. *
  751. ******************************************************************************/
  752. void
  753. acpi_rs_dump_resource_list (
  754. struct acpi_resource *resource)
  755. {
  756. u8 count = 0;
  757. u8 done = FALSE;
  758. ACPI_FUNCTION_ENTRY ();
  759. if (acpi_dbg_level & ACPI_LV_RESOURCES && _COMPONENT & acpi_dbg_layer) {
  760. while (!done) {
  761. acpi_os_printf ("Resource structure %X.\n", count++);
  762. switch (resource->id) {
  763. case ACPI_RSTYPE_IRQ:
  764. acpi_rs_dump_irq (&resource->data);
  765. break;
  766. case ACPI_RSTYPE_DMA:
  767. acpi_rs_dump_dma (&resource->data);
  768. break;
  769. case ACPI_RSTYPE_START_DPF:
  770. acpi_rs_dump_start_depend_fns (&resource->data);
  771. break;
  772. case ACPI_RSTYPE_END_DPF:
  773. acpi_os_printf ("end_dependent_functions Resource\n");
  774. /* acpi_rs_dump_end_dependent_functions (Resource->Data);*/
  775. break;
  776. case ACPI_RSTYPE_IO:
  777. acpi_rs_dump_io (&resource->data);
  778. break;
  779. case ACPI_RSTYPE_FIXED_IO:
  780. acpi_rs_dump_fixed_io (&resource->data);
  781. break;
  782. case ACPI_RSTYPE_VENDOR:
  783. acpi_rs_dump_vendor_specific (&resource->data);
  784. break;
  785. case ACPI_RSTYPE_END_TAG:
  786. /*rs_dump_end_tag (Resource->Data);*/
  787. acpi_os_printf ("end_tag Resource\n");
  788. done = TRUE;
  789. break;
  790. case ACPI_RSTYPE_MEM24:
  791. acpi_rs_dump_memory24 (&resource->data);
  792. break;
  793. case ACPI_RSTYPE_MEM32:
  794. acpi_rs_dump_memory32 (&resource->data);
  795. break;
  796. case ACPI_RSTYPE_FIXED_MEM32:
  797. acpi_rs_dump_fixed_memory32 (&resource->data);
  798. break;
  799. case ACPI_RSTYPE_ADDRESS16:
  800. acpi_rs_dump_address16 (&resource->data);
  801. break;
  802. case ACPI_RSTYPE_ADDRESS32:
  803. acpi_rs_dump_address32 (&resource->data);
  804. break;
  805. case ACPI_RSTYPE_ADDRESS64:
  806. acpi_rs_dump_address64 (&resource->data);
  807. break;
  808. case ACPI_RSTYPE_EXT_IRQ:
  809. acpi_rs_dump_extended_irq (&resource->data);
  810. break;
  811. default:
  812. acpi_os_printf ("Invalid resource type\n");
  813. break;
  814. }
  815. resource = ACPI_PTR_ADD (struct acpi_resource, resource, resource->length);
  816. }
  817. }
  818. return;
  819. }
  820. /*******************************************************************************
  821. *
  822. * FUNCTION: acpi_rs_dump_irq_list
  823. *
  824. * PARAMETERS: route_table - pointer to the routing table to dump.
  825. *
  826. * RETURN: None
  827. *
  828. * DESCRIPTION: Dispatches the structures to the correct dump routine.
  829. *
  830. ******************************************************************************/
  831. void
  832. acpi_rs_dump_irq_list (
  833. u8 *route_table)
  834. {
  835. u8 *buffer = route_table;
  836. u8 count = 0;
  837. u8 done = FALSE;
  838. struct acpi_pci_routing_table *prt_element;
  839. ACPI_FUNCTION_ENTRY ();
  840. if (acpi_dbg_level & ACPI_LV_RESOURCES && _COMPONENT & acpi_dbg_layer) {
  841. prt_element = ACPI_CAST_PTR (struct acpi_pci_routing_table, buffer);
  842. while (!done) {
  843. acpi_os_printf ("PCI IRQ Routing Table structure %X.\n", count++);
  844. acpi_os_printf (" Address: %8.8X%8.8X\n",
  845. ACPI_FORMAT_UINT64 (prt_element->address));
  846. acpi_os_printf (" Pin: %X\n", prt_element->pin);
  847. acpi_os_printf (" Source: %s\n", prt_element->source);
  848. acpi_os_printf (" source_index: %X\n", prt_element->source_index);
  849. buffer += prt_element->length;
  850. prt_element = ACPI_CAST_PTR (struct acpi_pci_routing_table, buffer);
  851. if (0 == prt_element->length) {
  852. done = TRUE;
  853. }
  854. }
  855. }
  856. return;
  857. }
  858. #endif