OSDN Git Service

klibc基本機能実装. ACPICAの準備
[vaneos/DivergeMirror.git] / drivers / acpi / compiler / aslcompiler.h
1 /******************************************************************************
2  *
3  * Module Name: aslcompiler.h - common include file for iASL
4  *
5  *****************************************************************************/
6
7 /******************************************************************************
8  *
9  * 1. Copyright Notice
10  *
11  * Some or all of this work - Copyright (c) 1999 - 2015, 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 #ifndef __ASLCOMPILER_H
117 #define __ASLCOMPILER_H
118
119 #include "acpi.h"
120 #include "accommon.h"
121 #include "amlresrc.h"
122 #include "acdebug.h"
123
124 /* Microsoft-specific */
125
126 #if (defined WIN32 || defined WIN64)
127
128 /* warn : used #pragma pack */
129 #pragma warning(disable:4103)
130
131 /* warn : named type definition in parentheses */
132 #pragma warning(disable:4115)
133 #endif
134
135 #include <stdio.h>
136 #include <stdlib.h>
137 #include <stdarg.h>
138 #include <string.h>
139 #include <errno.h>
140 #include <ctype.h>
141
142 /* Compiler headers */
143
144 #include "asldefine.h"
145 #include "asltypes.h"
146 #include "aslmessages.h"
147 #include "aslglobal.h"
148 #include "preprocess.h"
149
150
151 /*******************************************************************************
152  *
153  * Compiler prototypes
154  *
155  ******************************************************************************/
156
157 /*
158  * Main ASL parser - generated from flex/bison, lex/yacc, etc.
159  */
160 ACPI_PARSE_OBJECT *
161 AslDoError (
162     void);
163
164 int
165 AslCompilerlex(
166     void);
167
168 void
169 AslResetCurrentLineBuffer (
170     void);
171
172 void
173 AslInsertLineBuffer (
174     int                     SourceChar);
175
176 int
177 AslPopInputFileStack (
178     void);
179
180 void
181 AslPushInputFileStack (
182     FILE                    *InputFile,
183     char                    *Filename);
184
185 void
186 AslParserCleanup (
187     void);
188
189
190 /*
191  * aslstartup - entered from main()
192  */
193 void
194 AslInitializeGlobals (
195     void);
196
197 typedef
198 ACPI_STATUS (*ASL_PATHNAME_CALLBACK) (
199     char *);
200
201 ACPI_STATUS
202 AslDoOneFile (
203     char                    *Filename);
204
205 ACPI_STATUS
206 AslCheckForErrorExit (
207     void);
208
209
210 /*
211  * aslcompile - compile mainline
212  */
213 void
214 AslCompilerSignon (
215     UINT32                  FileId);
216
217 void
218 AslCompilerFileHeader (
219     UINT32                  FileId);
220
221 int
222 CmDoCompile (
223     void);
224
225 void
226 CmDoOutputFiles (
227     void);
228
229 void
230 CmCleanupAndExit (
231     void);
232
233 void
234 CmDeleteCaches (
235     void);
236
237
238 /*
239  * aslascii - ascii support
240  */
241 ACPI_STATUS
242 FlCheckForAcpiTable (
243     FILE                    *Handle);
244
245 ACPI_STATUS
246 FlCheckForAscii (
247     char                    *Filename,
248     BOOLEAN                 DisplayErrors);
249
250
251 /*
252  * aslwalks - semantic analysis and parse tree walks
253  */
254 ACPI_STATUS
255 AnOtherSemanticAnalysisWalkBegin (
256     ACPI_PARSE_OBJECT       *Op,
257     UINT32                  Level,
258     void                    *Context);
259
260 ACPI_STATUS
261 AnOtherSemanticAnalysisWalkEnd (
262     ACPI_PARSE_OBJECT       *Op,
263     UINT32                  Level,
264     void                    *Context);
265
266 ACPI_STATUS
267 AnOperandTypecheckWalkEnd (
268     ACPI_PARSE_OBJECT       *Op,
269     UINT32                  Level,
270     void                    *Context);
271
272 ACPI_STATUS
273 AnMethodTypingWalkEnd (
274     ACPI_PARSE_OBJECT       *Op,
275     UINT32                  Level,
276     void                    *Context);
277
278
279 /*
280  * aslmethod - Control method analysis walk
281  */
282 ACPI_STATUS
283 MtMethodAnalysisWalkBegin (
284     ACPI_PARSE_OBJECT       *Op,
285     UINT32                  Level,
286     void                    *Context);
287
288 ACPI_STATUS
289 MtMethodAnalysisWalkEnd (
290     ACPI_PARSE_OBJECT       *Op,
291     UINT32                  Level,
292     void                    *Context);
293
294
295 /*
296  * aslbtypes - bitfield data types
297  */
298 UINT32
299 AnMapObjTypeToBtype (
300     ACPI_PARSE_OBJECT       *Op);
301
302 UINT32
303 AnMapArgTypeToBtype (
304     UINT32                  ArgType);
305
306 UINT32
307 AnGetBtype (
308     ACPI_PARSE_OBJECT       *Op);
309
310 void
311 AnFormatBtype (
312     char                    *Buffer,
313     UINT32                  Btype);
314
315
316 /*
317  * aslanalyze - Support functions for parse tree walks
318  */
319 void
320 AnCheckId (
321     ACPI_PARSE_OBJECT       *Op,
322     ACPI_NAME               Type);
323
324 /* Values for Type argument above */
325
326 #define ASL_TYPE_HID        0
327 #define ASL_TYPE_CID        1
328
329 BOOLEAN
330 AnIsInternalMethod (
331     ACPI_PARSE_OBJECT       *Op);
332
333 UINT32
334 AnGetInternalMethodReturnType (
335     ACPI_PARSE_OBJECT       *Op);
336
337 BOOLEAN
338 AnLastStatementIsReturn (
339     ACPI_PARSE_OBJECT       *Op);
340
341 void
342 AnCheckMethodReturnValue (
343     ACPI_PARSE_OBJECT       *Op,
344     const ACPI_OPCODE_INFO  *OpInfo,
345     ACPI_PARSE_OBJECT       *ArgOp,
346     UINT32                  RequiredBtypes,
347     UINT32                  ThisNodeBtype);
348
349 BOOLEAN
350 AnIsResultUsed (
351     ACPI_PARSE_OBJECT       *Op);
352
353 void
354 ApCheckForGpeNameConflict (
355     ACPI_PARSE_OBJECT       *Op);
356
357 void
358 ApCheckRegMethod (
359     ACPI_PARSE_OBJECT       *Op);
360
361 BOOLEAN
362 ApFindNameInScope (
363     char                    *Name,
364     ACPI_PARSE_OBJECT       *Op);
365
366
367 /*
368  * aslerror - error handling/reporting
369  */
370 void
371 AslAbort (
372     void);
373
374 void
375 AslError (
376     UINT8                   Level,
377     UINT16                  MessageId,
378     ACPI_PARSE_OBJECT       *Op,
379     char                    *ExtraMessage);
380
381 ACPI_STATUS
382 AslDisableException (
383     char                    *MessageIdString);
384
385 BOOLEAN
386 AslIsExceptionDisabled (
387     UINT8                   Level,
388     UINT16                  MessageId);
389
390 void
391 AslCoreSubsystemError (
392     ACPI_PARSE_OBJECT       *Op,
393     ACPI_STATUS             Status,
394     char                    *ExtraMessage,
395     BOOLEAN                 Abort);
396
397 int
398 AslCompilererror(
399     const char              *s);
400
401 void
402 AslCommonError (
403     UINT8                   Level,
404     UINT16                  MessageId,
405     UINT32                  CurrentLineNumber,
406     UINT32                  LogicalLineNumber,
407     UINT32                  LogicalByteOffset,
408     UINT32                  Column,
409     char                    *Filename,
410     char                    *ExtraMessage);
411
412 void
413 AslCommonError2 (
414     UINT8                   Level,
415     UINT16                  MessageId,
416     UINT32                  LineNumber,
417     UINT32                  Column,
418     char                    *SourceLine,
419     char                    *Filename,
420     char                    *ExtraMessage);
421
422 void
423 AePrintException (
424     UINT32                  FileId,
425     ASL_ERROR_MSG           *Enode,
426     char                    *Header);
427
428 void
429 AePrintErrorLog (
430     UINT32                  FileId);
431
432 void
433 AeClearErrorLog (
434     void);
435
436
437 /*
438  * asllisting - generate all "listing" type files
439  */
440 void
441 LsDoListings (
442     void);
443
444 void
445 LsWriteNodeToAsmListing (
446     ACPI_PARSE_OBJECT       *Op);
447
448 void
449 LsWriteNode (
450     ACPI_PARSE_OBJECT       *Op,
451     UINT32                  FileId);
452
453 void
454 LsDumpParseTree (
455     void);
456
457
458 /*
459  * asllistsup - Listing file support utilities
460  */
461 void
462 LsDumpAscii (
463     UINT32                  FileId,
464     UINT32                  Count,
465     UINT8                   *Buffer);
466
467 void
468 LsDumpAsciiInComment (
469     UINT32                  FileId,
470     UINT32                  Count,
471     UINT8                   *Buffer);
472
473 void
474 LsCheckException (
475     UINT32                  LineNumber,
476     UINT32                  FileId);
477
478 void
479 LsFlushListingBuffer (
480     UINT32                  FileId);
481
482 void
483 LsWriteListingHexBytes (
484     UINT8                   *Buffer,
485     UINT32                  Length,
486     UINT32                  FileId);
487
488 void
489 LsWriteSourceLines (
490     UINT32                  ToLineNumber,
491     UINT32                  ToLogicalLineNumber,
492     UINT32                  FileId);
493
494 UINT32
495 LsWriteOneSourceLine (
496     UINT32                  FileId);
497
498 void
499 LsPushNode (
500     char                    *Filename);
501
502 ASL_LISTING_NODE *
503 LsPopNode (
504     void);
505
506
507 /*
508  * aslhex - generate all "hex" output files (C, ASM, ASL)
509  */
510 void
511 HxDoHexOutput (
512     void);
513
514
515 /*
516  * aslfold - constant folding
517  */
518 ACPI_STATUS
519 OpcAmlConstantWalk (
520     ACPI_PARSE_OBJECT       *Op,
521     UINT32                  Level,
522     void                    *Context);
523
524
525 /*
526  * aslmessages - exception strings
527  */
528 const char *
529 AeDecodeMessageId (
530     UINT16                  MessageId);
531
532 const char *
533 AeDecodeExceptionLevel (
534     UINT8                   Level);
535
536 UINT16
537 AeBuildFullExceptionCode (
538     UINT8                   Level,
539     UINT16                  MessageId);
540
541 /*
542  * asloffset - generate C offset file for BIOS support
543  */
544 ACPI_STATUS
545 LsAmlOffsetWalk (
546     ACPI_PARSE_OBJECT       *Op,
547     UINT32                  Level,
548     void                    *Context);
549
550 void
551 LsDoOffsetTableHeader (
552     UINT32                  FileId);
553
554 void
555 LsDoOffsetTableFooter (
556     UINT32                  FileId);
557
558
559 /*
560  * aslopcodes - generate AML opcodes
561  */
562 ACPI_STATUS
563 OpcAmlOpcodeWalk (
564     ACPI_PARSE_OBJECT       *Op,
565     UINT32                  Level,
566     void                    *Context);
567
568 ACPI_STATUS
569 OpcAmlOpcodeUpdateWalk (
570     ACPI_PARSE_OBJECT       *Op,
571     UINT32                  Level,
572     void                    *Context);
573
574 void
575 OpcGenerateAmlOpcode (
576     ACPI_PARSE_OBJECT       *Op);
577
578 UINT32
579 OpcSetOptimalIntegerSize (
580     ACPI_PARSE_OBJECT       *Op);
581
582 void
583 OpcGetIntegerWidth (
584     ACPI_PARSE_OBJECT       *Op);
585
586
587 /*
588  * asloperands - generate AML operands for the AML opcodes
589  */
590 ACPI_PARSE_OBJECT  *
591 UtGetArg (
592     ACPI_PARSE_OBJECT       *Op,
593     UINT32                  Argn);
594
595 void
596 OpnGenerateAmlOperands (
597     ACPI_PARSE_OBJECT       *Op);
598
599 void
600 OpnDoPackage (
601     ACPI_PARSE_OBJECT       *Op);
602
603
604 /*
605  * aslopt - optmization
606  */
607 void
608 OptOptimizeNamePath (
609     ACPI_PARSE_OBJECT       *Op,
610     UINT32                  Flags,
611     ACPI_WALK_STATE         *WalkState,
612     char                    *AmlNameString,
613     ACPI_NAMESPACE_NODE     *TargetNode);
614
615
616 /*
617  * aslprintf - Printf/Fprintf macros
618  */
619 void
620 OpcDoPrintf (
621     ACPI_PARSE_OBJECT       *Op);
622
623 void
624 OpcDoFprintf (
625     ACPI_PARSE_OBJECT       *Op);
626
627
628 /*
629  * aslprune - parse tree pruner
630  */
631 void
632 AslPruneParseTree (
633     UINT32                  PruneDepth,
634     UINT32                  Type);
635
636
637 /*
638  * aslcodegen - code generation
639  */
640 void
641 CgGenerateAmlOutput (
642     void);
643
644
645 /*
646  * aslfile
647  */
648 void
649 FlOpenFile (
650     UINT32                  FileId,
651     char                    *Filename,
652     char                    *Mode);
653
654
655 /*
656  * asllength - calculate/adjust AML package lengths
657  */
658 ACPI_STATUS
659 LnPackageLengthWalk (
660     ACPI_PARSE_OBJECT       *Op,
661     UINT32                  Level,
662     void                    *Context);
663
664 ACPI_STATUS
665 LnInitLengthsWalk (
666     ACPI_PARSE_OBJECT       *Op,
667     UINT32                  Level,
668     void                    *Context);
669
670 void
671 CgGenerateAmlLengths (
672     ACPI_PARSE_OBJECT       *Op);
673
674
675 /*
676  * aslmap - opcode mappings and reserved method names
677  */
678 ACPI_OBJECT_TYPE
679 AslMapNamedOpcodeToDataType (
680     UINT16                  Opcode);
681
682
683 /*
684  * aslpredef - ACPI predefined names support
685  */
686 BOOLEAN
687 ApCheckForPredefinedMethod (
688     ACPI_PARSE_OBJECT       *Op,
689     ASL_METHOD_INFO         *MethodInfo);
690
691 void
692 ApCheckPredefinedReturnValue (
693     ACPI_PARSE_OBJECT       *Op,
694     ASL_METHOD_INFO         *MethodInfo);
695
696 UINT32
697 ApCheckForPredefinedName (
698     ACPI_PARSE_OBJECT       *Op,
699     char                    *Name);
700
701 void
702 ApCheckForPredefinedObject (
703     ACPI_PARSE_OBJECT       *Op,
704     char                    *Name);
705
706 ACPI_STATUS
707 ApCheckObjectType (
708     const char              *PredefinedName,
709     ACPI_PARSE_OBJECT       *Op,
710     UINT32                  ExpectedBtypes,
711     UINT32                  PackageIndex);
712
713 void
714 ApDisplayReservedNames (
715     void);
716
717
718 /*
719  * aslprepkg - ACPI predefined names support for packages
720  */
721 void
722 ApCheckPackage (
723     ACPI_PARSE_OBJECT           *ParentOp,
724     const ACPI_PREDEFINED_INFO  *Predefined);
725
726
727 /*
728  * asltransform - parse tree transformations
729  */
730 ACPI_STATUS
731 TrAmlTransformWalk (
732     ACPI_PARSE_OBJECT       *Op,
733     UINT32                  Level,
734     void                    *Context);
735
736
737 /*
738  * asltree - parse tree support
739  */
740 ACPI_STATUS
741 TrWalkParseTree (
742     ACPI_PARSE_OBJECT       *Op,
743     UINT32                  Visitation,
744     ASL_WALK_CALLBACK       DescendingCallback,
745     ASL_WALK_CALLBACK       AscendingCallback,
746     void                    *Context);
747
748 /* Values for "Visitation" parameter above */
749
750 #define ASL_WALK_VISIT_DOWNWARD     0x01
751 #define ASL_WALK_VISIT_UPWARD       0x02
752 #define ASL_WALK_VISIT_TWICE        (ASL_WALK_VISIT_DOWNWARD | ASL_WALK_VISIT_UPWARD)
753
754
755 ACPI_PARSE_OBJECT *
756 TrAllocateNode (
757     UINT32                  ParseOpcode);
758
759 void
760 TrPrintNodeCompileFlags (
761     UINT32                  Flags);
762
763 void
764 TrReleaseNode (
765     ACPI_PARSE_OBJECT       *Op);
766
767 ACPI_PARSE_OBJECT *
768 TrUpdateNode (
769     UINT32                  ParseOpcode,
770     ACPI_PARSE_OBJECT       *Op);
771
772 ACPI_PARSE_OBJECT *
773 TrCreateNode (
774     UINT32                  ParseOpcode,
775     UINT32                  NumChildren,
776     ...);
777
778 ACPI_PARSE_OBJECT *
779 TrCreateLeafNode (
780     UINT32                  ParseOpcode);
781
782 ACPI_PARSE_OBJECT *
783 TrCreateNullTarget (
784     void);
785
786 ACPI_PARSE_OBJECT *
787 TrCreateAssignmentNode (
788     ACPI_PARSE_OBJECT       *Target,
789     ACPI_PARSE_OBJECT       *Source);
790
791 ACPI_PARSE_OBJECT *
792 TrCreateTargetOperand (
793     ACPI_PARSE_OBJECT       *OriginalOp,
794     ACPI_PARSE_OBJECT       *ParentOp);
795
796 ACPI_PARSE_OBJECT *
797 TrCreateValuedLeafNode (
798     UINT32                  ParseOpcode,
799     UINT64                  Value);
800
801 ACPI_PARSE_OBJECT *
802 TrCreateConstantLeafNode (
803     UINT32                  ParseOpcode);
804
805 ACPI_PARSE_OBJECT *
806 TrLinkChildren (
807     ACPI_PARSE_OBJECT       *Op,
808     UINT32                  NumChildren,
809     ...);
810
811 void
812 TrSetEndLineNumber (
813     ACPI_PARSE_OBJECT       *Op);
814
815 void
816 TrWalkTree (
817     void);
818
819 ACPI_PARSE_OBJECT *
820 TrLinkPeerNode (
821     ACPI_PARSE_OBJECT       *Op1,
822     ACPI_PARSE_OBJECT       *Op2);
823
824 ACPI_PARSE_OBJECT *
825 TrLinkChildNode (
826     ACPI_PARSE_OBJECT       *Op1,
827     ACPI_PARSE_OBJECT       *Op2);
828
829 ACPI_PARSE_OBJECT *
830 TrSetNodeFlags (
831     ACPI_PARSE_OBJECT       *Op,
832     UINT32                  Flags);
833
834 ACPI_PARSE_OBJECT *
835 TrSetNodeAmlLength (
836     ACPI_PARSE_OBJECT       *Op,
837     UINT32                  Length);
838
839 ACPI_PARSE_OBJECT *
840 TrLinkPeerNodes (
841     UINT32                  NumPeers,
842     ...);
843
844
845 /*
846  * aslfiles - File I/O support
847  */
848 void
849 FlAddIncludeDirectory (
850     char                    *Dir);
851
852 char *
853 FlMergePathnames (
854     char                    *PrefixDir,
855     char                    *FilePathname);
856
857 void
858 FlOpenIncludeFile (
859     ACPI_PARSE_OBJECT       *Op);
860
861 void
862 FlFileError (
863     UINT32                  FileId,
864     UINT8                   ErrorId);
865
866 UINT32
867 FlGetFileSize (
868     UINT32                  FileId);
869
870 ACPI_STATUS
871 FlReadFile (
872     UINT32                  FileId,
873     void                    *Buffer,
874     UINT32                  Length);
875
876 void
877 FlWriteFile (
878     UINT32                  FileId,
879     void                    *Buffer,
880     UINT32                  Length);
881
882 void
883 FlSeekFile (
884     UINT32                  FileId,
885     long                    Offset);
886
887 void
888 FlCloseFile (
889     UINT32                  FileId);
890
891 void
892 FlPrintFile (
893     UINT32                  FileId,
894     char                    *Format,
895     ...);
896
897 void
898 FlDeleteFile (
899     UINT32                  FileId);
900
901 void
902 FlSetLineNumber (
903     UINT32                  LineNumber);
904
905 void
906 FlSetFilename (
907     char                    *Filename);
908
909 ACPI_STATUS
910 FlOpenInputFile (
911     char                    *InputFilename);
912
913 ACPI_STATUS
914 FlOpenAmlOutputFile (
915     char                    *InputFilename);
916
917 ACPI_STATUS
918 FlOpenMiscOutputFiles (
919     char                    *InputFilename);
920
921 /*
922  * aslhwmap - hardware map summary
923  */
924 void
925 MpEmitMappingInfo (
926     void);
927
928
929 /*
930  * asload - load namespace in prep for cross reference
931  */
932 ACPI_STATUS
933 LdLoadNamespace (
934     ACPI_PARSE_OBJECT       *RootOp);
935
936
937 /*
938  * asllookup - namespace lookup functions
939  */
940 void
941 LkFindUnreferencedObjects (
942     void);
943
944 /*
945  * aslmain - startup
946  */
947 void
948 Usage (
949     void);
950
951 void
952 AslFilenameHelp (
953     void);
954
955
956 /*
957  * aslnamesp - namespace output file generation
958  */
959 ACPI_STATUS
960 NsDisplayNamespace (
961     void);
962
963 void
964 NsSetupNamespaceListing (
965     void                    *Handle);
966
967 /*
968  * asloptions - command line processing
969  */
970 int
971 AslCommandLine (
972     int                     argc,
973     char                    **argv);
974
975 /*
976  * aslxref - namespace cross reference
977  */
978 ACPI_STATUS
979 XfCrossReferenceNamespace (
980     void);
981
982
983 /*
984  * aslutils - common compiler utilites
985  */
986 void
987 DbgPrint (
988     UINT32                  Type,
989     char                    *Format,
990     ...);
991
992 /* Type values for above */
993
994 #define ASL_DEBUG_OUTPUT    0
995 #define ASL_PARSE_OUTPUT    1
996 #define ASL_TREE_OUTPUT     2
997
998 void
999 UtDisplaySupportedTables (
1000     void);
1001
1002 void
1003 UtDisplayConstantOpcodes (
1004     void);
1005
1006 UINT8
1007 UtBeginEvent (
1008     char                    *Name);
1009
1010 void
1011 UtEndEvent (
1012     UINT8                   Event);
1013
1014 void *
1015 UtLocalCalloc (
1016     UINT32                  Size);
1017
1018 void
1019 UtPrintFormattedName (
1020     UINT16                  ParseOpcode,
1021     UINT32                  Level);
1022
1023 void
1024 UtDisplaySummary (
1025     UINT32                  FileId);
1026
1027 void
1028 UtConvertByteToHex (
1029     UINT8                   RawByte,
1030     UINT8                   *Buffer);
1031
1032 void
1033 UtConvertByteToAsmHex (
1034     UINT8                   RawByte,
1035     UINT8                   *Buffer);
1036
1037 char *
1038 UtGetOpName (
1039     UINT32                  ParseOpcode);
1040
1041 void
1042 UtSetParseOpName (
1043     ACPI_PARSE_OBJECT       *Op);
1044
1045 char *
1046 UtStringCacheCalloc (
1047     UINT32                  Length);
1048
1049 void
1050 UtExpandLineBuffers (
1051     void);
1052
1053 void
1054 UtFreeLineBuffers (
1055     void);
1056
1057 ACPI_STATUS
1058 UtInternalizeName (
1059     char                    *ExternalName,
1060     char                    **ConvertedName);
1061
1062 void
1063 UtAttachNamepathToOwner (
1064     ACPI_PARSE_OBJECT       *Op,
1065     ACPI_PARSE_OBJECT       *NameNode);
1066
1067 ACPI_PARSE_OBJECT *
1068 UtCheckIntegerRange (
1069     ACPI_PARSE_OBJECT       *Op,
1070     UINT32                  LowValue,
1071     UINT32                  HighValue);
1072
1073 UINT64
1074 UtDoConstant (
1075     char                    *String);
1076
1077 ACPI_STATUS
1078 UtStrtoul64 (
1079     char                    *String,
1080     UINT32                  Base,
1081     UINT64                  *RetInteger);
1082
1083
1084 /*
1085  * asluuid - UUID support
1086  */
1087 ACPI_STATUS
1088 AuValidateUuid (
1089     char                    *InString);
1090
1091 ACPI_STATUS
1092 AuConvertUuidToString (
1093     char                    *UuIdBuffer,
1094     char                    *OutString);
1095
1096 /*
1097  * aslresource - Resource template generation utilities
1098  */
1099 void
1100 RsSmallAddressCheck (
1101     UINT8                   Type,
1102     UINT32                  Minimum,
1103     UINT32                  Maximum,
1104     UINT32                  Length,
1105     UINT32                  Alignment,
1106     ACPI_PARSE_OBJECT       *MinOp,
1107     ACPI_PARSE_OBJECT       *MaxOp,
1108     ACPI_PARSE_OBJECT       *LengthOp,
1109     ACPI_PARSE_OBJECT       *AlignOp,
1110     ACPI_PARSE_OBJECT       *Op);
1111
1112 void
1113 RsLargeAddressCheck (
1114     UINT64                  Minimum,
1115     UINT64                  Maximum,
1116     UINT64                  Length,
1117     UINT64                  Granularity,
1118     UINT8                   Flags,
1119     ACPI_PARSE_OBJECT       *MinOp,
1120     ACPI_PARSE_OBJECT       *MaxOp,
1121     ACPI_PARSE_OBJECT       *LengthOp,
1122     ACPI_PARSE_OBJECT       *GranOp,
1123     ACPI_PARSE_OBJECT       *Op);
1124
1125 UINT16
1126 RsGetStringDataLength (
1127     ACPI_PARSE_OBJECT       *InitializerOp);
1128
1129 ASL_RESOURCE_NODE *
1130 RsAllocateResourceNode (
1131     UINT32                  Size);
1132
1133 void
1134 RsCreateResourceField (
1135     ACPI_PARSE_OBJECT       *Op,
1136     char                    *Name,
1137     UINT32                  ByteOffset,
1138     UINT32                  BitOffset,
1139     UINT32                  BitLength);
1140
1141 void
1142 RsSetFlagBits (
1143     UINT8                   *Flags,
1144     ACPI_PARSE_OBJECT       *Op,
1145     UINT8                   Position,
1146     UINT8                   DefaultBit);
1147
1148 void
1149 RsSetFlagBits16 (
1150     UINT16                  *Flags,
1151     ACPI_PARSE_OBJECT       *Op,
1152     UINT8                   Position,
1153     UINT8                   DefaultBit);
1154
1155 ACPI_PARSE_OBJECT *
1156 RsCompleteNodeAndGetNext (
1157     ACPI_PARSE_OBJECT       *Op);
1158
1159 void
1160 RsCheckListForDuplicates (
1161     ACPI_PARSE_OBJECT       *Op);
1162
1163 ASL_RESOURCE_NODE *
1164 RsDoOneResourceDescriptor (
1165     ASL_RESOURCE_INFO       *Info,
1166     UINT8                   *State);
1167
1168 /* Values for State above */
1169
1170 #define ACPI_RSTATE_NORMAL              0
1171 #define ACPI_RSTATE_START_DEPENDENT     1
1172 #define ACPI_RSTATE_DEPENDENT_LIST      2
1173
1174 UINT32
1175 RsLinkDescriptorChain (
1176     ASL_RESOURCE_NODE       **PreviousRnode,
1177     ASL_RESOURCE_NODE       *Rnode);
1178
1179 void
1180 RsDoResourceTemplate (
1181     ACPI_PARSE_OBJECT       *Op);
1182
1183
1184 /*
1185  * aslrestype1 - Miscellaneous Small descriptors
1186  */
1187 ASL_RESOURCE_NODE *
1188 RsDoEndTagDescriptor (
1189     ASL_RESOURCE_INFO       *Info);
1190
1191 ASL_RESOURCE_NODE *
1192 RsDoEndDependentDescriptor (
1193     ASL_RESOURCE_INFO       *Info);
1194
1195 ASL_RESOURCE_NODE *
1196 RsDoMemory24Descriptor (
1197     ASL_RESOURCE_INFO       *Info);
1198
1199 ASL_RESOURCE_NODE *
1200 RsDoMemory32Descriptor (
1201     ASL_RESOURCE_INFO       *Info);
1202
1203 ASL_RESOURCE_NODE *
1204 RsDoMemory32FixedDescriptor (
1205     ASL_RESOURCE_INFO       *Info);
1206
1207 ASL_RESOURCE_NODE *
1208 RsDoStartDependentDescriptor (
1209     ASL_RESOURCE_INFO       *Info);
1210
1211 ASL_RESOURCE_NODE *
1212 RsDoStartDependentNoPriDescriptor (
1213     ASL_RESOURCE_INFO       *Info);
1214
1215 ASL_RESOURCE_NODE *
1216 RsDoVendorSmallDescriptor (
1217     ASL_RESOURCE_INFO       *Info);
1218
1219
1220 /*
1221  * aslrestype1i - I/O-related Small descriptors
1222  */
1223 ASL_RESOURCE_NODE *
1224 RsDoDmaDescriptor (
1225     ASL_RESOURCE_INFO       *Info);
1226
1227 ASL_RESOURCE_NODE *
1228 RsDoFixedDmaDescriptor (
1229     ASL_RESOURCE_INFO       *Info);
1230
1231 ASL_RESOURCE_NODE *
1232 RsDoFixedIoDescriptor (
1233     ASL_RESOURCE_INFO       *Info);
1234
1235 ASL_RESOURCE_NODE *
1236 RsDoIoDescriptor (
1237     ASL_RESOURCE_INFO       *Info);
1238
1239 ASL_RESOURCE_NODE *
1240 RsDoIrqDescriptor (
1241     ASL_RESOURCE_INFO       *Info);
1242
1243 ASL_RESOURCE_NODE *
1244 RsDoIrqNoFlagsDescriptor (
1245     ASL_RESOURCE_INFO       *Info);
1246
1247
1248 /*
1249  * aslrestype2 - Large resource descriptors
1250  */
1251 ASL_RESOURCE_NODE *
1252 RsDoInterruptDescriptor (
1253     ASL_RESOURCE_INFO       *Info);
1254
1255 ASL_RESOURCE_NODE *
1256 RsDoVendorLargeDescriptor (
1257     ASL_RESOURCE_INFO       *Info);
1258
1259 ASL_RESOURCE_NODE *
1260 RsDoGeneralRegisterDescriptor (
1261     ASL_RESOURCE_INFO       *Info);
1262
1263 ASL_RESOURCE_NODE *
1264 RsDoGpioIntDescriptor (
1265     ASL_RESOURCE_INFO       *Info);
1266
1267 ASL_RESOURCE_NODE *
1268 RsDoGpioIoDescriptor (
1269     ASL_RESOURCE_INFO       *Info);
1270
1271 ASL_RESOURCE_NODE *
1272 RsDoI2cSerialBusDescriptor (
1273     ASL_RESOURCE_INFO       *Info);
1274
1275 ASL_RESOURCE_NODE *
1276 RsDoSpiSerialBusDescriptor (
1277     ASL_RESOURCE_INFO       *Info);
1278
1279 ASL_RESOURCE_NODE *
1280 RsDoUartSerialBusDescriptor (
1281     ASL_RESOURCE_INFO       *Info);
1282
1283 /*
1284  * aslrestype2d - DWord address descriptors
1285  */
1286 ASL_RESOURCE_NODE *
1287 RsDoDwordIoDescriptor (
1288     ASL_RESOURCE_INFO       *Info);
1289
1290 ASL_RESOURCE_NODE *
1291 RsDoDwordMemoryDescriptor (
1292     ASL_RESOURCE_INFO       *Info);
1293
1294 ASL_RESOURCE_NODE *
1295 RsDoDwordSpaceDescriptor (
1296     ASL_RESOURCE_INFO       *Info);
1297
1298
1299 /*
1300  * aslrestype2e - Extended address descriptors
1301  */
1302 ASL_RESOURCE_NODE *
1303 RsDoExtendedIoDescriptor (
1304     ASL_RESOURCE_INFO       *Info);
1305
1306 ASL_RESOURCE_NODE *
1307 RsDoExtendedMemoryDescriptor (
1308     ASL_RESOURCE_INFO       *Info);
1309
1310 ASL_RESOURCE_NODE *
1311 RsDoExtendedSpaceDescriptor (
1312     ASL_RESOURCE_INFO       *Info);
1313
1314
1315 /*
1316  * aslrestype2q - QWord address descriptors
1317  */
1318 ASL_RESOURCE_NODE *
1319 RsDoQwordIoDescriptor (
1320     ASL_RESOURCE_INFO       *Info);
1321
1322 ASL_RESOURCE_NODE *
1323 RsDoQwordMemoryDescriptor (
1324     ASL_RESOURCE_INFO       *Info);
1325
1326 ASL_RESOURCE_NODE *
1327 RsDoQwordSpaceDescriptor (
1328     ASL_RESOURCE_INFO       *Info);
1329
1330
1331 /*
1332  * aslrestype2w - Word address descriptors
1333  */
1334 ASL_RESOURCE_NODE *
1335 RsDoWordIoDescriptor (
1336     ASL_RESOURCE_INFO       *Info);
1337
1338 ASL_RESOURCE_NODE *
1339 RsDoWordSpaceDescriptor (
1340     ASL_RESOURCE_INFO       *Info);
1341
1342 ASL_RESOURCE_NODE *
1343 RsDoWordBusNumberDescriptor (
1344     ASL_RESOURCE_INFO       *Info);
1345
1346
1347 /*
1348  * Entry to data table compiler subsystem
1349  */
1350 ACPI_STATUS
1351 DtDoCompile(
1352     void);
1353
1354 ACPI_STATUS
1355 DtCreateTemplates (
1356     char                    *Signature);
1357
1358 #endif /*  __ASLCOMPILER_H */