diff --git a/source/tools/acpisrc/asremove.c b/source/tools/acpisrc/asremove.c index 0ee4b3a10..a728d9067 100644 --- a/source/tools/acpisrc/asremove.c +++ b/source/tools/acpisrc/asremove.c @@ -550,6 +550,7 @@ AsReduceTypedefs ( { char *SubString; char *SubBuffer; + char *SubSubString; int NestLevel; @@ -562,56 +563,89 @@ AsReduceTypedefs ( if (SubString) { - /* Remove the typedef itself */ + SubSubString = SubString + strlen (Keyword); - SubBuffer = SubString + strlen ("typedef") + 1; - SubBuffer = AsRemoveData (SubString, SubBuffer); + /* skip spaces */ - /* Find the opening brace of the struct or union */ - - while (*SubString != '{') + while (strchr(" \t\r\n", *SubSubString)) { - SubString++; + SubSubString++; } - SubString++; - /* Find the closing brace. Handles nested braces */ + /* skip type name */ - NestLevel = 1; - while (*SubString) + while (!strchr(" \t\r\n", *SubSubString)) { - if (*SubString == '{') - { - NestLevel++; - } - else if (*SubString == '}') - { - NestLevel--; - } + SubSubString++; + } + /* skip spaces */ + + while (strchr(" \t\r\n", *SubSubString)) + { + SubSubString++; + } + + if (*SubSubString == '{') + { + /* Remove the typedef itself */ + + SubBuffer = SubString + strlen ("typedef") + 1; + SubBuffer = AsRemoveData (SubString, SubBuffer); + + /* Find the opening brace of the struct or union */ + + while (*SubString != '{') + { + SubString++; + } SubString++; - if (NestLevel == 0) + /* Find the closing brace. Handles nested braces */ + + NestLevel = 1; + while (*SubString) { - break; + if (*SubString == '{') + { + NestLevel++; + } + else if (*SubString == '}') + { + NestLevel--; + } + + SubString++; + + if (NestLevel == 0) + { + break; + } } + + /* Remove an extra line feed if present */ + + if (!strncmp (SubString - 3, "\n\n", 2)) + { + *(SubString -2) = '}'; + SubString--; + } + + /* Find the end of the typedef name */ + + SubBuffer = AsSkipUntilChar (SubString, ';'); + + /* And remove the typedef name */ + + SubBuffer = AsRemoveData (SubString, SubBuffer); } - - /* Remove an extra line feed if present */ - - if (!strncmp (SubString - 3, "\n\n", 2)) + else { - *(SubString -2) = '}'; - SubString--; + /* Skip the entire definition */ + + SubString = strchr (SubString, ';') + 1; + SubBuffer = SubString; } - - /* Find the end of the typedef name */ - - SubBuffer = AsSkipUntilChar (SubString, ';'); - - /* And remove the typedef name */ - - SubBuffer = AsRemoveData (SubString, SubBuffer); } } } diff --git a/source/tools/acpisrc/astable.c b/source/tools/acpisrc/astable.c index 0f01286d0..624c6b4f5 100644 --- a/source/tools/acpisrc/astable.c +++ b/source/tools/acpisrc/astable.c @@ -317,6 +317,7 @@ ACPI_TYPED_IDENTIFIER_TABLE AcpiIdentifiers[] = { {"ACPI_DMTABLE_DATA", SRC_TYPE_STRUCT}, {"ACPI_DMTABLE_INFO", SRC_TYPE_STRUCT}, {"ACPI_DMTABLE_HANDLER", SRC_TYPE_SIMPLE}, + {"ACPI_EFI_FILE", SRC_TYPE_SIMPLE}, {"ACPI_EVALUATE_INFO", SRC_TYPE_STRUCT}, {"ACPI_EVENT_HANDLER", SRC_TYPE_SIMPLE}, {"ACPI_EVENT_STATUS", SRC_TYPE_SIMPLE},