rsdump.c 29 KB

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