2 /******************************************************************************
4 * Module Name: aslrestype1 - Short (type1) 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 "aslcompiler.h"
120 #include "aslcompiler.y.h"
122 #define _COMPONENT ACPI_COMPILER
123 ACPI_MODULE_NAME ("aslrestype1")
126 /*******************************************************************************
128 * FUNCTION: RsDoDmaDescriptor
130 * PARAMETERS: Op - Parent resource descriptor parse node
131 * CurrentByteOffset - Offset into the resource template AML
132 * buffer (to track references to the desc)
134 * RETURN: Completed resource node
136 * DESCRIPTION: Construct a short "DMA" descriptor
138 ******************************************************************************/
142 ACPI_PARSE_OBJECT *Op,
143 UINT32 CurrentByteOffset)
145 ASL_RESOURCE_DESC *Descriptor;
146 ACPI_PARSE_OBJECT *InitializerOp;
147 ASL_RESOURCE_NODE *Rnode;
149 UINT8 DmaChannelMask = 0;
150 UINT8 DmaChannels = 0;
153 InitializerOp = Op->Asl.Child;
154 Rnode = RsAllocateResourceNode (sizeof (ASL_DMA_FORMAT_DESC));
156 Descriptor = Rnode->Buffer;
157 Descriptor->Dma.DescriptorType = ACPI_RDESC_TYPE_DMA_FORMAT |
161 * Process all child initialization nodes
163 for (i = 0; InitializerOp; i++)
167 case 0: /* DMA type */
169 RsSetFlagBits (&Descriptor->Dma.Flags, InitializerOp, 5, 0);
170 RsCreateBitField (InitializerOp, ASL_RESNAME_DMATYPE,
171 CurrentByteOffset + ASL_RESDESC_OFFSET (Dma.Flags), 5);
174 case 1: /* Bus Master */
176 RsSetFlagBits (&Descriptor->Dma.Flags, InitializerOp, 2, 0);
177 RsCreateBitField (InitializerOp, ASL_RESNAME_BUSMASTER,
178 CurrentByteOffset + ASL_RESDESC_OFFSET (Dma.Flags), 2);
181 case 2: /* Xfer Type (transfer width) */
183 RsSetFlagBits (&Descriptor->Dma.Flags, InitializerOp, 0, 0);
184 RsCreateBitField (InitializerOp, ASL_RESNAME_XFERTYPE,
185 CurrentByteOffset + ASL_RESDESC_OFFSET (Dma.Flags), 0);
190 UtAttachNamepathToOwner (Op, InitializerOp);
195 /* All DMA channel bytes are handled here, after the flags and name */
197 if (InitializerOp->Asl.ParseOpcode != PARSEOP_DEFAULT_ARG)
199 /* Up to 8 channels can be specified in the list */
204 AslError (ASL_ERROR, ASL_MSG_DMA_LIST, InitializerOp, NULL);
208 /* Only DMA channels 0-7 are allowed (mask is 8 bits) */
210 if (InitializerOp->Asl.Value.Integer > 7)
212 AslError (ASL_ERROR, ASL_MSG_DMA_CHANNEL, InitializerOp, NULL);
217 DmaChannelMask |= (1 << ((UINT8) InitializerOp->Asl.Value.Integer));
220 if (i == 4) /* case 4: First DMA byte */
222 RsCreateByteField (InitializerOp, ASL_RESNAME_DMA,
223 CurrentByteOffset + ASL_RESDESC_OFFSET (Dma.DmaChannelMask));
228 InitializerOp = RsCompleteNodeAndGetNext (InitializerOp);
231 /* Now we can set the channel mask */
233 Descriptor->Dma.DmaChannelMask = DmaChannelMask;
238 /*******************************************************************************
240 * FUNCTION: RsDoEndDependentDescriptor
242 * PARAMETERS: Op - Parent resource descriptor parse node
243 * CurrentByteOffset - Offset into the resource template AML
244 * buffer (to track references to the desc)
246 * RETURN: Completed resource node
248 * DESCRIPTION: Construct a short "EndDependentFn" descriptor
250 ******************************************************************************/
253 RsDoEndDependentDescriptor (
254 ACPI_PARSE_OBJECT *Op,
255 UINT32 CurrentByteOffset)
257 ASL_RESOURCE_DESC *Descriptor;
258 ASL_RESOURCE_NODE *Rnode;
261 Rnode = RsAllocateResourceNode (sizeof (ASL_END_DEPENDENT_DESC));
263 Descriptor = Rnode->Buffer;
264 Descriptor->End.DescriptorType = ACPI_RDESC_TYPE_END_DEPENDENT |
265 ASL_RDESC_END_DEPEND_SIZE;
270 /*******************************************************************************
272 * FUNCTION: RsDoFixedIoDescriptor
274 * PARAMETERS: Op - Parent resource descriptor parse node
275 * CurrentByteOffset - Offset into the resource template AML
276 * buffer (to track references to the desc)
278 * RETURN: Completed resource node
280 * DESCRIPTION: Construct a short "FixedIO" descriptor
282 ******************************************************************************/
285 RsDoFixedIoDescriptor (
286 ACPI_PARSE_OBJECT *Op,
287 UINT32 CurrentByteOffset)
289 ASL_RESOURCE_DESC *Descriptor;
290 ACPI_PARSE_OBJECT *InitializerOp;
291 ASL_RESOURCE_NODE *Rnode;
295 InitializerOp = Op->Asl.Child;
296 Rnode = RsAllocateResourceNode (sizeof (ASL_FIXED_IO_PORT_DESC));
298 Descriptor = Rnode->Buffer;
299 Descriptor->Iop.DescriptorType = ACPI_RDESC_TYPE_FIXED_IO_PORT |
300 ASL_RDESC_FIXED_IO_SIZE;
303 * Process all child initialization nodes
305 for (i = 0; InitializerOp; i++)
309 case 0: /* Base Address */
311 Descriptor->Fio.BaseAddress = (UINT16) InitializerOp->Asl.Value.Integer;
312 RsCreateByteField (InitializerOp, ASL_RESNAME_BASEADDRESS,
313 CurrentByteOffset + ASL_RESDESC_OFFSET (Fio.BaseAddress));
318 Descriptor->Fio.Length = (UINT8) InitializerOp->Asl.Value.Integer;
319 RsCreateByteField (InitializerOp, ASL_RESNAME_LENGTH,
320 CurrentByteOffset + ASL_RESDESC_OFFSET (Fio.Length));
325 UtAttachNamepathToOwner (Op, InitializerOp);
330 AslError (ASL_ERROR, ASL_MSG_RESOURCE_LIST, InitializerOp, NULL);
334 InitializerOp = RsCompleteNodeAndGetNext (InitializerOp);
341 /*******************************************************************************
343 * FUNCTION: RsDoIoDescriptor
345 * PARAMETERS: Op - Parent resource descriptor parse node
346 * CurrentByteOffset - Offset into the resource template AML
347 * buffer (to track references to the desc)
349 * RETURN: Completed resource node
351 * DESCRIPTION: Construct a short "IO" descriptor
353 ******************************************************************************/
357 ACPI_PARSE_OBJECT *Op,
358 UINT32 CurrentByteOffset)
360 ASL_RESOURCE_DESC *Descriptor;
361 ACPI_PARSE_OBJECT *InitializerOp;
362 ASL_RESOURCE_NODE *Rnode;
366 InitializerOp = Op->Asl.Child;
367 Rnode = RsAllocateResourceNode (sizeof (ASL_IO_PORT_DESC));
369 Descriptor = Rnode->Buffer;
370 Descriptor->Iop.DescriptorType = ACPI_RDESC_TYPE_IO_PORT |
374 * Process all child initialization nodes
376 for (i = 0; InitializerOp; i++)
380 case 0: /* Decode size */
382 RsSetFlagBits (&Descriptor->Iop.Information, InitializerOp, 0, 1);
383 RsCreateBitField (InitializerOp, ASL_RESNAME_DECODE,
384 CurrentByteOffset + ASL_RESDESC_OFFSET (Iop.Information), 0);
387 case 1: /* Min Address */
389 Descriptor->Iop.AddressMin = (UINT16) InitializerOp->Asl.Value.Integer;
390 RsCreateByteField (InitializerOp, ASL_RESNAME_MINADDR,
391 CurrentByteOffset + ASL_RESDESC_OFFSET (Iop.AddressMin));
394 case 2: /* Max Address */
396 Descriptor->Iop.AddressMax = (UINT16) InitializerOp->Asl.Value.Integer;
397 RsCreateByteField (InitializerOp, ASL_RESNAME_MAXADDR,
398 CurrentByteOffset + ASL_RESDESC_OFFSET (Iop.AddressMax));
401 case 3: /* Alignment */
403 Descriptor->Iop.Alignment = (UINT8) InitializerOp->Asl.Value.Integer;
404 RsCreateByteField (InitializerOp, ASL_RESNAME_ALIGNMENT,
405 CurrentByteOffset + ASL_RESDESC_OFFSET (Iop.Alignment));
410 Descriptor->Iop.Length = (UINT8) InitializerOp->Asl.Value.Integer;
411 RsCreateByteField (InitializerOp, ASL_RESNAME_LENGTH,
412 CurrentByteOffset + ASL_RESDESC_OFFSET (Iop.Length));
417 UtAttachNamepathToOwner (Op, InitializerOp);
422 AslError (ASL_ERROR, ASL_MSG_RESOURCE_LIST, InitializerOp, NULL);
426 InitializerOp = RsCompleteNodeAndGetNext (InitializerOp);
433 /*******************************************************************************
435 * FUNCTION: RsDoIrqDescriptor
437 * PARAMETERS: Op - Parent resource descriptor parse node
438 * CurrentByteOffset - Offset into the resource template AML
439 * buffer (to track references to the desc)
441 * RETURN: Completed resource node
443 * DESCRIPTION: Construct a short "IRQ" descriptor
445 ******************************************************************************/
449 ACPI_PARSE_OBJECT *Op,
450 UINT32 CurrentByteOffset)
452 ASL_RESOURCE_DESC *Descriptor;
453 ACPI_PARSE_OBJECT *InitializerOp;
454 ASL_RESOURCE_NODE *Rnode;
459 InitializerOp = Op->Asl.Child;
460 Rnode = RsAllocateResourceNode (sizeof (ASL_IRQ_FORMAT_DESC));
462 /* Length = 3 (with flag byte) */
464 Descriptor = Rnode->Buffer;
465 Descriptor->Irq.DescriptorType = ACPI_RDESC_TYPE_IRQ_FORMAT |
466 (ASL_RDESC_IRQ_SIZE + 0x01);
469 * Process all child initialization nodes
471 for (i = 0; InitializerOp; i++)
475 case 0: /* Interrupt Type (or Mode - edge/level) */
477 RsSetFlagBits (&Descriptor->Irq.Flags, InitializerOp, 0, 1);
478 RsCreateBitField (InitializerOp, ASL_RESNAME_INTERRUPTTYPE,
479 CurrentByteOffset + ASL_RESDESC_OFFSET (Irq.Flags), 0);
482 case 1: /* Interrupt Level (or Polarity - Active high/low) */
484 RsSetFlagBits (&Descriptor->Irq.Flags, InitializerOp, 3, 0);
485 RsCreateBitField (InitializerOp, ASL_RESNAME_INTERRUPTLEVEL,
486 CurrentByteOffset + ASL_RESDESC_OFFSET (Irq.Flags), 3);
489 case 2: /* Share Type - Default: exclusive (0) */
491 RsSetFlagBits (&Descriptor->Irq.Flags, InitializerOp, 4, 0);
492 RsCreateBitField (InitializerOp, ASL_RESNAME_INTERRUPTSHARE,
493 CurrentByteOffset + ASL_RESDESC_OFFSET (Irq.Flags), 4);
498 UtAttachNamepathToOwner (Op, InitializerOp);
503 /* All IRQ bytes are handled here, after the flags and name */
505 if (InitializerOp->Asl.ParseOpcode != PARSEOP_DEFAULT_ARG)
507 IrqMask |= (1 << (UINT8) InitializerOp->Asl.Value.Integer);
510 if (i == 4) /* case 4: First IRQ byte */
512 RsCreateByteField (InitializerOp, ASL_RESNAME_INTERRUPT,
513 CurrentByteOffset + ASL_RESDESC_OFFSET (Irq.IrqMask));
518 InitializerOp = RsCompleteNodeAndGetNext (InitializerOp);
521 /* Now we can set the channel mask */
523 Descriptor->Irq.IrqMask = IrqMask;
528 /*******************************************************************************
530 * FUNCTION: RsDoIrqNoFlagsDescriptor
532 * PARAMETERS: Op - Parent resource descriptor parse node
533 * CurrentByteOffset - Offset into the resource template AML
534 * buffer (to track references to the desc)
536 * RETURN: Completed resource node
538 * DESCRIPTION: Construct a short "IRQNoFlags" descriptor
540 ******************************************************************************/
543 RsDoIrqNoFlagsDescriptor (
544 ACPI_PARSE_OBJECT *Op,
545 UINT32 CurrentByteOffset)
547 ASL_RESOURCE_DESC *Descriptor;
548 ACPI_PARSE_OBJECT *InitializerOp;
549 ASL_RESOURCE_NODE *Rnode;
554 InitializerOp = Op->Asl.Child;
555 Rnode = RsAllocateResourceNode (sizeof (ASL_IRQ_NOFLAGS_DESC));
557 Descriptor = Rnode->Buffer;
558 Descriptor->Irq.DescriptorType = ACPI_RDESC_TYPE_IRQ_FORMAT |
562 * Process all child initialization nodes
564 for (i = 0; InitializerOp; i++)
570 UtAttachNamepathToOwner (Op, InitializerOp);
575 /* IRQ bytes are handled here, after the flags and name */
577 if (InitializerOp->Asl.ParseOpcode != PARSEOP_DEFAULT_ARG)
579 IrqMask |= (1 << ((UINT8) InitializerOp->Asl.Value.Integer));
582 if (i == 1) /* case 1: First IRQ byte */
584 RsCreateByteField (InitializerOp, ASL_RESNAME_INTERRUPT,
585 CurrentByteOffset + ASL_RESDESC_OFFSET (Irq.IrqMask));
590 InitializerOp = RsCompleteNodeAndGetNext (InitializerOp);
593 /* Now we can set the interrupt mask */
595 Descriptor->Irq.IrqMask = IrqMask;
600 /*******************************************************************************
602 * FUNCTION: RsDoMemory24Descriptor
604 * PARAMETERS: Op - Parent resource descriptor parse node
605 * CurrentByteOffset - Offset into the resource template AML
606 * buffer (to track references to the desc)
608 * RETURN: Completed resource node
610 * DESCRIPTION: Construct a short "Memory24" descriptor
612 ******************************************************************************/
615 RsDoMemory24Descriptor (
616 ACPI_PARSE_OBJECT *Op,
617 UINT32 CurrentByteOffset)
619 ASL_RESOURCE_DESC *Descriptor;
620 ACPI_PARSE_OBJECT *InitializerOp;
621 ASL_RESOURCE_NODE *Rnode;
625 InitializerOp = Op->Asl.Child;
626 Rnode = RsAllocateResourceNode (sizeof (ASL_MEMORY_24_DESC));
628 Descriptor = Rnode->Buffer;
629 Descriptor->M24.DescriptorType = ACPI_RDESC_TYPE_MEMORY_24;
630 Descriptor->M24.Length = 9;
633 * Process all child initialization nodes
635 for (i = 0; InitializerOp; i++)
639 case 0: /* Read/Write type */
641 RsSetFlagBits (&Descriptor->M24.Information, InitializerOp, 0, 1);
642 RsCreateBitField (InitializerOp, ASL_RESNAME_READWRITETYPE,
643 CurrentByteOffset + ASL_RESDESC_OFFSET (M24.Information), 0);
646 case 1: /* Min Address */
648 Descriptor->M24.AddressMin = (UINT16) InitializerOp->Asl.Value.Integer;
649 RsCreateByteField (InitializerOp, ASL_RESNAME_MINADDR,
650 CurrentByteOffset + ASL_RESDESC_OFFSET (M24.AddressMin));
653 case 2: /* Max Address */
655 Descriptor->M24.AddressMax = (UINT16) InitializerOp->Asl.Value.Integer;
656 RsCreateByteField (InitializerOp, ASL_RESNAME_MAXADDR,
657 CurrentByteOffset + ASL_RESDESC_OFFSET (M24.AddressMax));
660 case 3: /* Alignment */
662 Descriptor->M24.Alignment = (UINT16) InitializerOp->Asl.Value.Integer;
663 RsCreateByteField (InitializerOp, ASL_RESNAME_ALIGNMENT,
664 CurrentByteOffset + ASL_RESDESC_OFFSET (M24.Alignment));
669 Descriptor->M24.RangeLength = (UINT16) InitializerOp->Asl.Value.Integer;
670 RsCreateByteField (InitializerOp, ASL_RESNAME_LENGTH,
671 CurrentByteOffset + ASL_RESDESC_OFFSET (M24.RangeLength));
676 UtAttachNamepathToOwner (Op, InitializerOp);
681 AslError (ASL_ERROR, ASL_MSG_RESOURCE_LIST, InitializerOp, NULL);
685 InitializerOp = RsCompleteNodeAndGetNext (InitializerOp);
692 /*******************************************************************************
694 * FUNCTION: RsDoMemory32Descriptor
696 * PARAMETERS: Op - Parent resource descriptor parse node
697 * CurrentByteOffset - Offset into the resource template AML
698 * buffer (to track references to the desc)
700 * RETURN: Completed resource node
702 * DESCRIPTION: Construct a short "Memory32" descriptor
704 ******************************************************************************/
707 RsDoMemory32Descriptor (
708 ACPI_PARSE_OBJECT *Op,
709 UINT32 CurrentByteOffset)
711 ASL_RESOURCE_DESC *Descriptor;
712 ACPI_PARSE_OBJECT *InitializerOp;
713 ASL_RESOURCE_NODE *Rnode;
717 InitializerOp = Op->Asl.Child;
718 Rnode = RsAllocateResourceNode (sizeof (ASL_MEMORY_32_DESC));
720 Descriptor = Rnode->Buffer;
721 Descriptor->M32.DescriptorType = ACPI_RDESC_TYPE_MEMORY_32;
722 Descriptor->M32.Length = 17;
725 * Process all child initialization nodes
727 for (i = 0; InitializerOp; i++)
731 case 0: /* Read/Write type */
733 RsSetFlagBits (&Descriptor->M32.Information, InitializerOp, 0, 1);
734 RsCreateBitField (InitializerOp, ASL_RESNAME_READWRITETYPE,
735 CurrentByteOffset + ASL_RESDESC_OFFSET (M32.Information), 0);
738 case 1: /* Min Address */
740 Descriptor->M32.AddressMin = (UINT32) InitializerOp->Asl.Value.Integer;
741 RsCreateByteField (InitializerOp, ASL_RESNAME_MINADDR,
742 CurrentByteOffset + ASL_RESDESC_OFFSET (M32.AddressMin));
745 case 2: /* Max Address */
747 Descriptor->M32.AddressMax = (UINT32) InitializerOp->Asl.Value.Integer;
748 RsCreateByteField (InitializerOp, ASL_RESNAME_MAXADDR,
749 CurrentByteOffset + ASL_RESDESC_OFFSET (M32.AddressMax));
752 case 3: /* Alignment */
754 Descriptor->M32.Alignment = (UINT32) InitializerOp->Asl.Value.Integer;
755 RsCreateByteField (InitializerOp, ASL_RESNAME_ALIGNMENT,
756 CurrentByteOffset + ASL_RESDESC_OFFSET (M32.Alignment));
761 Descriptor->M32.RangeLength = (UINT32) InitializerOp->Asl.Value.Integer;
762 RsCreateByteField (InitializerOp, ASL_RESNAME_LENGTH,
763 CurrentByteOffset + ASL_RESDESC_OFFSET (M32.RangeLength));
768 UtAttachNamepathToOwner (Op, InitializerOp);
773 AslError (ASL_ERROR, ASL_MSG_RESOURCE_LIST, InitializerOp, NULL);
777 InitializerOp = RsCompleteNodeAndGetNext (InitializerOp);
784 /*******************************************************************************
786 * FUNCTION: RsDoMemory32FixedDescriptor
788 * PARAMETERS: Op - Parent resource descriptor parse node
789 * CurrentByteOffset - Offset into the resource template AML
790 * buffer (to track references to the desc)
792 * RETURN: Completed resource node
794 * DESCRIPTION: Construct a short "Memory32Fixed" descriptor
796 ******************************************************************************/
799 RsDoMemory32FixedDescriptor (
800 ACPI_PARSE_OBJECT *Op,
801 UINT32 CurrentByteOffset)
803 ASL_RESOURCE_DESC *Descriptor;
804 ACPI_PARSE_OBJECT *InitializerOp;
805 ASL_RESOURCE_NODE *Rnode;
809 InitializerOp = Op->Asl.Child;
810 Rnode = RsAllocateResourceNode (sizeof (ASL_FIXED_MEMORY_32_DESC));
812 Descriptor = Rnode->Buffer;
813 Descriptor->F32.DescriptorType = ACPI_RDESC_TYPE_FIXED_MEMORY_32;
814 Descriptor->F32.Length = 9;
817 * Process all child initialization nodes
819 for (i = 0; InitializerOp; i++)
823 case 0: /* Read/Write type */
825 RsSetFlagBits (&Descriptor->F32.Information, InitializerOp, 0, 1);
826 RsCreateBitField (InitializerOp, ASL_RESNAME_READWRITETYPE,
827 CurrentByteOffset + ASL_RESDESC_OFFSET (F32.Information), 0);
830 case 1: /* Address */
832 Descriptor->F32.BaseAddress = (UINT32) InitializerOp->Asl.Value.Integer;
833 RsCreateByteField (InitializerOp, ASL_RESNAME_BASEADDRESS,
834 CurrentByteOffset + ASL_RESDESC_OFFSET (F32.BaseAddress));
839 Descriptor->F32.RangeLength = (UINT32) InitializerOp->Asl.Value.Integer;
840 RsCreateByteField (InitializerOp, ASL_RESNAME_LENGTH,
841 CurrentByteOffset + ASL_RESDESC_OFFSET (F32.RangeLength));
846 UtAttachNamepathToOwner (Op, InitializerOp);
851 AslError (ASL_ERROR, ASL_MSG_RESOURCE_LIST, InitializerOp, NULL);
855 InitializerOp = RsCompleteNodeAndGetNext (InitializerOp);
862 /*******************************************************************************
864 * FUNCTION: RsDoStartDependentDescriptor
866 * PARAMETERS: Op - Parent resource descriptor parse node
867 * CurrentByteOffset - Offset into the resource template AML
868 * buffer (to track references to the desc)
870 * RETURN: Completed resource node
872 * DESCRIPTION: Construct a short "StartDependentFn" descriptor
874 ******************************************************************************/
877 RsDoStartDependentDescriptor (
878 ACPI_PARSE_OBJECT *Op,
879 UINT32 CurrentByteOffset)
881 ASL_RESOURCE_DESC *Descriptor;
882 ACPI_PARSE_OBJECT *InitializerOp;
883 ASL_RESOURCE_NODE *Rnode;
884 ASL_RESOURCE_NODE *PreviousRnode;
885 ASL_RESOURCE_NODE *NextRnode;
890 InitializerOp = Op->Asl.Child;
891 Rnode = RsAllocateResourceNode (sizeof (ASL_START_DEPENDENT_DESC));
893 PreviousRnode = Rnode;
894 Descriptor = Rnode->Buffer;
896 /* Descriptor has priority byte */
898 Descriptor->Std.DescriptorType = ACPI_RDESC_TYPE_START_DEPENDENT |
899 (ASL_RDESC_ST_DEPEND_SIZE + 0x01);
902 * Process all child initialization nodes
904 State = ACPI_RSTATE_START_DEPENDENT;
905 for (i = 0; InitializerOp; i++)
909 case 0: /* Compatibility Priority */
911 if ((UINT8) InitializerOp->Asl.Value.Integer > 2)
913 AslError (ASL_ERROR, ASL_MSG_INVALID_PRIORITY, InitializerOp, NULL);
916 RsSetFlagBits (&Descriptor->Std.Flags, InitializerOp, 0, 0);
919 case 1: /* Performance/Robustness Priority */
921 if ((UINT8) InitializerOp->Asl.Value.Integer > 2)
923 AslError (ASL_ERROR, ASL_MSG_INVALID_PERFORMANCE, InitializerOp, NULL);
926 RsSetFlagBits (&Descriptor->Std.Flags, InitializerOp, 2, 0);
930 NextRnode = RsDoOneResourceDescriptor (InitializerOp, CurrentByteOffset, &State);
933 * Update current byte offset to indicate the number of bytes from the
934 * start of the buffer. Buffer can include multiple descriptors, we
935 * must keep track of the offset of not only each descriptor, but each
936 * element (field) within each descriptor as well.
939 CurrentByteOffset += RsLinkDescriptorChain (&PreviousRnode, NextRnode);
943 InitializerOp = RsCompleteNodeAndGetNext (InitializerOp);
950 /*******************************************************************************
952 * FUNCTION: RsDoStartDependentNoPriDescriptor
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 short "StartDependentNoPri" descriptor
962 ******************************************************************************/
965 RsDoStartDependentNoPriDescriptor (
966 ACPI_PARSE_OBJECT *Op,
967 UINT32 CurrentByteOffset)
969 ASL_RESOURCE_DESC *Descriptor;
970 ACPI_PARSE_OBJECT *InitializerOp;
971 ASL_RESOURCE_NODE *Rnode;
972 ASL_RESOURCE_NODE *PreviousRnode;
973 ASL_RESOURCE_NODE *NextRnode;
977 InitializerOp = Op->Asl.Child;
978 Rnode = RsAllocateResourceNode (sizeof (ASL_START_DEPENDENT_NOPRIO_DESC));
980 Descriptor = Rnode->Buffer;
981 Descriptor->Std.DescriptorType = ACPI_RDESC_TYPE_START_DEPENDENT |
982 ASL_RDESC_ST_DEPEND_SIZE;
983 PreviousRnode = Rnode;
986 * Process all child initialization nodes
988 State = ACPI_RSTATE_START_DEPENDENT;
989 while (InitializerOp)
991 NextRnode = RsDoOneResourceDescriptor (InitializerOp, CurrentByteOffset, &State);
994 * Update current byte offset to indicate the number of bytes from the
995 * start of the buffer. Buffer can include multiple descriptors, we
996 * must keep track of the offset of not only each descriptor, but each
997 * element (field) within each descriptor as well.
1000 CurrentByteOffset += RsLinkDescriptorChain (&PreviousRnode, NextRnode);
1002 InitializerOp = RsCompleteNodeAndGetNext (InitializerOp);
1009 /*******************************************************************************
1011 * FUNCTION: RsDoVendorSmallDescriptor
1013 * PARAMETERS: Op - Parent resource descriptor parse node
1014 * CurrentByteOffset - Offset into the resource template AML
1015 * buffer (to track references to the desc)
1017 * RETURN: Completed resource node
1019 * DESCRIPTION: Construct a short "VendorShort" descriptor
1021 ******************************************************************************/
1024 RsDoVendorSmallDescriptor (
1025 ACPI_PARSE_OBJECT *Op,
1026 UINT32 CurrentByteOffset)
1028 ASL_RESOURCE_DESC *Descriptor;
1029 ACPI_PARSE_OBJECT *InitializerOp;
1030 ASL_RESOURCE_NODE *Rnode;
1034 InitializerOp = Op->Asl.Child;
1035 Rnode = RsAllocateResourceNode (sizeof (ASL_SMALL_VENDOR_DESC));
1037 Descriptor = Rnode->Buffer;
1038 Descriptor->Smv.DescriptorType = ACPI_RDESC_TYPE_SMALL_VENDOR;
1041 * Process all child initialization nodes
1043 InitializerOp = RsCompleteNodeAndGetNext (InitializerOp);
1044 for (i = 0; InitializerOp; i++)
1046 /* Maximum 7 vendor data bytes allowed (0-6) */
1050 AslError (ASL_ERROR, ASL_MSG_VENDOR_LIST, InitializerOp, NULL);
1052 /* Eat the excess initializers */
1054 while (InitializerOp)
1056 InitializerOp = RsCompleteNodeAndGetNext (InitializerOp);
1061 Descriptor->Smv.VendorDefined[i] = (UINT8) InitializerOp->Asl.Value.Integer;
1062 InitializerOp = RsCompleteNodeAndGetNext (InitializerOp);
1065 /* Adjust the Rnode buffer size, so correct number of bytes are emitted */
1067 Rnode->BufferLength -= (7 - i);
1069 /* Set the length in the Type Tag */
1071 Descriptor->Smv.DescriptorType |= (UINT8) i;