2 /******************************************************************************
4 * Module Name: aslrestype2q - Large QWord address resource descriptors
6 *****************************************************************************/
8 /******************************************************************************
12 * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
13 * All rights reserved.
17 * 2.1. This is your license from Intel Corp. under its intellectual property
18 * rights. You may have additional license terms from the party that provided
19 * you this software, covering your right to use that party's intellectual
22 * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
23 * copy of the source code appearing in this file ("Covered Code") an
24 * irrevocable, perpetual, worldwide license under Intel's copyrights in the
25 * base code distributed originally by Intel ("Original Intel Code") to copy,
26 * make derivatives, distribute, use and display any portion of the Covered
27 * Code in any form, with the right to sublicense such rights; and
29 * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
30 * license (with the right to sublicense), under only those claims of Intel
31 * patents that are infringed by the Original Intel Code, to make, use, sell,
32 * offer to sell, and import the Covered Code and derivative works thereof
33 * solely to the minimum extent necessary to exercise the above copyright
34 * license, and in no event shall the patent license extend to any additions
35 * to or modifications of the Original Intel Code. No other license or right
36 * is granted directly or by implication, estoppel or otherwise;
38 * The above copyright and patent license is granted only if the following
43 * 3.1. Redistribution of Source with Rights to Further Distribute Source.
44 * Redistribution of source code of any substantial portion of the Covered
45 * Code or modification with rights to further distribute source must include
46 * the above Copyright Notice, the above License, this list of Conditions,
47 * and the following Disclaimer and Export Compliance provision. In addition,
48 * Licensee must cause all Covered Code to which Licensee contributes to
49 * contain a file documenting the changes Licensee made to create that Covered
50 * Code and the date of any change. Licensee must include in that file the
51 * documentation of any changes made by any predecessor Licensee. Licensee
52 * must include a prominent statement that the modification is derived,
53 * directly or indirectly, from Original Intel Code.
55 * 3.2. Redistribution of Source with no Rights to Further Distribute Source.
56 * Redistribution of source code of any substantial portion of the Covered
57 * Code or modification without rights to further distribute source must
58 * include the following Disclaimer and Export Compliance provision in the
59 * documentation and/or other materials provided with distribution. In
60 * addition, Licensee may not authorize further sublicense of source of any
61 * portion of the Covered Code, and must include terms to the effect that the
62 * license from Licensee to its licensee is limited to the intellectual
63 * property embodied in the software Licensee provides to its licensee, and
64 * not to intellectual property embodied in modifications its licensee may
67 * 3.3. Redistribution of Executable. Redistribution in executable form of any
68 * substantial portion of the Covered Code or modification must reproduce the
69 * above Copyright Notice, and the following Disclaimer and Export Compliance
70 * provision in the documentation and/or other materials provided with the
73 * 3.4. Intel retains all right, title, and interest in and to the Original
76 * 3.5. Neither the name Intel nor any other trademark owned or controlled by
77 * Intel shall be used in advertising or otherwise to promote the sale, use or
78 * other dealings in products derived from or relating to the Covered Code
79 * without prior written authorization from Intel.
81 * 4. Disclaimer and Export Compliance
83 * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
84 * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
85 * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
86 * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
87 * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
88 * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
91 * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
92 * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
93 * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
94 * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
95 * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
96 * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
97 * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
100 * 4.3. Licensee shall not export, either directly or indirectly, any of this
101 * software or system incorporating such software without first obtaining any
102 * required license or other approval from the U. S. Department of Commerce or
103 * any other agency or department of the United States Government. In the
104 * event Licensee exports any such software from the United States or
105 * re-exports any such software from a foreign destination, Licensee shall
106 * ensure that the distribution and export/re-export of the software is in
107 * compliance with all laws, regulations, orders, or other restrictions of the
108 * U.S. Export Administration Regulations. Licensee agrees that neither it nor
109 * any of its subsidiaries will export/re-export any technical data, process,
110 * software, or service, directly or indirectly, to any country for which the
111 * United States government or any agency thereof requires an export license,
112 * other governmental approval, or letter of assurance, without first obtaining
113 * such license, approval or letter.
115 *****************************************************************************/
118 #include "aslcompiler.h"
119 #include "aslcompiler.y.h"
121 #define _COMPONENT ACPI_COMPILER
122 ACPI_MODULE_NAME ("aslrestype2q")
125 * This module contains the QWord (64-bit) address space descriptors:
132 /*******************************************************************************
134 * FUNCTION: RsDoQwordIoDescriptor
136 * PARAMETERS: Op - Parent resource descriptor parse node
137 * CurrentByteOffset - Offset into the resource template AML
138 * buffer (to track references to the desc)
140 * RETURN: Completed resource node
142 * DESCRIPTION: Construct a long "QwordIO" descriptor
144 ******************************************************************************/
147 RsDoQwordIoDescriptor (
148 ACPI_PARSE_OBJECT *Op,
149 UINT32 CurrentByteOffset)
151 AML_RESOURCE *Descriptor;
152 ACPI_PARSE_OBJECT *InitializerOp;
153 ACPI_PARSE_OBJECT *MinOp = NULL;
154 ACPI_PARSE_OBJECT *MaxOp = NULL;
155 ACPI_PARSE_OBJECT *LengthOp = NULL;
156 ACPI_PARSE_OBJECT *GranOp = NULL;
157 ASL_RESOURCE_NODE *Rnode;
158 UINT8 *OptionalFields;
159 UINT16 StringLength = 0;
160 UINT32 OptionIndex = 0;
162 BOOLEAN ResSourceIndex = FALSE;
165 InitializerOp = Op->Asl.Child;
166 StringLength = RsGetStringDataLength (InitializerOp);
168 Rnode = RsAllocateResourceNode (
169 sizeof (AML_RESOURCE_ADDRESS64) + 1 + StringLength);
171 Descriptor = Rnode->Buffer;
172 Descriptor->Address64.DescriptorType = ACPI_RESOURCE_NAME_ADDRESS64;
173 Descriptor->Address64.ResourceType = ACPI_ADDRESS_TYPE_IO_RANGE;
176 * Initial descriptor length -- may be enlarged if there are
177 * optional fields present
179 OptionalFields = ((UINT8 *) Descriptor) + sizeof (AML_RESOURCE_ADDRESS64);
180 Descriptor->Address64.ResourceLength = (UINT16)
181 (sizeof (AML_RESOURCE_ADDRESS64) -
182 sizeof (AML_RESOURCE_LARGE_HEADER));
184 /* Process all child initialization nodes */
186 for (i = 0; InitializerOp; i++)
190 case 0: /* Resource Usage */
192 RsSetFlagBits (&Descriptor->Address64.Flags, InitializerOp, 0, 1);
195 case 1: /* MinType */
197 RsSetFlagBits (&Descriptor->Address64.Flags, InitializerOp, 2, 0);
198 RsCreateBitField (InitializerOp, ACPI_RESTAG_MINTYPE,
199 CurrentByteOffset + ASL_RESDESC_OFFSET (Address64.Flags), 2);
202 case 2: /* MaxType */
204 RsSetFlagBits (&Descriptor->Address64.Flags, InitializerOp, 3, 0);
205 RsCreateBitField (InitializerOp, ACPI_RESTAG_MAXTYPE,
206 CurrentByteOffset + ASL_RESDESC_OFFSET (Address64.Flags), 3);
209 case 3: /* DecodeType */
211 RsSetFlagBits (&Descriptor->Address64.Flags, InitializerOp, 1, 0);
212 RsCreateBitField (InitializerOp, ACPI_RESTAG_DECODE,
213 CurrentByteOffset + ASL_RESDESC_OFFSET (Address64.Flags), 1);
216 case 4: /* Range Type */
218 RsSetFlagBits (&Descriptor->Address64.SpecificFlags, InitializerOp, 0, 3);
219 RsCreateBitField (InitializerOp, ACPI_RESTAG_RANGETYPE,
220 CurrentByteOffset + ASL_RESDESC_OFFSET (Address64.SpecificFlags), 0);
223 case 5: /* Address Granularity */
225 Descriptor->Address64.Granularity = InitializerOp->Asl.Value.Integer;
226 RsCreateByteField (InitializerOp, ACPI_RESTAG_GRANULARITY,
227 CurrentByteOffset + ASL_RESDESC_OFFSET (Address64.Granularity));
228 GranOp = InitializerOp;
231 case 6: /* Address Min */
233 Descriptor->Address64.Minimum = InitializerOp->Asl.Value.Integer;
234 RsCreateByteField (InitializerOp, ACPI_RESTAG_MINADDR,
235 CurrentByteOffset + ASL_RESDESC_OFFSET (Address64.Minimum));
236 MinOp = InitializerOp;
239 case 7: /* Address Max */
241 Descriptor->Address64.Maximum = InitializerOp->Asl.Value.Integer;
242 RsCreateByteField (InitializerOp, ACPI_RESTAG_MAXADDR,
243 CurrentByteOffset + ASL_RESDESC_OFFSET (Address64.Maximum));
244 MaxOp = InitializerOp;
247 case 8: /* Translation Offset */
249 Descriptor->Address64.TranslationOffset = InitializerOp->Asl.Value.Integer;
250 RsCreateByteField (InitializerOp, ACPI_RESTAG_TRANSLATION,
251 CurrentByteOffset + ASL_RESDESC_OFFSET (Address64.TranslationOffset));
254 case 9: /* Address Length */
256 Descriptor->Address64.AddressLength = InitializerOp->Asl.Value.Integer;
257 RsCreateByteField (InitializerOp, ACPI_RESTAG_LENGTH,
258 CurrentByteOffset + ASL_RESDESC_OFFSET (Address64.AddressLength));
259 LengthOp = InitializerOp;
262 case 10: /* ResSourceIndex [Optional Field - BYTE] */
264 if (InitializerOp->Asl.ParseOpcode != PARSEOP_DEFAULT_ARG)
266 OptionalFields[0] = (UINT8) InitializerOp->Asl.Value.Integer;
268 Descriptor->Address64.ResourceLength++;
269 ResSourceIndex = TRUE;
273 case 11: /* ResSource [Optional Field - STRING] */
275 if ((InitializerOp->Asl.ParseOpcode != PARSEOP_DEFAULT_ARG) &&
276 (InitializerOp->Asl.Value.String))
280 Descriptor->Address64.ResourceLength = (UINT16)
281 (Descriptor->Address64.ResourceLength + StringLength);
284 &OptionalFields[OptionIndex],
285 InitializerOp->Asl.Value.String);
287 /* ResourceSourceIndex must also be valid */
291 AslError (ASL_ERROR, ASL_MSG_RESOURCE_INDEX,
292 InitializerOp, NULL);
299 * Not a valid ResourceSource, ResourceSourceIndex must also
302 else if (ResSourceIndex)
304 AslError (ASL_ERROR, ASL_MSG_RESOURCE_SOURCE,
305 InitializerOp, NULL);
310 case 12: /* ResourceTag */
312 UtAttachNamepathToOwner (Op, InitializerOp);
317 RsSetFlagBits (&Descriptor->Address64.SpecificFlags, InitializerOp, 4, 0);
318 RsCreateBitField (InitializerOp, ACPI_RESTAG_TYPE,
319 CurrentByteOffset + ASL_RESDESC_OFFSET (Address64.SpecificFlags), 4);
322 case 14: /* Translation Type */
324 RsSetFlagBits (&Descriptor->Address64.SpecificFlags, InitializerOp, 5, 0);
325 RsCreateBitField (InitializerOp, ACPI_RESTAG_TRANSTYPE,
326 CurrentByteOffset + ASL_RESDESC_OFFSET (Address64.SpecificFlags), 5);
331 AslError (ASL_ERROR, ASL_MSG_RESOURCE_LIST, InitializerOp, NULL);
335 InitializerOp = RsCompleteNodeAndGetNext (InitializerOp);
338 /* Validate the Min/Max/Len/Gran values */
340 RsLargeAddressCheck (
341 Descriptor->Address64.Minimum,
342 Descriptor->Address64.Maximum,
343 Descriptor->Address64.AddressLength,
344 Descriptor->Address64.Granularity,
345 Descriptor->Address64.Flags,
346 MinOp, MaxOp, LengthOp, GranOp, Op);
348 Rnode->BufferLength = sizeof (AML_RESOURCE_ADDRESS64) +
349 OptionIndex + StringLength;
354 /*******************************************************************************
356 * FUNCTION: RsDoQwordMemoryDescriptor
358 * PARAMETERS: Op - Parent resource descriptor parse node
359 * CurrentByteOffset - Offset into the resource template AML
360 * buffer (to track references to the desc)
362 * RETURN: Completed resource node
364 * DESCRIPTION: Construct a long "QwordMemory" descriptor
366 ******************************************************************************/
369 RsDoQwordMemoryDescriptor (
370 ACPI_PARSE_OBJECT *Op,
371 UINT32 CurrentByteOffset)
373 AML_RESOURCE *Descriptor;
374 ACPI_PARSE_OBJECT *InitializerOp;
375 ACPI_PARSE_OBJECT *MinOp = NULL;
376 ACPI_PARSE_OBJECT *MaxOp = NULL;
377 ACPI_PARSE_OBJECT *LengthOp = NULL;
378 ACPI_PARSE_OBJECT *GranOp = NULL;
379 ASL_RESOURCE_NODE *Rnode;
380 UINT8 *OptionalFields;
381 UINT16 StringLength = 0;
382 UINT32 OptionIndex = 0;
384 BOOLEAN ResSourceIndex = FALSE;
387 InitializerOp = Op->Asl.Child;
388 StringLength = RsGetStringDataLength (InitializerOp);
390 Rnode = RsAllocateResourceNode (
391 sizeof (AML_RESOURCE_ADDRESS64) + 1 + StringLength);
393 Descriptor = Rnode->Buffer;
394 Descriptor->Address64.DescriptorType = ACPI_RESOURCE_NAME_ADDRESS64;
395 Descriptor->Address64.ResourceType = ACPI_ADDRESS_TYPE_MEMORY_RANGE;
398 * Initial descriptor length -- may be enlarged if there are
399 * optional fields present
401 OptionalFields = ((UINT8 *) Descriptor) + sizeof (AML_RESOURCE_ADDRESS64);
402 Descriptor->Address64.ResourceLength = (UINT16)
403 (sizeof (AML_RESOURCE_ADDRESS64) -
404 sizeof (AML_RESOURCE_LARGE_HEADER));
406 /* Process all child initialization nodes */
408 for (i = 0; InitializerOp; i++)
412 case 0: /* Resource Usage */
414 RsSetFlagBits (&Descriptor->Address64.Flags, InitializerOp, 0, 1);
417 case 1: /* DecodeType */
419 RsSetFlagBits (&Descriptor->Address64.Flags, InitializerOp, 1, 0);
420 RsCreateBitField (InitializerOp, ACPI_RESTAG_DECODE,
421 CurrentByteOffset + ASL_RESDESC_OFFSET (Address64.Flags), 1);
424 case 2: /* MinType */
426 RsSetFlagBits (&Descriptor->Address64.Flags, InitializerOp, 2, 0);
427 RsCreateBitField (InitializerOp, ACPI_RESTAG_MINTYPE,
428 CurrentByteOffset + ASL_RESDESC_OFFSET (Address64.Flags), 2);
431 case 3: /* MaxType */
433 RsSetFlagBits (&Descriptor->Address64.Flags, InitializerOp, 3, 0);
434 RsCreateBitField (InitializerOp, ACPI_RESTAG_MAXTYPE,
435 CurrentByteOffset + ASL_RESDESC_OFFSET (Address64.Flags), 3);
438 case 4: /* Memory Type */
440 RsSetFlagBits (&Descriptor->Address64.SpecificFlags, InitializerOp, 1, 0);
441 RsCreateBitField (InitializerOp, ACPI_RESTAG_MEMTYPE,
442 CurrentByteOffset + ASL_RESDESC_OFFSET (Address64.SpecificFlags), 1);
445 case 5: /* Read/Write Type */
447 RsSetFlagBits (&Descriptor->Address64.SpecificFlags, InitializerOp, 0, 1);
448 RsCreateBitField (InitializerOp, ACPI_RESTAG_READWRITETYPE,
449 CurrentByteOffset + ASL_RESDESC_OFFSET (Address64.SpecificFlags), 0);
452 case 6: /* Address Granularity */
454 Descriptor->Address64.Granularity = InitializerOp->Asl.Value.Integer;
455 RsCreateByteField (InitializerOp, ACPI_RESTAG_GRANULARITY,
456 CurrentByteOffset + ASL_RESDESC_OFFSET (Address64.Granularity));
457 GranOp = InitializerOp;
460 case 7: /* Min Address */
462 Descriptor->Address64.Minimum = InitializerOp->Asl.Value.Integer;
463 RsCreateByteField (InitializerOp, ACPI_RESTAG_MINADDR,
464 CurrentByteOffset + ASL_RESDESC_OFFSET (Address64.Minimum));
465 MinOp = InitializerOp;
468 case 8: /* Max Address */
470 Descriptor->Address64.Maximum = InitializerOp->Asl.Value.Integer;
471 RsCreateByteField (InitializerOp, ACPI_RESTAG_MAXADDR,
472 CurrentByteOffset + ASL_RESDESC_OFFSET (Address64.Maximum));
473 MaxOp = InitializerOp;
476 case 9: /* Translation Offset */
478 Descriptor->Address64.TranslationOffset = InitializerOp->Asl.Value.Integer;
479 RsCreateByteField (InitializerOp, ACPI_RESTAG_TRANSLATION,
480 CurrentByteOffset + ASL_RESDESC_OFFSET (Address64.TranslationOffset));
483 case 10: /* Address Length */
485 Descriptor->Address64.AddressLength = InitializerOp->Asl.Value.Integer;
486 RsCreateByteField (InitializerOp, ACPI_RESTAG_LENGTH,
487 CurrentByteOffset + ASL_RESDESC_OFFSET (Address64.AddressLength));
488 LengthOp = InitializerOp;
491 case 11: /* ResSourceIndex [Optional Field - BYTE] */
493 if (InitializerOp->Asl.ParseOpcode != PARSEOP_DEFAULT_ARG)
495 OptionalFields[0] = (UINT8) InitializerOp->Asl.Value.Integer;
497 Descriptor->Address64.ResourceLength++;
498 ResSourceIndex = TRUE;
502 case 12: /* ResSource [Optional Field - STRING] */
504 if ((InitializerOp->Asl.ParseOpcode != PARSEOP_DEFAULT_ARG) &&
505 (InitializerOp->Asl.Value.String))
509 Descriptor->Address64.ResourceLength = (UINT16)
510 (Descriptor->Address64.ResourceLength + StringLength);
513 &OptionalFields[OptionIndex],
514 InitializerOp->Asl.Value.String);
516 /* ResourceSourceIndex must also be valid */
520 AslError (ASL_ERROR, ASL_MSG_RESOURCE_INDEX,
521 InitializerOp, NULL);
528 * Not a valid ResourceSource, ResourceSourceIndex must also
531 else if (ResSourceIndex)
533 AslError (ASL_ERROR, ASL_MSG_RESOURCE_SOURCE,
534 InitializerOp, NULL);
539 case 13: /* ResourceTag */
541 UtAttachNamepathToOwner (Op, InitializerOp);
545 case 14: /* Address Range */
547 RsSetFlagBits (&Descriptor->Address64.SpecificFlags, InitializerOp, 3, 0);
548 RsCreateBitField (InitializerOp, ACPI_RESTAG_MEMATTRIBUTES,
549 CurrentByteOffset + ASL_RESDESC_OFFSET (Address64.SpecificFlags), 3);
554 RsSetFlagBits (&Descriptor->Address64.SpecificFlags, InitializerOp, 5, 0);
555 RsCreateBitField (InitializerOp, ACPI_RESTAG_TYPE,
556 CurrentByteOffset + ASL_RESDESC_OFFSET (Address64.SpecificFlags), 5);
561 AslError (ASL_ERROR, ASL_MSG_RESOURCE_LIST, InitializerOp, NULL);
565 InitializerOp = RsCompleteNodeAndGetNext (InitializerOp);
568 /* Validate the Min/Max/Len/Gran values */
570 RsLargeAddressCheck (
571 Descriptor->Address64.Minimum,
572 Descriptor->Address64.Maximum,
573 Descriptor->Address64.AddressLength,
574 Descriptor->Address64.Granularity,
575 Descriptor->Address64.Flags,
576 MinOp, MaxOp, LengthOp, GranOp, Op);
578 Rnode->BufferLength = sizeof (AML_RESOURCE_ADDRESS64) +
579 OptionIndex + StringLength;
584 /*******************************************************************************
586 * FUNCTION: RsDoQwordSpaceDescriptor
588 * PARAMETERS: Op - Parent resource descriptor parse node
589 * CurrentByteOffset - Offset into the resource template AML
590 * buffer (to track references to the desc)
592 * RETURN: Completed resource node
594 * DESCRIPTION: Construct a long "QwordSpace" descriptor
596 ******************************************************************************/
599 RsDoQwordSpaceDescriptor (
600 ACPI_PARSE_OBJECT *Op,
601 UINT32 CurrentByteOffset)
603 AML_RESOURCE *Descriptor;
604 ACPI_PARSE_OBJECT *InitializerOp;
605 ACPI_PARSE_OBJECT *MinOp = NULL;
606 ACPI_PARSE_OBJECT *MaxOp = NULL;
607 ACPI_PARSE_OBJECT *LengthOp = NULL;
608 ACPI_PARSE_OBJECT *GranOp = NULL;
609 ASL_RESOURCE_NODE *Rnode;
610 UINT8 *OptionalFields;
611 UINT16 StringLength = 0;
612 UINT32 OptionIndex = 0;
614 BOOLEAN ResSourceIndex = FALSE;
617 InitializerOp = Op->Asl.Child;
618 StringLength = RsGetStringDataLength (InitializerOp);
620 Rnode = RsAllocateResourceNode (
621 sizeof (AML_RESOURCE_ADDRESS64) + 1 + StringLength);
623 Descriptor = Rnode->Buffer;
624 Descriptor->Address64.DescriptorType = ACPI_RESOURCE_NAME_ADDRESS64;
627 * Initial descriptor length -- may be enlarged if there are
628 * optional fields present
630 OptionalFields = ((UINT8 *) Descriptor) + sizeof (AML_RESOURCE_ADDRESS64);
631 Descriptor->Address64.ResourceLength = (UINT16)
632 (sizeof (AML_RESOURCE_ADDRESS64) -
633 sizeof (AML_RESOURCE_LARGE_HEADER));
635 /* Process all child initialization nodes */
637 for (i = 0; InitializerOp; i++)
641 case 0: /* Resource Type */
643 Descriptor->Address64.ResourceType =
644 (UINT8) InitializerOp->Asl.Value.Integer;
647 case 1: /* Resource Usage */
649 RsSetFlagBits (&Descriptor->Address64.Flags, InitializerOp, 0, 1);
652 case 2: /* DecodeType */
654 RsSetFlagBits (&Descriptor->Address64.Flags, InitializerOp, 1, 0);
655 RsCreateBitField (InitializerOp, ACPI_RESTAG_DECODE,
656 CurrentByteOffset + ASL_RESDESC_OFFSET (Address64.Flags), 1);
659 case 3: /* MinType */
661 RsSetFlagBits (&Descriptor->Address64.Flags, InitializerOp, 2, 0);
662 RsCreateBitField (InitializerOp, ACPI_RESTAG_MINTYPE,
663 CurrentByteOffset + ASL_RESDESC_OFFSET (Address64.Flags), 2);
666 case 4: /* MaxType */
668 RsSetFlagBits (&Descriptor->Address64.Flags, InitializerOp, 3, 0);
669 RsCreateBitField (InitializerOp, ACPI_RESTAG_MAXTYPE,
670 CurrentByteOffset + ASL_RESDESC_OFFSET (Address64.Flags), 3);
673 case 5: /* Type-Specific flags */
675 Descriptor->Address64.SpecificFlags =
676 (UINT8) InitializerOp->Asl.Value.Integer;
679 case 6: /* Address Granularity */
681 Descriptor->Address64.Granularity = InitializerOp->Asl.Value.Integer;
682 RsCreateByteField (InitializerOp, ACPI_RESTAG_GRANULARITY,
683 CurrentByteOffset + ASL_RESDESC_OFFSET (Address64.Granularity));
684 GranOp = InitializerOp;
687 case 7: /* Min Address */
689 Descriptor->Address64.Minimum = InitializerOp->Asl.Value.Integer;
690 RsCreateByteField (InitializerOp, ACPI_RESTAG_MINADDR,
691 CurrentByteOffset + ASL_RESDESC_OFFSET (Address64.Minimum));
692 MinOp = InitializerOp;
695 case 8: /* Max Address */
697 Descriptor->Address64.Maximum = InitializerOp->Asl.Value.Integer;
698 RsCreateByteField (InitializerOp, ACPI_RESTAG_MAXADDR,
699 CurrentByteOffset + ASL_RESDESC_OFFSET (Address64.Maximum));
700 MaxOp = InitializerOp;
703 case 9: /* Translation Offset */
705 Descriptor->Address64.TranslationOffset = InitializerOp->Asl.Value.Integer;
706 RsCreateByteField (InitializerOp, ACPI_RESTAG_TRANSLATION,
707 CurrentByteOffset + ASL_RESDESC_OFFSET (Address64.TranslationOffset));
710 case 10: /* Address Length */
712 Descriptor->Address64.AddressLength = InitializerOp->Asl.Value.Integer;
713 RsCreateByteField (InitializerOp, ACPI_RESTAG_LENGTH,
714 CurrentByteOffset + ASL_RESDESC_OFFSET (Address64.AddressLength));
715 LengthOp = InitializerOp;
718 case 11: /* ResSourceIndex [Optional Field - BYTE] */
720 if (InitializerOp->Asl.ParseOpcode != PARSEOP_DEFAULT_ARG)
722 OptionalFields[0] = (UINT8) InitializerOp->Asl.Value.Integer;
724 Descriptor->Address64.ResourceLength++;
725 ResSourceIndex = TRUE;
729 case 12: /* ResSource [Optional Field - STRING] */
731 if ((InitializerOp->Asl.ParseOpcode != PARSEOP_DEFAULT_ARG) &&
732 (InitializerOp->Asl.Value.String))
736 Descriptor->Address64.ResourceLength = (UINT16)
737 (Descriptor->Address64.ResourceLength + StringLength);
740 &OptionalFields[OptionIndex],
741 InitializerOp->Asl.Value.String);
743 /* ResourceSourceIndex must also be valid */
747 AslError (ASL_ERROR, ASL_MSG_RESOURCE_INDEX,
748 InitializerOp, NULL);
755 * Not a valid ResourceSource, ResourceSourceIndex must also
758 else if (ResSourceIndex)
760 AslError (ASL_ERROR, ASL_MSG_RESOURCE_SOURCE,
761 InitializerOp, NULL);
766 case 13: /* ResourceTag */
768 UtAttachNamepathToOwner (Op, InitializerOp);
773 AslError (ASL_ERROR, ASL_MSG_RESOURCE_LIST, InitializerOp, NULL);
777 InitializerOp = RsCompleteNodeAndGetNext (InitializerOp);
780 /* Validate the Min/Max/Len/Gran values */
782 RsLargeAddressCheck (
783 Descriptor->Address64.Minimum,
784 Descriptor->Address64.Maximum,
785 Descriptor->Address64.AddressLength,
786 Descriptor->Address64.Granularity,
787 Descriptor->Address64.Flags,
788 MinOp, MaxOp, LengthOp, GranOp, Op);
790 Rnode->BufferLength = sizeof (AML_RESOURCE_ADDRESS64) +
791 OptionIndex + StringLength;