aboutsummaryrefslogtreecommitdiff
path: root/source/compiler/aslstartup.c
diff options
context:
space:
mode:
authorJung-uk Kim <jkim@FreeBSD.org>2012-04-20 23:39:48 +0000
committerJung-uk Kim <jkim@FreeBSD.org>2012-04-20 23:39:48 +0000
commitb43c4dd5abdb09fe2e7f73f186586b962c9dc9f5 (patch)
tree79677aa8d9d6e5b97246264fe36dcad25ae471a1 /source/compiler/aslstartup.c
parent9fd6e3caab6c4754f50b66bcc8bdbf7ef8397f74 (diff)
downloadsrc-b43c4dd5abdb09fe2e7f73f186586b962c9dc9f5.tar.gz
src-b43c4dd5abdb09fe2e7f73f186586b962c9dc9f5.zip
Notes
Diffstat (limited to 'source/compiler/aslstartup.c')
-rw-r--r--source/compiler/aslstartup.c76
1 files changed, 68 insertions, 8 deletions
diff --git a/source/compiler/aslstartup.c b/source/compiler/aslstartup.c
index 2bc1ba6c0e4c..13b7af4bfe37 100644
--- a/source/compiler/aslstartup.c
+++ b/source/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);
+}