1 /******************************************************************************
3 * Module Name: aslrestype1 - Miscellaneous small resource descriptors
5 *****************************************************************************/
7 /******************************************************************************
11 * Some or all of this work - Copyright (c) 1999 - 2021, Intel Corp.
12 * All rights reserved.
16 * 2.1. This is your license from Intel Corp. under its intellectual property
17 * rights. You may have additional license terms from the party that provided
18 * you this software, covering your right to use that party's intellectual
21 * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
22 * copy of the source code appearing in this file ("Covered Code") an
23 * irrevocable, perpetual, worldwide license under Intel's copyrights in the
24 * base code distributed originally by Intel ("Original Intel Code") to copy,
25 * make derivatives, distribute, use and display any portion of the Covered
26 * Code in any form, with the right to sublicense such rights; and
28 * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
29 * license (with the right to sublicense), under only those claims of Intel
30 * patents that are infringed by the Original Intel Code, to make, use, sell,
31 * offer to sell, and import the Covered Code and derivative works thereof
32 * solely to the minimum extent necessary to exercise the above copyright
33 * license, and in no event shall the patent license extend to any additions
34 * to or modifications of the Original Intel Code. No other license or right
35 * is granted directly or by implication, estoppel or otherwise;
37 * The above copyright and patent license is granted only if the following
42 * 3.1. Redistribution of Source with Rights to Further Distribute Source.
43 * Redistribution of source code of any substantial portion of the Covered
44 * Code or modification with rights to further distribute source must include
45 * the above Copyright Notice, the above License, this list of Conditions,
46 * and the following Disclaimer and Export Compliance provision. In addition,
47 * Licensee must cause all Covered Code to which Licensee contributes to
48 * contain a file documenting the changes Licensee made to create that Covered
49 * Code and the date of any change. Licensee must include in that file the
50 * documentation of any changes made by any predecessor Licensee. Licensee
51 * must include a prominent statement that the modification is derived,
52 * directly or indirectly, from Original Intel Code.
54 * 3.2. Redistribution of Source with no Rights to Further Distribute Source.
55 * Redistribution of source code of any substantial portion of the Covered
56 * Code or modification without rights to further distribute source must
57 * include the following Disclaimer and Export Compliance provision in the
58 * documentation and/or other materials provided with distribution. In
59 * addition, Licensee may not authorize further sublicense of source of any
60 * portion of the Covered Code, and must include terms to the effect that the
61 * license from Licensee to its licensee is limited to the intellectual
62 * property embodied in the software Licensee provides to its licensee, and
63 * not to intellectual property embodied in modifications its licensee may
66 * 3.3. Redistribution of Executable. Redistribution in executable form of any
67 * substantial portion of the Covered Code or modification must reproduce the
68 * above Copyright Notice, and the following Disclaimer and Export Compliance
69 * provision in the documentation and/or other materials provided with the
72 * 3.4. Intel retains all right, title, and interest in and to the Original
75 * 3.5. Neither the name Intel nor any other trademark owned or controlled by
76 * Intel shall be used in advertising or otherwise to promote the sale, use or
77 * other dealings in products derived from or relating to the Covered Code
78 * without prior written authorization from Intel.
80 * 4. Disclaimer and Export Compliance
82 * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
83 * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
84 * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
85 * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
86 * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
87 * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
90 * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
91 * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
92 * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
93 * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
94 * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
95 * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
96 * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
99 * 4.3. Licensee shall not export, either directly or indirectly, any of this
100 * software or system incorporating such software without first obtaining any
101 * required license or other approval from the U. S. Department of Commerce or
102 * any other agency or department of the United States Government. In the
103 * event Licensee exports any such software from the United States or
104 * re-exports any such software from a foreign destination, Licensee shall
105 * ensure that the distribution and export/re-export of the software is in
106 * compliance with all laws, regulations, orders, or other restrictions of the
107 * U.S. Export Administration Regulations. Licensee agrees that neither it nor
108 * any of its subsidiaries will export/re-export any technical data, process,
109 * software, or service, directly or indirectly, to any country for which the
110 * United States government or any agency thereof requires an export license,
111 * other governmental approval, or letter of assurance, without first obtaining
112 * such license, approval or letter.
114 *****************************************************************************
116 * Alternatively, you may choose to be licensed under the terms of the
119 * Redistribution and use in source and binary forms, with or without
120 * modification, are permitted provided that the following conditions
122 * 1. Redistributions of source code must retain the above copyright
123 * notice, this list of conditions, and the following disclaimer,
124 * without modification.
125 * 2. Redistributions in binary form must reproduce at minimum a disclaimer
126 * substantially similar to the "NO WARRANTY" disclaimer below
127 * ("Disclaimer") and any redistribution must be conditioned upon
128 * including a substantially similar Disclaimer requirement for further
129 * binary redistribution.
130 * 3. Neither the names of the above-listed copyright holders nor the names
131 * of any contributors may be used to endorse or promote products derived
132 * from this software without specific prior written permission.
134 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
135 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
136 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
137 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
138 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
139 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
140 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
141 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
142 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
143 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
144 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
146 * Alternatively, you may choose to be licensed under the terms of the
147 * GNU General Public License ("GPL") version 2 as published by the Free
148 * Software Foundation.
150 *****************************************************************************/
152 #include "aslcompiler.h"
153 #include "aslcompiler.y.h"
155 #define _COMPONENT ACPI_COMPILER
156 ACPI_MODULE_NAME ("aslrestype1")
159 * This module contains miscellaneous small resource descriptors:
167 * StartDependentFnNoPri
171 /*******************************************************************************
173 * FUNCTION: RsDoEndTagDescriptor
175 * PARAMETERS: Info - Parse Op and resource template offset
177 * RETURN: Completed resource node
179 * DESCRIPTION: Construct a short "EndDependentFn" descriptor
181 ******************************************************************************/
184 RsDoEndTagDescriptor (
185 ASL_RESOURCE_INFO *Info)
187 AML_RESOURCE *Descriptor;
188 ASL_RESOURCE_NODE *Rnode;
191 Rnode = RsAllocateResourceNode (sizeof (AML_RESOURCE_END_TAG));
193 Descriptor = Rnode->Buffer;
194 Descriptor->EndTag.DescriptorType = ACPI_RESOURCE_NAME_END_TAG |
195 ASL_RDESC_END_TAG_SIZE;
196 Descriptor->EndTag.Checksum = 0;
201 /*******************************************************************************
203 * FUNCTION: RsDoEndDependentDescriptor
205 * PARAMETERS: Info - Parse Op and resource template offset
207 * RETURN: Completed resource node
209 * DESCRIPTION: Construct a short "EndDependentFn" descriptor
211 ******************************************************************************/
214 RsDoEndDependentDescriptor (
215 ASL_RESOURCE_INFO *Info)
217 AML_RESOURCE *Descriptor;
218 ASL_RESOURCE_NODE *Rnode;
221 Rnode = RsAllocateResourceNode (sizeof (AML_RESOURCE_END_DEPENDENT));
223 Descriptor = Rnode->Buffer;
224 Descriptor->EndDpf.DescriptorType =
225 ACPI_RESOURCE_NAME_END_DEPENDENT | ASL_RDESC_END_DEPEND_SIZE;
230 /*******************************************************************************
232 * FUNCTION: RsDoMemory24Descriptor
234 * PARAMETERS: Info - Parse Op and resource template offset
236 * RETURN: Completed resource node
238 * DESCRIPTION: Construct a short "Memory24" descriptor
240 ******************************************************************************/
243 RsDoMemory24Descriptor (
244 ASL_RESOURCE_INFO *Info)
246 AML_RESOURCE *Descriptor;
247 ACPI_PARSE_OBJECT *InitializerOp;
248 ACPI_PARSE_OBJECT *MinOp = NULL;
249 ACPI_PARSE_OBJECT *MaxOp = NULL;
250 ACPI_PARSE_OBJECT *LengthOp = NULL;
251 ASL_RESOURCE_NODE *Rnode;
252 UINT32 CurrentByteOffset;
256 InitializerOp = Info->DescriptorTypeOp->Asl.Child;
257 CurrentByteOffset = Info->CurrentByteOffset;
258 Rnode = RsAllocateResourceNode (sizeof (AML_RESOURCE_MEMORY24));
260 Descriptor = Rnode->Buffer;
261 Descriptor->Memory24.DescriptorType = ACPI_RESOURCE_NAME_MEMORY24;
262 Descriptor->Memory24.ResourceLength = 9;
264 /* Process all child initialization nodes */
266 for (i = 0; InitializerOp; i++)
270 case 0: /* Read/Write type */
272 RsSetFlagBits (&Descriptor->Memory24.Flags, InitializerOp, 0, 1);
273 RsCreateBitField (InitializerOp, ACPI_RESTAG_READWRITETYPE,
274 CurrentByteOffset + ASL_RESDESC_OFFSET (Memory24.Flags), 0);
277 case 1: /* Min Address */
279 Descriptor->Memory24.Minimum = (UINT16) InitializerOp->Asl.Value.Integer;
280 RsCreateWordField (InitializerOp, ACPI_RESTAG_MINADDR,
281 CurrentByteOffset + ASL_RESDESC_OFFSET (Memory24.Minimum));
282 MinOp = InitializerOp;
285 case 2: /* Max Address */
287 Descriptor->Memory24.Maximum = (UINT16) InitializerOp->Asl.Value.Integer;
288 RsCreateWordField (InitializerOp, ACPI_RESTAG_MAXADDR,
289 CurrentByteOffset + ASL_RESDESC_OFFSET (Memory24.Maximum));
290 MaxOp = InitializerOp;
293 case 3: /* Alignment */
295 Descriptor->Memory24.Alignment = (UINT16) InitializerOp->Asl.Value.Integer;
296 RsCreateWordField (InitializerOp, ACPI_RESTAG_ALIGNMENT,
297 CurrentByteOffset + ASL_RESDESC_OFFSET (Memory24.Alignment));
302 Descriptor->Memory24.AddressLength = (UINT16) InitializerOp->Asl.Value.Integer;
303 RsCreateWordField (InitializerOp, ACPI_RESTAG_LENGTH,
304 CurrentByteOffset + ASL_RESDESC_OFFSET (Memory24.AddressLength));
305 LengthOp = InitializerOp;
310 UtAttachNamepathToOwner (Info->DescriptorTypeOp, InitializerOp);
315 AslError (ASL_ERROR, ASL_MSG_RESOURCE_LIST, InitializerOp, NULL);
319 InitializerOp = RsCompleteNodeAndGetNext (InitializerOp);
322 /* Validate the Min/Max/Len/Align values (Alignment==0 means 64K) */
324 RsSmallAddressCheck (ACPI_RESOURCE_NAME_MEMORY24,
325 Descriptor->Memory24.Minimum,
326 Descriptor->Memory24.Maximum,
327 Descriptor->Memory24.AddressLength,
328 Descriptor->Memory24.Alignment,
329 MinOp, MaxOp, LengthOp, NULL, Info->DescriptorTypeOp);
335 /*******************************************************************************
337 * FUNCTION: RsDoMemory32Descriptor
339 * PARAMETERS: Info - Parse Op and resource template offset
341 * RETURN: Completed resource node
343 * DESCRIPTION: Construct a short "Memory32" descriptor
345 ******************************************************************************/
348 RsDoMemory32Descriptor (
349 ASL_RESOURCE_INFO *Info)
351 AML_RESOURCE *Descriptor;
352 ACPI_PARSE_OBJECT *InitializerOp;
353 ACPI_PARSE_OBJECT *MinOp = NULL;
354 ACPI_PARSE_OBJECT *MaxOp = NULL;
355 ACPI_PARSE_OBJECT *LengthOp = NULL;
356 ACPI_PARSE_OBJECT *AlignOp = NULL;
357 ASL_RESOURCE_NODE *Rnode;
358 UINT32 CurrentByteOffset;
362 InitializerOp = Info->DescriptorTypeOp->Asl.Child;
363 CurrentByteOffset = Info->CurrentByteOffset;
364 Rnode = RsAllocateResourceNode (sizeof (AML_RESOURCE_MEMORY32));
366 Descriptor = Rnode->Buffer;
367 Descriptor->Memory32.DescriptorType = ACPI_RESOURCE_NAME_MEMORY32;
368 Descriptor->Memory32.ResourceLength = 17;
370 /* Process all child initialization nodes */
372 for (i = 0; InitializerOp; i++)
376 case 0: /* Read/Write type */
378 RsSetFlagBits (&Descriptor->Memory32.Flags, InitializerOp, 0, 1);
379 RsCreateBitField (InitializerOp, ACPI_RESTAG_READWRITETYPE,
380 CurrentByteOffset + ASL_RESDESC_OFFSET (Memory32.Flags), 0);
383 case 1: /* Min Address */
385 Descriptor->Memory32.Minimum = (UINT32) InitializerOp->Asl.Value.Integer;
386 RsCreateDwordField (InitializerOp, ACPI_RESTAG_MINADDR,
387 CurrentByteOffset + ASL_RESDESC_OFFSET (Memory32.Minimum));
388 MinOp = InitializerOp;
391 case 2: /* Max Address */
393 Descriptor->Memory32.Maximum = (UINT32) InitializerOp->Asl.Value.Integer;
394 RsCreateDwordField (InitializerOp, ACPI_RESTAG_MAXADDR,
395 CurrentByteOffset + ASL_RESDESC_OFFSET (Memory32.Maximum));
396 MaxOp = InitializerOp;
399 case 3: /* Alignment */
401 Descriptor->Memory32.Alignment = (UINT32) InitializerOp->Asl.Value.Integer;
402 RsCreateDwordField (InitializerOp, ACPI_RESTAG_ALIGNMENT,
403 CurrentByteOffset + ASL_RESDESC_OFFSET (Memory32.Alignment));
404 AlignOp = InitializerOp;
409 Descriptor->Memory32.AddressLength = (UINT32) InitializerOp->Asl.Value.Integer;
410 RsCreateDwordField (InitializerOp, ACPI_RESTAG_LENGTH,
411 CurrentByteOffset + ASL_RESDESC_OFFSET (Memory32.AddressLength));
412 LengthOp = InitializerOp;
417 UtAttachNamepathToOwner (Info->DescriptorTypeOp, InitializerOp);
422 AslError (ASL_ERROR, ASL_MSG_RESOURCE_LIST, InitializerOp, NULL);
426 InitializerOp = RsCompleteNodeAndGetNext (InitializerOp);
429 /* Validate the Min/Max/Len/Align values */
431 RsSmallAddressCheck (ACPI_RESOURCE_NAME_MEMORY32,
432 Descriptor->Memory32.Minimum,
433 Descriptor->Memory32.Maximum,
434 Descriptor->Memory32.AddressLength,
435 Descriptor->Memory32.Alignment,
436 MinOp, MaxOp, LengthOp, AlignOp, Info->DescriptorTypeOp);
442 /*******************************************************************************
444 * FUNCTION: RsDoMemory32FixedDescriptor
446 * PARAMETERS: Info - Parse Op and resource template offset
448 * RETURN: Completed resource node
450 * DESCRIPTION: Construct a short "Memory32Fixed" descriptor
452 ******************************************************************************/
455 RsDoMemory32FixedDescriptor (
456 ASL_RESOURCE_INFO *Info)
458 AML_RESOURCE *Descriptor;
459 ACPI_PARSE_OBJECT *InitializerOp;
460 ASL_RESOURCE_NODE *Rnode;
461 UINT32 CurrentByteOffset;
465 InitializerOp = Info->DescriptorTypeOp->Asl.Child;
466 CurrentByteOffset = Info->CurrentByteOffset;
467 Rnode = RsAllocateResourceNode (sizeof (AML_RESOURCE_FIXED_MEMORY32));
469 Descriptor = Rnode->Buffer;
470 Descriptor->FixedMemory32.DescriptorType = ACPI_RESOURCE_NAME_FIXED_MEMORY32;
471 Descriptor->FixedMemory32.ResourceLength = 9;
473 /* Process all child initialization nodes */
475 for (i = 0; InitializerOp; i++)
479 case 0: /* Read/Write type */
481 RsSetFlagBits (&Descriptor->FixedMemory32.Flags, InitializerOp, 0, 1);
482 RsCreateBitField (InitializerOp, ACPI_RESTAG_READWRITETYPE,
483 CurrentByteOffset + ASL_RESDESC_OFFSET (FixedMemory32.Flags), 0);
486 case 1: /* Address */
488 Descriptor->FixedMemory32.Address = (UINT32) InitializerOp->Asl.Value.Integer;
489 RsCreateDwordField (InitializerOp, ACPI_RESTAG_BASEADDRESS,
490 CurrentByteOffset + ASL_RESDESC_OFFSET (FixedMemory32.Address));
495 Descriptor->FixedMemory32.AddressLength = (UINT32) InitializerOp->Asl.Value.Integer;
496 RsCreateDwordField (InitializerOp, ACPI_RESTAG_LENGTH,
497 CurrentByteOffset + ASL_RESDESC_OFFSET (FixedMemory32.AddressLength));
502 UtAttachNamepathToOwner (Info->DescriptorTypeOp, InitializerOp);
507 AslError (ASL_ERROR, ASL_MSG_RESOURCE_LIST, InitializerOp, NULL);
511 InitializerOp = RsCompleteNodeAndGetNext (InitializerOp);
518 /*******************************************************************************
520 * FUNCTION: RsDoStartDependentDescriptor
522 * PARAMETERS: Info - Parse Op and resource template offset
524 * RETURN: Completed resource node
526 * DESCRIPTION: Construct a short "StartDependentFn" descriptor
528 ******************************************************************************/
531 RsDoStartDependentDescriptor (
532 ASL_RESOURCE_INFO *Info)
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 ASL_RESOURCE_INFO NextInfo;
540 UINT32 CurrentByteOffset;
545 InitializerOp = Info->DescriptorTypeOp->Asl.Child;
546 CurrentByteOffset = Info->CurrentByteOffset;
547 Rnode = RsAllocateResourceNode (sizeof (AML_RESOURCE_START_DEPENDENT));
549 PreviousRnode = Rnode;
550 Descriptor = Rnode->Buffer;
552 /* Increment offset past StartDependent descriptor */
554 CurrentByteOffset += sizeof (AML_RESOURCE_START_DEPENDENT);
556 /* Descriptor has priority byte */
558 Descriptor->StartDpf.DescriptorType =
559 ACPI_RESOURCE_NAME_START_DEPENDENT | (ASL_RDESC_ST_DEPEND_SIZE + 0x01);
561 /* Process all child initialization nodes */
563 State = ACPI_RSTATE_START_DEPENDENT;
564 for (i = 0; InitializerOp; i++)
568 case 0: /* Compatibility Priority */
570 if ((UINT8) InitializerOp->Asl.Value.Integer > 2)
572 AslError (ASL_ERROR, ASL_MSG_INVALID_PRIORITY,
573 InitializerOp, NULL);
576 RsSetFlagBits (&Descriptor->StartDpf.Flags, InitializerOp, 0, 0);
579 case 1: /* Performance/Robustness Priority */
581 if ((UINT8) InitializerOp->Asl.Value.Integer > 2)
583 AslError (ASL_ERROR, ASL_MSG_INVALID_PERFORMANCE,
584 InitializerOp, NULL);
587 RsSetFlagBits (&Descriptor->StartDpf.Flags, InitializerOp, 2, 0);
592 NextInfo.CurrentByteOffset = CurrentByteOffset;
593 NextInfo.DescriptorTypeOp = InitializerOp;
595 NextRnode = RsDoOneResourceDescriptor (&NextInfo, &State);
598 * Update current byte offset to indicate the number of bytes from the
599 * start of the buffer. Buffer can include multiple descriptors, we
600 * must keep track of the offset of not only each descriptor, but each
601 * element (field) within each descriptor as well.
603 CurrentByteOffset += RsLinkDescriptorChain (
604 &PreviousRnode, NextRnode);
608 InitializerOp = RsCompleteNodeAndGetNext (InitializerOp);
615 /*******************************************************************************
617 * FUNCTION: RsDoStartDependentNoPriDescriptor
619 * PARAMETERS: Info - Parse Op and resource template offset
621 * RETURN: Completed resource node
623 * DESCRIPTION: Construct a short "StartDependentNoPri" descriptor
625 ******************************************************************************/
628 RsDoStartDependentNoPriDescriptor (
629 ASL_RESOURCE_INFO *Info)
631 AML_RESOURCE *Descriptor;
632 ACPI_PARSE_OBJECT *InitializerOp;
633 ASL_RESOURCE_NODE *Rnode;
634 ASL_RESOURCE_NODE *PreviousRnode;
635 ASL_RESOURCE_NODE *NextRnode;
636 ASL_RESOURCE_INFO NextInfo;
637 UINT32 CurrentByteOffset;
641 InitializerOp = Info->DescriptorTypeOp->Asl.Child;
642 CurrentByteOffset = Info->CurrentByteOffset;
643 Rnode = RsAllocateResourceNode (sizeof (AML_RESOURCE_START_DEPENDENT_NOPRIO));
645 Descriptor = Rnode->Buffer;
646 Descriptor->StartDpf.DescriptorType =
647 ACPI_RESOURCE_NAME_START_DEPENDENT | ASL_RDESC_ST_DEPEND_SIZE;
648 PreviousRnode = Rnode;
650 /* Increment offset past StartDependentNoPri descriptor */
652 CurrentByteOffset += sizeof (AML_RESOURCE_START_DEPENDENT_NOPRIO);
654 /* Process all child initialization nodes */
656 State = ACPI_RSTATE_START_DEPENDENT;
657 while (InitializerOp)
659 NextInfo.CurrentByteOffset = CurrentByteOffset;
660 NextInfo.DescriptorTypeOp = InitializerOp;
662 NextRnode = RsDoOneResourceDescriptor (&NextInfo, &State);
665 * Update current byte offset to indicate the number of bytes from the
666 * start of the buffer. Buffer can include multiple descriptors, we
667 * must keep track of the offset of not only each descriptor, but each
668 * element (field) within each descriptor as well.
670 CurrentByteOffset += RsLinkDescriptorChain (&PreviousRnode, NextRnode);
672 InitializerOp = RsCompleteNodeAndGetNext (InitializerOp);
679 /*******************************************************************************
681 * FUNCTION: RsDoVendorSmallDescriptor
683 * PARAMETERS: Info - Parse Op and resource template offset
685 * RETURN: Completed resource node
687 * DESCRIPTION: Construct a short "VendorShort" descriptor
689 ******************************************************************************/
692 RsDoVendorSmallDescriptor (
693 ASL_RESOURCE_INFO *Info)
695 AML_RESOURCE *Descriptor;
696 ACPI_PARSE_OBJECT *InitializerOp;
697 ASL_RESOURCE_NODE *Rnode;
702 InitializerOp = Info->DescriptorTypeOp->Asl.Child;
704 /* Allocate worst case - 7 vendor bytes */
706 Rnode = RsAllocateResourceNode (sizeof (AML_RESOURCE_VENDOR_SMALL) + 7);
708 Descriptor = Rnode->Buffer;
709 Descriptor->VendorSmall.DescriptorType = ACPI_RESOURCE_NAME_VENDOR_SMALL;
710 VendorData = ((UINT8 *) Descriptor) + sizeof (AML_RESOURCE_SMALL_HEADER);
712 /* Process all child initialization nodes */
714 InitializerOp = RsCompleteNodeAndGetNext (InitializerOp);
715 for (i = 0; InitializerOp; i++)
717 if (InitializerOp->Asl.ParseOpcode == PARSEOP_DEFAULT_ARG)
722 /* Maximum 7 vendor data bytes allowed (0-6) */
726 AslError (ASL_ERROR, ASL_MSG_VENDOR_LIST, InitializerOp, NULL);
728 /* Eat the excess initializers */
730 while (InitializerOp)
732 InitializerOp = RsCompleteNodeAndGetNext (InitializerOp);
737 VendorData[i] = (UINT8) InitializerOp->Asl.Value.Integer;
738 InitializerOp = RsCompleteNodeAndGetNext (InitializerOp);
741 /* Adjust the Rnode buffer size, so correct number of bytes are emitted */
743 Rnode->BufferLength -= (7 - i);
745 /* Set the length in the Type Tag */
747 Descriptor->VendorSmall.DescriptorType |= (UINT8) i;