73f3efe6cabf954bfcdaeb493736392bc981b651
[dragonfly.git] / sys / contrib / dev / acpica / source / compiler / aslrestype1.c
1 /******************************************************************************
2  *
3  * Module Name: aslrestype1 - Miscellaneous small resource descriptors
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 "aslcompiler.h"
45 #include "aslcompiler.y.h"
46
47 #define _COMPONENT          ACPI_COMPILER
48         ACPI_MODULE_NAME    ("aslrestype1")
49
50 /*
51  * This module contains miscellaneous small resource descriptors:
52  *
53  * EndTag
54  * EndDependentFn
55  * Memory24
56  * Memory32
57  * Memory32Fixed
58  * StartDependentFn
59  * StartDependentFnNoPri
60  * VendorShort
61  */
62
63 /*******************************************************************************
64  *
65  * FUNCTION:    RsDoEndTagDescriptor
66  *
67  * PARAMETERS:  Op                  - Parent resource descriptor parse node
68  *              CurrentByteOffset   - Offset into the resource template AML
69  *                                    buffer (to track references to the desc)
70  *
71  * RETURN:      Completed resource node
72  *
73  * DESCRIPTION: Construct a short "EndDependentFn" descriptor
74  *
75  ******************************************************************************/
76
77 ASL_RESOURCE_NODE *
78 RsDoEndTagDescriptor (
79     ACPI_PARSE_OBJECT       *Op,
80     UINT32                  CurrentByteOffset)
81 {
82     AML_RESOURCE            *Descriptor;
83     ASL_RESOURCE_NODE       *Rnode;
84
85
86     Rnode = RsAllocateResourceNode (sizeof (AML_RESOURCE_END_TAG));
87
88     Descriptor = Rnode->Buffer;
89     Descriptor->EndTag.DescriptorType = ACPI_RESOURCE_NAME_END_TAG |
90                                         ASL_RDESC_END_TAG_SIZE;
91     Descriptor->EndTag.Checksum = 0;
92
93     return (Rnode);
94 }
95
96
97 /*******************************************************************************
98  *
99  * FUNCTION:    RsDoEndDependentDescriptor
100  *
101  * PARAMETERS:  Op                  - Parent resource descriptor parse node
102  *              CurrentByteOffset   - Offset into the resource template AML
103  *                                    buffer (to track references to the desc)
104  *
105  * RETURN:      Completed resource node
106  *
107  * DESCRIPTION: Construct a short "EndDependentFn" descriptor
108  *
109  ******************************************************************************/
110
111 ASL_RESOURCE_NODE *
112 RsDoEndDependentDescriptor (
113     ACPI_PARSE_OBJECT       *Op,
114     UINT32                  CurrentByteOffset)
115 {
116     AML_RESOURCE            *Descriptor;
117     ASL_RESOURCE_NODE       *Rnode;
118
119
120     Rnode = RsAllocateResourceNode (sizeof (AML_RESOURCE_END_DEPENDENT));
121
122     Descriptor = Rnode->Buffer;
123     Descriptor->EndDpf.DescriptorType  = ACPI_RESOURCE_NAME_END_DEPENDENT |
124                                       ASL_RDESC_END_DEPEND_SIZE;
125     return (Rnode);
126 }
127
128
129 /*******************************************************************************
130  *
131  * FUNCTION:    RsDoMemory24Descriptor
132  *
133  * PARAMETERS:  Op                  - Parent resource descriptor parse node
134  *              CurrentByteOffset   - Offset into the resource template AML
135  *                                    buffer (to track references to the desc)
136  *
137  * RETURN:      Completed resource node
138  *
139  * DESCRIPTION: Construct a short "Memory24" descriptor
140  *
141  ******************************************************************************/
142
143 ASL_RESOURCE_NODE *
144 RsDoMemory24Descriptor (
145     ACPI_PARSE_OBJECT       *Op,
146     UINT32                  CurrentByteOffset)
147 {
148     AML_RESOURCE            *Descriptor;
149     ACPI_PARSE_OBJECT       *InitializerOp;
150     ACPI_PARSE_OBJECT       *MinOp = NULL;
151     ACPI_PARSE_OBJECT       *MaxOp = NULL;
152     ACPI_PARSE_OBJECT       *LengthOp = NULL;
153     ASL_RESOURCE_NODE       *Rnode;
154     UINT32                  i;
155
156
157     InitializerOp = Op->Asl.Child;
158     Rnode = RsAllocateResourceNode (sizeof (AML_RESOURCE_MEMORY24));
159
160     Descriptor = Rnode->Buffer;
161     Descriptor->Memory24.DescriptorType  = ACPI_RESOURCE_NAME_MEMORY24;
162     Descriptor->Memory24.ResourceLength = 9;
163
164     /* Process all child initialization nodes */
165
166     for (i = 0; InitializerOp; i++)
167     {
168         switch (i)
169         {
170         case 0: /* Read/Write type */
171
172             RsSetFlagBits (&Descriptor->Memory24.Flags, InitializerOp, 0, 1);
173             RsCreateBitField (InitializerOp, ACPI_RESTAG_READWRITETYPE,
174                 CurrentByteOffset + ASL_RESDESC_OFFSET (Memory24.Flags), 0);
175             break;
176
177         case 1: /* Min Address */
178
179             Descriptor->Memory24.Minimum = (UINT16) InitializerOp->Asl.Value.Integer;
180             RsCreateWordField (InitializerOp, ACPI_RESTAG_MINADDR,
181                 CurrentByteOffset + ASL_RESDESC_OFFSET (Memory24.Minimum));
182             MinOp = InitializerOp;
183             break;
184
185         case 2: /* Max Address */
186
187             Descriptor->Memory24.Maximum = (UINT16) InitializerOp->Asl.Value.Integer;
188             RsCreateWordField (InitializerOp, ACPI_RESTAG_MAXADDR,
189                 CurrentByteOffset + ASL_RESDESC_OFFSET (Memory24.Maximum));
190             MaxOp = InitializerOp;
191             break;
192
193         case 3: /* Alignment */
194
195             Descriptor->Memory24.Alignment = (UINT16) InitializerOp->Asl.Value.Integer;
196             RsCreateWordField (InitializerOp, ACPI_RESTAG_ALIGNMENT,
197                 CurrentByteOffset + ASL_RESDESC_OFFSET (Memory24.Alignment));
198             break;
199
200         case 4: /* Length */
201
202             Descriptor->Memory24.AddressLength = (UINT16) InitializerOp->Asl.Value.Integer;
203             RsCreateWordField (InitializerOp, ACPI_RESTAG_LENGTH,
204                 CurrentByteOffset + ASL_RESDESC_OFFSET (Memory24.AddressLength));
205             LengthOp = InitializerOp;
206             break;
207
208         case 5: /* Name */
209
210             UtAttachNamepathToOwner (Op, InitializerOp);
211             break;
212
213         default:
214
215             AslError (ASL_ERROR, ASL_MSG_RESOURCE_LIST, InitializerOp, NULL);
216             break;
217         }
218
219         InitializerOp = RsCompleteNodeAndGetNext (InitializerOp);
220     }
221
222     /* Validate the Min/Max/Len/Align values (Alignment==0 means 64K) */
223
224     RsSmallAddressCheck (ACPI_RESOURCE_NAME_MEMORY24,
225         Descriptor->Memory24.Minimum,
226         Descriptor->Memory24.Maximum,
227         Descriptor->Memory24.AddressLength,
228         Descriptor->Memory24.Alignment,
229         MinOp, MaxOp, LengthOp, NULL, Op);
230
231     return (Rnode);
232 }
233
234
235 /*******************************************************************************
236  *
237  * FUNCTION:    RsDoMemory32Descriptor
238  *
239  * PARAMETERS:  Op                  - Parent resource descriptor parse node
240  *              CurrentByteOffset   - Offset into the resource template AML
241  *                                    buffer (to track references to the desc)
242  *
243  * RETURN:      Completed resource node
244  *
245  * DESCRIPTION: Construct a short "Memory32" descriptor
246  *
247  ******************************************************************************/
248
249 ASL_RESOURCE_NODE *
250 RsDoMemory32Descriptor (
251     ACPI_PARSE_OBJECT       *Op,
252     UINT32                  CurrentByteOffset)
253 {
254     AML_RESOURCE            *Descriptor;
255     ACPI_PARSE_OBJECT       *InitializerOp;
256     ACPI_PARSE_OBJECT       *MinOp = NULL;
257     ACPI_PARSE_OBJECT       *MaxOp = NULL;
258     ACPI_PARSE_OBJECT       *LengthOp = NULL;
259     ACPI_PARSE_OBJECT       *AlignOp = NULL;
260     ASL_RESOURCE_NODE       *Rnode;
261     UINT32                  i;
262
263
264     InitializerOp = Op->Asl.Child;
265     Rnode = RsAllocateResourceNode (sizeof (AML_RESOURCE_MEMORY32));
266
267     Descriptor = Rnode->Buffer;
268     Descriptor->Memory32.DescriptorType  = ACPI_RESOURCE_NAME_MEMORY32;
269     Descriptor->Memory32.ResourceLength = 17;
270
271     /* Process all child initialization nodes */
272
273     for (i = 0; InitializerOp; i++)
274     {
275         switch (i)
276         {
277         case 0: /* Read/Write type */
278
279             RsSetFlagBits (&Descriptor->Memory32.Flags, InitializerOp, 0, 1);
280             RsCreateBitField (InitializerOp, ACPI_RESTAG_READWRITETYPE,
281                 CurrentByteOffset + ASL_RESDESC_OFFSET (Memory32.Flags), 0);
282             break;
283
284         case 1:  /* Min Address */
285
286             Descriptor->Memory32.Minimum = (UINT32) InitializerOp->Asl.Value.Integer;
287             RsCreateDwordField (InitializerOp, ACPI_RESTAG_MINADDR,
288                 CurrentByteOffset + ASL_RESDESC_OFFSET (Memory32.Minimum));
289             MinOp = InitializerOp;
290             break;
291
292         case 2: /* Max Address */
293
294             Descriptor->Memory32.Maximum = (UINT32) InitializerOp->Asl.Value.Integer;
295             RsCreateDwordField (InitializerOp, ACPI_RESTAG_MAXADDR,
296                 CurrentByteOffset + ASL_RESDESC_OFFSET (Memory32.Maximum));
297             MaxOp = InitializerOp;
298             break;
299
300         case 3: /* Alignment */
301
302             Descriptor->Memory32.Alignment = (UINT32) InitializerOp->Asl.Value.Integer;
303             RsCreateDwordField (InitializerOp, ACPI_RESTAG_ALIGNMENT,
304                 CurrentByteOffset + ASL_RESDESC_OFFSET (Memory32.Alignment));
305             AlignOp = InitializerOp;
306             break;
307
308         case 4: /* Length */
309
310             Descriptor->Memory32.AddressLength = (UINT32) InitializerOp->Asl.Value.Integer;
311             RsCreateDwordField (InitializerOp, ACPI_RESTAG_LENGTH,
312                 CurrentByteOffset + ASL_RESDESC_OFFSET (Memory32.AddressLength));
313             LengthOp = InitializerOp;
314             break;
315
316         case 5: /* Name */
317
318             UtAttachNamepathToOwner (Op, InitializerOp);
319             break;
320
321         default:
322
323             AslError (ASL_ERROR, ASL_MSG_RESOURCE_LIST, InitializerOp, NULL);
324             break;
325         }
326
327         InitializerOp = RsCompleteNodeAndGetNext (InitializerOp);
328     }
329
330     /* Validate the Min/Max/Len/Align values */
331
332     RsSmallAddressCheck (ACPI_RESOURCE_NAME_MEMORY32,
333         Descriptor->Memory32.Minimum,
334         Descriptor->Memory32.Maximum,
335         Descriptor->Memory32.AddressLength,
336         Descriptor->Memory32.Alignment,
337         MinOp, MaxOp, LengthOp, AlignOp, Op);
338
339     return (Rnode);
340 }
341
342
343 /*******************************************************************************
344  *
345  * FUNCTION:    RsDoMemory32FixedDescriptor
346  *
347  * PARAMETERS:  Op                  - Parent resource descriptor parse node
348  *              CurrentByteOffset   - Offset into the resource template AML
349  *                                    buffer (to track references to the desc)
350  *
351  * RETURN:      Completed resource node
352  *
353  * DESCRIPTION: Construct a short "Memory32Fixed" descriptor
354  *
355  ******************************************************************************/
356
357 ASL_RESOURCE_NODE *
358 RsDoMemory32FixedDescriptor (
359     ACPI_PARSE_OBJECT       *Op,
360     UINT32                  CurrentByteOffset)
361 {
362     AML_RESOURCE            *Descriptor;
363     ACPI_PARSE_OBJECT       *InitializerOp;
364     ASL_RESOURCE_NODE       *Rnode;
365     UINT32                  i;
366
367
368     InitializerOp = Op->Asl.Child;
369     Rnode = RsAllocateResourceNode (sizeof (AML_RESOURCE_FIXED_MEMORY32));
370
371     Descriptor = Rnode->Buffer;
372     Descriptor->FixedMemory32.DescriptorType  = ACPI_RESOURCE_NAME_FIXED_MEMORY32;
373     Descriptor->FixedMemory32.ResourceLength = 9;
374
375     /* Process all child initialization nodes */
376
377     for (i = 0; InitializerOp; i++)
378     {
379         switch (i)
380         {
381         case 0: /* Read/Write type */
382
383             RsSetFlagBits (&Descriptor->FixedMemory32.Flags, InitializerOp, 0, 1);
384             RsCreateBitField (InitializerOp, ACPI_RESTAG_READWRITETYPE,
385                 CurrentByteOffset + ASL_RESDESC_OFFSET (FixedMemory32.Flags), 0);
386             break;
387
388         case 1: /* Address */
389
390             Descriptor->FixedMemory32.Address = (UINT32) InitializerOp->Asl.Value.Integer;
391             RsCreateDwordField (InitializerOp, ACPI_RESTAG_BASEADDRESS,
392                 CurrentByteOffset + ASL_RESDESC_OFFSET (FixedMemory32.Address));
393             break;
394
395         case 2: /* Length */
396
397             Descriptor->FixedMemory32.AddressLength = (UINT32) InitializerOp->Asl.Value.Integer;
398             RsCreateDwordField (InitializerOp, ACPI_RESTAG_LENGTH,
399                 CurrentByteOffset + ASL_RESDESC_OFFSET (FixedMemory32.AddressLength));
400             break;
401
402         case 3: /* Name */
403
404             UtAttachNamepathToOwner (Op, InitializerOp);
405             break;
406
407         default:
408
409             AslError (ASL_ERROR, ASL_MSG_RESOURCE_LIST, InitializerOp, NULL);
410             break;
411         }
412
413         InitializerOp = RsCompleteNodeAndGetNext (InitializerOp);
414     }
415
416     return (Rnode);
417 }
418
419
420 /*******************************************************************************
421  *
422  * FUNCTION:    RsDoStartDependentDescriptor
423  *
424  * PARAMETERS:  Op                  - Parent resource descriptor parse node
425  *              CurrentByteOffset   - Offset into the resource template AML
426  *                                    buffer (to track references to the desc)
427  *
428  * RETURN:      Completed resource node
429  *
430  * DESCRIPTION: Construct a short "StartDependentFn" descriptor
431  *
432  ******************************************************************************/
433
434 ASL_RESOURCE_NODE *
435 RsDoStartDependentDescriptor (
436     ACPI_PARSE_OBJECT       *Op,
437     UINT32                  CurrentByteOffset)
438 {
439     AML_RESOURCE            *Descriptor;
440     ACPI_PARSE_OBJECT       *InitializerOp;
441     ASL_RESOURCE_NODE       *Rnode;
442     ASL_RESOURCE_NODE       *PreviousRnode;
443     ASL_RESOURCE_NODE       *NextRnode;
444     UINT32                  i;
445     UINT8                   State;
446
447
448     InitializerOp = Op->Asl.Child;
449     Rnode = RsAllocateResourceNode (sizeof (AML_RESOURCE_START_DEPENDENT));
450
451     PreviousRnode = Rnode;
452     Descriptor = Rnode->Buffer;
453
454     /* Increment offset past StartDependent descriptor */
455
456     CurrentByteOffset += sizeof (AML_RESOURCE_START_DEPENDENT);
457
458     /* Descriptor has priority byte */
459
460     Descriptor->StartDpf.DescriptorType  = ACPI_RESOURCE_NAME_START_DEPENDENT |
461                                       (ASL_RDESC_ST_DEPEND_SIZE + 0x01);
462
463     /* Process all child initialization nodes */
464
465     State = ACPI_RSTATE_START_DEPENDENT;
466     for (i = 0; InitializerOp; i++)
467     {
468         switch (i)
469         {
470         case 0: /* Compatibility Priority */
471
472             if ((UINT8) InitializerOp->Asl.Value.Integer > 2)
473             {
474                 AslError (ASL_ERROR, ASL_MSG_INVALID_PRIORITY,
475                     InitializerOp, NULL);
476             }
477
478             RsSetFlagBits (&Descriptor->StartDpf.Flags, InitializerOp, 0, 0);
479             break;
480
481         case 1: /* Performance/Robustness Priority */
482
483             if ((UINT8) InitializerOp->Asl.Value.Integer > 2)
484             {
485                 AslError (ASL_ERROR, ASL_MSG_INVALID_PERFORMANCE,
486                     InitializerOp, NULL);
487             }
488
489             RsSetFlagBits (&Descriptor->StartDpf.Flags, InitializerOp, 2, 0);
490             break;
491
492         default:
493
494             NextRnode = RsDoOneResourceDescriptor  (InitializerOp,
495                         CurrentByteOffset, &State);
496
497             /*
498              * Update current byte offset to indicate the number of bytes from the
499              * start of the buffer. Buffer can include multiple descriptors, we
500              * must keep track of the offset of not only each descriptor, but each
501              * element (field) within each descriptor as well.
502              */
503             CurrentByteOffset += RsLinkDescriptorChain (&PreviousRnode,
504                                     NextRnode);
505             break;
506         }
507
508         InitializerOp = RsCompleteNodeAndGetNext (InitializerOp);
509     }
510
511     return (Rnode);
512 }
513
514
515 /*******************************************************************************
516  *
517  * FUNCTION:    RsDoStartDependentNoPriDescriptor
518  *
519  * PARAMETERS:  Op                  - Parent resource descriptor parse node
520  *              CurrentByteOffset   - Offset into the resource template AML
521  *                                    buffer (to track references to the desc)
522  *
523  * RETURN:      Completed resource node
524  *
525  * DESCRIPTION: Construct a short "StartDependentNoPri" descriptor
526  *
527  ******************************************************************************/
528
529 ASL_RESOURCE_NODE *
530 RsDoStartDependentNoPriDescriptor (
531     ACPI_PARSE_OBJECT       *Op,
532     UINT32                  CurrentByteOffset)
533 {
534     AML_RESOURCE            *Descriptor;
535     ACPI_PARSE_OBJECT       *InitializerOp;
536     ASL_RESOURCE_NODE       *Rnode;
537     ASL_RESOURCE_NODE       *PreviousRnode;
538     ASL_RESOURCE_NODE       *NextRnode;
539     UINT8                   State;
540
541
542     InitializerOp = Op->Asl.Child;
543     Rnode = RsAllocateResourceNode (sizeof (AML_RESOURCE_START_DEPENDENT_NOPRIO));
544
545     Descriptor = Rnode->Buffer;
546     Descriptor->StartDpf.DescriptorType  = ACPI_RESOURCE_NAME_START_DEPENDENT |
547                                       ASL_RDESC_ST_DEPEND_SIZE;
548     PreviousRnode = Rnode;
549
550     /* Increment offset past StartDependentNoPri descriptor */
551
552     CurrentByteOffset += sizeof (AML_RESOURCE_START_DEPENDENT_NOPRIO);
553
554     /* Process all child initialization nodes */
555
556     State = ACPI_RSTATE_START_DEPENDENT;
557     while (InitializerOp)
558     {
559         NextRnode = RsDoOneResourceDescriptor  (InitializerOp,
560                         CurrentByteOffset, &State);
561
562         /*
563          * Update current byte offset to indicate the number of bytes from the
564          * start of the buffer. Buffer can include multiple descriptors, we
565          * must keep track of the offset of not only each descriptor, but each
566          * element (field) within each descriptor as well.
567          */
568         CurrentByteOffset += RsLinkDescriptorChain (&PreviousRnode, NextRnode);
569
570         InitializerOp = RsCompleteNodeAndGetNext (InitializerOp);
571     }
572
573     return (Rnode);
574 }
575
576
577 /*******************************************************************************
578  *
579  * FUNCTION:    RsDoVendorSmallDescriptor
580  *
581  * PARAMETERS:  Op                  - Parent resource descriptor parse node
582  *              CurrentByteOffset   - Offset into the resource template AML
583  *                                    buffer (to track references to the desc)
584  *
585  * RETURN:      Completed resource node
586  *
587  * DESCRIPTION: Construct a short "VendorShort" descriptor
588  *
589  ******************************************************************************/
590
591 ASL_RESOURCE_NODE *
592 RsDoVendorSmallDescriptor (
593     ACPI_PARSE_OBJECT       *Op,
594     UINT32                  CurrentByteOffset)
595 {
596     AML_RESOURCE            *Descriptor;
597     ACPI_PARSE_OBJECT       *InitializerOp;
598     ASL_RESOURCE_NODE       *Rnode;
599     UINT8                   *VendorData;
600     UINT32                  i;
601
602
603     InitializerOp = Op->Asl.Child;
604
605     /* Allocate worst case - 7 vendor bytes */
606
607     Rnode = RsAllocateResourceNode (sizeof (AML_RESOURCE_VENDOR_SMALL) + 7);
608
609     Descriptor = Rnode->Buffer;
610     Descriptor->VendorSmall.DescriptorType  = ACPI_RESOURCE_NAME_VENDOR_SMALL;
611     VendorData = ((UINT8 *) Descriptor) + sizeof (AML_RESOURCE_SMALL_HEADER);
612
613     /* Process all child initialization nodes */
614
615     InitializerOp = RsCompleteNodeAndGetNext (InitializerOp);
616     for (i = 0; InitializerOp; i++)
617     {
618         if (InitializerOp->Asl.ParseOpcode == PARSEOP_DEFAULT_ARG)
619         {
620             break;
621         }
622
623         /* Maximum 7 vendor data bytes allowed (0-6) */
624
625         if (i >= 7)
626         {
627             AslError (ASL_ERROR, ASL_MSG_VENDOR_LIST, InitializerOp, NULL);
628
629             /* Eat the excess initializers */
630
631             while (InitializerOp)
632             {
633                 InitializerOp = RsCompleteNodeAndGetNext (InitializerOp);
634             }
635             break;
636         }
637
638         VendorData[i] = (UINT8) InitializerOp->Asl.Value.Integer;
639         InitializerOp = RsCompleteNodeAndGetNext (InitializerOp);
640     }
641
642     /* Adjust the Rnode buffer size, so correct number of bytes are emitted */
643
644     Rnode->BufferLength -= (7 - i);
645
646     /* Set the length in the Type Tag */
647
648     Descriptor->VendorSmall.DescriptorType |= (UINT8) i;
649     return (Rnode);
650 }