[BACK]Return to dtcompile.c CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / src / sys / external / bsd / acpica / dist / compiler

Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.

Diff for /src/sys/external/bsd/acpica/dist/compiler/dtcompile.c between version 1.1.1.3 and 1.1.1.3.16.1

version 1.1.1.3, 2011/06/28 09:01:49 version 1.1.1.3.16.1, 2014/05/18 17:45:49
Line 5 
Line 5 
  *****************************************************************************/   *****************************************************************************/
   
 /*  /*
  * Copyright (C) 2000 - 2011, Intel Corp.   * Copyright (C) 2000 - 2013, Intel Corp.
  * All rights reserved.   * All rights reserved.
  *   *
  * Redistribution and use in source and binary forms, with or without   * Redistribution and use in source and binary forms, with or without
Line 101  DtDoCompile (
Line 101  DtDoCompile (
         return (Status);          return (Status);
     }      }
   
       /* Preprocessor */
   
       Event = UtBeginEvent ("Preprocess input file");
       PrDoPreprocess ();
       UtEndEvent (Event);
   
       if (Gbl_PreprocessOnly)
       {
           return (AE_OK);
       }
   
     /*      /*
      * Scan the input file (file is already open) and       * Scan the input file (file is already open) and
      * build the parse tree       * build the parse tree
Line 154  DtDoCompile (
Line 165  DtDoCompile (
     /* Write the binary, then the optional hex file */      /* Write the binary, then the optional hex file */
   
     DtOutputBinary (Gbl_RootTable);      DtOutputBinary (Gbl_RootTable);
     LsDoHexOutput ();      HxDoHexOutput ();
     DtWriteTableToListing ();      DtWriteTableToListing ();
   
 CleanupAndExit:  CleanupAndExit:
Line 200  DtInitialize (
Line 211  DtInitialize (
     Gbl_RootTable = NULL;      Gbl_RootTable = NULL;
     Gbl_SubtableStack = NULL;      Gbl_SubtableStack = NULL;
   
     sprintf (VersionString, "%X", (UINT32) ACPI_CA_VERSION);      snprintf (VersionString, sizeof(VersionString), "%X",
           (UINT32) ACPI_CA_VERSION);
     return (AE_OK);      return (AE_OK);
 }  }
   
Line 273  DtCompileDataTable (
Line 285  DtCompileDataTable (
     char                    *Signature;      char                    *Signature;
     ACPI_TABLE_HEADER       *AcpiTableHeader;      ACPI_TABLE_HEADER       *AcpiTableHeader;
     ACPI_STATUS             Status;      ACPI_STATUS             Status;
       DT_FIELD                *RootField = *FieldList;
   
   
     /* Verify that we at least have a table signature and save it */      /* Verify that we at least have a table signature and save it */
Line 280  DtCompileDataTable (
Line 293  DtCompileDataTable (
     Signature = DtGetFieldValue (*FieldList);      Signature = DtGetFieldValue (*FieldList);
     if (!Signature)      if (!Signature)
     {      {
         sprintf (MsgBuffer, "Expected \"%s\"", "Signature");          snprintf (MsgBuffer, sizeof(MsgBuffer), "Expected \"%s\"", "Signature");
         DtNameError (ASL_ERROR, ASL_MSG_INVALID_FIELD_NAME,          DtNameError (ASL_ERROR, ASL_MSG_INVALID_FIELD_NAME,
             *FieldList, MsgBuffer);              *FieldList, MsgBuffer);
         return (AE_ERROR);          return (AE_ERROR);
Line 305  DtCompileDataTable (
Line 318  DtCompileDataTable (
         DtSetTableLength ();          DtSetTableLength ();
         return (Status);          return (Status);
     }      }
     else if (ACPI_COMPARE_NAME (Signature, ACPI_SIG_RSDP))      else if (ACPI_VALIDATE_RSDP_SIG (Signature))
     {      {
         Status = DtCompileRsdp (FieldList);          Status = DtCompileRsdp (FieldList);
         return (Status);          return (Status);
     }      }
       else if (ACPI_COMPARE_NAME (Signature, ACPI_SIG_S3PT))
       {
           Status = DtCompileS3pt (FieldList);
           if (ACPI_FAILURE (Status))
           {
               return (Status);
           }
   
           DtSetTableLength ();
           return (Status);
       }
   
     /*      /*
      * All other tables must use the common ACPI table header. Insert the       * All other tables must use the common ACPI table header. Insert the
Line 329  DtCompileDataTable (
Line 353  DtCompileDataTable (
     /* Validate the signature via the ACPI table list */      /* Validate the signature via the ACPI table list */
   
     TableData = AcpiDmGetTableData (Signature);      TableData = AcpiDmGetTableData (Signature);
     if (!TableData)      if (!TableData || Gbl_CompileGeneric)
     {      {
         DtCompileGeneric ((void **) FieldList);          DtCompileGeneric ((void **) FieldList);
         goto Out;          goto FinishHeader;
     }      }
   
     /* Dispatch to per-table compile */      /* Dispatch to per-table compile */
Line 369  DtCompileDataTable (
Line 393  DtCompileDataTable (
         return (AE_ERROR);          return (AE_ERROR);
     }      }
   
 Out:  FinishHeader:
   
     /* Set the final table length and then the checksum */      /* Set the final table length and then the checksum */
   
     DtSetTableLength ();      DtSetTableLength ();
Line 377  Out:
Line 402  Out:
         ACPI_TABLE_HEADER, Gbl_RootTable->Buffer);          ACPI_TABLE_HEADER, Gbl_RootTable->Buffer);
     DtSetTableChecksum (&AcpiTableHeader->Checksum);      DtSetTableChecksum (&AcpiTableHeader->Checksum);
   
       DtDumpFieldList (RootField);
       DtDumpSubtableList ();
     return (AE_OK);      return (AE_OK);
 }  }
   
Line 411  DtCompileTable (
Line 438  DtCompileTable (
     UINT8                   FieldType;      UINT8                   FieldType;
     UINT8                   *Buffer;      UINT8                   *Buffer;
     UINT8                   *FlagBuffer = NULL;      UINT8                   *FlagBuffer = NULL;
       UINT32                  CurrentFlagByteOffset = 0;
     ACPI_STATUS             Status;      ACPI_STATUS             Status;
   
   
Line 419  DtCompileTable (
Line 447  DtCompileTable (
         return (AE_BAD_PARAMETER);          return (AE_BAD_PARAMETER);
     }      }
   
       /* Ignore optional subtable if name does not match */
   
       if ((Info->Flags & DT_OPTIONAL) &&
           ACPI_STRCMP ((*Field)->Name, Info->Name))
       {
           *RetSubtable = NULL;
           return (AE_OK);
       }
   
     Length = DtGetSubtableLength (*Field, Info);      Length = DtGetSubtableLength (*Field, Info);
     if (Length == ASL_EOF)      if (Length == ASL_EOF)
     {      {
Line 442  DtCompileTable (
Line 479  DtCompileTable (
      */       */
     for (; Info->Name; Info++)      for (; Info->Name; Info++)
     {      {
           if (Info->Opcode == ACPI_DMT_EXTRA_TEXT)
           {
               continue;
           }
   
         if (!LocalField)          if (!LocalField)
         {          {
             sprintf (MsgBuffer, "Found NULL field - Field name \"%s\" needed",              snprintf (MsgBuffer, sizeof(MsgBuffer), "Found NULL field - Field name \"%s\" needed",
                 Info->Name);                  Info->Name);
             DtFatal (ASL_MSG_COMPILER_INTERNAL, NULL, MsgBuffer);              DtFatal (ASL_MSG_COMPILER_INTERNAL, NULL, MsgBuffer);
             Status = AE_BAD_DATA;              Status = AE_BAD_DATA;
Line 472  DtCompileTable (
Line 514  DtCompileTable (
             *Field = LocalField;              *Field = LocalField;
   
             FlagBuffer = Buffer;              FlagBuffer = Buffer;
               CurrentFlagByteOffset = Info->Offset;
             break;              break;
   
         case DT_FIELD_TYPE_FLAG:          case DT_FIELD_TYPE_FLAG:
Line 480  DtCompileTable (
Line 523  DtCompileTable (
   
             if (FlagBuffer)              if (FlagBuffer)
             {              {
                   /*
                    * We must increment the FlagBuffer when we have crossed
                    * into the next flags byte within the flags field
                    * of type DT_FIELD_TYPE_FLAGS_INTEGER.
                    */
                   FlagBuffer += (Info->Offset - CurrentFlagByteOffset);
                   CurrentFlagByteOffset = Info->Offset;
   
                 DtCompileFlag (FlagBuffer, LocalField, Info);                  DtCompileFlag (FlagBuffer, LocalField, Info);
             }              }
             else              else

Legend:
Removed from v.1.1.1.3  
changed lines
  Added in v.1.1.1.3.16.1

CVSweb <webmaster@jp.NetBSD.org>