rsdump.c 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170
  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. /* Local prototypes */
  48. static void
  49. acpi_rs_dump_irq (
  50. union acpi_resource_data *data);
  51. static void
  52. acpi_rs_dump_address16 (
  53. union acpi_resource_data *data);
  54. static void
  55. acpi_rs_dump_address32 (
  56. union acpi_resource_data *data);
  57. static void
  58. acpi_rs_dump_address64 (
  59. union acpi_resource_data *data);
  60. static void
  61. acpi_rs_dump_dma (
  62. union acpi_resource_data *data);
  63. static void
  64. acpi_rs_dump_io (
  65. union acpi_resource_data *data);
  66. static void
  67. acpi_rs_dump_extended_irq (
  68. union acpi_resource_data *data);
  69. static void
  70. acpi_rs_dump_fixed_io (
  71. union acpi_resource_data *data);
  72. static void
  73. acpi_rs_dump_fixed_memory32 (
  74. union acpi_resource_data *data);
  75. static void
  76. acpi_rs_dump_memory24 (
  77. union acpi_resource_data *data);
  78. static void
  79. acpi_rs_dump_memory32 (
  80. union acpi_resource_data *data);
  81. static void
  82. acpi_rs_dump_start_depend_fns (
  83. union acpi_resource_data *data);
  84. static void
  85. acpi_rs_dump_vendor_specific (
  86. union acpi_resource_data *data);
  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