aslcompiler.h revision 209746
1323032Smav
2355041Smav/******************************************************************************
3323032Smav *
4323032Smav * Module Name: aslcompiler.h - common include file for iASL
5323032Smav *
6323032Smav *****************************************************************************/
7323032Smav
8323032Smav/******************************************************************************
9323032Smav *
10323032Smav * 1. Copyright Notice
11323032Smav *
12323032Smav * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
13323032Smav * All rights reserved.
14323032Smav *
15323032Smav * 2. License
16323032Smav *
17323032Smav * 2.1. This is your license from Intel Corp. under its intellectual property
18323032Smav * rights.  You may have additional license terms from the party that provided
19323032Smav * you this software, covering your right to use that party's intellectual
20323032Smav * property rights.
21323032Smav *
22323032Smav * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
23323032Smav * copy of the source code appearing in this file ("Covered Code") an
24323032Smav * irrevocable, perpetual, worldwide license under Intel's copyrights in the
25323032Smav * base code distributed originally by Intel ("Original Intel Code") to copy,
26323032Smav * make derivatives, distribute, use and display any portion of the Covered
27323032Smav * Code in any form, with the right to sublicense such rights; and
28355041Smav *
29323032Smav * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
30323032Smav * license (with the right to sublicense), under only those claims of Intel
31323032Smav * patents that are infringed by the Original Intel Code, to make, use, sell,
32323032Smav * offer to sell, and import the Covered Code and derivative works thereof
33323032Smav * solely to the minimum extent necessary to exercise the above copyright
34323032Smav * license, and in no event shall the patent license extend to any additions
35323032Smav * to or modifications of the Original Intel Code.  No other license or right
36323032Smav * is granted directly or by implication, estoppel or otherwise;
37323032Smav *
38323032Smav * The above copyright and patent license is granted only if the following
39323032Smav * conditions are met:
40323032Smav *
41323032Smav * 3. Conditions
42323032Smav *
43323032Smav * 3.1. Redistribution of Source with Rights to Further Distribute Source.
44323032Smav * Redistribution of source code of any substantial portion of the Covered
45323032Smav * Code or modification with rights to further distribute source must include
46323032Smav * the above Copyright Notice, the above License, this list of Conditions,
47323032Smav * and the following Disclaimer and Export Compliance provision.  In addition,
48323032Smav * Licensee must cause all Covered Code to which Licensee contributes to
49323032Smav * contain a file documenting the changes Licensee made to create that Covered
50323032Smav * Code and the date of any change.  Licensee must include in that file the
51323032Smav * documentation of any changes made by any predecessor Licensee.  Licensee
52323032Smav * must include a prominent statement that the modification is derived,
53323032Smav * directly or indirectly, from Original Intel Code.
54323032Smav *
55323032Smav * 3.2. Redistribution of Source with no Rights to Further Distribute Source.
56323032Smav * Redistribution of source code of any substantial portion of the Covered
57355041Smav * Code or modification without rights to further distribute source must
58355041Smav * include the following Disclaimer and Export Compliance provision in the
59355041Smav * documentation and/or other materials provided with distribution.  In
60323032Smav * addition, Licensee may not authorize further sublicense of source of any
61323032Smav * portion of the Covered Code, and must include terms to the effect that the
62323032Smav * license from Licensee to its licensee is limited to the intellectual
63323032Smav * property embodied in the software Licensee provides to its licensee, and
64323032Smav * not to intellectual property embodied in modifications its licensee may
65323032Smav * make.
66323032Smav *
67323032Smav * 3.3. Redistribution of Executable. Redistribution in executable form of any
68323032Smav * substantial portion of the Covered Code or modification must reproduce the
69323032Smav * above Copyright Notice, and the following Disclaimer and Export Compliance
70323032Smav * provision in the documentation and/or other materials provided with the
71323032Smav * distribution.
72323032Smav *
73323032Smav * 3.4. Intel retains all right, title, and interest in and to the Original
74323032Smav * Intel Code.
75323032Smav *
76355041Smav * 3.5. Neither the name Intel nor any other trademark owned or controlled by
77355041Smav * Intel shall be used in advertising or otherwise to promote the sale, use or
78323032Smav * other dealings in products derived from or relating to the Covered Code
79323032Smav * without prior written authorization from Intel.
80323032Smav *
81323032Smav * 4. Disclaimer and Export Compliance
82323032Smav *
83323032Smav * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
84323032Smav * HERE.  ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
85323032Smav * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT,  ASSISTANCE,
86323032Smav * INSTALLATION, TRAINING OR OTHER SERVICES.  INTEL WILL NOT PROVIDE ANY
87323032Smav * UPDATES, ENHANCEMENTS OR EXTENSIONS.  INTEL SPECIFICALLY DISCLAIMS ANY
88323032Smav * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
89323032Smav * PARTICULAR PURPOSE.
90323032Smav *
91323032Smav * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
92323032Smav * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
93323032Smav * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
94323032Smav * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
95323032Smav * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
96323032Smav * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES.  THESE LIMITATIONS
97323032Smav * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
98323032Smav * LIMITED REMEDY.
99323032Smav *
100323032Smav * 4.3. Licensee shall not export, either directly or indirectly, any of this
101323032Smav * software or system incorporating such software without first obtaining any
102323032Smav * required license or other approval from the U. S. Department of Commerce or
103323032Smav * any other agency or department of the United States Government.  In the
104323032Smav * event Licensee exports any such software from the United States or
105323032Smav * re-exports any such software from a foreign destination, Licensee shall
106323032Smav * ensure that the distribution and export/re-export of the software is in
107323032Smav * compliance with all laws, regulations, orders, or other restrictions of the
108323032Smav * U.S. Export Administration Regulations. Licensee agrees that neither it nor
109323032Smav * any of its subsidiaries will export/re-export any technical data, process,
110323032Smav * software, or service, directly or indirectly, to any country for which the
111323032Smav * United States government or any agency thereof requires an export license,
112323032Smav * other governmental approval, or letter of assurance, without first obtaining
113323032Smav * such license, approval or letter.
114323032Smav *
115323032Smav *****************************************************************************/
116323032Smav
117323032Smav
118323032Smav#ifndef __ASLCOMPILER_H
119323032Smav#define __ASLCOMPILER_H
120323032Smav
121323032Smav
122323032Smav/* Microsoft-specific */
123323032Smav
124#if (defined WIN32 || defined WIN64)
125
126/* warn : used #pragma pack */
127#pragma warning(disable:4103)
128
129/* warn : named type definition in parentheses */
130#pragma warning(disable:4115)
131#endif
132
133#include <stdio.h>
134#include <stdlib.h>
135#include <stdarg.h>
136#include <string.h>
137#include <errno.h>
138#include <ctype.h>
139
140
141#include <contrib/dev/acpica/include/acpi.h>
142#include <contrib/dev/acpica/include/accommon.h>
143#include <contrib/dev/acpica/include/amlresrc.h>
144#include <contrib/dev/acpica/include/acdebug.h>
145
146/* Compiler headers */
147
148#include <contrib/dev/acpica/compiler/asldefine.h>
149#include <contrib/dev/acpica/compiler/asltypes.h>
150#include <contrib/dev/acpica/compiler/aslglobal.h>
151
152
153/*******************************************************************************
154 *
155 * Compiler prototypes
156 *
157 ******************************************************************************/
158
159/*
160 * parser - generated from flex/bison, lex/yacc, etc.
161 */
162int
163AslCompilerparse(
164    void);
165
166ACPI_PARSE_OBJECT *
167AslDoError (
168    void);
169
170int
171AslCompilerlex(
172    void);
173
174void
175ResetCurrentLineBuffer (
176    void);
177
178void
179InsertLineBuffer (
180    int                     SourceChar);
181
182int
183AslPopInputFileStack (
184    void);
185
186void
187AslPushInputFileStack (
188    FILE                    *InputFile,
189    char                    *Filename);
190
191/*
192 * aslstartup - entered from main()
193 */
194void
195AslInitializeGlobals (
196    void);
197
198ACPI_STATUS
199AslDoOnePathname (
200    char                    *Pathname);
201
202ACPI_STATUS
203AslDoOneFile (
204    char                    *Filename);
205
206/*
207 * aslcompile - compile mainline
208 */
209void
210AslCompilerSignon (
211    UINT32                  FileId);
212
213void
214AslCompilerFileHeader (
215    UINT32                  FileId);
216
217int
218CmDoCompile (
219    void);
220
221void
222CmDoOutputFiles (
223    void);
224
225void
226CmCleanupAndExit (
227    void);
228
229ACPI_STATUS
230FlCheckForAscii (
231    ASL_FILE_INFO           *FileInfo);
232
233
234/*
235 * aslanalyze - semantic analysis
236 */
237ACPI_STATUS
238AnOtherSemanticAnalysisWalkBegin (
239    ACPI_PARSE_OBJECT       *Op,
240    UINT32                  Level,
241    void                    *Context);
242
243ACPI_STATUS
244AnOtherSemanticAnalysisWalkEnd (
245    ACPI_PARSE_OBJECT       *Op,
246    UINT32                  Level,
247    void                    *Context);
248
249ACPI_STATUS
250AnOperandTypecheckWalkBegin (
251    ACPI_PARSE_OBJECT       *Op,
252    UINT32                  Level,
253    void                    *Context);
254
255ACPI_STATUS
256AnOperandTypecheckWalkEnd (
257    ACPI_PARSE_OBJECT       *Op,
258    UINT32                  Level,
259    void                    *Context);
260
261ACPI_STATUS
262AnMethodAnalysisWalkBegin (
263    ACPI_PARSE_OBJECT       *Op,
264    UINT32                  Level,
265    void                    *Context);
266
267ACPI_STATUS
268AnMethodAnalysisWalkEnd (
269    ACPI_PARSE_OBJECT       *Op,
270    UINT32                  Level,
271    void                    *Context);
272
273ACPI_STATUS
274AnMethodTypingWalkBegin (
275    ACPI_PARSE_OBJECT       *Op,
276    UINT32                  Level,
277    void                    *Context);
278
279ACPI_STATUS
280AnMethodTypingWalkEnd (
281    ACPI_PARSE_OBJECT       *Op,
282    UINT32                  Level,
283    void                    *Context);
284
285
286/*
287 * aslerror - error handling/reporting
288 */
289void
290AslError (
291    UINT8                   Level,
292    UINT8                   MessageId,
293    ACPI_PARSE_OBJECT       *Op,
294    char                    *ExtraMessage);
295
296void
297AslCoreSubsystemError (
298    ACPI_PARSE_OBJECT       *Op,
299    ACPI_STATUS             Status,
300    char                    *ExtraMessage,
301    BOOLEAN                 Abort);
302
303int
304AslCompilererror(
305    char                    *s);
306
307void
308AslCommonError (
309    UINT8                   Level,
310    UINT8                   MessageId,
311    UINT32                  CurrentLineNumber,
312    UINT32                  LogicalLineNumber,
313    UINT32                  LogicalByteOffset,
314    UINT32                  Column,
315    char                    *Filename,
316    char                    *ExtraMessage);
317
318void
319AePrintException (
320    UINT32                  FileId,
321    ASL_ERROR_MSG           *Enode,
322    char                    *Header);
323
324void
325AePrintErrorLog (
326    UINT32                  FileId);
327
328void
329AeClearErrorLog (
330    void);
331
332ACPI_PHYSICAL_ADDRESS
333AeLocalGetRootPointer (
334    void);
335
336
337/*
338 * asllisting - generate all "listing" type files
339 */
340void
341LsDoListings (
342    void);
343
344void
345LsWriteNodeToAsmListing (
346    ACPI_PARSE_OBJECT       *Op);
347
348void
349LsWriteNode (
350    ACPI_PARSE_OBJECT       *Op,
351    UINT32                  FileId);
352
353void
354LsDoHexOutput (
355    void);
356
357void
358LsDumpParseTree (
359    void);
360
361/*
362 * aslfold - constant folding
363 */
364ACPI_STATUS
365OpcAmlConstantWalk (
366    ACPI_PARSE_OBJECT       *Op,
367    UINT32                  Level,
368    void                    *Context);
369
370
371/*
372 * aslopcodes - generate AML opcodes
373 */
374ACPI_STATUS
375OpcAmlOpcodeWalk (
376    ACPI_PARSE_OBJECT       *Op,
377    UINT32                  Level,
378    void                    *Context);
379
380ACPI_STATUS
381OpcAmlOpcodeUpdateWalk (
382    ACPI_PARSE_OBJECT       *Op,
383    UINT32                  Level,
384    void                    *Context);
385
386void
387OpcGenerateAmlOpcode (
388    ACPI_PARSE_OBJECT       *Op);
389
390UINT32
391OpcSetOptimalIntegerSize (
392    ACPI_PARSE_OBJECT       *Op);
393
394void
395OpcGetIntegerWidth (
396    ACPI_PARSE_OBJECT       *Op);
397
398
399/*
400 * asloperands - generate AML operands for the AML opcodes
401 */
402ACPI_PARSE_OBJECT  *
403UtGetArg (
404    ACPI_PARSE_OBJECT       *Op,
405    UINT32                  Argn);
406
407void
408OpnGenerateAmlOperands (
409    ACPI_PARSE_OBJECT       *Op);
410
411void
412OpnDoPackage (
413    ACPI_PARSE_OBJECT       *Op);
414
415
416/*
417 * aslopt - optmization
418 */
419void
420OptOptimizeNamePath (
421    ACPI_PARSE_OBJECT       *Op,
422    UINT32                  Flags,
423    ACPI_WALK_STATE         *WalkState,
424    char                    *AmlNameString,
425    ACPI_NAMESPACE_NODE     *TargetNode);
426
427
428/*
429 * aslcodegen - code generation
430 */
431void
432CgGenerateAmlOutput (
433    void);
434
435
436/*
437 * aslfile
438 */
439void
440FlOpenFile (
441    UINT32                  FileId,
442    char                    *Filename,
443    char                    *Mode);
444
445
446/*
447 * asllength - calculate/adjust AML package lengths
448 */
449ACPI_STATUS
450LnPackageLengthWalk (
451    ACPI_PARSE_OBJECT       *Op,
452    UINT32                  Level,
453    void                    *Context);
454
455ACPI_STATUS
456LnInitLengthsWalk (
457    ACPI_PARSE_OBJECT       *Op,
458    UINT32                  Level,
459    void                    *Context);
460
461void
462CgGenerateAmlLengths (
463    ACPI_PARSE_OBJECT       *Op);
464
465
466/*
467 * aslmap - opcode mappings and reserved method names
468 */
469ACPI_OBJECT_TYPE
470AslMapNamedOpcodeToDataType (
471    UINT16                  Opcode);
472
473
474/*
475 * aslpredef - ACPI predefined names support
476 */
477void
478ApCheckForPredefinedMethod (
479    ACPI_PARSE_OBJECT       *Op,
480    ASL_METHOD_INFO         *MethodInfo);
481
482void
483ApCheckPredefinedReturnValue (
484    ACPI_PARSE_OBJECT       *Op,
485    ASL_METHOD_INFO         *MethodInfo);
486
487UINT32
488ApCheckForPredefinedName (
489    ACPI_PARSE_OBJECT       *Op,
490    char                    *Name);
491
492void
493ApCheckForPredefinedObject (
494    ACPI_PARSE_OBJECT       *Op,
495    char                    *Name);
496
497void
498ApDisplayReservedNames (
499    void);
500
501
502/*
503 * asltransform - parse tree transformations
504 */
505ACPI_STATUS
506TrAmlTransformWalk (
507    ACPI_PARSE_OBJECT       *Op,
508    UINT32                  Level,
509    void                    *Context);
510
511
512/*
513 * asltree - parse tree support
514 */
515ACPI_STATUS
516TrWalkParseTree (
517    ACPI_PARSE_OBJECT       *Op,
518    UINT32                  Visitation,
519    ASL_WALK_CALLBACK       DescendingCallback,
520    ASL_WALK_CALLBACK       AscendingCallback,
521    void                    *Context);
522
523/* Values for "Visitation" parameter above */
524
525#define ASL_WALK_VISIT_DOWNWARD     0x01
526#define ASL_WALK_VISIT_UPWARD       0x02
527#define ASL_WALK_VISIT_TWICE        (ASL_WALK_VISIT_DOWNWARD | ASL_WALK_VISIT_UPWARD)
528
529
530ACPI_PARSE_OBJECT *
531TrAllocateNode (
532    UINT32                  ParseOpcode);
533
534void
535TrReleaseNode (
536    ACPI_PARSE_OBJECT       *Op);
537
538ACPI_PARSE_OBJECT *
539TrUpdateNode (
540    UINT32                  ParseOpcode,
541    ACPI_PARSE_OBJECT       *Op);
542
543ACPI_PARSE_OBJECT *
544TrCreateNode (
545    UINT32                  ParseOpcode,
546    UINT32                  NumChildren,
547    ...);
548
549ACPI_PARSE_OBJECT *
550TrCreateLeafNode (
551    UINT32                  ParseOpcode);
552
553ACPI_PARSE_OBJECT *
554TrCreateValuedLeafNode (
555    UINT32                  ParseOpcode,
556    UINT64                  Value);
557
558ACPI_PARSE_OBJECT *
559TrLinkChildren (
560    ACPI_PARSE_OBJECT       *Op,
561    UINT32                  NumChildren,
562    ...);
563
564void
565TrSetEndLineNumber (
566    ACPI_PARSE_OBJECT       *Op);
567
568void
569TrWalkTree (
570    void);
571
572ACPI_PARSE_OBJECT *
573TrLinkPeerNode (
574    ACPI_PARSE_OBJECT       *Op1,
575    ACPI_PARSE_OBJECT       *Op2);
576
577ACPI_PARSE_OBJECT *
578TrLinkChildNode (
579    ACPI_PARSE_OBJECT       *Op1,
580    ACPI_PARSE_OBJECT       *Op2);
581
582ACPI_PARSE_OBJECT *
583TrSetNodeFlags (
584    ACPI_PARSE_OBJECT       *Op,
585    UINT32                  Flags);
586
587ACPI_PARSE_OBJECT *
588TrLinkPeerNodes (
589    UINT32                  NumPeers,
590    ...);
591
592
593/*
594 * aslfiles - File I/O support
595 */
596void
597AslAbort (
598    void);
599
600void
601FlAddIncludeDirectory (
602    char                    *Dir);
603
604void
605FlOpenIncludeFile (
606    ACPI_PARSE_OBJECT       *Op);
607
608void
609FlFileError (
610    UINT32                  FileId,
611    UINT8                   ErrorId);
612
613UINT32
614FlGetFileSize (
615    UINT32                  FileId);
616
617ACPI_STATUS
618FlReadFile (
619    UINT32                  FileId,
620    void                    *Buffer,
621    UINT32                  Length);
622
623void
624FlWriteFile (
625    UINT32                  FileId,
626    void                    *Buffer,
627    UINT32                  Length);
628
629void
630FlSeekFile (
631    UINT32                  FileId,
632    long                    Offset);
633
634void
635FlCloseFile (
636    UINT32                  FileId);
637
638void
639FlPrintFile (
640    UINT32                  FileId,
641    char                    *Format,
642    ...);
643
644void
645FlSetLineNumber (
646    ACPI_PARSE_OBJECT       *Op);
647
648ACPI_STATUS
649FlOpenInputFile (
650    char                    *InputFilename);
651
652ACPI_STATUS
653FlOpenAmlOutputFile (
654    char                    *InputFilename);
655
656ACPI_STATUS
657FlOpenMiscOutputFiles (
658    char                    *InputFilename);
659
660
661/*
662 * asload - load namespace in prep for cross reference
663 */
664ACPI_STATUS
665LdLoadNamespace (
666    ACPI_PARSE_OBJECT       *RootOp);
667
668
669/*
670 * asllookup - namespace cross reference
671 */
672ACPI_STATUS
673LkCrossReferenceNamespace (
674    void);
675
676void
677LkFindUnreferencedObjects (
678    void);
679
680ACPI_STATUS
681LsDisplayNamespace (
682    void);
683
684
685/*
686 * aslutils - common compiler utilites
687 */
688void
689DbgPrint (
690    UINT32                  Type,
691    char                    *Format,
692    ...);
693
694/* Type values for above */
695
696#define ASL_DEBUG_OUTPUT    0
697#define ASL_PARSE_OUTPUT    1
698#define ASL_TREE_OUTPUT     2
699
700void
701UtDisplaySupportedTables (
702    void);
703
704void
705UtDisplayConstantOpcodes (
706    void);
707
708UINT8
709UtBeginEvent (
710    char                    *Name);
711
712void
713UtEndEvent (
714    UINT8                   Event);
715
716void *
717UtLocalCalloc (
718    UINT32                  Size);
719
720void
721UtPrintFormattedName (
722    UINT16                  ParseOpcode,
723    UINT32                  Level);
724
725void
726UtDisplaySummary (
727    UINT32                  FileId);
728
729UINT8
730UtHexCharToValue (
731    int                     HexChar);
732
733void
734UtConvertByteToHex (
735    UINT8                   RawByte,
736    UINT8                   *Buffer);
737
738void
739UtConvertByteToAsmHex (
740    UINT8                   RawByte,
741    UINT8                   *Buffer);
742
743char *
744UtGetOpName (
745    UINT32                  ParseOpcode);
746
747void
748UtSetParseOpName (
749    ACPI_PARSE_OBJECT       *Op);
750
751char *
752UtGetStringBuffer (
753    UINT32                  Length);
754
755ACPI_STATUS
756UtInternalizeName (
757    char                    *ExternalName,
758    char                    **ConvertedName);
759
760void
761UtAttachNamepathToOwner (
762    ACPI_PARSE_OBJECT       *Op,
763    ACPI_PARSE_OBJECT       *NameNode);
764
765ACPI_PARSE_OBJECT *
766UtCheckIntegerRange (
767    ACPI_PARSE_OBJECT       *Op,
768    UINT32                  LowValue,
769    UINT32                  HighValue);
770
771UINT64
772UtDoConstant (
773    char                    *String);
774
775
776/*
777 * aslresource - Resource template generation utilities
778 */
779void
780RsSmallAddressCheck (
781    UINT8                   Type,
782    UINT32                  Minimum,
783    UINT32                  Maximum,
784    UINT32                  Length,
785    UINT32                  Alignment,
786    ACPI_PARSE_OBJECT       *MinOp,
787    ACPI_PARSE_OBJECT       *MaxOp,
788    ACPI_PARSE_OBJECT       *LengthOp,
789    ACPI_PARSE_OBJECT       *AlignOp);
790
791void
792RsLargeAddressCheck (
793    UINT64                  Minimum,
794    UINT64                  Maximum,
795    UINT64                  Length,
796    UINT64                  Granularity,
797    UINT8                   Flags,
798    ACPI_PARSE_OBJECT       *MinOp,
799    ACPI_PARSE_OBJECT       *MaxOp,
800    ACPI_PARSE_OBJECT       *LengthOp,
801    ACPI_PARSE_OBJECT       *GranOp);
802
803UINT16
804RsGetStringDataLength (
805    ACPI_PARSE_OBJECT       *InitializerOp);
806
807ASL_RESOURCE_NODE *
808RsAllocateResourceNode (
809    UINT32                  Size);
810
811void
812RsCreateBitField (
813    ACPI_PARSE_OBJECT       *Op,
814    char                    *Name,
815    UINT32                  ByteOffset,
816    UINT32                  BitOffset);
817
818void
819RsCreateByteField (
820    ACPI_PARSE_OBJECT       *Op,
821    char                    *Name,
822    UINT32                  ByteOffset);
823
824void
825RsSetFlagBits (
826    UINT8                   *Flags,
827    ACPI_PARSE_OBJECT       *Op,
828    UINT8                   Position,
829    UINT8                   DefaultBit);
830
831ACPI_PARSE_OBJECT *
832RsCompleteNodeAndGetNext (
833    ACPI_PARSE_OBJECT       *Op);
834
835void
836RsCheckListForDuplicates (
837    ACPI_PARSE_OBJECT       *Op);
838
839ASL_RESOURCE_NODE *
840RsDoOneResourceDescriptor (
841    ACPI_PARSE_OBJECT       *DescriptorTypeOp,
842    UINT32                  CurrentByteOffset,
843    UINT8                   *State);
844
845/* Values for State above */
846
847#define ACPI_RSTATE_NORMAL              0
848#define ACPI_RSTATE_START_DEPENDENT     1
849#define ACPI_RSTATE_DEPENDENT_LIST      2
850
851UINT32
852RsLinkDescriptorChain (
853    ASL_RESOURCE_NODE       **PreviousRnode,
854    ASL_RESOURCE_NODE       *Rnode);
855
856void
857RsDoResourceTemplate (
858    ACPI_PARSE_OBJECT       *Op);
859
860
861/*
862 * aslrestype1 - Miscellaneous Small descriptors
863 */
864ASL_RESOURCE_NODE *
865RsDoEndTagDescriptor (
866    ACPI_PARSE_OBJECT       *Op,
867    UINT32                  CurrentByteOffset);
868
869ASL_RESOURCE_NODE *
870RsDoEndDependentDescriptor (
871    ACPI_PARSE_OBJECT       *Op,
872    UINT32                  CurrentByteOffset);
873
874ASL_RESOURCE_NODE *
875RsDoMemory24Descriptor (
876    ACPI_PARSE_OBJECT       *Op,
877    UINT32                  CurrentByteOffset);
878
879ASL_RESOURCE_NODE *
880RsDoMemory32Descriptor (
881    ACPI_PARSE_OBJECT       *Op,
882    UINT32                  CurrentByteOffset);
883
884ASL_RESOURCE_NODE *
885RsDoMemory32FixedDescriptor (
886    ACPI_PARSE_OBJECT       *Op,
887    UINT32                  CurrentByteOffset);
888
889ASL_RESOURCE_NODE *
890RsDoStartDependentDescriptor (
891    ACPI_PARSE_OBJECT       *Op,
892    UINT32                  CurrentByteOffset);
893
894ASL_RESOURCE_NODE *
895RsDoStartDependentNoPriDescriptor (
896    ACPI_PARSE_OBJECT       *Op,
897    UINT32                  CurrentByteOffset);
898
899ASL_RESOURCE_NODE *
900RsDoVendorSmallDescriptor (
901    ACPI_PARSE_OBJECT       *Op,
902    UINT32                  CurrentByteOffset);
903
904
905/*
906 * aslrestype1i - I/O-related Small descriptors
907 */
908ASL_RESOURCE_NODE *
909RsDoDmaDescriptor (
910    ACPI_PARSE_OBJECT       *Op,
911    UINT32                  CurrentByteOffset);
912
913ASL_RESOURCE_NODE *
914RsDoFixedIoDescriptor (
915    ACPI_PARSE_OBJECT       *Op,
916    UINT32                  CurrentByteOffset);
917
918ASL_RESOURCE_NODE *
919RsDoIoDescriptor (
920    ACPI_PARSE_OBJECT       *Op,
921    UINT32                  CurrentByteOffset);
922
923ASL_RESOURCE_NODE *
924RsDoIrqDescriptor (
925    ACPI_PARSE_OBJECT       *Op,
926    UINT32                  CurrentByteOffset);
927
928ASL_RESOURCE_NODE *
929RsDoIrqNoFlagsDescriptor (
930    ACPI_PARSE_OBJECT       *Op,
931    UINT32                  CurrentByteOffset);
932
933
934/*
935 * aslrestype2 - Large resource descriptors
936 */
937ASL_RESOURCE_NODE *
938RsDoInterruptDescriptor (
939    ACPI_PARSE_OBJECT       *Op,
940    UINT32                  CurrentByteOffset);
941
942ASL_RESOURCE_NODE *
943RsDoVendorLargeDescriptor (
944    ACPI_PARSE_OBJECT       *Op,
945    UINT32                  CurrentByteOffset);
946
947ASL_RESOURCE_NODE *
948RsDoGeneralRegisterDescriptor (
949    ACPI_PARSE_OBJECT       *Op,
950    UINT32                  CurrentByteOffset);
951
952
953/*
954 * aslrestype2d - DWord address descriptors
955 */
956ASL_RESOURCE_NODE *
957RsDoDwordIoDescriptor (
958    ACPI_PARSE_OBJECT       *Op,
959    UINT32                  CurrentByteOffset);
960
961ASL_RESOURCE_NODE *
962RsDoDwordMemoryDescriptor (
963    ACPI_PARSE_OBJECT       *Op,
964    UINT32                  CurrentByteOffset);
965
966ASL_RESOURCE_NODE *
967RsDoDwordSpaceDescriptor (
968    ACPI_PARSE_OBJECT       *Op,
969    UINT32                  CurrentByteOffset);
970
971
972/*
973 * aslrestype2e - Extended address descriptors
974 */
975ASL_RESOURCE_NODE *
976RsDoExtendedIoDescriptor (
977    ACPI_PARSE_OBJECT       *Op,
978    UINT32                  CurrentByteOffset);
979
980ASL_RESOURCE_NODE *
981RsDoExtendedMemoryDescriptor (
982    ACPI_PARSE_OBJECT       *Op,
983    UINT32                  CurrentByteOffset);
984
985ASL_RESOURCE_NODE *
986RsDoExtendedSpaceDescriptor (
987    ACPI_PARSE_OBJECT       *Op,
988    UINT32                  CurrentByteOffset);
989
990
991/*
992 * aslrestype2q - QWord address descriptors
993 */
994ASL_RESOURCE_NODE *
995RsDoQwordIoDescriptor (
996    ACPI_PARSE_OBJECT       *Op,
997    UINT32                  CurrentByteOffset);
998
999ASL_RESOURCE_NODE *
1000RsDoQwordMemoryDescriptor (
1001    ACPI_PARSE_OBJECT       *Op,
1002    UINT32                  CurrentByteOffset);
1003
1004ASL_RESOURCE_NODE *
1005RsDoQwordSpaceDescriptor (
1006    ACPI_PARSE_OBJECT       *Op,
1007    UINT32                  CurrentByteOffset);
1008
1009
1010/*
1011 * aslrestype2w - Word address descriptors
1012 */
1013ASL_RESOURCE_NODE *
1014RsDoWordIoDescriptor (
1015    ACPI_PARSE_OBJECT       *Op,
1016    UINT32                  CurrentByteOffset);
1017
1018ASL_RESOURCE_NODE *
1019RsDoWordSpaceDescriptor (
1020    ACPI_PARSE_OBJECT       *Op,
1021    UINT32                  CurrentByteOffset);
1022
1023ASL_RESOURCE_NODE *
1024RsDoWordBusNumberDescriptor (
1025    ACPI_PARSE_OBJECT       *Op,
1026    UINT32                  CurrentByteOffset);
1027
1028/*
1029 * Entry to data table compiler subsystem
1030 */
1031ACPI_STATUS
1032DtDoCompile(
1033    void);
1034
1035ACPI_STATUS
1036DtCreateTemplates (
1037    char                    *Signature);
1038
1039#endif /*  __ASLCOMPILER_H */
1040
1041