summaryrefslogtreecommitdiffstats
path: root/sys/contrib/dev/acpica/compiler/dtio.c
diff options
context:
space:
mode:
authorjkim <jkim@FreeBSD.org>2011-02-12 01:03:15 +0000
committerjkim <jkim@FreeBSD.org>2011-02-12 01:03:15 +0000
commitf74b693166215a41e29f1932c91ef7c921e662a7 (patch)
tree77080c497fdac042ac2702fc74a130a870de5215 /sys/contrib/dev/acpica/compiler/dtio.c
parent060dcf42aad3ccbc8df13ec962fd6a93e9f78070 (diff)
parent6636ac3533f4af02a42a7302b5cd1197817f4ed9 (diff)
downloadFreeBSD-src-f74b693166215a41e29f1932c91ef7c921e662a7.zip
FreeBSD-src-f74b693166215a41e29f1932c91ef7c921e662a7.tar.gz
Merge ACPICA 20110211.
Diffstat (limited to 'sys/contrib/dev/acpica/compiler/dtio.c')
-rw-r--r--sys/contrib/dev/acpica/compiler/dtio.c64
1 files changed, 48 insertions, 16 deletions
diff --git a/sys/contrib/dev/acpica/compiler/dtio.c b/sys/contrib/dev/acpica/compiler/dtio.c
index e34e777..9ba9acc 100644
--- a/sys/contrib/dev/acpica/compiler/dtio.c
+++ b/sys/contrib/dev/acpica/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);
}
OpenPOWER on IntegriCloud