diff options
| author | Jung-uk Kim <jkim@FreeBSD.org> | 2011-04-13 18:18:52 +0000 | 
|---|---|---|
| committer | Jung-uk Kim <jkim@FreeBSD.org> | 2011-04-13 18:18:52 +0000 | 
| commit | 997de4e17cf02a81027df8d01a4fcefe25da3796 (patch) | |
| tree | f5abd67cc9e3ada1ae289fe7cf2e23d9abf07fcc /compiler/dtcompile.c | |
| parent | 4d8fe534b7309d798d941e14e51985eed6b511bc (diff) | |
Diffstat (limited to 'compiler/dtcompile.c')
| -rw-r--r-- | compiler/dtcompile.c | 55 | 
1 files changed, 16 insertions, 39 deletions
| diff --git a/compiler/dtcompile.c b/compiler/dtcompile.c index c1a7b08d5a340..7f4a824b18cf9 100644 --- a/compiler/dtcompile.c +++ b/compiler/dtcompile.c @@ -277,7 +277,7 @@ DtCompileDataTable (      /* Verify that we at least have a table signature and save it */ -    Signature = DtGetFieldValue (*FieldList, "Signature"); +    Signature = DtGetFieldValue (*FieldList);      if (!Signature)      {          sprintf (MsgBuffer, "Expected \"%s\"", "Signature"); @@ -310,20 +310,6 @@ DtCompileDataTable (          Status = DtCompileRsdp (FieldList);          return (Status);      } -    else if (!ACPI_STRNCMP (Signature, "OEM", 3)) -    { -        DtFatal (ASL_MSG_OEM_TABLE, *FieldList, Signature); -        return (AE_ERROR); -    } - -    /* Validate the signature via the ACPI table list */ - -    TableData = AcpiDmGetTableData (Signature); -    if (!TableData) -    { -        DtFatal (ASL_MSG_UNKNOWN_TABLE, *FieldList, Signature); -        return (AE_ERROR); -    }      /*       * All other tables must use the common ACPI table header. Insert the @@ -340,6 +326,15 @@ DtCompileDataTable (      DtPushSubtable (Gbl_RootTable); +    /* Validate the signature via the ACPI table list */ + +    TableData = AcpiDmGetTableData (Signature); +    if (!TableData) +    { +        DtCompileGeneric ((void **) FieldList); +        goto Out; +    } +      /* Dispatch to per-table compile */      if (TableData->CmTableHandler) @@ -374,6 +369,7 @@ DtCompileDataTable (          return (AE_ERROR);      } +Out:      /* Set the final table length and then the checksum */      DtSetTableLength (); @@ -424,6 +420,11 @@ DtCompileTable (      }      Length = DtGetSubtableLength (*Field, Info); +    if (Length == ASL_EOF) +    { +        return (AE_ERROR); +    } +      Subtable = UtLocalCalloc (sizeof (DT_SUBTABLE));      if (Length > 0) @@ -450,29 +451,6 @@ DtCompileTable (              goto Error;          } -        /* Does input field name match what is expected? */ - -        if (ACPI_STRCMP (LocalField->Name, Info->Name)) -        { -            /* -             * If Required = TRUE, the subtable must exist. -             * If Required = FALSE, the subtable is optional -             * (For example, AcpiDmTableInfoDmarScope in DMAR table is -             * optional) -             */ -            if (Required) -            { -                sprintf (MsgBuffer, "Expected \"%s\"", Info->Name); -                DtNameError (ASL_ERROR, ASL_MSG_INVALID_FIELD_NAME, -                    LocalField, MsgBuffer); -            } -            else -            { -                Status = AE_NOT_FOUND; -                goto Error; -            } -        } -          /* Maintain table offsets */          LocalField->TableOffset = Gbl_CurrentTableOffset; @@ -518,7 +496,6 @@ DtCompileTable (               * Recursion (one level max): compile GAS (Generic Address)               * or Notify in-line subtable               */ -            LocalField = LocalField->Next;              *Field = LocalField;              if (Info->Opcode == ACPI_DMT_GAS) | 
