Rev 1498 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1498 | Rev 2216 | ||
---|---|---|---|
Line 7... | Line 7... | ||
7 | /****************************************************************************** |
7 | /****************************************************************************** |
8 | * |
8 | * |
9 | * 1. Copyright Notice |
9 | * 1. Copyright Notice |
10 | * |
10 | * |
11 | * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. |
11 | * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. |
12 | * All rights reserved. |
12 | * All rights reserved. |
13 | * |
13 | * |
14 | * 2. License |
14 | * 2. License |
15 | * |
15 | * |
16 | * 2.1. This is your license from Intel Corp. under its intellectual property |
16 | * 2.1. This is your license from Intel Corp. under its intellectual property |
Line 112... | Line 112... | ||
112 | * such license, approval or letter. |
112 | * such license, approval or letter. |
113 | * |
113 | * |
114 | *****************************************************************************/ |
114 | *****************************************************************************/ |
115 | 115 | ||
Line -... | Line 116... | ||
- | 116 | #include "aslcompiler.h" |
|
- | 117 | ||
116 | #include |
118 | #include |
117 | #include |
119 | #include |
118 | #include "aslcompiler.h" |
120 | #include |
Line 119... | Line 121... | ||
119 | 121 | ||
120 | #define _COMPONENT ACPI_COMPILER |
122 | #define _COMPONENT ACPI_COMPILER |
Line 121... | Line 123... | ||
121 | ACPI_MODULE_NAME ("aslcompile") |
123 | ACPI_MODULE_NAME ("aslcompile") |
Line 122... | Line 124... | ||
122 | 124 | ||
123 | /* Local prototypes */ |
125 | /* Local prototypes */ |
124 | 126 | ||
Line 125... | Line 127... | ||
125 | static void |
127 | static void |
126 | CmFlushSourceCode ( |
128 | CmFlushSourceCode ( |
127 | void); |
129 | void); |
128 | 130 | ||
Line 129... | Line 131... | ||
129 | void |
131 | static void |
130 | FlConsumeAnsiComment ( |
132 | FlConsumeAnsiComment ( |
131 | ASL_FILE_INFO *FileInfo, |
133 | ASL_FILE_INFO *FileInfo, |
132 | ASL_FILE_STATUS *Status); |
134 | ASL_FILE_STATUS *Status); |
Line 153... | Line 155... | ||
153 | AslCompilerSignon ( |
155 | AslCompilerSignon ( |
154 | UINT32 FileId) |
156 | UINT32 FileId) |
155 | { |
157 | { |
156 | char *Prefix = ""; |
158 | char *Prefix = ""; |
157 | 159 | char *UtilityName; |
|
- | 160 | ||
Line 158... | Line 161... | ||
158 | 161 | ||
Line 159... | Line 162... | ||
159 | /* Set line prefix depending on the destination file type */ |
162 | /* Set line prefix depending on the destination file type */ |
Line 190... | Line 193... | ||
190 | /* No other output types supported */ |
193 | /* No other output types supported */ |
191 | break; |
194 | break; |
192 | } |
195 | } |
193 | 196 | ||
Line 194... | Line -... | ||
194 | /* |
- | |
195 | * Compiler signon with copyright |
- | |
196 | */ |
- | |
197 | FlPrintFile (FileId, |
- | |
198 | "%s\n%s%s\n%s", |
- | |
199 | Prefix, |
- | |
200 | Prefix, IntelAcpiCA, |
- | |
201 | Prefix); |
- | |
202 | - | ||
203 | /* Running compiler or disassembler? */ |
197 | /* Running compiler or disassembler? */ |
Line 204... | Line 198... | ||
204 | 198 | ||
205 | if (Gbl_DisasmFlag) |
199 | if (Gbl_DisasmFlag) |
206 | { |
- | |
207 | FlPrintFile (FileId, |
200 | { |
208 | "%s", DisassemblerId); |
201 | UtilityName = AML_DISASSEMBLER_NAME; |
209 | } |
202 | } |
210 | else |
203 | else |
211 | { |
204 | { |
212 | FlPrintFile (FileId, |
- | |
213 | "%s", CompilerId); |
205 | UtilityName = ASL_COMPILER_NAME; |
Line 214... | Line 206... | ||
214 | } |
206 | } |
Line 215... | Line 207... | ||
215 | 207 | ||
216 | /* Version, build date, copyright, compliance */ |
- | |
217 | 208 | /* Compiler signon with copyright */ |
|
218 | FlPrintFile (FileId, |
- | |
219 | " version %X [%s]\n%s%s\n%s%s\n%s\n", |
- | |
220 | (UINT32) ACPI_CA_VERSION, __DATE__, |
- | |
221 | Prefix, CompilerCopyright, |
209 | |
Line 222... | Line 210... | ||
222 | Prefix, CompilerCompliance, |
210 | FlPrintFile (FileId, "%s\n", Prefix); |
223 | Prefix); |
211 | FlPrintFile (FileId, ACPI_COMMON_HEADER (UtilityName, Prefix)); |
Line 343... | Line 331... | ||
343 | * DESCRIPTION: Step over both types of comment during check for ascii chars |
331 | * DESCRIPTION: Step over both types of comment during check for ascii chars |
344 | * |
332 | * |
345 | ******************************************************************************/ |
333 | ******************************************************************************/ |
346 | 334 | ||
Line 347... | Line 335... | ||
347 | void |
335 | static void |
348 | FlConsumeAnsiComment ( |
336 | FlConsumeAnsiComment ( |
349 | ASL_FILE_INFO *FileInfo, |
337 | ASL_FILE_INFO *FileInfo, |
350 | ASL_FILE_STATUS *Status) |
338 | ASL_FILE_STATUS *Status) |
351 | { |
339 | { |
352 | UINT8 Byte; |
340 | UINT8 Byte; |
Line 387... | Line 375... | ||
387 | } |
375 | } |
388 | } |
376 | } |
389 | 377 | ||
Line 390... | Line 378... | ||
390 | 378 | ||
391 | void |
379 | static void |
392 | FlConsumeNewComment ( |
380 | FlConsumeNewComment ( |
393 | ASL_FILE_INFO *FileInfo, |
381 | ASL_FILE_INFO *FileInfo, |
394 | ASL_FILE_STATUS *Status) |
382 | ASL_FILE_STATUS *Status) |
395 | { |
383 | { |
Line 682... | Line 670... | ||
682 | /* Semantic error checking part two - typing of method returns */ |
670 | /* Semantic error checking part two - typing of method returns */ |
Line 683... | Line 671... | ||
683 | 671 | ||
684 | Event = UtBeginEvent ("Determine object types returned by methods"); |
672 | Event = UtBeginEvent ("Determine object types returned by methods"); |
685 | DbgPrint (ASL_DEBUG_OUTPUT, "\nSemantic analysis - Method typing\n\n"); |
673 | DbgPrint (ASL_DEBUG_OUTPUT, "\nSemantic analysis - Method typing\n\n"); |
686 | TrWalkParseTree (RootNode, ASL_WALK_VISIT_TWICE, |
- | |
687 | AnMethodTypingWalkBegin, |
674 | TrWalkParseTree (RootNode, ASL_WALK_VISIT_UPWARD, |
688 | AnMethodTypingWalkEnd, NULL); |
675 | NULL, AnMethodTypingWalkEnd, NULL); |
Line 689... | Line 676... | ||
689 | UtEndEvent (Event); |
676 | UtEndEvent (Event); |
Line 690... | Line 677... | ||
690 | 677 | ||
691 | /* Semantic error checking part three - operand type checking */ |
678 | /* Semantic error checking part three - operand type checking */ |
692 | 679 | ||
693 | Event = UtBeginEvent ("Analyze AML operand types"); |
- | |
694 | DbgPrint (ASL_DEBUG_OUTPUT, "\nSemantic analysis - Operand type checking\n\n"); |
680 | Event = UtBeginEvent ("Analyze AML operand types"); |
695 | TrWalkParseTree (RootNode, ASL_WALK_VISIT_TWICE, |
681 | DbgPrint (ASL_DEBUG_OUTPUT, "\nSemantic analysis - Operand type checking\n\n"); |
Line 696... | Line 682... | ||
696 | AnOperandTypecheckWalkBegin, |
682 | TrWalkParseTree (RootNode, ASL_WALK_VISIT_UPWARD, |
Line 697... | Line 683... | ||
697 | AnOperandTypecheckWalkEnd, &AnalysisWalkInfo); |
683 | NULL, AnOperandTypecheckWalkEnd, &AnalysisWalkInfo); |
698 | UtEndEvent (Event); |
684 | UtEndEvent (Event); |
699 | 685 | ||
700 | /* Semantic error checking part four - other miscellaneous checks */ |
686 | /* Semantic error checking part four - other miscellaneous checks */ |
701 | 687 | ||
702 | Event = UtBeginEvent ("Miscellaneous analysis"); |
688 | Event = UtBeginEvent ("Miscellaneous analysis"); |
Line 703... | Line 689... | ||
703 | DbgPrint (ASL_DEBUG_OUTPUT, "\nSemantic analysis - miscellaneous\n\n"); |
689 | DbgPrint (ASL_DEBUG_OUTPUT, "\nSemantic analysis - miscellaneous\n\n"); |
Line 704... | Line 690... | ||
704 | TrWalkParseTree (RootNode, ASL_WALK_VISIT_TWICE, |
690 | TrWalkParseTree (RootNode, ASL_WALK_VISIT_DOWNWARD, |
Line 901... | Line 887... | ||
901 | } |
887 | } |
902 | 888 | ||
Line 903... | Line 889... | ||
903 | /* |
889 | /* |
904 | * Delete intermediate ("combined") source file (if -ls flag not set) |
890 | * Delete intermediate ("combined") source file (if -ls flag not set) |
- | 891 | * This file is created during normal ASL/AML compiles. It is not |
|
- | 892 | * created by the data table compiler. |
|
- | 893 | * |
|
- | 894 | * If the -ls flag is set, then the .SRC file should not be deleted. |
|
- | 895 | * In this case, Gbl_SourceOutputFlag is set to TRUE. |
|
- | 896 | * |
|
- | 897 | * Note: Handles are cleared by FlCloseFile above, so we look at the |
|
- | 898 | * filename instead, to determine if the .SRC file was actually |
|
- | 899 | * created. |
|
905 | * |
900 | * |
906 | * TBD: SourceOutput should be .TMP, then rename if we want to keep it? |
901 | * TBD: SourceOutput should be .TMP, then rename if we want to keep it? |
907 | */ |
902 | */ |
908 | if (!Gbl_SourceOutputFlag) |
903 | if (!Gbl_SourceOutputFlag && Gbl_Files[ASL_FILE_SOURCE_OUTPUT].Filename) |
909 | { |
904 | { |
910 | if (remove (Gbl_Files[ASL_FILE_SOURCE_OUTPUT].Filename)) |
905 | if (remove (Gbl_Files[ASL_FILE_SOURCE_OUTPUT].Filename)) |
911 | { |
906 | { |
912 | printf ("%s: ", |
907 | printf ("%s: ", |
913 | Gbl_Files[ASL_FILE_SOURCE_OUTPUT].Filename); |
908 | Gbl_Files[ASL_FILE_SOURCE_OUTPUT].Filename); |