2 /******************************************************************************
4 * Module Name: aslrestype2w - Large Word address resource descriptors
6 *****************************************************************************/
8 /******************************************************************************
12 * Some or all of this work - Copyright (c) 1999 - 2010, 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 <contrib/dev/acpica/compiler/aslcompiler.h>
119 #include "aslcompiler.y.h"
121 #define _COMPONENT ACPI_COMPILER
122 ACPI_MODULE_NAME ("aslrestype2w")
125 * This module contains the Word (16-bit) address space descriptors:
132 /*******************************************************************************
134 * FUNCTION: RsDoWordIoDescriptor
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 "WordIO" descriptor
144 ******************************************************************************/
147 RsDoWordIoDescriptor (
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_ADDRESS16) + 1 + StringLength);
171 Descriptor = Rnode->Buffer;
172 Descriptor->Address16.DescriptorType = ACPI_RESOURCE_NAME_ADDRESS16;
173 Descriptor->Address16.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_ADDRESS16);
180 Descriptor->Address16.ResourceLength = (UINT16)
181 (sizeof (AML_RESOURCE_ADDRESS16) -
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->Address16.Flags, InitializerOp, 0, 1);
195 case 1: /* MinType */
197 RsSetFlagBits (&Descriptor->Address16.Flags, InitializerOp, 2, 0);
198 RsCreateBitField (InitializerOp, ACPI_RESTAG_MINTYPE,
199 CurrentByteOffset + ASL_RESDESC_OFFSET (Address16.Flags), 2);
202 case 2: /* MaxType */
204 RsSetFlagBits (&Descriptor->Address16.Flags, InitializerOp, 3, 0);
205 RsCreateBitField (InitializerOp, ACPI_RESTAG_MAXTYPE,
206 CurrentByteOffset + ASL_RESDESC_OFFSET (Address16.Flags), 3);
209 case 3: /* DecodeType */
211 RsSetFlagBits (&Descriptor->Address16.Flags, InitializerOp, 1, 0);
212 RsCreateBitField (InitializerOp, ACPI_RESTAG_DECODE,
213 CurrentByteOffset + ASL_RESDESC_OFFSET (Address16.Flags), 1);
216 case 4: /* Range Type */
218 RsSetFlagBits (&Descriptor->Address16.SpecificFlags, InitializerOp, 0, 3);
219 RsCreateBitField (InitializerOp, ACPI_RESTAG_RANGETYPE,
220 CurrentByteOffset + ASL_RESDESC_OFFSET (Address16.SpecificFlags), 0);
223 case 5: /* Address Granularity */
225 Descriptor->Address16.Granularity = (UINT16) InitializerOp->Asl.Value.Integer;
226 RsCreateByteField (InitializerOp, ACPI_RESTAG_GRANULARITY,
227 CurrentByteOffset + ASL_RESDESC_OFFSET (Address16.Granularity));
228 GranOp = InitializerOp;
231 case 6: /* Address Min */
233 Descriptor->Address16.Minimum = (UINT16) InitializerOp->Asl.Value.Integer;
234 RsCreateByteField (InitializerOp, ACPI_RESTAG_MINADDR,
235 CurrentByteOffset + ASL_RESDESC_OFFSET (Address16.Minimum));
236 MinOp = InitializerOp;
239 case 7: /* Address Max */
241 Descriptor->Address16.Maximum = (UINT16) InitializerOp->Asl.Value.Integer;
242 RsCreateByteField (InitializerOp, ACPI_RESTAG_MAXADDR,
243 CurrentByteOffset + ASL_RESDESC_OFFSET (Address16.Maximum));
244 MaxOp = InitializerOp;
247 case 8: /* Translation Offset */
249 Descriptor->Address16.TranslationOffset = (UINT16) InitializerOp->Asl.Value.Integer;
250 RsCreateByteField (InitializerOp, ACPI_RESTAG_TRANSLATION,
251 CurrentByteOffset + ASL_RESDESC_OFFSET (Address16.TranslationOffset));
254 case 9: /* Address Length */
256 Descriptor->Address16.AddressLength = (UINT16) InitializerOp->Asl.Value.Integer;
257 RsCreateByteField (InitializerOp, ACPI_RESTAG_LENGTH,
258 CurrentByteOffset + ASL_RESDESC_OFFSET (Address16.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->Address16.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->Address16.ResourceLength = (UINT16)
281 (Descriptor->Address16.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->Address16.SpecificFlags, InitializerOp, 4, 0);
318 RsCreateBitField (InitializerOp, ACPI_RESTAG_TYPE,
319 CurrentByteOffset + ASL_RESDESC_OFFSET (Address16.SpecificFlags), 4);
322 case 14: /* Translation Type */
324 RsSetFlagBits (&Descriptor->Address16.SpecificFlags, InitializerOp, 5, 0);
325 RsCreateBitField (InitializerOp, ACPI_RESTAG_TRANSTYPE,
326 CurrentByteOffset + ASL_RESDESC_OFFSET (Address16.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 (UINT64) Descriptor->Address16.Minimum,
342 (UINT64) Descriptor->Address16.Maximum,
343 (UINT64) Descriptor->Address16.AddressLength,
344 (UINT64) Descriptor->Address16.Granularity,
345 Descriptor->Address16.Flags,
346 MinOp, MaxOp, LengthOp, GranOp, Op);
348 Rnode->BufferLength = sizeof (AML_RESOURCE_ADDRESS16) +
349 OptionIndex + StringLength;
354 /*******************************************************************************
356 * FUNCTION: RsDoWordBusNumberDescriptor
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 "WordBusNumber" descriptor
366 ******************************************************************************/
369 RsDoWordBusNumberDescriptor (
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_ADDRESS16) + 1 + StringLength);
393 Descriptor = Rnode->Buffer;
394 Descriptor->Address16.DescriptorType = ACPI_RESOURCE_NAME_ADDRESS16;
395 Descriptor->Address16.ResourceType = ACPI_ADDRESS_TYPE_BUS_NUMBER_RANGE;
398 * Initial descriptor length -- may be enlarged if there are
399 * optional fields present
401 OptionalFields = ((UINT8 *) Descriptor) + sizeof (AML_RESOURCE_ADDRESS16);
402 Descriptor->Address16.ResourceLength = (UINT16)
403 (sizeof (AML_RESOURCE_ADDRESS16) -
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->Address16.Flags, InitializerOp, 0, 1);
417 case 1: /* MinType */
419 RsSetFlagBits (&Descriptor->Address16.Flags, InitializerOp, 2, 0);
420 RsCreateBitField (InitializerOp, ACPI_RESTAG_MINTYPE,
421 CurrentByteOffset + ASL_RESDESC_OFFSET (Address16.Flags), 2);
424 case 2: /* MaxType */
426 RsSetFlagBits (&Descriptor->Address16.Flags, InitializerOp, 3, 0);
427 RsCreateBitField (InitializerOp, ACPI_RESTAG_MAXTYPE,
428 CurrentByteOffset + ASL_RESDESC_OFFSET (Address16.Flags), 3);
431 case 3: /* DecodeType */
433 RsSetFlagBits (&Descriptor->Address16.Flags, InitializerOp, 1, 0);
434 RsCreateBitField (InitializerOp, ACPI_RESTAG_DECODE,
435 CurrentByteOffset + ASL_RESDESC_OFFSET (Address16.Flags), 1);
438 case 4: /* Address Granularity */
440 Descriptor->Address16.Granularity =
441 (UINT16) InitializerOp->Asl.Value.Integer;
442 RsCreateByteField (InitializerOp, ACPI_RESTAG_GRANULARITY,
443 CurrentByteOffset + ASL_RESDESC_OFFSET (Address16.Granularity));
444 GranOp = InitializerOp;
447 case 5: /* Min Address */
449 Descriptor->Address16.Minimum =
450 (UINT16) InitializerOp->Asl.Value.Integer;
451 RsCreateByteField (InitializerOp, ACPI_RESTAG_MINADDR,
452 CurrentByteOffset + ASL_RESDESC_OFFSET (Address16.Minimum));
453 MinOp = InitializerOp;
456 case 6: /* Max Address */
458 Descriptor->Address16.Maximum =
459 (UINT16) InitializerOp->Asl.Value.Integer;
460 RsCreateByteField (InitializerOp, ACPI_RESTAG_MAXADDR,
461 CurrentByteOffset + ASL_RESDESC_OFFSET (Address16.Maximum));
462 MaxOp = InitializerOp;
465 case 7: /* Translation Offset */
467 Descriptor->Address16.TranslationOffset =
468 (UINT16) InitializerOp->Asl.Value.Integer;
469 RsCreateByteField (InitializerOp, ACPI_RESTAG_TRANSLATION,
470 CurrentByteOffset + ASL_RESDESC_OFFSET (Address16.TranslationOffset));
473 case 8: /* Address Length */
475 Descriptor->Address16.AddressLength =
476 (UINT16) InitializerOp->Asl.Value.Integer;
477 RsCreateByteField (InitializerOp, ACPI_RESTAG_LENGTH,
478 CurrentByteOffset + ASL_RESDESC_OFFSET (Address16.AddressLength));
479 LengthOp = InitializerOp;
482 case 9: /* ResSourceIndex [Optional Field - BYTE] */
484 if (InitializerOp->Asl.ParseOpcode != PARSEOP_DEFAULT_ARG)
486 OptionalFields[0] = (UINT8) InitializerOp->Asl.Value.Integer;
488 Descriptor->Address16.ResourceLength++;
489 ResSourceIndex = TRUE;
493 case 10: /* ResSource [Optional Field - STRING] */
495 if ((InitializerOp->Asl.ParseOpcode != PARSEOP_DEFAULT_ARG) &&
496 (InitializerOp->Asl.Value.String))
500 Descriptor->Address16.ResourceLength = (UINT16)
501 (Descriptor->Address16.ResourceLength + StringLength);
504 &OptionalFields[OptionIndex],
505 InitializerOp->Asl.Value.String);
507 /* ResourceSourceIndex must also be valid */
511 AslError (ASL_ERROR, ASL_MSG_RESOURCE_INDEX,
512 InitializerOp, NULL);
519 * Not a valid ResourceSource, ResourceSourceIndex must also
522 else if (ResSourceIndex)
524 AslError (ASL_ERROR, ASL_MSG_RESOURCE_SOURCE,
525 InitializerOp, NULL);
530 case 11: /* ResourceTag */
532 UtAttachNamepathToOwner (Op, InitializerOp);
537 AslError (ASL_ERROR, ASL_MSG_RESOURCE_LIST, InitializerOp, NULL);
541 InitializerOp = RsCompleteNodeAndGetNext (InitializerOp);
544 /* Validate the Min/Max/Len/Gran values */
546 RsLargeAddressCheck (
547 (UINT64) Descriptor->Address16.Minimum,
548 (UINT64) Descriptor->Address16.Maximum,
549 (UINT64) Descriptor->Address16.AddressLength,
550 (UINT64) Descriptor->Address16.Granularity,
551 Descriptor->Address16.Flags,
552 MinOp, MaxOp, LengthOp, GranOp, Op);
554 Rnode->BufferLength = sizeof (AML_RESOURCE_ADDRESS16) +
555 OptionIndex + StringLength;
560 /*******************************************************************************
562 * FUNCTION: RsDoWordSpaceDescriptor
564 * PARAMETERS: Op - Parent resource descriptor parse node
565 * CurrentByteOffset - Offset into the resource template AML
566 * buffer (to track references to the desc)
568 * RETURN: Completed resource node
570 * DESCRIPTION: Construct a long "WordSpace" descriptor
572 ******************************************************************************/
575 RsDoWordSpaceDescriptor (
576 ACPI_PARSE_OBJECT *Op,
577 UINT32 CurrentByteOffset)
579 AML_RESOURCE *Descriptor;
580 ACPI_PARSE_OBJECT *InitializerOp;
581 ACPI_PARSE_OBJECT *MinOp = NULL;
582 ACPI_PARSE_OBJECT *MaxOp = NULL;
583 ACPI_PARSE_OBJECT *LengthOp = NULL;
584 ACPI_PARSE_OBJECT *GranOp = NULL;
585 ASL_RESOURCE_NODE *Rnode;
586 UINT8 *OptionalFields;
587 UINT16 StringLength = 0;
588 UINT32 OptionIndex = 0;
590 BOOLEAN ResSourceIndex = FALSE;
593 InitializerOp = Op->Asl.Child;
594 StringLength = RsGetStringDataLength (InitializerOp);
596 Rnode = RsAllocateResourceNode (
597 sizeof (AML_RESOURCE_ADDRESS16) + 1 + StringLength);
599 Descriptor = Rnode->Buffer;
600 Descriptor->Address16.DescriptorType = ACPI_RESOURCE_NAME_ADDRESS16;
603 * Initial descriptor length -- may be enlarged if there are
604 * optional fields present
606 OptionalFields = ((UINT8 *) Descriptor) + sizeof (AML_RESOURCE_ADDRESS16);
607 Descriptor->Address16.ResourceLength = (UINT16)
608 (sizeof (AML_RESOURCE_ADDRESS16) -
609 sizeof (AML_RESOURCE_LARGE_HEADER));
611 /* Process all child initialization nodes */
613 for (i = 0; InitializerOp; i++)
617 case 0: /* Resource Type */
619 Descriptor->Address16.ResourceType =
620 (UINT8) InitializerOp->Asl.Value.Integer;
623 case 1: /* Resource Usage */
625 RsSetFlagBits (&Descriptor->Address16.Flags, InitializerOp, 0, 1);
628 case 2: /* DecodeType */
630 RsSetFlagBits (&Descriptor->Address16.Flags, InitializerOp, 1, 0);
631 RsCreateBitField (InitializerOp, ACPI_RESTAG_DECODE,
632 CurrentByteOffset + ASL_RESDESC_OFFSET (Address16.Flags), 1);
635 case 3: /* MinType */
637 RsSetFlagBits (&Descriptor->Address16.Flags, InitializerOp, 2, 0);
638 RsCreateBitField (InitializerOp, ACPI_RESTAG_MINTYPE,
639 CurrentByteOffset + ASL_RESDESC_OFFSET (Address16.Flags), 2);
642 case 4: /* MaxType */
644 RsSetFlagBits (&Descriptor->Address16.Flags, InitializerOp, 3, 0);
645 RsCreateBitField (InitializerOp, ACPI_RESTAG_MAXTYPE,
646 CurrentByteOffset + ASL_RESDESC_OFFSET (Address16.Flags), 3);
649 case 5: /* Type-Specific flags */
651 Descriptor->Address16.SpecificFlags =
652 (UINT8) InitializerOp->Asl.Value.Integer;
655 case 6: /* Address Granularity */
657 Descriptor->Address16.Granularity =
658 (UINT16) InitializerOp->Asl.Value.Integer;
659 RsCreateByteField (InitializerOp, ACPI_RESTAG_GRANULARITY,
660 CurrentByteOffset + ASL_RESDESC_OFFSET (Address16.Granularity));
661 GranOp = InitializerOp;
664 case 7: /* Min Address */
666 Descriptor->Address16.Minimum =
667 (UINT16) InitializerOp->Asl.Value.Integer;
668 RsCreateByteField (InitializerOp, ACPI_RESTAG_MINADDR,
669 CurrentByteOffset + ASL_RESDESC_OFFSET (Address16.Minimum));
670 MinOp = InitializerOp;
673 case 8: /* Max Address */
675 Descriptor->Address16.Maximum =
676 (UINT16) InitializerOp->Asl.Value.Integer;
677 RsCreateByteField (InitializerOp, ACPI_RESTAG_MAXADDR,
678 CurrentByteOffset + ASL_RESDESC_OFFSET (Address16.Maximum));
679 MaxOp = InitializerOp;
682 case 9: /* Translation Offset */
684 Descriptor->Address16.TranslationOffset =
685 (UINT16) InitializerOp->Asl.Value.Integer;
686 RsCreateByteField (InitializerOp, ACPI_RESTAG_TRANSLATION,
687 CurrentByteOffset + ASL_RESDESC_OFFSET (Address16.TranslationOffset));
690 case 10: /* Address Length */
692 Descriptor->Address16.AddressLength =
693 (UINT16) InitializerOp->Asl.Value.Integer;
694 RsCreateByteField (InitializerOp, ACPI_RESTAG_LENGTH,
695 CurrentByteOffset + ASL_RESDESC_OFFSET (Address16.AddressLength));
696 LengthOp = InitializerOp;
699 case 11: /* ResSourceIndex [Optional Field - BYTE] */
701 if (InitializerOp->Asl.ParseOpcode != PARSEOP_DEFAULT_ARG)
703 OptionalFields[0] = (UINT8) InitializerOp->Asl.Value.Integer;
705 Descriptor->Address16.ResourceLength++;
706 ResSourceIndex = TRUE;
710 case 12: /* ResSource [Optional Field - STRING] */
712 if ((InitializerOp->Asl.ParseOpcode != PARSEOP_DEFAULT_ARG) &&
713 (InitializerOp->Asl.Value.String))
717 Descriptor->Address16.ResourceLength = (UINT16)
718 (Descriptor->Address16.ResourceLength + StringLength);
721 &OptionalFields[OptionIndex],
722 InitializerOp->Asl.Value.String);
724 /* ResourceSourceIndex must also be valid */
728 AslError (ASL_ERROR, ASL_MSG_RESOURCE_INDEX,
729 InitializerOp, NULL);
736 * Not a valid ResourceSource, ResourceSourceIndex must also
739 else if (ResSourceIndex)
741 AslError (ASL_ERROR, ASL_MSG_RESOURCE_SOURCE,
742 InitializerOp, NULL);
747 case 13: /* ResourceTag */
749 UtAttachNamepathToOwner (Op, InitializerOp);
754 AslError (ASL_ERROR, ASL_MSG_RESOURCE_LIST, InitializerOp, NULL);
758 InitializerOp = RsCompleteNodeAndGetNext (InitializerOp);
761 /* Validate the Min/Max/Len/Gran values */
763 RsLargeAddressCheck (
764 (UINT64) Descriptor->Address16.Minimum,
765 (UINT64) Descriptor->Address16.Maximum,
766 (UINT64) Descriptor->Address16.AddressLength,
767 (UINT64) Descriptor->Address16.Granularity,
768 Descriptor->Address16.Flags,
769 MinOp, MaxOp, LengthOp, GranOp, Op);
771 Rnode->BufferLength = sizeof (AML_RESOURCE_ADDRESS16) +
772 OptionIndex + StringLength;