1 /******************************************************************************
3 * Module Name: aslrestype2d - Large DWord address resource descriptors
5 *****************************************************************************/
7 /******************************************************************************
11 * Some or all of this work - Copyright (c) 1999 - 2015, 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 #include "aslcompiler.h"
117 #include "aslcompiler.y.h"
119 #define _COMPONENT ACPI_COMPILER
120 ACPI_MODULE_NAME ("aslrestype2d")
123 * This module contains the Dword (32-bit) address space descriptors:
130 /*******************************************************************************
132 * FUNCTION: RsDoDwordIoDescriptor
134 * PARAMETERS: Info - Parse Op and resource template offset
136 * RETURN: Completed resource node
138 * DESCRIPTION: Construct a long "DwordIO" descriptor
140 ******************************************************************************/
143 RsDoDwordIoDescriptor (
144 ASL_RESOURCE_INFO *Info)
146 AML_RESOURCE *Descriptor;
147 ACPI_PARSE_OBJECT *InitializerOp;
148 ACPI_PARSE_OBJECT *MinOp = NULL;
149 ACPI_PARSE_OBJECT *MaxOp = NULL;
150 ACPI_PARSE_OBJECT *LengthOp = NULL;
151 ACPI_PARSE_OBJECT *GranOp = NULL;
152 ASL_RESOURCE_NODE *Rnode;
153 UINT16 StringLength = 0;
154 UINT32 OptionIndex = 0;
155 UINT8 *OptionalFields;
156 UINT32 CurrentByteOffset;
158 BOOLEAN ResSourceIndex = FALSE;
161 InitializerOp = Info->DescriptorTypeOp->Asl.Child;
162 StringLength = RsGetStringDataLength (InitializerOp);
163 CurrentByteOffset = Info->CurrentByteOffset;
165 Rnode = RsAllocateResourceNode (
166 sizeof (AML_RESOURCE_ADDRESS32) + 1 + StringLength);
168 Descriptor = Rnode->Buffer;
169 Descriptor->Address32.DescriptorType = ACPI_RESOURCE_NAME_ADDRESS32;
170 Descriptor->Address32.ResourceType = ACPI_ADDRESS_TYPE_IO_RANGE;
173 * Initial descriptor length -- may be enlarged if there are
174 * optional fields present
176 OptionalFields = ((UINT8 *) Descriptor) + sizeof (AML_RESOURCE_ADDRESS32);
177 Descriptor->Address32.ResourceLength = (UINT16)
178 (sizeof (AML_RESOURCE_ADDRESS32) -
179 sizeof (AML_RESOURCE_LARGE_HEADER));
181 /* Process all child initialization nodes */
183 for (i = 0; InitializerOp; i++)
187 case 0: /* Resource Usage */
189 RsSetFlagBits (&Descriptor->Address32.Flags, InitializerOp, 0, 1);
192 case 1: /* MinType */
194 RsSetFlagBits (&Descriptor->Address32.Flags, InitializerOp, 2, 0);
195 RsCreateBitField (InitializerOp, ACPI_RESTAG_MINTYPE,
196 CurrentByteOffset + ASL_RESDESC_OFFSET (Address32.Flags), 2);
199 case 2: /* MaxType */
201 RsSetFlagBits (&Descriptor->Address32.Flags, InitializerOp, 3, 0);
202 RsCreateBitField (InitializerOp, ACPI_RESTAG_MAXTYPE,
203 CurrentByteOffset + ASL_RESDESC_OFFSET (Address32.Flags), 3);
206 case 3: /* DecodeType */
208 RsSetFlagBits (&Descriptor->Address32.Flags, InitializerOp, 1, 0);
209 RsCreateBitField (InitializerOp, ACPI_RESTAG_DECODE,
210 CurrentByteOffset + ASL_RESDESC_OFFSET (Address32.Flags), 1);
213 case 4: /* Range Type */
215 RsSetFlagBits (&Descriptor->Address32.SpecificFlags, InitializerOp, 0, 3);
216 RsCreateMultiBitField (InitializerOp, ACPI_RESTAG_RANGETYPE,
217 CurrentByteOffset + ASL_RESDESC_OFFSET (Address32.SpecificFlags), 0, 2);
220 case 5: /* Address Granularity */
222 Descriptor->Address32.Granularity =
223 (UINT32) InitializerOp->Asl.Value.Integer;
224 RsCreateDwordField (InitializerOp, ACPI_RESTAG_GRANULARITY,
225 CurrentByteOffset + ASL_RESDESC_OFFSET (Address32.Granularity));
226 GranOp = InitializerOp;
229 case 6: /* Address Min */
231 Descriptor->Address32.Minimum =
232 (UINT32) InitializerOp->Asl.Value.Integer;
233 RsCreateDwordField (InitializerOp, ACPI_RESTAG_MINADDR,
234 CurrentByteOffset + ASL_RESDESC_OFFSET (Address32.Minimum));
235 MinOp = InitializerOp;
238 case 7: /* Address Max */
240 Descriptor->Address32.Maximum =
241 (UINT32) InitializerOp->Asl.Value.Integer;
242 RsCreateDwordField (InitializerOp, ACPI_RESTAG_MAXADDR,
243 CurrentByteOffset + ASL_RESDESC_OFFSET (Address32.Maximum));
244 MaxOp = InitializerOp;
247 case 8: /* Translation Offset */
249 Descriptor->Address32.TranslationOffset =
250 (UINT32) InitializerOp->Asl.Value.Integer;
251 RsCreateDwordField (InitializerOp, ACPI_RESTAG_TRANSLATION,
252 CurrentByteOffset + ASL_RESDESC_OFFSET (Address32.TranslationOffset));
255 case 9: /* Address Length */
257 Descriptor->Address32.AddressLength =
258 (UINT32) InitializerOp->Asl.Value.Integer;
259 RsCreateDwordField (InitializerOp, ACPI_RESTAG_LENGTH,
260 CurrentByteOffset + ASL_RESDESC_OFFSET (Address32.AddressLength));
261 LengthOp = InitializerOp;
264 case 10: /* ResSourceIndex [Optional Field - BYTE] */
266 if (InitializerOp->Asl.ParseOpcode != PARSEOP_DEFAULT_ARG)
268 /* Found a valid ResourceSourceIndex */
270 OptionalFields[0] = (UINT8) InitializerOp->Asl.Value.Integer;
272 Descriptor->Address32.ResourceLength++;
273 ResSourceIndex = TRUE;
277 case 11: /* ResSource [Optional Field - STRING] */
279 if ((InitializerOp->Asl.ParseOpcode != PARSEOP_DEFAULT_ARG) &&
280 (InitializerOp->Asl.Value.String))
284 /* Found a valid ResourceSource */
286 Descriptor->Address32.ResourceLength = (UINT16)
287 (Descriptor->Address32.ResourceLength + StringLength);
290 &OptionalFields[OptionIndex],
291 InitializerOp->Asl.Value.String);
293 /* ResourceSourceIndex must also be valid */
297 AslError (ASL_ERROR, ASL_MSG_RESOURCE_INDEX,
298 InitializerOp, NULL);
305 * Not a valid ResourceSource, ResourceSourceIndex must also
308 else if (ResSourceIndex)
310 AslError (ASL_ERROR, ASL_MSG_RESOURCE_SOURCE,
311 InitializerOp, NULL);
316 case 12: /* ResourceTag */
318 UtAttachNamepathToOwner (Info->DescriptorTypeOp, InitializerOp);
323 RsSetFlagBits (&Descriptor->Address32.SpecificFlags, InitializerOp, 4, 0);
324 RsCreateBitField (InitializerOp, ACPI_RESTAG_TYPE,
325 CurrentByteOffset + ASL_RESDESC_OFFSET (Address32.SpecificFlags), 4);
328 case 14: /* Translation Type */
330 RsSetFlagBits (&Descriptor->Address32.SpecificFlags, InitializerOp, 5, 0);
331 RsCreateBitField (InitializerOp, ACPI_RESTAG_TRANSTYPE,
332 CurrentByteOffset + ASL_RESDESC_OFFSET (Address32.SpecificFlags), 5);
337 AslError (ASL_ERROR, ASL_MSG_RESOURCE_LIST, InitializerOp, NULL);
341 InitializerOp = RsCompleteNodeAndGetNext (InitializerOp);
344 /* Validate the Min/Max/Len/Gran values */
346 RsLargeAddressCheck (
347 (UINT64) Descriptor->Address32.Minimum,
348 (UINT64) Descriptor->Address32.Maximum,
349 (UINT64) Descriptor->Address32.AddressLength,
350 (UINT64) Descriptor->Address32.Granularity,
351 Descriptor->Address32.Flags,
352 MinOp, MaxOp, LengthOp, GranOp, Info->DescriptorTypeOp);
354 Rnode->BufferLength = sizeof (AML_RESOURCE_ADDRESS32) +
355 OptionIndex + StringLength;
360 /*******************************************************************************
362 * FUNCTION: RsDoDwordMemoryDescriptor
364 * PARAMETERS: Info - Parse Op and resource template offset
366 * RETURN: Completed resource node
368 * DESCRIPTION: Construct a long "DwordMemory" descriptor
370 ******************************************************************************/
373 RsDoDwordMemoryDescriptor (
374 ASL_RESOURCE_INFO *Info)
376 AML_RESOURCE *Descriptor;
377 ACPI_PARSE_OBJECT *InitializerOp;
378 ACPI_PARSE_OBJECT *MinOp = NULL;
379 ACPI_PARSE_OBJECT *MaxOp = NULL;
380 ACPI_PARSE_OBJECT *LengthOp = NULL;
381 ACPI_PARSE_OBJECT *GranOp = NULL;
382 ASL_RESOURCE_NODE *Rnode;
383 UINT8 *OptionalFields;
384 UINT16 StringLength = 0;
385 UINT32 OptionIndex = 0;
386 UINT32 CurrentByteOffset;
388 BOOLEAN ResSourceIndex = FALSE;
391 InitializerOp = Info->DescriptorTypeOp->Asl.Child;
392 StringLength = RsGetStringDataLength (InitializerOp);
393 CurrentByteOffset = Info->CurrentByteOffset;
395 Rnode = RsAllocateResourceNode (
396 sizeof (AML_RESOURCE_ADDRESS32) + 1 + StringLength);
398 Descriptor = Rnode->Buffer;
399 Descriptor->Address32.DescriptorType = ACPI_RESOURCE_NAME_ADDRESS32;
400 Descriptor->Address32.ResourceType = ACPI_ADDRESS_TYPE_MEMORY_RANGE;
403 * Initial descriptor length -- may be enlarged if there are
404 * optional fields present
406 OptionalFields = ((UINT8 *) Descriptor) + sizeof (AML_RESOURCE_ADDRESS32);
407 Descriptor->Address32.ResourceLength = (UINT16)
408 (sizeof (AML_RESOURCE_ADDRESS32) -
409 sizeof (AML_RESOURCE_LARGE_HEADER));
412 /* Process all child initialization nodes */
414 for (i = 0; InitializerOp; i++)
418 case 0: /* Resource Usage */
420 RsSetFlagBits (&Descriptor->Address32.Flags, InitializerOp, 0, 1);
423 case 1: /* DecodeType */
425 RsSetFlagBits (&Descriptor->Address32.Flags, InitializerOp, 1, 0);
426 RsCreateBitField (InitializerOp, ACPI_RESTAG_DECODE,
427 CurrentByteOffset + ASL_RESDESC_OFFSET (Address32.Flags), 1);
430 case 2: /* MinType */
432 RsSetFlagBits (&Descriptor->Address32.Flags, InitializerOp, 2, 0);
433 RsCreateBitField (InitializerOp, ACPI_RESTAG_MINTYPE,
434 CurrentByteOffset + ASL_RESDESC_OFFSET (Address32.Flags), 2);
437 case 3: /* MaxType */
439 RsSetFlagBits (&Descriptor->Address32.Flags, InitializerOp, 3, 0);
440 RsCreateBitField (InitializerOp, ACPI_RESTAG_MAXTYPE,
441 CurrentByteOffset + ASL_RESDESC_OFFSET (Address32.Flags), 3);
444 case 4: /* Memory Type */
446 RsSetFlagBits (&Descriptor->Address32.SpecificFlags, InitializerOp, 1, 0);
447 RsCreateMultiBitField (InitializerOp, ACPI_RESTAG_MEMTYPE,
448 CurrentByteOffset + ASL_RESDESC_OFFSET (Address32.SpecificFlags), 1, 2);
451 case 5: /* Read/Write Type */
453 RsSetFlagBits (&Descriptor->Address32.SpecificFlags, InitializerOp, 0, 1);
454 RsCreateBitField (InitializerOp, ACPI_RESTAG_READWRITETYPE,
455 CurrentByteOffset + ASL_RESDESC_OFFSET (Address32.SpecificFlags), 0);
458 case 6: /* Address Granularity */
460 Descriptor->Address32.Granularity =
461 (UINT32) InitializerOp->Asl.Value.Integer;
462 RsCreateDwordField (InitializerOp, ACPI_RESTAG_GRANULARITY,
463 CurrentByteOffset + ASL_RESDESC_OFFSET (Address32.Granularity));
464 GranOp = InitializerOp;
467 case 7: /* Min Address */
469 Descriptor->Address32.Minimum =
470 (UINT32) InitializerOp->Asl.Value.Integer;
471 RsCreateDwordField (InitializerOp, ACPI_RESTAG_MINADDR,
472 CurrentByteOffset + ASL_RESDESC_OFFSET (Address32.Minimum));
473 MinOp = InitializerOp;
476 case 8: /* Max Address */
478 Descriptor->Address32.Maximum =
479 (UINT32) InitializerOp->Asl.Value.Integer;
480 RsCreateDwordField (InitializerOp, ACPI_RESTAG_MAXADDR,
481 CurrentByteOffset + ASL_RESDESC_OFFSET (Address32.Maximum));
482 MaxOp = InitializerOp;
485 case 9: /* Translation Offset */
487 Descriptor->Address32.TranslationOffset =
488 (UINT32) InitializerOp->Asl.Value.Integer;
489 RsCreateDwordField (InitializerOp, ACPI_RESTAG_TRANSLATION,
490 CurrentByteOffset + ASL_RESDESC_OFFSET (Address32.TranslationOffset));
493 case 10: /* Address Length */
495 Descriptor->Address32.AddressLength =
496 (UINT32) InitializerOp->Asl.Value.Integer;
497 RsCreateDwordField (InitializerOp, ACPI_RESTAG_LENGTH,
498 CurrentByteOffset + ASL_RESDESC_OFFSET (Address32.AddressLength));
499 LengthOp = InitializerOp;
502 case 11: /* ResSourceIndex [Optional Field - BYTE] */
504 if (InitializerOp->Asl.ParseOpcode != PARSEOP_DEFAULT_ARG)
506 OptionalFields[0] = (UINT8) InitializerOp->Asl.Value.Integer;
508 Descriptor->Address32.ResourceLength++;
509 ResSourceIndex = TRUE;
513 case 12: /* ResSource [Optional Field - STRING] */
515 if ((InitializerOp->Asl.ParseOpcode != PARSEOP_DEFAULT_ARG) &&
516 (InitializerOp->Asl.Value.String))
520 Descriptor->Address32.ResourceLength = (UINT16)
521 (Descriptor->Address32.ResourceLength + StringLength);
524 &OptionalFields[OptionIndex],
525 InitializerOp->Asl.Value.String);
527 /* ResourceSourceIndex must also be valid */
531 AslError (ASL_ERROR, ASL_MSG_RESOURCE_INDEX,
532 InitializerOp, NULL);
539 * Not a valid ResourceSource, ResourceSourceIndex must also
542 else if (ResSourceIndex)
544 AslError (ASL_ERROR, ASL_MSG_RESOURCE_SOURCE,
545 InitializerOp, NULL);
550 case 13: /* ResourceTag */
552 UtAttachNamepathToOwner (Info->DescriptorTypeOp, InitializerOp);
556 case 14: /* Address Range */
558 RsSetFlagBits (&Descriptor->Address32.SpecificFlags, InitializerOp, 3, 0);
559 RsCreateMultiBitField (InitializerOp, ACPI_RESTAG_MEMATTRIBUTES,
560 CurrentByteOffset + ASL_RESDESC_OFFSET (Address32.SpecificFlags), 3, 2);
565 RsSetFlagBits (&Descriptor->Address32.SpecificFlags, InitializerOp, 5, 0);
566 RsCreateBitField (InitializerOp, ACPI_RESTAG_TYPE,
567 CurrentByteOffset + ASL_RESDESC_OFFSET (Address32.SpecificFlags), 5);
572 AslError (ASL_ERROR, ASL_MSG_RESOURCE_LIST, InitializerOp, NULL);
576 InitializerOp = RsCompleteNodeAndGetNext (InitializerOp);
579 /* Validate the Min/Max/Len/Gran values */
581 RsLargeAddressCheck (
582 (UINT64) Descriptor->Address32.Minimum,
583 (UINT64) Descriptor->Address32.Maximum,
584 (UINT64) Descriptor->Address32.AddressLength,
585 (UINT64) Descriptor->Address32.Granularity,
586 Descriptor->Address32.Flags,
587 MinOp, MaxOp, LengthOp, GranOp, Info->DescriptorTypeOp);
589 Rnode->BufferLength = sizeof (AML_RESOURCE_ADDRESS32) +
590 OptionIndex + StringLength;
595 /*******************************************************************************
597 * FUNCTION: RsDoDwordSpaceDescriptor
599 * PARAMETERS: Info - Parse Op and resource template offset
601 * RETURN: Completed resource node
603 * DESCRIPTION: Construct a long "DwordSpace" descriptor
605 ******************************************************************************/
608 RsDoDwordSpaceDescriptor (
609 ASL_RESOURCE_INFO *Info)
611 AML_RESOURCE *Descriptor;
612 ACPI_PARSE_OBJECT *InitializerOp;
613 ACPI_PARSE_OBJECT *MinOp = NULL;
614 ACPI_PARSE_OBJECT *MaxOp = NULL;
615 ACPI_PARSE_OBJECT *LengthOp = NULL;
616 ACPI_PARSE_OBJECT *GranOp = NULL;
617 ASL_RESOURCE_NODE *Rnode;
618 UINT8 *OptionalFields;
619 UINT16 StringLength = 0;
620 UINT32 OptionIndex = 0;
621 UINT32 CurrentByteOffset;
623 BOOLEAN ResSourceIndex = FALSE;
626 InitializerOp = Info->DescriptorTypeOp->Asl.Child;
627 StringLength = RsGetStringDataLength (InitializerOp);
628 CurrentByteOffset = Info->CurrentByteOffset;
630 Rnode = RsAllocateResourceNode (
631 sizeof (AML_RESOURCE_ADDRESS32) + 1 + StringLength);
633 Descriptor = Rnode->Buffer;
634 Descriptor->Address32.DescriptorType = ACPI_RESOURCE_NAME_ADDRESS32;
637 * Initial descriptor length -- may be enlarged if there are
638 * optional fields present
640 OptionalFields = ((UINT8 *) Descriptor) + sizeof (AML_RESOURCE_ADDRESS32);
641 Descriptor->Address32.ResourceLength = (UINT16)
642 (sizeof (AML_RESOURCE_ADDRESS32) -
643 sizeof (AML_RESOURCE_LARGE_HEADER));
645 /* Process all child initialization nodes */
647 for (i = 0; InitializerOp; i++)
651 case 0: /* Resource Type */
653 Descriptor->Address32.ResourceType =
654 (UINT8) InitializerOp->Asl.Value.Integer;
657 case 1: /* Resource Usage */
659 RsSetFlagBits (&Descriptor->Address32.Flags, InitializerOp, 0, 1);
662 case 2: /* DecodeType */
664 RsSetFlagBits (&Descriptor->Address32.Flags, InitializerOp, 1, 0);
665 RsCreateBitField (InitializerOp, ACPI_RESTAG_DECODE,
666 CurrentByteOffset + ASL_RESDESC_OFFSET (Address32.Flags), 1);
669 case 3: /* MinType */
671 RsSetFlagBits (&Descriptor->Address32.Flags, InitializerOp, 2, 0);
672 RsCreateBitField (InitializerOp, ACPI_RESTAG_MINTYPE,
673 CurrentByteOffset + ASL_RESDESC_OFFSET (Address32.Flags), 2);
676 case 4: /* MaxType */
678 RsSetFlagBits (&Descriptor->Address32.Flags, InitializerOp, 3, 0);
679 RsCreateBitField (InitializerOp, ACPI_RESTAG_MAXTYPE,
680 CurrentByteOffset + ASL_RESDESC_OFFSET (Address32.Flags), 3);
683 case 5: /* Type-Specific flags */
685 Descriptor->Address32.SpecificFlags =
686 (UINT8) InitializerOp->Asl.Value.Integer;
689 case 6: /* Address Granularity */
691 Descriptor->Address32.Granularity =
692 (UINT32) InitializerOp->Asl.Value.Integer;
693 RsCreateDwordField (InitializerOp, ACPI_RESTAG_GRANULARITY,
694 CurrentByteOffset + ASL_RESDESC_OFFSET (Address32.Granularity));
695 GranOp = InitializerOp;
698 case 7: /* Min Address */
700 Descriptor->Address32.Minimum =
701 (UINT32) InitializerOp->Asl.Value.Integer;
702 RsCreateDwordField (InitializerOp, ACPI_RESTAG_MINADDR,
703 CurrentByteOffset + ASL_RESDESC_OFFSET (Address32.Minimum));
704 MinOp = InitializerOp;
707 case 8: /* Max Address */
709 Descriptor->Address32.Maximum =
710 (UINT32) InitializerOp->Asl.Value.Integer;
711 RsCreateDwordField (InitializerOp, ACPI_RESTAG_MAXADDR,
712 CurrentByteOffset + ASL_RESDESC_OFFSET (Address32.Maximum));
713 MaxOp = InitializerOp;
716 case 9: /* Translation Offset */
718 Descriptor->Address32.TranslationOffset =
719 (UINT32) InitializerOp->Asl.Value.Integer;
720 RsCreateDwordField (InitializerOp, ACPI_RESTAG_TRANSLATION,
721 CurrentByteOffset + ASL_RESDESC_OFFSET (Address32.TranslationOffset));
724 case 10: /* Address Length */
726 Descriptor->Address32.AddressLength =
727 (UINT32) InitializerOp->Asl.Value.Integer;
728 RsCreateDwordField (InitializerOp, ACPI_RESTAG_LENGTH,
729 CurrentByteOffset + ASL_RESDESC_OFFSET (Address32.AddressLength));
730 LengthOp = InitializerOp;
733 case 11: /* ResSourceIndex [Optional Field - BYTE] */
735 if (InitializerOp->Asl.ParseOpcode != PARSEOP_DEFAULT_ARG)
737 OptionalFields[0] = (UINT8) InitializerOp->Asl.Value.Integer;
739 Descriptor->Address32.ResourceLength++;
740 ResSourceIndex = TRUE;
744 case 12: /* ResSource [Optional Field - STRING] */
746 if ((InitializerOp->Asl.ParseOpcode != PARSEOP_DEFAULT_ARG) &&
747 (InitializerOp->Asl.Value.String))
751 Descriptor->Address32.ResourceLength = (UINT16)
752 (Descriptor->Address32.ResourceLength + StringLength);
755 &OptionalFields[OptionIndex],
756 InitializerOp->Asl.Value.String);
758 /* ResourceSourceIndex must also be valid */
762 AslError (ASL_ERROR, ASL_MSG_RESOURCE_INDEX,
763 InitializerOp, NULL);
770 * Not a valid ResourceSource, ResourceSourceIndex must also
773 else if (ResSourceIndex)
775 AslError (ASL_ERROR, ASL_MSG_RESOURCE_SOURCE,
776 InitializerOp, NULL);
781 case 13: /* ResourceTag */
783 UtAttachNamepathToOwner (Info->DescriptorTypeOp, InitializerOp);
788 AslError (ASL_ERROR, ASL_MSG_RESOURCE_LIST,
789 InitializerOp, NULL);
793 InitializerOp = RsCompleteNodeAndGetNext (InitializerOp);
796 /* Validate the Min/Max/Len/Gran values */
798 RsLargeAddressCheck (
799 (UINT64) Descriptor->Address32.Minimum,
800 (UINT64) Descriptor->Address32.Maximum,
801 (UINT64) Descriptor->Address32.AddressLength,
802 (UINT64) Descriptor->Address32.Granularity,
803 Descriptor->Address32.Flags,
804 MinOp, MaxOp, LengthOp, GranOp, Info->DescriptorTypeOp);
806 Rnode->BufferLength = sizeof (AML_RESOURCE_ADDRESS32) +
807 OptionIndex + StringLength;