2 /******************************************************************************
4 * Module Name: aslrestype2d - Large DWord 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 ("aslrestype2d")
125 * This module contains the Dword (32-bit) address space descriptors:
132 /*******************************************************************************
134 * FUNCTION: RsDoDwordIoDescriptor
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 "DwordIO" descriptor
144 ******************************************************************************/
147 RsDoDwordIoDescriptor (
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 UINT16 StringLength = 0;
159 UINT32 OptionIndex = 0;
160 UINT8 *OptionalFields;
162 BOOLEAN ResSourceIndex = FALSE;
165 InitializerOp = Op->Asl.Child;
166 StringLength = RsGetStringDataLength (InitializerOp);
168 Rnode = RsAllocateResourceNode (
169 sizeof (AML_RESOURCE_ADDRESS32) + 1 + StringLength);
171 Descriptor = Rnode->Buffer;
172 Descriptor->Address32.DescriptorType = ACPI_RESOURCE_NAME_ADDRESS32;
173 Descriptor->Address32.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_ADDRESS32);
180 Descriptor->Address32.ResourceLength = (UINT16)
181 (sizeof (AML_RESOURCE_ADDRESS32) -
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->Address32.Flags, InitializerOp, 0, 1);
195 case 1: /* MinType */
197 RsSetFlagBits (&Descriptor->Address32.Flags, InitializerOp, 2, 0);
198 RsCreateBitField (InitializerOp, ACPI_RESTAG_MINTYPE,
199 CurrentByteOffset + ASL_RESDESC_OFFSET (Address32.Flags), 2);
202 case 2: /* MaxType */
204 RsSetFlagBits (&Descriptor->Address32.Flags, InitializerOp, 3, 0);
205 RsCreateBitField (InitializerOp, ACPI_RESTAG_MAXTYPE,
206 CurrentByteOffset + ASL_RESDESC_OFFSET (Address32.Flags), 3);
209 case 3: /* DecodeType */
211 RsSetFlagBits (&Descriptor->Address32.Flags, InitializerOp, 1, 0);
212 RsCreateBitField (InitializerOp, ACPI_RESTAG_DECODE,
213 CurrentByteOffset + ASL_RESDESC_OFFSET (Address32.Flags), 1);
216 case 4: /* Range Type */
218 RsSetFlagBits (&Descriptor->Address32.SpecificFlags, InitializerOp, 0, 3);
219 RsCreateBitField (InitializerOp, ACPI_RESTAG_RANGETYPE,
220 CurrentByteOffset + ASL_RESDESC_OFFSET (Address32.SpecificFlags), 0);
223 case 5: /* Address Granularity */
225 Descriptor->Address32.Granularity =
226 (UINT32) InitializerOp->Asl.Value.Integer;
227 RsCreateByteField (InitializerOp, ACPI_RESTAG_GRANULARITY,
228 CurrentByteOffset + ASL_RESDESC_OFFSET (Address32.Granularity));
229 GranOp = InitializerOp;
232 case 6: /* Address Min */
234 Descriptor->Address32.Minimum =
235 (UINT32) InitializerOp->Asl.Value.Integer;
236 RsCreateByteField (InitializerOp, ACPI_RESTAG_MINADDR,
237 CurrentByteOffset + ASL_RESDESC_OFFSET (Address32.Minimum));
238 MinOp = InitializerOp;
241 case 7: /* Address Max */
243 Descriptor->Address32.Maximum =
244 (UINT32) InitializerOp->Asl.Value.Integer;
245 RsCreateByteField (InitializerOp, ACPI_RESTAG_MAXADDR,
246 CurrentByteOffset + ASL_RESDESC_OFFSET (Address32.Maximum));
247 MaxOp = InitializerOp;
250 case 8: /* Translation Offset */
252 Descriptor->Address32.TranslationOffset =
253 (UINT32) InitializerOp->Asl.Value.Integer;
254 RsCreateByteField (InitializerOp, ACPI_RESTAG_TRANSLATION,
255 CurrentByteOffset + ASL_RESDESC_OFFSET (Address32.TranslationOffset));
258 case 9: /* Address Length */
260 Descriptor->Address32.AddressLength =
261 (UINT32) InitializerOp->Asl.Value.Integer;
262 RsCreateByteField (InitializerOp, ACPI_RESTAG_LENGTH,
263 CurrentByteOffset + ASL_RESDESC_OFFSET (Address32.AddressLength));
264 LengthOp = InitializerOp;
267 case 10: /* ResSourceIndex [Optional Field - BYTE] */
269 if (InitializerOp->Asl.ParseOpcode != PARSEOP_DEFAULT_ARG)
271 /* Found a valid ResourceSourceIndex */
273 OptionalFields[0] = (UINT8) InitializerOp->Asl.Value.Integer;
275 Descriptor->Address32.ResourceLength++;
276 ResSourceIndex = TRUE;
280 case 11: /* ResSource [Optional Field - STRING] */
282 if ((InitializerOp->Asl.ParseOpcode != PARSEOP_DEFAULT_ARG) &&
283 (InitializerOp->Asl.Value.String))
287 /* Found a valid ResourceSource */
289 Descriptor->Address32.ResourceLength = (UINT16)
290 (Descriptor->Address32.ResourceLength + StringLength);
293 &OptionalFields[OptionIndex],
294 InitializerOp->Asl.Value.String);
296 /* ResourceSourceIndex must also be valid */
300 AslError (ASL_ERROR, ASL_MSG_RESOURCE_INDEX,
301 InitializerOp, NULL);
308 * Not a valid ResourceSource, ResourceSourceIndex must also
311 else if (ResSourceIndex)
313 AslError (ASL_ERROR, ASL_MSG_RESOURCE_SOURCE,
314 InitializerOp, NULL);
319 case 12: /* ResourceTag */
321 UtAttachNamepathToOwner (Op, InitializerOp);
326 RsSetFlagBits (&Descriptor->Address32.SpecificFlags, InitializerOp, 4, 0);
327 RsCreateBitField (InitializerOp, ACPI_RESTAG_TYPE,
328 CurrentByteOffset + ASL_RESDESC_OFFSET (Address32.SpecificFlags), 4);
331 case 14: /* Translation Type */
333 RsSetFlagBits (&Descriptor->Address32.SpecificFlags, InitializerOp, 5, 0);
334 RsCreateBitField (InitializerOp, ACPI_RESTAG_TRANSTYPE,
335 CurrentByteOffset + ASL_RESDESC_OFFSET (Address32.SpecificFlags), 5);
340 AslError (ASL_ERROR, ASL_MSG_RESOURCE_LIST, InitializerOp, NULL);
344 InitializerOp = RsCompleteNodeAndGetNext (InitializerOp);
347 /* Validate the Min/Max/Len/Gran values */
349 RsLargeAddressCheck (
350 (UINT64) Descriptor->Address32.Minimum,
351 (UINT64) Descriptor->Address32.Maximum,
352 (UINT64) Descriptor->Address32.AddressLength,
353 (UINT64) Descriptor->Address32.Granularity,
354 Descriptor->Address32.Flags,
355 MinOp, MaxOp, LengthOp, GranOp, Op);
357 Rnode->BufferLength = sizeof (AML_RESOURCE_ADDRESS32) +
358 OptionIndex + StringLength;
363 /*******************************************************************************
365 * FUNCTION: RsDoDwordMemoryDescriptor
367 * PARAMETERS: Op - Parent resource descriptor parse node
368 * CurrentByteOffset - Offset into the resource template AML
369 * buffer (to track references to the desc)
371 * RETURN: Completed resource node
373 * DESCRIPTION: Construct a long "DwordMemory" descriptor
375 ******************************************************************************/
378 RsDoDwordMemoryDescriptor (
379 ACPI_PARSE_OBJECT *Op,
380 UINT32 CurrentByteOffset)
382 AML_RESOURCE *Descriptor;
383 ACPI_PARSE_OBJECT *InitializerOp;
384 ACPI_PARSE_OBJECT *MinOp = NULL;
385 ACPI_PARSE_OBJECT *MaxOp = NULL;
386 ACPI_PARSE_OBJECT *LengthOp = NULL;
387 ACPI_PARSE_OBJECT *GranOp = NULL;
388 ASL_RESOURCE_NODE *Rnode;
389 UINT8 *OptionalFields;
390 UINT16 StringLength = 0;
391 UINT32 OptionIndex = 0;
393 BOOLEAN ResSourceIndex = FALSE;
396 InitializerOp = Op->Asl.Child;
397 StringLength = RsGetStringDataLength (InitializerOp);
399 Rnode = RsAllocateResourceNode (
400 sizeof (AML_RESOURCE_ADDRESS32) + 1 + StringLength);
402 Descriptor = Rnode->Buffer;
403 Descriptor->Address32.DescriptorType = ACPI_RESOURCE_NAME_ADDRESS32;
404 Descriptor->Address32.ResourceType = ACPI_ADDRESS_TYPE_MEMORY_RANGE;
407 * Initial descriptor length -- may be enlarged if there are
408 * optional fields present
410 OptionalFields = ((UINT8 *) Descriptor) + sizeof (AML_RESOURCE_ADDRESS32);
411 Descriptor->Address32.ResourceLength = (UINT16)
412 (sizeof (AML_RESOURCE_ADDRESS32) -
413 sizeof (AML_RESOURCE_LARGE_HEADER));
416 /* Process all child initialization nodes */
418 for (i = 0; InitializerOp; i++)
422 case 0: /* Resource Usage */
424 RsSetFlagBits (&Descriptor->Address32.Flags, InitializerOp, 0, 1);
427 case 1: /* DecodeType */
429 RsSetFlagBits (&Descriptor->Address32.Flags, InitializerOp, 1, 0);
430 RsCreateBitField (InitializerOp, ACPI_RESTAG_DECODE,
431 CurrentByteOffset + ASL_RESDESC_OFFSET (Address32.Flags), 1);
434 case 2: /* MinType */
436 RsSetFlagBits (&Descriptor->Address32.Flags, InitializerOp, 2, 0);
437 RsCreateBitField (InitializerOp, ACPI_RESTAG_MINTYPE,
438 CurrentByteOffset + ASL_RESDESC_OFFSET (Address32.Flags), 2);
441 case 3: /* MaxType */
443 RsSetFlagBits (&Descriptor->Address32.Flags, InitializerOp, 3, 0);
444 RsCreateBitField (InitializerOp, ACPI_RESTAG_MAXTYPE,
445 CurrentByteOffset + ASL_RESDESC_OFFSET (Address32.Flags), 3);
448 case 4: /* Memory Type */
450 RsSetFlagBits (&Descriptor->Address32.SpecificFlags, InitializerOp, 1, 0);
451 RsCreateBitField (InitializerOp, ACPI_RESTAG_MEMTYPE,
452 CurrentByteOffset + ASL_RESDESC_OFFSET (Address32.SpecificFlags), 1);
455 case 5: /* Read/Write Type */
457 RsSetFlagBits (&Descriptor->Address32.SpecificFlags, InitializerOp, 0, 1);
458 RsCreateBitField (InitializerOp, ACPI_RESTAG_READWRITETYPE,
459 CurrentByteOffset + ASL_RESDESC_OFFSET (Address32.SpecificFlags), 0);
462 case 6: /* Address Granularity */
464 Descriptor->Address32.Granularity =
465 (UINT32) InitializerOp->Asl.Value.Integer;
466 RsCreateByteField (InitializerOp, ACPI_RESTAG_GRANULARITY,
467 CurrentByteOffset + ASL_RESDESC_OFFSET (Address32.Granularity));
468 GranOp = InitializerOp;
471 case 7: /* Min Address */
473 Descriptor->Address32.Minimum =
474 (UINT32) InitializerOp->Asl.Value.Integer;
475 RsCreateByteField (InitializerOp, ACPI_RESTAG_MINADDR,
476 CurrentByteOffset + ASL_RESDESC_OFFSET (Address32.Minimum));
477 MinOp = InitializerOp;
480 case 8: /* Max Address */
482 Descriptor->Address32.Maximum =
483 (UINT32) InitializerOp->Asl.Value.Integer;
484 RsCreateByteField (InitializerOp, ACPI_RESTAG_MAXADDR,
485 CurrentByteOffset + ASL_RESDESC_OFFSET (Address32.Maximum));
486 MaxOp = InitializerOp;
489 case 9: /* Translation Offset */
491 Descriptor->Address32.TranslationOffset =
492 (UINT32) InitializerOp->Asl.Value.Integer;
493 RsCreateByteField (InitializerOp, ACPI_RESTAG_TRANSLATION,
494 CurrentByteOffset + ASL_RESDESC_OFFSET (Address32.TranslationOffset));
497 case 10: /* Address Length */
499 Descriptor->Address32.AddressLength =
500 (UINT32) InitializerOp->Asl.Value.Integer;
501 RsCreateByteField (InitializerOp, ACPI_RESTAG_LENGTH,
502 CurrentByteOffset + ASL_RESDESC_OFFSET (Address32.AddressLength));
503 LengthOp = InitializerOp;
506 case 11: /* ResSourceIndex [Optional Field - BYTE] */
508 if (InitializerOp->Asl.ParseOpcode != PARSEOP_DEFAULT_ARG)
510 OptionalFields[0] = (UINT8) InitializerOp->Asl.Value.Integer;
512 Descriptor->Address32.ResourceLength++;
513 ResSourceIndex = TRUE;
517 case 12: /* ResSource [Optional Field - STRING] */
519 if ((InitializerOp->Asl.ParseOpcode != PARSEOP_DEFAULT_ARG) &&
520 (InitializerOp->Asl.Value.String))
524 Descriptor->Address32.ResourceLength = (UINT16)
525 (Descriptor->Address32.ResourceLength + StringLength);
528 &OptionalFields[OptionIndex],
529 InitializerOp->Asl.Value.String);
531 /* ResourceSourceIndex must also be valid */
535 AslError (ASL_ERROR, ASL_MSG_RESOURCE_INDEX,
536 InitializerOp, NULL);
543 * Not a valid ResourceSource, ResourceSourceIndex must also
546 else if (ResSourceIndex)
548 AslError (ASL_ERROR, ASL_MSG_RESOURCE_SOURCE,
549 InitializerOp, NULL);
554 case 13: /* ResourceTag */
556 UtAttachNamepathToOwner (Op, InitializerOp);
560 case 14: /* Address Range */
562 RsSetFlagBits (&Descriptor->Address32.SpecificFlags, InitializerOp, 3, 0);
563 RsCreateBitField (InitializerOp, ACPI_RESTAG_MEMATTRIBUTES,
564 CurrentByteOffset + ASL_RESDESC_OFFSET (Address32.SpecificFlags), 3);
569 RsSetFlagBits (&Descriptor->Address32.SpecificFlags, InitializerOp, 5, 0);
570 RsCreateBitField (InitializerOp, ACPI_RESTAG_TYPE,
571 CurrentByteOffset + ASL_RESDESC_OFFSET (Address32.SpecificFlags), 5);
576 AslError (ASL_ERROR, ASL_MSG_RESOURCE_LIST, InitializerOp, NULL);
580 InitializerOp = RsCompleteNodeAndGetNext (InitializerOp);
583 /* Validate the Min/Max/Len/Gran values */
585 RsLargeAddressCheck (
586 (UINT64) Descriptor->Address32.Minimum,
587 (UINT64) Descriptor->Address32.Maximum,
588 (UINT64) Descriptor->Address32.AddressLength,
589 (UINT64) Descriptor->Address32.Granularity,
590 Descriptor->Address32.Flags,
591 MinOp, MaxOp, LengthOp, GranOp, Op);
593 Rnode->BufferLength = sizeof (AML_RESOURCE_ADDRESS32) +
594 OptionIndex + StringLength;
599 /*******************************************************************************
601 * FUNCTION: RsDoDwordSpaceDescriptor
603 * PARAMETERS: Op - Parent resource descriptor parse node
604 * CurrentByteOffset - Offset into the resource template AML
605 * buffer (to track references to the desc)
607 * RETURN: Completed resource node
609 * DESCRIPTION: Construct a long "DwordSpace" descriptor
611 ******************************************************************************/
614 RsDoDwordSpaceDescriptor (
615 ACPI_PARSE_OBJECT *Op,
616 UINT32 CurrentByteOffset)
618 AML_RESOURCE *Descriptor;
619 ACPI_PARSE_OBJECT *InitializerOp;
620 ACPI_PARSE_OBJECT *MinOp = NULL;
621 ACPI_PARSE_OBJECT *MaxOp = NULL;
622 ACPI_PARSE_OBJECT *LengthOp = NULL;
623 ACPI_PARSE_OBJECT *GranOp = NULL;
624 ASL_RESOURCE_NODE *Rnode;
625 UINT8 *OptionalFields;
626 UINT16 StringLength = 0;
627 UINT32 OptionIndex = 0;
629 BOOLEAN ResSourceIndex = FALSE;
632 InitializerOp = Op->Asl.Child;
633 StringLength = RsGetStringDataLength (InitializerOp);
635 Rnode = RsAllocateResourceNode (
636 sizeof (AML_RESOURCE_ADDRESS32) + 1 + StringLength);
638 Descriptor = Rnode->Buffer;
639 Descriptor->Address32.DescriptorType = ACPI_RESOURCE_NAME_ADDRESS32;
642 * Initial descriptor length -- may be enlarged if there are
643 * optional fields present
645 OptionalFields = ((UINT8 *) Descriptor) + sizeof (AML_RESOURCE_ADDRESS32);
646 Descriptor->Address32.ResourceLength = (UINT16)
647 (sizeof (AML_RESOURCE_ADDRESS32) -
648 sizeof (AML_RESOURCE_LARGE_HEADER));
650 /* Process all child initialization nodes */
652 for (i = 0; InitializerOp; i++)
656 case 0: /* Resource Type */
658 Descriptor->Address32.ResourceType =
659 (UINT8) InitializerOp->Asl.Value.Integer;
662 case 1: /* Resource Usage */
664 RsSetFlagBits (&Descriptor->Address32.Flags, InitializerOp, 0, 1);
667 case 2: /* DecodeType */
669 RsSetFlagBits (&Descriptor->Address32.Flags, InitializerOp, 1, 0);
670 RsCreateBitField (InitializerOp, ACPI_RESTAG_DECODE,
671 CurrentByteOffset + ASL_RESDESC_OFFSET (Address32.Flags), 1);
674 case 3: /* MinType */
676 RsSetFlagBits (&Descriptor->Address32.Flags, InitializerOp, 2, 0);
677 RsCreateBitField (InitializerOp, ACPI_RESTAG_MINTYPE,
678 CurrentByteOffset + ASL_RESDESC_OFFSET (Address32.Flags), 2);
681 case 4: /* MaxType */
683 RsSetFlagBits (&Descriptor->Address32.Flags, InitializerOp, 3, 0);
684 RsCreateBitField (InitializerOp, ACPI_RESTAG_MAXTYPE,
685 CurrentByteOffset + ASL_RESDESC_OFFSET (Address32.Flags), 3);
688 case 5: /* Type-Specific flags */
690 Descriptor->Address32.SpecificFlags =
691 (UINT8) InitializerOp->Asl.Value.Integer;
694 case 6: /* Address Granularity */
696 Descriptor->Address32.Granularity =
697 (UINT32) InitializerOp->Asl.Value.Integer;
698 RsCreateByteField (InitializerOp, ACPI_RESTAG_GRANULARITY,
699 CurrentByteOffset + ASL_RESDESC_OFFSET (Address32.Granularity));
700 GranOp = InitializerOp;
703 case 7: /* Min Address */
705 Descriptor->Address32.Minimum =
706 (UINT32) InitializerOp->Asl.Value.Integer;
707 RsCreateByteField (InitializerOp, ACPI_RESTAG_MINADDR,
708 CurrentByteOffset + ASL_RESDESC_OFFSET (Address32.Minimum));
709 MinOp = InitializerOp;
712 case 8: /* Max Address */
714 Descriptor->Address32.Maximum =
715 (UINT32) InitializerOp->Asl.Value.Integer;
716 RsCreateByteField (InitializerOp, ACPI_RESTAG_MAXADDR,
717 CurrentByteOffset + ASL_RESDESC_OFFSET (Address32.Maximum));
718 MaxOp = InitializerOp;
721 case 9: /* Translation Offset */
723 Descriptor->Address32.TranslationOffset =
724 (UINT32) InitializerOp->Asl.Value.Integer;
725 RsCreateByteField (InitializerOp, ACPI_RESTAG_TRANSLATION,
726 CurrentByteOffset + ASL_RESDESC_OFFSET (Address32.TranslationOffset));
729 case 10: /* Address Length */
731 Descriptor->Address32.AddressLength =
732 (UINT32) InitializerOp->Asl.Value.Integer;
733 RsCreateByteField (InitializerOp, ACPI_RESTAG_LENGTH,
734 CurrentByteOffset + ASL_RESDESC_OFFSET (Address32.AddressLength));
735 LengthOp = InitializerOp;
738 case 11: /* ResSourceIndex [Optional Field - BYTE] */
740 if (InitializerOp->Asl.ParseOpcode != PARSEOP_DEFAULT_ARG)
742 OptionalFields[0] = (UINT8) InitializerOp->Asl.Value.Integer;
744 Descriptor->Address32.ResourceLength++;
745 ResSourceIndex = TRUE;
749 case 12: /* ResSource [Optional Field - STRING] */
751 if ((InitializerOp->Asl.ParseOpcode != PARSEOP_DEFAULT_ARG) &&
752 (InitializerOp->Asl.Value.String))
756 Descriptor->Address32.ResourceLength = (UINT16)
757 (Descriptor->Address32.ResourceLength + StringLength);
760 &OptionalFields[OptionIndex],
761 InitializerOp->Asl.Value.String);
763 /* ResourceSourceIndex must also be valid */
767 AslError (ASL_ERROR, ASL_MSG_RESOURCE_INDEX,
768 InitializerOp, NULL);
775 * Not a valid ResourceSource, ResourceSourceIndex must also
778 else if (ResSourceIndex)
780 AslError (ASL_ERROR, ASL_MSG_RESOURCE_SOURCE,
781 InitializerOp, NULL);
786 case 13: /* ResourceTag */
788 UtAttachNamepathToOwner (Op, InitializerOp);
793 AslError (ASL_ERROR, ASL_MSG_RESOURCE_LIST,
794 InitializerOp, NULL);
798 InitializerOp = RsCompleteNodeAndGetNext (InitializerOp);
801 /* Validate the Min/Max/Len/Gran values */
803 RsLargeAddressCheck (
804 (UINT64) Descriptor->Address32.Minimum,
805 (UINT64) Descriptor->Address32.Maximum,
806 (UINT64) Descriptor->Address32.AddressLength,
807 (UINT64) Descriptor->Address32.Granularity,
808 Descriptor->Address32.Flags,
809 MinOp, MaxOp, LengthOp, GranOp, Op);
811 Rnode->BufferLength = sizeof (AML_RESOURCE_ADDRESS32) +
812 OptionIndex + StringLength;