diff options
author | jkim <jkim@FreeBSD.org> | 2012-04-23 23:05:14 +0000 |
---|---|---|
committer | jkim <jkim@FreeBSD.org> | 2012-04-23 23:05:14 +0000 |
commit | 6ad6e5ad458430028d7210712b32b42a6a5bd27f (patch) | |
tree | 56922987e2cfefbddd9a8298beb2dce0ea965339 /sys/contrib/dev/acpica/compiler/aslstartup.c | |
parent | 22fae261d4ee03ee88b67242e0842711fe24b0f3 (diff) | |
parent | eb364ef2c90291c41e896d265d93fe21e48d02a7 (diff) | |
download | FreeBSD-src-6ad6e5ad458430028d7210712b32b42a6a5bd27f.zip FreeBSD-src-6ad6e5ad458430028d7210712b32b42a6a5bd27f.tar.gz |
Merge ACPICA 20120420.
Diffstat (limited to 'sys/contrib/dev/acpica/compiler/aslstartup.c')
-rw-r--r-- | sys/contrib/dev/acpica/compiler/aslstartup.c | 76 |
1 files changed, 68 insertions, 8 deletions
diff --git a/sys/contrib/dev/acpica/compiler/aslstartup.c b/sys/contrib/dev/acpica/compiler/aslstartup.c index f3143c0..9c5ef15 100644 --- a/sys/contrib/dev/acpica/compiler/aslstartup.c +++ b/sys/contrib/dev/acpica/compiler/aslstartup.c @@ -404,18 +404,33 @@ AslDoOneFile ( case ASL_INPUT_TYPE_ASCII_DATA: Status = DtDoCompile (); + if (ACPI_FAILURE (Status)) + { + return (Status); + } if (Gbl_Signature) { ACPI_FREE (Gbl_Signature); Gbl_Signature = NULL; } + + /* Check if any errors occurred during compile */ + + Status = AslCheckForErrorExit (); + if (ACPI_FAILURE (Status)) + { + return (Status); + } + + /* Cleanup (for next source file) and exit */ + AeClearErrorLog (); PrTerminatePreprocessor (); return (Status); /* - * ASL Compilation (Optional) + * ASL Compilation */ case ASL_INPUT_TYPE_ASCII_ASL: @@ -427,18 +442,19 @@ AslDoOneFile ( return (Status); } - Status = CmDoCompile (); + (void) CmDoCompile (); (void) AcpiTerminate (); - /* - * Return non-zero exit code if there have been errors, unless the - * global ignore error flag has been set - */ - if ((Gbl_ExceptionCount[ASL_ERROR] > 0) && (!Gbl_IgnoreErrors)) + /* Check if any errors occurred during compile */ + + Status = AslCheckForErrorExit (); + if (ACPI_FAILURE (Status)) { - return (AE_ERROR); + return (Status); } + /* Cleanup (for next source file) and exit */ + AeClearErrorLog (); PrTerminatePreprocessor (); return (AE_OK); @@ -525,3 +541,47 @@ AslDoOnePathname ( return (Status); } + +/******************************************************************************* + * + * FUNCTION: AslCheckForErrorExit + * + * PARAMETERS: None. Examines global exception count array + * + * RETURN: Status + * + * DESCRIPTION: Determine if compiler should abort with error status + * + ******************************************************************************/ + +ACPI_STATUS +AslCheckForErrorExit ( + void) +{ + + /* + * Return non-zero exit code if there have been errors, unless the + * global ignore error flag has been set + */ + if (!Gbl_IgnoreErrors) + { + if (Gbl_ExceptionCount[ASL_ERROR] > 0) + { + return (AE_ERROR); + } + + /* Optionally treat warnings as errors */ + + if (Gbl_WarningsAsErrors) + { + if ((Gbl_ExceptionCount[ASL_WARNING] > 0) || + (Gbl_ExceptionCount[ASL_WARNING2] > 0) || + (Gbl_ExceptionCount[ASL_WARNING3] > 0)) + { + return (AE_ERROR); + } + } + } + + return (AE_OK); +} |