summaryrefslogtreecommitdiffstats
path: root/sys/contrib/dev/acpica/compiler/aslfiles.c
diff options
context:
space:
mode:
authorjkim <jkim@FreeBSD.org>2015-02-18 20:33:00 +0000
committerjkim <jkim@FreeBSD.org>2015-02-18 20:33:00 +0000
commita1a0103e5c0491f9378743fd890ce7c1b5731996 (patch)
treefb0545399f40531160cc35b45423b4a49e6dbb79 /sys/contrib/dev/acpica/compiler/aslfiles.c
parente88977434bd97898228c4330df94ca93ffd4b3bf (diff)
parentc289b811b42daf9e7ef5c37a35e951d01c23715a (diff)
downloadFreeBSD-src-a1a0103e5c0491f9378743fd890ce7c1b5731996.zip
FreeBSD-src-a1a0103e5c0491f9378743fd890ce7c1b5731996.tar.gz
Merge ACPICA 20141107 and 20150204.
Diffstat (limited to 'sys/contrib/dev/acpica/compiler/aslfiles.c')
-rw-r--r--sys/contrib/dev/acpica/compiler/aslfiles.c35
1 files changed, 31 insertions, 4 deletions
diff --git a/sys/contrib/dev/acpica/compiler/aslfiles.c b/sys/contrib/dev/acpica/compiler/aslfiles.c
index 2c84c9e..63a8dbb 100644
--- a/sys/contrib/dev/acpica/compiler/aslfiles.c
+++ b/sys/contrib/dev/acpica/compiler/aslfiles.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2014, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -485,6 +485,8 @@ FlOpenAmlOutputFile (
0, 0, 0, 0, NULL, NULL);
return (AE_ERROR);
}
+
+ Gbl_Files[ASL_FILE_AML_OUTPUT].Filename = Filename;
}
/* Open the output AML file in binary mode */
@@ -563,9 +565,14 @@ FlOpenMiscOutputFiles (
if (!Gbl_Files[ASL_FILE_DEBUG_OUTPUT].Handle)
{
- AslCommonError (ASL_ERROR, ASL_MSG_DEBUG_FILENAME,
- 0, 0, 0, 0, NULL, NULL);
- return (AE_ERROR);
+ /*
+ * A problem with freopen is that on error,
+ * we no longer have stderr.
+ */
+ Gbl_DebugFlag = FALSE;
+ memcpy (stderr, stdout, sizeof (FILE));
+ FlFileError (ASL_FILE_DEBUG_OUTPUT, ASL_MSG_DEBUG_FILENAME);
+ AslAbort ();
}
AslCompilerSignon (ASL_FILE_DEBUG_OUTPUT);
@@ -758,6 +765,26 @@ FlOpenMiscOutputFiles (
AslCompilerFileHeader (ASL_FILE_NAMESPACE_OUTPUT);
}
+ /* Create/Open a map file if requested */
+
+ if (Gbl_MapfileFlag)
+ {
+ Filename = FlGenerateFilename (FilenamePrefix, FILE_SUFFIX_MAP);
+ if (!Filename)
+ {
+ AslCommonError (ASL_ERROR, ASL_MSG_LISTING_FILENAME,
+ 0, 0, 0, 0, NULL, NULL);
+ return (AE_ERROR);
+ }
+
+ /* Open the hex file, text mode (closed at compiler exit) */
+
+ FlOpenFile (ASL_FILE_MAP_OUTPUT, Filename, "w+t");
+
+ AslCompilerSignon (ASL_FILE_MAP_OUTPUT);
+ AslCompilerFileHeader (ASL_FILE_MAP_OUTPUT);
+ }
+
return (AE_OK);
}
OpenPOWER on IntegriCloud