summaryrefslogtreecommitdiffstats
path: root/sys/contrib/dev/acpica/compiler/aslfileio.c
diff options
context:
space:
mode:
authorjkim <jkim@FreeBSD.org>2016-09-30 22:40:58 +0000
committerjkim <jkim@FreeBSD.org>2016-09-30 22:40:58 +0000
commitdba8c0a565199df70a86f6a036d00c92f0c7675f (patch)
treecf4924274c6e92898c01efb3c8ba31b34f0630f2 /sys/contrib/dev/acpica/compiler/aslfileio.c
parent0f41551ef9dde560d9d191d7190af02904dbf611 (diff)
downloadFreeBSD-src-dba8c0a565199df70a86f6a036d00c92f0c7675f.zip
FreeBSD-src-dba8c0a565199df70a86f6a036d00c92f0c7675f.tar.gz
MFC: r284583, r285797, r285799, r287168, r298714, r298720, r298838,
r300879 Merge ACPICA up to 20160527. Requested by: mav
Diffstat (limited to 'sys/contrib/dev/acpica/compiler/aslfileio.c')
-rw-r--r--sys/contrib/dev/acpica/compiler/aslfileio.c41
1 files changed, 39 insertions, 2 deletions
diff --git a/sys/contrib/dev/acpica/compiler/aslfileio.c b/sys/contrib/dev/acpica/compiler/aslfileio.c
index cf726dd..f1c664f 100644
--- a/sys/contrib/dev/acpica/compiler/aslfileio.c
+++ b/sys/contrib/dev/acpica/compiler/aslfileio.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2015, Intel Corp.
+ * Copyright (C) 2000 - 2016, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -70,6 +70,7 @@ FlFileError (
sprintf (MsgBuffer, "\"%s\" (%s) - %s", Gbl_Files[FileId].Filename,
Gbl_Files[FileId].Description, strerror (errno));
+
AslCommonError (ASL_ERROR, ErrorId, 0, 0, 0, 0, NULL, MsgBuffer);
}
@@ -218,6 +219,19 @@ FlWriteFile (
FlFileError (FileId, ASL_MSG_WRITE);
AslAbort ();
}
+
+ if ((FileId == ASL_FILE_PREPROCESSOR) && Gbl_PreprocessorOutputFlag)
+ {
+ /* Duplicate the output to the user preprocessor (.i) file */
+
+ Actual = fwrite ((char *) Buffer, 1, Length,
+ Gbl_Files[ASL_FILE_PREPROCESSOR_USER].Handle);
+ if (Actual != Length)
+ {
+ FlFileError (FileId, ASL_MSG_WRITE);
+ AslAbort ();
+ }
+ }
}
@@ -247,7 +261,6 @@ FlPrintFile (
va_start (Args, Format);
-
Actual = vfprintf (Gbl_Files[FileId].Handle, Format, Args);
va_end (Args);
@@ -256,6 +269,30 @@ FlPrintFile (
FlFileError (FileId, ASL_MSG_WRITE);
AslAbort ();
}
+
+ if ((FileId == ASL_FILE_PREPROCESSOR) &&
+ Gbl_PreprocessorOutputFlag)
+ {
+ /*
+ * Duplicate the output to the user preprocessor (.i) file,
+ * except: no #line directives.
+ */
+ if (!strncmp (Format, "#line", 5))
+ {
+ return;
+ }
+
+ va_start (Args, Format);
+ Actual = vfprintf (Gbl_Files[ASL_FILE_PREPROCESSOR_USER].Handle,
+ Format, Args);
+ va_end (Args);
+
+ if (Actual == -1)
+ {
+ FlFileError (FileId, ASL_MSG_WRITE);
+ AslAbort ();
+ }
+ }
}
OpenPOWER on IntegriCloud