[PATCH] ACPICA: update to version 20140828 (LP: #1362786)
Colin King
colin.king at canonical.com
Thu Aug 28 19:48:43 UTC 2014
From: Colin Ian King <colin.king at canonical.com>
Update to ACPICA version 20140828. Refer to
https://lists.acpica.org/pipermail/devel/2014-August/000665.html
for details of fixes and features landed in this release.
Signed-off-by: Colin Ian King <colin.king at canonical.com>
---
src/acpica/source/common/adfile.c | 8 +-
src/acpica/source/common/adisasm.c | 26 +-
src/acpica/source/common/adwalk.c | 1 -
src/acpica/source/common/ahids.c | 0
src/acpica/source/common/ahuuids.c | 3 +
src/acpica/source/common/cmfsize.c | 0
src/acpica/source/common/dmrestag.c | 1 -
src/acpica/source/common/dmtable.c | 1 +
src/acpica/source/common/dmtbdump.c | 5 +
src/acpica/source/common/dmtbinfo.c | 16 +-
src/acpica/source/compiler/Makefile.am | 1 +
src/acpica/source/compiler/aslanalyze.c | 1 -
src/acpica/source/compiler/aslascii.c | 421 ++++++++++++
src/acpica/source/compiler/aslbtypes.c | 1 -
src/acpica/source/compiler/aslcodegen.c | 1 -
src/acpica/source/compiler/aslcompile.c | 743 ++++++++-------------
src/acpica/source/compiler/aslcompiler.h | 20 +-
src/acpica/source/compiler/aslcompiler.l | 8 +-
src/acpica/source/compiler/asldefine.h | 5 +-
src/acpica/source/compiler/aslerror.c | 8 +-
src/acpica/source/compiler/aslfileio.c | 2 +
src/acpica/source/compiler/aslfiles.c | 9 +-
src/acpica/source/compiler/aslfold.c | 1 -
src/acpica/source/compiler/aslglobal.h | 29 +-
src/acpica/source/compiler/aslhex.c | 1 -
src/acpica/source/compiler/asllength.c | 1 -
src/acpica/source/compiler/aslload.c | 1 +
src/acpica/source/compiler/asllookup.c | 1 -
src/acpica/source/compiler/aslmain.c | 13 +-
src/acpica/source/compiler/aslmessages.c | 4 +-
src/acpica/source/compiler/aslmessages.h | 2 +
src/acpica/source/compiler/aslmethod.c | 53 +-
src/acpica/source/compiler/aslnamesp.c | 1 -
src/acpica/source/compiler/aslopcodes.c | 1 -
src/acpica/source/compiler/asloperands.c | 7 +-
src/acpica/source/compiler/aslopt.c | 3 +-
src/acpica/source/compiler/aslresource.c | 34 +-
src/acpica/source/compiler/aslrestype1.c | 1 -
src/acpica/source/compiler/aslrestype1i.c | 1 -
src/acpica/source/compiler/aslrestype2.c | 1 -
src/acpica/source/compiler/aslrestype2d.c | 1 -
src/acpica/source/compiler/aslrestype2e.c | 1 -
src/acpica/source/compiler/aslrestype2q.c | 1 -
src/acpica/source/compiler/aslrestype2s.c | 1 -
src/acpica/source/compiler/aslrestype2w.c | 1 -
src/acpica/source/compiler/aslstartup.c | 16 +-
src/acpica/source/compiler/aslsupport.l | 18 +-
src/acpica/source/compiler/asltransform.c | 2 -
src/acpica/source/compiler/asltree.c | 25 +-
src/acpica/source/compiler/asltypes.h | 11 +-
src/acpica/source/compiler/aslutils.c | 64 +-
src/acpica/source/compiler/aslwalks.c | 1 -
src/acpica/source/compiler/aslxref.c | 193 +++++-
src/acpica/source/compiler/dtcompile.c | 12 +-
src/acpica/source/compiler/dtcompiler.h | 26 +-
src/acpica/source/compiler/dtio.c | 14 +-
src/acpica/source/compiler/dtsubtable.c | 4 +-
src/acpica/source/compiler/dttable.c | 5 +
src/acpica/source/compiler/dttemplate.c | 7 +-
src/acpica/source/compiler/dttemplate.h | 13 +-
src/acpica/source/compiler/dtutils.c | 146 +++-
src/acpica/source/compiler/prutils.c | 9 +-
src/acpica/source/components/debugger/dbcmds.c | 1 -
src/acpica/source/components/debugger/dbconvert.c | 1 -
src/acpica/source/components/debugger/dbdisply.c | 1 -
src/acpica/source/components/debugger/dbexec.c | 1 -
src/acpica/source/components/debugger/dbfileio.c | 1 -
src/acpica/source/components/debugger/dbhistry.c | 1 -
src/acpica/source/components/debugger/dbinput.c | 1 -
src/acpica/source/components/debugger/dbmethod.c | 1 -
src/acpica/source/components/debugger/dbnames.c | 1 -
src/acpica/source/components/debugger/dbstats.c | 1 -
src/acpica/source/components/debugger/dbtest.c | 0
src/acpica/source/components/debugger/dbutils.c | 1 -
src/acpica/source/components/debugger/dbxface.c | 1 -
.../source/components/disassembler/dmdeferred.c | 1 -
.../source/components/disassembler/dmnames.c | 1 -
.../source/components/disassembler/dmobject.c | 1 -
.../source/components/disassembler/dmresrc.c | 1 -
.../source/components/disassembler/dmresrcl.c | 1 -
.../source/components/disassembler/dmresrcl2.c | 3 +-
.../source/components/disassembler/dmresrcs.c | 1 -
.../source/components/disassembler/dmutils.c | 1 -
src/acpica/source/components/disassembler/dmwalk.c | 1 -
src/acpica/source/components/dispatcher/dswstate.c | 1 -
src/acpica/source/components/events/evgpeinit.c | 1 -
src/acpica/source/components/events/evhandler.c | 1 -
src/acpica/source/components/events/evregion.c | 1 -
src/acpica/source/components/events/evrgnini.c | 1 -
src/acpica/source/components/events/evxface.c | 1 -
src/acpica/source/components/events/evxfevnt.c | 1 -
src/acpica/source/components/events/evxfgpe.c | 1 -
src/acpica/source/components/executer/exconvrt.c | 1 -
src/acpica/source/components/executer/exdebug.c | 2 +-
src/acpica/source/components/executer/exfield.c | 1 -
src/acpica/source/components/executer/exfldio.c | 1 -
src/acpica/source/components/executer/exoparg2.c | 1 -
src/acpica/source/components/executer/exregion.c | 1 -
src/acpica/source/components/namespace/nsalloc.c | 1 -
src/acpica/source/components/namespace/nsinit.c | 1 -
src/acpica/source/components/namespace/nsobject.c | 1 -
src/acpica/source/components/namespace/nsprepkg.c | 40 ++
src/acpica/source/components/namespace/nswalk.c | 1 -
src/acpica/source/components/namespace/nsxfeval.c | 1 -
src/acpica/source/components/namespace/nsxfobj.c | 1 -
src/acpica/source/components/parser/psloop.c | 1 -
src/acpica/source/components/parser/psobject.c | 1 -
src/acpica/source/components/parser/psopcode.c | 1 -
src/acpica/source/components/parser/psopinfo.c | 1 -
src/acpica/source/components/parser/psparse.c | 1 -
src/acpica/source/components/parser/psscope.c | 1 -
src/acpica/source/components/parser/pstree.c | 1 -
src/acpica/source/components/parser/psutils.c | 1 -
src/acpica/source/components/parser/pswalk.c | 1 -
src/acpica/source/components/resources/rsdump.c | 1 -
.../source/components/resources/rsdumpinfo.c | 1 -
src/acpica/source/components/resources/rsutils.c | 1 -
src/acpica/source/components/resources/rsxface.c | 1 -
src/acpica/source/components/tables/tbdata.c | 0
src/acpica/source/components/utilities/utexcep.c | 1 -
src/acpica/source/components/utilities/utfileio.c | 1 -
src/acpica/source/components/utilities/utinit.c | 1 -
src/acpica/source/components/utilities/utmath.c | 1 -
src/acpica/source/components/utilities/utmisc.c | 1 -
src/acpica/source/components/utilities/utmutex.c | 1 -
src/acpica/source/components/utilities/utownerid.c | 1 -
src/acpica/source/components/utilities/utresrc.c | 5 +-
src/acpica/source/components/utilities/utstate.c | 1 -
src/acpica/source/components/utilities/utstring.c | 1 -
src/acpica/source/components/utilities/utxface.c | 1 -
src/acpica/source/components/utilities/utxfinit.c | 1 -
src/acpica/source/include/acdisasm.h | 1 +
src/acpica/source/include/acdispat.h | 1 -
src/acpica/source/include/acnames.h | 4 +
src/acpica/source/include/acparser.h | 1 -
src/acpica/source/include/acpixf.h | 2 +-
src/acpica/source/include/actbl1.h | 21 +-
src/acpica/source/include/actbl3.h | 8 +-
src/acpica/source/include/platform/aclinux.h | 12 +
src/acpica/source/include/platform/aclinuxex.h | 22 +
.../source/os_specific/service_layers/osunixxf.c | 1 -
141 files changed, 1451 insertions(+), 742 deletions(-)
mode change 100755 => 100644 src/acpica/source/common/ahids.c
mode change 100755 => 100644 src/acpica/source/common/cmfsize.c
create mode 100644 src/acpica/source/compiler/aslascii.c
mode change 100755 => 100644 src/acpica/source/components/debugger/dbtest.c
mode change 100755 => 100644 src/acpica/source/components/tables/tbdata.c
diff --git a/src/acpica/source/common/adfile.c b/src/acpica/source/common/adfile.c
index 3426107..6a2625a 100644
--- a/src/acpica/source/common/adfile.c
+++ b/src/acpica/source/common/adfile.c
@@ -113,7 +113,7 @@
*
*****************************************************************************/
-
+#include "aslcompiler.h"
#include "acpi.h"
#include "accommon.h"
#include "acapps.h"
@@ -278,7 +278,7 @@ FlGenerateFilename (
* Copy the original filename to a new buffer. Leave room for the worst
* case where we append the suffix, an added dot and the null terminator.
*/
- NewFilename = ACPI_ALLOCATE_ZEROED ((ACPI_SIZE)
+ NewFilename = UtStringCacheCalloc ((ACPI_SIZE)
strlen (InputFilename) + strlen (Suffix) + 2);
if (!NewFilename)
{
@@ -327,7 +327,7 @@ FlStrdup (
char *NewString;
- NewString = ACPI_ALLOCATE ((ACPI_SIZE) strlen (String) + 1);
+ NewString = UtStringCacheCalloc ((ACPI_SIZE) strlen (String) + 1);
if (!NewString)
{
return (NULL);
@@ -409,7 +409,6 @@ FlSplitInputPathname (
if (!Filename)
{
- ACPI_FREE (DirectoryPath);
return (AE_NO_MEMORY);
}
@@ -421,6 +420,5 @@ FlSplitInputPathname (
return (AE_OK);
}
- ACPI_FREE (Filename);
return (AE_OK);
}
diff --git a/src/acpica/source/common/adisasm.c b/src/acpica/source/common/adisasm.c
index df70001..a34dff5 100644
--- a/src/acpica/source/common/adisasm.c
+++ b/src/acpica/source/common/adisasm.c
@@ -113,12 +113,9 @@
*
*****************************************************************************/
-
-#include "acpi.h"
-#include "accommon.h"
+#include "aslcompiler.h"
#include "acparser.h"
#include "amlcode.h"
-#include "acdebug.h"
#include "acdisasm.h"
#include "acdispat.h"
#include "acnamesp.h"
@@ -132,23 +129,6 @@
#define _COMPONENT ACPI_TOOLS
ACPI_MODULE_NAME ("adisasm")
-/*
- * Older versions of Bison won't emit this external in the generated header.
- * Newer versions do emit the external, so we don't need to do it.
- */
-#ifndef ASLCOMPILER_ASLCOMPILERPARSE_H
-extern int AslCompilerdebug;
-#endif
-
-ACPI_STATUS
-NsDisplayNamespace (
- void);
-
-void
-NsSetupNamespaceListing (
- void *Handle);
-
-
/* Local prototypes */
static void
@@ -726,7 +706,7 @@ AdCreateTableHeader (
}
else
{
- NewFilename = ACPI_ALLOCATE_ZEROED (9);
+ NewFilename = UtStringCacheCalloc (9);
if (NewFilename)
{
strncat (NewFilename, Table->Signature, 4);
@@ -746,8 +726,6 @@ AdCreateTableHeader (
"DefinitionBlock (\"%s\", \"%4.4s\", %hu, \"%.6s\", \"%.8s\", 0x%8.8X)\n",
NewFilename, Table->Signature, Table->Revision,
Table->OemId, Table->OemTableId, Table->OemRevision);
-
- ACPI_FREE (NewFilename);
}
diff --git a/src/acpica/source/common/adwalk.c b/src/acpica/source/common/adwalk.c
index 808e4e2..aa50195 100644
--- a/src/acpica/source/common/adwalk.c
+++ b/src/acpica/source/common/adwalk.c
@@ -113,7 +113,6 @@
*
*****************************************************************************/
-
#include "acpi.h"
#include "accommon.h"
#include "acparser.h"
diff --git a/src/acpica/source/common/ahids.c b/src/acpica/source/common/ahids.c
old mode 100755
new mode 100644
diff --git a/src/acpica/source/common/ahuuids.c b/src/acpica/source/common/ahuuids.c
index 1bf362c..e2da9c1 100644
--- a/src/acpica/source/common/ahuuids.c
+++ b/src/acpica/source/common/ahuuids.c
@@ -160,6 +160,9 @@ const AH_UUID AcpiUuids[] =
{"Physical Presence Interface",
"3dddfaa6-361b-4eb4-a424-8d10089d1653"},
+ {"Device Properties for _DSD",
+ "daffd814-6eba-4d8c-8a91-bc9bbf4aa301"},
+
{NULL, NULL}
};
diff --git a/src/acpica/source/common/cmfsize.c b/src/acpica/source/common/cmfsize.c
old mode 100755
new mode 100644
diff --git a/src/acpica/source/common/dmrestag.c b/src/acpica/source/common/dmrestag.c
index 7eca155..d21b111 100644
--- a/src/acpica/source/common/dmrestag.c
+++ b/src/acpica/source/common/dmrestag.c
@@ -113,7 +113,6 @@
*
*****************************************************************************/
-
#include "acpi.h"
#include "accommon.h"
#include "acparser.h"
diff --git a/src/acpica/source/common/dmtable.c b/src/acpica/source/common/dmtable.c
index efb50b5..8ed2236 100644
--- a/src/acpica/source/common/dmtable.c
+++ b/src/acpica/source/common/dmtable.c
@@ -325,6 +325,7 @@ static const char *AcpiDmSratSubnames[] =
"Processor Local APIC/SAPIC Affinity",
"Memory Affinity",
"Processor Local x2APIC Affinity",
+ "GICC Affinity",
"Unknown SubTable Type" /* Reserved */
};
diff --git a/src/acpica/source/common/dmtbdump.c b/src/acpica/source/common/dmtbdump.c
index b0ae905..235c650 100644
--- a/src/acpica/source/common/dmtbdump.c
+++ b/src/acpica/source/common/dmtbdump.c
@@ -2811,6 +2811,11 @@ AcpiDmDumpSrat (
InfoTable = AcpiDmTableInfoSrat2;
break;
+ case ACPI_SRAT_TYPE_GICC_AFFINITY:
+
+ InfoTable = AcpiDmTableInfoSrat3;
+ break;
+
default:
AcpiOsPrintf ("\n**** Unknown SRAT subtable type 0x%X\n", SubTable->Type);
diff --git a/src/acpica/source/common/dmtbinfo.c b/src/acpica/source/common/dmtbinfo.c
index 2a3bed4..777928d 100644
--- a/src/acpica/source/common/dmtbinfo.c
+++ b/src/acpica/source/common/dmtbinfo.c
@@ -279,6 +279,7 @@
#define ACPI_SRAT0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_SRAT_CPU_AFFINITY,f)
#define ACPI_SRAT1_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_SRAT_MEM_AFFINITY,f)
#define ACPI_SRAT2_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_SRAT_X2APIC_CPU_AFFINITY,f)
+#define ACPI_SRAT3_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_SRAT_GICC_AFFINITY,f)
#define ACPI_VRTC0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_VRTC_ENTRY,f)
#define ACPI_WDAT0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_WDAT_ENTRY,f)
@@ -295,6 +296,7 @@
#define ACPI_SRAT0_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_SRAT_CPU_AFFINITY,f,o)
#define ACPI_SRAT1_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_SRAT_MEM_AFFINITY,f,o)
#define ACPI_SRAT2_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_SRAT_X2APIC_CPU_AFFINITY,f,o)
+#define ACPI_SRAT3_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_SRAT_GICC_AFFINITY,f,o)
#define ACPI_GTDT_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_TABLE_GTDT,f,o)
#define ACPI_GTDT0a_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_GTDT_TIMER_ENTRY,f,o)
#define ACPI_GTDT1_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_GTDT_WATCHDOG,f,o)
@@ -2258,7 +2260,7 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoSrat0[] =
{ACPI_DMT_FLAG0, ACPI_SRAT0_FLAG_OFFSET (Flags,0), "Enabled", 0},
{ACPI_DMT_UINT8, ACPI_SRAT0_OFFSET (LocalSapicEid), "Local Sapic EID", 0},
{ACPI_DMT_UINT24, ACPI_SRAT0_OFFSET (ProximityDomainHi[0]), "Proximity Domain High(24)", 0},
- {ACPI_DMT_UINT32, ACPI_SRAT0_OFFSET (Reserved), "Reserved", 0},
+ {ACPI_DMT_UINT32, ACPI_SRAT0_OFFSET (ClockDomain), "Clock Domain", 0},
ACPI_DMT_TERMINATOR
};
@@ -2293,6 +2295,18 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoSrat2[] =
ACPI_DMT_TERMINATOR
};
+/* : GICC Affinity (ACPI 5.1) */
+
+ACPI_DMTABLE_INFO AcpiDmTableInfoSrat3[] =
+{
+ {ACPI_DMT_UINT32, ACPI_SRAT3_OFFSET (ProximityDomain), "Proximity Domain", 0},
+ {ACPI_DMT_UINT32, ACPI_SRAT3_OFFSET (AcpiProcessorUid), "Acpi Processor UID", 0},
+ {ACPI_DMT_UINT32, ACPI_SRAT3_OFFSET (Flags), "Flags (decoded below)", DT_FLAG},
+ {ACPI_DMT_FLAG0, ACPI_SRAT3_FLAG_OFFSET (Flags,0), "Enabled", 0},
+ {ACPI_DMT_UINT32, ACPI_SRAT3_OFFSET (ClockDomain), "Clock Domain", 0},
+ ACPI_DMT_TERMINATOR
+};
+
/*******************************************************************************
*
diff --git a/src/acpica/source/compiler/Makefile.am b/src/acpica/source/compiler/Makefile.am
index a1de14a..34caaee 100644
--- a/src/acpica/source/compiler/Makefile.am
+++ b/src/acpica/source/compiler/Makefile.am
@@ -59,6 +59,7 @@ CLEANFILES = y.output y.tab.c y.tab.h aslcompiler.y.h \
libfwtsiasl_la_CPPFLAGS = $(AM_CPPFLAGS)
libfwtsiasl_la_SOURCES = \
fwts_iasl_interface.c \
+ aslascii.c \
aslcompile.c \
aslcompilerlex.c \
aslcompilerparse.c \
diff --git a/src/acpica/source/compiler/aslanalyze.c b/src/acpica/source/compiler/aslanalyze.c
index 8bfc9ac..8562ecd 100644
--- a/src/acpica/source/compiler/aslanalyze.c
+++ b/src/acpica/source/compiler/aslanalyze.c
@@ -113,7 +113,6 @@
*
*****************************************************************************/
-
#include "aslcompiler.h"
#include "aslcompiler.y.h"
#include <string.h>
diff --git a/src/acpica/source/compiler/aslascii.c b/src/acpica/source/compiler/aslascii.c
new file mode 100644
index 0000000..09ab9e9
--- /dev/null
+++ b/src/acpica/source/compiler/aslascii.c
@@ -0,0 +1,421 @@
+/******************************************************************************
+ *
+ * Module Name: aslascii - ASCII detection and support routines
+ *
+ *****************************************************************************/
+
+/******************************************************************************
+ *
+ * 1. Copyright Notice
+ *
+ * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp.
+ * All rights reserved.
+ *
+ * 2. License
+ *
+ * 2.1. This is your license from Intel Corp. under its intellectual property
+ * rights. You may have additional license terms from the party that provided
+ * you this software, covering your right to use that party's intellectual
+ * property rights.
+ *
+ * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
+ * copy of the source code appearing in this file ("Covered Code") an
+ * irrevocable, perpetual, worldwide license under Intel's copyrights in the
+ * base code distributed originally by Intel ("Original Intel Code") to copy,
+ * make derivatives, distribute, use and display any portion of the Covered
+ * Code in any form, with the right to sublicense such rights; and
+ *
+ * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
+ * license (with the right to sublicense), under only those claims of Intel
+ * patents that are infringed by the Original Intel Code, to make, use, sell,
+ * offer to sell, and import the Covered Code and derivative works thereof
+ * solely to the minimum extent necessary to exercise the above copyright
+ * license, and in no event shall the patent license extend to any additions
+ * to or modifications of the Original Intel Code. No other license or right
+ * is granted directly or by implication, estoppel or otherwise;
+ *
+ * The above copyright and patent license is granted only if the following
+ * conditions are met:
+ *
+ * 3. Conditions
+ *
+ * 3.1. Redistribution of Source with Rights to Further Distribute Source.
+ * Redistribution of source code of any substantial portion of the Covered
+ * Code or modification with rights to further distribute source must include
+ * the above Copyright Notice, the above License, this list of Conditions,
+ * and the following Disclaimer and Export Compliance provision. In addition,
+ * Licensee must cause all Covered Code to which Licensee contributes to
+ * contain a file documenting the changes Licensee made to create that Covered
+ * Code and the date of any change. Licensee must include in that file the
+ * documentation of any changes made by any predecessor Licensee. Licensee
+ * must include a prominent statement that the modification is derived,
+ * directly or indirectly, from Original Intel Code.
+ *
+ * 3.2. Redistribution of Source with no Rights to Further Distribute Source.
+ * Redistribution of source code of any substantial portion of the Covered
+ * Code or modification without rights to further distribute source must
+ * include the following Disclaimer and Export Compliance provision in the
+ * documentation and/or other materials provided with distribution. In
+ * addition, Licensee may not authorize further sublicense of source of any
+ * portion of the Covered Code, and must include terms to the effect that the
+ * license from Licensee to its licensee is limited to the intellectual
+ * property embodied in the software Licensee provides to its licensee, and
+ * not to intellectual property embodied in modifications its licensee may
+ * make.
+ *
+ * 3.3. Redistribution of Executable. Redistribution in executable form of any
+ * substantial portion of the Covered Code or modification must reproduce the
+ * above Copyright Notice, and the following Disclaimer and Export Compliance
+ * provision in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * 3.4. Intel retains all right, title, and interest in and to the Original
+ * Intel Code.
+ *
+ * 3.5. Neither the name Intel nor any other trademark owned or controlled by
+ * Intel shall be used in advertising or otherwise to promote the sale, use or
+ * other dealings in products derived from or relating to the Covered Code
+ * without prior written authorization from Intel.
+ *
+ * 4. Disclaimer and Export Compliance
+ *
+ * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
+ * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
+ * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
+ * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
+ * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
+ * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
+ * PARTICULAR PURPOSE.
+ *
+ * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
+ * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
+ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
+ * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
+ * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
+ * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
+ * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
+ * LIMITED REMEDY.
+ *
+ * 4.3. Licensee shall not export, either directly or indirectly, any of this
+ * software or system incorporating such software without first obtaining any
+ * required license or other approval from the U. S. Department of Commerce or
+ * any other agency or department of the United States Government. In the
+ * event Licensee exports any such software from the United States or
+ * re-exports any such software from a foreign destination, Licensee shall
+ * ensure that the distribution and export/re-export of the software is in
+ * compliance with all laws, regulations, orders, or other restrictions of the
+ * U.S. Export Administration Regulations. Licensee agrees that neither it nor
+ * any of its subsidiaries will export/re-export any technical data, process,
+ * software, or service, directly or indirectly, to any country for which the
+ * United States government or any agency thereof requires an export license,
+ * other governmental approval, or letter of assurance, without first obtaining
+ * such license, approval or letter.
+ *
+ *****************************************************************************/
+
+#include "aslcompiler.h"
+#include <acapps.h>
+
+#define _COMPONENT ACPI_COMPILER
+ ACPI_MODULE_NAME ("aslascii")
+
+
+/* Local prototypes */
+
+static void
+FlConsumeAnsiComment (
+ FILE *Handle,
+ ASL_FILE_STATUS *Status);
+
+static void
+FlConsumeNewComment (
+ FILE *Handle,
+ ASL_FILE_STATUS *Status);
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: FlCheckForAcpiTable
+ *
+ * PARAMETERS: Handle - Open input file
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Determine if a file seems to be a binary ACPI table, via the
+ * following checks on what would be the table header:
+ * 0) File must be at least as long as an ACPI_TABLE_HEADER
+ * 1) The header length field must match the file size
+ * 2) Signature, OemId, OemTableId, AslCompilerId must be ASCII
+ *
+ ******************************************************************************/
+
+ACPI_STATUS
+FlCheckForAcpiTable (
+ FILE *Handle)
+{
+ ACPI_TABLE_HEADER Table;
+ UINT32 FileSize;
+ size_t Actual;
+ UINT32 i;
+
+
+ /* Read a potential table header */
+
+ Actual = fread (&Table, 1, sizeof (ACPI_TABLE_HEADER), Handle);
+ fseek (Handle, 0, SEEK_SET);
+
+ if (Actual < sizeof (ACPI_TABLE_HEADER))
+ {
+ return (AE_ERROR);
+ }
+
+ /* Header length field must match the file size */
+
+ FileSize = CmGetFileSize (Handle);
+ if (Table.Length != FileSize)
+ {
+ return (AE_ERROR);
+ }
+
+ /*
+ * These fields must be ASCII:
+ * Signature, OemId, OemTableId, AslCompilerId.
+ * We allow a NULL terminator in OemId and OemTableId.
+ */
+ for (i = 0; i < ACPI_NAME_SIZE; i++)
+ {
+ if (!ACPI_IS_ASCII ((UINT8) Table.Signature[i]))
+ {
+ return (AE_ERROR);
+ }
+
+ if (!ACPI_IS_ASCII ((UINT8) Table.AslCompilerId[i]))
+ {
+ return (AE_ERROR);
+ }
+ }
+
+ for (i = 0; (i < ACPI_OEM_ID_SIZE) && (Table.OemId[i]); i++)
+ {
+ if (!ACPI_IS_ASCII ((UINT8) Table.OemId[i]))
+ {
+ return (AE_ERROR);
+ }
+ }
+
+ for (i = 0; (i < ACPI_OEM_TABLE_ID_SIZE) && (Table.OemTableId[i]); i++)
+ {
+ if (!ACPI_IS_ASCII ((UINT8) Table.OemTableId[i]))
+ {
+ return (AE_ERROR);
+ }
+ }
+
+ printf ("Binary file appears to be a valid ACPI table, disassembling\n");
+ return (AE_OK);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: FlCheckForAscii
+ *
+ * PARAMETERS: Handle - Open input file
+ * Filename - Input filename
+ * DisplayErrors - TRUE if error messages desired
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Verify that the input file is entirely ASCII. Ignores characters
+ * within comments. Note: does not handle nested comments and does
+ * not handle comment delimiters within string literals. However,
+ * on the rare chance this happens and an invalid character is
+ * missed, the parser will catch the error by failing in some
+ * spectactular manner.
+ *
+ ******************************************************************************/
+
+ACPI_STATUS
+FlCheckForAscii (
+ FILE *Handle,
+ char *Filename,
+ BOOLEAN DisplayErrors)
+{
+ UINT8 Byte;
+ ACPI_SIZE BadBytes = 0;
+ BOOLEAN OpeningComment = FALSE;
+ ASL_FILE_STATUS Status;
+
+
+ Status.Line = 1;
+ Status.Offset = 0;
+
+ /* Read the entire file */
+
+ while (fread (&Byte, 1, 1, Handle) == 1)
+ {
+ /* Ignore comment fields (allow non-ascii within) */
+
+ if (OpeningComment)
+ {
+ /* Check for second comment open delimiter */
+
+ if (Byte == '*')
+ {
+ FlConsumeAnsiComment (Handle, &Status);
+ }
+
+ if (Byte == '/')
+ {
+ FlConsumeNewComment (Handle, &Status);
+ }
+
+ /* Reset */
+
+ OpeningComment = FALSE;
+ }
+ else if (Byte == '/')
+ {
+ OpeningComment = TRUE;
+ }
+
+ /* Check for an ASCII character */
+
+ if (!ACPI_IS_ASCII (Byte))
+ {
+ if ((BadBytes < 10) && (DisplayErrors))
+ {
+ AcpiOsPrintf (
+ "Non-ASCII character [0x%2.2X] found in line %u, file offset 0x%.2X\n",
+ Byte, Status.Line, Status.Offset);
+ }
+
+ BadBytes++;
+ }
+
+ /* Update line counter */
+
+ else if (Byte == 0x0A)
+ {
+ Status.Line++;
+ }
+
+ Status.Offset++;
+ }
+
+ /* Seek back to the beginning of the source file */
+
+ fseek (Handle, 0, SEEK_SET);
+
+ /* Were there any non-ASCII characters in the file? */
+
+ if (BadBytes)
+ {
+ if (DisplayErrors)
+ {
+ AcpiOsPrintf (
+ "%u non-ASCII characters found in input source text, could be a binary file\n",
+ BadBytes);
+ AslError (ASL_ERROR, ASL_MSG_NON_ASCII, NULL, Filename);
+ }
+
+ return (AE_BAD_CHARACTER);
+ }
+
+ /* File is OK (100% ASCII) */
+
+ return (AE_OK);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: FlConsumeAnsiComment
+ *
+ * PARAMETERS: Handle - Open input file
+ * Status - File current status struct
+ *
+ * RETURN: Number of lines consumed
+ *
+ * DESCRIPTION: Step over a normal slash-star type comment
+ *
+ ******************************************************************************/
+
+static void
+FlConsumeAnsiComment (
+ FILE *Handle,
+ ASL_FILE_STATUS *Status)
+{
+ UINT8 Byte;
+ BOOLEAN ClosingComment = FALSE;
+
+
+ while (fread (&Byte, 1, 1, Handle) == 1)
+ {
+ /* Scan until comment close is found */
+
+ if (ClosingComment)
+ {
+ if (Byte == '/')
+ {
+ return;
+ }
+
+ if (Byte != '*')
+ {
+ /* Reset */
+
+ ClosingComment = FALSE;
+ }
+ }
+ else if (Byte == '*')
+ {
+ ClosingComment = TRUE;
+ }
+
+ /* Maintain line count */
+
+ if (Byte == 0x0A)
+ {
+ Status->Line++;
+ }
+
+ Status->Offset++;
+ }
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: FlConsumeNewComment
+ *
+ * PARAMETERS: Handle - Open input file
+ * Status - File current status struct
+ *
+ * RETURN: Number of lines consumed
+ *
+ * DESCRIPTION: Step over a slash-slash type of comment
+ *
+ ******************************************************************************/
+
+static void
+FlConsumeNewComment (
+ FILE *Handle,
+ ASL_FILE_STATUS *Status)
+{
+ UINT8 Byte;
+
+
+ while (fread (&Byte, 1, 1, Handle) == 1)
+ {
+ Status->Offset++;
+
+ /* Comment ends at newline */
+
+ if (Byte == 0x0A)
+ {
+ Status->Line++;
+ return;
+ }
+ }
+}
diff --git a/src/acpica/source/compiler/aslbtypes.c b/src/acpica/source/compiler/aslbtypes.c
index 58cb792..bb80368 100644
--- a/src/acpica/source/compiler/aslbtypes.c
+++ b/src/acpica/source/compiler/aslbtypes.c
@@ -113,7 +113,6 @@
*
*****************************************************************************/
-
#include "aslcompiler.h"
#include "aslcompiler.y.h"
#include "amlcode.h"
diff --git a/src/acpica/source/compiler/aslcodegen.c b/src/acpica/source/compiler/aslcodegen.c
index 2de4a58..77fc315 100644
--- a/src/acpica/source/compiler/aslcodegen.c
+++ b/src/acpica/source/compiler/aslcodegen.c
@@ -113,7 +113,6 @@
*
*****************************************************************************/
-
#include "aslcompiler.h"
#include "aslcompiler.y.h"
#include "amlcode.h"
diff --git a/src/acpica/source/compiler/aslcompile.c b/src/acpica/source/compiler/aslcompile.c
index 8f14ef5..a051e0f 100644
--- a/src/acpica/source/compiler/aslcompile.c
+++ b/src/acpica/source/compiler/aslcompile.c
@@ -115,6 +115,7 @@
#include "aslcompiler.h"
#include "dtcompiler.h"
+#include "acnamesp.h"
#include <stdio.h>
#include <time.h>
@@ -139,484 +140,8 @@ CmFlushSourceCode (
void);
static void
-FlConsumeAnsiComment (
- FILE *Handle,
- ASL_FILE_STATUS *Status);
-
-static void
-FlConsumeNewComment (
- FILE *Handle,
- ASL_FILE_STATUS *Status);
-
-static void
-CmDumpAllEvents (
- void);
-
-
-/*******************************************************************************
- *
- * FUNCTION: AslCompilerSignon
- *
- * PARAMETERS: FileId - ID of the output file
- *
- * RETURN: None
- *
- * DESCRIPTION: Display compiler signon
- *
- ******************************************************************************/
-
-void
-AslCompilerSignon (
- UINT32 FileId)
-{
- char *Prefix = "";
- char *UtilityName;
-
-
- /* Set line prefix depending on the destination file type */
-
- switch (FileId)
- {
- case ASL_FILE_ASM_SOURCE_OUTPUT:
- case ASL_FILE_ASM_INCLUDE_OUTPUT:
-
- Prefix = "; ";
- break;
-
- case ASL_FILE_HEX_OUTPUT:
-
- if (Gbl_HexOutputFlag == HEX_OUTPUT_ASM)
- {
- Prefix = "; ";
- }
- else if ((Gbl_HexOutputFlag == HEX_OUTPUT_C) ||
- (Gbl_HexOutputFlag == HEX_OUTPUT_ASL))
- {
- FlPrintFile (ASL_FILE_HEX_OUTPUT, "/*\n");
- Prefix = " * ";
- }
- break;
-
- case ASL_FILE_C_SOURCE_OUTPUT:
- case ASL_FILE_C_OFFSET_OUTPUT:
- case ASL_FILE_C_INCLUDE_OUTPUT:
-
- Prefix = " * ";
- break;
-
- default:
-
- /* No other output types supported */
-
- break;
- }
-
- /* Running compiler or disassembler? */
-
- if (Gbl_DisasmFlag)
- {
- UtilityName = AML_DISASSEMBLER_NAME;
- }
- else
- {
- UtilityName = ASL_COMPILER_NAME;
- }
-
- /* Compiler signon with copyright */
-
- FlPrintFile (FileId, "%s\n", Prefix);
- FlPrintFile (FileId, ACPI_COMMON_HEADER (UtilityName, Prefix));
-}
-
-
-/*******************************************************************************
- *
- * FUNCTION: AslCompilerFileHeader
- *
- * PARAMETERS: FileId - ID of the output file
- *
- * RETURN: None
- *
- * DESCRIPTION: Header used at the beginning of output files
- *
- ******************************************************************************/
-
-void
-AslCompilerFileHeader (
- UINT32 FileId)
-{
- struct tm *NewTime;
- time_t Aclock;
- char *Prefix = "";
-
-
- /* Set line prefix depending on the destination file type */
-
- switch (FileId)
- {
- case ASL_FILE_ASM_SOURCE_OUTPUT:
- case ASL_FILE_ASM_INCLUDE_OUTPUT:
-
- Prefix = "; ";
- break;
-
- case ASL_FILE_HEX_OUTPUT:
-
- if (Gbl_HexOutputFlag == HEX_OUTPUT_ASM)
- {
- Prefix = "; ";
- }
- else if ((Gbl_HexOutputFlag == HEX_OUTPUT_C) ||
- (Gbl_HexOutputFlag == HEX_OUTPUT_ASL))
- {
- Prefix = " * ";
- }
- break;
-
- case ASL_FILE_C_SOURCE_OUTPUT:
- case ASL_FILE_C_OFFSET_OUTPUT:
- case ASL_FILE_C_INCLUDE_OUTPUT:
-
- Prefix = " * ";
- break;
-
- default:
-
- /* No other output types supported */
-
- break;
- }
-
- /* Compilation header with timestamp */
-
- (void) time (&Aclock);
- NewTime = localtime (&Aclock);
-
- FlPrintFile (FileId,
- "%sCompilation of \"%s\" - %s%s\n",
- Prefix, Gbl_Files[ASL_FILE_INPUT].Filename, asctime (NewTime),
- Prefix);
-
- switch (FileId)
- {
- case ASL_FILE_C_SOURCE_OUTPUT:
- case ASL_FILE_C_OFFSET_OUTPUT:
- case ASL_FILE_C_INCLUDE_OUTPUT:
-
- FlPrintFile (FileId, " */\n");
- break;
-
- default:
-
- /* Nothing to do for other output types */
-
- break;
- }
-}
-
-
-/*******************************************************************************
- *
- * FUNCTION: CmFlushSourceCode
- *
- * PARAMETERS: None
- *
- * RETURN: None
- *
- * DESCRIPTION: Read in any remaining source code after the parse tree
- * has been constructed.
- *
- ******************************************************************************/
-
-static void
-CmFlushSourceCode (
- void)
-{
- char Buffer;
-
-
- while (FlReadFile (ASL_FILE_INPUT, &Buffer, 1) != AE_ERROR)
- {
- AslInsertLineBuffer ((int) Buffer);
- }
-
- AslResetCurrentLineBuffer ();
-}
-
-
-/*******************************************************************************
- *
- * FUNCTION: FlConsume*
- *
- * PARAMETERS: Handle - Open input file
- * Status - File current status struct
- *
- * RETURN: Number of lines consumed
- *
- * DESCRIPTION: Step over both types of comment during check for ascii chars
- *
- ******************************************************************************/
-
-static void
-FlConsumeAnsiComment (
- FILE *Handle,
- ASL_FILE_STATUS *Status)
-{
- UINT8 Byte;
- BOOLEAN ClosingComment = FALSE;
-
-
- while (fread (&Byte, 1, 1, Handle) == 1)
- {
- /* Scan until comment close is found */
-
- if (ClosingComment)
- {
- if (Byte == '/')
- {
- return;
- }
-
- if (Byte != '*')
- {
- /* Reset */
-
- ClosingComment = FALSE;
- }
- }
- else if (Byte == '*')
- {
- ClosingComment = TRUE;
- }
-
- /* Maintain line count */
-
- if (Byte == 0x0A)
- {
- Status->Line++;
- }
-
- Status->Offset++;
- }
-}
-
-
-static void
-FlConsumeNewComment (
- FILE *Handle,
- ASL_FILE_STATUS *Status)
-{
- UINT8 Byte;
-
-
- while (fread (&Byte, 1, 1, Handle) == 1)
- {
- Status->Offset++;
-
- /* Comment ends at newline */
-
- if (Byte == 0x0A)
- {
- Status->Line++;
- return;
- }
- }
-}
-
-
-/*******************************************************************************
- *
- * FUNCTION: FlCheckForAcpiTable
- *
- * PARAMETERS: Handle - Open input file
- *
- * RETURN: Status
- *
- * DESCRIPTION: Determine if a file seems to be a binary ACPI table, via the
- * following checks on what would be the table header:
- * 0) File must be at least as long as an ACPI_TABLE_HEADER
- * 1) The header length field must match the file size
- * 2) Signature, OemId, OemTableId, AslCompilerId must be ASCII
- *
- ******************************************************************************/
-
-ACPI_STATUS
-FlCheckForAcpiTable (
- FILE *Handle)
-{
- ACPI_TABLE_HEADER Table;
- UINT32 FileSize;
- size_t Actual;
- UINT32 i;
-
-
- /* Read a potential table header */
-
- Actual = fread (&Table, 1, sizeof (ACPI_TABLE_HEADER), Handle);
- fseek (Handle, 0, SEEK_SET);
-
- if (Actual < sizeof (ACPI_TABLE_HEADER))
- {
- return (AE_ERROR);
- }
-
- /* Header length field must match the file size */
-
- FileSize = CmGetFileSize (Handle);
- if (Table.Length != FileSize)
- {
- return (AE_ERROR);
- }
-
- /*
- * These fields must be ASCII:
- * Signature, OemId, OemTableId, AslCompilerId.
- * We allow a NULL terminator in OemId and OemTableId.
- */
- for (i = 0; i < ACPI_NAME_SIZE; i++)
- {
- if (!ACPI_IS_ASCII ((UINT8) Table.Signature[i]))
- {
- return (AE_ERROR);
- }
-
- if (!ACPI_IS_ASCII ((UINT8) Table.AslCompilerId[i]))
- {
- return (AE_ERROR);
- }
- }
-
- for (i = 0; (i < ACPI_OEM_ID_SIZE) && (Table.OemId[i]); i++)
- {
- if (!ACPI_IS_ASCII ((UINT8) Table.OemId[i]))
- {
- return (AE_ERROR);
- }
- }
-
- for (i = 0; (i < ACPI_OEM_TABLE_ID_SIZE) && (Table.OemTableId[i]); i++)
- {
- if (!ACPI_IS_ASCII ((UINT8) Table.OemTableId[i]))
- {
- return (AE_ERROR);
- }
- }
-
- printf ("Binary file appears to be a valid ACPI table, disassembling\n");
- return (AE_OK);
-}
-
-
-/*******************************************************************************
- *
- * FUNCTION: FlCheckForAscii
- *
- * PARAMETERS: Handle - Open input file
- * Filename - Input filename
- * DisplayErrors - TRUE if error messages desired
- *
- * RETURN: Status
- *
- * DESCRIPTION: Verify that the input file is entirely ASCII. Ignores characters
- * within comments. Note: does not handle nested comments and does
- * not handle comment delimiters within string literals. However,
- * on the rare chance this happens and an invalid character is
- * missed, the parser will catch the error by failing in some
- * spectactular manner.
- *
- ******************************************************************************/
-
-ACPI_STATUS
-FlCheckForAscii (
- FILE *Handle,
- char *Filename,
- BOOLEAN DisplayErrors)
-{
- UINT8 Byte;
- ACPI_SIZE BadBytes = 0;
- BOOLEAN OpeningComment = FALSE;
- ASL_FILE_STATUS Status;
-
-
- Status.Line = 1;
- Status.Offset = 0;
-
- /* Read the entire file */
-
- while (fread (&Byte, 1, 1, Handle) == 1)
- {
- /* Ignore comment fields (allow non-ascii within) */
-
- if (OpeningComment)
- {
- /* Check for second comment open delimiter */
-
- if (Byte == '*')
- {
- FlConsumeAnsiComment (Handle, &Status);
- }
-
- if (Byte == '/')
- {
- FlConsumeNewComment (Handle, &Status);
- }
-
- /* Reset */
-
- OpeningComment = FALSE;
- }
- else if (Byte == '/')
- {
- OpeningComment = TRUE;
- }
-
- /* Check for an ASCII character */
-
- if (!ACPI_IS_ASCII (Byte))
- {
- if ((BadBytes < 10) && (DisplayErrors))
- {
- AcpiOsPrintf (
- "Non-ASCII character [0x%2.2X] found in line %u, file offset 0x%.2X\n",
- Byte, Status.Line, Status.Offset);
- }
-
- BadBytes++;
- }
-
- /* Update line counter */
-
- else if (Byte == 0x0A)
- {
- Status.Line++;
- }
-
- Status.Offset++;
- }
-
- /* Seek back to the beginning of the source file */
-
- fseek (Handle, 0, SEEK_SET);
-
- /* Were there any non-ASCII characters in the file? */
-
- if (BadBytes)
- {
- if (DisplayErrors)
- {
- AcpiOsPrintf (
- "%u non-ASCII characters found in input source text, could be a binary file\n",
- BadBytes);
- AslError (ASL_ERROR, ASL_MSG_NON_ASCII, NULL, Filename);
- }
-
- return (AE_BAD_CHARACTER);
- }
-
- /* File is OK (100% ASCII) */
-
- return (AE_OK);
-}
+CmDumpAllEvents (
+ void);
/*******************************************************************************
@@ -689,7 +214,6 @@ CmDoCompile (
goto ErrorExit;
}
-
/* Flush out any remaining source after parse tree is complete */
Event = UtBeginEvent ("Flush source input");
@@ -874,6 +398,197 @@ ErrorExit:
/*******************************************************************************
*
+ * FUNCTION: AslCompilerSignon
+ *
+ * PARAMETERS: FileId - ID of the output file
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Display compiler signon
+ *
+ ******************************************************************************/
+
+void
+AslCompilerSignon (
+ UINT32 FileId)
+{
+ char *Prefix = "";
+ char *UtilityName;
+
+
+ /* Set line prefix depending on the destination file type */
+
+ switch (FileId)
+ {
+ case ASL_FILE_ASM_SOURCE_OUTPUT:
+ case ASL_FILE_ASM_INCLUDE_OUTPUT:
+
+ Prefix = "; ";
+ break;
+
+ case ASL_FILE_HEX_OUTPUT:
+
+ if (Gbl_HexOutputFlag == HEX_OUTPUT_ASM)
+ {
+ Prefix = "; ";
+ }
+ else if ((Gbl_HexOutputFlag == HEX_OUTPUT_C) ||
+ (Gbl_HexOutputFlag == HEX_OUTPUT_ASL))
+ {
+ FlPrintFile (ASL_FILE_HEX_OUTPUT, "/*\n");
+ Prefix = " * ";
+ }
+ break;
+
+ case ASL_FILE_C_SOURCE_OUTPUT:
+ case ASL_FILE_C_OFFSET_OUTPUT:
+ case ASL_FILE_C_INCLUDE_OUTPUT:
+
+ Prefix = " * ";
+ break;
+
+ default:
+
+ /* No other output types supported */
+
+ break;
+ }
+
+ /* Running compiler or disassembler? */
+
+ if (Gbl_DisasmFlag)
+ {
+ UtilityName = AML_DISASSEMBLER_NAME;
+ }
+ else
+ {
+ UtilityName = ASL_COMPILER_NAME;
+ }
+
+ /* Compiler signon with copyright */
+
+ FlPrintFile (FileId, "%s\n", Prefix);
+ FlPrintFile (FileId, ACPI_COMMON_HEADER (UtilityName, Prefix));
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AslCompilerFileHeader
+ *
+ * PARAMETERS: FileId - ID of the output file
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Header used at the beginning of output files
+ *
+ ******************************************************************************/
+
+void
+AslCompilerFileHeader (
+ UINT32 FileId)
+{
+ struct tm *NewTime;
+ time_t Aclock;
+ char *Prefix = "";
+
+
+ /* Set line prefix depending on the destination file type */
+
+ switch (FileId)
+ {
+ case ASL_FILE_ASM_SOURCE_OUTPUT:
+ case ASL_FILE_ASM_INCLUDE_OUTPUT:
+
+ Prefix = "; ";
+ break;
+
+ case ASL_FILE_HEX_OUTPUT:
+
+ if (Gbl_HexOutputFlag == HEX_OUTPUT_ASM)
+ {
+ Prefix = "; ";
+ }
+ else if ((Gbl_HexOutputFlag == HEX_OUTPUT_C) ||
+ (Gbl_HexOutputFlag == HEX_OUTPUT_ASL))
+ {
+ Prefix = " * ";
+ }
+ break;
+
+ case ASL_FILE_C_SOURCE_OUTPUT:
+ case ASL_FILE_C_OFFSET_OUTPUT:
+ case ASL_FILE_C_INCLUDE_OUTPUT:
+
+ Prefix = " * ";
+ break;
+
+ default:
+
+ /* No other output types supported */
+
+ break;
+ }
+
+ /* Compilation header with timestamp */
+
+ (void) time (&Aclock);
+ NewTime = localtime (&Aclock);
+
+ FlPrintFile (FileId,
+ "%sCompilation of \"%s\" - %s%s\n",
+ Prefix, Gbl_Files[ASL_FILE_INPUT].Filename, asctime (NewTime),
+ Prefix);
+
+ switch (FileId)
+ {
+ case ASL_FILE_C_SOURCE_OUTPUT:
+ case ASL_FILE_C_OFFSET_OUTPUT:
+ case ASL_FILE_C_INCLUDE_OUTPUT:
+
+ FlPrintFile (FileId, " */\n");
+ break;
+
+ default:
+
+ /* Nothing to do for other output types */
+
+ break;
+ }
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: CmFlushSourceCode
+ *
+ * PARAMETERS: None
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Read in any remaining source code after the parse tree
+ * has been constructed.
+ *
+ ******************************************************************************/
+
+static void
+CmFlushSourceCode (
+ void)
+{
+ char Buffer;
+
+
+ while (FlReadFile (ASL_FILE_INPUT, &Buffer, 1) != AE_ERROR)
+ {
+ AslInsertLineBuffer ((int) Buffer);
+ }
+
+ AslResetCurrentLineBuffer ();
+}
+
+
+/*******************************************************************************
+ *
* FUNCTION: CmDoOutputFiles
*
* PARAMETERS: None
@@ -1037,7 +752,8 @@ CmCleanupAndExit (
* We will delete the AML file if there are errors and the
* force AML output option has not been used.
*/
- if ((Gbl_ExceptionCount[ASL_ERROR] > 0) && (!Gbl_IgnoreErrors) &&
+ if ((Gbl_ExceptionCount[ASL_ERROR] > 0) &&
+ (!Gbl_IgnoreErrors) &&
Gbl_Files[ASL_FILE_AML_OUTPUT].Handle)
{
DeleteAmlFile = TRUE;
@@ -1097,4 +813,71 @@ CmCleanupAndExit (
{
FlDeleteFile (ASL_FILE_SOURCE_OUTPUT);
}
+
+ /* Final cleanup after compiling one file */
+
+ CmDeleteCaches ();
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: CmDeleteCaches
+ *
+ * PARAMETERS: None
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Delete all local cache buffer blocks
+ *
+ ******************************************************************************/
+
+void
+CmDeleteCaches (
+ void)
+{
+ UINT32 BufferCount;
+ ASL_CACHE_INFO *Next;
+
+
+ /* Parse Op cache */
+
+ BufferCount = 0;
+ while (Gbl_ParseOpCacheList)
+ {
+ Next = Gbl_ParseOpCacheList->Next;
+ ACPI_FREE (Gbl_ParseOpCacheList);
+ Gbl_ParseOpCacheList = Next;
+ BufferCount++;
+ }
+
+ DbgPrint (ASL_DEBUG_OUTPUT,
+ "%u ParseOps, Buffer size: %u ops (%u bytes), %u Buffers\n",
+ Gbl_ParseOpCount, ASL_PARSEOP_CACHE_SIZE,
+ (sizeof (ACPI_PARSE_OBJECT) * ASL_PARSEOP_CACHE_SIZE), BufferCount);
+
+ Gbl_ParseOpCount = 0;
+ Gbl_ParseOpCacheNext = NULL;
+ Gbl_ParseOpCacheLast = NULL;
+ RootNode = NULL;
+
+ /* Generic string cache */
+
+ BufferCount = 0;
+ while (Gbl_StringCacheList)
+ {
+ Next = Gbl_StringCacheList->Next;
+ ACPI_FREE (Gbl_StringCacheList);
+ Gbl_StringCacheList = Next;
+ BufferCount++;
+ }
+
+ DbgPrint (ASL_DEBUG_OUTPUT,
+ "%u Strings (%u bytes), Buffer size: %u bytes, %u Buffers\n",
+ Gbl_StringCount, Gbl_StringSize, ASL_STRING_CACHE_SIZE, BufferCount);
+
+ Gbl_StringSize = 0;
+ Gbl_StringCount = 0;
+ Gbl_StringCacheNext = NULL;
+ Gbl_StringCacheLast = NULL;
}
diff --git a/src/acpica/source/compiler/aslcompiler.h b/src/acpica/source/compiler/aslcompiler.h
index c4afef4..74b6a45 100644
--- a/src/acpica/source/compiler/aslcompiler.h
+++ b/src/acpica/source/compiler/aslcompiler.h
@@ -113,7 +113,6 @@
*
*****************************************************************************/
-
#ifndef __ASLCOMPILER_H
#define __ASLCOMPILER_H
@@ -183,6 +182,11 @@ AslPushInputFileStack (
FILE *InputFile,
char *Filename);
+void
+AslParserCleanup (
+ void);
+
+
/*
* aslstartup - entered from main()
*/
@@ -226,6 +230,14 @@ void
CmCleanupAndExit (
void);
+void
+CmDeleteCaches (
+ void);
+
+
+/*
+ * aslascii - ascii support
+ */
ACPI_STATUS
FlCheckForAcpiTable (
FILE *Handle);
@@ -986,13 +998,17 @@ UtSetParseOpName (
ACPI_PARSE_OBJECT *Op);
char *
-UtGetStringBuffer (
+UtStringCacheCalloc (
UINT32 Length);
void
UtExpandLineBuffers (
void);
+void
+UtFreeLineBuffers (
+ void);
+
ACPI_STATUS
UtInternalizeName (
char *ExternalName,
diff --git a/src/acpica/source/compiler/aslcompiler.l b/src/acpica/source/compiler/aslcompiler.l
index bdcc8ed..8171f13 100644
--- a/src/acpica/source/compiler/aslcompiler.l
+++ b/src/acpica/source/compiler/aslcompiler.l
@@ -185,7 +185,8 @@ NamePathTail [.]{NameSeg}
"/*" { if (!AslDoComment ()) {yyterminate ();} }
"//" { if (!AslDoCommentType2 ()) {yyterminate ();} }
-"\"" { if (AslDoStringLiteral ()) {return (PARSEOP_STRING_LITERAL);} else {yyterminate ();} }
+"\"" { if (AslDoStringLiteral ()) {return (PARSEOP_STRING_LITERAL);}
+ else {yyterminate ();} }
";" { count (0); return(';'); }
@@ -679,7 +680,7 @@ NamePathTail [.]{NameSeg}
{NameSeg} { char *s;
count (0);
- s=malloc (ACPI_NAME_SIZE + 1);
+ s=UtStringCacheCalloc (ACPI_NAME_SIZE + 1);
if (strcmp (AslCompilertext, "\\"))
{
strcpy (s, "____");
@@ -692,10 +693,9 @@ NamePathTail [.]{NameSeg}
{NameString} { char *s;
count (0);
- s=malloc (strlen (AslCompilertext)+1);
+ s=UtStringCacheCalloc (strlen (AslCompilertext)+1);
AcpiUtStrupr (AslCompilertext);
strcpy (s, AslCompilertext);
- s[strlen (AslCompilertext)] = 0;
AslCompilerlval.s = s;
DbgPrint (ASL_PARSE_OUTPUT, "NameString: %s\n", s);
return (PARSEOP_NAMESTRING); }
diff --git a/src/acpica/source/compiler/asldefine.h b/src/acpica/source/compiler/asldefine.h
index b05bd7f..0332a83 100644
--- a/src/acpica/source/compiler/asldefine.h
+++ b/src/acpica/source/compiler/asldefine.h
@@ -113,7 +113,6 @@
*
*****************************************************************************/
-
#ifndef __ASLDEFINE_H
#define __ASLDEFINE_H
@@ -133,8 +132,8 @@
/* Configuration constants */
#define ASL_MAX_ERROR_COUNT 200
-#define ASL_NODE_CACHE_SIZE 1024
-#define ASL_STRING_CACHE_SIZE 32768
+#define ASL_PARSEOP_CACHE_SIZE (1024 * 16)
+#define ASL_STRING_CACHE_SIZE (1024 * 64)
#define ASL_FIRST_PARSE_OPCODE PARSEOP_ACCESSAS
#define ASL_PARSE_OPCODE_BASE PARSEOP_ACCESSAS /* First Lex type */
diff --git a/src/acpica/source/compiler/aslerror.c b/src/acpica/source/compiler/aslerror.c
index c2de70a..dc8578c 100644
--- a/src/acpica/source/compiler/aslerror.c
+++ b/src/acpica/source/compiler/aslerror.c
@@ -629,7 +629,7 @@ AslCommonError2 (
{
/* Allocate a buffer for the message and a new error node */
- MessageBuffer = UtLocalCalloc (strlen (ExtraMessage) + 1);
+ MessageBuffer = UtStringCacheCalloc (strlen (ExtraMessage) + 1);
/* Keep a copy of the extra message */
@@ -643,7 +643,7 @@ AslCommonError2 (
if (Filename)
{
- Enode->Filename = Filename;
+ Enode->Filename = Filename;
Enode->FilenameLength = strlen (Filename);
if (Enode->FilenameLength < 6)
{
@@ -715,7 +715,7 @@ AslCommonError (
{
/* Allocate a buffer for the message and a new error node */
- MessageBuffer = UtLocalCalloc (strlen (ExtraMessage) + 1);
+ MessageBuffer = UtStringCacheCalloc (strlen (ExtraMessage) + 1);
/* Keep a copy of the extra message */
@@ -726,7 +726,7 @@ AslCommonError (
if (Filename)
{
- Enode->Filename = Filename;
+ Enode->Filename = Filename;
Enode->FilenameLength = strlen (Filename);
if (Enode->FilenameLength < 6)
{
diff --git a/src/acpica/source/compiler/aslfileio.c b/src/acpica/source/compiler/aslfileio.c
index ee84a12..a8c24cc 100644
--- a/src/acpica/source/compiler/aslfileio.c
+++ b/src/acpica/source/compiler/aslfileio.c
@@ -391,6 +391,8 @@ FlCloseFile (
AslAbort ();
}
+ /* Do not clear/free the filename string */
+
Gbl_Files[FileId].Handle = NULL;
return;
}
diff --git a/src/acpica/source/compiler/aslfiles.c b/src/acpica/source/compiler/aslfiles.c
index 8a62567..4557861 100644
--- a/src/acpica/source/compiler/aslfiles.c
+++ b/src/acpica/source/compiler/aslfiles.c
@@ -179,6 +179,8 @@ FlSetFilename (
DbgPrint (ASL_PARSE_OUTPUT, "\n#line: New filename %s (old %s)\n",
Filename, Gbl_Files[ASL_FILE_INPUT].Filename);
+ /* No need to free any existing filename */
+
Gbl_Files[ASL_FILE_INPUT].Filename = Filename;
}
@@ -288,14 +290,14 @@ FlMergePathnames (
(*FilePathname == '/') ||
(FilePathname[1] == ':'))
{
- Pathname = ACPI_ALLOCATE (strlen (FilePathname) + 1);
+ Pathname = UtStringCacheCalloc (strlen (FilePathname) + 1);
strcpy (Pathname, FilePathname);
goto ConvertBackslashes;
}
/* Need a local copy of the prefix directory path */
- CommonPath = ACPI_ALLOCATE (strlen (PrefixDir) + 1);
+ CommonPath = UtStringCacheCalloc (strlen (PrefixDir) + 1);
strcpy (CommonPath, PrefixDir);
/*
@@ -331,14 +333,13 @@ FlMergePathnames (
/* Build the final merged pathname */
ConcatenatePaths:
- Pathname = ACPI_ALLOCATE_ZEROED (strlen (CommonPath) + strlen (FilePathname) + 2);
+ Pathname = UtStringCacheCalloc (strlen (CommonPath) + strlen (FilePathname) + 2);
if (LastElement && *CommonPath)
{
strcpy (Pathname, CommonPath);
strcat (Pathname, "/");
}
strcat (Pathname, FilePathname);
- ACPI_FREE (CommonPath);
/* Convert all backslashes to normal slashes */
diff --git a/src/acpica/source/compiler/aslfold.c b/src/acpica/source/compiler/aslfold.c
index c4cf421..51c355a 100644
--- a/src/acpica/source/compiler/aslfold.c
+++ b/src/acpica/source/compiler/aslfold.c
@@ -113,7 +113,6 @@
*
*****************************************************************************/
-
#include "aslcompiler.h"
#include "aslcompiler.y.h"
#include "amlcode.h"
diff --git a/src/acpica/source/compiler/aslglobal.h b/src/acpica/source/compiler/aslglobal.h
index 53a500e..7ca898f 100644
--- a/src/acpica/source/compiler/aslglobal.h
+++ b/src/acpica/source/compiler/aslglobal.h
@@ -113,7 +113,6 @@
*
*****************************************************************************/
-
#ifndef __ASLGLOBAL_H
#define __ASLGLOBAL_H
@@ -168,12 +167,20 @@ extern ASL_FILE_INFO Gbl_Files [ASL_NUM_FILES];
*/
extern int yydebug;
extern FILE *AslCompilerin;
-extern int AslCompilerdebug;
extern int DtParserdebug;
extern int PrParserdebug;
extern const ASL_MAPPING_ENTRY AslKeywordMapping[];
extern char *AslCompilertext;
+/*
+ * Older versions of Bison won't emit this external in the generated header.
+ * Newer versions do emit the external, so we don't need to do it.
+ */
+#ifndef ASLCOMPILER_ASLCOMPILERPARSE_H
+extern int AslCompilerdebug;
+#endif
+
+
#define ASL_DEFAULT_LINE_BUFFER_SIZE (1024 * 32) /* 32K */
#define ASL_MSG_BUFFER_SIZE 4096
#define ASL_MAX_DISABLED_MESSAGES 32
@@ -273,6 +280,20 @@ ASL_EXTERN UINT32 ASL_INIT_GLOBAL (TotalAllocated, 0);
ASL_EXTERN UINT32 ASL_INIT_GLOBAL (TotalFolds, 0);
+/* Local caches */
+
+ASL_EXTERN UINT32 ASL_INIT_GLOBAL (Gbl_ParseOpCount, 0);
+ASL_EXTERN ASL_CACHE_INFO ASL_INIT_GLOBAL (*Gbl_ParseOpCacheList, NULL);
+ASL_EXTERN ACPI_PARSE_OBJECT ASL_INIT_GLOBAL (*Gbl_ParseOpCacheNext, NULL);
+ASL_EXTERN ACPI_PARSE_OBJECT ASL_INIT_GLOBAL (*Gbl_ParseOpCacheLast, NULL);
+
+ASL_EXTERN UINT32 ASL_INIT_GLOBAL (Gbl_StringCount, 0);
+ASL_EXTERN UINT32 ASL_INIT_GLOBAL (Gbl_StringSize, 0);
+ASL_EXTERN ASL_CACHE_INFO ASL_INIT_GLOBAL (*Gbl_StringCacheList, NULL);
+ASL_EXTERN char ASL_INIT_GLOBAL (*Gbl_StringCacheNext, NULL);
+ASL_EXTERN char ASL_INIT_GLOBAL (*Gbl_StringCacheLast, NULL);
+
+
/* Misc */
ASL_EXTERN UINT8 ASL_INIT_GLOBAL (Gbl_RevisionOverride, 0);
@@ -281,10 +302,6 @@ ASL_EXTERN ACPI_PARSE_OBJECT ASL_INIT_GLOBAL (*RootNode, NULL);
ASL_EXTERN UINT32 ASL_INIT_GLOBAL (Gbl_TableLength, 0);
ASL_EXTERN UINT32 ASL_INIT_GLOBAL (Gbl_SourceLine, 0);
ASL_EXTERN ASL_LISTING_NODE ASL_INIT_GLOBAL (*Gbl_ListingNode, NULL);
-ASL_EXTERN ACPI_PARSE_OBJECT ASL_INIT_GLOBAL (*Gbl_NodeCacheNext, NULL);
-ASL_EXTERN ACPI_PARSE_OBJECT ASL_INIT_GLOBAL (*Gbl_NodeCacheLast, NULL);
-ASL_EXTERN char ASL_INIT_GLOBAL (*Gbl_StringCacheNext, NULL);
-ASL_EXTERN char ASL_INIT_GLOBAL (*Gbl_StringCacheLast, NULL);
ASL_EXTERN ACPI_PARSE_OBJECT *Gbl_FirstLevelInsertionNode;
ASL_EXTERN UINT8 ASL_INIT_GLOBAL (Gbl_FileType, 0);
ASL_EXTERN char ASL_INIT_GLOBAL (*Gbl_Signature, NULL);
diff --git a/src/acpica/source/compiler/aslhex.c b/src/acpica/source/compiler/aslhex.c
index 6110f1f..1d8056b 100644
--- a/src/acpica/source/compiler/aslhex.c
+++ b/src/acpica/source/compiler/aslhex.c
@@ -113,7 +113,6 @@
*
*****************************************************************************/
-
#include "aslcompiler.h"
#define _COMPONENT ACPI_COMPILER
diff --git a/src/acpica/source/compiler/asllength.c b/src/acpica/source/compiler/asllength.c
index b49467d..0c19896 100644
--- a/src/acpica/source/compiler/asllength.c
+++ b/src/acpica/source/compiler/asllength.c
@@ -113,7 +113,6 @@
*
*****************************************************************************/
-
#include "aslcompiler.h"
#include "aslcompiler.y.h"
#include "amlcode.h"
diff --git a/src/acpica/source/compiler/aslload.c b/src/acpica/source/compiler/aslload.c
index 3baea4e..7b042ec 100644
--- a/src/acpica/source/compiler/aslload.c
+++ b/src/acpica/source/compiler/aslload.c
@@ -201,6 +201,7 @@ LdLoadNamespace (
/* Dump the namespace if debug is enabled */
AcpiNsDumpTables (ACPI_NS_ALL, ACPI_UINT32_MAX);
+ ACPI_FREE (WalkState);
return (AE_OK);
}
diff --git a/src/acpica/source/compiler/asllookup.c b/src/acpica/source/compiler/asllookup.c
index 507158e..435dec9 100644
--- a/src/acpica/source/compiler/asllookup.c
+++ b/src/acpica/source/compiler/asllookup.c
@@ -113,7 +113,6 @@
*
*****************************************************************************/
-
#include "aslcompiler.h"
#include "aslcompiler.y.h"
#include "acparser.h"
diff --git a/src/acpica/source/compiler/aslmain.c b/src/acpica/source/compiler/aslmain.c
index 10f64bd..15e2f36 100644
--- a/src/acpica/source/compiler/aslmain.c
+++ b/src/acpica/source/compiler/aslmain.c
@@ -399,6 +399,7 @@ main (
ACPI_STATUS Status;
int Index1;
int Index2;
+ int ReturnStatus = 0;
/*
@@ -464,16 +465,24 @@ main (
Status = AslDoOneFile (argv[Index2]);
if (ACPI_FAILURE (Status))
{
- return (-1);
+ ReturnStatus = -1;
+ goto CleanupAndExit;
}
Index2++;
}
+
+CleanupAndExit:
+
+ UtFreeLineBuffers ();
+
+ AslParserCleanup ();
+
if (AcpiGbl_ExternalFileList)
{
AcpiDmClearExternalFileList();
}
- return (0);
+ return (ReturnStatus);
}
diff --git a/src/acpica/source/compiler/aslmessages.c b/src/acpica/source/compiler/aslmessages.c
index 11b5d57..879e3ab 100644
--- a/src/acpica/source/compiler/aslmessages.c
+++ b/src/acpica/source/compiler/aslmessages.c
@@ -305,7 +305,9 @@ const char *AslCompilerMsgs [] =
/* ASL_MSG_WRITE */ "Could not write file",
/* ASL_MSG_RANGE */ "Constant out of range",
/* ASL_MSG_BUFFER_ALLOCATION */ "Could not allocate line buffer",
-/* ASL_MSG_MISSING_DEPENDENCY */ "Missing dependency"
+/* ASL_MSG_MISSING_DEPENDENCY */ "Missing dependency",
+/* ASL_MSG_ILLEGAL_FORWARD_REF */ "Illegal forward reference within a method",
+/* ASL_MSG_ILLEGAL_METHOD_REF */ "Illegal reference across two methods"
};
/* Table compiler */
diff --git a/src/acpica/source/compiler/aslmessages.h b/src/acpica/source/compiler/aslmessages.h
index 5743075..bf99a72 100644
--- a/src/acpica/source/compiler/aslmessages.h
+++ b/src/acpica/source/compiler/aslmessages.h
@@ -308,6 +308,8 @@ typedef enum
ASL_MSG_RANGE,
ASL_MSG_BUFFER_ALLOCATION,
ASL_MSG_MISSING_DEPENDENCY,
+ ASL_MSG_ILLEGAL_FORWARD_REF,
+ ASL_MSG_ILLEGAL_METHOD_REF,
/* These messages are used by the Data Table compiler only */
diff --git a/src/acpica/source/compiler/aslmethod.c b/src/acpica/source/compiler/aslmethod.c
index 58c1cc8..5dc30d7 100644
--- a/src/acpica/source/compiler/aslmethod.c
+++ b/src/acpica/source/compiler/aslmethod.c
@@ -113,7 +113,6 @@
*
*****************************************************************************/
-
#include "aslcompiler.h"
#include "aslcompiler.y.h"
#include "acparser.h"
@@ -180,14 +179,38 @@ MtMethodAnalysisWalkBegin (
WalkInfo->MethodStack = MethodInfo;
- /* Special handling for _DSD, must have a _HID also */
+ /*
+ * Special handling for _PSx methods. Dependency rules (same scope):
+ *
+ * 1) _PS0 - One of these must exist: _PS1, _PS2, _PS3
+ * 2) _PS1/_PS2/_PS3: A _PS0 must exist
+ */
+ if (ACPI_COMPARE_NAME (METHOD_NAME__PS0, Op->Asl.NameSeg))
+ {
+ /* For _PS0, one of _PS1/_PS2/_PS3 must exist */
- if (!ACPI_STRCMP (METHOD_NAME__DSD, Op->Asl.NameSeg))
+ if ((!ApFindNameInScope (METHOD_NAME__PS1, Op)) &&
+ (!ApFindNameInScope (METHOD_NAME__PS2, Op)) &&
+ (!ApFindNameInScope (METHOD_NAME__PS3, Op)))
+ {
+ AslError (ASL_WARNING, ASL_MSG_MISSING_DEPENDENCY, Op,
+ "_PS0 requires one of _PS1/_PS2/_PS3 in same scope");
+ }
+ }
+ else if (
+ ACPI_COMPARE_NAME (METHOD_NAME__PS1, Op->Asl.NameSeg) ||
+ ACPI_COMPARE_NAME (METHOD_NAME__PS2, Op->Asl.NameSeg) ||
+ ACPI_COMPARE_NAME (METHOD_NAME__PS3, Op->Asl.NameSeg))
{
- if (!ApFindNameInScope (METHOD_NAME__HID, Op))
+ /* For _PS1/_PS2/_PS3, a _PS0 must exist */
+
+ if (!ApFindNameInScope (METHOD_NAME__PS0, Op))
{
+ sprintf (MsgBuffer,
+ "%4.4s requires _PS0 in same scope", Op->Asl.NameSeg);
+
AslError (ASL_WARNING, ASL_MSG_MISSING_DEPENDENCY, Op,
- "_DSD requires _HID in same scope");
+ MsgBuffer);
}
}
@@ -442,6 +465,17 @@ MtMethodAnalysisWalkBegin (
break;
case PARSEOP_DEVICE:
+
+ Next = Op->Asl.Child;
+
+ if (!ApFindNameInScope (METHOD_NAME__HID, Next) &&
+ !ApFindNameInScope (METHOD_NAME__ADR, Next))
+ {
+ AslError (ASL_WARNING, ASL_MSG_MISSING_DEPENDENCY, Op,
+ "Device object requires a _HID or _ADR in same scope");
+ }
+ break;
+
case PARSEOP_EVENT:
case PARSEOP_MUTEX:
case PARSEOP_OPERATIONREGION:
@@ -496,15 +530,6 @@ MtMethodAnalysisWalkBegin (
}
}
- else if (!ACPI_STRCMP (METHOD_NAME__DSD, Op->Asl.NameSeg))
- {
- if (!ApFindNameInScope (METHOD_NAME__HID, Op))
- {
- AslError (ASL_WARNING, ASL_MSG_MISSING_DEPENDENCY, Op,
- "_DSD requires _HID in same scope");
- }
- }
-
break;
default:
diff --git a/src/acpica/source/compiler/aslnamesp.c b/src/acpica/source/compiler/aslnamesp.c
index 9c96c00..0321dc1 100644
--- a/src/acpica/source/compiler/aslnamesp.c
+++ b/src/acpica/source/compiler/aslnamesp.c
@@ -113,7 +113,6 @@
*
*****************************************************************************/
-
#include "aslcompiler.h"
#include "aslcompiler.y.h"
#include "acnamesp.h"
diff --git a/src/acpica/source/compiler/aslopcodes.c b/src/acpica/source/compiler/aslopcodes.c
index bd8ea0e..0f8d41e 100644
--- a/src/acpica/source/compiler/aslopcodes.c
+++ b/src/acpica/source/compiler/aslopcodes.c
@@ -113,7 +113,6 @@
*
*****************************************************************************/
-
#include "aslcompiler.h"
#include "aslcompiler.y.h"
#include "amlcode.h"
diff --git a/src/acpica/source/compiler/asloperands.c b/src/acpica/source/compiler/asloperands.c
index a142eea..5533971 100644
--- a/src/acpica/source/compiler/asloperands.c
+++ b/src/acpica/source/compiler/asloperands.c
@@ -113,7 +113,6 @@
*
*****************************************************************************/
-
#include "aslcompiler.h"
#include "aslcompiler.y.h"
#include "amlcode.h"
@@ -985,8 +984,8 @@ OpnDoDefinitionBlock (
* We will use the AML filename that is embedded in the source file
* for the output filename.
*/
- Filename = ACPI_ALLOCATE (strlen (Gbl_DirectoryPath) +
- strlen ((char *) Child->Asl.Value.Buffer) + 1);
+ Filename = UtStringCacheCalloc (strlen (Gbl_DirectoryPath) +
+ strlen ((char *) Child->Asl.Value.Buffer) + 1);
/* Prepend the current directory path */
@@ -1041,7 +1040,7 @@ OpnDoDefinitionBlock (
if (Child->Asl.Value.String)
{
Length = ACPI_STRLEN (Child->Asl.Value.String);
- Gbl_TableId = AcpiOsAllocate (Length + 1);
+ Gbl_TableId = UtStringCacheCalloc (Length + 1);
ACPI_STRCPY (Gbl_TableId, Child->Asl.Value.String);
/*
diff --git a/src/acpica/source/compiler/aslopt.c b/src/acpica/source/compiler/aslopt.c
index fa2badb..3cdaeb0 100644
--- a/src/acpica/source/compiler/aslopt.c
+++ b/src/acpica/source/compiler/aslopt.c
@@ -113,7 +113,6 @@
*
*****************************************************************************/
-
#include "aslcompiler.h"
#include "aslcompiler.y.h"
@@ -240,7 +239,7 @@ OptSearchToRoot (
/* We must allocate a new string for the name (TargetPath gets deleted) */
- *NewPath = ACPI_ALLOCATE_ZEROED (ACPI_NAME_SIZE + 1);
+ *NewPath = UtStringCacheCalloc (ACPI_NAME_SIZE + 1);
ACPI_STRCPY (*NewPath, Path);
if (ACPI_STRNCMP (*NewPath, "_T_", 3))
diff --git a/src/acpica/source/compiler/aslresource.c b/src/acpica/source/compiler/aslresource.c
index 427a871..37d76a1 100644
--- a/src/acpica/source/compiler/aslresource.c
+++ b/src/acpica/source/compiler/aslresource.c
@@ -113,7 +113,6 @@
*
*****************************************************************************/
-
#include "aslcompiler.h"
#include "aslcompiler.y.h"
#include "amlcode.h"
@@ -195,22 +194,10 @@ RsSmallAddressCheck (
return;
}
- /* Special case for Memory24, values are compressed */
-
- if (Type == ACPI_RESOURCE_NAME_MEMORY24)
- {
- if (!Alignment) /* Alignment==0 means 64K - no invalid alignment */
- {
- Alignment = ACPI_UINT16_MAX + 1;
- }
-
- Minimum <<= 8;
- Maximum <<= 8;
- Length *= 256;
- }
-
- /* IO descriptor has different definition of min/max, don't check */
-
+ /*
+ * Range checks for Memory24 and Memory32.
+ * IO descriptor has different definition of min/max, don't check.
+ */
if (Type != ACPI_RESOURCE_NAME_IO)
{
/* Basic checks on Min/Max/Length */
@@ -223,6 +210,19 @@ RsSmallAddressCheck (
{
AslError (ASL_ERROR, ASL_MSG_INVALID_LENGTH, LengthOp, NULL);
}
+
+ /* Special case for Memory24, min/max values are compressed */
+
+ if (Type == ACPI_RESOURCE_NAME_MEMORY24)
+ {
+ if (!Alignment) /* Alignment==0 means 64K alignment */
+ {
+ Alignment = ACPI_UINT16_MAX + 1;
+ }
+
+ Minimum <<= 8;
+ Maximum <<= 8;
+ }
}
/* Alignment of zero is not in ACPI spec, but is used to mean byte acc */
diff --git a/src/acpica/source/compiler/aslrestype1.c b/src/acpica/source/compiler/aslrestype1.c
index 47bc1af..8b79447 100644
--- a/src/acpica/source/compiler/aslrestype1.c
+++ b/src/acpica/source/compiler/aslrestype1.c
@@ -113,7 +113,6 @@
*
*****************************************************************************/
-
#include "aslcompiler.h"
#include "aslcompiler.y.h"
diff --git a/src/acpica/source/compiler/aslrestype1i.c b/src/acpica/source/compiler/aslrestype1i.c
index cda8aee..f778f5d 100644
--- a/src/acpica/source/compiler/aslrestype1i.c
+++ b/src/acpica/source/compiler/aslrestype1i.c
@@ -113,7 +113,6 @@
*
*****************************************************************************/
-
#include "aslcompiler.h"
#include "aslcompiler.y.h"
diff --git a/src/acpica/source/compiler/aslrestype2.c b/src/acpica/source/compiler/aslrestype2.c
index a739753..f6dced2 100644
--- a/src/acpica/source/compiler/aslrestype2.c
+++ b/src/acpica/source/compiler/aslrestype2.c
@@ -113,7 +113,6 @@
*
*****************************************************************************/
-
#include "aslcompiler.h"
#include "aslcompiler.y.h"
#include "amlcode.h"
diff --git a/src/acpica/source/compiler/aslrestype2d.c b/src/acpica/source/compiler/aslrestype2d.c
index c618505..32e9826 100644
--- a/src/acpica/source/compiler/aslrestype2d.c
+++ b/src/acpica/source/compiler/aslrestype2d.c
@@ -113,7 +113,6 @@
*
*****************************************************************************/
-
#include "aslcompiler.h"
#include "aslcompiler.y.h"
diff --git a/src/acpica/source/compiler/aslrestype2e.c b/src/acpica/source/compiler/aslrestype2e.c
index 9e24f70..a47085d 100644
--- a/src/acpica/source/compiler/aslrestype2e.c
+++ b/src/acpica/source/compiler/aslrestype2e.c
@@ -113,7 +113,6 @@
*
*****************************************************************************/
-
#include "aslcompiler.h"
#define _COMPONENT ACPI_COMPILER
diff --git a/src/acpica/source/compiler/aslrestype2q.c b/src/acpica/source/compiler/aslrestype2q.c
index ea07d52..99af42d 100644
--- a/src/acpica/source/compiler/aslrestype2q.c
+++ b/src/acpica/source/compiler/aslrestype2q.c
@@ -113,7 +113,6 @@
*
*****************************************************************************/
-
#include "aslcompiler.h"
#include "aslcompiler.y.h"
diff --git a/src/acpica/source/compiler/aslrestype2s.c b/src/acpica/source/compiler/aslrestype2s.c
index ccfb5f5..cc08c47 100644
--- a/src/acpica/source/compiler/aslrestype2s.c
+++ b/src/acpica/source/compiler/aslrestype2s.c
@@ -113,7 +113,6 @@
*
*****************************************************************************/
-
#include "aslcompiler.h"
#include "aslcompiler.y.h"
#include "amlcode.h"
diff --git a/src/acpica/source/compiler/aslrestype2w.c b/src/acpica/source/compiler/aslrestype2w.c
index ea040c6..08a0d0f 100644
--- a/src/acpica/source/compiler/aslrestype2w.c
+++ b/src/acpica/source/compiler/aslrestype2w.c
@@ -113,7 +113,6 @@
*
*****************************************************************************/
-
#include "aslcompiler.h"
#include "aslcompiler.y.h"
diff --git a/src/acpica/source/compiler/aslstartup.c b/src/acpica/source/compiler/aslstartup.c
index fb38e7c..46839ff 100644
--- a/src/acpica/source/compiler/aslstartup.c
+++ b/src/acpica/source/compiler/aslstartup.c
@@ -113,7 +113,6 @@
*
*****************************************************************************/
-
#include "aslcompiler.h"
#include "actables.h"
#include "acdisasm.h"
@@ -356,8 +355,11 @@ AslDoDisassembly (
return (AE_CTRL_CONTINUE);
}
- ACPI_FREE (Gbl_Files[ASL_FILE_INPUT].Filename);
+ /* No need to free the filename string */
+
Gbl_Files[ASL_FILE_INPUT].Filename = NULL;
+
+ CmDeleteCaches ();
return (AE_OK);
}
@@ -397,8 +399,13 @@ AslDoOneFile (
return (Status);
}
- Gbl_Files[ASL_FILE_INPUT].Filename = Filename;
- UtConvertBackslashes (Filename);
+ /* Take a copy of the input filename, convert any backslashes */
+
+ Gbl_Files[ASL_FILE_INPUT].Filename =
+ UtStringCacheCalloc (strlen (Filename) + 1);
+
+ strcpy (Gbl_Files[ASL_FILE_INPUT].Filename, Filename);
+ UtConvertBackslashes (Gbl_Files[ASL_FILE_INPUT].Filename);
/*
* AML Disassembly (Optional)
@@ -468,7 +475,6 @@ AslDoOneFile (
if (Gbl_Signature)
{
- ACPI_FREE (Gbl_Signature);
Gbl_Signature = NULL;
}
diff --git a/src/acpica/source/compiler/aslsupport.l b/src/acpica/source/compiler/aslsupport.l
index 550dace..2fc591c 100644
--- a/src/acpica/source/compiler/aslsupport.l
+++ b/src/acpica/source/compiler/aslsupport.l
@@ -114,7 +114,6 @@
*
*****************************************************************************/
-
/* Configuration */
#define ASL_SPACES_PER_TAB 4
@@ -142,6 +141,15 @@ typedef struct asl_file_node
ASL_FILE_NODE *Gbl_IncludeFileStack = NULL;
+void
+AslParserCleanup (
+ void)
+{
+
+ yy_delete_buffer (YY_CURRENT_BUFFER);
+}
+
+
/*******************************************************************************
*
* FUNCTION: AslDoLineDirective
@@ -331,7 +339,11 @@ AslPushInputFileStack (
/* Reset the global line count and filename */
- Gbl_Files[ASL_FILE_INPUT].Filename = Filename;
+ Gbl_Files[ASL_FILE_INPUT].Filename =
+ UtStringCacheCalloc (strlen (Filename) + 1);
+
+ strcpy (Gbl_Files[ASL_FILE_INPUT].Filename, Filename);
+
Gbl_CurrentLineNumber = 1;
yyin = InputFile;
}
@@ -869,7 +881,7 @@ CompletedString:
*/
*StringBuffer = 0;
- CleanString = UtGetStringBuffer (strlen (MsgBuffer) + 1);
+ CleanString = UtStringCacheCalloc (strlen (MsgBuffer) + 1);
if (!CleanString)
{
AslCommonError (ASL_ERROR, ASL_MSG_MEMORY_ALLOCATION,
diff --git a/src/acpica/source/compiler/asltransform.c b/src/acpica/source/compiler/asltransform.c
index de34e6e..5ce8624 100644
--- a/src/acpica/source/compiler/asltransform.c
+++ b/src/acpica/source/compiler/asltransform.c
@@ -113,7 +113,6 @@
*
*****************************************************************************/
-
#include "aslcompiler.h"
#include "aslcompiler.y.h"
@@ -449,7 +448,6 @@ TrDoDefinitionBlock (
*
* RETURN: None
*
- *
* DESCRIPTION: Translate ASL SWITCH statement to if/else pairs. There is
* no actual AML opcode for SWITCH -- it must be simulated.
*
diff --git a/src/acpica/source/compiler/asltree.c b/src/acpica/source/compiler/asltree.c
index dabe198..6b3d444 100644
--- a/src/acpica/source/compiler/asltree.c
+++ b/src/acpica/source/compiler/asltree.c
@@ -113,7 +113,6 @@
*
*****************************************************************************/
-
#include "aslcompiler.h"
#include "aslcompiler.y.h"
#include "acapps.h"
@@ -151,15 +150,29 @@ static ACPI_PARSE_OBJECT *
TrGetNextNode (
void)
{
+ ASL_CACHE_INFO *Cache;
+
- if (Gbl_NodeCacheNext >= Gbl_NodeCacheLast)
+ if (Gbl_ParseOpCacheNext >= Gbl_ParseOpCacheLast)
{
- Gbl_NodeCacheNext = UtLocalCalloc (sizeof (ACPI_PARSE_OBJECT) *
- ASL_NODE_CACHE_SIZE);
- Gbl_NodeCacheLast = Gbl_NodeCacheNext + ASL_NODE_CACHE_SIZE;
+ /* Allocate a new buffer */
+
+ Cache = UtLocalCalloc (sizeof (Cache->Next) +
+ (sizeof (ACPI_PARSE_OBJECT) * ASL_PARSEOP_CACHE_SIZE));
+
+ /* Link new cache buffer to head of list */
+
+ Cache->Next = Gbl_ParseOpCacheList;
+ Gbl_ParseOpCacheList = Cache;
+
+ /* Setup cache management pointers */
+
+ Gbl_ParseOpCacheNext = ACPI_CAST_PTR (ACPI_PARSE_OBJECT, Cache->Buffer);
+ Gbl_ParseOpCacheLast = Gbl_ParseOpCacheNext + ASL_PARSEOP_CACHE_SIZE;
}
- return (Gbl_NodeCacheNext++);
+ Gbl_ParseOpCount++;
+ return (Gbl_ParseOpCacheNext++);
}
diff --git a/src/acpica/source/compiler/asltypes.h b/src/acpica/source/compiler/asltypes.h
index 7e06d0b..130c648 100644
--- a/src/acpica/source/compiler/asltypes.h
+++ b/src/acpica/source/compiler/asltypes.h
@@ -113,7 +113,6 @@
*
*****************************************************************************/
-
#ifndef __ASLTYPES_H
#define __ASLTYPES_H
@@ -247,6 +246,16 @@ typedef enum
#define ASL_NUM_FILES (ASL_MAX_FILE_TYPE + 1)
+/* Cache block structure for ParseOps and Strings */
+
+typedef struct asl_cache_info
+{
+ void *Next;
+ char Buffer[1];
+
+} ASL_CACHE_INFO;
+
+
typedef struct asl_include_dir
{
char *Dir;
diff --git a/src/acpica/source/compiler/aslutils.c b/src/acpica/source/compiler/aslutils.c
index 5a02470..a2ddd05 100644
--- a/src/acpica/source/compiler/aslutils.c
+++ b/src/acpica/source/compiler/aslutils.c
@@ -113,7 +113,6 @@
*
*****************************************************************************/
-
#include "aslcompiler.h"
#include "aslcompiler.y.h"
#include "acdisasm.h"
@@ -626,7 +625,7 @@ UtCheckIntegerRange (
/*******************************************************************************
*
- * FUNCTION: UtGetStringBuffer
+ * FUNCTION: UtStringCacheCalloc
*
* PARAMETERS: Length - Size of buffer requested
*
@@ -639,22 +638,42 @@ UtCheckIntegerRange (
******************************************************************************/
char *
-UtGetStringBuffer (
+UtStringCacheCalloc (
UINT32 Length)
{
char *Buffer;
+ ASL_CACHE_INFO *Cache;
+
+ if (Length > ASL_STRING_CACHE_SIZE)
+ {
+ Buffer = UtLocalCalloc (Length);
+ return (Buffer);
+ }
if ((Gbl_StringCacheNext + Length) >= Gbl_StringCacheLast)
{
- Gbl_StringCacheNext = UtLocalCalloc (ASL_STRING_CACHE_SIZE + Length);
- Gbl_StringCacheLast = Gbl_StringCacheNext + ASL_STRING_CACHE_SIZE +
- Length;
+ /* Allocate a new buffer */
+
+ Cache = UtLocalCalloc (sizeof (Cache->Next) +
+ ASL_STRING_CACHE_SIZE);
+
+ /* Link new cache buffer to head of list */
+
+ Cache->Next = Gbl_StringCacheList;
+ Gbl_StringCacheList = Cache;
+
+ /* Setup cache management pointers */
+
+ Gbl_StringCacheNext = Cache->Buffer;
+ Gbl_StringCacheLast = Gbl_StringCacheNext + ASL_STRING_CACHE_SIZE;
}
+ Gbl_StringCount++;
+ Gbl_StringSize += Length;
+
Buffer = Gbl_StringCacheNext;
Gbl_StringCacheNext += Length;
-
return (Buffer);
}
@@ -687,7 +706,8 @@ UtExpandLineBuffers (
NewSize = Gbl_LineBufferSize * 2;
if (Gbl_CurrentLineBuffer)
{
- DbgPrint (ASL_DEBUG_OUTPUT,"Increasing line buffer size from %u to %u\n",
+ DbgPrint (ASL_DEBUG_OUTPUT,
+ "Increasing line buffer size from %u to %u\n",
Gbl_LineBufferSize, NewSize);
}
@@ -732,6 +752,30 @@ ErrorExit:
}
+/******************************************************************************
+ *
+ * FUNCTION: UtFreeLineBuffers
+ *
+ * PARAMETERS: None
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Free all line buffers
+ *
+ *****************************************************************************/
+
+void
+UtFreeLineBuffers (
+ void)
+{
+
+ free (Gbl_CurrentLineBuffer);
+ free (Gbl_MainTokenBuffer);
+ free (Gbl_MacroTokenBuffer);
+ free (Gbl_ExpressionTokenBuffer);
+}
+
+
/*******************************************************************************
*
* FUNCTION: UtInternalizeName
@@ -764,9 +808,9 @@ UtInternalizeName (
Info.ExternalName = ExternalName;
AcpiNsGetInternalNameLength (&Info);
- /* We need a segment to store the internal name */
+ /* We need a segment to store the internal name */
- Info.InternalName = UtGetStringBuffer (Info.Length);
+ Info.InternalName = UtStringCacheCalloc (Info.Length);
if (!Info.InternalName)
{
return (AE_NO_MEMORY);
diff --git a/src/acpica/source/compiler/aslwalks.c b/src/acpica/source/compiler/aslwalks.c
index 545d809..835769b 100644
--- a/src/acpica/source/compiler/aslwalks.c
+++ b/src/acpica/source/compiler/aslwalks.c
@@ -113,7 +113,6 @@
*
*****************************************************************************/
-
#include "aslcompiler.h"
#include "aslcompiler.y.h"
#include "acparser.h"
diff --git a/src/acpica/source/compiler/aslxref.c b/src/acpica/source/compiler/aslxref.c
index 39978bb..bb0b394 100644
--- a/src/acpica/source/compiler/aslxref.c
+++ b/src/acpica/source/compiler/aslxref.c
@@ -113,7 +113,6 @@
*
*****************************************************************************/
-
#include "aslcompiler.h"
#include "aslcompiler.y.h"
#include "acparser.h"
@@ -158,6 +157,20 @@ XfCheckFieldRange (
UINT32 FieldBitLength,
UINT32 AccessBitWidth);
+static BOOLEAN
+XfIsObjectParental (
+ ACPI_PARSE_OBJECT *MethodOp1,
+ ACPI_PARSE_OBJECT *MethodOp2);
+
+static ACPI_PARSE_OBJECT *
+XfGetParentMethod (
+ ACPI_PARSE_OBJECT *Op);
+
+static void
+XfCheckIllegalReference (
+ ACPI_PARSE_OBJECT *Op,
+ ACPI_NAMESPACE_NODE *Node);
+
/*******************************************************************************
*
@@ -202,6 +215,8 @@ XfCrossReferenceNamespace (
TrWalkParseTree (RootNode, ASL_WALK_VISIT_TWICE, XfNamespaceLocateBegin,
XfNamespaceLocateEnd, WalkState);
+
+ ACPI_FREE (WalkState);
return (AE_OK);
}
@@ -334,6 +349,178 @@ XfCheckFieldRange (
}
}
+
+/*******************************************************************************
+ *
+ * FUNCTION: XfIsObjectParental
+ *
+ * PARAMETERS: ChildOp - Op to be checked
+ * PossibleParentOp - Determine if this op is in the family
+ *
+ * RETURN: TRUE if ChildOp is a descendent of PossibleParentOp
+ *
+ * DESCRIPTION: Determine if an Op is a descendent of another Op. Used to
+ * detect if a method is declared within another method.
+ *
+ ******************************************************************************/
+
+static BOOLEAN
+XfIsObjectParental (
+ ACPI_PARSE_OBJECT *ChildOp,
+ ACPI_PARSE_OBJECT *PossibleParentOp)
+{
+ ACPI_PARSE_OBJECT *ParentOp;
+
+
+ /* Search upwards through the tree for possible parent */
+
+ ParentOp = ChildOp;
+ while (ParentOp)
+ {
+ if (ParentOp == PossibleParentOp)
+ {
+ return (TRUE);
+ }
+
+ ParentOp = ParentOp->Asl.Parent;
+ }
+
+ return (FALSE);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: XfGetParentMethod
+ *
+ * PARAMETERS: Op - Op to be checked
+ *
+ * RETURN: Op for parent method. NULL if object is not within a method.
+ *
+ * DESCRIPTION: Determine if an object is within a control method. Used to
+ * implement special rules for named references from within a
+ * control method.
+ *
+ * NOTE: It would be better to have the parser set a flag in the Op if possible.
+ *
+ ******************************************************************************/
+
+static ACPI_PARSE_OBJECT *
+XfGetParentMethod (
+ ACPI_PARSE_OBJECT *Op)
+{
+ ACPI_PARSE_OBJECT *ParentOp;
+
+
+ if (!Op)
+ {
+ return (NULL);
+ }
+
+ if (Op->Asl.ParseOpcode == PARSEOP_METHOD)
+ {
+ return (NULL);
+ }
+
+ /* Walk upwards through the parse tree, up to the root if necessary */
+
+ ParentOp = Op;
+ while (ParentOp)
+ {
+ if (ParentOp->Asl.ParseOpcode == PARSEOP_METHOD)
+ {
+ return (ParentOp);
+ }
+
+ ParentOp = ParentOp->Asl.Parent;
+ }
+
+ /* Object is not within a method */
+
+ return (NULL);
+}
+
+/*******************************************************************************
+ *
+ * FUNCTION: XfCheckIllegalReference
+ *
+ * PARAMETERS: Op - Op referring to the target
+ * TargetNode - Target of the reference
+ *
+ * RETURN: None. Emits error message for an illegal reference
+ *
+ * DESCRIPTION: Determine if a named reference is legal. A "named" reference
+ * is something like: Store(ABCD, ...), where ABCD is an AML
+ * Nameseg or Namepath.
+ *
+ * NOTE: Caller must ensure that the name Op is in fact a reference, and not
+ * an actual name declaration (creation of a named object).
+ *
+ ******************************************************************************/
+
+static void
+XfCheckIllegalReference (
+ ACPI_PARSE_OBJECT *Op,
+ ACPI_NAMESPACE_NODE *TargetNode)
+{
+ ACPI_PARSE_OBJECT *MethodOp1;
+ ACPI_PARSE_OBJECT *MethodOp2;
+ ACPI_PARSE_OBJECT *TargetOp;
+
+
+ /*
+ * Check for an illegal reference to a named object:
+ *
+ * 1) References from one control method to another, non-parent
+ * method are not allowed, they will fail at runtime.
+ *
+ * 2) Forward references within a control method are not allowed.
+ * AML interpreters use a one-pass parse of control methods
+ * so these forward references will fail at runtime.
+ */
+ TargetOp = TargetNode->Op;
+
+ MethodOp1 = XfGetParentMethod (Op);
+ MethodOp2 = XfGetParentMethod (TargetOp);
+
+ /* Are both objects within control method(s)? */
+
+ if (!MethodOp1 || !MethodOp2)
+ {
+ return;
+ }
+
+ /* Objects not in the same method? */
+
+ if (MethodOp1 != MethodOp2)
+ {
+ /*
+ * 1) Cross-method named reference
+ *
+ * This is OK if and only if the target reference is within in a
+ * method that is a parent of current method
+ */
+ if (!XfIsObjectParental (MethodOp1, MethodOp2))
+ {
+ AslError (ASL_ERROR, ASL_MSG_ILLEGAL_METHOD_REF, Op,
+ Op->Asl.ExternalName);
+ }
+ }
+
+ /*
+ * 2) Both reference and target are in the same method. Check if this is
+ * an (illegal) forward reference by examining the exact source code
+ * location of each (the referenced object and the object declaration).
+ * This is a bit nasty, yet effective.
+ */
+ else if (Op->Asl.LogicalByteOffset < TargetOp->Asl.LogicalByteOffset)
+ {
+ AslError (ASL_ERROR, ASL_MSG_ILLEGAL_FORWARD_REF, Op,
+ Op->Asl.ExternalName);
+ }
+}
+
+
/*******************************************************************************
*
* FUNCTION: XfNamespaceLocateBegin
@@ -543,6 +730,10 @@ XfNamespaceLocateBegin (
/* This node has been referenced, mark it for reference check */
Node->Flags |= ANOBJ_IS_REFERENCED;
+
+ /* Check for an illegal reference */
+
+ XfCheckIllegalReference (Op, Node);
}
/* Attempt to optimize the NamePath */
diff --git a/src/acpica/source/compiler/dtcompile.c b/src/acpica/source/compiler/dtcompile.c
index 1c7580f..c33564a 100644
--- a/src/acpica/source/compiler/dtcompile.c
+++ b/src/acpica/source/compiler/dtcompile.c
@@ -213,8 +213,6 @@ DtDoCompile (
Status = DtCompileDataTable (&FieldList);
UtEndEvent (Event);
- DtFreeFieldList ();
-
if (ACPI_FAILURE (Status))
{
/* TBD: temporary error message. Msgs should come from function above */
@@ -242,6 +240,8 @@ DtDoCompile (
CleanupAndExit:
+ AcpiUtDeleteCaches ();
+ DtDeleteCaches ();
CmCleanupAndExit ();
return (Status);
}
@@ -370,7 +370,7 @@ DtCompileDataTable (
return (AE_ERROR);
}
- Gbl_Signature = UtLocalCalloc (ACPI_STRLEN (Signature) + 1);
+ Gbl_Signature = UtStringCacheCalloc (ACPI_STRLEN (Signature) + 1);
strcpy (Gbl_Signature, Signature);
/*
@@ -533,11 +533,11 @@ DtCompileTable (
return (AE_ERROR);
}
- Subtable = UtLocalCalloc (sizeof (DT_SUBTABLE));
+ Subtable = UtSubtableCacheCalloc ();
if (Length > 0)
{
- Subtable->Buffer = UtLocalCalloc (Length);
+ Subtable->Buffer = ACPI_CAST_PTR (UINT8, UtStringCacheCalloc (Length));
}
Subtable->Length = Length;
Subtable->TotalLength = Length;
@@ -639,8 +639,6 @@ DtCompileTable (
DtSetSubtableLength (InlineSubtable);
ACPI_MEMCPY (Buffer, InlineSubtable->Buffer, FieldLength);
- ACPI_FREE (InlineSubtable->Buffer);
- ACPI_FREE (InlineSubtable);
LocalField = *Field;
break;
diff --git a/src/acpica/source/compiler/dtcompiler.h b/src/acpica/source/compiler/dtcompiler.h
index 1fb1f12..2eda236 100644
--- a/src/acpica/source/compiler/dtcompiler.h
+++ b/src/acpica/source/compiler/dtcompiler.h
@@ -122,6 +122,10 @@
#include "acdisasm.h"
+#define ASL_FIELD_CACHE_SIZE 512
+#define ASL_SUBTABLE_CACHE_SIZE 128
+
+
#undef DT_EXTERN
#ifdef _DECLARE_DT_GLOBALS
@@ -215,6 +219,18 @@ DT_EXTERN DT_FIELD DT_INIT_GLOBAL (*Gbl_LabelList, NULL);
DT_EXTERN UINT32 DT_INIT_GLOBAL (Gbl_CurrentTableOffset, 0);
+/* Local caches */
+
+DT_EXTERN UINT32 DT_INIT_GLOBAL (Gbl_SubtableCount, 0);
+DT_EXTERN ASL_CACHE_INFO DT_INIT_GLOBAL (*Gbl_SubtableCacheList, NULL);
+DT_EXTERN DT_SUBTABLE DT_INIT_GLOBAL (*Gbl_SubtableCacheNext, NULL);
+DT_EXTERN DT_SUBTABLE DT_INIT_GLOBAL (*Gbl_SubtableCacheLast, NULL);
+
+DT_EXTERN UINT32 DT_INIT_GLOBAL (Gbl_FieldCount, 0);
+DT_EXTERN ASL_CACHE_INFO DT_INIT_GLOBAL (*Gbl_FieldCacheList, NULL);
+DT_EXTERN DT_FIELD DT_INIT_GLOBAL (*Gbl_FieldCacheNext, NULL);
+DT_EXTERN DT_FIELD DT_INIT_GLOBAL (*Gbl_FieldCacheLast, NULL);
+
/* dtcompiler - main module */
@@ -440,8 +456,16 @@ void
DtSetTableLength(
void);
+DT_SUBTABLE *
+UtSubtableCacheCalloc (
+ void);
+
+DT_FIELD *
+UtFieldCacheCalloc (
+ void);
+
void
-DtFreeFieldList (
+DtDeleteCaches (
void);
diff --git a/src/acpica/source/compiler/dtio.c b/src/acpica/source/compiler/dtio.c
index 1465cc0..7c93afe 100644
--- a/src/acpica/source/compiler/dtio.c
+++ b/src/acpica/source/compiler/dtio.c
@@ -205,7 +205,7 @@ DtTrim (
if (!ACPI_STRCMP (String, " "))
{
- ReturnString = UtLocalCalloc (1);
+ ReturnString = UtStringCacheCalloc (1);
return (ReturnString);
}
@@ -253,7 +253,7 @@ DtTrim (
/* Create the trimmed return string */
Length = ACPI_PTR_DIFF (End, Start) + 1;
- ReturnString = UtLocalCalloc (Length + 1);
+ ReturnString = UtStringCacheCalloc (Length + 1);
if (ACPI_STRLEN (Start))
{
ACPI_STRNCPY (ReturnString, Start, Length);
@@ -442,7 +442,7 @@ DtParseLine (
if ((Value && *Value) || IsNullString)
{
- Field = UtLocalCalloc (sizeof (DT_FIELD));
+ Field = UtFieldCacheCalloc ();
Field->Name = Name;
Field->Value = Value;
Field->Line = Line;
@@ -452,11 +452,7 @@ DtParseLine (
DtLinkField (Field);
}
- else /* Ignore this field, it has no valid data */
- {
- ACPI_FREE (Name);
- ACPI_FREE (Value);
- }
+ /* Else -- Ignore this field, it has no valid data */
return (AE_OK);
}
@@ -1107,6 +1103,8 @@ DtDumpSubtableList (
DbgPrint (ASL_DEBUG_OUTPUT,
"\nSubtable Tree: (Depth, Subtable, Length, TotalLength)\n\n");
DtWalkTableTree (Gbl_RootTable, DtDumpSubtableTree, NULL, NULL);
+
+ DbgPrint (ASL_DEBUG_OUTPUT, "\n");
}
diff --git a/src/acpica/source/compiler/dtsubtable.c b/src/acpica/source/compiler/dtsubtable.c
index 3892fdc..e9f530b 100644
--- a/src/acpica/source/compiler/dtsubtable.c
+++ b/src/acpica/source/compiler/dtsubtable.c
@@ -147,11 +147,11 @@ DtCreateSubtable (
DT_SUBTABLE *Subtable;
- Subtable = UtLocalCalloc (sizeof (DT_SUBTABLE));
+ Subtable = UtSubtableCacheCalloc ();
/* Create a new buffer for the subtable data */
- Subtable->Buffer = UtLocalCalloc (Length);
+ Subtable->Buffer = ACPI_CAST_PTR (UINT8, UtStringCacheCalloc (Length));
ACPI_MEMCPY (Subtable->Buffer, Buffer, Length);
Subtable->Length = Length;
diff --git a/src/acpica/source/compiler/dttable.c b/src/acpica/source/compiler/dttable.c
index db95850..2b86c0e 100644
--- a/src/acpica/source/compiler/dttable.c
+++ b/src/acpica/source/compiler/dttable.c
@@ -2492,6 +2492,11 @@ DtCompileSrat (
InfoTable = AcpiDmTableInfoSrat2;
break;
+ case ACPI_SRAT_TYPE_GICC_AFFINITY:
+
+ InfoTable = AcpiDmTableInfoSrat3;
+ break;
+
default:
DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "SRAT");
diff --git a/src/acpica/source/compiler/dttemplate.c b/src/acpica/source/compiler/dttemplate.c
index e3c3c0c..f677f83 100644
--- a/src/acpica/source/compiler/dttemplate.c
+++ b/src/acpica/source/compiler/dttemplate.c
@@ -259,6 +259,12 @@ GetTemplate:
}
Status = DtCreateOneTemplate (Signature, TableData);
+
+
+ /* Shutdown ACPICA subsystem */
+
+ (void) AcpiTerminate ();
+ CmDeleteCaches ();
return (Status);
}
@@ -469,6 +475,5 @@ DtCreateOneTemplate (
Cleanup:
fclose (File);
AcpiOsRedirectOutput (stdout);
- ACPI_FREE (DisasmFilename);
return (Status);
}
diff --git a/src/acpica/source/compiler/dttemplate.h b/src/acpica/source/compiler/dttemplate.h
index eefae69..1dfd5cb 100644
--- a/src/acpica/source/compiler/dttemplate.h
+++ b/src/acpica/source/compiler/dttemplate.h
@@ -1033,11 +1033,11 @@ const unsigned char TemplateSpmi[] =
const unsigned char TemplateSrat[] =
{
- 0x53,0x52,0x41,0x54,0x80,0x00,0x00,0x00, /* 00000000 "SRAT...." */
- 0x03,0x5A,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 ".ZINTEL " */
- 0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */
+ 0x53,0x52,0x41,0x54,0x92,0x00,0x00,0x00, /* 00000000 "SRAT...." */
+ 0x03,0x50,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 ".PINTEL " */
+ 0x54,0x65,0x6D,0x70,0x6C,0x61,0x74,0x65, /* 00000010 "Template" */
0x01,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */
- 0x28,0x05,0x10,0x20,0x01,0x00,0x00,0x00, /* 00000020 "(.. ...." */
+ 0x24,0x07,0x14,0x20,0x01,0x00,0x00,0x00, /* 00000020 "$.. ...." */
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000028 "........" */
0x00,0x10,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000030 "........" */
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000038 "........" */
@@ -1048,7 +1048,10 @@ const unsigned char TemplateSrat[] =
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000060 "........" */
0x02,0x18,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000068 "........" */
0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000070 "........" */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 /* 00000078 "........" */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000078 "........" */
+ 0x03,0x12,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000080 "........" */
+ 0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00, /* 00000088 "........" */
+ 0x00,0x00 /* 00000090 ".." */
};
const unsigned char TemplateTcpa[] =
diff --git a/src/acpica/source/compiler/dtutils.c b/src/acpica/source/compiler/dtutils.c
index 51d50c7..2eac7fa 100644
--- a/src/acpica/source/compiler/dtutils.c
+++ b/src/acpica/source/compiler/dtutils.c
@@ -917,39 +917,151 @@ DtWalkTableTree (
}
-/******************************************************************************
+/*******************************************************************************
+ *
+ * FUNCTION: UtSubtableCacheCalloc
+ *
+ * PARAMETERS: None
+ *
+ * RETURN: Pointer to the buffer. Aborts on allocation failure
+ *
+ * DESCRIPTION: Allocate a subtable object buffer. Bypass the local
+ * dynamic memory manager for performance reasons (This has a
+ * major impact on the speed of the compiler.)
+ *
+ ******************************************************************************/
+
+DT_SUBTABLE *
+UtSubtableCacheCalloc (
+ void)
+{
+ ASL_CACHE_INFO *Cache;
+
+
+ if (Gbl_SubtableCacheNext >= Gbl_SubtableCacheLast)
+ {
+ /* Allocate a new buffer */
+
+ Cache = UtLocalCalloc (sizeof (Cache->Next) +
+ (sizeof (DT_SUBTABLE) * ASL_SUBTABLE_CACHE_SIZE));
+
+ /* Link new cache buffer to head of list */
+
+ Cache->Next = Gbl_SubtableCacheList;
+ Gbl_SubtableCacheList = Cache;
+
+ /* Setup cache management pointers */
+
+ Gbl_SubtableCacheNext = ACPI_CAST_PTR (DT_SUBTABLE, Cache->Buffer);
+ Gbl_SubtableCacheLast = Gbl_SubtableCacheNext + ASL_SUBTABLE_CACHE_SIZE;
+ }
+
+ Gbl_SubtableCount++;
+ return (Gbl_SubtableCacheNext++);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: UtFieldCacheCalloc
+ *
+ * PARAMETERS: None
+ *
+ * RETURN: Pointer to the buffer. Aborts on allocation failure
*
- * FUNCTION: DtFreeFieldList
+ * DESCRIPTION: Allocate a field object buffer. Bypass the local
+ * dynamic memory manager for performance reasons (This has a
+ * major impact on the speed of the compiler.)
+ *
+ ******************************************************************************/
+
+DT_FIELD *
+UtFieldCacheCalloc (
+ void)
+{
+ ASL_CACHE_INFO *Cache;
+
+
+ if (Gbl_FieldCacheNext >= Gbl_FieldCacheLast)
+ {
+ /* Allocate a new buffer */
+
+ Cache = UtLocalCalloc (sizeof (Cache->Next) +
+ (sizeof (DT_FIELD) * ASL_FIELD_CACHE_SIZE));
+
+ /* Link new cache buffer to head of list */
+
+ Cache->Next = Gbl_FieldCacheList;
+ Gbl_FieldCacheList = Cache;
+
+ /* Setup cache management pointers */
+
+ Gbl_FieldCacheNext = ACPI_CAST_PTR (DT_FIELD, Cache->Buffer);
+ Gbl_FieldCacheLast = Gbl_FieldCacheNext + ASL_FIELD_CACHE_SIZE;
+ }
+
+ Gbl_FieldCount++;
+ return (Gbl_FieldCacheNext++);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: DtDeleteCaches
*
* PARAMETERS: None
*
* RETURN: None
*
- * DESCRIPTION: Free the field list
+ * DESCRIPTION: Delete all local cache buffer blocks
*
- *****************************************************************************/
+ ******************************************************************************/
void
-DtFreeFieldList (
+DtDeleteCaches (
void)
{
- DT_FIELD *Field = Gbl_FieldList;
- DT_FIELD *NextField;
+ UINT32 BufferCount;
+ ASL_CACHE_INFO *Next;
- /* Walk and free entire field list */
+ /* Field cache */
- while (Field)
+ BufferCount = 0;
+ while (Gbl_FieldCacheList)
{
- NextField = Field->Next; /* Save link */
+ Next = Gbl_FieldCacheList->Next;
+ ACPI_FREE (Gbl_FieldCacheList);
+ Gbl_FieldCacheList = Next;
+ BufferCount++;
+ }
- if (!(Field->Flags & DT_FIELD_NOT_ALLOCATED))
- {
- ACPI_FREE (Field->Name);
- ACPI_FREE (Field->Value);
- }
+ DbgPrint (ASL_DEBUG_OUTPUT,
+ "%u Fields, Buffer size: %u fields (%u bytes), %u Buffers\n",
+ Gbl_FieldCount, ASL_FIELD_CACHE_SIZE,
+ (sizeof (DT_FIELD) * ASL_FIELD_CACHE_SIZE), BufferCount);
+
+ Gbl_FieldCount = 0;
+ Gbl_FieldCacheNext = NULL;
+ Gbl_FieldCacheLast = NULL;
+
+ /* Subtable cache */
- ACPI_FREE (Field);
- Field = NextField;
+ BufferCount = 0;
+ while (Gbl_SubtableCacheList)
+ {
+ Next = Gbl_SubtableCacheList->Next;
+ ACPI_FREE (Gbl_SubtableCacheList);
+ Gbl_SubtableCacheList = Next;
+ BufferCount++;
}
+
+ DbgPrint (ASL_DEBUG_OUTPUT,
+ "%u Subtables, Buffer size: %u subtables (%u bytes), %u Buffers\n",
+ Gbl_SubtableCount, ASL_SUBTABLE_CACHE_SIZE,
+ (sizeof (DT_SUBTABLE) * ASL_SUBTABLE_CACHE_SIZE), BufferCount);
+
+ Gbl_SubtableCount = 0;
+ Gbl_SubtableCacheNext = NULL;
+ Gbl_SubtableCacheLast = NULL;
}
diff --git a/src/acpica/source/compiler/prutils.c b/src/acpica/source/compiler/prutils.c
index 198bbfc..a2b5906 100644
--- a/src/acpica/source/compiler/prutils.c
+++ b/src/acpica/source/compiler/prutils.c
@@ -412,7 +412,6 @@ PrOpenIncludeWithPrefix (
if (!IncludeFile)
{
fprintf (stderr, "Could not open include file %s\n", Pathname);
- ACPI_FREE (Pathname);
return (NULL);
}
@@ -465,15 +464,17 @@ PrPushInputFileStack (
/* Reset the global line count and filename */
- Gbl_Files[ASL_FILE_INPUT].Filename = Filename;
+ Gbl_Files[ASL_FILE_INPUT].Filename =
+ UtStringCacheCalloc (strlen (Filename) + 1);
+ strcpy (Gbl_Files[ASL_FILE_INPUT].Filename, Filename);
+
Gbl_Files[ASL_FILE_INPUT].Handle = InputFile;
Gbl_PreviousLineNumber = 0;
Gbl_CurrentLineNumber = 0;
/* Emit a new #line directive for the include file */
- FlPrintFile (ASL_FILE_PREPROCESSOR, "#line %u \"%s\"\n",
- 1, Filename);
+ FlPrintFile (ASL_FILE_PREPROCESSOR, "#line %u \"%s\"\n", 1, Filename);
}
diff --git a/src/acpica/source/components/debugger/dbcmds.c b/src/acpica/source/components/debugger/dbcmds.c
index 6d70e03..0d39139 100644
--- a/src/acpica/source/components/debugger/dbcmds.c
+++ b/src/acpica/source/components/debugger/dbcmds.c
@@ -113,7 +113,6 @@
*
*****************************************************************************/
-
#include "acpi.h"
#include "accommon.h"
#include "acevents.h"
diff --git a/src/acpica/source/components/debugger/dbconvert.c b/src/acpica/source/components/debugger/dbconvert.c
index 172f36a..cb882a3 100644
--- a/src/acpica/source/components/debugger/dbconvert.c
+++ b/src/acpica/source/components/debugger/dbconvert.c
@@ -113,7 +113,6 @@
*
*****************************************************************************/
-
#include "acpi.h"
#include "accommon.h"
#include "acdebug.h"
diff --git a/src/acpica/source/components/debugger/dbdisply.c b/src/acpica/source/components/debugger/dbdisply.c
index 77c5409..7991f0a 100644
--- a/src/acpica/source/components/debugger/dbdisply.c
+++ b/src/acpica/source/components/debugger/dbdisply.c
@@ -113,7 +113,6 @@
*
*****************************************************************************/
-
#include "acpi.h"
#include "accommon.h"
#include "amlcode.h"
diff --git a/src/acpica/source/components/debugger/dbexec.c b/src/acpica/source/components/debugger/dbexec.c
index a7a791d..253b25a 100644
--- a/src/acpica/source/components/debugger/dbexec.c
+++ b/src/acpica/source/components/debugger/dbexec.c
@@ -113,7 +113,6 @@
*
*****************************************************************************/
-
#include "acpi.h"
#include "accommon.h"
#include "acdebug.h"
diff --git a/src/acpica/source/components/debugger/dbfileio.c b/src/acpica/source/components/debugger/dbfileio.c
index 3581d83..4521ee6 100644
--- a/src/acpica/source/components/debugger/dbfileio.c
+++ b/src/acpica/source/components/debugger/dbfileio.c
@@ -114,7 +114,6 @@
*
*****************************************************************************/
-
#include "acpi.h"
#include "accommon.h"
#include "acdebug.h"
diff --git a/src/acpica/source/components/debugger/dbhistry.c b/src/acpica/source/components/debugger/dbhistry.c
index c74519b..18de938 100644
--- a/src/acpica/source/components/debugger/dbhistry.c
+++ b/src/acpica/source/components/debugger/dbhistry.c
@@ -113,7 +113,6 @@
*
*****************************************************************************/
-
#include "acpi.h"
#include "accommon.h"
#include "acdebug.h"
diff --git a/src/acpica/source/components/debugger/dbinput.c b/src/acpica/source/components/debugger/dbinput.c
index c84bf8a..a85f5ff 100644
--- a/src/acpica/source/components/debugger/dbinput.c
+++ b/src/acpica/source/components/debugger/dbinput.c
@@ -113,7 +113,6 @@
*
*****************************************************************************/
-
#include "acpi.h"
#include "accommon.h"
#include "acdebug.h"
diff --git a/src/acpica/source/components/debugger/dbmethod.c b/src/acpica/source/components/debugger/dbmethod.c
index 39a9fa7..67aa9c8 100644
--- a/src/acpica/source/components/debugger/dbmethod.c
+++ b/src/acpica/source/components/debugger/dbmethod.c
@@ -113,7 +113,6 @@
*
*****************************************************************************/
-
#include "acpi.h"
#include "accommon.h"
#include "acdispat.h"
diff --git a/src/acpica/source/components/debugger/dbnames.c b/src/acpica/source/components/debugger/dbnames.c
index 621ae61..6cbe840 100644
--- a/src/acpica/source/components/debugger/dbnames.c
+++ b/src/acpica/source/components/debugger/dbnames.c
@@ -113,7 +113,6 @@
*
*****************************************************************************/
-
#include "acpi.h"
#include "accommon.h"
#include "acnamesp.h"
diff --git a/src/acpica/source/components/debugger/dbstats.c b/src/acpica/source/components/debugger/dbstats.c
index 9594b3d..70224fa 100644
--- a/src/acpica/source/components/debugger/dbstats.c
+++ b/src/acpica/source/components/debugger/dbstats.c
@@ -113,7 +113,6 @@
*
*****************************************************************************/
-
#include "acpi.h"
#include "accommon.h"
#include "acdebug.h"
diff --git a/src/acpica/source/components/debugger/dbtest.c b/src/acpica/source/components/debugger/dbtest.c
old mode 100755
new mode 100644
diff --git a/src/acpica/source/components/debugger/dbutils.c b/src/acpica/source/components/debugger/dbutils.c
index 9bcc675..fa47bd8 100644
--- a/src/acpica/source/components/debugger/dbutils.c
+++ b/src/acpica/source/components/debugger/dbutils.c
@@ -113,7 +113,6 @@
*
*****************************************************************************/
-
#include "acpi.h"
#include "accommon.h"
#include "acnamesp.h"
diff --git a/src/acpica/source/components/debugger/dbxface.c b/src/acpica/source/components/debugger/dbxface.c
index ed821c4..d4cc9e0 100644
--- a/src/acpica/source/components/debugger/dbxface.c
+++ b/src/acpica/source/components/debugger/dbxface.c
@@ -113,7 +113,6 @@
*
*****************************************************************************/
-
#include "acpi.h"
#include "accommon.h"
#include "amlcode.h"
diff --git a/src/acpica/source/components/disassembler/dmdeferred.c b/src/acpica/source/components/disassembler/dmdeferred.c
index 148de63..c3fb456 100644
--- a/src/acpica/source/components/disassembler/dmdeferred.c
+++ b/src/acpica/source/components/disassembler/dmdeferred.c
@@ -113,7 +113,6 @@
*
*****************************************************************************/
-
#include "acpi.h"
#include "accommon.h"
#include "acdispat.h"
diff --git a/src/acpica/source/components/disassembler/dmnames.c b/src/acpica/source/components/disassembler/dmnames.c
index f88e35e..cb4c63b 100644
--- a/src/acpica/source/components/disassembler/dmnames.c
+++ b/src/acpica/source/components/disassembler/dmnames.c
@@ -113,7 +113,6 @@
*
*****************************************************************************/
-
#include "acpi.h"
#include "accommon.h"
#include "amlcode.h"
diff --git a/src/acpica/source/components/disassembler/dmobject.c b/src/acpica/source/components/disassembler/dmobject.c
index 4194939..0a01264 100644
--- a/src/acpica/source/components/disassembler/dmobject.c
+++ b/src/acpica/source/components/disassembler/dmobject.c
@@ -113,7 +113,6 @@
*
*****************************************************************************/
-
#include "acpi.h"
#include "accommon.h"
#include "acnamesp.h"
diff --git a/src/acpica/source/components/disassembler/dmresrc.c b/src/acpica/source/components/disassembler/dmresrc.c
index 610ead7..8c0198a 100644
--- a/src/acpica/source/components/disassembler/dmresrc.c
+++ b/src/acpica/source/components/disassembler/dmresrc.c
@@ -113,7 +113,6 @@
*
*****************************************************************************/
-
#include "acpi.h"
#include "accommon.h"
#include "amlcode.h"
diff --git a/src/acpica/source/components/disassembler/dmresrcl.c b/src/acpica/source/components/disassembler/dmresrcl.c
index 64c10bf..8db712e 100644
--- a/src/acpica/source/components/disassembler/dmresrcl.c
+++ b/src/acpica/source/components/disassembler/dmresrcl.c
@@ -113,7 +113,6 @@
*
*****************************************************************************/
-
#include "acpi.h"
#include "accommon.h"
#include "acdisasm.h"
diff --git a/src/acpica/source/components/disassembler/dmresrcl2.c b/src/acpica/source/components/disassembler/dmresrcl2.c
index 50e60fd..d4f7fe7 100644
--- a/src/acpica/source/components/disassembler/dmresrcl2.c
+++ b/src/acpica/source/components/disassembler/dmresrcl2.c
@@ -113,7 +113,6 @@
*
*****************************************************************************/
-
#include "acpi.h"
#include "accommon.h"
#include "acdisasm.h"
@@ -346,7 +345,7 @@ AcpiDmGpioIntDescriptor (
AcpiDmIndent (Level);
AcpiOsPrintf ("GpioInt (%s, %s, %s, ",
AcpiGbl_HeDecode [ACPI_GET_1BIT_FLAG (Resource->Gpio.IntFlags)],
- AcpiGbl_LlDecode [ACPI_EXTRACT_1BIT_FLAG (Resource->Gpio.IntFlags, 1)],
+ AcpiGbl_LlDecode [ACPI_EXTRACT_2BIT_FLAG (Resource->Gpio.IntFlags, 1)],
AcpiGbl_ShrDecode [ACPI_EXTRACT_2BIT_FLAG (Resource->Gpio.IntFlags, 3)]);
/* PinConfig, DebounceTimeout */
diff --git a/src/acpica/source/components/disassembler/dmresrcs.c b/src/acpica/source/components/disassembler/dmresrcs.c
index e29b9ee..6ec784f 100644
--- a/src/acpica/source/components/disassembler/dmresrcs.c
+++ b/src/acpica/source/components/disassembler/dmresrcs.c
@@ -113,7 +113,6 @@
*
*****************************************************************************/
-
#include "acpi.h"
#include "accommon.h"
#include "acdisasm.h"
diff --git a/src/acpica/source/components/disassembler/dmutils.c b/src/acpica/source/components/disassembler/dmutils.c
index 26141ea..8464665 100644
--- a/src/acpica/source/components/disassembler/dmutils.c
+++ b/src/acpica/source/components/disassembler/dmutils.c
@@ -113,7 +113,6 @@
*
*****************************************************************************/
-
#include "acpi.h"
#include "accommon.h"
#include "amlcode.h"
diff --git a/src/acpica/source/components/disassembler/dmwalk.c b/src/acpica/source/components/disassembler/dmwalk.c
index 1f63e08..8ebdde8 100644
--- a/src/acpica/source/components/disassembler/dmwalk.c
+++ b/src/acpica/source/components/disassembler/dmwalk.c
@@ -113,7 +113,6 @@
*
*****************************************************************************/
-
#include "acpi.h"
#include "accommon.h"
#include "acparser.h"
diff --git a/src/acpica/source/components/dispatcher/dswstate.c b/src/acpica/source/components/dispatcher/dswstate.c
index e76d4ce..9c2f2ec 100644
--- a/src/acpica/source/components/dispatcher/dswstate.c
+++ b/src/acpica/source/components/dispatcher/dswstate.c
@@ -113,7 +113,6 @@
*
*****************************************************************************/
-
#define __DSWSTATE_C__
#include "acpi.h"
diff --git a/src/acpica/source/components/events/evgpeinit.c b/src/acpica/source/components/events/evgpeinit.c
index 2e2e6b3..f512a38 100644
--- a/src/acpica/source/components/events/evgpeinit.c
+++ b/src/acpica/source/components/events/evgpeinit.c
@@ -113,7 +113,6 @@
*
*****************************************************************************/
-
#include "acpi.h"
#include "accommon.h"
#include "acevents.h"
diff --git a/src/acpica/source/components/events/evhandler.c b/src/acpica/source/components/events/evhandler.c
index d17411e..7df392b 100644
--- a/src/acpica/source/components/events/evhandler.c
+++ b/src/acpica/source/components/events/evhandler.c
@@ -113,7 +113,6 @@
*
*****************************************************************************/
-
#define __EVHANDLER_C__
#include "acpi.h"
diff --git a/src/acpica/source/components/events/evregion.c b/src/acpica/source/components/events/evregion.c
index 8f1b24b..886f7ae 100644
--- a/src/acpica/source/components/events/evregion.c
+++ b/src/acpica/source/components/events/evregion.c
@@ -113,7 +113,6 @@
*
*****************************************************************************/
-
#define __EVREGION_C__
#include "acpi.h"
diff --git a/src/acpica/source/components/events/evrgnini.c b/src/acpica/source/components/events/evrgnini.c
index ac321c7..b35ddbc 100644
--- a/src/acpica/source/components/events/evrgnini.c
+++ b/src/acpica/source/components/events/evrgnini.c
@@ -113,7 +113,6 @@
*
*****************************************************************************/
-
#define __EVRGNINI_C__
#include "acpi.h"
diff --git a/src/acpica/source/components/events/evxface.c b/src/acpica/source/components/events/evxface.c
index 85355a5..6fdc72e 100644
--- a/src/acpica/source/components/events/evxface.c
+++ b/src/acpica/source/components/events/evxface.c
@@ -113,7 +113,6 @@
*
*****************************************************************************/
-
#define __EVXFACE_C__
#define EXPORT_ACPI_INTERFACES
diff --git a/src/acpica/source/components/events/evxfevnt.c b/src/acpica/source/components/events/evxfevnt.c
index c099bdb..bf6bed8 100644
--- a/src/acpica/source/components/events/evxfevnt.c
+++ b/src/acpica/source/components/events/evxfevnt.c
@@ -113,7 +113,6 @@
*
*****************************************************************************/
-
#define __EVXFEVNT_C__
#define EXPORT_ACPI_INTERFACES
diff --git a/src/acpica/source/components/events/evxfgpe.c b/src/acpica/source/components/events/evxfgpe.c
index b116322..98a797d 100644
--- a/src/acpica/source/components/events/evxfgpe.c
+++ b/src/acpica/source/components/events/evxfgpe.c
@@ -113,7 +113,6 @@
*
*****************************************************************************/
-
#define __EVXFGPE_C__
#define EXPORT_ACPI_INTERFACES
diff --git a/src/acpica/source/components/executer/exconvrt.c b/src/acpica/source/components/executer/exconvrt.c
index 2b2fffd..f674893 100644
--- a/src/acpica/source/components/executer/exconvrt.c
+++ b/src/acpica/source/components/executer/exconvrt.c
@@ -113,7 +113,6 @@
*
*****************************************************************************/
-
#define __EXCONVRT_C__
#include "acpi.h"
diff --git a/src/acpica/source/components/executer/exdebug.c b/src/acpica/source/components/executer/exdebug.c
index b7d47fd..45fca31 100644
--- a/src/acpica/source/components/executer/exdebug.c
+++ b/src/acpica/source/components/executer/exdebug.c
@@ -173,7 +173,7 @@ AcpiExDoDebugObject (
* debug output. Only need the lower 26 bits. This allows for 67
* million microseconds or 67 seconds before rollover.
*/
- Timer = (UINT32) (AcpiOsGetTimer () / 10); /* (100 nanoseconds to microseconds) */
+ Timer = ((UINT32) AcpiOsGetTimer () / 10); /* (100 nanoseconds to microseconds) */
Timer &= 0x03FFFFFF;
/*
diff --git a/src/acpica/source/components/executer/exfield.c b/src/acpica/source/components/executer/exfield.c
index 55934de..1263ed7 100644
--- a/src/acpica/source/components/executer/exfield.c
+++ b/src/acpica/source/components/executer/exfield.c
@@ -113,7 +113,6 @@
*
*****************************************************************************/
-
#define __EXFIELD_C__
#include "acpi.h"
diff --git a/src/acpica/source/components/executer/exfldio.c b/src/acpica/source/components/executer/exfldio.c
index 51a1e6d..6db8f05 100644
--- a/src/acpica/source/components/executer/exfldio.c
+++ b/src/acpica/source/components/executer/exfldio.c
@@ -113,7 +113,6 @@
*
*****************************************************************************/
-
#define __EXFLDIO_C__
#include "acpi.h"
diff --git a/src/acpica/source/components/executer/exoparg2.c b/src/acpica/source/components/executer/exoparg2.c
index 3a65485..84c44f4 100644
--- a/src/acpica/source/components/executer/exoparg2.c
+++ b/src/acpica/source/components/executer/exoparg2.c
@@ -113,7 +113,6 @@
*
*****************************************************************************/
-
#define __EXOPARG2_C__
#include "acpi.h"
diff --git a/src/acpica/source/components/executer/exregion.c b/src/acpica/source/components/executer/exregion.c
index ea10a01..4056f08 100644
--- a/src/acpica/source/components/executer/exregion.c
+++ b/src/acpica/source/components/executer/exregion.c
@@ -113,7 +113,6 @@
*
*****************************************************************************/
-
#define __EXREGION_C__
#include "acpi.h"
diff --git a/src/acpica/source/components/namespace/nsalloc.c b/src/acpica/source/components/namespace/nsalloc.c
index d1701b8..ae855e9 100644
--- a/src/acpica/source/components/namespace/nsalloc.c
+++ b/src/acpica/source/components/namespace/nsalloc.c
@@ -113,7 +113,6 @@
*
*****************************************************************************/
-
#define __NSALLOC_C__
#include "acpi.h"
diff --git a/src/acpica/source/components/namespace/nsinit.c b/src/acpica/source/components/namespace/nsinit.c
index 2e35355..b5be1f4 100644
--- a/src/acpica/source/components/namespace/nsinit.c
+++ b/src/acpica/source/components/namespace/nsinit.c
@@ -113,7 +113,6 @@
*
*****************************************************************************/
-
#define __NSXFINIT_C__
#include "acpi.h"
diff --git a/src/acpica/source/components/namespace/nsobject.c b/src/acpica/source/components/namespace/nsobject.c
index 74470f0..c9b7b32 100644
--- a/src/acpica/source/components/namespace/nsobject.c
+++ b/src/acpica/source/components/namespace/nsobject.c
@@ -114,7 +114,6 @@
*
*****************************************************************************/
-
#define __NSOBJECT_C__
#include "acpi.h"
diff --git a/src/acpica/source/components/namespace/nsprepkg.c b/src/acpica/source/components/namespace/nsprepkg.c
index 41dc5a7..b44d12b 100644
--- a/src/acpica/source/components/namespace/nsprepkg.c
+++ b/src/acpica/source/components/namespace/nsprepkg.c
@@ -393,6 +393,46 @@ AcpiNsCheckPackage (
Status = AcpiNsCheckPackageList (Info, Package, Elements, Count);
break;
+ case ACPI_PTYPE2_UUID_PAIR:
+
+ /* The package must contain pairs of (UUID + type) */
+
+ if (Count & 1)
+ {
+ ExpectedCount = Count + 1;
+ goto PackageTooSmall;
+ }
+
+ while (Count > 0)
+ {
+ Status = AcpiNsCheckObjectType(Info, Elements,
+ Package->RetInfo.ObjectType1, 0);
+ if (ACPI_FAILURE(Status))
+ {
+ return (Status);
+ }
+
+ /* Validate length of the UUID buffer */
+
+ if ((*Elements)->Buffer.Length != 16)
+ {
+ ACPI_WARN_PREDEFINED ((AE_INFO, Info->FullPathname,
+ Info->NodeFlags, "Invalid length for UUID Buffer"));
+ return (AE_AML_OPERAND_VALUE);
+ }
+
+ Status = AcpiNsCheckObjectType(Info, Elements + 1,
+ Package->RetInfo.ObjectType2, 0);
+ if (ACPI_FAILURE(Status))
+ {
+ return (Status);
+ }
+
+ Elements += 2;
+ Count -= 2;
+ }
+ break;
+
default:
/* Should not get here if predefined info table is correct */
diff --git a/src/acpica/source/components/namespace/nswalk.c b/src/acpica/source/components/namespace/nswalk.c
index c6c5663..23e5fd1 100644
--- a/src/acpica/source/components/namespace/nswalk.c
+++ b/src/acpica/source/components/namespace/nswalk.c
@@ -113,7 +113,6 @@
*
*****************************************************************************/
-
#define __NSWALK_C__
#include "acpi.h"
diff --git a/src/acpica/source/components/namespace/nsxfeval.c b/src/acpica/source/components/namespace/nsxfeval.c
index 4864e61..259a187 100644
--- a/src/acpica/source/components/namespace/nsxfeval.c
+++ b/src/acpica/source/components/namespace/nsxfeval.c
@@ -114,7 +114,6 @@
*
*****************************************************************************/
-
#define __NSXFEVAL_C__
#define EXPORT_ACPI_INTERFACES
diff --git a/src/acpica/source/components/namespace/nsxfobj.c b/src/acpica/source/components/namespace/nsxfobj.c
index 0f61a71..409f233 100644
--- a/src/acpica/source/components/namespace/nsxfobj.c
+++ b/src/acpica/source/components/namespace/nsxfobj.c
@@ -114,7 +114,6 @@
*
*****************************************************************************/
-
#define __NSXFOBJ_C__
#define EXPORT_ACPI_INTERFACES
diff --git a/src/acpica/source/components/parser/psloop.c b/src/acpica/source/components/parser/psloop.c
index ec7db25..cf52d5f 100644
--- a/src/acpica/source/components/parser/psloop.c
+++ b/src/acpica/source/components/parser/psloop.c
@@ -113,7 +113,6 @@
*
*****************************************************************************/
-
/*
* Parse the AML and build an operation tree as most interpreters, (such as
* Perl) do. Parsing is done by hand rather than with a YACC generated parser
diff --git a/src/acpica/source/components/parser/psobject.c b/src/acpica/source/components/parser/psobject.c
index f4ecc33..705aa6c 100644
--- a/src/acpica/source/components/parser/psobject.c
+++ b/src/acpica/source/components/parser/psobject.c
@@ -113,7 +113,6 @@
*
*****************************************************************************/
-
#include "acpi.h"
#include "accommon.h"
#include "acparser.h"
diff --git a/src/acpica/source/components/parser/psopcode.c b/src/acpica/source/components/parser/psopcode.c
index 0af5e9a..40243a5 100644
--- a/src/acpica/source/components/parser/psopcode.c
+++ b/src/acpica/source/components/parser/psopcode.c
@@ -113,7 +113,6 @@
*
*****************************************************************************/
-
#include "acpi.h"
#include "accommon.h"
#include "acopcode.h"
diff --git a/src/acpica/source/components/parser/psopinfo.c b/src/acpica/source/components/parser/psopinfo.c
index 5118ccd..198d9a3 100644
--- a/src/acpica/source/components/parser/psopinfo.c
+++ b/src/acpica/source/components/parser/psopinfo.c
@@ -113,7 +113,6 @@
*
*****************************************************************************/
-
#include "acpi.h"
#include "accommon.h"
#include "acparser.h"
diff --git a/src/acpica/source/components/parser/psparse.c b/src/acpica/source/components/parser/psparse.c
index b9038f1..afbcc62 100644
--- a/src/acpica/source/components/parser/psparse.c
+++ b/src/acpica/source/components/parser/psparse.c
@@ -113,7 +113,6 @@
*
*****************************************************************************/
-
/*
* Parse the AML and build an operation tree as most interpreters,
* like Perl, do. Parsing is done by hand rather than with a YACC
diff --git a/src/acpica/source/components/parser/psscope.c b/src/acpica/source/components/parser/psscope.c
index 45a5768..3c0fb90 100644
--- a/src/acpica/source/components/parser/psscope.c
+++ b/src/acpica/source/components/parser/psscope.c
@@ -113,7 +113,6 @@
*
*****************************************************************************/
-
#include "acpi.h"
#include "accommon.h"
#include "acparser.h"
diff --git a/src/acpica/source/components/parser/pstree.c b/src/acpica/source/components/parser/pstree.c
index 4a6403d..45c6fc2 100644
--- a/src/acpica/source/components/parser/pstree.c
+++ b/src/acpica/source/components/parser/pstree.c
@@ -113,7 +113,6 @@
*
*****************************************************************************/
-
#define __PSTREE_C__
#include "acpi.h"
diff --git a/src/acpica/source/components/parser/psutils.c b/src/acpica/source/components/parser/psutils.c
index 12d74a9..bce4010 100644
--- a/src/acpica/source/components/parser/psutils.c
+++ b/src/acpica/source/components/parser/psutils.c
@@ -113,7 +113,6 @@
*
*****************************************************************************/
-
#include "acpi.h"
#include "accommon.h"
#include "acparser.h"
diff --git a/src/acpica/source/components/parser/pswalk.c b/src/acpica/source/components/parser/pswalk.c
index 7226e48..1605428 100644
--- a/src/acpica/source/components/parser/pswalk.c
+++ b/src/acpica/source/components/parser/pswalk.c
@@ -113,7 +113,6 @@
*
*****************************************************************************/
-
#include "acpi.h"
#include "accommon.h"
#include "acparser.h"
diff --git a/src/acpica/source/components/resources/rsdump.c b/src/acpica/source/components/resources/rsdump.c
index ae295fa..4fc7d4a 100644
--- a/src/acpica/source/components/resources/rsdump.c
+++ b/src/acpica/source/components/resources/rsdump.c
@@ -113,7 +113,6 @@
*
*****************************************************************************/
-
#define __RSDUMP_C__
#include "acpi.h"
diff --git a/src/acpica/source/components/resources/rsdumpinfo.c b/src/acpica/source/components/resources/rsdumpinfo.c
index 2aef0e5..929043c 100644
--- a/src/acpica/source/components/resources/rsdumpinfo.c
+++ b/src/acpica/source/components/resources/rsdumpinfo.c
@@ -113,7 +113,6 @@
*
*****************************************************************************/
-
#define __RSDUMPINFO_C__
#include "acpi.h"
diff --git a/src/acpica/source/components/resources/rsutils.c b/src/acpica/source/components/resources/rsutils.c
index e9952f0..b05338c 100644
--- a/src/acpica/source/components/resources/rsutils.c
+++ b/src/acpica/source/components/resources/rsutils.c
@@ -113,7 +113,6 @@
*
*****************************************************************************/
-
#define __RSUTILS_C__
#include "acpi.h"
diff --git a/src/acpica/source/components/resources/rsxface.c b/src/acpica/source/components/resources/rsxface.c
index 2ae63b3..8dbb301 100644
--- a/src/acpica/source/components/resources/rsxface.c
+++ b/src/acpica/source/components/resources/rsxface.c
@@ -113,7 +113,6 @@
*
*****************************************************************************/
-
#define __RSXFACE_C__
#define EXPORT_ACPI_INTERFACES
diff --git a/src/acpica/source/components/tables/tbdata.c b/src/acpica/source/components/tables/tbdata.c
old mode 100755
new mode 100644
diff --git a/src/acpica/source/components/utilities/utexcep.c b/src/acpica/source/components/utilities/utexcep.c
index d9f0471..5455f87 100644
--- a/src/acpica/source/components/utilities/utexcep.c
+++ b/src/acpica/source/components/utilities/utexcep.c
@@ -113,7 +113,6 @@
*
*****************************************************************************/
-
#define __UTEXCEP_C__
#define EXPORT_ACPI_INTERFACES
diff --git a/src/acpica/source/components/utilities/utfileio.c b/src/acpica/source/components/utilities/utfileio.c
index 9501e22..956f300 100644
--- a/src/acpica/source/components/utilities/utfileio.c
+++ b/src/acpica/source/components/utilities/utfileio.c
@@ -113,7 +113,6 @@
*
*****************************************************************************/
-
#include "acpi.h"
#include "accommon.h"
#include "actables.h"
diff --git a/src/acpica/source/components/utilities/utinit.c b/src/acpica/source/components/utilities/utinit.c
index 8df0277..af29d7a 100644
--- a/src/acpica/source/components/utilities/utinit.c
+++ b/src/acpica/source/components/utilities/utinit.c
@@ -113,7 +113,6 @@
*
*****************************************************************************/
-
#define __UTINIT_C__
#include "acpi.h"
diff --git a/src/acpica/source/components/utilities/utmath.c b/src/acpica/source/components/utilities/utmath.c
index c781c7e..22f5a21 100644
--- a/src/acpica/source/components/utilities/utmath.c
+++ b/src/acpica/source/components/utilities/utmath.c
@@ -113,7 +113,6 @@
*
*****************************************************************************/
-
#define __UTMATH_C__
#include "acpi.h"
diff --git a/src/acpica/source/components/utilities/utmisc.c b/src/acpica/source/components/utilities/utmisc.c
index 69d8350..68f85f4 100644
--- a/src/acpica/source/components/utilities/utmisc.c
+++ b/src/acpica/source/components/utilities/utmisc.c
@@ -113,7 +113,6 @@
*
*****************************************************************************/
-
#define __UTMISC_C__
#include "acpi.h"
diff --git a/src/acpica/source/components/utilities/utmutex.c b/src/acpica/source/components/utilities/utmutex.c
index 168afa3..fcca4a4 100644
--- a/src/acpica/source/components/utilities/utmutex.c
+++ b/src/acpica/source/components/utilities/utmutex.c
@@ -113,7 +113,6 @@
*
*****************************************************************************/
-
#define __UTMUTEX_C__
#include "acpi.h"
diff --git a/src/acpica/source/components/utilities/utownerid.c b/src/acpica/source/components/utilities/utownerid.c
index ae42970..ba191fa 100644
--- a/src/acpica/source/components/utilities/utownerid.c
+++ b/src/acpica/source/components/utilities/utownerid.c
@@ -113,7 +113,6 @@
*
*****************************************************************************/
-
#define __UTOWNERID_C__
#include "acpi.h"
diff --git a/src/acpica/source/components/utilities/utresrc.c b/src/acpica/source/components/utilities/utresrc.c
index f5af86f..2c31f2a 100644
--- a/src/acpica/source/components/utilities/utresrc.c
+++ b/src/acpica/source/components/utilities/utresrc.c
@@ -113,7 +113,6 @@
*
*****************************************************************************/
-
#define __UTRESRC_C__
#include "acpi.h"
@@ -172,7 +171,9 @@ const char *AcpiGbl_IoDecode[] =
const char *AcpiGbl_LlDecode[] =
{
"ActiveHigh",
- "ActiveLow"
+ "ActiveLow",
+ "ActiveBoth",
+ "Reserved"
};
const char *AcpiGbl_MaxDecode[] =
diff --git a/src/acpica/source/components/utilities/utstate.c b/src/acpica/source/components/utilities/utstate.c
index fc99c56..0d1f2bf 100644
--- a/src/acpica/source/components/utilities/utstate.c
+++ b/src/acpica/source/components/utilities/utstate.c
@@ -113,7 +113,6 @@
*
*****************************************************************************/
-
#define __UTSTATE_C__
#include "acpi.h"
diff --git a/src/acpica/source/components/utilities/utstring.c b/src/acpica/source/components/utilities/utstring.c
index c4ead02..d4e5f45 100644
--- a/src/acpica/source/components/utilities/utstring.c
+++ b/src/acpica/source/components/utilities/utstring.c
@@ -113,7 +113,6 @@
*
*****************************************************************************/
-
#define __UTSTRING_C__
#include "acpi.h"
diff --git a/src/acpica/source/components/utilities/utxface.c b/src/acpica/source/components/utilities/utxface.c
index e915b84..068609b 100644
--- a/src/acpica/source/components/utilities/utxface.c
+++ b/src/acpica/source/components/utilities/utxface.c
@@ -113,7 +113,6 @@
*
*****************************************************************************/
-
#define __UTXFACE_C__
#define EXPORT_ACPI_INTERFACES
diff --git a/src/acpica/source/components/utilities/utxfinit.c b/src/acpica/source/components/utilities/utxfinit.c
index b9b1326..d29028c 100644
--- a/src/acpica/source/components/utilities/utxfinit.c
+++ b/src/acpica/source/components/utilities/utxfinit.c
@@ -113,7 +113,6 @@
*
*****************************************************************************/
-
#define __UTXFINIT_C__
#define EXPORT_ACPI_INTERFACES
diff --git a/src/acpica/source/include/acdisasm.h b/src/acpica/source/include/acdisasm.h
index 21e26e6..f936128 100644
--- a/src/acpica/source/include/acdisasm.h
+++ b/src/acpica/source/include/acdisasm.h
@@ -432,6 +432,7 @@ extern ACPI_DMTABLE_INFO AcpiDmTableInfoSratHdr[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoSrat0[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoSrat1[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoSrat2[];
+extern ACPI_DMTABLE_INFO AcpiDmTableInfoSrat3[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoTcpa[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoTpm2[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoUefi[];
diff --git a/src/acpica/source/include/acdispat.h b/src/acpica/source/include/acdispat.h
index bfccbf1..2a47c52 100644
--- a/src/acpica/source/include/acdispat.h
+++ b/src/acpica/source/include/acdispat.h
@@ -113,7 +113,6 @@
*
*****************************************************************************/
-
#ifndef _ACDISPAT_H_
#define _ACDISPAT_H_
diff --git a/src/acpica/source/include/acnames.h b/src/acpica/source/include/acnames.h
index 6ccf47f..55cbe44 100644
--- a/src/acpica/source/include/acnames.h
+++ b/src/acpica/source/include/acnames.h
@@ -131,6 +131,10 @@
#define METHOD_NAME__PRS "_PRS"
#define METHOD_NAME__PRT "_PRT"
#define METHOD_NAME__PRW "_PRW"
+#define METHOD_NAME__PS0 "_PS0"
+#define METHOD_NAME__PS1 "_PS1"
+#define METHOD_NAME__PS2 "_PS2"
+#define METHOD_NAME__PS3 "_PS3"
#define METHOD_NAME__REG "_REG"
#define METHOD_NAME__SB_ "_SB_"
#define METHOD_NAME__SEG "_SEG"
diff --git a/src/acpica/source/include/acparser.h b/src/acpica/source/include/acparser.h
index 5827a8c..0899969 100644
--- a/src/acpica/source/include/acparser.h
+++ b/src/acpica/source/include/acparser.h
@@ -113,7 +113,6 @@
*
*****************************************************************************/
-
#ifndef __ACPARSER_H__
#define __ACPARSER_H__
diff --git a/src/acpica/source/include/acpixf.h b/src/acpica/source/include/acpixf.h
index cafc37b..b3182c3 100644
--- a/src/acpica/source/include/acpixf.h
+++ b/src/acpica/source/include/acpixf.h
@@ -118,7 +118,7 @@
/* Current ACPICA subsystem version in YYYYMMDD format */
-#define ACPI_CA_VERSION 0x20140724
+#define ACPI_CA_VERSION 0x20140828
#include "acconfig.h"
#include "actypes.h"
diff --git a/src/acpica/source/include/actbl1.h b/src/acpica/source/include/actbl1.h
index d28faa3..4c5ffee 100644
--- a/src/acpica/source/include/actbl1.h
+++ b/src/acpica/source/include/actbl1.h
@@ -1190,7 +1190,8 @@ enum AcpiSratType
ACPI_SRAT_TYPE_CPU_AFFINITY = 0,
ACPI_SRAT_TYPE_MEMORY_AFFINITY = 1,
ACPI_SRAT_TYPE_X2APIC_CPU_AFFINITY = 2,
- ACPI_SRAT_TYPE_RESERVED = 3 /* 3 and greater are reserved */
+ ACPI_SRAT_TYPE_GICC_AFFINITY = 3,
+ ACPI_SRAT_TYPE_RESERVED = 4 /* 4 and greater are reserved */
};
/*
@@ -1207,7 +1208,7 @@ typedef struct acpi_srat_cpu_affinity
UINT32 Flags;
UINT8 LocalSapicEid;
UINT8 ProximityDomainHi[3];
- UINT32 Reserved; /* Reserved, must be zero */
+ UINT32 ClockDomain;
} ACPI_SRAT_CPU_AFFINITY;
@@ -1257,6 +1258,22 @@ typedef struct acpi_srat_x2apic_cpu_affinity
#define ACPI_SRAT_CPU_ENABLED (1) /* 00: Use affinity structure */
+/* 3: GICC Affinity (ACPI 5.1) */
+
+typedef struct acpi_srat_gicc_affinity
+{
+ ACPI_SUBTABLE_HEADER Header;
+ UINT32 ProximityDomain;
+ UINT32 AcpiProcessorUid;
+ UINT32 Flags;
+ UINT32 ClockDomain;
+
+} ACPI_SRAT_GICC_AFFINITY;
+
+/* Flags for ACPI_SRAT_GICC_AFFINITY */
+
+#define ACPI_SRAT_GICC_ENABLED (1) /* 00: Use affinity structure */
+
/* Reset to default packing */
#pragma pack()
diff --git a/src/acpica/source/include/actbl3.h b/src/acpica/source/include/actbl3.h
index b30e80f..4e3b77a 100644
--- a/src/acpica/source/include/actbl3.h
+++ b/src/acpica/source/include/actbl3.h
@@ -432,11 +432,15 @@ typedef struct acpi_gtdt_timer_entry
} ACPI_GTDT_TIMER_ENTRY;
+/* Flag Definitions: TimerFlags and VirtualTimerFlags above */
+
+#define ACPI_GTDT_GT_IRQ_MODE (1)
+#define ACPI_GTDT_GT_IRQ_POLARITY (1<<1)
/* Flag Definitions: CommonFlags above */
-#define ACPI_GTDT_GT_IS_SECURE_TIMER (1)
-#define ACPI_GTDT_GT_ALWAYS_ON (1<<1)
+#define ACPI_GTDT_GT_IS_SECURE_TIMER (1)
+#define ACPI_GTDT_GT_ALWAYS_ON (1<<1)
/* 1: SBSA Generic Watchdog Structure */
diff --git a/src/acpica/source/include/platform/aclinux.h b/src/acpica/source/include/platform/aclinux.h
index d5c1501..e7df0b7 100644
--- a/src/acpica/source/include/platform/aclinux.h
+++ b/src/acpica/source/include/platform/aclinux.h
@@ -116,6 +116,16 @@
#ifndef __ACLINUX_H__
#define __ACLINUX_H__
+#ifdef __KERNEL__
+
+/* ACPICA external files should not include ACPICA headers directly. */
+
+#if !defined(BUILDING_ACPICA) && !defined(_LINUX_ACPI_H)
+#error "Please don't include <acpi/acpi.h> directly, include <linux/acpi.h> instead."
+#endif
+
+#endif
+
/* Common (in-kernel/user-space) ACPICA configuration */
#define ACPI_USE_SYSTEM_CLIBRARY
@@ -143,7 +153,9 @@
#ifdef EXPORT_ACPI_INTERFACES
#include <linux/export.h>
#endif
+#ifdef CONFIG_ACPI
#include <asm/acenv.h>
+#endif
#ifndef CONFIG_ACPI
diff --git a/src/acpica/source/include/platform/aclinuxex.h b/src/acpica/source/include/platform/aclinuxex.h
index e3d5d5b..d4111a1 100644
--- a/src/acpica/source/include/platform/aclinuxex.h
+++ b/src/acpica/source/include/platform/aclinuxex.h
@@ -118,6 +118,28 @@
#ifdef __KERNEL__
+#ifndef ACPI_USE_NATIVE_DIVIDE
+
+#ifndef ACPI_DIV_64_BY_32
+#define ACPI_DIV_64_BY_32(n_hi, n_lo, d32, q32, r32) \
+ do { \
+ UINT64 (__n) = ((UINT64) n_hi) << 32 | (n_lo); \
+ (r32) = do_div ((__n), (d32)); \
+ (q32) = (UINT32) (__n); \
+ } while (0)
+#endif
+
+#ifndef ACPI_SHIFT_RIGHT_64
+#define ACPI_SHIFT_RIGHT_64(n_hi, n_lo) \
+ do { \
+ (n_lo) >>= 1; \
+ (n_lo) |= (((n_hi) & 1) << 31); \
+ (n_hi) >>= 1; \
+ } while (0)
+#endif
+
+#endif
+
/*
* Overrides for in-kernel ACPICA
*/
diff --git a/src/acpica/source/os_specific/service_layers/osunixxf.c b/src/acpica/source/os_specific/service_layers/osunixxf.c
index 6f0bdfe..7f5193d 100644
--- a/src/acpica/source/os_specific/service_layers/osunixxf.c
+++ b/src/acpica/source/os_specific/service_layers/osunixxf.c
@@ -113,7 +113,6 @@
*
*****************************************************************************/
-
/*
* These interfaces are required in order to compile the ASL compiler and the
* various ACPICA tools under Linux or other Unix-like system.
--
2.1.0
More information about the fwts-devel
mailing list