diff options
| author | Jung-uk Kim <jkim@FreeBSD.org> | 2012-11-14 22:20:16 +0000 | 
|---|---|---|
| committer | Jung-uk Kim <jkim@FreeBSD.org> | 2012-11-14 22:20:16 +0000 | 
| commit | c2463a8709e5b3a5ce54c09d35b4820a756b0fc5 (patch) | |
| tree | 2ffc551e57f0545a17c165d729c1438a26236f60 /source/compiler/asllisting.c | |
| parent | 31aa864e8c068201d58aad3a8f82ddb51df11015 (diff) | |
Notes
Diffstat (limited to 'source/compiler/asllisting.c')
| -rw-r--r-- | source/compiler/asllisting.c | 45 | 
1 files changed, 39 insertions, 6 deletions
| diff --git a/source/compiler/asllisting.c b/source/compiler/asllisting.c index 339cc01ac4c68..b70bcf8ab8d57 100644 --- a/source/compiler/asllisting.c +++ b/source/compiler/asllisting.c @@ -135,6 +135,10 @@ LsTreeWriteWalk (      UINT32                  Level,      void                    *Context); +static UINT32 +LsReadAmlOutputFile ( +    UINT8                   *Buffer); +  /*******************************************************************************   * @@ -1282,6 +1286,38 @@ LsDoHexOutput (  /*******************************************************************************   * + * FUNCTION:    LsReadAmlOutputFile + * + * PARAMETERS:  Buffer              - Where to return data + * + * RETURN:      None. + * + * DESCRIPTION: Read a line of the AML output prior to formatting the data + * + ******************************************************************************/ + +static UINT32 +LsReadAmlOutputFile ( +    UINT8                   *Buffer) +{ +    UINT32                  Actual; + + +    Actual = fread (Buffer, 1, HEX_TABLE_LINE_SIZE, +        Gbl_Files[ASL_FILE_AML_OUTPUT].Handle); + +    if (ferror (Gbl_Files[ASL_FILE_AML_OUTPUT].Handle)) +    { +        FlFileError (ASL_FILE_AML_OUTPUT, ASL_MSG_READ); +        AslAbort (); +    } + +    return (Actual); +} + + +/******************************************************************************* + *   * FUNCTION:    LsDoHexOutputC   *   * PARAMETERS:  None @@ -1319,8 +1355,7 @@ LsDoHexOutputC (      {          /* Read enough bytes needed for one output line */ -        LineLength = fread (FileData, 1, HEX_TABLE_LINE_SIZE, -                        Gbl_Files[ASL_FILE_AML_OUTPUT].Handle); +        LineLength = LsReadAmlOutputFile (FileData);          if (!LineLength)          {              break; @@ -1407,8 +1442,7 @@ LsDoHexOutputAsl (      {          /* Read enough bytes needed for one output line */ -        LineLength = fread (FileData, 1, HEX_TABLE_LINE_SIZE, -                        Gbl_Files[ASL_FILE_AML_OUTPUT].Handle); +        LineLength = LsReadAmlOutputFile (FileData);          if (!LineLength)          {              break; @@ -1494,8 +1528,7 @@ LsDoHexOutputAsm (      {          /* Read enough bytes needed for one output line */ -        LineLength = fread (FileData, 1, HEX_TABLE_LINE_SIZE, -                        Gbl_Files[ASL_FILE_AML_OUTPUT].Handle); +        LineLength = LsReadAmlOutputFile (FileData);          if (!LineLength)          {              break; | 
