1 /******************************************************************************
2  *
3  * Module Name: aslrestype2s - Serial Large resource descriptors
4  *
5  *****************************************************************************/
6 
7 /*
8  * Copyright (C) 2000 - 2016, 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 "aslcompiler.h"
45 #include "aslcompiler.y.h"
46 #include "amlcode.h"
47 
48 #define _COMPONENT          ACPI_COMPILER
49         ACPI_MODULE_NAME    ("aslrestype2s")
50 
51 
52 static UINT16
53 RsGetBufferDataLength (
54     ACPI_PARSE_OBJECT       *InitializerOp);
55 
56 static UINT16
57 RsGetInterruptDataLength (
58     ACPI_PARSE_OBJECT       *InitializerOp);
59 
60 static BOOLEAN
61 RsGetVendorData (
62     ACPI_PARSE_OBJECT       *InitializerOp,
63     UINT8                   *VendorData,
64     ACPI_SIZE               DescriptorOffset);
65 
66 /*
67  * This module contains descriptors for serial buses and GPIO:
68  *
69  * GpioInt
70  * GpioIo
71  * I2cSerialBus
72  * SpiSerialBus
73  * UartSerialBus
74  */
75 
76 
77 /*******************************************************************************
78  *
79  * FUNCTION:    RsGetBufferDataLength
80  *
81  * PARAMETERS:  InitializerOp       - Current parse op, start of the resource
82  *                                    descriptor
83  *
84  * RETURN:      Length of the data buffer
85  *
86  * DESCRIPTION: Get the length of a RawDataBuffer, used for vendor data.
87  *
88  ******************************************************************************/
89 
90 static UINT16
91 RsGetBufferDataLength (
92     ACPI_PARSE_OBJECT       *InitializerOp)
93 {
94     UINT16                  ExtraDataSize = 0;
95     ACPI_PARSE_OBJECT       *DataList;
96 
97 
98     /* Find the byte-initializer list */
99 
100     while (InitializerOp)
101     {
102         if (InitializerOp->Asl.ParseOpcode == PARSEOP_DATABUFFER)
103         {
104             /* First child is the optional length (ignore it here) */
105 
106             DataList = InitializerOp->Asl.Child;
107             DataList = ASL_GET_PEER_NODE (DataList);
108 
109             /* Count the data items (each one is a byte of data) */
110 
111             while (DataList)
112             {
113                 ExtraDataSize++;
114                 DataList = ASL_GET_PEER_NODE (DataList);
115             }
116 
117             return (ExtraDataSize);
118         }
119 
120         InitializerOp = ASL_GET_PEER_NODE (InitializerOp);
121     }
122 
123     return (ExtraDataSize);
124 }
125 
126 
127 /*******************************************************************************
128  *
129  * FUNCTION:    RsGetInterruptDataLength
130  *
131  * PARAMETERS:  InitializerOp       - Current parse op, start of the resource
132  *                                    descriptor
133  *
134  * RETURN:      Length of the interrupt data list
135  *
136  * DESCRIPTION: Get the length of a list of interrupt DWORDs for the GPIO
137  *              descriptors.
138  *
139  ******************************************************************************/
140 
141 static UINT16
142 RsGetInterruptDataLength (
143     ACPI_PARSE_OBJECT       *InitializerOp)
144 {
145     UINT16                  InterruptLength;
146     UINT32                  i;
147 
148 
149     /* Count the interrupt numbers */
150 
151     InterruptLength = 0;
152     for (i = 0; InitializerOp; i++)
153     {
154         InitializerOp = ASL_GET_PEER_NODE (InitializerOp);
155 
156         /* Interrupt list starts at offset 10 (Gpio descriptors) */
157 
158         if (i >= 10)
159         {
160             InterruptLength += 2;
161         }
162     }
163 
164     return (InterruptLength);
165 }
166 
167 
168 /*******************************************************************************
169  *
170  * FUNCTION:    RsGetVendorData
171  *
172  * PARAMETERS:  InitializerOp       - Current parse op, start of the resource
173  *                                    descriptor.
174  *              VendorData          - Where the vendor data is returned
175  *              DescriptorOffset    - Where vendor data begins in descriptor
176  *
177  * RETURN:      TRUE if valid vendor data was returned, FALSE otherwise.
178  *
179  * DESCRIPTION: Extract the vendor data and construct a vendor data buffer.
180  *
181  ******************************************************************************/
182 
183 static BOOLEAN
184 RsGetVendorData (
185     ACPI_PARSE_OBJECT       *InitializerOp,
186     UINT8                   *VendorData,
187     ACPI_SIZE               DescriptorOffset)
188 {
189     ACPI_PARSE_OBJECT       *BufferOp;
190     UINT32                  SpecifiedLength = ACPI_UINT32_MAX;
191     UINT16                  ActualLength = 0;
192 
193 
194     /* Vendor Data field is always optional */
195 
196     if (InitializerOp->Asl.ParseOpcode == PARSEOP_DEFAULT_ARG)
197     {
198         return (FALSE);
199     }
200 
201     BufferOp = InitializerOp->Asl.Child;
202     if (!BufferOp)
203     {
204         AslError (ASL_ERROR, ASL_MSG_SYNTAX, InitializerOp, "");
205         return (FALSE);
206     }
207 
208     /* First child is the optional buffer length (WORD) */
209 
210     if (BufferOp->Asl.ParseOpcode != PARSEOP_DEFAULT_ARG)
211     {
212         SpecifiedLength = (UINT16) BufferOp->Asl.Value.Integer;
213     }
214 
215     /* Insert field tag _VEN */
216 
217     RsCreateByteField (InitializerOp, ACPI_RESTAG_VENDORDATA,
218         (UINT16) DescriptorOffset);
219 
220     /* Walk the list of buffer initializers (each is one byte) */
221 
222     BufferOp = RsCompleteNodeAndGetNext (BufferOp);
223     if (BufferOp->Asl.ParseOpcode != PARSEOP_DEFAULT_ARG)
224     {
225         while (BufferOp)
226         {
227             *VendorData = (UINT8) BufferOp->Asl.Value.Integer;
228             VendorData++;
229             ActualLength++;
230             BufferOp = RsCompleteNodeAndGetNext (BufferOp);
231         }
232     }
233 
234     /* Length validation. Buffer cannot be of zero length */
235 
236     if ((SpecifiedLength == 0) ||
237         ((SpecifiedLength == ACPI_UINT32_MAX) && (ActualLength == 0)))
238     {
239         AslError (ASL_ERROR, ASL_MSG_BUFFER_LENGTH, InitializerOp, NULL);
240         return (FALSE);
241     }
242 
243     if (SpecifiedLength != ACPI_UINT32_MAX)
244     {
245         /* ActualLength > SpecifiedLength -> error */
246 
247         if (ActualLength > SpecifiedLength)
248         {
249             AslError (ASL_ERROR, ASL_MSG_LIST_LENGTH_LONG, InitializerOp, NULL);
250             return (FALSE);
251         }
252 
253         /* ActualLength < SpecifiedLength -> remark */
254 
255         else if (ActualLength < SpecifiedLength)
256         {
257             AslError (ASL_REMARK, ASL_MSG_LIST_LENGTH_SHORT, InitializerOp, NULL);
258             return (FALSE);
259         }
260     }
261 
262     return (TRUE);
263 }
264 
265 
266 /*******************************************************************************
267  *
268  * FUNCTION:    RsDoGpioIntDescriptor
269  *
270  * PARAMETERS:  Info                - Parse Op and resource template offset
271  *
272  * RETURN:      Completed resource node
273  *
274  * DESCRIPTION: Construct a long "GpioInt" descriptor
275  *
276  ******************************************************************************/
277 
278 ASL_RESOURCE_NODE *
279 RsDoGpioIntDescriptor (
280     ASL_RESOURCE_INFO       *Info)
281 {
282     AML_RESOURCE            *Descriptor;
283     ACPI_PARSE_OBJECT       *InitializerOp;
284     ASL_RESOURCE_NODE       *Rnode;
285     char                    *ResourceSource = NULL;
286     UINT8                   *VendorData = NULL;
287     UINT16                  *InterruptList = NULL;
288     UINT16                  *PinList = NULL;
289     UINT16                  ResSourceLength;
290     UINT16                  VendorLength;
291     UINT16                  InterruptLength;
292     UINT16                  DescriptorSize;
293     UINT32                  CurrentByteOffset;
294     UINT32                  PinCount = 0;
295     UINT32                  i;
296 
297 
298     InitializerOp = Info->DescriptorTypeOp->Asl.Child;
299     CurrentByteOffset = Info->CurrentByteOffset;
300 
301     /*
302      * Calculate lengths for fields that have variable length:
303      * 1) Resource Source string
304      * 2) Vendor Data buffer
305      * 3) PIN (interrupt) list
306      */
307     ResSourceLength = RsGetStringDataLength (InitializerOp);
308     VendorLength = RsGetBufferDataLength (InitializerOp);
309     InterruptLength = RsGetInterruptDataLength (InitializerOp);
310 
311     DescriptorSize = ACPI_AML_SIZE_LARGE (AML_RESOURCE_GPIO) +
312         ResSourceLength + VendorLength + InterruptLength;
313 
314     /* Allocate the local resource node and initialize */
315 
316     Rnode = RsAllocateResourceNode (DescriptorSize +
317         sizeof (AML_RESOURCE_LARGE_HEADER));
318 
319     Descriptor = Rnode->Buffer;
320     Descriptor->Gpio.ResourceLength = DescriptorSize;
321     Descriptor->Gpio.DescriptorType = ACPI_RESOURCE_NAME_GPIO;
322     Descriptor->Gpio.RevisionId = AML_RESOURCE_GPIO_REVISION;
323     Descriptor->Gpio.ConnectionType = AML_RESOURCE_GPIO_TYPE_INT;
324 
325     /* Build pointers to optional areas */
326 
327     InterruptList = ACPI_ADD_PTR (UINT16, Descriptor,
328         sizeof (AML_RESOURCE_GPIO));
329     PinList = InterruptList;
330     ResourceSource = ACPI_ADD_PTR (char, InterruptList, InterruptLength);
331     VendorData = ACPI_ADD_PTR (UINT8, ResourceSource, ResSourceLength);
332 
333     /* Setup offsets within the descriptor */
334 
335     Descriptor->Gpio.PinTableOffset = (UINT16)
336         ACPI_PTR_DIFF (InterruptList, Descriptor);
337 
338     Descriptor->Gpio.ResSourceOffset = (UINT16)
339         ACPI_PTR_DIFF (ResourceSource, Descriptor);
340 
341     /* Process all child initialization nodes */
342 
343     for (i = 0; InitializerOp; i++)
344     {
345         switch (i)
346         {
347         case 0: /* Interrupt Mode - edge/level [Flag] (_MOD) */
348 
349             RsSetFlagBits16 (&Descriptor->Gpio.IntFlags, InitializerOp, 0, 0);
350             RsCreateBitField (InitializerOp, ACPI_RESTAG_MODE,
351                 CurrentByteOffset + ASL_RESDESC_OFFSET (Gpio.IntFlags), 0);
352             break;
353 
354         case 1: /* Interrupt Polarity - Active high/low [Flags] (_POL) */
355 
356             RsSetFlagBits16 (&Descriptor->Gpio.IntFlags, InitializerOp, 1, 0);
357             RsCreateMultiBitField (InitializerOp, ACPI_RESTAG_POLARITY,
358                 CurrentByteOffset + ASL_RESDESC_OFFSET (Gpio.IntFlags), 1, 2);
359             break;
360 
361         case 2: /* Share Type - Default: exclusive (0) [Flags] (_SHR) */
362 
363             RsSetFlagBits16 (&Descriptor->Gpio.IntFlags, InitializerOp, 3, 0);
364             RsCreateMultiBitField (InitializerOp, ACPI_RESTAG_INTERRUPTSHARE,
365                 CurrentByteOffset + ASL_RESDESC_OFFSET (Gpio.IntFlags), 3, 2);
366             break;
367 
368         case 3: /* Pin Config [BYTE] (_PPI) */
369 
370             Descriptor->Gpio.PinConfig = (UINT8) InitializerOp->Asl.Value.Integer;
371             RsCreateByteField (InitializerOp, ACPI_RESTAG_PINCONFIG,
372                 CurrentByteOffset + ASL_RESDESC_OFFSET (Gpio.PinConfig));
373             break;
374 
375         case 4: /* Debounce Timeout [WORD] (_DBT) */
376 
377             Descriptor->Gpio.DebounceTimeout = (UINT16) InitializerOp->Asl.Value.Integer;
378             RsCreateWordField (InitializerOp, ACPI_RESTAG_DEBOUNCETIME,
379                 CurrentByteOffset + ASL_RESDESC_OFFSET (Gpio.DebounceTimeout));
380             break;
381 
382         case 5: /* ResSource [Optional Field - STRING] */
383 
384             if (ResSourceLength)
385             {
386                 /* Copy string to the descriptor */
387 
388                 strcpy (ResourceSource,
389                     InitializerOp->Asl.Value.String);
390             }
391             break;
392 
393         case 6: /* Resource Index */
394 
395             if (InitializerOp->Asl.ParseOpcode != PARSEOP_DEFAULT_ARG)
396             {
397                 Descriptor->Gpio.ResSourceIndex =
398                     (UINT8) InitializerOp->Asl.Value.Integer;
399             }
400             break;
401 
402         case 7: /* Resource Usage (consumer/producer) */
403 
404             RsSetFlagBits16 (&Descriptor->Gpio.Flags, InitializerOp, 0, 1);
405             break;
406 
407         case 8: /* Resource Tag (Descriptor Name) */
408 
409             UtAttachNamepathToOwner (Info->DescriptorTypeOp, InitializerOp);
410             break;
411 
412         case 9: /* Vendor Data (Optional - Buffer of BYTEs) (_VEN) */
413 
414             /*
415              * Always set the VendorOffset even if there is no Vendor Data.
416              * This field is required in order to calculate the length
417              * of the ResourceSource at runtime.
418              */
419             Descriptor->Gpio.VendorOffset = (UINT16)
420                 ACPI_PTR_DIFF (VendorData, Descriptor);
421 
422             if (RsGetVendorData (InitializerOp, VendorData,
423                 (CurrentByteOffset +  Descriptor->Gpio.VendorOffset)))
424             {
425                 Descriptor->Gpio.VendorLength = VendorLength;
426             }
427             break;
428 
429         default:
430             /*
431              * PINs come through here, repeatedly. Each PIN must be a WORD.
432              * NOTE: there is no "length" field for this, so from ACPI spec:
433              *  The number of pins in the table can be calculated from:
434              *  PinCount = (Resource Source Name Offset - Pin Table Offset) / 2
435              *  (implies resource source must immediately follow the pin list.)
436              *  Name: _PIN
437              */
438             *InterruptList = (UINT16) InitializerOp->Asl.Value.Integer;
439             InterruptList++;
440             PinCount++;
441 
442             /* Case 10: First interrupt number in list */
443 
444             if (i == 10)
445             {
446                 if (InitializerOp->Asl.ParseOpcode == PARSEOP_DEFAULT_ARG)
447                 {
448                     /* Must be at least one interrupt */
449 
450                     AslError (ASL_ERROR, ASL_MSG_EX_INTERRUPT_LIST_MIN,
451                         InitializerOp, NULL);
452                 }
453 
454                 /* Check now for duplicates in list */
455 
456                 RsCheckListForDuplicates (InitializerOp);
457 
458                 /* Create a named field at the start of the list */
459 
460                 RsCreateWordField (InitializerOp, ACPI_RESTAG_PIN,
461                     CurrentByteOffset + Descriptor->Gpio.PinTableOffset);
462             }
463             break;
464         }
465 
466         InitializerOp = RsCompleteNodeAndGetNext (InitializerOp);
467     }
468 
469     MpSaveGpioInfo (Info->MappingOp, Descriptor,
470         PinCount, PinList, ResourceSource);
471     return (Rnode);
472 }
473 
474 
475 /*******************************************************************************
476  *
477  * FUNCTION:    RsDoGpioIoDescriptor
478  *
479  * PARAMETERS:  Info                - Parse Op and resource template offset
480  *
481  * RETURN:      Completed resource node
482  *
483  * DESCRIPTION: Construct a long "GpioIo" descriptor
484  *
485  ******************************************************************************/
486 
487 ASL_RESOURCE_NODE *
488 RsDoGpioIoDescriptor (
489     ASL_RESOURCE_INFO       *Info)
490 {
491     AML_RESOURCE            *Descriptor;
492     ACPI_PARSE_OBJECT       *InitializerOp;
493     ASL_RESOURCE_NODE       *Rnode;
494     char                    *ResourceSource = NULL;
495     UINT8                   *VendorData = NULL;
496     UINT16                  *InterruptList = NULL;
497     UINT16                  *PinList = NULL;
498     UINT16                  ResSourceLength;
499     UINT16                  VendorLength;
500     UINT16                  InterruptLength;
501     UINT16                  DescriptorSize;
502     UINT32                  CurrentByteOffset;
503     UINT32                  PinCount = 0;
504     UINT32                  i;
505 
506 
507     InitializerOp = Info->DescriptorTypeOp->Asl.Child;
508     CurrentByteOffset = Info->CurrentByteOffset;
509 
510     /*
511      * Calculate lengths for fields that have variable length:
512      * 1) Resource Source string
513      * 2) Vendor Data buffer
514      * 3) PIN (interrupt) list
515      */
516     ResSourceLength = RsGetStringDataLength (InitializerOp);
517     VendorLength = RsGetBufferDataLength (InitializerOp);
518     InterruptLength = RsGetInterruptDataLength (InitializerOp);
519     PinList = InterruptList;
520 
521     DescriptorSize = ACPI_AML_SIZE_LARGE (AML_RESOURCE_GPIO) +
522         ResSourceLength + VendorLength + InterruptLength;
523 
524     /* Allocate the local resource node and initialize */
525 
526     Rnode = RsAllocateResourceNode (DescriptorSize +
527         sizeof (AML_RESOURCE_LARGE_HEADER));
528 
529     Descriptor = Rnode->Buffer;
530     Descriptor->Gpio.ResourceLength = DescriptorSize;
531     Descriptor->Gpio.DescriptorType = ACPI_RESOURCE_NAME_GPIO;
532     Descriptor->Gpio.RevisionId = AML_RESOURCE_GPIO_REVISION;
533     Descriptor->Gpio.ConnectionType = AML_RESOURCE_GPIO_TYPE_IO;
534 
535     /* Build pointers to optional areas */
536 
537     InterruptList = ACPI_ADD_PTR (UINT16, Descriptor, sizeof (AML_RESOURCE_GPIO));
538     PinList = InterruptList;
539     ResourceSource = ACPI_ADD_PTR (char, InterruptList, InterruptLength);
540     VendorData = ACPI_ADD_PTR (UINT8, ResourceSource, ResSourceLength);
541 
542     /* Setup offsets within the descriptor */
543 
544     Descriptor->Gpio.PinTableOffset = (UINT16)
545         ACPI_PTR_DIFF (InterruptList, Descriptor);
546 
547     Descriptor->Gpio.ResSourceOffset = (UINT16)
548         ACPI_PTR_DIFF (ResourceSource, Descriptor);
549 
550     /* Process all child initialization nodes */
551 
552     for (i = 0; InitializerOp; i++)
553     {
554         switch (i)
555         {
556         case 0: /* Share Type [Flags] (_SHR) */
557 
558             RsSetFlagBits16 (&Descriptor->Gpio.IntFlags, InitializerOp, 3, 0);
559             RsCreateBitField (InitializerOp, ACPI_RESTAG_INTERRUPTSHARE,
560                 CurrentByteOffset + ASL_RESDESC_OFFSET (Gpio.IntFlags), 3);
561             break;
562 
563         case 1: /* Pin Config [BYTE] (_PPI) */
564 
565             Descriptor->Gpio.PinConfig = (UINT8) InitializerOp->Asl.Value.Integer;
566             RsCreateByteField (InitializerOp, ACPI_RESTAG_PINCONFIG,
567                 CurrentByteOffset + ASL_RESDESC_OFFSET (Gpio.PinConfig));
568             break;
569 
570         case 2: /* Debounce Timeout [WORD] (_DBT) */
571 
572             Descriptor->Gpio.DebounceTimeout = (UINT16) InitializerOp->Asl.Value.Integer;
573             RsCreateWordField (InitializerOp, ACPI_RESTAG_DEBOUNCETIME,
574                 CurrentByteOffset + ASL_RESDESC_OFFSET (Gpio.DebounceTimeout));
575             break;
576 
577         case 3: /* Drive Strength [WORD] (_DRS) */
578 
579             Descriptor->Gpio.DriveStrength = (UINT16) InitializerOp->Asl.Value.Integer;
580             RsCreateWordField (InitializerOp, ACPI_RESTAG_DRIVESTRENGTH,
581                 CurrentByteOffset + ASL_RESDESC_OFFSET (Gpio.DriveStrength));
582             break;
583 
584         case 4: /* I/O Restriction [Flag] (_IOR) */
585 
586             RsSetFlagBits16 (&Descriptor->Gpio.IntFlags, InitializerOp, 0, 0);
587             RsCreateMultiBitField (InitializerOp, ACPI_RESTAG_IORESTRICTION,
588                 CurrentByteOffset + ASL_RESDESC_OFFSET (Gpio.IntFlags), 0, 2);
589             break;
590 
591         case 5: /* ResSource [Optional Field - STRING] */
592 
593             if (ResSourceLength)
594             {
595                 /* Copy string to the descriptor */
596 
597                 strcpy (ResourceSource,
598                     InitializerOp->Asl.Value.String);
599             }
600             break;
601 
602         case 6: /* Resource Index */
603 
604             if (InitializerOp->Asl.ParseOpcode != PARSEOP_DEFAULT_ARG)
605             {
606                 Descriptor->Gpio.ResSourceIndex = (UINT8) InitializerOp->Asl.Value.Integer;
607             }
608             break;
609 
610         case 7: /* Resource Usage (consumer/producer) */
611 
612             RsSetFlagBits16 (&Descriptor->Gpio.Flags, InitializerOp, 0, 1);
613             break;
614 
615         case 8: /* Resource Tag (Descriptor Name) */
616 
617             UtAttachNamepathToOwner (Info->DescriptorTypeOp, InitializerOp);
618             break;
619 
620         case 9: /* Vendor Data (Optional - Buffer of BYTEs) (_VEN) */
621             /*
622              * Always set the VendorOffset even if there is no Vendor Data.
623              * This field is required in order to calculate the length
624              * of the ResourceSource at runtime.
625              */
626             Descriptor->Gpio.VendorOffset = (UINT16)
627                 ACPI_PTR_DIFF (VendorData, Descriptor);
628 
629             if (RsGetVendorData (InitializerOp, VendorData,
630                 (CurrentByteOffset + Descriptor->Gpio.VendorOffset)))
631             {
632                 Descriptor->Gpio.VendorLength = VendorLength;
633             }
634             break;
635 
636         default:
637             /*
638              * PINs come through here, repeatedly. Each PIN must be a WORD.
639              * NOTE: there is no "length" field for this, so from ACPI spec:
640              *  The number of pins in the table can be calculated from:
641              *  PinCount = (Resource Source Name Offset - Pin Table Offset) / 2
642              *  (implies resource source must immediately follow the pin list.)
643              *  Name: _PIN
644              */
645             *InterruptList = (UINT16) InitializerOp->Asl.Value.Integer;
646             InterruptList++;
647             PinCount++;
648 
649             /* Case 10: First interrupt number in list */
650 
651             if (i == 10)
652             {
653                 if (InitializerOp->Asl.ParseOpcode == PARSEOP_DEFAULT_ARG)
654                 {
655                     /* Must be at least one interrupt */
656 
657                     AslError (ASL_ERROR, ASL_MSG_EX_INTERRUPT_LIST_MIN,
658                         InitializerOp, NULL);
659                 }
660 
661                 /* Check now for duplicates in list */
662 
663                 RsCheckListForDuplicates (InitializerOp);
664 
665                 /* Create a named field at the start of the list */
666 
667                 RsCreateWordField (InitializerOp, ACPI_RESTAG_PIN,
668                     CurrentByteOffset + Descriptor->Gpio.PinTableOffset);
669             }
670             break;
671         }
672 
673         InitializerOp = RsCompleteNodeAndGetNext (InitializerOp);
674     }
675 
676     MpSaveGpioInfo (Info->MappingOp, Descriptor,
677         PinCount, PinList, ResourceSource);
678     return (Rnode);
679 }
680 
681 
682 /*******************************************************************************
683  *
684  * FUNCTION:    RsDoI2cSerialBusDescriptor
685  *
686  * PARAMETERS:  Info                - Parse Op and resource template offset
687  *
688  * RETURN:      Completed resource node
689  *
690  * DESCRIPTION: Construct a long "I2cSerialBus" descriptor
691  *
692  ******************************************************************************/
693 
694 ASL_RESOURCE_NODE *
695 RsDoI2cSerialBusDescriptor (
696     ASL_RESOURCE_INFO       *Info)
697 {
698     AML_RESOURCE            *Descriptor;
699     ACPI_PARSE_OBJECT       *InitializerOp;
700     ASL_RESOURCE_NODE       *Rnode;
701     char                    *ResourceSource = NULL;
702     UINT8                   *VendorData = NULL;
703     UINT16                  ResSourceLength;
704     UINT16                  VendorLength;
705     UINT16                  DescriptorSize;
706     UINT32                  CurrentByteOffset;
707     UINT32                  i;
708 
709 
710     InitializerOp = Info->DescriptorTypeOp->Asl.Child;
711     CurrentByteOffset = Info->CurrentByteOffset;
712 
713     /*
714      * Calculate lengths for fields that have variable length:
715      * 1) Resource Source string
716      * 2) Vendor Data buffer
717      */
718     ResSourceLength = RsGetStringDataLength (InitializerOp);
719     VendorLength = RsGetBufferDataLength (InitializerOp);
720 
721     DescriptorSize = ACPI_AML_SIZE_LARGE (AML_RESOURCE_I2C_SERIALBUS) +
722         ResSourceLength + VendorLength;
723 
724     /* Allocate the local resource node and initialize */
725 
726     Rnode = RsAllocateResourceNode (DescriptorSize +
727         sizeof (AML_RESOURCE_LARGE_HEADER));
728 
729     Descriptor = Rnode->Buffer;
730     Descriptor->I2cSerialBus.ResourceLength = DescriptorSize;
731     Descriptor->I2cSerialBus.DescriptorType = ACPI_RESOURCE_NAME_SERIAL_BUS;
732     Descriptor->I2cSerialBus.RevisionId = AML_RESOURCE_I2C_REVISION;
733     Descriptor->I2cSerialBus.TypeRevisionId = AML_RESOURCE_I2C_TYPE_REVISION;
734     Descriptor->I2cSerialBus.Type = AML_RESOURCE_I2C_SERIALBUSTYPE;
735     Descriptor->I2cSerialBus.TypeDataLength = AML_RESOURCE_I2C_MIN_DATA_LEN + VendorLength;
736 
737     /* Build pointers to optional areas */
738 
739     VendorData = ACPI_ADD_PTR (UINT8, Descriptor, sizeof (AML_RESOURCE_I2C_SERIALBUS));
740     ResourceSource = ACPI_ADD_PTR (char, VendorData, VendorLength);
741 
742     /* Process all child initialization nodes */
743 
744     for (i = 0; InitializerOp; i++)
745     {
746         switch (i)
747         {
748         case 0: /* Slave Address [WORD] (_ADR) */
749 
750             Descriptor->I2cSerialBus.SlaveAddress = (UINT16) InitializerOp->Asl.Value.Integer;
751             RsCreateWordField (InitializerOp, ACPI_RESTAG_ADDRESS,
752                 CurrentByteOffset + ASL_RESDESC_OFFSET (I2cSerialBus.SlaveAddress));
753             break;
754 
755         case 1: /* Slave Mode [Flag] (_SLV) */
756 
757             RsSetFlagBits (&Descriptor->I2cSerialBus.Flags, InitializerOp, 0, 0);
758             RsCreateBitField (InitializerOp, ACPI_RESTAG_SLAVEMODE,
759                 CurrentByteOffset + ASL_RESDESC_OFFSET (I2cSerialBus.Flags), 0);
760             break;
761 
762         case 2: /* Connection Speed [DWORD] (_SPE) */
763 
764             Descriptor->I2cSerialBus.ConnectionSpeed = (UINT32) InitializerOp->Asl.Value.Integer;
765             RsCreateDwordField (InitializerOp, ACPI_RESTAG_SPEED,
766                 CurrentByteOffset + ASL_RESDESC_OFFSET (I2cSerialBus.ConnectionSpeed));
767             break;
768 
769         case 3: /* Addressing Mode [Flag] (_MOD) */
770 
771             RsSetFlagBits16 (&Descriptor->I2cSerialBus.TypeSpecificFlags, InitializerOp, 0, 0);
772             RsCreateBitField (InitializerOp, ACPI_RESTAG_MODE,
773                 CurrentByteOffset + ASL_RESDESC_OFFSET (I2cSerialBus.TypeSpecificFlags), 0);
774             break;
775 
776         case 4: /* ResSource [Optional Field - STRING] */
777 
778             if (ResSourceLength)
779             {
780                 /* Copy string to the descriptor */
781 
782                 strcpy (ResourceSource,
783                     InitializerOp->Asl.Value.String);
784             }
785             break;
786 
787         case 5: /* Resource Index */
788 
789             if (InitializerOp->Asl.ParseOpcode != PARSEOP_DEFAULT_ARG)
790             {
791                 Descriptor->I2cSerialBus.ResSourceIndex =
792                     (UINT8) InitializerOp->Asl.Value.Integer;
793             }
794             break;
795 
796         case 6: /* Resource Usage (consumer/producer) */
797 
798             RsSetFlagBits (&Descriptor->I2cSerialBus.Flags, InitializerOp, 1, 1);
799             break;
800 
801         case 7: /* Resource Tag (Descriptor Name) */
802 
803             UtAttachNamepathToOwner (Info->DescriptorTypeOp, InitializerOp);
804             break;
805 
806         case 8: /* Vendor Data (Optional - Buffer of BYTEs) (_VEN) */
807 
808             RsGetVendorData (InitializerOp, VendorData,
809                 CurrentByteOffset + sizeof (AML_RESOURCE_I2C_SERIALBUS));
810             break;
811 
812         default:    /* Ignore any extra nodes */
813 
814             break;
815         }
816 
817         InitializerOp = RsCompleteNodeAndGetNext (InitializerOp);
818     }
819 
820     MpSaveSerialInfo (Info->MappingOp, Descriptor, ResourceSource);
821     return (Rnode);
822 }
823 
824 
825 /*******************************************************************************
826  *
827  * FUNCTION:    RsDoSpiSerialBusDescriptor
828  *
829  * PARAMETERS:  Info                - Parse Op and resource template offset
830  *
831  * RETURN:      Completed resource node
832  *
833  * DESCRIPTION: Construct a long "SPI Serial Bus" descriptor
834  *
835  ******************************************************************************/
836 
837 ASL_RESOURCE_NODE *
838 RsDoSpiSerialBusDescriptor (
839     ASL_RESOURCE_INFO       *Info)
840 {
841     AML_RESOURCE            *Descriptor;
842     ACPI_PARSE_OBJECT       *InitializerOp;
843     ASL_RESOURCE_NODE       *Rnode;
844     char                    *ResourceSource = NULL;
845     UINT8                   *VendorData = NULL;
846     UINT16                  ResSourceLength;
847     UINT16                  VendorLength;
848     UINT16                  DescriptorSize;
849     UINT32                  CurrentByteOffset;
850     UINT32                  i;
851 
852 
853     InitializerOp = Info->DescriptorTypeOp->Asl.Child;
854     CurrentByteOffset = Info->CurrentByteOffset;
855 
856     /*
857      * Calculate lengths for fields that have variable length:
858      * 1) Resource Source string
859      * 2) Vendor Data buffer
860      */
861     ResSourceLength = RsGetStringDataLength (InitializerOp);
862     VendorLength = RsGetBufferDataLength (InitializerOp);
863 
864     DescriptorSize = ACPI_AML_SIZE_LARGE (AML_RESOURCE_SPI_SERIALBUS) +
865         ResSourceLength + VendorLength;
866 
867     /* Allocate the local resource node and initialize */
868 
869     Rnode = RsAllocateResourceNode (DescriptorSize +
870         sizeof (AML_RESOURCE_LARGE_HEADER));
871 
872     Descriptor = Rnode->Buffer;
873     Descriptor->SpiSerialBus.ResourceLength = DescriptorSize;
874     Descriptor->SpiSerialBus.DescriptorType = ACPI_RESOURCE_NAME_SERIAL_BUS;
875     Descriptor->SpiSerialBus.RevisionId = AML_RESOURCE_SPI_REVISION;
876     Descriptor->SpiSerialBus.TypeRevisionId = AML_RESOURCE_SPI_TYPE_REVISION;
877     Descriptor->SpiSerialBus.Type = AML_RESOURCE_SPI_SERIALBUSTYPE;
878     Descriptor->SpiSerialBus.TypeDataLength = AML_RESOURCE_SPI_MIN_DATA_LEN + VendorLength;
879 
880     /* Build pointers to optional areas */
881 
882     VendorData = ACPI_ADD_PTR (UINT8, Descriptor,
883         sizeof (AML_RESOURCE_SPI_SERIALBUS));
884     ResourceSource = ACPI_ADD_PTR (char, VendorData, VendorLength);
885 
886     /* Process all child initialization nodes */
887 
888     for (i = 0; InitializerOp; i++)
889     {
890         switch (i)
891         {
892         case 0: /* Device Selection [WORD] (_ADR) */
893 
894             Descriptor->SpiSerialBus.DeviceSelection = (UINT16) InitializerOp->Asl.Value.Integer;
895             RsCreateWordField (InitializerOp, ACPI_RESTAG_ADDRESS,
896                 CurrentByteOffset + ASL_RESDESC_OFFSET (SpiSerialBus.DeviceSelection));
897             break;
898 
899         case 1: /* Device Polarity [Flag] (_DPL) */
900 
901             RsSetFlagBits16 (&Descriptor->SpiSerialBus.TypeSpecificFlags, InitializerOp, 1, 0);
902             RsCreateBitField (InitializerOp, ACPI_RESTAG_DEVICEPOLARITY,
903                 CurrentByteOffset + ASL_RESDESC_OFFSET (SpiSerialBus.TypeSpecificFlags), 1);
904             break;
905 
906         case 2: /* Wire Mode [Flag] (_MOD) */
907 
908             RsSetFlagBits16 (&Descriptor->SpiSerialBus.TypeSpecificFlags, InitializerOp, 0, 0);
909             RsCreateBitField (InitializerOp, ACPI_RESTAG_MODE,
910                 CurrentByteOffset + ASL_RESDESC_OFFSET (SpiSerialBus.TypeSpecificFlags), 0);
911             break;
912 
913         case 3: /* Device Bit Length [BYTE] (_LEN) */
914 
915             Descriptor->SpiSerialBus.DataBitLength = (UINT8) InitializerOp->Asl.Value.Integer;
916             RsCreateByteField (InitializerOp, ACPI_RESTAG_LENGTH,
917                 CurrentByteOffset + ASL_RESDESC_OFFSET (SpiSerialBus.DataBitLength));
918             break;
919 
920         case 4: /* Slave Mode [Flag] (_SLV) */
921 
922             RsSetFlagBits (&Descriptor->SpiSerialBus.Flags, InitializerOp, 0, 0);
923             RsCreateBitField (InitializerOp, ACPI_RESTAG_SLAVEMODE,
924                 CurrentByteOffset + ASL_RESDESC_OFFSET (SpiSerialBus.Flags), 0);
925             break;
926 
927         case 5: /* Connection Speed [DWORD] (_SPE) */
928 
929             Descriptor->SpiSerialBus.ConnectionSpeed = (UINT32) InitializerOp->Asl.Value.Integer;
930             RsCreateDwordField (InitializerOp, ACPI_RESTAG_SPEED,
931                 CurrentByteOffset + ASL_RESDESC_OFFSET (SpiSerialBus.ConnectionSpeed));
932             break;
933 
934         case 6: /* Clock Polarity [BYTE] (_POL) */
935 
936             Descriptor->SpiSerialBus.ClockPolarity = (UINT8) InitializerOp->Asl.Value.Integer;
937             RsCreateByteField (InitializerOp, ACPI_RESTAG_POLARITY,
938                 CurrentByteOffset + ASL_RESDESC_OFFSET (SpiSerialBus.ClockPolarity));
939             break;
940 
941         case 7: /* Clock Phase [BYTE] (_PHA) */
942 
943             Descriptor->SpiSerialBus.ClockPhase = (UINT8) InitializerOp->Asl.Value.Integer;
944             RsCreateByteField (InitializerOp, ACPI_RESTAG_PHASE,
945                 CurrentByteOffset + ASL_RESDESC_OFFSET (SpiSerialBus.ClockPhase));
946             break;
947 
948         case 8: /* ResSource [Optional Field - STRING] */
949 
950             if (ResSourceLength)
951             {
952                 /* Copy string to the descriptor */
953 
954                 strcpy (ResourceSource,
955                     InitializerOp->Asl.Value.String);
956             }
957             break;
958 
959         case 9: /* Resource Index */
960 
961             if (InitializerOp->Asl.ParseOpcode != PARSEOP_DEFAULT_ARG)
962             {
963                 Descriptor->SpiSerialBus.ResSourceIndex =
964                     (UINT8) InitializerOp->Asl.Value.Integer;
965             }
966             break;
967 
968         case 10: /* Resource Usage (consumer/producer) */
969 
970             RsSetFlagBits (&Descriptor->SpiSerialBus.Flags, InitializerOp, 1, 1);
971             break;
972 
973         case 11: /* Resource Tag (Descriptor Name) */
974 
975             UtAttachNamepathToOwner (Info->DescriptorTypeOp, InitializerOp);
976             break;
977 
978         case 12: /* Vendor Data (Optional - Buffer of BYTEs) (_VEN) */
979 
980             RsGetVendorData (InitializerOp, VendorData,
981                 CurrentByteOffset + sizeof (AML_RESOURCE_SPI_SERIALBUS));
982             break;
983 
984         default:    /* Ignore any extra nodes */
985 
986             break;
987         }
988 
989         InitializerOp = RsCompleteNodeAndGetNext (InitializerOp);
990     }
991 
992     MpSaveSerialInfo (Info->MappingOp, Descriptor, ResourceSource);
993     return (Rnode);
994 }
995 
996 
997 /*******************************************************************************
998  *
999  * FUNCTION:    RsDoUartSerialBusDescriptor
1000  *
1001  * PARAMETERS:  Info                - Parse Op and resource template offset
1002  *
1003  * RETURN:      Completed resource node
1004  *
1005  * DESCRIPTION: Construct a long "UART Serial Bus" descriptor
1006  *
1007  ******************************************************************************/
1008 
1009 ASL_RESOURCE_NODE *
1010 RsDoUartSerialBusDescriptor (
1011     ASL_RESOURCE_INFO       *Info)
1012 {
1013     AML_RESOURCE            *Descriptor;
1014     ACPI_PARSE_OBJECT       *InitializerOp;
1015     ASL_RESOURCE_NODE       *Rnode;
1016     char                    *ResourceSource = NULL;
1017     UINT8                   *VendorData = NULL;
1018     UINT16                  ResSourceLength;
1019     UINT16                  VendorLength;
1020     UINT16                  DescriptorSize;
1021     UINT32                  CurrentByteOffset;
1022     UINT32                  i;
1023 
1024 
1025     InitializerOp = Info->DescriptorTypeOp->Asl.Child;
1026     CurrentByteOffset = Info->CurrentByteOffset;
1027 
1028     /*
1029      * Calculate lengths for fields that have variable length:
1030      * 1) Resource Source string
1031      * 2) Vendor Data buffer
1032      */
1033     ResSourceLength = RsGetStringDataLength (InitializerOp);
1034     VendorLength = RsGetBufferDataLength (InitializerOp);
1035 
1036     DescriptorSize = ACPI_AML_SIZE_LARGE (AML_RESOURCE_UART_SERIALBUS) +
1037         ResSourceLength + VendorLength;
1038 
1039     /* Allocate the local resource node and initialize */
1040 
1041     Rnode = RsAllocateResourceNode (DescriptorSize +
1042         sizeof (AML_RESOURCE_LARGE_HEADER));
1043 
1044     Descriptor = Rnode->Buffer;
1045     Descriptor->UartSerialBus.ResourceLength = DescriptorSize;
1046     Descriptor->UartSerialBus.DescriptorType = ACPI_RESOURCE_NAME_SERIAL_BUS;
1047     Descriptor->UartSerialBus.RevisionId = AML_RESOURCE_UART_REVISION;
1048     Descriptor->UartSerialBus.TypeRevisionId = AML_RESOURCE_UART_TYPE_REVISION;
1049     Descriptor->UartSerialBus.Type = AML_RESOURCE_UART_SERIALBUSTYPE;
1050     Descriptor->UartSerialBus.TypeDataLength = AML_RESOURCE_UART_MIN_DATA_LEN + VendorLength;
1051 
1052     /* Build pointers to optional areas */
1053 
1054     VendorData = ACPI_ADD_PTR (UINT8, Descriptor, sizeof (AML_RESOURCE_UART_SERIALBUS));
1055     ResourceSource = ACPI_ADD_PTR (char, VendorData, VendorLength);
1056 
1057     /* Process all child initialization nodes */
1058 
1059     for (i = 0; InitializerOp; i++)
1060     {
1061         switch (i)
1062         {
1063         case 0: /* Connection Speed (Baud Rate) [DWORD] (_SPE) */
1064 
1065             Descriptor->UartSerialBus.DefaultBaudRate = (UINT32) InitializerOp->Asl.Value.Integer;
1066             RsCreateDwordField (InitializerOp, ACPI_RESTAG_SPEED,
1067                 CurrentByteOffset + ASL_RESDESC_OFFSET (UartSerialBus.DefaultBaudRate));
1068             break;
1069 
1070         case 1: /* Bits Per Byte [Flags] (_LEN) */
1071 
1072             RsSetFlagBits16 (&Descriptor->UartSerialBus.TypeSpecificFlags, InitializerOp, 4, 3);
1073             RsCreateMultiBitField (InitializerOp, ACPI_RESTAG_LENGTH,
1074                 CurrentByteOffset + ASL_RESDESC_OFFSET (UartSerialBus.TypeSpecificFlags), 4, 3);
1075             break;
1076 
1077         case 2: /* Stop Bits [Flags] (_STB) */
1078 
1079             RsSetFlagBits16 (&Descriptor->UartSerialBus.TypeSpecificFlags, InitializerOp, 2, 1);
1080             RsCreateMultiBitField (InitializerOp, ACPI_RESTAG_STOPBITS,
1081                 CurrentByteOffset + ASL_RESDESC_OFFSET (UartSerialBus.TypeSpecificFlags), 2, 2);
1082             break;
1083 
1084         case 3: /* Lines In Use [BYTE] (_LIN) */
1085 
1086             Descriptor->UartSerialBus.LinesEnabled = (UINT8) InitializerOp->Asl.Value.Integer;
1087             RsCreateByteField (InitializerOp, ACPI_RESTAG_LINE,
1088                 CurrentByteOffset + ASL_RESDESC_OFFSET (UartSerialBus.LinesEnabled));
1089             break;
1090 
1091         case 4: /* Endianness [Flag] (_END) */
1092 
1093             RsSetFlagBits16 (&Descriptor->UartSerialBus.TypeSpecificFlags, InitializerOp, 7, 0);
1094             RsCreateBitField (InitializerOp, ACPI_RESTAG_ENDIANNESS,
1095                 CurrentByteOffset + ASL_RESDESC_OFFSET (UartSerialBus.TypeSpecificFlags), 7);
1096             break;
1097 
1098         case 5: /* Parity [BYTE] (_PAR) */
1099 
1100             Descriptor->UartSerialBus.Parity = (UINT8) InitializerOp->Asl.Value.Integer;
1101             RsCreateByteField (InitializerOp, ACPI_RESTAG_PARITY,
1102                 CurrentByteOffset + ASL_RESDESC_OFFSET (UartSerialBus.Parity));
1103             break;
1104 
1105         case 6: /* Flow Control [Flags] (_FLC) */
1106 
1107             RsSetFlagBits16 (&Descriptor->UartSerialBus.TypeSpecificFlags, InitializerOp, 0, 0);
1108             RsCreateMultiBitField (InitializerOp, ACPI_RESTAG_FLOWCONTROL,
1109                 CurrentByteOffset + ASL_RESDESC_OFFSET (UartSerialBus.TypeSpecificFlags), 0, 2);
1110             break;
1111 
1112         case 7: /* Rx Buffer Size [WORD] (_RXL) */
1113 
1114             Descriptor->UartSerialBus.RxFifoSize = (UINT16) InitializerOp->Asl.Value.Integer;
1115             RsCreateWordField (InitializerOp, ACPI_RESTAG_LENGTH_RX,
1116                 CurrentByteOffset + ASL_RESDESC_OFFSET (UartSerialBus.RxFifoSize));
1117             break;
1118 
1119         case 8: /* Tx Buffer Size [WORD] (_TXL) */
1120 
1121             Descriptor->UartSerialBus.TxFifoSize = (UINT16) InitializerOp->Asl.Value.Integer;
1122             RsCreateWordField (InitializerOp, ACPI_RESTAG_LENGTH_TX,
1123                 CurrentByteOffset + ASL_RESDESC_OFFSET (UartSerialBus.TxFifoSize));
1124             break;
1125 
1126         case 9: /* ResSource [Optional Field - STRING] */
1127 
1128             if (ResSourceLength)
1129             {
1130                 /* Copy string to the descriptor */
1131 
1132                 strcpy (ResourceSource,
1133                     InitializerOp->Asl.Value.String);
1134             }
1135             break;
1136 
1137         case 10: /* Resource Index */
1138 
1139             if (InitializerOp->Asl.ParseOpcode != PARSEOP_DEFAULT_ARG)
1140             {
1141                 Descriptor->UartSerialBus.ResSourceIndex =
1142                     (UINT8) InitializerOp->Asl.Value.Integer;
1143             }
1144             break;
1145 
1146         case 11: /* Resource Usage (consumer/producer) */
1147 
1148             RsSetFlagBits (&Descriptor->UartSerialBus.Flags, InitializerOp, 1, 1);
1149 
1150             /*
1151              * Slave Mode [Flag] (_SLV)
1152              *
1153              * Note: There is no SlaveMode argument to the UartSerialBus macro, but
1154              * we add this name anyway to allow the flag to be set by ASL in the
1155              * rare case where there is a slave mode associated with the UART.
1156              */
1157             RsCreateBitField (InitializerOp, ACPI_RESTAG_SLAVEMODE,
1158                 CurrentByteOffset + ASL_RESDESC_OFFSET (UartSerialBus.Flags), 0);
1159             break;
1160 
1161         case 12: /* Resource Tag (Descriptor Name) */
1162 
1163             UtAttachNamepathToOwner (Info->DescriptorTypeOp, InitializerOp);
1164             break;
1165 
1166         case 13: /* Vendor Data (Optional - Buffer of BYTEs) (_VEN) */
1167 
1168             RsGetVendorData (InitializerOp, VendorData,
1169                 CurrentByteOffset + sizeof (AML_RESOURCE_UART_SERIALBUS));
1170             break;
1171 
1172         default:    /* Ignore any extra nodes */
1173 
1174             break;
1175         }
1176 
1177         InitializerOp = RsCompleteNodeAndGetNext (InitializerOp);
1178     }
1179 
1180     MpSaveSerialInfo (Info->MappingOp, Descriptor, ResourceSource);
1181     return (Rnode);
1182 }
1183