xref: /freebsd/sys/contrib/dev/acpica/compiler/aslcompiler.h (revision ab2043b81eaba0d7d7769b4a58b2b6d17bc464a3)
1 
2 /******************************************************************************
3  *
4  * Module Name: aslcompiler.h - common include file for iASL
5  *
6  *****************************************************************************/
7 
8 /*
9  * Copyright (C) 2000 - 2012, Intel Corp.
10  * All rights reserved.
11  *
12  * Redistribution and use in source and binary forms, with or without
13  * modification, are permitted provided that the following conditions
14  * are met:
15  * 1. Redistributions of source code must retain the above copyright
16  *    notice, this list of conditions, and the following disclaimer,
17  *    without modification.
18  * 2. Redistributions in binary form must reproduce at minimum a disclaimer
19  *    substantially similar to the "NO WARRANTY" disclaimer below
20  *    ("Disclaimer") and any redistribution must be conditioned upon
21  *    including a substantially similar Disclaimer requirement for further
22  *    binary redistribution.
23  * 3. Neither the names of the above-listed copyright holders nor the names
24  *    of any contributors may be used to endorse or promote products derived
25  *    from this software without specific prior written permission.
26  *
27  * Alternatively, this software may be distributed under the terms of the
28  * GNU General Public License ("GPL") version 2 as published by the Free
29  * Software Foundation.
30  *
31  * NO WARRANTY
32  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
33  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
34  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
35  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
36  * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
37  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
38  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
39  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
40  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
41  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
42  * POSSIBILITY OF SUCH DAMAGES.
43  */
44 
45 
46 #ifndef __ASLCOMPILER_H
47 #define __ASLCOMPILER_H
48 
49 #include <contrib/dev/acpica/include/acpi.h>
50 #include <contrib/dev/acpica/include/accommon.h>
51 #include <contrib/dev/acpica/include/amlresrc.h>
52 #include <contrib/dev/acpica/include/acdebug.h>
53 
54 /* Microsoft-specific */
55 
56 #if (defined WIN32 || defined WIN64)
57 
58 /* warn : used #pragma pack */
59 #pragma warning(disable:4103)
60 
61 /* warn : named type definition in parentheses */
62 #pragma warning(disable:4115)
63 #endif
64 
65 #include <stdio.h>
66 #include <stdlib.h>
67 #include <stdarg.h>
68 #include <string.h>
69 #include <errno.h>
70 #include <ctype.h>
71 
72 /* Compiler headers */
73 
74 #include <contrib/dev/acpica/compiler/asldefine.h>
75 #include <contrib/dev/acpica/compiler/asltypes.h>
76 #include <contrib/dev/acpica/compiler/aslmessages.h>
77 #include <contrib/dev/acpica/compiler/aslglobal.h>
78 #include <contrib/dev/acpica/compiler/preprocess.h>
79 
80 
81 /*******************************************************************************
82  *
83  * Compiler prototypes
84  *
85  ******************************************************************************/
86 
87 /*
88  * Main ASL parser - generated from flex/bison, lex/yacc, etc.
89  */
90 int
91 AslCompilerparse(
92     void);
93 
94 ACPI_PARSE_OBJECT *
95 AslDoError (
96     void);
97 
98 int
99 AslCompilerlex(
100     void);
101 
102 void
103 AslResetCurrentLineBuffer (
104     void);
105 
106 void
107 AslInsertLineBuffer (
108     int                     SourceChar);
109 
110 int
111 AslPopInputFileStack (
112     void);
113 
114 void
115 AslPushInputFileStack (
116     FILE                    *InputFile,
117     char                    *Filename);
118 
119 /*
120  * aslstartup - entered from main()
121  */
122 void
123 AslInitializeGlobals (
124     void);
125 
126 typedef
127 ACPI_STATUS (*ASL_PATHNAME_CALLBACK) (
128     char *);
129 
130 ACPI_STATUS
131 AslDoOnePathname (
132     char                    *Pathname,
133     ASL_PATHNAME_CALLBACK   Callback);
134 
135 ACPI_STATUS
136 AslDoOneFile (
137     char                    *Filename);
138 
139 ACPI_STATUS
140 AslCheckForErrorExit (
141     void);
142 
143 
144 /*
145  * aslcompile - compile mainline
146  */
147 void
148 AslCompilerSignon (
149     UINT32                  FileId);
150 
151 void
152 AslCompilerFileHeader (
153     UINT32                  FileId);
154 
155 int
156 CmDoCompile (
157     void);
158 
159 void
160 CmDoOutputFiles (
161     void);
162 
163 void
164 CmCleanupAndExit (
165     void);
166 
167 ACPI_STATUS
168 FlCheckForAscii (
169     FILE                    *Handle,
170     char                    *Filename,
171     BOOLEAN                 DisplayErrors);
172 
173 
174 /*
175  * aslwalks - semantic analysis and parse tree walks
176  */
177 ACPI_STATUS
178 AnOtherSemanticAnalysisWalkBegin (
179     ACPI_PARSE_OBJECT       *Op,
180     UINT32                  Level,
181     void                    *Context);
182 
183 ACPI_STATUS
184 AnOtherSemanticAnalysisWalkEnd (
185     ACPI_PARSE_OBJECT       *Op,
186     UINT32                  Level,
187     void                    *Context);
188 
189 ACPI_STATUS
190 AnOperandTypecheckWalkEnd (
191     ACPI_PARSE_OBJECT       *Op,
192     UINT32                  Level,
193     void                    *Context);
194 
195 ACPI_STATUS
196 AnMethodAnalysisWalkBegin (
197     ACPI_PARSE_OBJECT       *Op,
198     UINT32                  Level,
199     void                    *Context);
200 
201 ACPI_STATUS
202 AnMethodAnalysisWalkEnd (
203     ACPI_PARSE_OBJECT       *Op,
204     UINT32                  Level,
205     void                    *Context);
206 
207 ACPI_STATUS
208 AnMethodTypingWalkEnd (
209     ACPI_PARSE_OBJECT       *Op,
210     UINT32                  Level,
211     void                    *Context);
212 
213 
214 /*
215  * aslbtypes - bitfield data types
216  */
217 UINT32
218 AnMapObjTypeToBtype (
219     ACPI_PARSE_OBJECT       *Op);
220 
221 UINT32
222 AnMapArgTypeToBtype (
223     UINT32                  ArgType);
224 
225 UINT32
226 AnGetBtype (
227     ACPI_PARSE_OBJECT       *Op);
228 
229 void
230 AnFormatBtype (
231     char                    *Buffer,
232     UINT32                  Btype);
233 
234 
235 /*
236  * aslanalyze - Support functions for parse tree walks
237  */
238 void
239 AnCheckId (
240     ACPI_PARSE_OBJECT       *Op,
241     ACPI_NAME               Type);
242 
243 /* Values for Type argument above */
244 
245 #define ASL_TYPE_HID        0
246 #define ASL_TYPE_CID        1
247 
248 BOOLEAN
249 AnIsInternalMethod (
250     ACPI_PARSE_OBJECT       *Op);
251 
252 UINT32
253 AnGetInternalMethodReturnType (
254     ACPI_PARSE_OBJECT       *Op);
255 
256 BOOLEAN
257 AnLastStatementIsReturn (
258     ACPI_PARSE_OBJECT       *Op);
259 
260 void
261 AnCheckMethodReturnValue (
262     ACPI_PARSE_OBJECT       *Op,
263     const ACPI_OPCODE_INFO  *OpInfo,
264     ACPI_PARSE_OBJECT       *ArgOp,
265     UINT32                  RequiredBtypes,
266     UINT32                  ThisNodeBtype);
267 
268 BOOLEAN
269 AnIsResultUsed (
270     ACPI_PARSE_OBJECT       *Op);
271 
272 void
273 ApCheckForGpeNameConflict (
274     ACPI_PARSE_OBJECT       *Op);
275 
276 void
277 ApCheckRegMethod (
278     ACPI_PARSE_OBJECT       *Op);
279 
280 
281 /*
282  * aslerror - error handling/reporting
283  */
284 void
285 AslError (
286     UINT8                   Level,
287     UINT8                   MessageId,
288     ACPI_PARSE_OBJECT       *Op,
289     char                    *ExtraMessage);
290 
291 void
292 AslCoreSubsystemError (
293     ACPI_PARSE_OBJECT       *Op,
294     ACPI_STATUS             Status,
295     char                    *ExtraMessage,
296     BOOLEAN                 Abort);
297 
298 int
299 AslCompilererror(
300     const char              *s);
301 
302 void
303 AslCommonError (
304     UINT8                   Level,
305     UINT8                   MessageId,
306     UINT32                  CurrentLineNumber,
307     UINT32                  LogicalLineNumber,
308     UINT32                  LogicalByteOffset,
309     UINT32                  Column,
310     char                    *Filename,
311     char                    *ExtraMessage);
312 
313 void
314 AslCommonError2 (
315     UINT8                   Level,
316     UINT8                   MessageId,
317     UINT32                  LineNumber,
318     UINT32                  Column,
319     char                    *SourceLine,
320     char                    *Filename,
321     char                    *ExtraMessage);
322 
323 void
324 AePrintException (
325     UINT32                  FileId,
326     ASL_ERROR_MSG           *Enode,
327     char                    *Header);
328 
329 void
330 AePrintErrorLog (
331     UINT32                  FileId);
332 
333 void
334 AeClearErrorLog (
335     void);
336 
337 ACPI_PHYSICAL_ADDRESS
338 AeLocalGetRootPointer (
339     void);
340 
341 
342 /*
343  * asllisting - generate all "listing" type files
344  */
345 void
346 LsDoListings (
347     void);
348 
349 void
350 LsWriteNodeToAsmListing (
351     ACPI_PARSE_OBJECT       *Op);
352 
353 void
354 LsWriteNode (
355     ACPI_PARSE_OBJECT       *Op,
356     UINT32                  FileId);
357 
358 void
359 LsDoHexOutput (
360     void);
361 
362 void
363 LsDumpParseTree (
364     void);
365 
366 /*
367  * aslfold - constant folding
368  */
369 ACPI_STATUS
370 OpcAmlConstantWalk (
371     ACPI_PARSE_OBJECT       *Op,
372     UINT32                  Level,
373     void                    *Context);
374 
375 
376 /*
377  * aslopcodes - generate AML opcodes
378  */
379 ACPI_STATUS
380 OpcAmlOpcodeWalk (
381     ACPI_PARSE_OBJECT       *Op,
382     UINT32                  Level,
383     void                    *Context);
384 
385 ACPI_STATUS
386 OpcAmlOpcodeUpdateWalk (
387     ACPI_PARSE_OBJECT       *Op,
388     UINT32                  Level,
389     void                    *Context);
390 
391 void
392 OpcGenerateAmlOpcode (
393     ACPI_PARSE_OBJECT       *Op);
394 
395 UINT32
396 OpcSetOptimalIntegerSize (
397     ACPI_PARSE_OBJECT       *Op);
398 
399 void
400 OpcGetIntegerWidth (
401     ACPI_PARSE_OBJECT       *Op);
402 
403 
404 /*
405  * asloperands - generate AML operands for the AML opcodes
406  */
407 ACPI_PARSE_OBJECT  *
408 UtGetArg (
409     ACPI_PARSE_OBJECT       *Op,
410     UINT32                  Argn);
411 
412 void
413 OpnGenerateAmlOperands (
414     ACPI_PARSE_OBJECT       *Op);
415 
416 void
417 OpnDoPackage (
418     ACPI_PARSE_OBJECT       *Op);
419 
420 
421 /*
422  * aslopt - optmization
423  */
424 void
425 OptOptimizeNamePath (
426     ACPI_PARSE_OBJECT       *Op,
427     UINT32                  Flags,
428     ACPI_WALK_STATE         *WalkState,
429     char                    *AmlNameString,
430     ACPI_NAMESPACE_NODE     *TargetNode);
431 
432 
433 /*
434  * aslcodegen - code generation
435  */
436 void
437 CgGenerateAmlOutput (
438     void);
439 
440 
441 /*
442  * aslfile
443  */
444 void
445 FlOpenFile (
446     UINT32                  FileId,
447     char                    *Filename,
448     char                    *Mode);
449 
450 
451 /*
452  * asllength - calculate/adjust AML package lengths
453  */
454 ACPI_STATUS
455 LnPackageLengthWalk (
456     ACPI_PARSE_OBJECT       *Op,
457     UINT32                  Level,
458     void                    *Context);
459 
460 ACPI_STATUS
461 LnInitLengthsWalk (
462     ACPI_PARSE_OBJECT       *Op,
463     UINT32                  Level,
464     void                    *Context);
465 
466 void
467 CgGenerateAmlLengths (
468     ACPI_PARSE_OBJECT       *Op);
469 
470 
471 /*
472  * aslmap - opcode mappings and reserved method names
473  */
474 ACPI_OBJECT_TYPE
475 AslMapNamedOpcodeToDataType (
476     UINT16                  Opcode);
477 
478 
479 /*
480  * aslpredef - ACPI predefined names support
481  */
482 BOOLEAN
483 ApCheckForPredefinedMethod (
484     ACPI_PARSE_OBJECT       *Op,
485     ASL_METHOD_INFO         *MethodInfo);
486 
487 void
488 ApCheckPredefinedReturnValue (
489     ACPI_PARSE_OBJECT       *Op,
490     ASL_METHOD_INFO         *MethodInfo);
491 
492 UINT32
493 ApCheckForPredefinedName (
494     ACPI_PARSE_OBJECT       *Op,
495     char                    *Name);
496 
497 void
498 ApCheckForPredefinedObject (
499     ACPI_PARSE_OBJECT       *Op,
500     char                    *Name);
501 
502 void
503 ApDisplayReservedNames (
504     void);
505 
506 
507 /*
508  * asltransform - parse tree transformations
509  */
510 ACPI_STATUS
511 TrAmlTransformWalk (
512     ACPI_PARSE_OBJECT       *Op,
513     UINT32                  Level,
514     void                    *Context);
515 
516 
517 /*
518  * asltree - parse tree support
519  */
520 ACPI_STATUS
521 TrWalkParseTree (
522     ACPI_PARSE_OBJECT       *Op,
523     UINT32                  Visitation,
524     ASL_WALK_CALLBACK       DescendingCallback,
525     ASL_WALK_CALLBACK       AscendingCallback,
526     void                    *Context);
527 
528 /* Values for "Visitation" parameter above */
529 
530 #define ASL_WALK_VISIT_DOWNWARD     0x01
531 #define ASL_WALK_VISIT_UPWARD       0x02
532 #define ASL_WALK_VISIT_TWICE        (ASL_WALK_VISIT_DOWNWARD | ASL_WALK_VISIT_UPWARD)
533 
534 
535 ACPI_PARSE_OBJECT *
536 TrAllocateNode (
537     UINT32                  ParseOpcode);
538 
539 void
540 TrReleaseNode (
541     ACPI_PARSE_OBJECT       *Op);
542 
543 ACPI_PARSE_OBJECT *
544 TrUpdateNode (
545     UINT32                  ParseOpcode,
546     ACPI_PARSE_OBJECT       *Op);
547 
548 ACPI_PARSE_OBJECT *
549 TrCreateNode (
550     UINT32                  ParseOpcode,
551     UINT32                  NumChildren,
552     ...);
553 
554 ACPI_PARSE_OBJECT *
555 TrCreateLeafNode (
556     UINT32                  ParseOpcode);
557 
558 ACPI_PARSE_OBJECT *
559 TrCreateValuedLeafNode (
560     UINT32                  ParseOpcode,
561     UINT64                  Value);
562 
563 ACPI_PARSE_OBJECT *
564 TrCreateConstantLeafNode (
565     UINT32                  ParseOpcode);
566 
567 ACPI_PARSE_OBJECT *
568 TrLinkChildren (
569     ACPI_PARSE_OBJECT       *Op,
570     UINT32                  NumChildren,
571     ...);
572 
573 void
574 TrSetEndLineNumber (
575     ACPI_PARSE_OBJECT       *Op);
576 
577 void
578 TrWalkTree (
579     void);
580 
581 ACPI_PARSE_OBJECT *
582 TrLinkPeerNode (
583     ACPI_PARSE_OBJECT       *Op1,
584     ACPI_PARSE_OBJECT       *Op2);
585 
586 ACPI_PARSE_OBJECT *
587 TrLinkChildNode (
588     ACPI_PARSE_OBJECT       *Op1,
589     ACPI_PARSE_OBJECT       *Op2);
590 
591 ACPI_PARSE_OBJECT *
592 TrSetNodeFlags (
593     ACPI_PARSE_OBJECT       *Op,
594     UINT32                  Flags);
595 
596 ACPI_PARSE_OBJECT *
597 TrSetNodeAmlLength (
598     ACPI_PARSE_OBJECT       *Op,
599     UINT32                  Length);
600 
601 ACPI_PARSE_OBJECT *
602 TrLinkPeerNodes (
603     UINT32                  NumPeers,
604     ...);
605 
606 
607 /*
608  * aslfiles - File I/O support
609  */
610 void
611 AslAbort (
612     void);
613 
614 void
615 FlAddIncludeDirectory (
616     char                    *Dir);
617 
618 char *
619 FlMergePathnames (
620     char                    *PrefixDir,
621     char                    *FilePathname);
622 
623 void
624 FlOpenIncludeFile (
625     ACPI_PARSE_OBJECT       *Op);
626 
627 void
628 FlFileError (
629     UINT32                  FileId,
630     UINT8                   ErrorId);
631 
632 UINT32
633 FlGetFileSize (
634     UINT32                  FileId);
635 
636 ACPI_STATUS
637 FlReadFile (
638     UINT32                  FileId,
639     void                    *Buffer,
640     UINT32                  Length);
641 
642 void
643 FlWriteFile (
644     UINT32                  FileId,
645     void                    *Buffer,
646     UINT32                  Length);
647 
648 void
649 FlSeekFile (
650     UINT32                  FileId,
651     long                    Offset);
652 
653 void
654 FlCloseFile (
655     UINT32                  FileId);
656 
657 void
658 FlPrintFile (
659     UINT32                  FileId,
660     char                    *Format,
661     ...);
662 
663 void
664 FlSetLineNumber (
665     UINT32                  LineNumber);
666 
667 void
668 FlSetFilename (
669     char                    *Filename);
670 
671 ACPI_STATUS
672 FlOpenInputFile (
673     char                    *InputFilename);
674 
675 ACPI_STATUS
676 FlOpenAmlOutputFile (
677     char                    *InputFilename);
678 
679 ACPI_STATUS
680 FlOpenMiscOutputFiles (
681     char                    *InputFilename);
682 
683 
684 /*
685  * asload - load namespace in prep for cross reference
686  */
687 ACPI_STATUS
688 LdLoadNamespace (
689     ACPI_PARSE_OBJECT       *RootOp);
690 
691 
692 /*
693  * asllookup - namespace cross reference
694  */
695 ACPI_STATUS
696 LkCrossReferenceNamespace (
697     void);
698 
699 void
700 LkFindUnreferencedObjects (
701     void);
702 
703 ACPI_STATUS
704 LsDisplayNamespace (
705     void);
706 
707 void
708 LsSetupNsList (
709     void                    *Handle);
710 
711 
712 /*
713  * aslutils - common compiler utilites
714  */
715 void
716 DbgPrint (
717     UINT32                  Type,
718     char                    *Format,
719     ...);
720 
721 /* Type values for above */
722 
723 #define ASL_DEBUG_OUTPUT    0
724 #define ASL_PARSE_OUTPUT    1
725 #define ASL_TREE_OUTPUT     2
726 
727 void
728 UtDisplaySupportedTables (
729     void);
730 
731 void
732 UtDisplayConstantOpcodes (
733     void);
734 
735 UINT8
736 UtBeginEvent (
737     char                    *Name);
738 
739 void
740 UtEndEvent (
741     UINT8                   Event);
742 
743 void *
744 UtLocalCalloc (
745     UINT32                  Size);
746 
747 void
748 UtPrintFormattedName (
749     UINT16                  ParseOpcode,
750     UINT32                  Level);
751 
752 void
753 UtDisplaySummary (
754     UINT32                  FileId);
755 
756 UINT8
757 UtHexCharToValue (
758     int                     HexChar);
759 
760 void
761 UtConvertByteToHex (
762     UINT8                   RawByte,
763     UINT8                   *Buffer);
764 
765 void
766 UtConvertByteToAsmHex (
767     UINT8                   RawByte,
768     UINT8                   *Buffer);
769 
770 char *
771 UtGetOpName (
772     UINT32                  ParseOpcode);
773 
774 void
775 UtSetParseOpName (
776     ACPI_PARSE_OBJECT       *Op);
777 
778 char *
779 UtGetStringBuffer (
780     UINT32                  Length);
781 
782 ACPI_STATUS
783 UtInternalizeName (
784     char                    *ExternalName,
785     char                    **ConvertedName);
786 
787 void
788 UtAttachNamepathToOwner (
789     ACPI_PARSE_OBJECT       *Op,
790     ACPI_PARSE_OBJECT       *NameNode);
791 
792 ACPI_PARSE_OBJECT *
793 UtCheckIntegerRange (
794     ACPI_PARSE_OBJECT       *Op,
795     UINT32                  LowValue,
796     UINT32                  HighValue);
797 
798 UINT64
799 UtDoConstant (
800     char                    *String);
801 
802 ACPI_STATUS
803 UtStrtoul64 (
804     char                    *String,
805     UINT32                  Base,
806     UINT64                  *RetInteger);
807 
808 
809 /*
810  * asluuid - UUID support
811  */
812 ACPI_STATUS
813 AuValidateUuid (
814     char                    *InString);
815 
816 ACPI_STATUS
817 AuConvertStringToUuid (
818     char                    *InString,
819     char                    *UuIdBuffer);
820 
821 ACPI_STATUS
822 AuConvertUuidToString (
823     char                    *UuIdBuffer,
824     char                    *OutString);
825 
826 /*
827  * aslresource - Resource template generation utilities
828  */
829 void
830 RsSmallAddressCheck (
831     UINT8                   Type,
832     UINT32                  Minimum,
833     UINT32                  Maximum,
834     UINT32                  Length,
835     UINT32                  Alignment,
836     ACPI_PARSE_OBJECT       *MinOp,
837     ACPI_PARSE_OBJECT       *MaxOp,
838     ACPI_PARSE_OBJECT       *LengthOp,
839     ACPI_PARSE_OBJECT       *AlignOp,
840     ACPI_PARSE_OBJECT       *Op);
841 
842 void
843 RsLargeAddressCheck (
844     UINT64                  Minimum,
845     UINT64                  Maximum,
846     UINT64                  Length,
847     UINT64                  Granularity,
848     UINT8                   Flags,
849     ACPI_PARSE_OBJECT       *MinOp,
850     ACPI_PARSE_OBJECT       *MaxOp,
851     ACPI_PARSE_OBJECT       *LengthOp,
852     ACPI_PARSE_OBJECT       *GranOp,
853     ACPI_PARSE_OBJECT       *Op);
854 
855 UINT16
856 RsGetStringDataLength (
857     ACPI_PARSE_OBJECT       *InitializerOp);
858 
859 ASL_RESOURCE_NODE *
860 RsAllocateResourceNode (
861     UINT32                  Size);
862 
863 void
864 RsCreateResourceField (
865     ACPI_PARSE_OBJECT       *Op,
866     char                    *Name,
867     UINT32                  ByteOffset,
868     UINT32                  BitOffset,
869     UINT32                  BitLength);
870 
871 void
872 RsSetFlagBits (
873     UINT8                   *Flags,
874     ACPI_PARSE_OBJECT       *Op,
875     UINT8                   Position,
876     UINT8                   DefaultBit);
877 
878 void
879 RsSetFlagBits16 (
880     UINT16                  *Flags,
881     ACPI_PARSE_OBJECT       *Op,
882     UINT8                   Position,
883     UINT8                   DefaultBit);
884 
885 ACPI_PARSE_OBJECT *
886 RsCompleteNodeAndGetNext (
887     ACPI_PARSE_OBJECT       *Op);
888 
889 void
890 RsCheckListForDuplicates (
891     ACPI_PARSE_OBJECT       *Op);
892 
893 ASL_RESOURCE_NODE *
894 RsDoOneResourceDescriptor (
895     ACPI_PARSE_OBJECT       *DescriptorTypeOp,
896     UINT32                  CurrentByteOffset,
897     UINT8                   *State);
898 
899 /* Values for State above */
900 
901 #define ACPI_RSTATE_NORMAL              0
902 #define ACPI_RSTATE_START_DEPENDENT     1
903 #define ACPI_RSTATE_DEPENDENT_LIST      2
904 
905 UINT32
906 RsLinkDescriptorChain (
907     ASL_RESOURCE_NODE       **PreviousRnode,
908     ASL_RESOURCE_NODE       *Rnode);
909 
910 void
911 RsDoResourceTemplate (
912     ACPI_PARSE_OBJECT       *Op);
913 
914 
915 /*
916  * aslrestype1 - Miscellaneous Small descriptors
917  */
918 ASL_RESOURCE_NODE *
919 RsDoEndTagDescriptor (
920     ACPI_PARSE_OBJECT       *Op,
921     UINT32                  CurrentByteOffset);
922 
923 ASL_RESOURCE_NODE *
924 RsDoEndDependentDescriptor (
925     ACPI_PARSE_OBJECT       *Op,
926     UINT32                  CurrentByteOffset);
927 
928 ASL_RESOURCE_NODE *
929 RsDoMemory24Descriptor (
930     ACPI_PARSE_OBJECT       *Op,
931     UINT32                  CurrentByteOffset);
932 
933 ASL_RESOURCE_NODE *
934 RsDoMemory32Descriptor (
935     ACPI_PARSE_OBJECT       *Op,
936     UINT32                  CurrentByteOffset);
937 
938 ASL_RESOURCE_NODE *
939 RsDoMemory32FixedDescriptor (
940     ACPI_PARSE_OBJECT       *Op,
941     UINT32                  CurrentByteOffset);
942 
943 ASL_RESOURCE_NODE *
944 RsDoStartDependentDescriptor (
945     ACPI_PARSE_OBJECT       *Op,
946     UINT32                  CurrentByteOffset);
947 
948 ASL_RESOURCE_NODE *
949 RsDoStartDependentNoPriDescriptor (
950     ACPI_PARSE_OBJECT       *Op,
951     UINT32                  CurrentByteOffset);
952 
953 ASL_RESOURCE_NODE *
954 RsDoVendorSmallDescriptor (
955     ACPI_PARSE_OBJECT       *Op,
956     UINT32                  CurrentByteOffset);
957 
958 
959 /*
960  * aslrestype1i - I/O-related Small descriptors
961  */
962 ASL_RESOURCE_NODE *
963 RsDoDmaDescriptor (
964     ACPI_PARSE_OBJECT       *Op,
965     UINT32                  CurrentByteOffset);
966 
967 ASL_RESOURCE_NODE *
968 RsDoFixedDmaDescriptor (
969     ACPI_PARSE_OBJECT       *Op,
970     UINT32                  CurrentByteOffset);
971 
972 ASL_RESOURCE_NODE *
973 RsDoFixedIoDescriptor (
974     ACPI_PARSE_OBJECT       *Op,
975     UINT32                  CurrentByteOffset);
976 
977 ASL_RESOURCE_NODE *
978 RsDoIoDescriptor (
979     ACPI_PARSE_OBJECT       *Op,
980     UINT32                  CurrentByteOffset);
981 
982 ASL_RESOURCE_NODE *
983 RsDoIrqDescriptor (
984     ACPI_PARSE_OBJECT       *Op,
985     UINT32                  CurrentByteOffset);
986 
987 ASL_RESOURCE_NODE *
988 RsDoIrqNoFlagsDescriptor (
989     ACPI_PARSE_OBJECT       *Op,
990     UINT32                  CurrentByteOffset);
991 
992 
993 /*
994  * aslrestype2 - Large resource descriptors
995  */
996 ASL_RESOURCE_NODE *
997 RsDoInterruptDescriptor (
998     ACPI_PARSE_OBJECT       *Op,
999     UINT32                  CurrentByteOffset);
1000 
1001 ASL_RESOURCE_NODE *
1002 RsDoVendorLargeDescriptor (
1003     ACPI_PARSE_OBJECT       *Op,
1004     UINT32                  CurrentByteOffset);
1005 
1006 ASL_RESOURCE_NODE *
1007 RsDoGeneralRegisterDescriptor (
1008     ACPI_PARSE_OBJECT       *Op,
1009     UINT32                  CurrentByteOffset);
1010 
1011 ASL_RESOURCE_NODE *
1012 RsDoGpioIntDescriptor (
1013     ACPI_PARSE_OBJECT       *Op,
1014     UINT32                  CurrentByteOffset);
1015 
1016 ASL_RESOURCE_NODE *
1017 RsDoGpioIoDescriptor (
1018     ACPI_PARSE_OBJECT       *Op,
1019     UINT32                  CurrentByteOffset);
1020 
1021 ASL_RESOURCE_NODE *
1022 RsDoI2cSerialBusDescriptor (
1023     ACPI_PARSE_OBJECT       *Op,
1024     UINT32                  CurrentByteOffset);
1025 
1026 ASL_RESOURCE_NODE *
1027 RsDoSpiSerialBusDescriptor (
1028     ACPI_PARSE_OBJECT       *Op,
1029     UINT32                  CurrentByteOffset);
1030 
1031 ASL_RESOURCE_NODE *
1032 RsDoUartSerialBusDescriptor (
1033     ACPI_PARSE_OBJECT       *Op,
1034     UINT32                  CurrentByteOffset);
1035 
1036 /*
1037  * aslrestype2d - DWord address descriptors
1038  */
1039 ASL_RESOURCE_NODE *
1040 RsDoDwordIoDescriptor (
1041     ACPI_PARSE_OBJECT       *Op,
1042     UINT32                  CurrentByteOffset);
1043 
1044 ASL_RESOURCE_NODE *
1045 RsDoDwordMemoryDescriptor (
1046     ACPI_PARSE_OBJECT       *Op,
1047     UINT32                  CurrentByteOffset);
1048 
1049 ASL_RESOURCE_NODE *
1050 RsDoDwordSpaceDescriptor (
1051     ACPI_PARSE_OBJECT       *Op,
1052     UINT32                  CurrentByteOffset);
1053 
1054 
1055 /*
1056  * aslrestype2e - Extended address descriptors
1057  */
1058 ASL_RESOURCE_NODE *
1059 RsDoExtendedIoDescriptor (
1060     ACPI_PARSE_OBJECT       *Op,
1061     UINT32                  CurrentByteOffset);
1062 
1063 ASL_RESOURCE_NODE *
1064 RsDoExtendedMemoryDescriptor (
1065     ACPI_PARSE_OBJECT       *Op,
1066     UINT32                  CurrentByteOffset);
1067 
1068 ASL_RESOURCE_NODE *
1069 RsDoExtendedSpaceDescriptor (
1070     ACPI_PARSE_OBJECT       *Op,
1071     UINT32                  CurrentByteOffset);
1072 
1073 
1074 /*
1075  * aslrestype2q - QWord address descriptors
1076  */
1077 ASL_RESOURCE_NODE *
1078 RsDoQwordIoDescriptor (
1079     ACPI_PARSE_OBJECT       *Op,
1080     UINT32                  CurrentByteOffset);
1081 
1082 ASL_RESOURCE_NODE *
1083 RsDoQwordMemoryDescriptor (
1084     ACPI_PARSE_OBJECT       *Op,
1085     UINT32                  CurrentByteOffset);
1086 
1087 ASL_RESOURCE_NODE *
1088 RsDoQwordSpaceDescriptor (
1089     ACPI_PARSE_OBJECT       *Op,
1090     UINT32                  CurrentByteOffset);
1091 
1092 
1093 /*
1094  * aslrestype2w - Word address descriptors
1095  */
1096 ASL_RESOURCE_NODE *
1097 RsDoWordIoDescriptor (
1098     ACPI_PARSE_OBJECT       *Op,
1099     UINT32                  CurrentByteOffset);
1100 
1101 ASL_RESOURCE_NODE *
1102 RsDoWordSpaceDescriptor (
1103     ACPI_PARSE_OBJECT       *Op,
1104     UINT32                  CurrentByteOffset);
1105 
1106 ASL_RESOURCE_NODE *
1107 RsDoWordBusNumberDescriptor (
1108     ACPI_PARSE_OBJECT       *Op,
1109     UINT32                  CurrentByteOffset);
1110 
1111 /*
1112  * Entry to data table compiler subsystem
1113  */
1114 ACPI_STATUS
1115 DtDoCompile(
1116     void);
1117 
1118 ACPI_STATUS
1119 DtCreateTemplates (
1120     char                    *Signature);
1121 
1122 #endif /*  __ASLCOMPILER_H */
1123 
1124