diff options
author | jkim <jkim@FreeBSD.org> | 2011-02-11 22:56:14 +0000 |
---|---|---|
committer | jkim <jkim@FreeBSD.org> | 2011-02-11 22:56:14 +0000 |
commit | 6636ac3533f4af02a42a7302b5cd1197817f4ed9 (patch) | |
tree | 9d61cc356dc91b33ff673ba89e884aab6cbb55be /compiler/dtio.c | |
parent | b6a3cbc0d6bb87f224b6e8f310a1a0c1e64685ca (diff) | |
download | FreeBSD-src-6636ac3533f4af02a42a7302b5cd1197817f4ed9.zip FreeBSD-src-6636ac3533f4af02a42a7302b5cd1197817f4ed9.tar.gz |
Import ACPICA 20110211.
Diffstat (limited to 'compiler/dtio.c')
-rw-r--r-- | compiler/dtio.c | 64 |
1 files changed, 48 insertions, 16 deletions
diff --git a/compiler/dtio.c b/compiler/dtio.c index 5fc50f7..3956450 100644 --- a/compiler/dtio.c +++ b/compiler/dtio.c @@ -66,7 +66,7 @@ DtParseLine ( UINT32 Line, UINT32 Offset); -static UINT32 +UINT32 DtGetNextLine ( FILE *Handle); @@ -80,8 +80,10 @@ static void DtDumpBuffer ( UINT32 FileId, UINT8 *Buffer, + UINT32 Offset, UINT32 Length); + /* States for DtGetNextLine */ #define DT_NORMAL_TEXT 0 @@ -324,7 +326,7 @@ DtParseLine ( if (*End == '"') { End++; - while (*End && *End != '"') + while (*End && (*End != '"')) { End++; } @@ -333,9 +335,16 @@ DtParseLine ( break; } + /* + * Special "comment" fields at line end, ignore them. + * Note: normal slash-slash and slash-asterisk comments are + * stripped already by the DtGetNextLine parser. + * + * TBD: Perhaps DtGetNextLine should parse the following type + * of comments also. + */ if (*End == '(' || - *End == '<' || - *End == '/') + *End == '<') { break; } @@ -385,7 +394,7 @@ DtParseLine ( * *****************************************************************************/ -static UINT32 +UINT32 DtGetNextLine ( FILE *Handle) { @@ -400,6 +409,19 @@ DtGetNextLine ( c = (char) getc (Handle); if (c == EOF) { + switch (State) + { + case DT_START_QUOTED_STRING: + case DT_SLASH_ASTERISK_COMMENT: + case DT_SLASH_SLASH_COMMENT: + + AcpiOsPrintf ("**** EOF within comment/string %u\n", State); + break; + + default: + break; + } + return (0); } @@ -520,6 +542,16 @@ DtGetNextLine ( State = DT_NORMAL_TEXT; break; + case '\n': + CurrentLineOffset = Gbl_NextLineOffset; + Gbl_NextLineOffset = (UINT32) ftell (Handle); + Gbl_CurrentLineNumber++; + break; + + case '*': + /* Consume all adjacent asterisks */ + break; + default: State = DT_SLASH_ASTERISK_COMMENT; break; @@ -653,6 +685,7 @@ DtOutputBinary ( * * PARAMETERS: FileID - Where to write buffer data * Buffer - Buffer to dump + * Offset - Offset in current table * Length - Buffer Length * * RETURN: None @@ -667,6 +700,7 @@ static void DtDumpBuffer ( UINT32 FileId, UINT8 *Buffer, + UINT32 Offset, UINT32 Length) { UINT32 i; @@ -674,12 +708,18 @@ DtDumpBuffer ( UINT8 BufChar; + FlPrintFile (FileId, "Output: [%3.3Xh %4.4d% 3d] ", + Offset, Offset, Length); + i = 0; while (i < Length) { - /* Print 16 hex chars */ + if (i >= 16) + { + FlPrintFile (FileId, "%23s", ""); + } - FlPrintFile (FileId, "Output: [%.3d] ", Length); + /* Print 16 hex chars */ for (j = 0; j < 16;) { @@ -773,17 +813,9 @@ DtWriteFieldToListing ( FlPrintFile (ASL_FILE_LISTING_OUTPUT, "Parsed: %*s : %s\n", Field->Column-4, Field->Name, Field->Value); -#if 0 - /* TBD Dump the length and AML offset */ - - FlPrintFile (ASL_FILE_LISTING_OUTPUT, - "Output: Length %d(0x%X) Offset %d(0x%X)\n", - Field->Column-4, Field->Name, Field->Value); -#endif - /* Dump the hex data that will be output for this field */ - DtDumpBuffer (ASL_FILE_LISTING_OUTPUT, Buffer, Length); + DtDumpBuffer (ASL_FILE_LISTING_OUTPUT, Buffer, Field->TableOffset, Length); } |