xref: /dflybsd-src/sys/contrib/dev/acpica/source/components/disassembler/dmresrcl2.c (revision 3a25be875e6cc0f33d611e2b5ba818544510a51f)
1 /*******************************************************************************
2  *
3  * Module Name: dmresrcl2.c - "Large" Resource Descriptor disassembly (#2)
4  *
5  ******************************************************************************/
6 
7 /*
8  * Copyright (C) 2000 - 2014, Intel Corp.
9  * All rights reserved.
10  *
11  * Redistribution and use in source and binary forms, with or without
12  * modification, are permitted provided that the following conditions
13  * are met:
14  * 1. Redistributions of source code must retain the above copyright
15  *    notice, this list of conditions, and the following disclaimer,
16  *    without modification.
17  * 2. Redistributions in binary form must reproduce at minimum a disclaimer
18  *    substantially similar to the "NO WARRANTY" disclaimer below
19  *    ("Disclaimer") and any redistribution must be conditioned upon
20  *    including a substantially similar Disclaimer requirement for further
21  *    binary redistribution.
22  * 3. Neither the names of the above-listed copyright holders nor the names
23  *    of any contributors may be used to endorse or promote products derived
24  *    from this software without specific prior written permission.
25  *
26  * Alternatively, this software may be distributed under the terms of the
27  * GNU General Public License ("GPL") version 2 as published by the Free
28  * Software Foundation.
29  *
30  * NO WARRANTY
31  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
32  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
33  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
34  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
35  * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
36  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
37  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
38  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
39  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
40  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
41  * POSSIBILITY OF SUCH DAMAGES.
42  */
43 
44 #include "acpi.h"
45 #include "accommon.h"
46 #include "acdisasm.h"
47 
48 
49 #ifdef ACPI_DISASSEMBLER
50 
51 #define _COMPONENT          ACPI_CA_DEBUGGER
52         ACPI_MODULE_NAME    ("dbresrcl2")
53 
54 /* Local prototypes */
55 
56 static void
57 AcpiDmI2cSerialBusDescriptor (
58     AML_RESOURCE            *Resource,
59     UINT32                  Length,
60     UINT32                  Level);
61 
62 static void
63 AcpiDmSpiSerialBusDescriptor (
64     AML_RESOURCE            *Resource,
65     UINT32                  Length,
66     UINT32                  Level);
67 
68 static void
69 AcpiDmUartSerialBusDescriptor (
70     AML_RESOURCE            *Resource,
71     UINT32                  Length,
72     UINT32                  Level);
73 
74 static void
75 AcpiDmGpioCommon (
76     AML_RESOURCE            *Resource,
77     UINT32                  Level);
78 
79 static void
80 AcpiDmDumpRawDataBuffer (
81     UINT8                   *Buffer,
82     UINT32                  Length,
83     UINT32                  Level);
84 
85 
86 /* Dispatch table for the serial bus descriptors */
87 
88 static ACPI_RESOURCE_HANDLER        SerialBusResourceDispatch [] =
89 {
90     NULL,
91     AcpiDmI2cSerialBusDescriptor,
92     AcpiDmSpiSerialBusDescriptor,
93     AcpiDmUartSerialBusDescriptor
94 };
95 
96 
97 /*******************************************************************************
98  *
99  * FUNCTION:    AcpiDmDumpRawDataBuffer
100  *
101  * PARAMETERS:  Buffer              - Pointer to the data bytes
102  *              Length              - Length of the descriptor in bytes
103  *              Level               - Current source code indentation level
104  *
105  * RETURN:      None
106  *
107  * DESCRIPTION: Dump a data buffer as a RawDataBuffer() object. Used for
108  *              vendor data bytes.
109  *
110  ******************************************************************************/
111 
112 static void
113 AcpiDmDumpRawDataBuffer (
114     UINT8                   *Buffer,
115     UINT32                  Length,
116     UINT32                  Level)
117 {
118     UINT32                  Index;
119     UINT32                  i;
120     UINT32                  j;
121 
122 
123     if (!Length)
124     {
125         return;
126     }
127 
128     AcpiOsPrintf ("RawDataBuffer (0x%.2X)  // Vendor Data", Length);
129 
130     AcpiOsPrintf ("\n");
131     AcpiDmIndent (Level + 1);
132     AcpiOsPrintf ("{\n");
133     AcpiDmIndent (Level + 2);
134 
135     for (i = 0; i < Length;)
136     {
137         for (j = 0; j < 8; j++)
138         {
139             Index = i + j;
140             if (Index >= Length)
141             {
142                 goto Finish;
143             }
144 
145             AcpiOsPrintf ("0x%2.2X", Buffer[Index]);
146             if ((Index + 1) >= Length)
147             {
148                 goto Finish;
149             }
150 
151             AcpiOsPrintf (", ");
152         }
153         AcpiOsPrintf ("\n");
154         AcpiDmIndent (Level + 2);
155 
156         i += 8;
157     }
158 
159 Finish:
160     AcpiOsPrintf ("\n");
161     AcpiDmIndent (Level + 1);
162     AcpiOsPrintf ("}");
163 }
164 
165 
166 /*******************************************************************************
167  *
168  * FUNCTION:    AcpiDmGpioCommon
169  *
170  * PARAMETERS:  Resource            - Pointer to the resource descriptor
171  *              Level               - Current source code indentation level
172  *
173  * RETURN:      None
174  *
175  * DESCRIPTION: Decode common parts of a GPIO Interrupt descriptor
176  *
177  ******************************************************************************/
178 
179 static void
180 AcpiDmGpioCommon (
181     AML_RESOURCE            *Resource,
182     UINT32                  Level)
183 {
184     UINT32                  PinCount;
185     UINT16                  *PinList;
186     UINT8                   *VendorData;
187     UINT32                  i;
188 
189 
190     /* ResourceSource, ResourceSourceIndex, ResourceType */
191 
192     AcpiDmIndent (Level + 1);
193     if (Resource->Gpio.ResSourceOffset)
194     {
195         AcpiUtPrintString (
196             ACPI_ADD_PTR (char, Resource, Resource->Gpio.ResSourceOffset),
197             ACPI_UINT16_MAX);
198     }
199 
200     AcpiOsPrintf (", ");
201     AcpiOsPrintf ("0x%2.2X, ", Resource->Gpio.ResSourceIndex);
202     AcpiOsPrintf ("%s, ",
203         AcpiGbl_ConsumeDecode [ACPI_GET_1BIT_FLAG (Resource->Gpio.Flags)]);
204 
205     /* Insert a descriptor name */
206 
207     AcpiDmDescriptorName ();
208     AcpiOsPrintf (",");
209 
210     /* Dump the vendor data */
211 
212     if (Resource->Gpio.VendorOffset)
213     {
214         AcpiOsPrintf ("\n");
215         AcpiDmIndent (Level + 1);
216         VendorData = ACPI_ADD_PTR (UINT8, Resource,
217             Resource->Gpio.VendorOffset);
218 
219         AcpiDmDumpRawDataBuffer (VendorData,
220             Resource->Gpio.VendorLength, Level);
221     }
222 
223     AcpiOsPrintf (")\n");
224 
225     /* Dump the interrupt list */
226 
227     AcpiDmIndent (Level + 1);
228     AcpiOsPrintf ("{   // Pin list\n");
229 
230     PinCount = ((UINT32) (Resource->Gpio.ResSourceOffset -
231         Resource->Gpio.PinTableOffset)) /
232         sizeof (UINT16);
233 
234     PinList = (UINT16 *) ACPI_ADD_PTR (char, Resource,
235         Resource->Gpio.PinTableOffset);
236 
237     for (i = 0; i < PinCount; i++)
238     {
239         AcpiDmIndent (Level + 2);
240         AcpiOsPrintf ("0x%4.4X%s\n", PinList[i], ((i + 1) < PinCount) ? "," : "");
241     }
242 
243     AcpiDmIndent (Level + 1);
244     AcpiOsPrintf ("}\n");
245 }
246 
247 
248 /*******************************************************************************
249  *
250  * FUNCTION:    AcpiDmGpioIntDescriptor
251  *
252  * PARAMETERS:  Resource            - Pointer to the resource descriptor
253  *              Length              - Length of the descriptor in bytes
254  *              Level               - Current source code indentation level
255  *
256  * RETURN:      None
257  *
258  * DESCRIPTION: Decode a GPIO Interrupt descriptor
259  *
260  ******************************************************************************/
261 
262 static void
263 AcpiDmGpioIntDescriptor (
264     AML_RESOURCE            *Resource,
265     UINT32                  Length,
266     UINT32                  Level)
267 {
268 
269     /* Dump the GpioInt-specific portion of the descriptor */
270 
271     /* EdgeLevel, ActiveLevel, Shared */
272 
273     AcpiDmIndent (Level);
274     AcpiOsPrintf ("GpioInt (%s, %s, %s, ",
275         AcpiGbl_HeDecode [ACPI_GET_1BIT_FLAG (Resource->Gpio.IntFlags)],
276         AcpiGbl_LlDecode [ACPI_EXTRACT_2BIT_FLAG (Resource->Gpio.IntFlags, 1)],
277         AcpiGbl_ShrDecode [ACPI_EXTRACT_2BIT_FLAG (Resource->Gpio.IntFlags, 3)]);
278 
279     /* PinConfig, DebounceTimeout */
280 
281     if (Resource->Gpio.PinConfig <= 3)
282     {
283         AcpiOsPrintf ("%s, ",
284             AcpiGbl_PpcDecode[Resource->Gpio.PinConfig]);
285     }
286     else
287     {
288         AcpiOsPrintf ("0x%2.2X, ", Resource->Gpio.PinConfig);
289     }
290     AcpiOsPrintf ("0x%4.4X,\n", Resource->Gpio.DebounceTimeout);
291 
292     /* Dump the GpioInt/GpioIo common portion of the descriptor */
293 
294     AcpiDmGpioCommon (Resource, Level);
295 }
296 
297 
298 /*******************************************************************************
299  *
300  * FUNCTION:    AcpiDmGpioIoDescriptor
301  *
302  * PARAMETERS:  Resource            - Pointer to the resource descriptor
303  *              Length              - Length of the descriptor in bytes
304  *              Level               - Current source code indentation level
305  *
306  * RETURN:      None
307  *
308  * DESCRIPTION: Decode a GPIO I/O descriptor
309  *
310  ******************************************************************************/
311 
312 static void
313 AcpiDmGpioIoDescriptor (
314     AML_RESOURCE            *Resource,
315     UINT32                  Length,
316     UINT32                  Level)
317 {
318 
319     /* Dump the GpioIo-specific portion of the descriptor */
320 
321     /* Shared, PinConfig */
322 
323     AcpiDmIndent (Level);
324     AcpiOsPrintf ("GpioIo (%s, ",
325         AcpiGbl_ShrDecode [ACPI_EXTRACT_2BIT_FLAG (Resource->Gpio.IntFlags, 3)]);
326 
327     if (Resource->Gpio.PinConfig <= 3)
328     {
329         AcpiOsPrintf ("%s, ",
330             AcpiGbl_PpcDecode[Resource->Gpio.PinConfig]);
331     }
332     else
333     {
334         AcpiOsPrintf ("0x%2.2X, ", Resource->Gpio.PinConfig);
335     }
336 
337     /* DebounceTimeout, DriveStrength, IoRestriction */
338 
339     AcpiOsPrintf ("0x%4.4X, ", Resource->Gpio.DebounceTimeout);
340     AcpiOsPrintf ("0x%4.4X, ", Resource->Gpio.DriveStrength);
341     AcpiOsPrintf ("%s,\n",
342         AcpiGbl_IorDecode [ACPI_GET_2BIT_FLAG (Resource->Gpio.IntFlags)]);
343 
344     /* Dump the GpioInt/GpioIo common portion of the descriptor */
345 
346     AcpiDmGpioCommon (Resource, Level);
347 }
348 
349 
350 /*******************************************************************************
351  *
352  * FUNCTION:    AcpiDmGpioDescriptor
353  *
354  * PARAMETERS:  Resource            - Pointer to the resource descriptor
355  *              Length              - Length of the descriptor in bytes
356  *              Level               - Current source code indentation level
357  *
358  * RETURN:      None
359  *
360  * DESCRIPTION: Decode a GpioInt/GpioIo GPIO Interrupt/IO descriptor
361  *
362  ******************************************************************************/
363 
364 void
365 AcpiDmGpioDescriptor (
366     AML_RESOURCE            *Resource,
367     UINT32                  Length,
368     UINT32                  Level)
369 {
370     UINT8                   ConnectionType;
371 
372 
373     ConnectionType = Resource->Gpio.ConnectionType;
374 
375     switch (ConnectionType)
376     {
377     case AML_RESOURCE_GPIO_TYPE_INT:
378 
379         AcpiDmGpioIntDescriptor (Resource, Length, Level);
380         break;
381 
382     case AML_RESOURCE_GPIO_TYPE_IO:
383 
384         AcpiDmGpioIoDescriptor (Resource, Length, Level);
385         break;
386 
387     default:
388 
389         AcpiOsPrintf ("Unknown GPIO type\n");
390         break;
391     }
392 }
393 
394 
395 /*******************************************************************************
396  *
397  * FUNCTION:    AcpiDmDumpSerialBusVendorData
398  *
399  * PARAMETERS:  Resource            - Pointer to the resource descriptor
400  *
401  * RETURN:      None
402  *
403  * DESCRIPTION: Dump optional serial bus vendor data
404  *
405  ******************************************************************************/
406 
407 static void
408 AcpiDmDumpSerialBusVendorData (
409     AML_RESOURCE            *Resource,
410     UINT32                  Level)
411 {
412     UINT8                   *VendorData;
413     UINT32                  VendorLength;
414 
415 
416     /* Get the (optional) vendor data and length */
417 
418     switch (Resource->CommonSerialBus.Type)
419     {
420     case AML_RESOURCE_I2C_SERIALBUSTYPE:
421 
422         VendorLength = Resource->CommonSerialBus.TypeDataLength -
423             AML_RESOURCE_I2C_MIN_DATA_LEN;
424 
425         VendorData = ACPI_ADD_PTR (UINT8, Resource,
426             sizeof (AML_RESOURCE_I2C_SERIALBUS));
427         break;
428 
429     case AML_RESOURCE_SPI_SERIALBUSTYPE:
430 
431         VendorLength = Resource->CommonSerialBus.TypeDataLength -
432             AML_RESOURCE_SPI_MIN_DATA_LEN;
433 
434         VendorData = ACPI_ADD_PTR (UINT8, Resource,
435             sizeof (AML_RESOURCE_SPI_SERIALBUS));
436         break;
437 
438     case AML_RESOURCE_UART_SERIALBUSTYPE:
439 
440         VendorLength = Resource->CommonSerialBus.TypeDataLength -
441             AML_RESOURCE_UART_MIN_DATA_LEN;
442 
443         VendorData = ACPI_ADD_PTR (UINT8, Resource,
444             sizeof (AML_RESOURCE_UART_SERIALBUS));
445         break;
446 
447     default:
448 
449         return;
450     }
451 
452     /* Dump the vendor bytes as a RawDataBuffer object */
453 
454     AcpiDmDumpRawDataBuffer (VendorData, VendorLength, Level);
455 }
456 
457 
458 /*******************************************************************************
459  *
460  * FUNCTION:    AcpiDmI2cSerialBusDescriptor
461  *
462  * PARAMETERS:  Resource            - Pointer to the resource descriptor
463  *              Length              - Length of the descriptor in bytes
464  *              Level               - Current source code indentation level
465  *
466  * RETURN:      None
467  *
468  * DESCRIPTION: Decode a I2C serial bus descriptor
469  *
470  ******************************************************************************/
471 
472 static void
473 AcpiDmI2cSerialBusDescriptor (
474     AML_RESOURCE            *Resource,
475     UINT32                  Length,
476     UINT32                  Level)
477 {
478     UINT32                  ResourceSourceOffset;
479 
480 
481     /* SlaveAddress, SlaveMode, ConnectionSpeed, AddressingMode */
482 
483     AcpiDmIndent (Level);
484     AcpiOsPrintf ("I2cSerialBus (0x%4.4X, %s, 0x%8.8X,\n",
485         Resource->I2cSerialBus.SlaveAddress,
486         AcpiGbl_SmDecode [ACPI_GET_1BIT_FLAG (Resource->I2cSerialBus.Flags)],
487         Resource->I2cSerialBus.ConnectionSpeed);
488 
489     AcpiDmIndent (Level + 1);
490     AcpiOsPrintf ("%s, ",
491         AcpiGbl_AmDecode [ACPI_GET_1BIT_FLAG (Resource->I2cSerialBus.TypeSpecificFlags)]);
492 
493     /* ResourceSource is a required field */
494 
495     ResourceSourceOffset = sizeof (AML_RESOURCE_COMMON_SERIALBUS) +
496         Resource->CommonSerialBus.TypeDataLength;
497 
498     AcpiUtPrintString (
499         ACPI_ADD_PTR (char, Resource, ResourceSourceOffset),
500         ACPI_UINT16_MAX);
501 
502     /* ResourceSourceIndex, ResourceUsage */
503 
504     AcpiOsPrintf (",\n");
505     AcpiDmIndent (Level + 1);
506     AcpiOsPrintf ("0x%2.2X, ", Resource->I2cSerialBus.ResSourceIndex);
507 
508     AcpiOsPrintf ("%s, ",
509         AcpiGbl_ConsumeDecode [ACPI_EXTRACT_1BIT_FLAG (Resource->I2cSerialBus.Flags, 1)]);
510 
511     /* Insert a descriptor name */
512 
513     AcpiDmDescriptorName ();
514     AcpiOsPrintf (",\n");
515 
516     /* Dump the vendor data */
517 
518     AcpiDmIndent (Level + 1);
519     AcpiDmDumpSerialBusVendorData (Resource, Level);
520     AcpiOsPrintf (")\n");
521 }
522 
523 
524 /*******************************************************************************
525  *
526  * FUNCTION:    AcpiDmSpiSerialBusDescriptor
527  *
528  * PARAMETERS:  Resource            - Pointer to the resource descriptor
529  *              Length              - Length of the descriptor in bytes
530  *              Level               - Current source code indentation level
531  *
532  * RETURN:      None
533  *
534  * DESCRIPTION: Decode a SPI serial bus descriptor
535  *
536  ******************************************************************************/
537 
538 static void
539 AcpiDmSpiSerialBusDescriptor (
540     AML_RESOURCE            *Resource,
541     UINT32                  Length,
542     UINT32                  Level)
543 {
544     UINT32                  ResourceSourceOffset;
545 
546 
547     /* DeviceSelection, DeviceSelectionPolarity, WireMode, DataBitLength */
548 
549     AcpiDmIndent (Level);
550     AcpiOsPrintf ("SpiSerialBus (0x%4.4X, %s, %s, 0x%2.2X,\n",
551         Resource->SpiSerialBus.DeviceSelection,
552         AcpiGbl_DpDecode [ACPI_EXTRACT_1BIT_FLAG (Resource->SpiSerialBus.TypeSpecificFlags, 1)],
553         AcpiGbl_WmDecode [ACPI_GET_1BIT_FLAG (Resource->SpiSerialBus.TypeSpecificFlags)],
554         Resource->SpiSerialBus.DataBitLength);
555 
556     /* SlaveMode, ConnectionSpeed, ClockPolarity, ClockPhase */
557 
558     AcpiDmIndent (Level + 1);
559     AcpiOsPrintf ("%s, 0x%8.8X, %s,\n",
560         AcpiGbl_SmDecode [ACPI_GET_1BIT_FLAG (Resource->SpiSerialBus.Flags)],
561         Resource->SpiSerialBus.ConnectionSpeed,
562         AcpiGbl_CpoDecode [ACPI_GET_1BIT_FLAG (Resource->SpiSerialBus.ClockPolarity)]);
563 
564     AcpiDmIndent (Level + 1);
565     AcpiOsPrintf ("%s, ",
566         AcpiGbl_CphDecode [ACPI_GET_1BIT_FLAG (Resource->SpiSerialBus.ClockPhase)]);
567 
568     /* ResourceSource is a required field */
569 
570     ResourceSourceOffset = sizeof (AML_RESOURCE_COMMON_SERIALBUS) +
571         Resource->CommonSerialBus.TypeDataLength;
572 
573     AcpiUtPrintString (
574         ACPI_ADD_PTR (char, Resource, ResourceSourceOffset),
575         ACPI_UINT16_MAX);
576 
577     /* ResourceSourceIndex, ResourceUsage */
578 
579     AcpiOsPrintf (",\n");
580     AcpiDmIndent (Level + 1);
581     AcpiOsPrintf ("0x%2.2X, ", Resource->SpiSerialBus.ResSourceIndex);
582 
583     AcpiOsPrintf ("%s, ",
584         AcpiGbl_ConsumeDecode [ACPI_EXTRACT_1BIT_FLAG (Resource->SpiSerialBus.Flags, 1)]);
585 
586     /* Insert a descriptor name */
587 
588     AcpiDmDescriptorName ();
589     AcpiOsPrintf (",\n");
590 
591     /* Dump the vendor data */
592 
593     AcpiDmIndent (Level + 1);
594     AcpiDmDumpSerialBusVendorData (Resource, Level);
595     AcpiOsPrintf (")\n");
596 }
597 
598 
599 /*******************************************************************************
600  *
601  * FUNCTION:    AcpiDmUartSerialBusDescriptor
602  *
603  * PARAMETERS:  Resource            - Pointer to the resource descriptor
604  *              Length              - Length of the descriptor in bytes
605  *              Level               - Current source code indentation level
606  *
607  * RETURN:      None
608  *
609  * DESCRIPTION: Decode a UART serial bus descriptor
610  *
611  ******************************************************************************/
612 
613 static void
614 AcpiDmUartSerialBusDescriptor (
615     AML_RESOURCE            *Resource,
616     UINT32                  Length,
617     UINT32                  Level)
618 {
619     UINT32                  ResourceSourceOffset;
620 
621 
622     /* ConnectionSpeed, BitsPerByte, StopBits */
623 
624     AcpiDmIndent (Level);
625     AcpiOsPrintf ("UartSerialBus (0x%8.8X, %s, %s,\n",
626         Resource->UartSerialBus.DefaultBaudRate,
627         AcpiGbl_BpbDecode [ACPI_EXTRACT_3BIT_FLAG (Resource->UartSerialBus.TypeSpecificFlags, 4)],
628         AcpiGbl_SbDecode [ACPI_EXTRACT_2BIT_FLAG (Resource->UartSerialBus.TypeSpecificFlags, 2)]);
629 
630     /* LinesInUse, IsBigEndian, Parity, FlowControl */
631 
632     AcpiDmIndent (Level + 1);
633     AcpiOsPrintf ("0x%2.2X, %s, %s, %s,\n",
634         Resource->UartSerialBus.LinesEnabled,
635         AcpiGbl_EdDecode [ACPI_EXTRACT_1BIT_FLAG (Resource->UartSerialBus.TypeSpecificFlags, 7)],
636         AcpiGbl_PtDecode [ACPI_GET_3BIT_FLAG (Resource->UartSerialBus.Parity)],
637         AcpiGbl_FcDecode [ACPI_GET_2BIT_FLAG (Resource->UartSerialBus.TypeSpecificFlags)]);
638 
639     /* ReceiveBufferSize, TransmitBufferSize */
640 
641     AcpiDmIndent (Level + 1);
642     AcpiOsPrintf ("0x%4.4X, 0x%4.4X, ",
643         Resource->UartSerialBus.RxFifoSize,
644         Resource->UartSerialBus.TxFifoSize);
645 
646     /* ResourceSource is a required field */
647 
648     ResourceSourceOffset = sizeof (AML_RESOURCE_COMMON_SERIALBUS) +
649         Resource->CommonSerialBus.TypeDataLength;
650 
651     AcpiUtPrintString (
652         ACPI_ADD_PTR (char, Resource, ResourceSourceOffset),
653         ACPI_UINT16_MAX);
654 
655     /* ResourceSourceIndex, ResourceUsage */
656 
657     AcpiOsPrintf (",\n");
658     AcpiDmIndent (Level + 1);
659     AcpiOsPrintf ("0x%2.2X, ", Resource->UartSerialBus.ResSourceIndex);
660 
661     AcpiOsPrintf ("%s, ",
662         AcpiGbl_ConsumeDecode [ACPI_EXTRACT_1BIT_FLAG (Resource->UartSerialBus.Flags, 1)]);
663 
664     /* Insert a descriptor name */
665 
666     AcpiDmDescriptorName ();
667     AcpiOsPrintf (",\n");
668 
669     /* Dump the vendor data */
670 
671     AcpiDmIndent (Level + 1);
672     AcpiDmDumpSerialBusVendorData (Resource, Level);
673     AcpiOsPrintf (")\n");
674 }
675 
676 
677 /*******************************************************************************
678  *
679  * FUNCTION:    AcpiDmSerialBusDescriptor
680  *
681  * PARAMETERS:  Resource            - Pointer to the resource descriptor
682  *              Length              - Length of the descriptor in bytes
683  *              Level               - Current source code indentation level
684  *
685  * RETURN:      None
686  *
687  * DESCRIPTION: Decode a I2C/SPI/UART serial bus descriptor
688  *
689  ******************************************************************************/
690 
691 void
692 AcpiDmSerialBusDescriptor (
693     AML_RESOURCE            *Resource,
694     UINT32                  Length,
695     UINT32                  Level)
696 {
697 
698     SerialBusResourceDispatch [Resource->CommonSerialBus.Type] (
699         Resource, Length, Level);
700 }
701 
702 #endif
703