]> rtime.felk.cvut.cz Git - l4.git/blob - l4/pkg/acpica/lib-acpi/src/acpica/compiler/aslrestype2e.c
update
[l4.git] / l4 / pkg / acpica / lib-acpi / src / acpica / compiler / aslrestype2e.c
1 /******************************************************************************
2  *
3  * Module Name: aslrestype2e - Large Extended address resource descriptors
4  *
5  *****************************************************************************/
6
7 /******************************************************************************
8  *
9  * 1. Copyright Notice
10  *
11  * Some or all of this work - Copyright (c) 1999 - 2012, Intel Corp.
12  * All rights reserved.
13  *
14  * 2. License
15  *
16  * 2.1. This is your license from Intel Corp. under its intellectual property
17  * rights. You may have additional license terms from the party that provided
18  * you this software, covering your right to use that party's intellectual
19  * property rights.
20  *
21  * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
22  * copy of the source code appearing in this file ("Covered Code") an
23  * irrevocable, perpetual, worldwide license under Intel's copyrights in the
24  * base code distributed originally by Intel ("Original Intel Code") to copy,
25  * make derivatives, distribute, use and display any portion of the Covered
26  * Code in any form, with the right to sublicense such rights; and
27  *
28  * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
29  * license (with the right to sublicense), under only those claims of Intel
30  * patents that are infringed by the Original Intel Code, to make, use, sell,
31  * offer to sell, and import the Covered Code and derivative works thereof
32  * solely to the minimum extent necessary to exercise the above copyright
33  * license, and in no event shall the patent license extend to any additions
34  * to or modifications of the Original Intel Code. No other license or right
35  * is granted directly or by implication, estoppel or otherwise;
36  *
37  * The above copyright and patent license is granted only if the following
38  * conditions are met:
39  *
40  * 3. Conditions
41  *
42  * 3.1. Redistribution of Source with Rights to Further Distribute Source.
43  * Redistribution of source code of any substantial portion of the Covered
44  * Code or modification with rights to further distribute source must include
45  * the above Copyright Notice, the above License, this list of Conditions,
46  * and the following Disclaimer and Export Compliance provision. In addition,
47  * Licensee must cause all Covered Code to which Licensee contributes to
48  * contain a file documenting the changes Licensee made to create that Covered
49  * Code and the date of any change. Licensee must include in that file the
50  * documentation of any changes made by any predecessor Licensee. Licensee
51  * must include a prominent statement that the modification is derived,
52  * directly or indirectly, from Original Intel Code.
53  *
54  * 3.2. Redistribution of Source with no Rights to Further Distribute Source.
55  * Redistribution of source code of any substantial portion of the Covered
56  * Code or modification without rights to further distribute source must
57  * include the following Disclaimer and Export Compliance provision in the
58  * documentation and/or other materials provided with distribution. In
59  * addition, Licensee may not authorize further sublicense of source of any
60  * portion of the Covered Code, and must include terms to the effect that the
61  * license from Licensee to its licensee is limited to the intellectual
62  * property embodied in the software Licensee provides to its licensee, and
63  * not to intellectual property embodied in modifications its licensee may
64  * make.
65  *
66  * 3.3. Redistribution of Executable. Redistribution in executable form of any
67  * substantial portion of the Covered Code or modification must reproduce the
68  * above Copyright Notice, and the following Disclaimer and Export Compliance
69  * provision in the documentation and/or other materials provided with the
70  * distribution.
71  *
72  * 3.4. Intel retains all right, title, and interest in and to the Original
73  * Intel Code.
74  *
75  * 3.5. Neither the name Intel nor any other trademark owned or controlled by
76  * Intel shall be used in advertising or otherwise to promote the sale, use or
77  * other dealings in products derived from or relating to the Covered Code
78  * without prior written authorization from Intel.
79  *
80  * 4. Disclaimer and Export Compliance
81  *
82  * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
83  * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
84  * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
85  * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
86  * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
87  * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
88  * PARTICULAR PURPOSE.
89  *
90  * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
91  * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
92  * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
93  * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
94  * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
95  * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
96  * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
97  * LIMITED REMEDY.
98  *
99  * 4.3. Licensee shall not export, either directly or indirectly, any of this
100  * software or system incorporating such software without first obtaining any
101  * required license or other approval from the U. S. Department of Commerce or
102  * any other agency or department of the United States Government. In the
103  * event Licensee exports any such software from the United States or
104  * re-exports any such software from a foreign destination, Licensee shall
105  * ensure that the distribution and export/re-export of the software is in
106  * compliance with all laws, regulations, orders, or other restrictions of the
107  * U.S. Export Administration Regulations. Licensee agrees that neither it nor
108  * any of its subsidiaries will export/re-export any technical data, process,
109  * software, or service, directly or indirectly, to any country for which the
110  * United States government or any agency thereof requires an export license,
111  * other governmental approval, or letter of assurance, without first obtaining
112  * such license, approval or letter.
113  *
114  *****************************************************************************/
115
116
117 #include "aslcompiler.h"
118
119 #define _COMPONENT          ACPI_COMPILER
120         ACPI_MODULE_NAME    ("aslrestype2e")
121
122 /*
123  * This module contains the Extended (64-bit) address space descriptors:
124  *
125  * ExtendedIO
126  * ExtendedMemory
127  * ExtendedSpace
128  */
129
130 /*******************************************************************************
131  *
132  * FUNCTION:    RsDoExtendedIoDescriptor
133  *
134  * PARAMETERS:  Op                  - Parent resource descriptor parse node
135  *              CurrentByteOffset   - Offset into the resource template AML
136  *                                    buffer (to track references to the desc)
137  *
138  * RETURN:      Completed resource node
139  *
140  * DESCRIPTION: Construct a long "ExtendedIO" descriptor
141  *
142  ******************************************************************************/
143
144 ASL_RESOURCE_NODE *
145 RsDoExtendedIoDescriptor (
146     ACPI_PARSE_OBJECT       *Op,
147     UINT32                  CurrentByteOffset)
148 {
149     AML_RESOURCE            *Descriptor;
150     ACPI_PARSE_OBJECT       *InitializerOp;
151     ACPI_PARSE_OBJECT       *MinOp = NULL;
152     ACPI_PARSE_OBJECT       *MaxOp = NULL;
153     ACPI_PARSE_OBJECT       *LengthOp = NULL;
154     ACPI_PARSE_OBJECT       *GranOp = NULL;
155     ASL_RESOURCE_NODE       *Rnode;
156     UINT16                  StringLength = 0;
157     UINT32                  i;
158
159
160     InitializerOp = Op->Asl.Child;
161     StringLength = RsGetStringDataLength (InitializerOp);
162
163     Rnode = RsAllocateResourceNode (
164                 sizeof (AML_RESOURCE_EXTENDED_ADDRESS64) + 1 + StringLength);
165
166     Descriptor = Rnode->Buffer;
167     Descriptor->ExtAddress64.DescriptorType  = ACPI_RESOURCE_NAME_EXTENDED_ADDRESS64;
168     Descriptor->ExtAddress64.ResourceType    = ACPI_ADDRESS_TYPE_IO_RANGE;
169     Descriptor->ExtAddress64.RevisionID      = AML_RESOURCE_EXTENDED_ADDRESS_REVISION;
170
171     Descriptor->ExtAddress64.ResourceLength  = (UINT16)
172         (sizeof (AML_RESOURCE_EXTENDED_ADDRESS64) -
173          sizeof (AML_RESOURCE_LARGE_HEADER));
174
175     /* Process all child initialization nodes */
176
177     for (i = 0; InitializerOp; i++)
178     {
179         switch (i)
180         {
181         case 0: /* Resource Usage */
182
183             RsSetFlagBits (&Descriptor->ExtAddress64.Flags, InitializerOp, 0, 1);
184             break;
185
186         case 1: /* MinType */
187
188             RsSetFlagBits (&Descriptor->ExtAddress64.Flags, InitializerOp, 2, 0);
189             RsCreateBitField (InitializerOp, ACPI_RESTAG_MINTYPE,
190                 CurrentByteOffset + ASL_RESDESC_OFFSET (ExtAddress64.Flags), 2);
191             break;
192
193         case 2: /* MaxType */
194
195             RsSetFlagBits (&Descriptor->ExtAddress64.Flags, InitializerOp, 3, 0);
196             RsCreateBitField (InitializerOp, ACPI_RESTAG_MAXTYPE,
197                 CurrentByteOffset + ASL_RESDESC_OFFSET (ExtAddress64.Flags), 3);
198             break;
199
200         case 3: /* DecodeType */
201
202             RsSetFlagBits (&Descriptor->ExtAddress64.Flags, InitializerOp, 1, 0);
203             RsCreateBitField (InitializerOp, ACPI_RESTAG_DECODE,
204                 CurrentByteOffset + ASL_RESDESC_OFFSET (ExtAddress64.Flags), 1);
205             break;
206
207         case 4: /* Range Type */
208
209             RsSetFlagBits (&Descriptor->ExtAddress64.SpecificFlags, InitializerOp, 0, 3);
210             RsCreateMultiBitField (InitializerOp, ACPI_RESTAG_RANGETYPE,
211                 CurrentByteOffset + ASL_RESDESC_OFFSET (ExtAddress64.SpecificFlags), 0, 2);
212             break;
213
214         case 5: /* Address Granularity */
215
216             Descriptor->ExtAddress64.Granularity = InitializerOp->Asl.Value.Integer;
217             RsCreateQwordField (InitializerOp, ACPI_RESTAG_GRANULARITY,
218                 CurrentByteOffset + ASL_RESDESC_OFFSET (ExtAddress64.Granularity));
219             GranOp = InitializerOp;
220            break;
221
222         case 6: /* Address Min */
223
224             Descriptor->ExtAddress64.Minimum = InitializerOp->Asl.Value.Integer;
225             RsCreateQwordField (InitializerOp, ACPI_RESTAG_MINADDR,
226                 CurrentByteOffset + ASL_RESDESC_OFFSET (ExtAddress64.Minimum));
227             MinOp = InitializerOp;
228             break;
229
230         case 7: /* Address Max */
231
232             Descriptor->ExtAddress64.Maximum = InitializerOp->Asl.Value.Integer;
233             RsCreateQwordField (InitializerOp, ACPI_RESTAG_MAXADDR,
234                 CurrentByteOffset + ASL_RESDESC_OFFSET (ExtAddress64.Maximum));
235             MaxOp = InitializerOp;
236             break;
237
238         case 8: /* Translation Offset */
239
240             Descriptor->ExtAddress64.TranslationOffset = InitializerOp->Asl.Value.Integer;
241             RsCreateQwordField (InitializerOp, ACPI_RESTAG_TRANSLATION,
242                 CurrentByteOffset + ASL_RESDESC_OFFSET (ExtAddress64.TranslationOffset));
243             break;
244
245         case 9: /* Address Length */
246
247             Descriptor->ExtAddress64.AddressLength = InitializerOp->Asl.Value.Integer;
248             RsCreateQwordField (InitializerOp, ACPI_RESTAG_LENGTH,
249                 CurrentByteOffset + ASL_RESDESC_OFFSET (ExtAddress64.AddressLength));
250             LengthOp = InitializerOp;
251             break;
252
253         case 10: /* Type-Specific Attributes */
254
255             Descriptor->ExtAddress64.TypeSpecific = InitializerOp->Asl.Value.Integer;
256             RsCreateQwordField (InitializerOp, ACPI_RESTAG_TYPESPECIFICATTRIBUTES,
257                 CurrentByteOffset + ASL_RESDESC_OFFSET (ExtAddress64.TypeSpecific));
258             break;
259
260         case 11: /* ResourceTag */
261
262             UtAttachNamepathToOwner (Op, InitializerOp);
263             break;
264
265         case 12: /* Type */
266
267             RsSetFlagBits (&Descriptor->ExtAddress64.SpecificFlags, InitializerOp, 4, 0);
268             RsCreateBitField (InitializerOp, ACPI_RESTAG_TYPE,
269                 CurrentByteOffset + ASL_RESDESC_OFFSET (ExtAddress64.SpecificFlags), 4);
270             break;
271
272         case 13: /* Translation Type */
273
274             RsSetFlagBits (&Descriptor->ExtAddress64.SpecificFlags, InitializerOp, 5, 0);
275             RsCreateBitField (InitializerOp, ACPI_RESTAG_TRANSTYPE,
276                 CurrentByteOffset + ASL_RESDESC_OFFSET (ExtAddress64.SpecificFlags), 5);
277             break;
278
279         default:
280
281             AslError (ASL_ERROR, ASL_MSG_RESOURCE_LIST, InitializerOp, NULL);
282             break;
283         }
284
285         InitializerOp = RsCompleteNodeAndGetNext (InitializerOp);
286     }
287
288     /* Validate the Min/Max/Len/Gran values */
289
290     RsLargeAddressCheck (
291         Descriptor->ExtAddress64.Minimum,
292         Descriptor->ExtAddress64.Maximum,
293         Descriptor->ExtAddress64.AddressLength,
294         Descriptor->ExtAddress64.Granularity,
295         Descriptor->ExtAddress64.Flags,
296         MinOp, MaxOp, LengthOp, GranOp, Op);
297
298     Rnode->BufferLength = sizeof (AML_RESOURCE_EXTENDED_ADDRESS64) + StringLength;
299     return (Rnode);
300 }
301
302
303 /*******************************************************************************
304  *
305  * FUNCTION:    RsDoExtendedMemoryDescriptor
306  *
307  * PARAMETERS:  Op                  - Parent resource descriptor parse node
308  *              CurrentByteOffset   - Offset into the resource template AML
309  *                                    buffer (to track references to the desc)
310  *
311  * RETURN:      Completed resource node
312  *
313  * DESCRIPTION: Construct a long "ExtendedMemory" descriptor
314  *
315  ******************************************************************************/
316
317 ASL_RESOURCE_NODE *
318 RsDoExtendedMemoryDescriptor (
319     ACPI_PARSE_OBJECT       *Op,
320     UINT32                  CurrentByteOffset)
321 {
322     AML_RESOURCE            *Descriptor;
323     ACPI_PARSE_OBJECT       *InitializerOp;
324     ACPI_PARSE_OBJECT       *MinOp = NULL;
325     ACPI_PARSE_OBJECT       *MaxOp = NULL;
326     ACPI_PARSE_OBJECT       *LengthOp = NULL;
327     ACPI_PARSE_OBJECT       *GranOp = NULL;
328     ASL_RESOURCE_NODE       *Rnode;
329     UINT16                  StringLength = 0;
330     UINT32                  i;
331
332
333     InitializerOp = Op->Asl.Child;
334     StringLength = RsGetStringDataLength (InitializerOp);
335
336     Rnode = RsAllocateResourceNode (
337                 sizeof (AML_RESOURCE_EXTENDED_ADDRESS64) + 1 + StringLength);
338
339     Descriptor = Rnode->Buffer;
340     Descriptor->ExtAddress64.DescriptorType  = ACPI_RESOURCE_NAME_EXTENDED_ADDRESS64;
341     Descriptor->ExtAddress64.ResourceType    = ACPI_ADDRESS_TYPE_MEMORY_RANGE;
342     Descriptor->ExtAddress64.RevisionID      = AML_RESOURCE_EXTENDED_ADDRESS_REVISION;
343
344     Descriptor->ExtAddress64.ResourceLength  = (UINT16)
345         (sizeof (AML_RESOURCE_EXTENDED_ADDRESS64) -
346          sizeof (AML_RESOURCE_LARGE_HEADER));
347
348     /* Process all child initialization nodes */
349
350     for (i = 0; InitializerOp; i++)
351     {
352         switch (i)
353         {
354         case 0: /* Resource Usage */
355
356             RsSetFlagBits (&Descriptor->ExtAddress64.Flags, InitializerOp, 0, 1);
357             break;
358
359         case 1: /* DecodeType */
360
361             RsSetFlagBits (&Descriptor->ExtAddress64.Flags, InitializerOp, 1, 0);
362             RsCreateBitField (InitializerOp, ACPI_RESTAG_DECODE,
363                 CurrentByteOffset + ASL_RESDESC_OFFSET (ExtAddress64.Flags), 1);
364             break;
365
366         case 2: /* MinType */
367
368             RsSetFlagBits (&Descriptor->ExtAddress64.Flags, InitializerOp, 2, 0);
369             RsCreateBitField (InitializerOp, ACPI_RESTAG_MINTYPE,
370                 CurrentByteOffset + ASL_RESDESC_OFFSET (ExtAddress64.Flags), 2);
371             break;
372
373         case 3: /* MaxType */
374
375             RsSetFlagBits (&Descriptor->ExtAddress64.Flags, InitializerOp, 3, 0);
376             RsCreateBitField (InitializerOp, ACPI_RESTAG_MAXTYPE,
377                 CurrentByteOffset + ASL_RESDESC_OFFSET (ExtAddress64.Flags), 3);
378             break;
379
380         case 4: /* Memory Type */
381
382             RsSetFlagBits (&Descriptor->ExtAddress64.SpecificFlags, InitializerOp, 1, 0);
383             RsCreateMultiBitField (InitializerOp, ACPI_RESTAG_MEMTYPE,
384                 CurrentByteOffset + ASL_RESDESC_OFFSET (ExtAddress64.SpecificFlags), 1, 2);
385             break;
386
387         case 5: /* Read/Write Type */
388
389             RsSetFlagBits (&Descriptor->ExtAddress64.SpecificFlags, InitializerOp, 0, 1);
390             RsCreateBitField (InitializerOp, ACPI_RESTAG_READWRITETYPE,
391                 CurrentByteOffset + ASL_RESDESC_OFFSET (ExtAddress64.SpecificFlags), 0);
392             break;
393
394         case 6: /* Address Granularity */
395
396             Descriptor->ExtAddress64.Granularity = InitializerOp->Asl.Value.Integer;
397             RsCreateQwordField (InitializerOp, ACPI_RESTAG_GRANULARITY,
398                 CurrentByteOffset + ASL_RESDESC_OFFSET (ExtAddress64.Granularity));
399             GranOp = InitializerOp;
400             break;
401
402         case 7: /* Min Address */
403
404             Descriptor->ExtAddress64.Minimum = InitializerOp->Asl.Value.Integer;
405             RsCreateQwordField (InitializerOp, ACPI_RESTAG_MINADDR,
406                 CurrentByteOffset + ASL_RESDESC_OFFSET (ExtAddress64.Minimum));
407             MinOp = InitializerOp;
408             break;
409
410         case 8: /* Max Address */
411
412             Descriptor->ExtAddress64.Maximum = InitializerOp->Asl.Value.Integer;
413             RsCreateQwordField (InitializerOp, ACPI_RESTAG_MAXADDR,
414                 CurrentByteOffset + ASL_RESDESC_OFFSET (ExtAddress64.Maximum));
415             MaxOp = InitializerOp;
416             break;
417
418         case 9: /* Translation Offset */
419
420             Descriptor->ExtAddress64.TranslationOffset = InitializerOp->Asl.Value.Integer;
421             RsCreateQwordField (InitializerOp, ACPI_RESTAG_TRANSLATION,
422                 CurrentByteOffset + ASL_RESDESC_OFFSET (ExtAddress64.TranslationOffset));
423             break;
424
425         case 10: /* Address Length */
426
427             Descriptor->ExtAddress64.AddressLength = InitializerOp->Asl.Value.Integer;
428             RsCreateQwordField (InitializerOp, ACPI_RESTAG_LENGTH,
429                 CurrentByteOffset + ASL_RESDESC_OFFSET (ExtAddress64.AddressLength));
430             LengthOp = InitializerOp;
431             break;
432
433         case 11: /* Type-Specific Attributes */
434
435             Descriptor->ExtAddress64.TypeSpecific = InitializerOp->Asl.Value.Integer;
436             RsCreateQwordField (InitializerOp, ACPI_RESTAG_TYPESPECIFICATTRIBUTES,
437                 CurrentByteOffset + ASL_RESDESC_OFFSET (ExtAddress64.TypeSpecific));
438             break;
439
440         case 12: /* ResourceTag */
441
442             UtAttachNamepathToOwner (Op, InitializerOp);
443             break;
444
445
446         case 13: /* Address Range */
447
448             RsSetFlagBits (&Descriptor->ExtAddress64.SpecificFlags, InitializerOp, 3, 0);
449             RsCreateMultiBitField (InitializerOp, ACPI_RESTAG_MEMATTRIBUTES,
450                 CurrentByteOffset + ASL_RESDESC_OFFSET (ExtAddress64.SpecificFlags), 3, 2);
451             break;
452
453         case 14: /* Type */
454
455             RsSetFlagBits (&Descriptor->ExtAddress64.SpecificFlags, InitializerOp, 5, 0);
456             RsCreateBitField (InitializerOp, ACPI_RESTAG_TYPE,
457                 CurrentByteOffset + ASL_RESDESC_OFFSET (ExtAddress64.SpecificFlags), 5);
458             break;
459
460         default:
461
462             AslError (ASL_ERROR, ASL_MSG_RESOURCE_LIST, InitializerOp, NULL);
463             break;
464         }
465
466         InitializerOp = RsCompleteNodeAndGetNext (InitializerOp);
467     }
468
469     /* Validate the Min/Max/Len/Gran values */
470
471     RsLargeAddressCheck (
472         Descriptor->ExtAddress64.Minimum,
473         Descriptor->ExtAddress64.Maximum,
474         Descriptor->ExtAddress64.AddressLength,
475         Descriptor->ExtAddress64.Granularity,
476         Descriptor->ExtAddress64.Flags,
477         MinOp, MaxOp, LengthOp, GranOp, Op);
478
479     Rnode->BufferLength = sizeof (AML_RESOURCE_EXTENDED_ADDRESS64) + StringLength;
480     return (Rnode);
481 }
482
483
484 /*******************************************************************************
485  *
486  * FUNCTION:    RsDoExtendedSpaceDescriptor
487  *
488  * PARAMETERS:  Op                  - Parent resource descriptor parse node
489  *              CurrentByteOffset   - Offset into the resource template AML
490  *                                    buffer (to track references to the desc)
491  *
492  * RETURN:      Completed resource node
493  *
494  * DESCRIPTION: Construct a long "ExtendedSpace" descriptor
495  *
496  ******************************************************************************/
497
498 ASL_RESOURCE_NODE *
499 RsDoExtendedSpaceDescriptor (
500     ACPI_PARSE_OBJECT       *Op,
501     UINT32                  CurrentByteOffset)
502 {
503     AML_RESOURCE            *Descriptor;
504     ACPI_PARSE_OBJECT       *InitializerOp;
505     ACPI_PARSE_OBJECT       *MinOp = NULL;
506     ACPI_PARSE_OBJECT       *MaxOp = NULL;
507     ACPI_PARSE_OBJECT       *LengthOp = NULL;
508     ACPI_PARSE_OBJECT       *GranOp = NULL;
509     ASL_RESOURCE_NODE       *Rnode;
510     UINT16                  StringLength = 0;
511     UINT32                  i;
512
513
514     InitializerOp = Op->Asl.Child;
515     StringLength = RsGetStringDataLength (InitializerOp);
516
517     Rnode = RsAllocateResourceNode (
518                 sizeof (AML_RESOURCE_EXTENDED_ADDRESS64) + 1 + StringLength);
519
520     Descriptor = Rnode->Buffer;
521     Descriptor->ExtAddress64.DescriptorType  = ACPI_RESOURCE_NAME_EXTENDED_ADDRESS64;
522     Descriptor->ExtAddress64.RevisionID      = AML_RESOURCE_EXTENDED_ADDRESS_REVISION;
523
524     Descriptor->ExtAddress64.ResourceLength  = (UINT16)
525         (sizeof (AML_RESOURCE_EXTENDED_ADDRESS64) -
526          sizeof (AML_RESOURCE_LARGE_HEADER));
527
528     /* Process all child initialization nodes */
529
530     for (i = 0; InitializerOp; i++)
531     {
532         switch (i)
533         {
534         case 0: /* Resource Type */
535
536             Descriptor->ExtAddress64.ResourceType =
537                 (UINT8) InitializerOp->Asl.Value.Integer;
538             break;
539
540         case 1: /* Resource Usage */
541
542             RsSetFlagBits (&Descriptor->ExtAddress64.Flags, InitializerOp, 0, 1);
543             break;
544
545         case 2: /* DecodeType */
546
547             RsSetFlagBits (&Descriptor->ExtAddress64.Flags, InitializerOp, 1, 0);
548             RsCreateBitField (InitializerOp, ACPI_RESTAG_DECODE,
549                 CurrentByteOffset + ASL_RESDESC_OFFSET (ExtAddress64.Flags), 1);
550             break;
551
552         case 3: /* MinType */
553
554             RsSetFlagBits (&Descriptor->ExtAddress64.Flags, InitializerOp, 2, 0);
555             RsCreateBitField (InitializerOp, ACPI_RESTAG_MINTYPE,
556                 CurrentByteOffset + ASL_RESDESC_OFFSET (ExtAddress64.Flags), 2);
557             break;
558
559         case 4: /* MaxType */
560
561             RsSetFlagBits (&Descriptor->ExtAddress64.Flags, InitializerOp, 3, 0);
562             RsCreateBitField (InitializerOp, ACPI_RESTAG_MAXTYPE,
563                 CurrentByteOffset + ASL_RESDESC_OFFSET (ExtAddress64.Flags), 3);
564             break;
565
566         case 5: /* Type-Specific flags */
567
568             Descriptor->ExtAddress64.SpecificFlags =
569                 (UINT8) InitializerOp->Asl.Value.Integer;
570             break;
571
572         case 6: /* Address Granularity */
573
574             Descriptor->ExtAddress64.Granularity = InitializerOp->Asl.Value.Integer;
575             RsCreateQwordField (InitializerOp, ACPI_RESTAG_GRANULARITY,
576                 CurrentByteOffset + ASL_RESDESC_OFFSET (ExtAddress64.Granularity));
577             GranOp = InitializerOp;
578             break;
579
580         case 7: /* Min Address */
581
582             Descriptor->ExtAddress64.Minimum = InitializerOp->Asl.Value.Integer;
583             RsCreateQwordField (InitializerOp, ACPI_RESTAG_MINADDR,
584                 CurrentByteOffset + ASL_RESDESC_OFFSET (ExtAddress64.Minimum));
585             MinOp = InitializerOp;
586             break;
587
588         case 8: /* Max Address */
589
590             Descriptor->ExtAddress64.Maximum = InitializerOp->Asl.Value.Integer;
591             RsCreateQwordField (InitializerOp, ACPI_RESTAG_MAXADDR,
592                 CurrentByteOffset + ASL_RESDESC_OFFSET (ExtAddress64.Maximum));
593             MaxOp = InitializerOp;
594             break;
595
596         case 9: /* Translation Offset */
597
598             Descriptor->ExtAddress64.TranslationOffset = InitializerOp->Asl.Value.Integer;
599             RsCreateQwordField (InitializerOp, ACPI_RESTAG_TRANSLATION,
600                 CurrentByteOffset + ASL_RESDESC_OFFSET (ExtAddress64.TranslationOffset));
601             break;
602
603         case 10: /* Address Length */
604
605             Descriptor->ExtAddress64.AddressLength = InitializerOp->Asl.Value.Integer;
606             RsCreateQwordField (InitializerOp, ACPI_RESTAG_LENGTH,
607                 CurrentByteOffset + ASL_RESDESC_OFFSET (ExtAddress64.AddressLength));
608             LengthOp = InitializerOp;
609             break;
610
611         case 11: /* Type-Specific Attributes */
612
613             Descriptor->ExtAddress64.TypeSpecific = InitializerOp->Asl.Value.Integer;
614             RsCreateQwordField (InitializerOp, ACPI_RESTAG_TYPESPECIFICATTRIBUTES,
615                 CurrentByteOffset + ASL_RESDESC_OFFSET (ExtAddress64.TypeSpecific));
616             break;
617
618         case 12: /* ResourceTag */
619
620             UtAttachNamepathToOwner (Op, InitializerOp);
621             break;
622
623         default:
624
625             AslError (ASL_ERROR, ASL_MSG_RESOURCE_LIST, InitializerOp, NULL);
626             break;
627         }
628
629         InitializerOp = RsCompleteNodeAndGetNext (InitializerOp);
630     }
631
632     /* Validate the Min/Max/Len/Gran values */
633
634     RsLargeAddressCheck (
635         Descriptor->ExtAddress64.Minimum,
636         Descriptor->ExtAddress64.Maximum,
637         Descriptor->ExtAddress64.AddressLength,
638         Descriptor->ExtAddress64.Granularity,
639         Descriptor->ExtAddress64.Flags,
640         MinOp, MaxOp, LengthOp, GranOp, Op);
641
642     Rnode->BufferLength = sizeof (AML_RESOURCE_EXTENDED_ADDRESS64) + StringLength;
643     return (Rnode);
644 }