Deleted Added
sdiff udiff text old ( 217365 ) new ( 218590 )
full compact
1/******************************************************************************
2 *
3 * Module Name: dtio.c - File I/O support for data table compiler
4 *
5 *****************************************************************************/
6
7/*
8 * Copyright (C) 2000 - 2011, Intel Corp.

--- 52 unchanged lines hidden (view full) ---

61 DT_FIELD *Field);
62
63static ACPI_STATUS
64DtParseLine (
65 char *LineBuffer,
66 UINT32 Line,
67 UINT32 Offset);
68
69static UINT32
70DtGetNextLine (
71 FILE *Handle);
72
73static void
74DtWriteBinary (
75 DT_SUBTABLE *Subtable,
76 void *Context,
77 void *ReturnValue);
78
79static void
80DtDumpBuffer (
81 UINT32 FileId,
82 UINT8 *Buffer,
83 UINT32 Length);
84
85/* States for DtGetNextLine */
86
87#define DT_NORMAL_TEXT 0
88#define DT_START_QUOTED_STRING 1
89#define DT_START_COMMENT 2
90#define DT_SLASH_ASTERISK_COMMENT 3
91#define DT_SLASH_SLASH_COMMENT 4
92#define DT_END_COMMENT 5

--- 226 unchanged lines hidden (view full) ---

319
320 while (*End)
321 {
322 /* Found left quotation, go to the right quotation and break */
323
324 if (*End == '"')
325 {
326 End++;
327 while (*End && *End != '"')
328 {
329 End++;
330 }
331
332 End++;
333 break;
334 }
335
336 if (*End == '(' ||
337 *End == '<' ||
338 *End == '/')
339 {
340 break;
341 }
342
343 End++;
344 }
345
346 Length = ACPI_PTR_DIFF (End, Start);

--- 33 unchanged lines hidden (view full) ---

380 * Handles both slash-asterisk and slash-slash comments.
381 * Also, quoted strings, but no escapes within.
382 *
383 * Line is returned in Gbl_CurrentLineBuffer.
384 * Line number in original file is returned in Gbl_CurrentLineNumber.
385 *
386 *****************************************************************************/
387
388static UINT32
389DtGetNextLine (
390 FILE *Handle)
391{
392 UINT32 State = DT_NORMAL_TEXT;
393 UINT32 CurrentLineOffset;
394 UINT32 i;
395 char c;
396
397
398 for (i = 0; i < ASL_LINE_BUFFER_SIZE;)
399 {
400 c = (char) getc (Handle);
401 if (c == EOF)
402 {
403 return (0);
404 }
405
406 switch (State)
407 {
408 case DT_NORMAL_TEXT:
409
410 /* Normal text, insert char into line buffer */

--- 104 unchanged lines hidden (view full) ---

515 /* End comment if this char is a slash */
516
517 switch (c)
518 {
519 case '/':
520 State = DT_NORMAL_TEXT;
521 break;
522
523 default:
524 State = DT_SLASH_ASTERISK_COMMENT;
525 break;
526 }
527 break;
528
529 default:
530 DtFatal (ASL_MSG_COMPILER_INTERNAL, NULL, "Unknown input state");

--- 117 unchanged lines hidden (view full) ---

648 */
649
650/******************************************************************************
651 *
652 * FUNCTION: DtDumpBuffer
653 *
654 * PARAMETERS: FileID - Where to write buffer data
655 * Buffer - Buffer to dump
656 * Length - Buffer Length
657 *
658 * RETURN: None
659 *
660 * DESCRIPTION: Another copy of DumpBuffer routine (unfortunately).
661 *
662 * TBD: merge dump buffer routines
663 *
664 *****************************************************************************/
665
666static void
667DtDumpBuffer (
668 UINT32 FileId,
669 UINT8 *Buffer,
670 UINT32 Length)
671{
672 UINT32 i;
673 UINT32 j;
674 UINT8 BufChar;
675
676
677 i = 0;
678 while (i < Length)
679 {
680 /* Print 16 hex chars */
681
682 FlPrintFile (FileId, "Output: [%.3d] ", Length);
683
684 for (j = 0; j < 16;)
685 {
686 if (i + j >= Length)
687 {
688 /* Dump fill spaces */
689
690 FlPrintFile (FileId, " ");
691 j++;

--- 76 unchanged lines hidden (view full) ---

768 }
769 }
770
771 /* Dump the line as parsed and represented internally */
772
773 FlPrintFile (ASL_FILE_LISTING_OUTPUT, "Parsed: %*s : %s\n",
774 Field->Column-4, Field->Name, Field->Value);
775
776#if 0
777 /* TBD Dump the length and AML offset */
778
779 FlPrintFile (ASL_FILE_LISTING_OUTPUT,
780 "Output: Length %d(0x%X) Offset %d(0x%X)\n",
781 Field->Column-4, Field->Name, Field->Value);
782#endif
783
784 /* Dump the hex data that will be output for this field */
785
786 DtDumpBuffer (ASL_FILE_LISTING_OUTPUT, Buffer, Length);
787}
788
789
790/******************************************************************************
791 *
792 * FUNCTION: DtWriteTableToListing
793 *
794 * PARAMETERS: None

--- 36 unchanged lines hidden ---