2 /******************************************************************************
4 * Module Name: aslrestype2 - Long (type2) resource templates and descriptors
7 *****************************************************************************/
9 /******************************************************************************
13 * Some or all of this work - Copyright (c) 1999 - 2005, Intel Corp.
14 * All rights reserved.
18 * 2.1. This is your license from Intel Corp. under its intellectual property
19 * rights. You may have additional license terms from the party that provided
20 * you this software, covering your right to use that party's intellectual
23 * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
24 * copy of the source code appearing in this file ("Covered Code") an
25 * irrevocable, perpetual, worldwide license under Intel's copyrights in the
26 * base code distributed originally by Intel ("Original Intel Code") to copy,
27 * make derivatives, distribute, use and display any portion of the Covered
28 * Code in any form, with the right to sublicense such rights; and
30 * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
31 * license (with the right to sublicense), under only those claims of Intel
32 * patents that are infringed by the Original Intel Code, to make, use, sell,
33 * offer to sell, and import the Covered Code and derivative works thereof
34 * solely to the minimum extent necessary to exercise the above copyright
35 * license, and in no event shall the patent license extend to any additions
36 * to or modifications of the Original Intel Code. No other license or right
37 * is granted directly or by implication, estoppel or otherwise;
39 * The above copyright and patent license is granted only if the following
44 * 3.1. Redistribution of Source with Rights to Further Distribute Source.
45 * Redistribution of source code of any substantial portion of the Covered
46 * Code or modification with rights to further distribute source must include
47 * the above Copyright Notice, the above License, this list of Conditions,
48 * and the following Disclaimer and Export Compliance provision. In addition,
49 * Licensee must cause all Covered Code to which Licensee contributes to
50 * contain a file documenting the changes Licensee made to create that Covered
51 * Code and the date of any change. Licensee must include in that file the
52 * documentation of any changes made by any predecessor Licensee. Licensee
53 * must include a prominent statement that the modification is derived,
54 * directly or indirectly, from Original Intel Code.
56 * 3.2. Redistribution of Source with no Rights to Further Distribute Source.
57 * Redistribution of source code of any substantial portion of the Covered
58 * Code or modification without rights to further distribute source must
59 * include the following Disclaimer and Export Compliance provision in the
60 * documentation and/or other materials provided with distribution. In
61 * addition, Licensee may not authorize further sublicense of source of any
62 * portion of the Covered Code, and must include terms to the effect that the
63 * license from Licensee to its licensee is limited to the intellectual
64 * property embodied in the software Licensee provides to its licensee, and
65 * not to intellectual property embodied in modifications its licensee may
68 * 3.3. Redistribution of Executable. Redistribution in executable form of any
69 * substantial portion of the Covered Code or modification must reproduce the
70 * above Copyright Notice, and the following Disclaimer and Export Compliance
71 * provision in the documentation and/or other materials provided with the
74 * 3.4. Intel retains all right, title, and interest in and to the Original
77 * 3.5. Neither the name Intel nor any other trademark owned or controlled by
78 * Intel shall be used in advertising or otherwise to promote the sale, use or
79 * other dealings in products derived from or relating to the Covered Code
80 * without prior written authorization from Intel.
82 * 4. Disclaimer and Export Compliance
84 * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
85 * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
86 * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
87 * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
88 * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
89 * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
92 * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
93 * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
94 * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
95 * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
96 * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
97 * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
98 * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
101 * 4.3. Licensee shall not export, either directly or indirectly, any of this
102 * software or system incorporating such software without first obtaining any
103 * required license or other approval from the U. S. Department of Commerce or
104 * any other agency or department of the United States Government. In the
105 * event Licensee exports any such software from the United States or
106 * re-exports any such software from a foreign destination, Licensee shall
107 * ensure that the distribution and export/re-export of the software is in
108 * compliance with all laws, regulations, orders, or other restrictions of the
109 * U.S. Export Administration Regulations. Licensee agrees that neither it nor
110 * any of its subsidiaries will export/re-export any technical data, process,
111 * software, or service, directly or indirectly, to any country for which the
112 * United States government or any agency thereof requires an export license,
113 * other governmental approval, or letter of assurance, without first obtaining
114 * such license, approval or letter.
116 *****************************************************************************/
119 #include <contrib/dev/acpica/compiler/aslcompiler.h>
120 #include "aslcompiler.y.h"
122 #define _COMPONENT ACPI_COMPILER
123 ACPI_MODULE_NAME ("aslrestype2")
125 /* Local prototypes */
128 RsGetStringDataLength (
129 ACPI_PARSE_OBJECT *InitializerOp);
132 /*******************************************************************************
134 * FUNCTION: RsGetStringDataLength
136 * PARAMETERS: InitializerOp - Start of a subtree of init nodes
138 * RETURN: Valid string length if a string node is found (otherwise 0)
140 * DESCRIPTION: In a list of peer nodes, find the first one that contains a
141 * string and return the length of the string.
143 ******************************************************************************/
146 RsGetStringDataLength (
147 ACPI_PARSE_OBJECT *InitializerOp)
150 while (InitializerOp)
152 if (InitializerOp->Asl.ParseOpcode == PARSEOP_STRING_LITERAL)
154 return ((UINT16) (strlen (InitializerOp->Asl.Value.String) + 1));
156 InitializerOp = ASL_GET_PEER_NODE (InitializerOp);
163 /*******************************************************************************
165 * FUNCTION: RsDoDwordIoDescriptor
167 * PARAMETERS: Op - Parent resource descriptor parse node
168 * CurrentByteOffset - Offset into the resource template AML
169 * buffer (to track references to the desc)
171 * RETURN: Completed resource node
173 * DESCRIPTION: Construct a long "DwordIO" descriptor
175 ******************************************************************************/
178 RsDoDwordIoDescriptor (
179 ACPI_PARSE_OBJECT *Op,
180 UINT32 CurrentByteOffset)
182 AML_RESOURCE *Descriptor;
183 ACPI_PARSE_OBJECT *InitializerOp;
184 ASL_RESOURCE_NODE *Rnode;
185 UINT16 StringLength = 0;
186 UINT32 OptionIndex = 0;
187 UINT8 *OptionalFields;
189 BOOLEAN ResSourceIndex = FALSE;
192 InitializerOp = Op->Asl.Child;
193 StringLength = RsGetStringDataLength (InitializerOp);
195 Rnode = RsAllocateResourceNode (
196 sizeof (AML_RESOURCE_ADDRESS32) + 1 + StringLength);
198 Descriptor = Rnode->Buffer;
199 Descriptor->Address32.DescriptorType = ACPI_RESOURCE_NAME_ADDRESS32;
200 Descriptor->Address32.ResourceType = ACPI_ADDRESS_TYPE_IO_RANGE;
203 * Initial descriptor length -- may be enlarged if there are
204 * optional fields present
206 OptionalFields = ((UINT8 *) Descriptor) + sizeof (AML_RESOURCE_ADDRESS32);
207 Descriptor->Address32.ResourceLength = (UINT16)
208 (sizeof (AML_RESOURCE_ADDRESS32) -
209 sizeof (AML_RESOURCE_LARGE_HEADER));
211 /* Process all child initialization nodes */
213 for (i = 0; InitializerOp; i++)
217 case 0: /* Resource Usage */
219 RsSetFlagBits (&Descriptor->Address32.Flags, InitializerOp, 0, 1);
222 case 1: /* MinType */
224 RsSetFlagBits (&Descriptor->Address32.Flags, InitializerOp, 2, 0);
225 RsCreateBitField (InitializerOp, ASL_RESNAME_MINTYPE,
226 CurrentByteOffset + ASL_RESDESC_OFFSET (Address32.Flags), 2);
229 case 2: /* MaxType */
231 RsSetFlagBits (&Descriptor->Address32.Flags, InitializerOp, 3, 0);
232 RsCreateBitField (InitializerOp, ASL_RESNAME_MAXTYPE,
233 CurrentByteOffset + ASL_RESDESC_OFFSET (Address32.Flags), 3);
236 case 3: /* DecodeType */
238 RsSetFlagBits (&Descriptor->Address32.Flags, InitializerOp, 1, 0);
239 RsCreateBitField (InitializerOp, ASL_RESNAME_DECODE,
240 CurrentByteOffset + ASL_RESDESC_OFFSET (Address32.Flags), 1);
243 case 4: /* Range Type */
245 RsSetFlagBits (&Descriptor->Address32.SpecificFlags, InitializerOp, 0, 3);
246 RsCreateBitField (InitializerOp, ASL_RESNAME_RANGETYPE,
247 CurrentByteOffset + ASL_RESDESC_OFFSET (Address32.SpecificFlags), 0);
250 case 5: /* Address Granularity */
252 Descriptor->Address32.Granularity =
253 (UINT32) InitializerOp->Asl.Value.Integer;
254 RsCreateByteField (InitializerOp, ASL_RESNAME_GRANULARITY,
255 CurrentByteOffset + ASL_RESDESC_OFFSET (Address32.Granularity));
258 case 6: /* Address Min */
260 Descriptor->Address32.Minimum =
261 (UINT32) InitializerOp->Asl.Value.Integer;
262 RsCreateByteField (InitializerOp, ASL_RESNAME_MINADDR,
263 CurrentByteOffset + ASL_RESDESC_OFFSET (Address32.Minimum));
266 case 7: /* Address Max */
268 Descriptor->Address32.Maximum =
269 (UINT32) InitializerOp->Asl.Value.Integer;
270 RsCreateByteField (InitializerOp, ASL_RESNAME_MAXADDR,
271 CurrentByteOffset + ASL_RESDESC_OFFSET (Address32.Maximum));
274 case 8: /* Translation Offset */
276 Descriptor->Address32.TranslationOffset =
277 (UINT32) InitializerOp->Asl.Value.Integer;
278 RsCreateByteField (InitializerOp, ASL_RESNAME_TRANSLATION,
279 CurrentByteOffset + ASL_RESDESC_OFFSET (Address32.TranslationOffset));
282 case 9: /* Address Length */
284 Descriptor->Address32.AddressLength =
285 (UINT32) InitializerOp->Asl.Value.Integer;
286 RsCreateByteField (InitializerOp, ASL_RESNAME_LENGTH,
287 CurrentByteOffset + ASL_RESDESC_OFFSET (Address32.AddressLength));
290 case 10: /* ResSourceIndex [Optional Field - BYTE] */
292 if (InitializerOp->Asl.ParseOpcode != PARSEOP_DEFAULT_ARG)
294 /* Found a valid ResourceSourceIndex */
296 OptionalFields[0] = (UINT8) InitializerOp->Asl.Value.Integer;
298 Descriptor->Address32.ResourceLength++;
299 ResSourceIndex = TRUE;
303 case 11: /* ResSource [Optional Field - STRING] */
305 if ((InitializerOp->Asl.ParseOpcode != PARSEOP_DEFAULT_ARG) &&
306 (InitializerOp->Asl.Value.String))
310 /* Found a valid ResourceSource */
312 Descriptor->Address32.ResourceLength = (UINT16)
313 (Descriptor->Address32.ResourceLength + StringLength);
316 &OptionalFields[OptionIndex],
317 InitializerOp->Asl.Value.String);
319 /* ResourceSourceIndex must also be valid */
323 AslError (ASL_ERROR, ASL_MSG_RESOURCE_INDEX,
324 InitializerOp, NULL);
331 * Not a valid ResourceSource, ResourceSourceIndex must also
334 else if (ResSourceIndex)
336 AslError (ASL_ERROR, ASL_MSG_RESOURCE_SOURCE,
337 InitializerOp, NULL);
342 case 12: /* ResourceTag */
344 UtAttachNamepathToOwner (Op, InitializerOp);
349 RsSetFlagBits (&Descriptor->Address32.SpecificFlags, InitializerOp, 4, 0);
350 RsCreateBitField (InitializerOp, ASL_RESNAME_TYPE,
351 CurrentByteOffset + ASL_RESDESC_OFFSET (Address32.SpecificFlags), 4);
354 case 14: /* Translation Type */
356 RsSetFlagBits (&Descriptor->Address32.SpecificFlags, InitializerOp, 5, 0);
357 RsCreateBitField (InitializerOp, ASL_RESNAME_TRANSTYPE,
358 CurrentByteOffset + ASL_RESDESC_OFFSET (Address32.SpecificFlags), 5);
363 AslError (ASL_ERROR, ASL_MSG_RESOURCE_LIST, InitializerOp, NULL);
367 InitializerOp = RsCompleteNodeAndGetNext (InitializerOp);
370 Rnode->BufferLength = sizeof (AML_RESOURCE_ADDRESS32) +
371 OptionIndex + StringLength;
376 /*******************************************************************************
378 * FUNCTION: RsDoDwordMemoryDescriptor
380 * PARAMETERS: Op - Parent resource descriptor parse node
381 * CurrentByteOffset - Offset into the resource template AML
382 * buffer (to track references to the desc)
384 * RETURN: Completed resource node
386 * DESCRIPTION: Construct a long "DwordMemory" descriptor
388 ******************************************************************************/
391 RsDoDwordMemoryDescriptor (
392 ACPI_PARSE_OBJECT *Op,
393 UINT32 CurrentByteOffset)
395 AML_RESOURCE *Descriptor;
396 ACPI_PARSE_OBJECT *InitializerOp;
397 ASL_RESOURCE_NODE *Rnode;
398 UINT8 *OptionalFields;
399 UINT16 StringLength = 0;
400 UINT32 OptionIndex = 0;
402 BOOLEAN ResSourceIndex = FALSE;
405 InitializerOp = Op->Asl.Child;
406 StringLength = RsGetStringDataLength (InitializerOp);
408 Rnode = RsAllocateResourceNode (
409 sizeof (AML_RESOURCE_ADDRESS32) + 1 + StringLength);
411 Descriptor = Rnode->Buffer;
412 Descriptor->Address32.DescriptorType = ACPI_RESOURCE_NAME_ADDRESS32;
413 Descriptor->Address32.ResourceType = ACPI_ADDRESS_TYPE_MEMORY_RANGE;
416 * Initial descriptor length -- may be enlarged if there are
417 * optional fields present
419 OptionalFields = ((UINT8 *) Descriptor) + sizeof (AML_RESOURCE_ADDRESS32);
420 Descriptor->Address32.ResourceLength = (UINT16)
421 (sizeof (AML_RESOURCE_ADDRESS32) -
422 sizeof (AML_RESOURCE_LARGE_HEADER));
425 /* Process all child initialization nodes */
427 for (i = 0; InitializerOp; i++)
431 case 0: /* Resource Usage */
433 RsSetFlagBits (&Descriptor->Address32.Flags, InitializerOp, 0, 1);
436 case 1: /* DecodeType */
438 RsSetFlagBits (&Descriptor->Address32.Flags, InitializerOp, 1, 0);
439 RsCreateBitField (InitializerOp, ASL_RESNAME_DECODE,
440 CurrentByteOffset + ASL_RESDESC_OFFSET (Address32.Flags), 1);
443 case 2: /* MinType */
445 RsSetFlagBits (&Descriptor->Address32.Flags, InitializerOp, 2, 0);
446 RsCreateBitField (InitializerOp, ASL_RESNAME_MINTYPE,
447 CurrentByteOffset + ASL_RESDESC_OFFSET (Address32.Flags), 2);
450 case 3: /* MaxType */
452 RsSetFlagBits (&Descriptor->Address32.Flags, InitializerOp, 3, 0);
453 RsCreateBitField (InitializerOp, ASL_RESNAME_MAXTYPE,
454 CurrentByteOffset + ASL_RESDESC_OFFSET (Address32.Flags), 3);
457 case 4: /* Memory Type */
459 RsSetFlagBits (&Descriptor->Address32.SpecificFlags, InitializerOp, 1, 0);
460 RsCreateBitField (InitializerOp, ASL_RESNAME_MEMTYPE,
461 CurrentByteOffset + ASL_RESDESC_OFFSET (Address32.SpecificFlags), 1);
464 case 5: /* Read/Write Type */
466 RsSetFlagBits (&Descriptor->Address32.SpecificFlags, InitializerOp, 0, 1);
467 RsCreateBitField (InitializerOp, ASL_RESNAME_READWRITETYPE,
468 CurrentByteOffset + ASL_RESDESC_OFFSET (Address32.SpecificFlags), 0);
471 case 6: /* Address Granularity */
473 Descriptor->Address32.Granularity =
474 (UINT32) InitializerOp->Asl.Value.Integer;
475 RsCreateByteField (InitializerOp, ASL_RESNAME_GRANULARITY,
476 CurrentByteOffset + ASL_RESDESC_OFFSET (Address32.Granularity));
479 case 7: /* Min Address */
481 Descriptor->Address32.Minimum =
482 (UINT32) InitializerOp->Asl.Value.Integer;
483 RsCreateByteField (InitializerOp, ASL_RESNAME_MINADDR,
484 CurrentByteOffset + ASL_RESDESC_OFFSET (Address32.Minimum));
487 case 8: /* Max Address */
489 Descriptor->Address32.Maximum =
490 (UINT32) InitializerOp->Asl.Value.Integer;
491 RsCreateByteField (InitializerOp, ASL_RESNAME_MAXADDR,
492 CurrentByteOffset + ASL_RESDESC_OFFSET (Address32.Maximum));
495 case 9: /* Translation Offset */
497 Descriptor->Address32.TranslationOffset =
498 (UINT32) InitializerOp->Asl.Value.Integer;
499 RsCreateByteField (InitializerOp, ASL_RESNAME_TRANSLATION,
500 CurrentByteOffset + ASL_RESDESC_OFFSET (Address32.TranslationOffset));
503 case 10: /* Address Length */
505 Descriptor->Address32.AddressLength =
506 (UINT32) InitializerOp->Asl.Value.Integer;
507 RsCreateByteField (InitializerOp, ASL_RESNAME_LENGTH,
508 CurrentByteOffset + ASL_RESDESC_OFFSET (Address32.AddressLength));
511 case 11: /* ResSourceIndex [Optional Field - BYTE] */
513 if (InitializerOp->Asl.ParseOpcode != PARSEOP_DEFAULT_ARG)
515 OptionalFields[0] = (UINT8) InitializerOp->Asl.Value.Integer;
517 Descriptor->Address32.ResourceLength++;
518 ResSourceIndex = TRUE;
522 case 12: /* ResSource [Optional Field - STRING] */
524 if ((InitializerOp->Asl.ParseOpcode != PARSEOP_DEFAULT_ARG) &&
525 (InitializerOp->Asl.Value.String))
529 Descriptor->Address32.ResourceLength = (UINT16)
530 (Descriptor->Address32.ResourceLength + StringLength);
533 &OptionalFields[OptionIndex],
534 InitializerOp->Asl.Value.String);
536 /* ResourceSourceIndex must also be valid */
540 AslError (ASL_ERROR, ASL_MSG_RESOURCE_INDEX,
541 InitializerOp, NULL);
548 * Not a valid ResourceSource, ResourceSourceIndex must also
551 else if (ResSourceIndex)
553 AslError (ASL_ERROR, ASL_MSG_RESOURCE_SOURCE,
554 InitializerOp, NULL);
559 case 13: /* ResourceTag */
561 UtAttachNamepathToOwner (Op, InitializerOp);
565 case 14: /* Address Range */
567 RsSetFlagBits (&Descriptor->Address32.SpecificFlags, InitializerOp, 3, 0);
568 RsCreateBitField (InitializerOp, ASL_RESNAME_MEMATTRIBUTES,
569 CurrentByteOffset + ASL_RESDESC_OFFSET (Address32.SpecificFlags), 3);
574 RsSetFlagBits (&Descriptor->Address32.SpecificFlags, InitializerOp, 5, 0);
575 RsCreateBitField (InitializerOp, ASL_RESNAME_TYPE,
576 CurrentByteOffset + ASL_RESDESC_OFFSET (Address32.SpecificFlags), 5);
581 AslError (ASL_ERROR, ASL_MSG_RESOURCE_LIST, InitializerOp, NULL);
585 InitializerOp = RsCompleteNodeAndGetNext (InitializerOp);
588 Rnode->BufferLength = sizeof (AML_RESOURCE_ADDRESS32) +
589 OptionIndex + StringLength;
594 /*******************************************************************************
596 * FUNCTION: RsDoDwordSpaceDescriptor
598 * PARAMETERS: Op - Parent resource descriptor parse node
599 * CurrentByteOffset - Offset into the resource template AML
600 * buffer (to track references to the desc)
602 * RETURN: Completed resource node
604 * DESCRIPTION: Construct a long "DwordSpace" descriptor
606 ******************************************************************************/
609 RsDoDwordSpaceDescriptor (
610 ACPI_PARSE_OBJECT *Op,
611 UINT32 CurrentByteOffset)
613 AML_RESOURCE *Descriptor;
614 ACPI_PARSE_OBJECT *InitializerOp;
615 ASL_RESOURCE_NODE *Rnode;
616 UINT8 *OptionalFields;
617 UINT16 StringLength = 0;
618 UINT32 OptionIndex = 0;
620 BOOLEAN ResSourceIndex = FALSE;
623 InitializerOp = Op->Asl.Child;
624 StringLength = RsGetStringDataLength (InitializerOp);
626 Rnode = RsAllocateResourceNode (
627 sizeof (AML_RESOURCE_ADDRESS32) + 1 + StringLength);
629 Descriptor = Rnode->Buffer;
630 Descriptor->Address32.DescriptorType = ACPI_RESOURCE_NAME_ADDRESS32;
633 * Initial descriptor length -- may be enlarged if there are
634 * optional fields present
636 OptionalFields = ((UINT8 *) Descriptor) + sizeof (AML_RESOURCE_ADDRESS32);
637 Descriptor->Address32.ResourceLength = (UINT16)
638 (sizeof (AML_RESOURCE_ADDRESS32) -
639 sizeof (AML_RESOURCE_LARGE_HEADER));
641 /* Process all child initialization nodes */
643 for (i = 0; InitializerOp; i++)
647 case 0: /* Resource Type */
649 Descriptor->Address32.ResourceType =
650 (UINT8) InitializerOp->Asl.Value.Integer;
653 case 1: /* Resource Usage */
655 RsSetFlagBits (&Descriptor->Address32.Flags, InitializerOp, 0, 1);
658 case 2: /* DecodeType */
660 RsSetFlagBits (&Descriptor->Address32.Flags, InitializerOp, 1, 0);
661 RsCreateBitField (InitializerOp, ASL_RESNAME_DECODE,
662 CurrentByteOffset + ASL_RESDESC_OFFSET (Address32.Flags), 1);
665 case 3: /* MinType */
667 RsSetFlagBits (&Descriptor->Address32.Flags, InitializerOp, 2, 0);
668 RsCreateBitField (InitializerOp, ASL_RESNAME_MINTYPE,
669 CurrentByteOffset + ASL_RESDESC_OFFSET (Address32.Flags), 2);
672 case 4: /* MaxType */
674 RsSetFlagBits (&Descriptor->Address32.Flags, InitializerOp, 3, 0);
675 RsCreateBitField (InitializerOp, ASL_RESNAME_MAXTYPE,
676 CurrentByteOffset + ASL_RESDESC_OFFSET (Address32.Flags), 3);
679 case 5: /* Type-Specific flags */
681 Descriptor->Address32.SpecificFlags =
682 (UINT8) InitializerOp->Asl.Value.Integer;
685 case 6: /* Address Granularity */
687 Descriptor->Address32.Granularity =
688 (UINT32) InitializerOp->Asl.Value.Integer;
689 RsCreateByteField (InitializerOp, ASL_RESNAME_GRANULARITY,
690 CurrentByteOffset + ASL_RESDESC_OFFSET (Address32.Granularity));
693 case 7: /* Min Address */
695 Descriptor->Address32.Minimum =
696 (UINT32) InitializerOp->Asl.Value.Integer;
697 RsCreateByteField (InitializerOp, ASL_RESNAME_MINADDR,
698 CurrentByteOffset + ASL_RESDESC_OFFSET (Address32.Minimum));
701 case 8: /* Max Address */
703 Descriptor->Address32.Maximum =
704 (UINT32) InitializerOp->Asl.Value.Integer;
705 RsCreateByteField (InitializerOp, ASL_RESNAME_MAXADDR,
706 CurrentByteOffset + ASL_RESDESC_OFFSET (Address32.Maximum));
709 case 9: /* Translation Offset */
711 Descriptor->Address32.TranslationOffset =
712 (UINT32) InitializerOp->Asl.Value.Integer;
713 RsCreateByteField (InitializerOp, ASL_RESNAME_TRANSLATION,
714 CurrentByteOffset + ASL_RESDESC_OFFSET (Address32.TranslationOffset));
717 case 10: /* Address Length */
719 Descriptor->Address32.AddressLength =
720 (UINT32) InitializerOp->Asl.Value.Integer;
721 RsCreateByteField (InitializerOp, ASL_RESNAME_LENGTH,
722 CurrentByteOffset + ASL_RESDESC_OFFSET (Address32.AddressLength));
725 case 11: /* ResSourceIndex [Optional Field - BYTE] */
727 if (InitializerOp->Asl.ParseOpcode != PARSEOP_DEFAULT_ARG)
729 OptionalFields[0] = (UINT8) InitializerOp->Asl.Value.Integer;
731 Descriptor->Address32.ResourceLength++;
732 ResSourceIndex = TRUE;
736 case 12: /* ResSource [Optional Field - STRING] */
738 if ((InitializerOp->Asl.ParseOpcode != PARSEOP_DEFAULT_ARG) &&
739 (InitializerOp->Asl.Value.String))
743 Descriptor->Address32.ResourceLength = (UINT16)
744 (Descriptor->Address32.ResourceLength + StringLength);
747 &OptionalFields[OptionIndex],
748 InitializerOp->Asl.Value.String);
750 /* ResourceSourceIndex must also be valid */
754 AslError (ASL_ERROR, ASL_MSG_RESOURCE_INDEX,
755 InitializerOp, NULL);
762 * Not a valid ResourceSource, ResourceSourceIndex must also
765 else if (ResSourceIndex)
767 AslError (ASL_ERROR, ASL_MSG_RESOURCE_SOURCE,
768 InitializerOp, NULL);
773 case 13: /* ResourceTag */
775 UtAttachNamepathToOwner (Op, InitializerOp);
780 AslError (ASL_ERROR, ASL_MSG_RESOURCE_LIST,
781 InitializerOp, NULL);
785 InitializerOp = RsCompleteNodeAndGetNext (InitializerOp);
788 Rnode->BufferLength = sizeof (AML_RESOURCE_ADDRESS32) +
789 OptionIndex + StringLength;
794 /*******************************************************************************
796 * FUNCTION: RsDoExtendedIoDescriptor
798 * PARAMETERS: Op - Parent resource descriptor parse node
799 * CurrentByteOffset - Offset into the resource template AML
800 * buffer (to track references to the desc)
802 * RETURN: Completed resource node
804 * DESCRIPTION: Construct a long "ExtendedIO" descriptor
806 ******************************************************************************/
809 RsDoExtendedIoDescriptor (
810 ACPI_PARSE_OBJECT *Op,
811 UINT32 CurrentByteOffset)
813 AML_RESOURCE *Descriptor;
814 ACPI_PARSE_OBJECT *InitializerOp;
815 ASL_RESOURCE_NODE *Rnode;
816 UINT16 StringLength = 0;
817 // UINT32 OptionIndex = 0;
821 InitializerOp = Op->Asl.Child;
822 StringLength = RsGetStringDataLength (InitializerOp);
824 Rnode = RsAllocateResourceNode (
825 sizeof (AML_RESOURCE_EXTENDED_ADDRESS64) + 1 + StringLength);
827 Descriptor = Rnode->Buffer;
828 Descriptor->ExtAddress64.DescriptorType = ACPI_RESOURCE_NAME_EXTENDED_ADDRESS64;
829 Descriptor->ExtAddress64.ResourceType = ACPI_ADDRESS_TYPE_IO_RANGE;
830 Descriptor->ExtAddress64.RevisionID = AML_RESOURCE_EXTENDED_ADDRESS_REVISION;
832 Descriptor->ExtAddress64.ResourceLength = (UINT16)
833 (sizeof (AML_RESOURCE_EXTENDED_ADDRESS64) -
834 sizeof (AML_RESOURCE_LARGE_HEADER));
836 /* Process all child initialization nodes */
838 for (i = 0; InitializerOp; i++)
842 case 0: /* Resource Usage */
844 RsSetFlagBits (&Descriptor->ExtAddress64.Flags, InitializerOp, 0, 1);
847 case 1: /* MinType */
849 RsSetFlagBits (&Descriptor->ExtAddress64.Flags, InitializerOp, 2, 0);
850 RsCreateBitField (InitializerOp, ASL_RESNAME_MINTYPE,
851 CurrentByteOffset + ASL_RESDESC_OFFSET (ExtAddress64.Flags), 2);
854 case 2: /* MaxType */
856 RsSetFlagBits (&Descriptor->ExtAddress64.Flags, InitializerOp, 3, 0);
857 RsCreateBitField (InitializerOp, ASL_RESNAME_MAXTYPE,
858 CurrentByteOffset + ASL_RESDESC_OFFSET (ExtAddress64.Flags), 3);
861 case 3: /* DecodeType */
863 RsSetFlagBits (&Descriptor->ExtAddress64.Flags, InitializerOp, 1, 0);
864 RsCreateBitField (InitializerOp, ASL_RESNAME_DECODE,
865 CurrentByteOffset + ASL_RESDESC_OFFSET (ExtAddress64.Flags), 1);
868 case 4: /* Range Type */
870 RsSetFlagBits (&Descriptor->ExtAddress64.SpecificFlags, InitializerOp, 0, 3);
871 RsCreateBitField (InitializerOp, ASL_RESNAME_RANGETYPE,
872 CurrentByteOffset + ASL_RESDESC_OFFSET (ExtAddress64.SpecificFlags), 0);
875 case 5: /* Address Granularity */
877 Descriptor->ExtAddress64.Granularity = InitializerOp->Asl.Value.Integer;
878 RsCreateByteField (InitializerOp, ASL_RESNAME_GRANULARITY,
879 CurrentByteOffset + ASL_RESDESC_OFFSET (ExtAddress64.Granularity));
882 case 6: /* Address Min */
884 Descriptor->ExtAddress64.Minimum = InitializerOp->Asl.Value.Integer;
885 RsCreateByteField (InitializerOp, ASL_RESNAME_MINADDR,
886 CurrentByteOffset + ASL_RESDESC_OFFSET (ExtAddress64.Minimum));
889 case 7: /* Address Max */
891 Descriptor->ExtAddress64.Maximum = InitializerOp->Asl.Value.Integer;
892 RsCreateByteField (InitializerOp, ASL_RESNAME_MAXADDR,
893 CurrentByteOffset + ASL_RESDESC_OFFSET (ExtAddress64.Maximum));
896 case 8: /* Translation Offset */
898 Descriptor->ExtAddress64.TranslationOffset = InitializerOp->Asl.Value.Integer;
899 RsCreateByteField (InitializerOp, ASL_RESNAME_TRANSLATION,
900 CurrentByteOffset + ASL_RESDESC_OFFSET (ExtAddress64.TranslationOffset));
903 case 9: /* Address Length */
905 Descriptor->ExtAddress64.AddressLength = InitializerOp->Asl.Value.Integer;
906 RsCreateByteField (InitializerOp, ASL_RESNAME_LENGTH,
907 CurrentByteOffset + ASL_RESDESC_OFFSET (ExtAddress64.AddressLength));
910 case 10: /* Type-Specific Attributes */
912 Descriptor->ExtAddress64.TypeSpecific = InitializerOp->Asl.Value.Integer;
913 RsCreateByteField (InitializerOp, ASL_RESNAME_TYPESPECIFICATTRIBUTES,
914 CurrentByteOffset + ASL_RESDESC_OFFSET (ExtAddress64.TypeSpecific));
917 case 11: /* ResourceTag */
919 UtAttachNamepathToOwner (Op, InitializerOp);
924 RsSetFlagBits (&Descriptor->ExtAddress64.SpecificFlags, InitializerOp, 4, 0);
925 RsCreateBitField (InitializerOp, ASL_RESNAME_TYPE,
926 CurrentByteOffset + ASL_RESDESC_OFFSET (ExtAddress64.SpecificFlags), 4);
929 case 13: /* Translation Type */
931 RsSetFlagBits (&Descriptor->ExtAddress64.SpecificFlags, InitializerOp, 5, 0);
932 RsCreateBitField (InitializerOp, ASL_RESNAME_TRANSTYPE,
933 CurrentByteOffset + ASL_RESDESC_OFFSET (ExtAddress64.SpecificFlags), 5);
938 AslError (ASL_ERROR, ASL_MSG_RESOURCE_LIST, InitializerOp, NULL);
942 InitializerOp = RsCompleteNodeAndGetNext (InitializerOp);
945 Rnode->BufferLength = sizeof (AML_RESOURCE_EXTENDED_ADDRESS64) + StringLength;
950 /*******************************************************************************
952 * FUNCTION: RsDoExtendedMemoryDescriptor
954 * PARAMETERS: Op - Parent resource descriptor parse node
955 * CurrentByteOffset - Offset into the resource template AML
956 * buffer (to track references to the desc)
958 * RETURN: Completed resource node
960 * DESCRIPTION: Construct a long "ExtendedMemory" descriptor
962 ******************************************************************************/
965 RsDoExtendedMemoryDescriptor (
966 ACPI_PARSE_OBJECT *Op,
967 UINT32 CurrentByteOffset)
969 AML_RESOURCE *Descriptor;
970 ACPI_PARSE_OBJECT *InitializerOp;
971 ASL_RESOURCE_NODE *Rnode;
972 UINT16 StringLength = 0;
976 InitializerOp = Op->Asl.Child;
977 StringLength = RsGetStringDataLength (InitializerOp);
979 Rnode = RsAllocateResourceNode (
980 sizeof (AML_RESOURCE_EXTENDED_ADDRESS64) + 1 + StringLength);
982 Descriptor = Rnode->Buffer;
983 Descriptor->ExtAddress64.DescriptorType = ACPI_RESOURCE_NAME_EXTENDED_ADDRESS64;
984 Descriptor->ExtAddress64.ResourceType = ACPI_ADDRESS_TYPE_MEMORY_RANGE;
985 Descriptor->ExtAddress64.RevisionID = AML_RESOURCE_EXTENDED_ADDRESS_REVISION;
987 Descriptor->ExtAddress64.ResourceLength = (UINT16)
988 (sizeof (AML_RESOURCE_EXTENDED_ADDRESS64) -
989 sizeof (AML_RESOURCE_LARGE_HEADER));
991 /* Process all child initialization nodes */
993 for (i = 0; InitializerOp; i++)
997 case 0: /* Resource Usage */
999 RsSetFlagBits (&Descriptor->ExtAddress64.Flags, InitializerOp, 0, 1);
1002 case 1: /* DecodeType */
1004 RsSetFlagBits (&Descriptor->ExtAddress64.Flags, InitializerOp, 1, 0);
1005 RsCreateBitField (InitializerOp, ASL_RESNAME_DECODE,
1006 CurrentByteOffset + ASL_RESDESC_OFFSET (ExtAddress64.Flags), 1);
1009 case 2: /* MinType */
1011 RsSetFlagBits (&Descriptor->ExtAddress64.Flags, InitializerOp, 2, 0);
1012 RsCreateBitField (InitializerOp, ASL_RESNAME_MINTYPE,
1013 CurrentByteOffset + ASL_RESDESC_OFFSET (ExtAddress64.Flags), 2);
1016 case 3: /* MaxType */
1018 RsSetFlagBits (&Descriptor->ExtAddress64.Flags, InitializerOp, 3, 0);
1019 RsCreateBitField (InitializerOp, ASL_RESNAME_MAXTYPE,
1020 CurrentByteOffset + ASL_RESDESC_OFFSET (ExtAddress64.Flags), 3);
1023 case 4: /* Memory Type */
1025 RsSetFlagBits (&Descriptor->ExtAddress64.SpecificFlags, InitializerOp, 1, 0);
1026 RsCreateBitField (InitializerOp, ASL_RESNAME_MEMTYPE,
1027 CurrentByteOffset + ASL_RESDESC_OFFSET (ExtAddress64.SpecificFlags), 1);
1030 case 5: /* Read/Write Type */
1032 RsSetFlagBits (&Descriptor->ExtAddress64.SpecificFlags, InitializerOp, 0, 1);
1033 RsCreateBitField (InitializerOp, ASL_RESNAME_READWRITETYPE,
1034 CurrentByteOffset + ASL_RESDESC_OFFSET (ExtAddress64.SpecificFlags), 0);
1037 case 6: /* Address Granularity */
1039 Descriptor->ExtAddress64.Granularity = InitializerOp->Asl.Value.Integer;
1040 RsCreateByteField (InitializerOp, ASL_RESNAME_GRANULARITY,
1041 CurrentByteOffset + ASL_RESDESC_OFFSET (ExtAddress64.Granularity));
1044 case 7: /* Min Address */
1046 Descriptor->ExtAddress64.Minimum = InitializerOp->Asl.Value.Integer;
1047 RsCreateByteField (InitializerOp, ASL_RESNAME_MINADDR,
1048 CurrentByteOffset + ASL_RESDESC_OFFSET (ExtAddress64.Minimum));
1051 case 8: /* Max Address */
1053 Descriptor->ExtAddress64.Maximum = InitializerOp->Asl.Value.Integer;
1054 RsCreateByteField (InitializerOp, ASL_RESNAME_MAXADDR,
1055 CurrentByteOffset + ASL_RESDESC_OFFSET (ExtAddress64.Maximum));
1058 case 9: /* Translation Offset */
1060 Descriptor->ExtAddress64.TranslationOffset = InitializerOp->Asl.Value.Integer;
1061 RsCreateByteField (InitializerOp, ASL_RESNAME_TRANSLATION,
1062 CurrentByteOffset + ASL_RESDESC_OFFSET (ExtAddress64.TranslationOffset));
1065 case 10: /* Address Length */
1067 Descriptor->ExtAddress64.AddressLength = InitializerOp->Asl.Value.Integer;
1068 RsCreateByteField (InitializerOp, ASL_RESNAME_LENGTH,
1069 CurrentByteOffset + ASL_RESDESC_OFFSET (ExtAddress64.AddressLength));
1072 case 11: /* Type-Specific Attributes */
1074 Descriptor->ExtAddress64.TypeSpecific = InitializerOp->Asl.Value.Integer;
1075 RsCreateByteField (InitializerOp, ASL_RESNAME_TYPESPECIFICATTRIBUTES,
1076 CurrentByteOffset + ASL_RESDESC_OFFSET (ExtAddress64.TypeSpecific));
1079 case 12: /* ResourceTag */
1081 UtAttachNamepathToOwner (Op, InitializerOp);
1085 case 13: /* Address Range */
1087 RsSetFlagBits (&Descriptor->ExtAddress64.SpecificFlags, InitializerOp, 3, 0);
1088 RsCreateBitField (InitializerOp, ASL_RESNAME_MEMATTRIBUTES,
1089 CurrentByteOffset + ASL_RESDESC_OFFSET (ExtAddress64.SpecificFlags), 3);
1094 RsSetFlagBits (&Descriptor->ExtAddress64.SpecificFlags, InitializerOp, 5, 0);
1095 RsCreateBitField (InitializerOp, ASL_RESNAME_TYPE,
1096 CurrentByteOffset + ASL_RESDESC_OFFSET (ExtAddress64.SpecificFlags), 5);
1101 AslError (ASL_ERROR, ASL_MSG_RESOURCE_LIST, InitializerOp, NULL);
1105 InitializerOp = RsCompleteNodeAndGetNext (InitializerOp);
1108 Rnode->BufferLength = sizeof (AML_RESOURCE_EXTENDED_ADDRESS64) + StringLength;
1113 /*******************************************************************************
1115 * FUNCTION: RsDoExtendedSpaceDescriptor
1117 * PARAMETERS: Op - Parent resource descriptor parse node
1118 * CurrentByteOffset - Offset into the resource template AML
1119 * buffer (to track references to the desc)
1121 * RETURN: Completed resource node
1123 * DESCRIPTION: Construct a long "ExtendedSpace" descriptor
1125 ******************************************************************************/
1128 RsDoExtendedSpaceDescriptor (
1129 ACPI_PARSE_OBJECT *Op,
1130 UINT32 CurrentByteOffset)
1132 AML_RESOURCE *Descriptor;
1133 ACPI_PARSE_OBJECT *InitializerOp;
1134 ASL_RESOURCE_NODE *Rnode;
1135 UINT16 StringLength = 0;
1139 InitializerOp = Op->Asl.Child;
1140 StringLength = RsGetStringDataLength (InitializerOp);
1142 Rnode = RsAllocateResourceNode (
1143 sizeof (AML_RESOURCE_EXTENDED_ADDRESS64) + 1 + StringLength);
1145 Descriptor = Rnode->Buffer;
1146 Descriptor->ExtAddress64.DescriptorType = ACPI_RESOURCE_NAME_EXTENDED_ADDRESS64;
1147 Descriptor->ExtAddress64.RevisionID = AML_RESOURCE_EXTENDED_ADDRESS_REVISION;
1149 Descriptor->ExtAddress64.ResourceLength = (UINT16)
1150 (sizeof (AML_RESOURCE_EXTENDED_ADDRESS64) -
1151 sizeof (AML_RESOURCE_LARGE_HEADER));
1153 /* Process all child initialization nodes */
1155 for (i = 0; InitializerOp; i++)
1159 case 0: /* Resource Type */
1161 Descriptor->ExtAddress64.ResourceType =
1162 (UINT8) InitializerOp->Asl.Value.Integer;
1165 case 1: /* Resource Usage */
1167 RsSetFlagBits (&Descriptor->ExtAddress64.Flags, InitializerOp, 0, 1);
1170 case 2: /* DecodeType */
1172 RsSetFlagBits (&Descriptor->ExtAddress64.Flags, InitializerOp, 1, 0);
1173 RsCreateBitField (InitializerOp, ASL_RESNAME_DECODE,
1174 CurrentByteOffset + ASL_RESDESC_OFFSET (ExtAddress64.Flags), 1);
1177 case 3: /* MinType */
1179 RsSetFlagBits (&Descriptor->ExtAddress64.Flags, InitializerOp, 2, 0);
1180 RsCreateBitField (InitializerOp, ASL_RESNAME_MINTYPE,
1181 CurrentByteOffset + ASL_RESDESC_OFFSET (ExtAddress64.Flags), 2);
1184 case 4: /* MaxType */
1186 RsSetFlagBits (&Descriptor->ExtAddress64.Flags, InitializerOp, 3, 0);
1187 RsCreateBitField (InitializerOp, ASL_RESNAME_MAXTYPE,
1188 CurrentByteOffset + ASL_RESDESC_OFFSET (ExtAddress64.Flags), 3);
1191 case 5: /* Type-Specific flags */
1193 Descriptor->ExtAddress64.SpecificFlags =
1194 (UINT8) InitializerOp->Asl.Value.Integer;
1197 case 6: /* Address Granularity */
1199 Descriptor->ExtAddress64.Granularity = InitializerOp->Asl.Value.Integer;
1200 RsCreateByteField (InitializerOp, ASL_RESNAME_GRANULARITY,
1201 CurrentByteOffset + ASL_RESDESC_OFFSET (ExtAddress64.Granularity));
1204 case 7: /* Min Address */
1206 Descriptor->ExtAddress64.Minimum = InitializerOp->Asl.Value.Integer;
1207 RsCreateByteField (InitializerOp, ASL_RESNAME_MINADDR,
1208 CurrentByteOffset + ASL_RESDESC_OFFSET (ExtAddress64.Minimum));
1211 case 8: /* Max Address */
1213 Descriptor->ExtAddress64.Maximum = InitializerOp->Asl.Value.Integer;
1214 RsCreateByteField (InitializerOp, ASL_RESNAME_MAXADDR,
1215 CurrentByteOffset + ASL_RESDESC_OFFSET (ExtAddress64.Maximum));
1218 case 9: /* Translation Offset */
1220 Descriptor->ExtAddress64.TranslationOffset = InitializerOp->Asl.Value.Integer;
1221 RsCreateByteField (InitializerOp, ASL_RESNAME_TRANSLATION,
1222 CurrentByteOffset + ASL_RESDESC_OFFSET (ExtAddress64.TranslationOffset));
1225 case 10: /* Address Length */
1227 Descriptor->ExtAddress64.AddressLength = InitializerOp->Asl.Value.Integer;
1228 RsCreateByteField (InitializerOp, ASL_RESNAME_LENGTH,
1229 CurrentByteOffset + ASL_RESDESC_OFFSET (ExtAddress64.AddressLength));
1232 case 11: /* Type-Specific Attributes */
1234 Descriptor->ExtAddress64.TypeSpecific = InitializerOp->Asl.Value.Integer;
1235 RsCreateByteField (InitializerOp, ASL_RESNAME_TYPESPECIFICATTRIBUTES,
1236 CurrentByteOffset + ASL_RESDESC_OFFSET (ExtAddress64.TypeSpecific));
1239 case 12: /* ResourceTag */
1241 UtAttachNamepathToOwner (Op, InitializerOp);
1246 AslError (ASL_ERROR, ASL_MSG_RESOURCE_LIST, InitializerOp, NULL);
1250 InitializerOp = RsCompleteNodeAndGetNext (InitializerOp);
1253 Rnode->BufferLength = sizeof (AML_RESOURCE_EXTENDED_ADDRESS64) + StringLength;
1258 /*******************************************************************************
1260 * FUNCTION: RsDoQwordIoDescriptor
1262 * PARAMETERS: Op - Parent resource descriptor parse node
1263 * CurrentByteOffset - Offset into the resource template AML
1264 * buffer (to track references to the desc)
1266 * RETURN: Completed resource node
1268 * DESCRIPTION: Construct a long "QwordIO" descriptor
1270 ******************************************************************************/
1273 RsDoQwordIoDescriptor (
1274 ACPI_PARSE_OBJECT *Op,
1275 UINT32 CurrentByteOffset)
1277 AML_RESOURCE *Descriptor;
1278 ACPI_PARSE_OBJECT *InitializerOp;
1279 ASL_RESOURCE_NODE *Rnode;
1280 UINT8 *OptionalFields;
1281 UINT16 StringLength = 0;
1282 UINT32 OptionIndex = 0;
1284 BOOLEAN ResSourceIndex = FALSE;
1287 InitializerOp = Op->Asl.Child;
1288 StringLength = RsGetStringDataLength (InitializerOp);
1290 Rnode = RsAllocateResourceNode (
1291 sizeof (AML_RESOURCE_ADDRESS64) + 1 + StringLength);
1293 Descriptor = Rnode->Buffer;
1294 Descriptor->Address64.DescriptorType = ACPI_RESOURCE_NAME_ADDRESS64;
1295 Descriptor->Address64.ResourceType = ACPI_ADDRESS_TYPE_IO_RANGE;
1298 * Initial descriptor length -- may be enlarged if there are
1299 * optional fields present
1301 OptionalFields = ((UINT8 *) Descriptor) + sizeof (AML_RESOURCE_ADDRESS64);
1302 Descriptor->Address64.ResourceLength = (UINT16)
1303 (sizeof (AML_RESOURCE_ADDRESS64) -
1304 sizeof (AML_RESOURCE_LARGE_HEADER));
1306 /* Process all child initialization nodes */
1308 for (i = 0; InitializerOp; i++)
1312 case 0: /* Resource Usage */
1314 RsSetFlagBits (&Descriptor->Address64.Flags, InitializerOp, 0, 1);
1317 case 1: /* MinType */
1319 RsSetFlagBits (&Descriptor->Address64.Flags, InitializerOp, 2, 0);
1320 RsCreateBitField (InitializerOp, ASL_RESNAME_MINTYPE,
1321 CurrentByteOffset + ASL_RESDESC_OFFSET (Address64.Flags), 2);
1324 case 2: /* MaxType */
1326 RsSetFlagBits (&Descriptor->Address64.Flags, InitializerOp, 3, 0);
1327 RsCreateBitField (InitializerOp, ASL_RESNAME_MAXTYPE,
1328 CurrentByteOffset + ASL_RESDESC_OFFSET (Address64.Flags), 3);
1331 case 3: /* DecodeType */
1333 RsSetFlagBits (&Descriptor->Address64.Flags, InitializerOp, 1, 0);
1334 RsCreateBitField (InitializerOp, ASL_RESNAME_DECODE,
1335 CurrentByteOffset + ASL_RESDESC_OFFSET (Address64.Flags), 1);
1338 case 4: /* Range Type */
1340 RsSetFlagBits (&Descriptor->Address64.SpecificFlags, InitializerOp, 0, 3);
1341 RsCreateBitField (InitializerOp, ASL_RESNAME_RANGETYPE,
1342 CurrentByteOffset + ASL_RESDESC_OFFSET (Address64.SpecificFlags), 0);
1345 case 5: /* Address Granularity */
1347 Descriptor->Address64.Granularity = InitializerOp->Asl.Value.Integer;
1348 RsCreateByteField (InitializerOp, ASL_RESNAME_GRANULARITY,
1349 CurrentByteOffset + ASL_RESDESC_OFFSET (Address64.Granularity));
1352 case 6: /* Address Min */
1354 Descriptor->Address64.Minimum = InitializerOp->Asl.Value.Integer;
1355 RsCreateByteField (InitializerOp, ASL_RESNAME_MINADDR,
1356 CurrentByteOffset + ASL_RESDESC_OFFSET (Address64.Minimum));
1359 case 7: /* Address Max */
1361 Descriptor->Address64.Maximum = InitializerOp->Asl.Value.Integer;
1362 RsCreateByteField (InitializerOp, ASL_RESNAME_MAXADDR,
1363 CurrentByteOffset + ASL_RESDESC_OFFSET (Address64.Maximum));
1366 case 8: /* Translation Offset */
1368 Descriptor->Address64.TranslationOffset = InitializerOp->Asl.Value.Integer;
1369 RsCreateByteField (InitializerOp, ASL_RESNAME_TRANSLATION,
1370 CurrentByteOffset + ASL_RESDESC_OFFSET (Address64.TranslationOffset));
1373 case 9: /* Address Length */
1375 Descriptor->Address64.AddressLength = InitializerOp->Asl.Value.Integer;
1376 RsCreateByteField (InitializerOp, ASL_RESNAME_LENGTH,
1377 CurrentByteOffset + ASL_RESDESC_OFFSET (Address64.AddressLength));
1380 case 10: /* ResSourceIndex [Optional Field - BYTE] */
1382 if (InitializerOp->Asl.ParseOpcode != PARSEOP_DEFAULT_ARG)
1384 OptionalFields[0] = (UINT8) InitializerOp->Asl.Value.Integer;
1386 Descriptor->Address64.ResourceLength++;
1387 ResSourceIndex = TRUE;
1391 case 11: /* ResSource [Optional Field - STRING] */
1393 if ((InitializerOp->Asl.ParseOpcode != PARSEOP_DEFAULT_ARG) &&
1394 (InitializerOp->Asl.Value.String))
1398 Descriptor->Address64.ResourceLength = (UINT16)
1399 (Descriptor->Address64.ResourceLength + StringLength);
1402 &OptionalFields[OptionIndex],
1403 InitializerOp->Asl.Value.String);
1405 /* ResourceSourceIndex must also be valid */
1407 if (!ResSourceIndex)
1409 AslError (ASL_ERROR, ASL_MSG_RESOURCE_INDEX,
1410 InitializerOp, NULL);
1417 * Not a valid ResourceSource, ResourceSourceIndex must also
1420 else if (ResSourceIndex)
1422 AslError (ASL_ERROR, ASL_MSG_RESOURCE_SOURCE,
1423 InitializerOp, NULL);
1428 case 12: /* ResourceTag */
1430 UtAttachNamepathToOwner (Op, InitializerOp);
1435 RsSetFlagBits (&Descriptor->Address64.SpecificFlags, InitializerOp, 4, 0);
1436 RsCreateBitField (InitializerOp, ASL_RESNAME_TYPE,
1437 CurrentByteOffset + ASL_RESDESC_OFFSET (Address64.SpecificFlags), 4);
1440 case 14: /* Translation Type */
1442 RsSetFlagBits (&Descriptor->Address64.SpecificFlags, InitializerOp, 5, 0);
1443 RsCreateBitField (InitializerOp, ASL_RESNAME_TRANSTYPE,
1444 CurrentByteOffset + ASL_RESDESC_OFFSET (Address64.SpecificFlags), 5);
1449 AslError (ASL_ERROR, ASL_MSG_RESOURCE_LIST, InitializerOp, NULL);
1453 InitializerOp = RsCompleteNodeAndGetNext (InitializerOp);
1456 Rnode->BufferLength = sizeof (AML_RESOURCE_ADDRESS64) +
1457 OptionIndex + StringLength;
1462 /*******************************************************************************
1464 * FUNCTION: RsDoQwordMemoryDescriptor
1466 * PARAMETERS: Op - Parent resource descriptor parse node
1467 * CurrentByteOffset - Offset into the resource template AML
1468 * buffer (to track references to the desc)
1470 * RETURN: Completed resource node
1472 * DESCRIPTION: Construct a long "QwordMemory" descriptor
1474 ******************************************************************************/
1477 RsDoQwordMemoryDescriptor (
1478 ACPI_PARSE_OBJECT *Op,
1479 UINT32 CurrentByteOffset)
1481 AML_RESOURCE *Descriptor;
1482 ACPI_PARSE_OBJECT *InitializerOp;
1483 ASL_RESOURCE_NODE *Rnode;
1484 UINT8 *OptionalFields;
1485 UINT16 StringLength = 0;
1486 UINT32 OptionIndex = 0;
1488 BOOLEAN ResSourceIndex = FALSE;
1491 InitializerOp = Op->Asl.Child;
1492 StringLength = RsGetStringDataLength (InitializerOp);
1494 Rnode = RsAllocateResourceNode (
1495 sizeof (AML_RESOURCE_ADDRESS64) + 1 + StringLength);
1497 Descriptor = Rnode->Buffer;
1498 Descriptor->Address64.DescriptorType = ACPI_RESOURCE_NAME_ADDRESS64;
1499 Descriptor->Address64.ResourceType = ACPI_ADDRESS_TYPE_MEMORY_RANGE;
1502 * Initial descriptor length -- may be enlarged if there are
1503 * optional fields present
1505 OptionalFields = ((UINT8 *) Descriptor) + sizeof (AML_RESOURCE_ADDRESS64);
1506 Descriptor->Address64.ResourceLength = (UINT16)
1507 (sizeof (AML_RESOURCE_ADDRESS64) -
1508 sizeof (AML_RESOURCE_LARGE_HEADER));
1510 /* Process all child initialization nodes */
1512 for (i = 0; InitializerOp; i++)
1516 case 0: /* Resource Usage */
1518 RsSetFlagBits (&Descriptor->Address64.Flags, InitializerOp, 0, 1);
1521 case 1: /* DecodeType */
1523 RsSetFlagBits (&Descriptor->Address64.Flags, InitializerOp, 1, 0);
1524 RsCreateBitField (InitializerOp, ASL_RESNAME_DECODE,
1525 CurrentByteOffset + ASL_RESDESC_OFFSET (Address64.Flags), 1);
1528 case 2: /* MinType */
1530 RsSetFlagBits (&Descriptor->Address64.Flags, InitializerOp, 2, 0);
1531 RsCreateBitField (InitializerOp, ASL_RESNAME_MINTYPE,
1532 CurrentByteOffset + ASL_RESDESC_OFFSET (Address64.Flags), 2);
1535 case 3: /* MaxType */
1537 RsSetFlagBits (&Descriptor->Address64.Flags, InitializerOp, 3, 0);
1538 RsCreateBitField (InitializerOp, ASL_RESNAME_MAXTYPE,
1539 CurrentByteOffset + ASL_RESDESC_OFFSET (Address64.Flags), 3);
1542 case 4: /* Memory Type */
1544 RsSetFlagBits (&Descriptor->Address64.SpecificFlags, InitializerOp, 1, 0);
1545 RsCreateBitField (InitializerOp, ASL_RESNAME_MEMTYPE,
1546 CurrentByteOffset + ASL_RESDESC_OFFSET (Address64.SpecificFlags), 1);
1549 case 5: /* Read/Write Type */
1551 RsSetFlagBits (&Descriptor->Address64.SpecificFlags, InitializerOp, 0, 1);
1552 RsCreateBitField (InitializerOp, ASL_RESNAME_READWRITETYPE,
1553 CurrentByteOffset + ASL_RESDESC_OFFSET (Address64.SpecificFlags), 0);
1556 case 6: /* Address Granularity */
1558 Descriptor->Address64.Granularity = InitializerOp->Asl.Value.Integer;
1559 RsCreateByteField (InitializerOp, ASL_RESNAME_GRANULARITY,
1560 CurrentByteOffset + ASL_RESDESC_OFFSET (Address64.Granularity));
1563 case 7: /* Min Address */
1565 Descriptor->Address64.Minimum = InitializerOp->Asl.Value.Integer;
1566 RsCreateByteField (InitializerOp, ASL_RESNAME_MINADDR,
1567 CurrentByteOffset + ASL_RESDESC_OFFSET (Address64.Minimum));
1570 case 8: /* Max Address */
1572 Descriptor->Address64.Maximum = InitializerOp->Asl.Value.Integer;
1573 RsCreateByteField (InitializerOp, ASL_RESNAME_MAXADDR,
1574 CurrentByteOffset + ASL_RESDESC_OFFSET (Address64.Maximum));
1577 case 9: /* Translation Offset */
1579 Descriptor->Address64.TranslationOffset = InitializerOp->Asl.Value.Integer;
1580 RsCreateByteField (InitializerOp, ASL_RESNAME_TRANSLATION,
1581 CurrentByteOffset + ASL_RESDESC_OFFSET (Address64.TranslationOffset));
1584 case 10: /* Address Length */
1586 Descriptor->Address64.AddressLength = InitializerOp->Asl.Value.Integer;
1587 RsCreateByteField (InitializerOp, ASL_RESNAME_LENGTH,
1588 CurrentByteOffset + ASL_RESDESC_OFFSET (Address64.AddressLength));
1591 case 11: /* ResSourceIndex [Optional Field - BYTE] */
1593 if (InitializerOp->Asl.ParseOpcode != PARSEOP_DEFAULT_ARG)
1595 OptionalFields[0] = (UINT8) InitializerOp->Asl.Value.Integer;
1597 Descriptor->Address64.ResourceLength++;
1598 ResSourceIndex = TRUE;
1602 case 12: /* ResSource [Optional Field - STRING] */
1604 if ((InitializerOp->Asl.ParseOpcode != PARSEOP_DEFAULT_ARG) &&
1605 (InitializerOp->Asl.Value.String))
1609 Descriptor->Address64.ResourceLength = (UINT16)
1610 (Descriptor->Address64.ResourceLength + StringLength);
1613 &OptionalFields[OptionIndex],
1614 InitializerOp->Asl.Value.String);
1616 /* ResourceSourceIndex must also be valid */
1618 if (!ResSourceIndex)
1620 AslError (ASL_ERROR, ASL_MSG_RESOURCE_INDEX,
1621 InitializerOp, NULL);
1628 * Not a valid ResourceSource, ResourceSourceIndex must also
1631 else if (ResSourceIndex)
1633 AslError (ASL_ERROR, ASL_MSG_RESOURCE_SOURCE,
1634 InitializerOp, NULL);
1639 case 13: /* ResourceTag */
1641 UtAttachNamepathToOwner (Op, InitializerOp);
1645 case 14: /* Address Range */
1647 RsSetFlagBits (&Descriptor->Address64.SpecificFlags, InitializerOp, 3, 0);
1648 RsCreateBitField (InitializerOp, ASL_RESNAME_MEMATTRIBUTES,
1649 CurrentByteOffset + ASL_RESDESC_OFFSET (Address64.SpecificFlags), 3);
1654 RsSetFlagBits (&Descriptor->Address64.SpecificFlags, InitializerOp, 5, 0);
1655 RsCreateBitField (InitializerOp, ASL_RESNAME_TYPE,
1656 CurrentByteOffset + ASL_RESDESC_OFFSET (Address64.SpecificFlags), 5);
1661 AslError (ASL_ERROR, ASL_MSG_RESOURCE_LIST, InitializerOp, NULL);
1665 InitializerOp = RsCompleteNodeAndGetNext (InitializerOp);
1668 Rnode->BufferLength = sizeof (AML_RESOURCE_ADDRESS64) +
1669 OptionIndex + StringLength;
1674 /*******************************************************************************
1676 * FUNCTION: RsDoQwordSpaceDescriptor
1678 * PARAMETERS: Op - Parent resource descriptor parse node
1679 * CurrentByteOffset - Offset into the resource template AML
1680 * buffer (to track references to the desc)
1682 * RETURN: Completed resource node
1684 * DESCRIPTION: Construct a long "QwordSpace" descriptor
1686 ******************************************************************************/
1689 RsDoQwordSpaceDescriptor (
1690 ACPI_PARSE_OBJECT *Op,
1691 UINT32 CurrentByteOffset)
1693 AML_RESOURCE *Descriptor;
1694 ACPI_PARSE_OBJECT *InitializerOp;
1695 ASL_RESOURCE_NODE *Rnode;
1696 UINT8 *OptionalFields;
1697 UINT16 StringLength = 0;
1698 UINT32 OptionIndex = 0;
1700 BOOLEAN ResSourceIndex = FALSE;
1703 InitializerOp = Op->Asl.Child;
1704 StringLength = RsGetStringDataLength (InitializerOp);
1706 Rnode = RsAllocateResourceNode (
1707 sizeof (AML_RESOURCE_ADDRESS64) + 1 + StringLength);
1709 Descriptor = Rnode->Buffer;
1710 Descriptor->Address64.DescriptorType = ACPI_RESOURCE_NAME_ADDRESS32;
1713 * Initial descriptor length -- may be enlarged if there are
1714 * optional fields present
1716 OptionalFields = ((UINT8 *) Descriptor) + sizeof (AML_RESOURCE_ADDRESS64);
1717 Descriptor->Address64.ResourceLength = (UINT16)
1718 (sizeof (AML_RESOURCE_ADDRESS64) -
1719 sizeof (AML_RESOURCE_LARGE_HEADER));
1721 /* Process all child initialization nodes */
1723 for (i = 0; InitializerOp; i++)
1727 case 0: /* Resource Type */
1729 Descriptor->Address64.ResourceType =
1730 (UINT8) InitializerOp->Asl.Value.Integer;
1733 case 1: /* Resource Usage */
1735 RsSetFlagBits (&Descriptor->Address64.Flags, InitializerOp, 0, 1);
1738 case 2: /* DecodeType */
1740 RsSetFlagBits (&Descriptor->Address64.Flags, InitializerOp, 1, 0);
1741 RsCreateBitField (InitializerOp, ASL_RESNAME_DECODE,
1742 CurrentByteOffset + ASL_RESDESC_OFFSET (Address64.Flags), 1);
1745 case 3: /* MinType */
1747 RsSetFlagBits (&Descriptor->Address64.Flags, InitializerOp, 2, 0);
1748 RsCreateBitField (InitializerOp, ASL_RESNAME_MINTYPE,
1749 CurrentByteOffset + ASL_RESDESC_OFFSET (Address64.Flags), 2);
1752 case 4: /* MaxType */
1754 RsSetFlagBits (&Descriptor->Address64.Flags, InitializerOp, 3, 0);
1755 RsCreateBitField (InitializerOp, ASL_RESNAME_MAXTYPE,
1756 CurrentByteOffset + ASL_RESDESC_OFFSET (Address64.Flags), 3);
1759 case 5: /* Type-Specific flags */
1761 Descriptor->Address64.SpecificFlags =
1762 (UINT8) InitializerOp->Asl.Value.Integer;
1765 case 6: /* Address Granularity */
1767 Descriptor->Address64.Granularity = InitializerOp->Asl.Value.Integer;
1768 RsCreateByteField (InitializerOp, ASL_RESNAME_GRANULARITY,
1769 CurrentByteOffset + ASL_RESDESC_OFFSET (Address64.Granularity));
1772 case 7: /* Min Address */
1774 Descriptor->Address64.Minimum = InitializerOp->Asl.Value.Integer;
1775 RsCreateByteField (InitializerOp, ASL_RESNAME_MINADDR,
1776 CurrentByteOffset + ASL_RESDESC_OFFSET (Address64.Minimum));
1779 case 8: /* Max Address */
1781 Descriptor->Address64.Maximum = InitializerOp->Asl.Value.Integer;
1782 RsCreateByteField (InitializerOp, ASL_RESNAME_MAXADDR,
1783 CurrentByteOffset + ASL_RESDESC_OFFSET (Address64.Maximum));
1786 case 9: /* Translation Offset */
1788 Descriptor->Address64.TranslationOffset = InitializerOp->Asl.Value.Integer;
1789 RsCreateByteField (InitializerOp, ASL_RESNAME_TRANSLATION,
1790 CurrentByteOffset + ASL_RESDESC_OFFSET (Address64.TranslationOffset));
1793 case 10: /* Address Length */
1795 Descriptor->Address64.AddressLength = InitializerOp->Asl.Value.Integer;
1796 RsCreateByteField (InitializerOp, ASL_RESNAME_LENGTH,
1797 CurrentByteOffset + ASL_RESDESC_OFFSET (Address64.AddressLength));
1800 case 11: /* ResSourceIndex [Optional Field - BYTE] */
1802 if (InitializerOp->Asl.ParseOpcode != PARSEOP_DEFAULT_ARG)
1804 OptionalFields[0] = (UINT8) InitializerOp->Asl.Value.Integer;
1806 Descriptor->Address64.ResourceLength++;
1807 ResSourceIndex = TRUE;
1811 case 12: /* ResSource [Optional Field - STRING] */
1813 if ((InitializerOp->Asl.ParseOpcode != PARSEOP_DEFAULT_ARG) &&
1814 (InitializerOp->Asl.Value.String))
1818 Descriptor->Address64.ResourceLength = (UINT16)
1819 (Descriptor->Address64.ResourceLength + StringLength);
1822 &OptionalFields[OptionIndex],
1823 InitializerOp->Asl.Value.String);
1825 /* ResourceSourceIndex must also be valid */
1827 if (!ResSourceIndex)
1829 AslError (ASL_ERROR, ASL_MSG_RESOURCE_INDEX,
1830 InitializerOp, NULL);
1837 * Not a valid ResourceSource, ResourceSourceIndex must also
1840 else if (ResSourceIndex)
1842 AslError (ASL_ERROR, ASL_MSG_RESOURCE_SOURCE,
1843 InitializerOp, NULL);
1848 case 13: /* ResourceTag */
1850 UtAttachNamepathToOwner (Op, InitializerOp);
1855 AslError (ASL_ERROR, ASL_MSG_RESOURCE_LIST, InitializerOp, NULL);
1859 InitializerOp = RsCompleteNodeAndGetNext (InitializerOp);
1862 Rnode->BufferLength = sizeof (AML_RESOURCE_ADDRESS64) +
1863 OptionIndex + StringLength;
1868 /*******************************************************************************
1870 * FUNCTION: RsDoWordIoDescriptor
1872 * PARAMETERS: Op - Parent resource descriptor parse node
1873 * CurrentByteOffset - Offset into the resource template AML
1874 * buffer (to track references to the desc)
1876 * RETURN: Completed resource node
1878 * DESCRIPTION: Construct a long "WordIO" descriptor
1880 ******************************************************************************/
1883 RsDoWordIoDescriptor (
1884 ACPI_PARSE_OBJECT *Op,
1885 UINT32 CurrentByteOffset)
1887 AML_RESOURCE *Descriptor;
1888 ACPI_PARSE_OBJECT *InitializerOp;
1889 ASL_RESOURCE_NODE *Rnode;
1890 UINT8 *OptionalFields;
1891 UINT16 StringLength = 0;
1892 UINT32 OptionIndex = 0;
1894 BOOLEAN ResSourceIndex = FALSE;
1897 InitializerOp = Op->Asl.Child;
1898 StringLength = RsGetStringDataLength (InitializerOp);
1900 Rnode = RsAllocateResourceNode (
1901 sizeof (AML_RESOURCE_ADDRESS16) + 1 + StringLength);
1903 Descriptor = Rnode->Buffer;
1904 Descriptor->Address16.DescriptorType = ACPI_RESOURCE_NAME_ADDRESS16;
1905 Descriptor->Address16.ResourceType = ACPI_ADDRESS_TYPE_IO_RANGE;
1908 * Initial descriptor length -- may be enlarged if there are
1909 * optional fields present
1911 OptionalFields = ((UINT8 *) Descriptor) + sizeof (AML_RESOURCE_ADDRESS16);
1912 Descriptor->Address16.ResourceLength = (UINT16)
1913 (sizeof (AML_RESOURCE_ADDRESS16) -
1914 sizeof (AML_RESOURCE_LARGE_HEADER));
1916 /* Process all child initialization nodes */
1918 for (i = 0; InitializerOp; i++)
1922 case 0: /* Resource Usage */
1924 RsSetFlagBits (&Descriptor->Address16.Flags, InitializerOp, 0, 1);
1927 case 1: /* MinType */
1929 RsSetFlagBits (&Descriptor->Address16.Flags, InitializerOp, 2, 0);
1930 RsCreateBitField (InitializerOp, ASL_RESNAME_MINTYPE,
1931 CurrentByteOffset + ASL_RESDESC_OFFSET (Address16.Flags), 2);
1934 case 2: /* MaxType */
1936 RsSetFlagBits (&Descriptor->Address16.Flags, InitializerOp, 3, 0);
1937 RsCreateBitField (InitializerOp, ASL_RESNAME_MAXTYPE,
1938 CurrentByteOffset + ASL_RESDESC_OFFSET (Address16.Flags), 3);
1941 case 3: /* DecodeType */
1943 RsSetFlagBits (&Descriptor->Address16.Flags, InitializerOp, 1, 0);
1944 RsCreateBitField (InitializerOp, ASL_RESNAME_DECODE,
1945 CurrentByteOffset + ASL_RESDESC_OFFSET (Address16.Flags), 1);
1948 case 4: /* Range Type */
1950 RsSetFlagBits (&Descriptor->Address16.SpecificFlags, InitializerOp, 0, 3);
1951 RsCreateBitField (InitializerOp, ASL_RESNAME_RANGETYPE,
1952 CurrentByteOffset + ASL_RESDESC_OFFSET (Address16.SpecificFlags), 0);
1955 case 5: /* Address Granularity */
1957 Descriptor->Address16.Granularity = (UINT16) InitializerOp->Asl.Value.Integer;
1958 RsCreateByteField (InitializerOp, ASL_RESNAME_GRANULARITY,
1959 CurrentByteOffset + ASL_RESDESC_OFFSET (Address16.Granularity));
1962 case 6: /* Address Min */
1964 Descriptor->Address16.Minimum = (UINT16) InitializerOp->Asl.Value.Integer;
1965 RsCreateByteField (InitializerOp, ASL_RESNAME_MINADDR,
1966 CurrentByteOffset + ASL_RESDESC_OFFSET (Address16.Minimum));
1969 case 7: /* Address Max */
1971 Descriptor->Address16.Maximum = (UINT16) InitializerOp->Asl.Value.Integer;
1972 RsCreateByteField (InitializerOp, ASL_RESNAME_MAXADDR,
1973 CurrentByteOffset + ASL_RESDESC_OFFSET (Address16.Maximum));
1976 case 8: /* Translation Offset */
1978 Descriptor->Address16.TranslationOffset = (UINT16) InitializerOp->Asl.Value.Integer;
1979 RsCreateByteField (InitializerOp, ASL_RESNAME_TRANSLATION,
1980 CurrentByteOffset + ASL_RESDESC_OFFSET (Address16.TranslationOffset));
1983 case 9: /* Address Length */
1985 Descriptor->Address16.AddressLength = (UINT16) InitializerOp->Asl.Value.Integer;
1986 RsCreateByteField (InitializerOp, ASL_RESNAME_LENGTH,
1987 CurrentByteOffset + ASL_RESDESC_OFFSET (Address16.AddressLength));
1990 case 10: /* ResSourceIndex [Optional Field - BYTE] */
1992 if (InitializerOp->Asl.ParseOpcode != PARSEOP_DEFAULT_ARG)
1994 OptionalFields[0] = (UINT8) InitializerOp->Asl.Value.Integer;
1996 Descriptor->Address16.ResourceLength++;
1997 ResSourceIndex = TRUE;
2001 case 11: /* ResSource [Optional Field - STRING] */
2003 if ((InitializerOp->Asl.ParseOpcode != PARSEOP_DEFAULT_ARG) &&
2004 (InitializerOp->Asl.Value.String))
2008 Descriptor->Address16.ResourceLength = (UINT16)
2009 (Descriptor->Address16.ResourceLength + StringLength);
2012 &OptionalFields[OptionIndex],
2013 InitializerOp->Asl.Value.String);
2015 /* ResourceSourceIndex must also be valid */
2017 if (!ResSourceIndex)
2019 AslError (ASL_ERROR, ASL_MSG_RESOURCE_INDEX,
2020 InitializerOp, NULL);
2027 * Not a valid ResourceSource, ResourceSourceIndex must also
2030 else if (ResSourceIndex)
2032 AslError (ASL_ERROR, ASL_MSG_RESOURCE_SOURCE,
2033 InitializerOp, NULL);
2038 case 12: /* ResourceTag */
2040 UtAttachNamepathToOwner (Op, InitializerOp);
2045 RsSetFlagBits (&Descriptor->Address16.SpecificFlags, InitializerOp, 4, 0);
2046 RsCreateBitField (InitializerOp, ASL_RESNAME_TYPE,
2047 CurrentByteOffset + ASL_RESDESC_OFFSET (Address16.SpecificFlags), 4);
2050 case 14: /* Translation Type */
2052 RsSetFlagBits (&Descriptor->Address16.SpecificFlags, InitializerOp, 5, 0);
2053 RsCreateBitField (InitializerOp, ASL_RESNAME_TRANSTYPE,
2054 CurrentByteOffset + ASL_RESDESC_OFFSET (Address16.SpecificFlags), 5);
2059 AslError (ASL_ERROR, ASL_MSG_RESOURCE_LIST, InitializerOp, NULL);
2063 InitializerOp = RsCompleteNodeAndGetNext (InitializerOp);
2066 Rnode->BufferLength = sizeof (AML_RESOURCE_ADDRESS16) +
2067 OptionIndex + StringLength;
2072 /*******************************************************************************
2074 * FUNCTION: RsDoWordBusNumberDescriptor
2076 * PARAMETERS: Op - Parent resource descriptor parse node
2077 * CurrentByteOffset - Offset into the resource template AML
2078 * buffer (to track references to the desc)
2080 * RETURN: Completed resource node
2082 * DESCRIPTION: Construct a long "WordBusNumber" descriptor
2084 ******************************************************************************/
2087 RsDoWordBusNumberDescriptor (
2088 ACPI_PARSE_OBJECT *Op,
2089 UINT32 CurrentByteOffset)
2091 AML_RESOURCE *Descriptor;
2092 ACPI_PARSE_OBJECT *InitializerOp;
2093 ASL_RESOURCE_NODE *Rnode;
2094 UINT8 *OptionalFields;
2095 UINT16 StringLength = 0;
2096 UINT32 OptionIndex = 0;
2098 BOOLEAN ResSourceIndex = FALSE;
2101 InitializerOp = Op->Asl.Child;
2102 StringLength = RsGetStringDataLength (InitializerOp);
2104 Rnode = RsAllocateResourceNode (
2105 sizeof (AML_RESOURCE_ADDRESS16) + 1 + StringLength);
2107 Descriptor = Rnode->Buffer;
2108 Descriptor->Address16.DescriptorType = ACPI_RESOURCE_NAME_ADDRESS16;
2109 Descriptor->Address16.ResourceType = ACPI_ADDRESS_TYPE_BUS_NUMBER_RANGE;
2112 * Initial descriptor length -- may be enlarged if there are
2113 * optional fields present
2115 OptionalFields = ((UINT8 *) Descriptor) + sizeof (AML_RESOURCE_ADDRESS16);
2116 Descriptor->Address16.ResourceLength = (UINT16)
2117 (sizeof (AML_RESOURCE_ADDRESS16) -
2118 sizeof (AML_RESOURCE_LARGE_HEADER));
2120 /* Process all child initialization nodes */
2122 for (i = 0; InitializerOp; i++)
2126 case 0: /* Resource Usage */
2128 RsSetFlagBits (&Descriptor->Address16.Flags, InitializerOp, 0, 1);
2131 case 1: /* MinType */
2133 RsSetFlagBits (&Descriptor->Address16.Flags, InitializerOp, 2, 0);
2134 RsCreateBitField (InitializerOp, ASL_RESNAME_MINTYPE,
2135 CurrentByteOffset + ASL_RESDESC_OFFSET (Address16.Flags), 2);
2138 case 2: /* MaxType */
2140 RsSetFlagBits (&Descriptor->Address16.Flags, InitializerOp, 3, 0);
2141 RsCreateBitField (InitializerOp, ASL_RESNAME_MAXTYPE,
2142 CurrentByteOffset + ASL_RESDESC_OFFSET (Address16.Flags), 3);
2145 case 3: /* DecodeType */
2147 RsSetFlagBits (&Descriptor->Address16.Flags, InitializerOp, 1, 0);
2148 RsCreateBitField (InitializerOp, ASL_RESNAME_DECODE,
2149 CurrentByteOffset + ASL_RESDESC_OFFSET (Address16.Flags), 1);
2152 case 4: /* Address Granularity */
2154 Descriptor->Address16.Granularity =
2155 (UINT16) InitializerOp->Asl.Value.Integer;
2156 RsCreateByteField (InitializerOp, ASL_RESNAME_GRANULARITY,
2157 CurrentByteOffset + ASL_RESDESC_OFFSET (Address16.Granularity));
2160 case 5: /* Min Address */
2162 Descriptor->Address16.Minimum =
2163 (UINT16) InitializerOp->Asl.Value.Integer;
2164 RsCreateByteField (InitializerOp, ASL_RESNAME_MINADDR,
2165 CurrentByteOffset + ASL_RESDESC_OFFSET (Address16.Minimum));
2168 case 6: /* Max Address */
2170 Descriptor->Address16.Maximum =
2171 (UINT16) InitializerOp->Asl.Value.Integer;
2172 RsCreateByteField (InitializerOp, ASL_RESNAME_MAXADDR,
2173 CurrentByteOffset + ASL_RESDESC_OFFSET (Address16.Maximum));
2176 case 7: /* Translation Offset */
2178 Descriptor->Address16.TranslationOffset =
2179 (UINT16) InitializerOp->Asl.Value.Integer;
2180 RsCreateByteField (InitializerOp, ASL_RESNAME_TRANSLATION,
2181 CurrentByteOffset + ASL_RESDESC_OFFSET (Address16.TranslationOffset));
2184 case 8: /* Address Length */
2186 Descriptor->Address16.AddressLength =
2187 (UINT16) InitializerOp->Asl.Value.Integer;
2188 RsCreateByteField (InitializerOp, ASL_RESNAME_LENGTH,
2189 CurrentByteOffset + ASL_RESDESC_OFFSET (Address16.AddressLength));
2192 case 9: /* ResSourceIndex [Optional Field - BYTE] */
2194 if (InitializerOp->Asl.ParseOpcode != PARSEOP_DEFAULT_ARG)
2196 OptionalFields[0] = (UINT8) InitializerOp->Asl.Value.Integer;
2198 Descriptor->Address16.ResourceLength++;
2199 ResSourceIndex = TRUE;
2203 case 10: /* ResSource [Optional Field - STRING] */
2205 if ((InitializerOp->Asl.ParseOpcode != PARSEOP_DEFAULT_ARG) &&
2206 (InitializerOp->Asl.Value.String))
2210 Descriptor->Address16.ResourceLength = (UINT16)
2211 (Descriptor->Address16.ResourceLength + StringLength);
2214 &OptionalFields[OptionIndex],
2215 InitializerOp->Asl.Value.String);
2217 /* ResourceSourceIndex must also be valid */
2219 if (!ResSourceIndex)
2221 AslError (ASL_ERROR, ASL_MSG_RESOURCE_INDEX,
2222 InitializerOp, NULL);
2229 * Not a valid ResourceSource, ResourceSourceIndex must also
2232 else if (ResSourceIndex)
2234 AslError (ASL_ERROR, ASL_MSG_RESOURCE_SOURCE,
2235 InitializerOp, NULL);
2240 case 11: /* ResourceTag */
2242 UtAttachNamepathToOwner (Op, InitializerOp);
2247 AslError (ASL_ERROR, ASL_MSG_RESOURCE_LIST, InitializerOp, NULL);
2251 InitializerOp = RsCompleteNodeAndGetNext (InitializerOp);
2254 Rnode->BufferLength = sizeof (AML_RESOURCE_ADDRESS16) +
2255 OptionIndex + StringLength;
2260 /*******************************************************************************
2262 * FUNCTION: RsDoWordSpaceDescriptor
2264 * PARAMETERS: Op - Parent resource descriptor parse node
2265 * CurrentByteOffset - Offset into the resource template AML
2266 * buffer (to track references to the desc)
2268 * RETURN: Completed resource node
2270 * DESCRIPTION: Construct a long "WordSpace" descriptor
2272 ******************************************************************************/
2275 RsDoWordSpaceDescriptor (
2276 ACPI_PARSE_OBJECT *Op,
2277 UINT32 CurrentByteOffset)
2279 AML_RESOURCE *Descriptor;
2280 ACPI_PARSE_OBJECT *InitializerOp;
2281 ASL_RESOURCE_NODE *Rnode;
2282 UINT8 *OptionalFields;
2283 UINT16 StringLength = 0;
2284 UINT32 OptionIndex = 0;
2286 BOOLEAN ResSourceIndex = FALSE;
2289 InitializerOp = Op->Asl.Child;
2290 StringLength = RsGetStringDataLength (InitializerOp);
2292 Rnode = RsAllocateResourceNode (
2293 sizeof (AML_RESOURCE_ADDRESS16) + 1 + StringLength);
2295 Descriptor = Rnode->Buffer;
2296 Descriptor->Address16.DescriptorType = ACPI_RESOURCE_NAME_ADDRESS16;
2299 * Initial descriptor length -- may be enlarged if there are
2300 * optional fields present
2302 OptionalFields = ((UINT8 *) Descriptor) + sizeof (AML_RESOURCE_ADDRESS16);
2303 Descriptor->Address16.ResourceLength = (UINT16)
2304 (sizeof (AML_RESOURCE_ADDRESS16) -
2305 sizeof (AML_RESOURCE_LARGE_HEADER));
2307 /* Process all child initialization nodes */
2309 for (i = 0; InitializerOp; i++)
2313 case 0: /* Resource Type */
2315 Descriptor->Address16.ResourceType =
2316 (UINT8) InitializerOp->Asl.Value.Integer;
2319 case 1: /* Resource Usage */
2321 RsSetFlagBits (&Descriptor->Address16.Flags, InitializerOp, 0, 1);
2324 case 2: /* DecodeType */
2326 RsSetFlagBits (&Descriptor->Address16.Flags, InitializerOp, 1, 0);
2327 RsCreateBitField (InitializerOp, ASL_RESNAME_DECODE,
2328 CurrentByteOffset + ASL_RESDESC_OFFSET (Address16.Flags), 1);
2331 case 3: /* MinType */
2333 RsSetFlagBits (&Descriptor->Address16.Flags, InitializerOp, 2, 0);
2334 RsCreateBitField (InitializerOp, ASL_RESNAME_MINTYPE,
2335 CurrentByteOffset + ASL_RESDESC_OFFSET (Address16.Flags), 2);
2338 case 4: /* MaxType */
2340 RsSetFlagBits (&Descriptor->Address16.Flags, InitializerOp, 3, 0);
2341 RsCreateBitField (InitializerOp, ASL_RESNAME_MAXTYPE,
2342 CurrentByteOffset + ASL_RESDESC_OFFSET (Address16.Flags), 3);
2345 case 5: /* Type-Specific flags */
2347 Descriptor->Address16.SpecificFlags =
2348 (UINT8) InitializerOp->Asl.Value.Integer;
2351 case 6: /* Address Granularity */
2353 Descriptor->Address16.Granularity =
2354 (UINT16) InitializerOp->Asl.Value.Integer;
2355 RsCreateByteField (InitializerOp, ASL_RESNAME_GRANULARITY,
2356 CurrentByteOffset + ASL_RESDESC_OFFSET (Address16.Granularity));
2359 case 7: /* Min Address */
2361 Descriptor->Address16.Minimum =
2362 (UINT16) InitializerOp->Asl.Value.Integer;
2363 RsCreateByteField (InitializerOp, ASL_RESNAME_MINADDR,
2364 CurrentByteOffset + ASL_RESDESC_OFFSET (Address16.Minimum));
2367 case 8: /* Max Address */
2369 Descriptor->Address16.Maximum =
2370 (UINT16) InitializerOp->Asl.Value.Integer;
2371 RsCreateByteField (InitializerOp, ASL_RESNAME_MAXADDR,
2372 CurrentByteOffset + ASL_RESDESC_OFFSET (Address16.Maximum));
2375 case 9: /* Translation Offset */
2377 Descriptor->Address16.TranslationOffset =
2378 (UINT16) InitializerOp->Asl.Value.Integer;
2379 RsCreateByteField (InitializerOp, ASL_RESNAME_TRANSLATION,
2380 CurrentByteOffset + ASL_RESDESC_OFFSET (Address16.TranslationOffset));
2383 case 10: /* Address Length */
2385 Descriptor->Address16.AddressLength =
2386 (UINT16) InitializerOp->Asl.Value.Integer;
2387 RsCreateByteField (InitializerOp, ASL_RESNAME_LENGTH,
2388 CurrentByteOffset + ASL_RESDESC_OFFSET (Address16.AddressLength));
2391 case 11: /* ResSourceIndex [Optional Field - BYTE] */
2393 if (InitializerOp->Asl.ParseOpcode != PARSEOP_DEFAULT_ARG)
2395 OptionalFields[0] = (UINT8) InitializerOp->Asl.Value.Integer;
2397 Descriptor->Address16.ResourceLength++;
2398 ResSourceIndex = TRUE;
2402 case 12: /* ResSource [Optional Field - STRING] */
2404 if ((InitializerOp->Asl.ParseOpcode != PARSEOP_DEFAULT_ARG) &&
2405 (InitializerOp->Asl.Value.String))
2409 Descriptor->Address16.ResourceLength = (UINT16)
2410 (Descriptor->Address16.ResourceLength + StringLength);
2413 &OptionalFields[OptionIndex],
2414 InitializerOp->Asl.Value.String);
2416 /* ResourceSourceIndex must also be valid */
2418 if (!ResSourceIndex)
2420 AslError (ASL_ERROR, ASL_MSG_RESOURCE_INDEX,
2421 InitializerOp, NULL);
2428 * Not a valid ResourceSource, ResourceSourceIndex must also
2431 else if (ResSourceIndex)
2433 AslError (ASL_ERROR, ASL_MSG_RESOURCE_SOURCE,
2434 InitializerOp, NULL);
2439 case 13: /* ResourceTag */
2441 UtAttachNamepathToOwner (Op, InitializerOp);
2446 AslError (ASL_ERROR, ASL_MSG_RESOURCE_LIST, InitializerOp, NULL);
2450 InitializerOp = RsCompleteNodeAndGetNext (InitializerOp);
2453 Rnode->BufferLength = sizeof (AML_RESOURCE_ADDRESS16) +
2454 OptionIndex + StringLength;
2459 /*******************************************************************************
2461 * FUNCTION: RsDoInterruptDescriptor
2463 * PARAMETERS: Op - Parent resource descriptor parse node
2464 * CurrentByteOffset - Offset into the resource template AML
2465 * buffer (to track references to the desc)
2467 * RETURN: Completed resource node
2469 * DESCRIPTION: Construct a long "Interrupt" descriptor
2471 ******************************************************************************/
2474 RsDoInterruptDescriptor (
2475 ACPI_PARSE_OBJECT *Op,
2476 UINT32 CurrentByteOffset)
2478 AML_RESOURCE *Descriptor;
2479 AML_RESOURCE *Rover = NULL;
2480 ACPI_PARSE_OBJECT *InitializerOp;
2481 ASL_RESOURCE_NODE *Rnode;
2482 UINT16 StringLength = 0;
2483 UINT32 OptionIndex = 0;
2485 BOOLEAN HasResSourceIndex = FALSE;
2486 UINT8 ResSourceIndex = 0;
2487 UINT8 *ResSourceString = NULL;
2490 InitializerOp = Op->Asl.Child;
2491 StringLength = RsGetStringDataLength (InitializerOp);
2494 /* Make room for the ResourceSourceIndex */
2499 /* Count the interrupt numbers */
2501 for (i = 0; InitializerOp; i++)
2503 InitializerOp = ASL_GET_PEER_NODE (InitializerOp);
2512 InitializerOp = Op->Asl.Child;
2513 Rnode = RsAllocateResourceNode (sizeof (AML_RESOURCE_EXTENDED_IRQ) +
2514 1 + OptionIndex + StringLength);
2516 Descriptor = Rnode->Buffer;
2517 Descriptor->ExtendedIrq.DescriptorType = ACPI_RESOURCE_NAME_EXTENDED_IRQ;
2520 * Initial descriptor length -- may be enlarged if there are
2521 * optional fields present
2523 Descriptor->ExtendedIrq.ResourceLength = 2; /* Flags and table length byte */
2524 Descriptor->ExtendedIrq.InterruptCount = 0;
2526 Rover = ACPI_CAST_PTR (AML_RESOURCE,
2527 (&(Descriptor->ExtendedIrq.Interrupts[0])));
2529 /* Process all child initialization nodes */
2531 for (i = 0; InitializerOp; i++)
2535 case 0: /* Resource Usage (Default: consumer (1) */
2537 RsSetFlagBits (&Descriptor->ExtendedIrq.Flags, InitializerOp, 0, 1);
2540 case 1: /* Interrupt Type (or Mode - edge/level) */
2542 RsSetFlagBits (&Descriptor->ExtendedIrq.Flags, InitializerOp, 1, 0);
2543 RsCreateBitField (InitializerOp, ASL_RESNAME_INTERRUPTTYPE,
2544 CurrentByteOffset + ASL_RESDESC_OFFSET (ExtendedIrq.Flags), 1);
2547 case 2: /* Interrupt Level (or Polarity - Active high/low) */
2549 RsSetFlagBits (&Descriptor->ExtendedIrq.Flags, InitializerOp, 2, 0);
2550 RsCreateBitField (InitializerOp, ASL_RESNAME_INTERRUPTLEVEL,
2551 CurrentByteOffset + ASL_RESDESC_OFFSET (ExtendedIrq.Flags), 2);
2554 case 3: /* Share Type - Default: exclusive (0) */
2556 RsSetFlagBits (&Descriptor->ExtendedIrq.Flags, InitializerOp, 3, 0);
2557 RsCreateBitField (InitializerOp, ASL_RESNAME_INTERRUPTSHARE,
2558 CurrentByteOffset + ASL_RESDESC_OFFSET (ExtendedIrq.Flags), 3);
2561 case 4: /* ResSourceIndex [Optional Field - BYTE] */
2563 if (InitializerOp->Asl.ParseOpcode != PARSEOP_DEFAULT_ARG)
2565 HasResSourceIndex = TRUE;
2566 ResSourceIndex = (UINT8) InitializerOp->Asl.Value.Integer;
2570 case 5: /* ResSource [Optional Field - STRING] */
2572 if ((InitializerOp->Asl.ParseOpcode != PARSEOP_DEFAULT_ARG) &&
2573 (InitializerOp->Asl.Value.String))
2577 ResSourceString = (UINT8 *) InitializerOp->Asl.Value.String;
2580 /* ResourceSourceIndex must also be valid */
2582 if (!HasResSourceIndex)
2584 AslError (ASL_ERROR, ASL_MSG_RESOURCE_INDEX,
2585 InitializerOp, NULL);
2591 * Not a valid ResourceSource, ResourceSourceIndex must also
2594 else if (HasResSourceIndex)
2596 AslError (ASL_ERROR, ASL_MSG_RESOURCE_SOURCE,
2597 InitializerOp, NULL);
2602 case 6: /* ResourceTag */
2604 UtAttachNamepathToOwner (Op, InitializerOp);
2609 * Interrupt Numbers come through here, repeatedly
2612 /* Maximum 255 interrupts allowed for this descriptor */
2614 if (Descriptor->ExtendedIrq.InterruptCount == 255)
2616 AslError (ASL_ERROR, ASL_MSG_EX_INTERRUPT_LIST,
2617 InitializerOp, NULL);
2621 /* Each interrupt number must be a 32-bit value */
2623 if (InitializerOp->Asl.Value.Integer > ACPI_UINT32_MAX)
2625 AslError (ASL_ERROR, ASL_MSG_EX_INTERRUPT_NUMBER,
2626 InitializerOp, NULL);
2629 /* Save the integer and move pointer to the next one */
2631 Rover->U32Item = (UINT32) InitializerOp->Asl.Value.Integer;
2632 Rover = ACPI_PTR_ADD (AML_RESOURCE, &(Rover->U32Item), 4);
2633 Descriptor->ExtendedIrq.InterruptCount++;
2634 Descriptor->ExtendedIrq.ResourceLength += 4;
2636 /* Case 7: First interrupt number in list */
2640 /* Check now for duplicates in list */
2642 RsCheckListForDuplicates (InitializerOp);
2644 /* Create a named field at the start of the list */
2646 RsCreateByteField (InitializerOp, ASL_RESNAME_INTERRUPT,
2648 ASL_RESDESC_OFFSET (ExtendedIrq.Interrupts[0]));
2652 InitializerOp = RsCompleteNodeAndGetNext (InitializerOp);
2656 /* Add optional ResSourceIndex if present */
2658 if (HasResSourceIndex)
2660 Rover->U8Item = ResSourceIndex;
2661 Rover = ACPI_PTR_ADD (AML_RESOURCE, &(Rover->U8Item), 1);
2662 Descriptor->ExtendedIrq.ResourceLength += 1;
2665 /* Add optional ResSource string if present */
2667 if (StringLength && ResSourceString)
2670 strcpy ((char *) Rover, (char *) ResSourceString);
2671 Rover = ACPI_PTR_ADD (
2672 AML_RESOURCE, &(Rover->U8Item), StringLength);
2674 Descriptor->ExtendedIrq.ResourceLength = (UINT16)
2675 (Descriptor->ExtendedIrq.ResourceLength + StringLength);
2678 Rnode->BufferLength = (ASL_RESDESC_OFFSET (ExtendedIrq.Interrupts[0]) -
2679 ASL_RESDESC_OFFSET (ExtendedIrq.DescriptorType))
2680 + OptionIndex + StringLength;
2685 /*******************************************************************************
2687 * FUNCTION: RsDoVendorLargeDescriptor
2689 * PARAMETERS: Op - Parent resource descriptor parse node
2690 * CurrentByteOffset - Offset into the resource template AML
2691 * buffer (to track references to the desc)
2693 * RETURN: Completed resource node
2695 * DESCRIPTION: Construct a long "VendorLong" descriptor
2697 ******************************************************************************/
2700 RsDoVendorLargeDescriptor (
2701 ACPI_PARSE_OBJECT *Op,
2702 UINT32 CurrentByteOffset)
2704 AML_RESOURCE *Descriptor;
2705 ACPI_PARSE_OBJECT *InitializerOp;
2706 ASL_RESOURCE_NODE *Rnode;
2711 /* Count the number of data bytes */
2713 InitializerOp = Op->Asl.Child;
2714 InitializerOp = RsCompleteNodeAndGetNext (InitializerOp);
2716 for (i = 0; InitializerOp; i++)
2718 InitializerOp = InitializerOp->Asl.Next;
2721 InitializerOp = Op->Asl.Child;
2722 InitializerOp = RsCompleteNodeAndGetNext (InitializerOp);
2723 Rnode = RsAllocateResourceNode (sizeof (AML_RESOURCE_VENDOR_LARGE) + i);
2725 Descriptor = Rnode->Buffer;
2726 Descriptor->VendorLarge.DescriptorType = ACPI_RESOURCE_NAME_VENDOR_LARGE;
2727 Descriptor->VendorLarge.ResourceLength = (UINT16) i;
2729 /* Point to end-of-descriptor for vendor data */
2731 VendorData = ((UINT8 *) Descriptor) + sizeof (AML_RESOURCE_LARGE_HEADER);
2733 /* Process all child initialization nodes */
2735 for (i = 0; InitializerOp; i++)
2737 VendorData[i] = (UINT8) InitializerOp->Asl.Value.Integer;
2739 InitializerOp = RsCompleteNodeAndGetNext (InitializerOp);
2746 /*******************************************************************************
2748 * FUNCTION: RsDoGeneralRegisterDescriptor
2750 * PARAMETERS: Op - Parent resource descriptor parse node
2751 * CurrentByteOffset - Offset into the resource template AML
2752 * buffer (to track references to the desc)
2754 * RETURN: Completed resource node
2756 * DESCRIPTION: Construct a long "Register" descriptor
2758 ******************************************************************************/
2761 RsDoGeneralRegisterDescriptor (
2762 ACPI_PARSE_OBJECT *Op,
2763 UINT32 CurrentByteOffset)
2765 AML_RESOURCE *Descriptor;
2766 ACPI_PARSE_OBJECT *InitializerOp;
2767 ASL_RESOURCE_NODE *Rnode;
2771 InitializerOp = Op->Asl.Child;
2772 Rnode = RsAllocateResourceNode (sizeof (AML_RESOURCE_GENERIC_REGISTER));
2774 Descriptor = Rnode->Buffer;
2775 Descriptor->GenericReg.DescriptorType = ACPI_RESOURCE_NAME_GENERIC_REGISTER;
2776 Descriptor->GenericReg.ResourceLength = 12;
2778 /* Process all child initialization nodes */
2780 for (i = 0; InitializerOp; i++)
2784 case 0: /* Address space */
2786 Descriptor->GenericReg.AddressSpaceId = (UINT8) InitializerOp->Asl.Value.Integer;
2787 RsCreateByteField (InitializerOp, ASL_RESNAME_ADDRESSSPACE,
2788 CurrentByteOffset + ASL_RESDESC_OFFSET (GenericReg.AddressSpaceId));
2791 case 1: /* Register Bit Width */
2793 Descriptor->GenericReg.BitWidth = (UINT8) InitializerOp->Asl.Value.Integer;
2794 RsCreateByteField (InitializerOp, ASL_RESNAME_REGISTERBITWIDTH,
2795 CurrentByteOffset + ASL_RESDESC_OFFSET (GenericReg.BitWidth));
2798 case 2: /* Register Bit Offset */
2800 Descriptor->GenericReg.BitOffset = (UINT8) InitializerOp->Asl.Value.Integer;
2801 RsCreateByteField (InitializerOp, ASL_RESNAME_REGISTERBITOFFSET,
2802 CurrentByteOffset + ASL_RESDESC_OFFSET (GenericReg.BitOffset));
2805 case 3: /* Register Address */
2807 Descriptor->GenericReg.Address = InitializerOp->Asl.Value.Integer;
2808 RsCreateByteField (InitializerOp, ASL_RESNAME_ADDRESS,
2809 CurrentByteOffset + ASL_RESDESC_OFFSET (GenericReg.Address));
2812 case 4: /* Access Size (ACPI 3.0) */
2814 Descriptor->GenericReg.AccessSize = (UINT8) InitializerOp->Asl.Value.Integer;
2815 RsCreateByteField (InitializerOp, ASL_RESNAME_ACCESSSIZE,
2816 CurrentByteOffset + ASL_RESDESC_OFFSET (GenericReg.AccessSize));
2821 AslError (ASL_ERROR, ASL_MSG_RESOURCE_LIST, InitializerOp, NULL);
2825 InitializerOp = RsCompleteNodeAndGetNext (InitializerOp);