prutils.c revision 1.3.10.2 1 1.3.10.2 tls /******************************************************************************
2 1.3.10.2 tls *
3 1.3.10.2 tls * Module Name: prutils - Preprocessor utilities
4 1.3.10.2 tls *
5 1.3.10.2 tls *****************************************************************************/
6 1.3.10.2 tls
7 1.3.10.2 tls /*
8 1.3.10.2 tls * Copyright (C) 2000 - 2013, Intel Corp.
9 1.3.10.2 tls * All rights reserved.
10 1.3.10.2 tls *
11 1.3.10.2 tls * Redistribution and use in source and binary forms, with or without
12 1.3.10.2 tls * modification, are permitted provided that the following conditions
13 1.3.10.2 tls * are met:
14 1.3.10.2 tls * 1. Redistributions of source code must retain the above copyright
15 1.3.10.2 tls * notice, this list of conditions, and the following disclaimer,
16 1.3.10.2 tls * without modification.
17 1.3.10.2 tls * 2. Redistributions in binary form must reproduce at minimum a disclaimer
18 1.3.10.2 tls * substantially similar to the "NO WARRANTY" disclaimer below
19 1.3.10.2 tls * ("Disclaimer") and any redistribution must be conditioned upon
20 1.3.10.2 tls * including a substantially similar Disclaimer requirement for further
21 1.3.10.2 tls * binary redistribution.
22 1.3.10.2 tls * 3. Neither the names of the above-listed copyright holders nor the names
23 1.3.10.2 tls * of any contributors may be used to endorse or promote products derived
24 1.3.10.2 tls * from this software without specific prior written permission.
25 1.3.10.2 tls *
26 1.3.10.2 tls * Alternatively, this software may be distributed under the terms of the
27 1.3.10.2 tls * GNU General Public License ("GPL") version 2 as published by the Free
28 1.3.10.2 tls * Software Foundation.
29 1.3.10.2 tls *
30 1.3.10.2 tls * NO WARRANTY
31 1.3.10.2 tls * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
32 1.3.10.2 tls * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
33 1.3.10.2 tls * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
34 1.3.10.2 tls * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
35 1.3.10.2 tls * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
36 1.3.10.2 tls * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
37 1.3.10.2 tls * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
38 1.3.10.2 tls * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
39 1.3.10.2 tls * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
40 1.3.10.2 tls * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
41 1.3.10.2 tls * POSSIBILITY OF SUCH DAMAGES.
42 1.3.10.2 tls */
43 1.3.10.2 tls
44 1.3.10.2 tls #include "aslcompiler.h"
45 1.3.10.2 tls #include "dtcompiler.h"
46 1.3.10.2 tls
47 1.3.10.2 tls
48 1.3.10.2 tls #define _COMPONENT ASL_PREPROCESSOR
49 1.3.10.2 tls ACPI_MODULE_NAME ("prutils")
50 1.3.10.2 tls
51 1.3.10.2 tls
52 1.3.10.2 tls /******************************************************************************
53 1.3.10.2 tls *
54 1.3.10.2 tls * FUNCTION: PrGetNextToken
55 1.3.10.2 tls *
56 1.3.10.2 tls * PARAMETERS: Buffer - Current line buffer
57 1.3.10.2 tls * MatchString - String with valid token delimiters
58 1.3.10.2 tls * Next - Set to next possible token in buffer
59 1.3.10.2 tls *
60 1.3.10.2 tls * RETURN: Next token (null-terminated). Modifies the input line.
61 1.3.10.2 tls * Remainder of line is stored in *Next.
62 1.3.10.2 tls *
63 1.3.10.2 tls * DESCRIPTION: Local implementation of strtok() with local storage for the
64 1.3.10.2 tls * next pointer. Not only thread-safe, but allows multiple
65 1.3.10.2 tls * parsing of substrings such as expressions.
66 1.3.10.2 tls *
67 1.3.10.2 tls *****************************************************************************/
68 1.3.10.2 tls
69 1.3.10.2 tls char *
70 1.3.10.2 tls PrGetNextToken (
71 1.3.10.2 tls char *Buffer,
72 1.3.10.2 tls char *MatchString,
73 1.3.10.2 tls char **Next)
74 1.3.10.2 tls {
75 1.3.10.2 tls char *TokenStart;
76 1.3.10.2 tls
77 1.3.10.2 tls
78 1.3.10.2 tls if (!Buffer)
79 1.3.10.2 tls {
80 1.3.10.2 tls /* Use Next if it is valid */
81 1.3.10.2 tls
82 1.3.10.2 tls Buffer = *Next;
83 1.3.10.2 tls if (!(*Next))
84 1.3.10.2 tls {
85 1.3.10.2 tls return (NULL);
86 1.3.10.2 tls }
87 1.3.10.2 tls }
88 1.3.10.2 tls
89 1.3.10.2 tls /* Skip any leading delimiters */
90 1.3.10.2 tls
91 1.3.10.2 tls while (*Buffer)
92 1.3.10.2 tls {
93 1.3.10.2 tls if (strchr (MatchString, *Buffer))
94 1.3.10.2 tls {
95 1.3.10.2 tls Buffer++;
96 1.3.10.2 tls }
97 1.3.10.2 tls else
98 1.3.10.2 tls {
99 1.3.10.2 tls break;
100 1.3.10.2 tls }
101 1.3.10.2 tls }
102 1.3.10.2 tls
103 1.3.10.2 tls /* Anything left on the line? */
104 1.3.10.2 tls
105 1.3.10.2 tls if (!(*Buffer))
106 1.3.10.2 tls {
107 1.3.10.2 tls *Next = NULL;
108 1.3.10.2 tls return (NULL);
109 1.3.10.2 tls }
110 1.3.10.2 tls
111 1.3.10.2 tls TokenStart = Buffer;
112 1.3.10.2 tls
113 1.3.10.2 tls /* Find the end of this token */
114 1.3.10.2 tls
115 1.3.10.2 tls while (*Buffer)
116 1.3.10.2 tls {
117 1.3.10.2 tls if (strchr (MatchString, *Buffer))
118 1.3.10.2 tls {
119 1.3.10.2 tls *Buffer = 0;
120 1.3.10.2 tls *Next = Buffer+1;
121 1.3.10.2 tls if (!**Next)
122 1.3.10.2 tls {
123 1.3.10.2 tls *Next = NULL;
124 1.3.10.2 tls }
125 1.3.10.2 tls return (TokenStart);
126 1.3.10.2 tls }
127 1.3.10.2 tls Buffer++;
128 1.3.10.2 tls }
129 1.3.10.2 tls
130 1.3.10.2 tls *Next = NULL;
131 1.3.10.2 tls return (TokenStart);
132 1.3.10.2 tls }
133 1.3.10.2 tls
134 1.3.10.2 tls
135 1.3.10.2 tls /*******************************************************************************
136 1.3.10.2 tls *
137 1.3.10.2 tls * FUNCTION: PrError
138 1.3.10.2 tls *
139 1.3.10.2 tls * PARAMETERS: Level - Seriousness (Warning/error, etc.)
140 1.3.10.2 tls * MessageId - Index into global message buffer
141 1.3.10.2 tls * Column - Column in current line
142 1.3.10.2 tls *
143 1.3.10.2 tls * RETURN: None
144 1.3.10.2 tls *
145 1.3.10.2 tls * DESCRIPTION: Preprocessor error reporting. Front end to AslCommonError2
146 1.3.10.2 tls *
147 1.3.10.2 tls ******************************************************************************/
148 1.3.10.2 tls
149 1.3.10.2 tls void
150 1.3.10.2 tls PrError (
151 1.3.10.2 tls UINT8 Level,
152 1.3.10.2 tls UINT8 MessageId,
153 1.3.10.2 tls UINT32 Column)
154 1.3.10.2 tls {
155 1.3.10.2 tls #if 0
156 1.3.10.2 tls AcpiOsPrintf ("%s (%u) : %s", Gbl_Files[ASL_FILE_INPUT].Filename,
157 1.3.10.2 tls Gbl_CurrentLineNumber, Gbl_CurrentLineBuffer);
158 1.3.10.2 tls #endif
159 1.3.10.2 tls
160 1.3.10.2 tls
161 1.3.10.2 tls if (Column > 120)
162 1.3.10.2 tls {
163 1.3.10.2 tls Column = 0;
164 1.3.10.2 tls }
165 1.3.10.2 tls
166 1.3.10.2 tls /* TBD: Need Logical line number? */
167 1.3.10.2 tls
168 1.3.10.2 tls AslCommonError2 (Level, MessageId,
169 1.3.10.2 tls Gbl_CurrentLineNumber, Column,
170 1.3.10.2 tls Gbl_CurrentLineBuffer,
171 1.3.10.2 tls Gbl_Files[ASL_FILE_INPUT].Filename, "Preprocessor");
172 1.3.10.2 tls
173 1.3.10.2 tls Gbl_PreprocessorError = TRUE;
174 1.3.10.2 tls }
175 1.3.10.2 tls
176 1.3.10.2 tls
177 1.3.10.2 tls /*******************************************************************************
178 1.3.10.2 tls *
179 1.3.10.2 tls * FUNCTION: PrReplaceData
180 1.3.10.2 tls *
181 1.3.10.2 tls * PARAMETERS: Buffer - Original(target) buffer pointer
182 1.3.10.2 tls * LengthToRemove - Length to be removed from target buffer
183 1.3.10.2 tls * BufferToAdd - Data to be inserted into target buffer
184 1.3.10.2 tls * LengthToAdd - Length of BufferToAdd
185 1.3.10.2 tls *
186 1.3.10.2 tls * RETURN: None
187 1.3.10.2 tls *
188 1.3.10.2 tls * DESCRIPTION: Generic buffer data replacement.
189 1.3.10.2 tls *
190 1.3.10.2 tls ******************************************************************************/
191 1.3.10.2 tls
192 1.3.10.2 tls void
193 1.3.10.2 tls PrReplaceData (
194 1.3.10.2 tls char *Buffer,
195 1.3.10.2 tls UINT32 LengthToRemove,
196 1.3.10.2 tls char *BufferToAdd,
197 1.3.10.2 tls UINT32 LengthToAdd)
198 1.3.10.2 tls {
199 1.3.10.2 tls UINT32 BufferLength;
200 1.3.10.2 tls
201 1.3.10.2 tls
202 1.3.10.2 tls /* Buffer is a string, so the length must include the terminating zero */
203 1.3.10.2 tls
204 1.3.10.2 tls BufferLength = strlen (Buffer) + 1;
205 1.3.10.2 tls
206 1.3.10.2 tls if (LengthToRemove != LengthToAdd)
207 1.3.10.2 tls {
208 1.3.10.2 tls /*
209 1.3.10.2 tls * Move some of the existing data
210 1.3.10.2 tls * 1) If adding more bytes than removing, make room for the new data
211 1.3.10.2 tls * 2) if removing more bytes than adding, delete the extra space
212 1.3.10.2 tls */
213 1.3.10.2 tls if (LengthToRemove > 0)
214 1.3.10.2 tls {
215 1.3.10.2 tls memmove ((Buffer + LengthToAdd), (Buffer + LengthToRemove),
216 1.3.10.2 tls (BufferLength - LengthToRemove));
217 1.3.10.2 tls }
218 1.3.10.2 tls }
219 1.3.10.2 tls
220 1.3.10.2 tls /* Now we can move in the new data */
221 1.3.10.2 tls
222 1.3.10.2 tls if (LengthToAdd > 0)
223 1.3.10.2 tls {
224 1.3.10.2 tls memmove (Buffer, BufferToAdd, LengthToAdd);
225 1.3.10.2 tls }
226 1.3.10.2 tls }
227 1.3.10.2 tls
228 1.3.10.2 tls
229 1.3.10.2 tls /*******************************************************************************
230 1.3.10.2 tls *
231 1.3.10.2 tls * FUNCTION: PrOpenIncludeFile
232 1.3.10.2 tls *
233 1.3.10.2 tls * PARAMETERS: Filename - Filename or pathname for include file
234 1.3.10.2 tls *
235 1.3.10.2 tls * RETURN: None.
236 1.3.10.2 tls *
237 1.3.10.2 tls * DESCRIPTION: Open an include file and push it on the input file stack.
238 1.3.10.2 tls *
239 1.3.10.2 tls ******************************************************************************/
240 1.3.10.2 tls
241 1.3.10.2 tls void
242 1.3.10.2 tls PrOpenIncludeFile (
243 1.3.10.2 tls char *Filename)
244 1.3.10.2 tls {
245 1.3.10.2 tls FILE *IncludeFile;
246 1.3.10.2 tls ASL_INCLUDE_DIR *NextDir;
247 1.3.10.2 tls
248 1.3.10.2 tls
249 1.3.10.2 tls /* Start the actual include file on the next line */
250 1.3.10.2 tls
251 1.3.10.2 tls Gbl_CurrentLineOffset++;
252 1.3.10.2 tls
253 1.3.10.2 tls /* Attempt to open the include file */
254 1.3.10.2 tls /* If the file specifies an absolute path, just open it */
255 1.3.10.2 tls
256 1.3.10.2 tls if ((Filename[0] == '/') ||
257 1.3.10.2 tls (Filename[0] == '\\') ||
258 1.3.10.2 tls (Filename[1] == ':'))
259 1.3.10.2 tls {
260 1.3.10.2 tls IncludeFile = PrOpenIncludeWithPrefix ("", Filename);
261 1.3.10.2 tls if (!IncludeFile)
262 1.3.10.2 tls {
263 1.3.10.2 tls goto ErrorExit;
264 1.3.10.2 tls }
265 1.3.10.2 tls return;
266 1.3.10.2 tls }
267 1.3.10.2 tls
268 1.3.10.2 tls /*
269 1.3.10.2 tls * The include filename is not an absolute path.
270 1.3.10.2 tls *
271 1.3.10.2 tls * First, search for the file within the "local" directory -- meaning
272 1.3.10.2 tls * the same directory that contains the source file.
273 1.3.10.2 tls *
274 1.3.10.2 tls * Construct the file pathname from the global directory name.
275 1.3.10.2 tls */
276 1.3.10.2 tls IncludeFile = PrOpenIncludeWithPrefix (Gbl_DirectoryPath, Filename);
277 1.3.10.2 tls if (IncludeFile)
278 1.3.10.2 tls {
279 1.3.10.2 tls return;
280 1.3.10.2 tls }
281 1.3.10.2 tls
282 1.3.10.2 tls /*
283 1.3.10.2 tls * Second, search for the file within the (possibly multiple)
284 1.3.10.2 tls * directories specified by the -I option on the command line.
285 1.3.10.2 tls */
286 1.3.10.2 tls NextDir = Gbl_IncludeDirList;
287 1.3.10.2 tls while (NextDir)
288 1.3.10.2 tls {
289 1.3.10.2 tls IncludeFile = PrOpenIncludeWithPrefix (NextDir->Dir, Filename);
290 1.3.10.2 tls if (IncludeFile)
291 1.3.10.2 tls {
292 1.3.10.2 tls return;
293 1.3.10.2 tls }
294 1.3.10.2 tls
295 1.3.10.2 tls NextDir = NextDir->Next;
296 1.3.10.2 tls }
297 1.3.10.2 tls
298 1.3.10.2 tls /* We could not open the include file after trying very hard */
299 1.3.10.2 tls
300 1.3.10.2 tls ErrorExit:
301 1.3.10.2 tls snprintf (Gbl_MainTokenBuffer, ASL_DEFAULT_LINE_BUFFER_SIZE, "%s, %s",
302 1.3.10.2 tls Filename, strerror (errno));
303 1.3.10.2 tls PrError (ASL_ERROR, ASL_MSG_INCLUDE_FILE_OPEN, 0);
304 1.3.10.2 tls }
305 1.3.10.2 tls
306 1.3.10.2 tls
307 1.3.10.2 tls /*******************************************************************************
308 1.3.10.2 tls *
309 1.3.10.2 tls * FUNCTION: FlOpenIncludeWithPrefix
310 1.3.10.2 tls *
311 1.3.10.2 tls * PARAMETERS: PrefixDir - Prefix directory pathname. Can be a zero
312 1.3.10.2 tls * length string.
313 1.3.10.2 tls * Filename - The include filename from the source ASL.
314 1.3.10.2 tls *
315 1.3.10.2 tls * RETURN: Valid file descriptor if successful. Null otherwise.
316 1.3.10.2 tls *
317 1.3.10.2 tls * DESCRIPTION: Open an include file and push it on the input file stack.
318 1.3.10.2 tls *
319 1.3.10.2 tls ******************************************************************************/
320 1.3.10.2 tls
321 1.3.10.2 tls FILE *
322 1.3.10.2 tls PrOpenIncludeWithPrefix (
323 1.3.10.2 tls char *PrefixDir,
324 1.3.10.2 tls char *Filename)
325 1.3.10.2 tls {
326 1.3.10.2 tls FILE *IncludeFile;
327 1.3.10.2 tls char *Pathname;
328 1.3.10.2 tls
329 1.3.10.2 tls
330 1.3.10.2 tls /* Build the full pathname to the file */
331 1.3.10.2 tls
332 1.3.10.2 tls Pathname = FlMergePathnames (PrefixDir, Filename);
333 1.3.10.2 tls
334 1.3.10.2 tls DbgPrint (ASL_PARSE_OUTPUT, PR_PREFIX_ID
335 1.3.10.2 tls "Include: Opening file - \"%s\"\n",
336 1.3.10.2 tls Gbl_CurrentLineNumber, Pathname);
337 1.3.10.2 tls
338 1.3.10.2 tls /* Attempt to open the file, push if successful */
339 1.3.10.2 tls
340 1.3.10.2 tls IncludeFile = fopen (Pathname, "r");
341 1.3.10.2 tls if (!IncludeFile)
342 1.3.10.2 tls {
343 1.3.10.2 tls fprintf (stderr, "Could not open include file %s\n", Pathname);
344 1.3.10.2 tls ACPI_FREE (Pathname);
345 1.3.10.2 tls return (NULL);
346 1.3.10.2 tls }
347 1.3.10.2 tls
348 1.3.10.2 tls /* Push the include file on the open input file stack */
349 1.3.10.2 tls
350 1.3.10.2 tls PrPushInputFileStack (IncludeFile, Pathname);
351 1.3.10.2 tls return (IncludeFile);
352 1.3.10.2 tls }
353 1.3.10.2 tls
354 1.3.10.2 tls
355 1.3.10.2 tls /*******************************************************************************
356 1.3.10.2 tls *
357 1.3.10.2 tls * FUNCTION: AslPushInputFileStack
358 1.3.10.2 tls *
359 1.3.10.2 tls * PARAMETERS: InputFile - Open file pointer
360 1.3.10.2 tls * Filename - Name of the file
361 1.3.10.2 tls *
362 1.3.10.2 tls * RETURN: None
363 1.3.10.2 tls *
364 1.3.10.2 tls * DESCRIPTION: Push the InputFile onto the file stack, and point the parser
365 1.3.10.2 tls * to this file. Called when an include file is successfully
366 1.3.10.2 tls * opened.
367 1.3.10.2 tls *
368 1.3.10.2 tls ******************************************************************************/
369 1.3.10.2 tls
370 1.3.10.2 tls void
371 1.3.10.2 tls PrPushInputFileStack (
372 1.3.10.2 tls FILE *InputFile,
373 1.3.10.2 tls char *Filename)
374 1.3.10.2 tls {
375 1.3.10.2 tls PR_FILE_NODE *Fnode;
376 1.3.10.2 tls
377 1.3.10.2 tls
378 1.3.10.2 tls /* Save the current state in an Fnode */
379 1.3.10.2 tls
380 1.3.10.2 tls Fnode = UtLocalCalloc (sizeof (PR_FILE_NODE));
381 1.3.10.2 tls
382 1.3.10.2 tls Fnode->File = Gbl_Files[ASL_FILE_INPUT].Handle;
383 1.3.10.2 tls Fnode->Next = Gbl_InputFileList;
384 1.3.10.2 tls Fnode->Filename = Gbl_Files[ASL_FILE_INPUT].Filename;
385 1.3.10.2 tls Fnode->CurrentLineNumber = Gbl_CurrentLineNumber;
386 1.3.10.2 tls
387 1.3.10.2 tls /* Push it on the stack */
388 1.3.10.2 tls
389 1.3.10.2 tls Gbl_InputFileList = Fnode;
390 1.3.10.2 tls
391 1.3.10.2 tls DbgPrint (ASL_PARSE_OUTPUT, PR_PREFIX_ID
392 1.3.10.2 tls "Push InputFile Stack: handle %p\n\n",
393 1.3.10.2 tls Gbl_CurrentLineNumber, InputFile);
394 1.3.10.2 tls
395 1.3.10.2 tls /* Reset the global line count and filename */
396 1.3.10.2 tls
397 1.3.10.2 tls Gbl_Files[ASL_FILE_INPUT].Filename = Filename;
398 1.3.10.2 tls Gbl_Files[ASL_FILE_INPUT].Handle = InputFile;
399 1.3.10.2 tls Gbl_PreviousLineNumber = 0;
400 1.3.10.2 tls Gbl_CurrentLineNumber = 0;
401 1.3.10.2 tls
402 1.3.10.2 tls /* Emit a new #line directive for the include file */
403 1.3.10.2 tls
404 1.3.10.2 tls FlPrintFile (ASL_FILE_PREPROCESSOR, "#line %u \"%s\"\n",
405 1.3.10.2 tls 1, Filename);
406 1.3.10.2 tls }
407 1.3.10.2 tls
408 1.3.10.2 tls
409 1.3.10.2 tls /*******************************************************************************
410 1.3.10.2 tls *
411 1.3.10.2 tls * FUNCTION: AslPopInputFileStack
412 1.3.10.2 tls *
413 1.3.10.2 tls * PARAMETERS: None
414 1.3.10.2 tls *
415 1.3.10.2 tls * RETURN: 0 if a node was popped, -1 otherwise
416 1.3.10.2 tls *
417 1.3.10.2 tls * DESCRIPTION: Pop the top of the input file stack and point the parser to
418 1.3.10.2 tls * the saved parse buffer contained in the fnode. Also, set the
419 1.3.10.2 tls * global line counters to the saved values. This function is
420 1.3.10.2 tls * called when an include file reaches EOF.
421 1.3.10.2 tls *
422 1.3.10.2 tls ******************************************************************************/
423 1.3.10.2 tls
424 1.3.10.2 tls BOOLEAN
425 1.3.10.2 tls PrPopInputFileStack (
426 1.3.10.2 tls void)
427 1.3.10.2 tls {
428 1.3.10.2 tls PR_FILE_NODE *Fnode;
429 1.3.10.2 tls
430 1.3.10.2 tls
431 1.3.10.2 tls Fnode = Gbl_InputFileList;
432 1.3.10.2 tls DbgPrint (ASL_PARSE_OUTPUT, "\n" PR_PREFIX_ID
433 1.3.10.2 tls "Pop InputFile Stack, Fnode %p\n\n",
434 1.3.10.2 tls Gbl_CurrentLineNumber, Fnode);
435 1.3.10.2 tls
436 1.3.10.2 tls if (!Fnode)
437 1.3.10.2 tls {
438 1.3.10.2 tls return (FALSE);
439 1.3.10.2 tls }
440 1.3.10.2 tls
441 1.3.10.2 tls /* Close the current include file */
442 1.3.10.2 tls
443 1.3.10.2 tls fclose (Gbl_Files[ASL_FILE_INPUT].Handle);
444 1.3.10.2 tls
445 1.3.10.2 tls /* Update the top-of-stack */
446 1.3.10.2 tls
447 1.3.10.2 tls Gbl_InputFileList = Fnode->Next;
448 1.3.10.2 tls
449 1.3.10.2 tls /* Reset global line counter and filename */
450 1.3.10.2 tls
451 1.3.10.2 tls Gbl_Files[ASL_FILE_INPUT].Filename = Fnode->Filename;
452 1.3.10.2 tls Gbl_Files[ASL_FILE_INPUT].Handle = Fnode->File;
453 1.3.10.2 tls Gbl_CurrentLineNumber = Fnode->CurrentLineNumber;
454 1.3.10.2 tls Gbl_PreviousLineNumber = 0;
455 1.3.10.2 tls
456 1.3.10.2 tls /* Emit a new #line directive after the include file */
457 1.3.10.2 tls
458 1.3.10.2 tls FlPrintFile (ASL_FILE_PREPROCESSOR, "#line %u \"%s\"\n",
459 1.3.10.2 tls Gbl_CurrentLineNumber + 1, Fnode->Filename);
460 1.3.10.2 tls
461 1.3.10.2 tls /* All done with this node */
462 1.3.10.2 tls
463 1.3.10.2 tls ACPI_FREE (Fnode);
464 1.3.10.2 tls return (TRUE);
465 1.3.10.2 tls }
466