[PATCH] ACPICA: Update to version 20151124 (LP: #1519425)
Colin King
colin.king at canonical.com
Tue Nov 24 17:15:21 UTC 2015
From: Colin Ian King <colin.king at canonical.com>
Changes in this release of ACPICA are detailed at the following
link on the ACPICA developer mailing list:
https://lists.acpica.org/pipermail/devel/2015-November/000856.html
Signed-off-by: Colin Ian King <colin.king at canonical.com>
---
src/acpica/Makefile.am | 2 +
src/acpica/source/common/acfileio.c | 429 +++
src/acpica/source/common/acgetline.c | 1 +
src/acpica/source/common/adisasm.c | 863 ++---
src/acpica/source/common/adwalk.c | 34 +-
src/acpica/source/common/ahuuids.c | 1 +
src/acpica/source/common/dmextern.c | 15 +-
src/acpica/source/common/dmrestag.c | 19 +-
src/acpica/source/common/dmtable.c | 6 +
src/acpica/source/common/dmtables.c | 571 ++++
src/acpica/source/common/dmtbdump.c | 339 +-
src/acpica/source/compiler/Makefile.am | 3 +
src/acpica/source/compiler/aslanalyze.c | 15 +-
src/acpica/source/compiler/aslbtypes.c | 10 +-
src/acpica/source/compiler/aslcodegen.c | 133 +-
src/acpica/source/compiler/aslcompile.c | 31 +-
src/acpica/source/compiler/aslcompiler.l | 2 +-
src/acpica/source/compiler/aslcompiler.y | 21 +-
src/acpica/source/compiler/aslerror.c | 35 +-
src/acpica/source/compiler/aslfileio.c | 5 +-
src/acpica/source/compiler/aslfiles.c | 10 +-
src/acpica/source/compiler/aslfold.c | 134 +-
src/acpica/source/compiler/aslhex.c | 4 +-
src/acpica/source/compiler/asllength.c | 19 +-
src/acpica/source/compiler/asllisting.c | 71 +-
src/acpica/source/compiler/asllistsup.c | 3 +-
src/acpica/source/compiler/aslload.c | 96 +-
src/acpica/source/compiler/aslmap.c | 1 +
src/acpica/source/compiler/aslmapoutput.c | 2 +-
src/acpica/source/compiler/aslmessages.c | 5 +-
src/acpica/source/compiler/aslmessages.h | 2 +
src/acpica/source/compiler/aslmethod.c | 26 +-
src/acpica/source/compiler/aslnamesp.c | 21 +-
src/acpica/source/compiler/aslopcodes.c | 61 +-
src/acpica/source/compiler/asloperands.c | 45 +-
src/acpica/source/compiler/aslopt.c | 45 +-
src/acpica/source/compiler/aslpredef.c | 9 +-
src/acpica/source/compiler/aslprepkg.c | 1 +
src/acpica/source/compiler/aslprune.c | 2 +
src/acpica/source/compiler/aslresource.c | 8 +-
src/acpica/source/compiler/aslrestype1.c | 25 +-
src/acpica/source/compiler/aslrestype1i.c | 20 +-
src/acpica/source/compiler/aslrestype2.c | 14 +-
src/acpica/source/compiler/aslrestype2d.c | 8 +-
src/acpica/source/compiler/aslrestype2e.c | 26 +-
src/acpica/source/compiler/aslrestype2q.c | 14 +-
src/acpica/source/compiler/aslrestype2s.c | 92 +-
src/acpica/source/compiler/aslrestype2w.c | 16 +-
src/acpica/source/compiler/aslrules.y | 13 +-
src/acpica/source/compiler/aslstubs.c | 42 +
src/acpica/source/compiler/asltokens.y | 5 +-
src/acpica/source/compiler/asltransform.c | 36 +-
src/acpica/source/compiler/asltree.c | 33 +-
src/acpica/source/compiler/asltypes.h | 2 +-
src/acpica/source/compiler/asltypes.y | 3 +-
src/acpica/source/compiler/aslutils.c | 4 +-
src/acpica/source/compiler/asluuid.c | 7 +-
src/acpica/source/compiler/aslxref.c | 30 +-
src/acpica/source/compiler/dtcompile.c | 55 +-
src/acpica/source/compiler/dtcompiler.h | 6 +
src/acpica/source/compiler/dtexpress.c | 3 +
src/acpica/source/compiler/dtfield.c | 1 +
src/acpica/source/compiler/dtio.c | 11 +-
src/acpica/source/compiler/dttable.c | 3394 +-------------------
src/acpica/source/compiler/dttable1.c | 1743 ++++++++++
src/acpica/source/compiler/dttable2.c | 1758 ++++++++++
src/acpica/source/compiler/dttemplate.c | 3 +-
src/acpica/source/compiler/prexpress.c | 1 +
src/acpica/source/compiler/prmacros.c | 3 +-
src/acpica/source/compiler/prscan.c | 9 +-
src/acpica/source/compiler/prutils.c | 2 +
src/acpica/source/components/debugger/dbcmds.c | 30 +-
src/acpica/source/components/debugger/dbconvert.c | 2 +-
src/acpica/source/components/debugger/dbdisply.c | 77 +-
src/acpica/source/components/debugger/dbexec.c | 11 +-
src/acpica/source/components/debugger/dbfileio.c | 136 +-
src/acpica/source/components/debugger/dbinput.c | 45 +-
src/acpica/source/components/debugger/dbmethod.c | 2 +-
src/acpica/source/components/debugger/dbnames.c | 9 +-
src/acpica/source/components/debugger/dbobject.c | 6 +-
src/acpica/source/components/debugger/dbstats.c | 3 +-
src/acpica/source/components/debugger/dbtest.c | 5 +-
src/acpica/source/components/debugger/dbutils.c | 1 +
src/acpica/source/components/debugger/dbxface.c | 91 +-
.../source/components/disassembler/dmbuffer.c | 7 +-
.../source/components/disassembler/dmcstyle.c | 1 +
.../source/components/disassembler/dmdeferred.c | 3 +-
.../source/components/disassembler/dmnames.c | 13 +-
.../source/components/disassembler/dmopcode.c | 7 +-
.../source/components/disassembler/dmresrc.c | 7 +-
.../source/components/disassembler/dmresrcl.c | 18 +-
.../source/components/disassembler/dmresrcl2.c | 10 +-
.../source/components/disassembler/dmresrcs.c | 3 +-
src/acpica/source/components/disassembler/dmwalk.c | 14 +-
src/acpica/source/components/dispatcher/dsargs.c | 34 +-
.../source/components/dispatcher/dscontrol.c | 49 +-
src/acpica/source/components/dispatcher/dsdebug.c | 9 +-
src/acpica/source/components/dispatcher/dsfield.c | 83 +-
src/acpica/source/components/dispatcher/dsinit.c | 12 +-
src/acpica/source/components/dispatcher/dsmethod.c | 73 +-
src/acpica/source/components/dispatcher/dsmthdat.c | 39 +-
src/acpica/source/components/dispatcher/dsobject.c | 66 +-
src/acpica/source/components/dispatcher/dsopcode.c | 46 +-
src/acpica/source/components/dispatcher/dsutils.c | 45 +-
src/acpica/source/components/dispatcher/dswexec.c | 51 +-
src/acpica/source/components/dispatcher/dswload.c | 32 +-
src/acpica/source/components/dispatcher/dswload2.c | 40 +-
src/acpica/source/components/dispatcher/dswscope.c | 1 +
src/acpica/source/components/dispatcher/dswstate.c | 9 +-
src/acpica/source/components/events/evevent.c | 14 +-
src/acpica/source/components/events/evglock.c | 11 +-
src/acpica/source/components/events/evgpe.c | 16 +-
src/acpica/source/components/events/evgpeblk.c | 15 +-
src/acpica/source/components/events/evgpeinit.c | 28 +-
src/acpica/source/components/events/evgpeutil.c | 7 +-
src/acpica/source/components/events/evhandler.c | 12 +-
src/acpica/source/components/events/evmisc.c | 5 +-
src/acpica/source/components/events/evregion.c | 8 +-
src/acpica/source/components/events/evrgnini.c | 16 +-
src/acpica/source/components/events/evsci.c | 4 +-
src/acpica/source/components/events/evxface.c | 10 +-
src/acpica/source/components/events/evxfevnt.c | 28 +-
src/acpica/source/components/events/evxfgpe.c | 8 +-
src/acpica/source/components/events/evxfregn.c | 4 +-
src/acpica/source/components/executer/exconfig.c | 43 +-
src/acpica/source/components/executer/exconvrt.c | 26 +-
src/acpica/source/components/executer/excreate.c | 24 +-
src/acpica/source/components/executer/exdebug.c | 384 +--
src/acpica/source/components/executer/exdump.c | 43 +-
src/acpica/source/components/executer/exfield.c | 82 +-
src/acpica/source/components/executer/exfldio.c | 63 +-
src/acpica/source/components/executer/exmisc.c | 37 +-
src/acpica/source/components/executer/exmutex.c | 75 +-
src/acpica/source/components/executer/exnames.c | 8 +-
src/acpica/source/components/executer/exoparg1.c | 69 +-
src/acpica/source/components/executer/exoparg2.c | 41 +-
src/acpica/source/components/executer/exoparg3.c | 25 +-
src/acpica/source/components/executer/exoparg6.c | 25 +-
src/acpica/source/components/executer/exprep.c | 60 +-
src/acpica/source/components/executer/exregion.c | 11 +-
src/acpica/source/components/executer/exresnte.c | 10 +-
src/acpica/source/components/executer/exresolv.c | 25 +-
src/acpica/source/components/executer/exresop.c | 36 +-
src/acpica/source/components/executer/exstore.c | 26 +-
src/acpica/source/components/executer/exstoren.c | 4 +-
src/acpica/source/components/executer/exstorob.c | 7 +-
src/acpica/source/components/executer/exsystem.c | 8 +-
src/acpica/source/components/executer/extrace.c | 499 +++
src/acpica/source/components/executer/exutils.c | 10 +-
src/acpica/source/components/hardware/hwacpi.c | 10 +-
src/acpica/source/components/hardware/hwesleep.c | 5 +-
src/acpica/source/components/hardware/hwgpe.c | 12 +-
src/acpica/source/components/hardware/hwregs.c | 39 +-
src/acpica/source/components/hardware/hwsleep.c | 16 +-
src/acpica/source/components/hardware/hwxface.c | 48 +-
src/acpica/source/components/hardware/hwxfsleep.c | 7 +-
src/acpica/source/components/namespace/nsaccess.c | 12 +-
src/acpica/source/components/namespace/nsalloc.c | 5 +-
.../source/components/namespace/nsarguments.c | 6 +-
src/acpica/source/components/namespace/nsconvert.c | 12 +-
src/acpica/source/components/namespace/nsdump.c | 41 +-
src/acpica/source/components/namespace/nsdumpdv.c | 4 +-
src/acpica/source/components/namespace/nseval.c | 6 +-
src/acpica/source/components/namespace/nsinit.c | 10 +-
src/acpica/source/components/namespace/nsload.c | 9 +-
src/acpica/source/components/namespace/nsnames.c | 15 +-
src/acpica/source/components/namespace/nsobject.c | 6 +-
src/acpica/source/components/namespace/nsparse.c | 13 +-
src/acpica/source/components/namespace/nsprepkg.c | 21 +-
src/acpica/source/components/namespace/nsrepair.c | 14 +-
src/acpica/source/components/namespace/nsrepair2.c | 33 +-
src/acpica/source/components/namespace/nssearch.c | 4 +-
src/acpica/source/components/namespace/nsutils.c | 21 +-
src/acpica/source/components/namespace/nswalk.c | 12 +-
src/acpica/source/components/namespace/nsxfeval.c | 24 +-
src/acpica/source/components/namespace/nsxfname.c | 56 +-
src/acpica/source/components/namespace/nsxfobj.c | 7 +-
src/acpica/source/components/parser/psargs.c | 11 +-
src/acpica/source/components/parser/psloop.c | 10 +-
src/acpica/source/components/parser/psobject.c | 7 +-
src/acpica/source/components/parser/psparse.c | 47 +-
src/acpica/source/components/parser/psscope.c | 10 +-
src/acpica/source/components/parser/psutils.c | 7 +-
src/acpica/source/components/parser/pswalk.c | 1 +
src/acpica/source/components/parser/psxface.c | 9 +-
src/acpica/source/components/resources/rsaddr.c | 27 +-
src/acpica/source/components/resources/rscalc.c | 63 +-
src/acpica/source/components/resources/rscreate.c | 49 +-
src/acpica/source/components/resources/rsdump.c | 15 +-
src/acpica/source/components/resources/rslist.c | 25 +-
src/acpica/source/components/resources/rsmisc.c | 51 +-
src/acpica/source/components/resources/rsutils.c | 65 +-
src/acpica/source/components/resources/rsxface.c | 15 +-
src/acpica/source/components/tables/tbdata.c | 9 +-
src/acpica/source/components/tables/tbfadt.c | 8 +-
src/acpica/source/components/tables/tbfind.c | 8 +-
src/acpica/source/components/tables/tbinstal.c | 13 +-
src/acpica/source/components/tables/tbprint.c | 5 +-
src/acpica/source/components/tables/tbutils.c | 48 +-
src/acpica/source/components/tables/tbxface.c | 18 +-
src/acpica/source/components/tables/tbxfload.c | 20 +-
src/acpica/source/components/tables/tbxfroot.c | 24 +-
src/acpica/source/components/utilities/utaddress.c | 2 +-
src/acpica/source/components/utilities/utalloc.c | 15 +-
src/acpica/source/components/utilities/utcache.c | 4 +-
src/acpica/source/components/utilities/utcopy.c | 120 +-
src/acpica/source/components/utilities/utdecode.c | 31 +-
src/acpica/source/components/utilities/utdelete.c | 11 +-
src/acpica/source/components/utilities/uterror.c | 8 +-
src/acpica/source/components/utilities/uteval.c | 8 +-
src/acpica/source/components/utilities/uthex.c | 2 +-
src/acpica/source/components/utilities/utids.c | 93 +-
src/acpica/source/components/utilities/utinit.c | 16 +-
src/acpica/source/components/utilities/utmath.c | 33 +-
src/acpica/source/components/utilities/utmisc.c | 30 +-
src/acpica/source/components/utilities/utmutex.c | 7 +-
src/acpica/source/components/utilities/utnonansi.c | 4 +-
src/acpica/source/components/utilities/utobject.c | 30 +-
src/acpica/source/components/utilities/utosi.c | 14 +-
src/acpica/source/components/utilities/utownerid.c | 11 +-
src/acpica/source/components/utilities/utpredef.c | 6 +-
src/acpica/source/components/utilities/utprint.c | 16 +-
src/acpica/source/components/utilities/utresrc.c | 17 +-
src/acpica/source/components/utilities/utstate.c | 3 +
src/acpica/source/components/utilities/utstring.c | 1 +
src/acpica/source/components/utilities/uttrack.c | 81 +-
src/acpica/source/components/utilities/utuuid.c | 8 +-
src/acpica/source/components/utilities/utxface.c | 21 -
src/acpica/source/components/utilities/utxferror.c | 4 +-
src/acpica/source/include/acapps.h | 75 +-
src/acpica/source/include/acdebug.h | 20 +-
src/acpica/source/include/acdisasm.h | 33 +-
src/acpica/source/include/acglobal.h | 5 +-
src/acpica/source/include/aclocal.h | 18 +
src/acpica/source/include/acmacros.h | 12 -
src/acpica/source/include/acpiosxf.h | 3 +-
src/acpica/source/include/acpixf.h | 30 +-
src/acpica/source/include/actables.h | 6 +-
src/acpica/source/include/actypes.h | 6 +-
src/acpica/source/include/acutils.h | 30 +-
src/acpica/source/include/platform/aclinux.h | 7 +-
src/acpica/source/include/platform/aclinuxex.h | 9 +
.../source/os_specific/service_layers/oslibcfs.c | 3 +
src/acpica/source/tools/acpiexec/aecommon.h | 41 +-
src/acpica/source/tools/acpiexec/aehandlers.c | 35 +-
src/acpica/source/tools/acpiexec/aeregion.c | 32 +-
246 files changed, 8587 insertions(+), 6803 deletions(-)
create mode 100644 src/acpica/source/common/acfileio.c
create mode 100644 src/acpica/source/common/dmtables.c
create mode 100644 src/acpica/source/compiler/dttable1.c
create mode 100644 src/acpica/source/compiler/dttable2.c
create mode 100644 src/acpica/source/components/executer/extrace.c
diff --git a/src/acpica/Makefile.am b/src/acpica/Makefile.am
index 4fd897a..9b1c435 100644
--- a/src/acpica/Makefile.am
+++ b/src/acpica/Makefile.am
@@ -140,6 +140,7 @@ libfwtsacpica_la_SOURCES = \
source/components/executer/exstoren.c \
source/components/executer/exstorob.c \
source/components/executer/exsystem.c \
+ source/components/executer/extrace.c \
source/components/executer/exutils.c \
source/components/executer/exconvrt.c \
source/components/executer/excreate.c \
@@ -245,6 +246,7 @@ libfwtsacpica_la_SOURCES = \
source/components/utilities/uterror.c \
source/components/utilities/utbuffer.c \
source/components/utilities/utuuid.c \
+ source/common/acfileio.c \
source/common/acgetline.c \
source/common/ahids.c \
source/common/cmfsize.c \
diff --git a/src/acpica/source/common/acfileio.c b/src/acpica/source/common/acfileio.c
new file mode 100644
index 0000000..7d6cc23
--- /dev/null
+++ b/src/acpica/source/common/acfileio.c
@@ -0,0 +1,429 @@
+/******************************************************************************
+ *
+ * Module Name: acfileio - Get ACPI tables from file
+ *
+ *****************************************************************************/
+
+/******************************************************************************
+ *
+ * 1. Copyright Notice
+ *
+ * Some or all of this work - Copyright (c) 1999 - 2015, 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 "acpi.h"
+#include "accommon.h"
+#include "acapps.h"
+#include "actables.h"
+#include "acutils.h"
+#include <errno.h>
+
+#define _COMPONENT ACPI_UTILITIES
+ ACPI_MODULE_NAME ("acfileio")
+
+
+/* Local prototypes */
+
+static ACPI_STATUS
+AcpiAcGetOneTableFromFile (
+ char *Filename,
+ FILE *File,
+ UINT8 GetOnlyAmlTables,
+ ACPI_TABLE_HEADER **Table);
+
+static ACPI_STATUS
+AcpiAcCheckTextModeCorruption (
+ ACPI_TABLE_HEADER *Table);
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiAcGetAllTablesFromFile
+ *
+ * PARAMETERS: Filename - Table filename
+ * GetOnlyAmlTables - TRUE if the tables must be AML tables
+ * ReturnListHead - Where table list is returned
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Get all ACPI tables from within a single file.
+ *
+ ******************************************************************************/
+
+ACPI_STATUS
+AcpiAcGetAllTablesFromFile (
+ char *Filename,
+ UINT8 GetOnlyAmlTables,
+ ACPI_NEW_TABLE_DESC **ReturnListHead)
+{
+ ACPI_NEW_TABLE_DESC *ListHead = NULL;
+ ACPI_NEW_TABLE_DESC *ListTail = NULL;
+ ACPI_NEW_TABLE_DESC *TableDesc;
+ FILE *File;
+ ACPI_TABLE_HEADER *Table = NULL;
+ UINT32 FileSize;
+ ACPI_STATUS Status = AE_OK;
+
+
+ File = fopen (Filename, "rb");
+ if (!File)
+ {
+ perror ("Could not open input file");
+ if (errno == ENOENT)
+ {
+ return (AE_NOT_EXIST);
+ }
+
+ return (AE_ERROR);
+ }
+
+ /* Get the file size */
+
+ FileSize = CmGetFileSize (File);
+ if (FileSize == ACPI_UINT32_MAX)
+ {
+ return (AE_ERROR);
+ }
+
+ if (FileSize < 4)
+ {
+ return (AE_BAD_HEADER);
+ }
+
+ /* Read all tables within the file */
+
+ while (ACPI_SUCCESS (Status))
+ {
+ /* Get one entire ACPI table */
+
+ Status = AcpiAcGetOneTableFromFile (
+ Filename, File, GetOnlyAmlTables, &Table);
+ if (Status == AE_CTRL_TERMINATE)
+ {
+ Status = AE_OK;
+ break;
+ }
+ else if (Status == AE_TYPE)
+ {
+ continue;
+ }
+ else if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ /* Allocate and link a table descriptor */
+
+ TableDesc = AcpiOsAllocate (sizeof (ACPI_NEW_TABLE_DESC));
+ TableDesc->Table = Table;
+ TableDesc->Next = NULL;
+
+ /* Link at the end of the local table list */
+
+ if (!ListHead)
+ {
+ ListHead = TableDesc;
+ ListTail = TableDesc;
+ }
+ else
+ {
+ ListTail->Next = TableDesc;
+ ListTail = TableDesc;
+ }
+ }
+
+ /* Add the local table list to the end of the global list */
+
+ if (*ReturnListHead)
+ {
+ ListTail = *ReturnListHead;
+ while (ListTail->Next)
+ {
+ ListTail = ListTail->Next;
+ }
+
+ ListTail->Next = ListHead;
+ }
+ else
+ {
+ *ReturnListHead = ListHead;
+ }
+
+ fclose(File);
+ return (Status);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiAcGetOneTableFromFile
+ *
+ * PARAMETERS: Filename - File where table is located
+ * File - Open FILE pointer to Filename
+ * GetOnlyAmlTables - TRUE if the tables must be AML tables.
+ * ReturnTable - Where a pointer to the table is returned
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Read the next ACPI table from a file. Implements support
+ * for multiple tables within a single file. File must already
+ * be open.
+ *
+ * Note: Loading an RSDP is not supported.
+ *
+ ******************************************************************************/
+
+static ACPI_STATUS
+AcpiAcGetOneTableFromFile (
+ char *Filename,
+ FILE *File,
+ UINT8 GetOnlyAmlTables,
+ ACPI_TABLE_HEADER **ReturnTable)
+{
+ ACPI_STATUS Status = AE_OK;
+ ACPI_TABLE_HEADER TableHeader;
+ ACPI_TABLE_HEADER *Table;
+ INT32 Count;
+ long Position;
+
+
+ *ReturnTable = NULL;
+
+
+ /* Get just the table header to get signature and length */
+
+ Position = ftell (File);
+ Count = fread (&TableHeader, 1, sizeof (ACPI_TABLE_HEADER), File);
+ if (Count != sizeof (ACPI_TABLE_HEADER))
+ {
+ return (AE_CTRL_TERMINATE);
+ }
+
+ if (GetOnlyAmlTables)
+ {
+ /* Table must be an AML table (DSDT/SSDT) or FADT */
+
+ if (!ACPI_COMPARE_NAME (TableHeader.Signature, ACPI_SIG_FADT) &&
+ !AcpiUtIsAmlTable (&TableHeader))
+ {
+ fprintf (stderr,
+ " %s: [%4.4s] is not an AML table - ignoring\n",
+ Filename, TableHeader.Signature);
+
+ return (AE_TYPE);
+ }
+ }
+
+ /* Allocate a buffer for the entire table */
+
+ Table = AcpiOsAllocate ((size_t) TableHeader.Length);
+ if (!Table)
+ {
+ return (AE_NO_MEMORY);
+ }
+
+ /* Now read the entire table */
+
+ fseek (File, Position, SEEK_SET);
+
+ Count = fread (Table, 1, TableHeader.Length, File);
+ if (Count != (INT32) TableHeader.Length)
+ {
+ Status = AE_ERROR;
+ goto ErrorExit;
+ }
+
+ /* Validate the checksum (just issue a warning) */
+
+ Status = AcpiTbVerifyChecksum (Table, TableHeader.Length);
+ if (ACPI_FAILURE (Status))
+ {
+ Status = AcpiAcCheckTextModeCorruption (Table);
+ if (ACPI_FAILURE (Status))
+ {
+ goto ErrorExit;
+ }
+ }
+
+ fprintf (stderr,
+ "Loading ACPI table [%4.4s] from file %12s - Length 0x%06X (%u)\n",
+ TableHeader.Signature, Filename,
+ TableHeader.Length, TableHeader.Length);
+
+ *ReturnTable = Table;
+ return (AE_OK);
+
+
+ErrorExit:
+ AcpiOsFree (Table);
+ return (Status);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiAcCheckTextModeCorruption
+ *
+ * PARAMETERS: Table - Table buffer starting with table header
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Check table for text mode file corruption where all linefeed
+ * characters (LF) have been replaced by carriage return linefeed
+ * pairs (CR/LF).
+ *
+ ******************************************************************************/
+
+static ACPI_STATUS
+AcpiAcCheckTextModeCorruption (
+ ACPI_TABLE_HEADER *Table)
+{
+ UINT32 i;
+ UINT32 Pairs = 0;
+ UINT8 *Buffer = ACPI_CAST_PTR (UINT8, Table);
+
+
+ /* Scan entire table to determine if each LF has been prefixed with a CR */
+
+ for (i = 1; i < Table->Length; i++)
+ {
+ if (Buffer[i] == 0x0A)
+ {
+ if (Buffer[i - 1] != 0x0D)
+ {
+ /* The LF does not have a preceding CR, table not corrupted */
+
+ return (AE_OK);
+ }
+ else
+ {
+ /* Found a CR/LF pair */
+
+ Pairs++;
+ }
+
+ i++;
+ }
+ }
+
+ if (!Pairs)
+ {
+ return (AE_OK);
+ }
+
+ /*
+ * Entire table scanned, each CR is part of a CR/LF pair --
+ * meaning that the table was treated as a text file somewhere.
+ *
+ * NOTE: We can't "fix" the table, because any existing CR/LF pairs in the
+ * original table are left untouched by the text conversion process --
+ * meaning that we cannot simply replace CR/LF pairs with LFs.
+ */
+ AcpiOsPrintf ("Table has been corrupted by text mode conversion\n");
+ AcpiOsPrintf ("All LFs (%u) were changed to CR/LF pairs\n", Pairs);
+ AcpiOsPrintf ("Table cannot be repaired!\n");
+
+ return (AE_BAD_VALUE);
+}
diff --git a/src/acpica/source/common/acgetline.c b/src/acpica/source/common/acgetline.c
index 2a2232a..804ff30 100644
--- a/src/acpica/source/common/acgetline.c
+++ b/src/acpica/source/common/acgetline.c
@@ -334,6 +334,7 @@ AcpiOsGetLine (
ACPI_BACKUP_CURSOR (i, EndOfLine - CursorPosition + 1);
EndOfLine--;
+
if (CursorPosition > 0)
{
CursorPosition--;
diff --git a/src/acpica/source/common/adisasm.c b/src/acpica/source/common/adisasm.c
index 44a052e..071649a 100644
--- a/src/acpica/source/common/adisasm.c
+++ b/src/acpica/source/common/adisasm.c
@@ -114,16 +114,14 @@
*****************************************************************************/
#include "aslcompiler.h"
-#include "acparser.h"
#include "amlcode.h"
#include "acdisasm.h"
#include "acdispat.h"
#include "acnamesp.h"
-#include "actables.h"
+#include "acparser.h"
#include "acapps.h"
#include <stdio.h>
-#include <time.h>
#define _COMPONENT ACPI_TOOLS
@@ -131,17 +129,29 @@
/* Local prototypes */
-static void
-AdCreateTableHeader (
+static ACPI_STATUS
+AdDoExternalFileList (
+ char *Filename);
+
+static ACPI_STATUS
+AdDisassembleOneTable (
+ ACPI_TABLE_HEADER *Table,
+ FILE *File,
char *Filename,
- ACPI_TABLE_HEADER *Table);
+ char *DisasmFilename);
static ACPI_STATUS
-AdStoreTable (
+AdReparseOneTable (
ACPI_TABLE_HEADER *Table,
- UINT32 *TableIndex);
+ FILE *File,
+ ACPI_OWNER_ID OwnerId);
-/* Stubs for ASL compiler */
+
+ACPI_TABLE_DESC LocalTables[1];
+ACPI_PARSE_OBJECT *AcpiGbl_ParseOpRoot;
+
+
+/* Stubs for everything except ASL compiler */
#ifndef ACPI_ASL_COMPILER
BOOLEAN
@@ -149,7 +159,7 @@ AcpiDsIsResultUsed (
ACPI_PARSE_OBJECT *Op,
ACPI_WALK_STATE *WalkState)
{
- return TRUE;
+ return (TRUE);
}
ACPI_STATUS
@@ -161,52 +171,6 @@ AcpiDsMethodError (
}
#endif
-ACPI_STATUS
-AcpiNsLoadTable (
- UINT32 TableIndex,
- ACPI_NAMESPACE_NODE *Node)
-{
- return (AE_NOT_IMPLEMENTED);
-}
-
-ACPI_STATUS
-AcpiDsRestartControlMethod (
- ACPI_WALK_STATE *WalkState,
- ACPI_OPERAND_OBJECT *ReturnDesc)
-{
- return (AE_OK);
-}
-
-void
-AcpiDsTerminateControlMethod (
- ACPI_OPERAND_OBJECT *MethodDesc,
- ACPI_WALK_STATE *WalkState)
-{
- return;
-}
-
-ACPI_STATUS
-AcpiDsCallControlMethod (
- ACPI_THREAD_STATE *Thread,
- ACPI_WALK_STATE *WalkState,
- ACPI_PARSE_OBJECT *Op)
-{
- return (AE_OK);
-}
-
-ACPI_STATUS
-AcpiDsMethodDataInitArgs (
- ACPI_OPERAND_OBJECT **Params,
- UINT32 MaxParamCount,
- ACPI_WALK_STATE *WalkState)
-{
- return (AE_OK);
-}
-
-
-static ACPI_TABLE_DESC LocalTables[1];
-static ACPI_PARSE_OBJECT *AcpiGbl_ParseOpRoot;
-
/*******************************************************************************
*
@@ -274,7 +238,7 @@ AdInitialize (
*
* RETURN: Status
*
- * DESCRIPTION: Disassemble an entire ACPI table
+ * DESCRIPTION: Disassembler entry point. Disassemble an entire ACPI table.
*
*****************************************************************************/
@@ -286,14 +250,10 @@ AdAmlDisassemble (
char **OutFilename)
{
ACPI_STATUS Status;
- ACPI_STATUS GlobalStatus = AE_OK;
char *DisasmFilename = NULL;
- char *ExternalFilename;
- ACPI_EXTERNAL_FILE *ExternalFileList = AcpiGbl_ExternalFileList;
FILE *File = NULL;
ACPI_TABLE_HEADER *Table = NULL;
- ACPI_TABLE_HEADER *ExternalTable;
- ACPI_OWNER_ID OwnerId;
+ ACPI_NEW_TABLE_DESC *ListHead = NULL;
/*
@@ -302,81 +262,22 @@ AdAmlDisassemble (
*/
if (Filename)
{
- Status = AcpiDbGetTableFromFile (Filename, &Table, FALSE);
+ /* Get the list of all AML tables in the file */
+
+ Status = AcpiAcGetAllTablesFromFile (Filename,
+ ACPI_GET_ALL_TABLES, &ListHead);
if (ACPI_FAILURE (Status))
{
return (Status);
}
- /*
- * External filenames separated by commas
- * Example: iasl -e file1,file2,file3 -d xxx.aml
- */
- while (ExternalFileList)
- {
- ExternalFilename = ExternalFileList->Path;
- if (!strcmp (ExternalFilename, Filename))
- {
- /* Next external file */
-
- ExternalFileList = ExternalFileList->Next;
- continue;
- }
-
- Status = AcpiDbGetTableFromFile (ExternalFilename, &ExternalTable, TRUE);
- if (ACPI_FAILURE (Status))
- {
- if (Status == AE_TYPE)
- {
- ExternalFileList = ExternalFileList->Next;
- GlobalStatus = AE_TYPE;
- Status = AE_OK;
- continue;
- }
- return (Status);
- }
-
- /* Load external table for symbol resolution */
-
- if (ExternalTable)
- {
- Status = AdParseTable (ExternalTable, &OwnerId, TRUE, TRUE);
- if (ACPI_FAILURE (Status))
- {
- AcpiOsPrintf ("Could not parse external ACPI tables, %s\n",
- AcpiFormatException (Status));
- return (Status);
- }
-
- /*
- * Load namespace from names created within control methods
- * Set owner id of nodes in external table
- */
- AcpiDmFinishNamespaceLoad (AcpiGbl_ParseOpRoot,
- AcpiGbl_RootNode, OwnerId);
- AcpiPsDeleteParseTree (AcpiGbl_ParseOpRoot);
- }
-
- /* Next external file */
-
- ExternalFileList = ExternalFileList->Next;
- }
-
- if (ACPI_FAILURE (GlobalStatus))
- {
- return (GlobalStatus);
- }
-
- /* Clear external list generated by Scope in external tables */
+ /* Process any user-specified files for external objects */
- if (AcpiGbl_ExternalFileList)
+ Status = AdDoExternalFileList (Filename);
+ if (ACPI_FAILURE (Status))
{
- AcpiDmClearExternalList ();
+ return (Status);
}
-
- /* Load any externals defined in the optional external ref file */
-
- AcpiDmGetExternalsFromFile ();
}
else
{
@@ -425,7 +326,8 @@ AdAmlDisassemble (
File = fopen (DisasmFilename, "w+");
if (!File)
{
- fprintf (stderr, "Could not open output file %s\n", DisasmFilename);
+ fprintf (stderr, "Could not open output file %s\n",
+ DisasmFilename);
Status = AE_ERROR;
goto Cleanup;
}
@@ -435,190 +337,32 @@ AdAmlDisassemble (
*OutFilename = DisasmFilename;
- /* ForceAmlDisassembly means to assume the table contains valid AML */
-
- if (!AcpiGbl_ForceAmlDisassembly && !AcpiUtIsAmlTable (Table))
- {
- AdDisassemblerHeader (Filename, ACPI_IS_DATA_TABLE);
- AcpiOsPrintf (" * ACPI Data Table [%4.4s]\n *\n",
- Table->Signature);
- AcpiOsPrintf (" * Format: [HexOffset DecimalOffset ByteLength] "
- "FieldName : FieldValue\n */\n\n");
-
- AcpiDmDumpDataTable (Table);
- fprintf (stderr, "Acpi Data Table [%4.4s] decoded\n",
- Table->Signature);
+ /* Disassemble all AML tables within the file */
- if (File)
- {
- fprintf (stderr, "Formatted output: %s - %u bytes\n",
- DisasmFilename, CmGetFileSize (File));
- }
- }
- else
+ while (ListHead)
{
- /* Always parse the tables, only option is what to display */
-
- Status = AdParseTable (Table, &OwnerId, TRUE, FALSE);
+ Status = AdDisassembleOneTable (ListHead->Table,
+ File, Filename, DisasmFilename);
if (ACPI_FAILURE (Status))
{
- AcpiOsPrintf ("Could not parse ACPI tables, %s\n",
- AcpiFormatException (Status));
- goto Cleanup;
- }
-
- if (AslCompilerdebug)
- {
- AcpiOsPrintf ("/**** Before second load\n");
-
- if (File)
- {
- NsSetupNamespaceListing (File);
- NsDisplayNamespace ();
- }
- AcpiOsPrintf ("*****/\n");
- }
-
- /* Load namespace from names created within control methods */
-
- AcpiDmFinishNamespaceLoad (AcpiGbl_ParseOpRoot,
- AcpiGbl_RootNode, OwnerId);
-
- /*
- * Cross reference the namespace here, in order to
- * generate External() statements
- */
- AcpiDmCrossReferenceNamespace (AcpiGbl_ParseOpRoot,
- AcpiGbl_RootNode, OwnerId);
-
- if (AslCompilerdebug)
- {
- AcpiDmDumpTree (AcpiGbl_ParseOpRoot);
- }
-
- /* Find possible calls to external control methods */
-
- AcpiDmFindOrphanMethods (AcpiGbl_ParseOpRoot);
-
- /*
- * If we found any external control methods, we must reparse
- * the entire tree with the new information (namely, the
- * number of arguments per method)
- */
- if (AcpiDmGetExternalMethodCount ())
- {
- fprintf (stderr,
- "\nFound %u external control methods, "
- "reparsing with new information\n",
- AcpiDmGetExternalMethodCount ());
-
- /* Reparse, rebuild namespace */
-
- AcpiPsDeleteParseTree (AcpiGbl_ParseOpRoot);
- AcpiGbl_ParseOpRoot = NULL;
- AcpiNsDeleteNamespaceSubtree (AcpiGbl_RootNode);
-
- AcpiGbl_RootNode = NULL;
- AcpiGbl_RootNodeStruct.Name.Integer = ACPI_ROOT_NAME;
- AcpiGbl_RootNodeStruct.DescriptorType = ACPI_DESC_TYPE_NAMED;
- AcpiGbl_RootNodeStruct.Type = ACPI_TYPE_DEVICE;
- AcpiGbl_RootNodeStruct.Parent = NULL;
- AcpiGbl_RootNodeStruct.Child = NULL;
- AcpiGbl_RootNodeStruct.Peer = NULL;
- AcpiGbl_RootNodeStruct.Object = NULL;
- AcpiGbl_RootNodeStruct.Flags = 0;
-
- Status = AcpiNsRootInitialize ();
-
- /* New namespace, add the external definitions first */
-
- AcpiDmAddExternalsToNamespace ();
-
- /* Parse the table again. No need to reload it, however */
-
- Status = AdParseTable (Table, NULL, FALSE, FALSE);
- if (ACPI_FAILURE (Status))
- {
- AcpiOsPrintf ("Could not parse ACPI tables, %s\n",
- AcpiFormatException (Status));
- goto Cleanup;
- }
-
- /* Cross reference the namespace again */
-
- AcpiDmFinishNamespaceLoad (AcpiGbl_ParseOpRoot,
- AcpiGbl_RootNode, OwnerId);
-
- AcpiDmCrossReferenceNamespace (AcpiGbl_ParseOpRoot,
- AcpiGbl_RootNode, OwnerId);
-
- if (AslCompilerdebug)
- {
- AcpiOsPrintf ("/**** After second load and resource conversion\n");
- if (File)
- {
- NsSetupNamespaceListing (File);
- NsDisplayNamespace ();
- }
- AcpiOsPrintf ("*****/\n");
-
- AcpiDmDumpTree (AcpiGbl_ParseOpRoot);
- }
+ break;
}
- /*
- * Now that the namespace is finalized, we can perform namespace
- * transforms.
- *
- * 1) Convert fixed-offset references to resource descriptors
- * to symbolic references (Note: modifies namespace)
- */
- AcpiDmConvertResourceIndexes (AcpiGbl_ParseOpRoot, AcpiGbl_RootNode);
-
- /* Optional displays */
-
- if (AcpiGbl_DmOpt_Disasm)
- {
- /* This is the real disassembly */
-
- AdDisplayTables (Filename, Table);
-
- /* Dump hex table if requested (-vt) */
-
- AcpiDmDumpDataTable (Table);
-
- fprintf (stderr, "Disassembly completed\n");
- if (File)
- {
- fprintf (stderr, "ASL Output: %s - %u bytes\n",
- DisasmFilename, CmGetFileSize (File));
- }
-
- if (Gbl_MapfileFlag)
- {
- fprintf (stderr, "%14s %s - %u bytes\n",
- Gbl_Files[ASL_FILE_MAP_OUTPUT].ShortDescription,
- Gbl_Files[ASL_FILE_MAP_OUTPUT].Filename,
- FlGetFileSize (ASL_FILE_MAP_OUTPUT));
- }
- }
+ ListHead = ListHead->Next;
}
Cleanup:
- if (Table && !AcpiGbl_ForceAmlDisassembly &&!AcpiUtIsAmlTable (Table))
+// check!
+#if 0
+ if (Table && !AcpiGbl_ForceAmlDisassembly && !AcpiUtIsAmlTable (Table))
{
ACPI_FREE (Table);
}
+#endif
if (File)
{
- if (AslCompilerdebug) /* Display final namespace, with transforms */
- {
- NsSetupNamespaceListing (File);
- NsDisplayNamespace ();
- }
-
fclose (File);
AcpiOsRedirectOutput (stdout);
}
@@ -631,290 +375,243 @@ Cleanup:
/******************************************************************************
*
- * FUNCTION: AdDisassemblerHeader
+ * FUNCTION: AdDisassembleOneTable
*
- * PARAMETERS: Filename - Input file for the table
- * TableType - Either AML or DataTable
+ * PARAMETERS: Table - Raw AML table
+ * File - Pointer for the input file
+ * Filename - AML input filename
+ * DisasmFilename - Output filename
*
- * RETURN: None
+ * RETURN: Status
*
- * DESCRIPTION: Create the disassembler header, including ACPICA signon with
- * current time and date.
+ * DESCRIPTION: Disassemble a single ACPI table. AML or data table.
*
*****************************************************************************/
-void
-AdDisassemblerHeader (
+static ACPI_STATUS
+AdDisassembleOneTable (
+ ACPI_TABLE_HEADER *Table,
+ FILE *File,
char *Filename,
- UINT8 TableType)
+ char *DisasmFilename)
{
- time_t Timer;
-
-
- time (&Timer);
+ ACPI_STATUS Status;
+ ACPI_OWNER_ID OwnerId;
- /* Header and input table info */
- AcpiOsPrintf ("/*\n");
- AcpiOsPrintf (ACPI_COMMON_HEADER (AML_DISASSEMBLER_NAME, " * "));
+ /* ForceAmlDisassembly means to assume the table contains valid AML */
- if (TableType == ACPI_IS_AML_TABLE)
+ if (!AcpiGbl_ForceAmlDisassembly && !AcpiUtIsAmlTable (Table))
{
- if (AcpiGbl_CstyleDisassembly)
- {
- AcpiOsPrintf (
- " * Disassembling to symbolic ASL+ operators\n"
- " *\n");
- }
- else
- {
- AcpiOsPrintf (
- " * Disassembling to non-symbolic legacy ASL operators\n"
- " *\n");
- }
- }
+ AdDisassemblerHeader (Filename, ACPI_IS_DATA_TABLE);
- AcpiOsPrintf (" * Disassembly of %s, %s", Filename, ctime (&Timer));
- AcpiOsPrintf (" *\n");
-}
+ /* This is a "Data Table" (non-AML table) */
+ AcpiOsPrintf (" * ACPI Data Table [%4.4s]\n *\n",
+ Table->Signature);
+ AcpiOsPrintf (" * Format: [HexOffset DecimalOffset ByteLength] "
+ "FieldName : FieldValue\n */\n\n");
-/******************************************************************************
- *
- * FUNCTION: AdCreateTableHeader
- *
- * PARAMETERS: Filename - Input file for the table
- * Table - Pointer to the raw table
- *
- * RETURN: None
- *
- * DESCRIPTION: Create the ASL table header, including ACPICA signon with
- * current time and date.
- *
- *****************************************************************************/
+ AcpiDmDumpDataTable (Table);
+ fprintf (stderr, "Acpi Data Table [%4.4s] decoded\n",
+ Table->Signature);
-static void
-AdCreateTableHeader (
- char *Filename,
- ACPI_TABLE_HEADER *Table)
-{
- char *NewFilename;
- UINT8 Checksum;
+ if (File)
+ {
+ fprintf (stderr, "Formatted output: %s - %u bytes\n",
+ DisasmFilename, CmGetFileSize (File));
+ }
+ return (AE_OK);
+ }
/*
- * Print file header and dump original table header
+ * This is an AML table (DSDT or SSDT).
+ * Always parse the tables, only option is what to display
*/
- AdDisassemblerHeader (Filename, ACPI_IS_AML_TABLE);
-
- AcpiOsPrintf (" * Original Table Header:\n");
- AcpiOsPrintf (" * Signature \"%4.4s\"\n", Table->Signature);
- AcpiOsPrintf (" * Length 0x%8.8X (%u)\n", Table->Length, Table->Length);
-
- /* Print and validate the revision */
+ Status = AdParseTable (Table, &OwnerId, TRUE, FALSE);
+ if (ACPI_FAILURE (Status))
+ {
+ AcpiOsPrintf ("Could not parse ACPI tables, %s\n",
+ AcpiFormatException (Status));
+ return (Status);
+ }
- AcpiOsPrintf (" * Revision 0x%2.2X", Table->Revision);
+ /* Debug output, namespace and parse tree */
- switch (Table->Revision)
+ if (AslCompilerdebug && File)
{
- case 0:
+ AcpiOsPrintf ("/**** Before second load\n");
- AcpiOsPrintf (" **** Invalid Revision");
- break;
+ NsSetupNamespaceListing (File);
+ NsDisplayNamespace ();
- case 1:
+ AcpiOsPrintf ("*****/\n");
+ }
- /* Revision of DSDT controls the ACPI integer width */
+ /* Load namespace from names created within control methods */
- if (ACPI_COMPARE_NAME (Table->Signature, ACPI_SIG_DSDT))
- {
- AcpiOsPrintf (" **** 32-bit table (V1), no 64-bit math support");
- }
- break;
+ AcpiDmFinishNamespaceLoad (AcpiGbl_ParseOpRoot,
+ AcpiGbl_RootNode, OwnerId);
- default:
+ /*
+ * Cross reference the namespace here, in order to
+ * generate External() statements
+ */
+ AcpiDmCrossReferenceNamespace (AcpiGbl_ParseOpRoot,
+ AcpiGbl_RootNode, OwnerId);
- break;
+ if (AslCompilerdebug)
+ {
+ AcpiDmDumpTree (AcpiGbl_ParseOpRoot);
}
- AcpiOsPrintf ("\n");
- /* Print and validate the table checksum */
+ /* Find possible calls to external control methods */
- AcpiOsPrintf (" * Checksum 0x%2.2X", Table->Checksum);
+ AcpiDmFindOrphanMethods (AcpiGbl_ParseOpRoot);
- Checksum = AcpiTbChecksum (ACPI_CAST_PTR (UINT8, Table), Table->Length);
- if (Checksum)
+ /*
+ * If we found any external control methods, we must reparse
+ * the entire tree with the new information (namely, the
+ * number of arguments per method)
+ */
+ if (AcpiDmGetExternalMethodCount ())
{
- AcpiOsPrintf (" **** Incorrect checksum, should be 0x%2.2X",
- (UINT8) (Table->Checksum - Checksum));
+ Status = AdReparseOneTable (Table, File, OwnerId);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
}
- AcpiOsPrintf ("\n");
- AcpiOsPrintf (" * OEM ID \"%.6s\"\n", Table->OemId);
- AcpiOsPrintf (" * OEM Table ID \"%.8s\"\n", Table->OemTableId);
- AcpiOsPrintf (" * OEM Revision 0x%8.8X (%u)\n", Table->OemRevision, Table->OemRevision);
- AcpiOsPrintf (" * Compiler ID \"%.4s\"\n", Table->AslCompilerId);
- AcpiOsPrintf (" * Compiler Version 0x%8.8X (%u)\n", Table->AslCompilerRevision, Table->AslCompilerRevision);
- AcpiOsPrintf (" */\n");
+ /*
+ * Now that the namespace is finalized, we can perform namespace
+ * transforms.
+ *
+ * 1) Convert fixed-offset references to resource descriptors
+ * to symbolic references (Note: modifies namespace)
+ */
+ AcpiDmConvertResourceIndexes (AcpiGbl_ParseOpRoot, AcpiGbl_RootNode);
- /* Create AML output filename based on input filename */
+ /* Optional displays */
- if (Filename)
- {
- NewFilename = FlGenerateFilename (Filename, "aml");
- }
- else
+ if (AcpiGbl_DmOpt_Disasm)
{
- NewFilename = UtStringCacheCalloc (9);
- if (NewFilename)
+ /* This is the real disassembly */
+
+ AdDisplayTables (Filename, Table);
+
+ /* Dump hex table if requested (-vt) */
+
+ AcpiDmDumpDataTable (Table);
+
+ fprintf (stderr, "Disassembly completed\n");
+ if (File)
{
- strncat (NewFilename, Table->Signature, 4);
- strcat (NewFilename, ".aml");
+ fprintf (stderr, "ASL Output: %s - %u bytes\n",
+ DisasmFilename, CmGetFileSize (File));
}
- }
- if (!NewFilename)
- {
- AcpiOsPrintf (" **** Could not generate AML output filename\n");
- return;
+ if (Gbl_MapfileFlag)
+ {
+ fprintf (stderr, "%14s %s - %u bytes\n",
+ Gbl_Files[ASL_FILE_MAP_OUTPUT].ShortDescription,
+ Gbl_Files[ASL_FILE_MAP_OUTPUT].Filename,
+ FlGetFileSize (ASL_FILE_MAP_OUTPUT));
+ }
}
- /* Open the ASL definition block */
-
- AcpiOsPrintf (
- "DefinitionBlock (\"%s\", \"%4.4s\", %hu, \"%.6s\", \"%.8s\", 0x%8.8X)\n",
- NewFilename, Table->Signature, Table->Revision,
- Table->OemId, Table->OemTableId, Table->OemRevision);
+ return (AE_OK);
}
/******************************************************************************
*
- * FUNCTION: AdDisplayTables
+ * FUNCTION: AdReparseOneTable
*
- * PARAMETERS: Filename - Input file for the table
- * Table - Pointer to the raw table
+ * PARAMETERS: Table - Raw AML table
+ * File - Pointer for the input file
+ * OwnerId - ID for this table
*
* RETURN: Status
*
- * DESCRIPTION: Display (disassemble) loaded tables and dump raw tables
+ * DESCRIPTION: Reparse a table that has already been loaded. Used to
+ * integrate information about external control methods.
+ * These methods may have been previously parsed incorrectly.
*
*****************************************************************************/
-ACPI_STATUS
-AdDisplayTables (
- char *Filename,
- ACPI_TABLE_HEADER *Table)
+static ACPI_STATUS
+AdReparseOneTable (
+ ACPI_TABLE_HEADER *Table,
+ FILE *File,
+ ACPI_OWNER_ID OwnerId)
{
+ ACPI_STATUS Status;
- if (!AcpiGbl_ParseOpRoot)
- {
- return (AE_NOT_EXIST);
- }
+ fprintf (stderr,
+ "\nFound %u external control methods, "
+ "reparsing with new information\n",
+ AcpiDmGetExternalMethodCount ());
- if (!AcpiGbl_DmOpt_Listing)
- {
- AdCreateTableHeader (Filename, Table);
- }
+ /* Reparse, rebuild namespace */
- AcpiDmDisassemble (NULL, AcpiGbl_ParseOpRoot, ACPI_UINT32_MAX);
- MpEmitMappingInfo ();
+ AcpiPsDeleteParseTree (AcpiGbl_ParseOpRoot);
+ AcpiGbl_ParseOpRoot = NULL;
+ AcpiNsDeleteNamespaceSubtree (AcpiGbl_RootNode);
+
+ AcpiGbl_RootNode = NULL;
+ AcpiGbl_RootNodeStruct.Name.Integer = ACPI_ROOT_NAME;
+ AcpiGbl_RootNodeStruct.DescriptorType = ACPI_DESC_TYPE_NAMED;
+ AcpiGbl_RootNodeStruct.Type = ACPI_TYPE_DEVICE;
+ AcpiGbl_RootNodeStruct.Parent = NULL;
+ AcpiGbl_RootNodeStruct.Child = NULL;
+ AcpiGbl_RootNodeStruct.Peer = NULL;
+ AcpiGbl_RootNodeStruct.Object = NULL;
+ AcpiGbl_RootNodeStruct.Flags = 0;
- if (AcpiGbl_DmOpt_Listing)
+ Status = AcpiNsRootInitialize ();
+ if (ACPI_FAILURE (Status))
{
- AcpiOsPrintf ("\n\nTable Header:\n");
- AcpiUtDebugDumpBuffer ((UINT8 *) Table, sizeof (ACPI_TABLE_HEADER),
- DB_BYTE_DISPLAY, ACPI_UINT32_MAX);
-
- AcpiOsPrintf ("Table Body (Length 0x%X)\n", Table->Length);
- AcpiUtDebugDumpBuffer (((UINT8 *) Table + sizeof (ACPI_TABLE_HEADER)),
- Table->Length, DB_BYTE_DISPLAY, ACPI_UINT32_MAX);
+ return (Status);
}
- return (AE_OK);
-}
-
-
-/*******************************************************************************
- *
- * FUNCTION: AdStoreTable
- *
- * PARAMETERS: Table - Table header
- * TableIndex - Where the table index is returned
- *
- * RETURN: Status and table index.
- *
- * DESCRIPTION: Add an ACPI table to the global table list
- *
- ******************************************************************************/
+ /* New namespace, add the external definitions first */
-static ACPI_STATUS
-AdStoreTable (
- ACPI_TABLE_HEADER *Table,
- UINT32 *TableIndex)
-{
- ACPI_STATUS Status;
- ACPI_TABLE_DESC *TableDesc;
+ AcpiDmAddExternalsToNamespace ();
+ /* Parse the table again. No need to reload it, however */
- Status = AcpiTbGetNextTableDescriptor (TableIndex, &TableDesc);
+ Status = AdParseTable (Table, NULL, FALSE, FALSE);
if (ACPI_FAILURE (Status))
{
+ AcpiOsPrintf ("Could not parse ACPI tables, %s\n",
+ AcpiFormatException (Status));
return (Status);
}
- /* Initialize added table */
+ /* Cross reference the namespace again */
- AcpiTbInitTableDescriptor (TableDesc, ACPI_PTR_TO_PHYSADDR (Table),
- ACPI_TABLE_ORIGIN_INTERNAL_VIRTUAL, Table);
- Status = AcpiTbValidateTable (TableDesc);
- return (Status);
-}
+ AcpiDmFinishNamespaceLoad (AcpiGbl_ParseOpRoot,
+ AcpiGbl_RootNode, OwnerId);
+ AcpiDmCrossReferenceNamespace (AcpiGbl_ParseOpRoot,
+ AcpiGbl_RootNode, OwnerId);
-/******************************************************************************
- *
- * FUNCTION: AdGetLocalTables
- *
- * PARAMETERS: None
- *
- * RETURN: Status
- *
- * DESCRIPTION: Get the ACPI tables from either memory or a file
- *
- *****************************************************************************/
-
-ACPI_STATUS
-AdGetLocalTables (
- void)
-{
- ACPI_STATUS Status;
- ACPI_TABLE_HEADER TableHeader;
- ACPI_TABLE_HEADER *NewTable;
- UINT32 TableIndex;
-
+ /* Debug output - namespace and parse tree */
- /* Get the DSDT via table override */
-
- ACPI_MOVE_32_TO_32 (TableHeader.Signature, ACPI_SIG_DSDT);
- AcpiOsTableOverride (&TableHeader, &NewTable);
- if (!NewTable)
+ if (AslCompilerdebug)
{
- fprintf (stderr, "Could not obtain DSDT\n");
- return (AE_NO_ACPI_TABLES);
- }
-
- AdWriteTable (NewTable, NewTable->Length,
- ACPI_SIG_DSDT, NewTable->OemTableId);
-
- /* Store DSDT in the Table Manager */
+ AcpiOsPrintf ("/**** After second load and resource conversion\n");
+ if (File)
+ {
+ NsSetupNamespaceListing (File);
+ NsDisplayNamespace ();
+ }
- Status = AdStoreTable (NewTable, &TableIndex);
- if (ACPI_FAILURE (Status))
- {
- fprintf (stderr, "Could not store DSDT\n");
- return (AE_NO_ACPI_TABLES);
+ AcpiOsPrintf ("*****/\n");
+ AcpiDmDumpTree (AcpiGbl_ParseOpRoot);
}
return (AE_OK);
@@ -923,134 +620,108 @@ AdGetLocalTables (
/******************************************************************************
*
- * FUNCTION: AdParseTable
+ * FUNCTION: AdDoExternalFileList
*
- * PARAMETERS: Table - Pointer to the raw table
- * OwnerId - Returned OwnerId of the table
- * LoadTable - If add table to the global table list
- * External - If this is an external table
+ * PARAMETERS: Filename - Input file for the table
*
* RETURN: Status
*
- * DESCRIPTION: Parse the DSDT.
+ * DESCRIPTION: Process all tables found in the -e external files list
*
*****************************************************************************/
-ACPI_STATUS
-AdParseTable (
- ACPI_TABLE_HEADER *Table,
- ACPI_OWNER_ID *OwnerId,
- BOOLEAN LoadTable,
- BOOLEAN External)
+static ACPI_STATUS
+AdDoExternalFileList (
+ char *Filename)
{
- ACPI_STATUS Status = AE_OK;
- ACPI_WALK_STATE *WalkState;
- UINT8 *AmlStart;
- UINT32 AmlLength;
- UINT32 TableIndex;
-
-
- if (!Table)
- {
- return (AE_NOT_EXIST);
- }
-
- /* Pass 1: Parse everything except control method bodies */
-
- fprintf (stderr, "Pass 1 parse of [%4.4s]\n", (char *) Table->Signature);
-
- AmlLength = Table->Length - sizeof (ACPI_TABLE_HEADER);
- AmlStart = ((UINT8 *) Table + sizeof (ACPI_TABLE_HEADER));
-
- /* Create the root object */
-
- AcpiGbl_ParseOpRoot = AcpiPsCreateScopeOp (AmlStart);
- if (!AcpiGbl_ParseOpRoot)
- {
- return (AE_NO_MEMORY);
- }
-
- /* Create and initialize a new walk state */
+ ACPI_EXTERNAL_FILE *ExternalFileList;
+ char *ExternalFilename;
+ ACPI_NEW_TABLE_DESC *ExternalListHead = NULL;
+ ACPI_STATUS Status;
+ ACPI_STATUS GlobalStatus = AE_OK;
+ ACPI_OWNER_ID OwnerId;
- WalkState = AcpiDsCreateWalkState (0,
- AcpiGbl_ParseOpRoot, NULL, NULL);
- if (!WalkState)
- {
- return (AE_NO_MEMORY);
- }
- Status = AcpiDsInitAmlWalk (WalkState, AcpiGbl_ParseOpRoot,
- NULL, AmlStart, AmlLength, NULL, ACPI_IMODE_LOAD_PASS1);
- if (ACPI_FAILURE (Status))
- {
- return (Status);
- }
+ /*
+ * External filenames are specified on the command line like this:
+ * Example: iasl -e file1,file2,file3 -d xxx.aml
+ */
+ ExternalFileList = AcpiGbl_ExternalFileList;
- WalkState->ParseFlags &= ~ACPI_PARSE_DELETE_TREE;
- WalkState->ParseFlags |= ACPI_PARSE_DISASSEMBLE;
+ /* Process each external file */
- Status = AcpiPsParseAml (WalkState);
- if (ACPI_FAILURE (Status))
+ while (ExternalFileList)
{
- return (Status);
- }
-
- /* If LoadTable is FALSE, we are parsing the last loaded table */
+ ExternalFilename = ExternalFileList->Path;
+ if (!strcmp (ExternalFilename, Filename))
+ {
+ /* Next external file */
- TableIndex = AcpiGbl_RootTableList.CurrentTableCount - 1;
+ ExternalFileList = ExternalFileList->Next;
+ continue;
+ }
- /* Pass 2 */
+ AcpiOsPrintf ("External object resolution file %16s\n",
+ ExternalFilename);
- if (LoadTable)
- {
- Status = AdStoreTable (Table, &TableIndex);
- if (ACPI_FAILURE (Status))
- {
- return (Status);
- }
- Status = AcpiTbAllocateOwnerId (TableIndex);
+ Status = AcpiAcGetAllTablesFromFile (
+ ExternalFilename, ACPI_GET_ONLY_AML_TABLES, &ExternalListHead);
if (ACPI_FAILURE (Status))
{
+ if (Status == AE_TYPE)
+ {
+ ExternalFileList = ExternalFileList->Next;
+ GlobalStatus = AE_TYPE;
+ Status = AE_OK;
+ continue;
+ }
+
return (Status);
}
- if (OwnerId)
+
+ /* Load external tables for symbol resolution */
+
+ while (ExternalListHead)
{
- Status = AcpiTbGetOwnerId (TableIndex, OwnerId);
+ Status = AdParseTable (
+ ExternalListHead->Table, &OwnerId, TRUE, TRUE);
if (ACPI_FAILURE (Status))
{
+ AcpiOsPrintf ("Could not parse external ACPI tables, %s\n",
+ AcpiFormatException (Status));
return (Status);
}
+
+ /*
+ * Load namespace from names created within control methods
+ * Set owner id of nodes in external table
+ */
+ AcpiDmFinishNamespaceLoad (AcpiGbl_ParseOpRoot,
+ AcpiGbl_RootNode, OwnerId);
+ AcpiPsDeleteParseTree (AcpiGbl_ParseOpRoot);
+
+ ExternalListHead = ExternalListHead->Next;
}
- }
- fprintf (stderr, "Pass 2 parse of [%4.4s]\n", (char *) Table->Signature);
+ /* Next external file */
- Status = AcpiNsOneCompleteParse (ACPI_IMODE_LOAD_PASS2, TableIndex, NULL);
- if (ACPI_FAILURE (Status))
- {
- return (Status);
+ ExternalFileList = ExternalFileList->Next;
}
- /* No need to parse control methods of external table */
-
- if (External)
+ if (ACPI_FAILURE (GlobalStatus))
{
- return (AE_OK);
+ return (GlobalStatus);
}
- /*
- * Pass 3: Parse control methods and link their parse trees
- * into the main parse tree
- */
- fprintf (stderr,
- "Parsing Deferred Opcodes (Methods/Buffers/Packages/Regions)\n");
- Status = AcpiDmParseDeferredOps (AcpiGbl_ParseOpRoot);
- fprintf (stderr, "\n");
+ /* Clear external list generated by Scope in external tables */
- /* Process Resource Templates */
+ if (AcpiGbl_ExternalFileList)
+ {
+ AcpiDmClearExternalList ();
+ }
- AcpiDmFindResources (AcpiGbl_ParseOpRoot);
+ /* Load any externals defined in the optional external ref file */
- fprintf (stderr, "Parsing completed\n");
+ AcpiDmGetExternalsFromFile ();
return (AE_OK);
}
diff --git a/src/acpica/source/common/adwalk.c b/src/acpica/source/common/adwalk.c
index fe07c07..92cec74 100644
--- a/src/acpica/source/common/adwalk.c
+++ b/src/acpica/source/common/adwalk.c
@@ -207,6 +207,7 @@ AcpiDmDumpTree (
Info.Count = 0;
Info.Level = 0;
Info.WalkState = NULL;
+
AcpiDmWalkParseTree (Origin, AcpiDmDumpDescending, NULL, &Info);
AcpiOsPrintf ("*/\n\n");
}
@@ -240,6 +241,7 @@ AcpiDmFindOrphanMethods (
Info.Flags = 0;
Info.Level = 0;
Info.WalkState = NULL;
+
AcpiDmWalkParseTree (Origin, AcpiDmFindOrphanDescending, NULL, &Info);
}
@@ -283,7 +285,8 @@ AcpiDmFinishNamespaceLoad (
return;
}
- Status = AcpiDsScopeStackPush (NamespaceRoot, NamespaceRoot->Type, WalkState);
+ Status = AcpiDsScopeStackPush (NamespaceRoot, NamespaceRoot->Type,
+ WalkState);
if (ACPI_FAILURE (Status))
{
return;
@@ -292,6 +295,7 @@ AcpiDmFinishNamespaceLoad (
Info.Flags = 0;
Info.Level = 0;
Info.WalkState = WalkState;
+
AcpiDmWalkParseTree (ParseTreeRoot, AcpiDmLoadDescendingOp,
AcpiDmCommonAscendingOp, &Info);
ACPI_FREE (WalkState);
@@ -336,7 +340,8 @@ AcpiDmCrossReferenceNamespace (
return;
}
- Status = AcpiDsScopeStackPush (NamespaceRoot, NamespaceRoot->Type, WalkState);
+ Status = AcpiDsScopeStackPush (NamespaceRoot, NamespaceRoot->Type,
+ WalkState);
if (ACPI_FAILURE (Status))
{
return;
@@ -345,6 +350,7 @@ AcpiDmCrossReferenceNamespace (
Info.Flags = 0;
Info.Level = 0;
Info.WalkState = WalkState;
+
AcpiDmWalkParseTree (ParseTreeRoot, AcpiDmXrefDescendingOp,
AcpiDmCommonAscendingOp, &Info);
ACPI_FREE (WalkState);
@@ -389,7 +395,8 @@ AcpiDmConvertResourceIndexes (
return;
}
- Status = AcpiDsScopeStackPush (NamespaceRoot, NamespaceRoot->Type, WalkState);
+ Status = AcpiDsScopeStackPush (NamespaceRoot, NamespaceRoot->Type,
+ WalkState);
if (ACPI_FAILURE (Status))
{
return;
@@ -398,6 +405,7 @@ AcpiDmConvertResourceIndexes (
Info.Flags = 0;
Info.Level = 0;
Info.WalkState = WalkState;
+
AcpiDmWalkParseTree (ParseTreeRoot, AcpiDmResourceDescendingOp,
AcpiDmCommonAscendingOp, &Info);
ACPI_FREE (WalkState);
@@ -468,7 +476,7 @@ AcpiDmDumpDescending (
if (Op->Common.Value.String)
{
AcpiNsExternalizeName (ACPI_UINT32_MAX, Op->Common.Value.String,
- NULL, &Path);
+ NULL, &Path);
AcpiOsPrintf ("%s %p", Path, Op->Common.Node);
ACPI_FREE (Path);
}
@@ -727,6 +735,7 @@ AcpiDmLoadDescendingOp (
{
NextOp = NextOp->Common.Next;
}
+
Path = NextOp->Common.Value.String;
}
@@ -738,8 +747,8 @@ AcpiDmLoadDescendingOp (
/* Insert the name into the namespace */
Status = AcpiNsLookup (WalkState->ScopeInfo, Path, ObjectType,
- ACPI_IMODE_LOAD_PASS2, ACPI_NS_DONT_OPEN_SCOPE,
- WalkState, &Node);
+ ACPI_IMODE_LOAD_PASS2, ACPI_NS_DONT_OPEN_SCOPE,
+ WalkState, &Node);
Op->Common.Node = Node;
@@ -780,7 +789,8 @@ Exit:
{
if (Op->Common.Node)
{
- Status = AcpiDsScopeStackPush (Op->Common.Node, ObjectType, WalkState);
+ Status = AcpiDsScopeStackPush (Op->Common.Node, ObjectType,
+ WalkState);
if (ACPI_FAILURE (Status))
{
return (Status);
@@ -897,8 +907,8 @@ AcpiDmXrefDescendingOp (
*/
Node = NULL;
Status = AcpiNsLookup (WalkState->ScopeInfo, Path, ACPI_TYPE_ANY,
- ACPI_IMODE_EXECUTE, ACPI_NS_SEARCH_PARENT | ACPI_NS_DONT_OPEN_SCOPE,
- WalkState, &Node);
+ ACPI_IMODE_EXECUTE, ACPI_NS_SEARCH_PARENT | ACPI_NS_DONT_OPEN_SCOPE,
+ WalkState, &Node);
if (ACPI_SUCCESS (Status) && (Node->Flags & ANOBJ_IS_EXTERNAL))
{
/* Node was created by an External() statement */
@@ -980,7 +990,8 @@ Exit:
{
if (Op->Common.Node)
{
- Status = AcpiDsScopeStackPush (Op->Common.Node, ObjectType, WalkState);
+ Status = AcpiDsScopeStackPush (Op->Common.Node, ObjectType,
+ WalkState);
if (ACPI_FAILURE (Status))
{
return (Status);
@@ -1028,7 +1039,8 @@ AcpiDmResourceDescendingOp (
if (Op->Common.Node)
{
- Status = AcpiDsScopeStackPush (Op->Common.Node, ObjectType, WalkState);
+ Status = AcpiDsScopeStackPush (Op->Common.Node, ObjectType,
+ WalkState);
if (ACPI_FAILURE (Status))
{
return (Status);
diff --git a/src/acpica/source/common/ahuuids.c b/src/acpica/source/common/ahuuids.c
index 118473d..499dbb4 100644
--- a/src/acpica/source/common/ahuuids.c
+++ b/src/acpica/source/common/ahuuids.c
@@ -120,6 +120,7 @@
#define _COMPONENT ACPI_UTILITIES
ACPI_MODULE_NAME ("ahuuids")
+
/*
* Table of "known" (ACPI-related) UUIDs
*/
diff --git a/src/acpica/source/common/dmextern.c b/src/acpica/source/common/dmextern.c
index 832379e..7335168 100644
--- a/src/acpica/source/common/dmextern.c
+++ b/src/acpica/source/common/dmextern.c
@@ -212,7 +212,6 @@ AcpiDmGetObjectTypeName (
{
Type = ACPI_TYPE_DEVICE;
}
-
else if (Type > ACPI_TYPE_LOCAL_INDEX_FIELD)
{
return ("");
@@ -482,6 +481,7 @@ AcpiDmGetExternalsFromFile (
{
continue;
}
+
if (strcmp (Token, "External"))
{
continue;
@@ -519,6 +519,7 @@ AcpiDmGetExternalsFromFile (
fprintf (stderr, "Invalid argument count (%s)\n", Token);
continue;
}
+
if (ArgCount > 7)
{
fprintf (stderr, "Invalid argument count (%u)\n", ArgCount);
@@ -537,7 +538,8 @@ AcpiDmGetExternalsFromFile (
if (!ImportCount)
{
- fprintf (stderr, "Did not find any external methods in reference file \"%s\"\n",
+ fprintf (stderr,
+ "Did not find any external methods in reference file \"%s\"\n",
Gbl_ExternalRefFilename);
}
else
@@ -887,7 +889,8 @@ AcpiDmCreateNewExternal (
(Value > 0))
{
ACPI_ERROR ((AE_INFO,
- "External method arg count mismatch %s: Current %u, attempted %u",
+ "External method arg count mismatch %s: "
+ "Current %u, attempted %u",
NextExternal->Path, NextExternal->Value, Value));
}
@@ -989,9 +992,9 @@ AcpiDmAddExternalsToNamespace (
/* Add the external name (object) into the namespace */
Status = AcpiNsLookup (NULL, External->InternalPath, External->Type,
- ACPI_IMODE_LOAD_PASS1,
- ACPI_NS_ERROR_IF_FOUND | ACPI_NS_EXTERNAL | ACPI_NS_DONT_OPEN_SCOPE,
- NULL, &Node);
+ ACPI_IMODE_LOAD_PASS1,
+ ACPI_NS_ERROR_IF_FOUND | ACPI_NS_EXTERNAL | ACPI_NS_DONT_OPEN_SCOPE,
+ NULL, &Node);
if (ACPI_FAILURE (Status))
{
diff --git a/src/acpica/source/common/dmrestag.c b/src/acpica/source/common/dmrestag.c
index 5041f88..c87a025 100644
--- a/src/acpica/source/common/dmrestag.c
+++ b/src/acpica/source/common/dmrestag.c
@@ -570,9 +570,9 @@ AcpiDmCheckResourceReference (
/* Lookup the buffer in the namespace */
Status = AcpiNsLookup (WalkState->ScopeInfo,
- BufferNameOp->Common.Value.String, ACPI_TYPE_BUFFER,
- ACPI_IMODE_EXECUTE, ACPI_NS_SEARCH_PARENT, WalkState,
- &BufferNode);
+ BufferNameOp->Common.Value.String, ACPI_TYPE_BUFFER,
+ ACPI_IMODE_EXECUTE, ACPI_NS_SEARCH_PARENT, WalkState,
+ &BufferNode);
if (ACPI_FAILURE (Status))
{
return;
@@ -693,8 +693,8 @@ AcpiGetTagPathname (
/* Get the individual resource descriptor and validate it */
- Aml = ACPI_CAST_PTR (AML_RESOURCE,
- &Op->Named.Data[ResourceNode->Value]);
+ Aml = ACPI_CAST_PTR (
+ AML_RESOURCE, &Op->Named.Data[ResourceNode->Value]);
Status = AcpiUtValidateResource (NULL, Aml, &ResourceTableIndex);
if (ACPI_FAILURE (Status))
@@ -735,7 +735,7 @@ AcpiGetTagPathname (
}
(void) AcpiNsBuildNormalizedPath (BufferNode, Pathname,
- RequiredSize, FALSE);
+ RequiredSize, FALSE);
/*
* Create the full path to the resource and tag by: remove the buffer name,
@@ -814,6 +814,7 @@ AcpiDmUpdateResourceName (
{
AcpiGbl_NextResourceId = 0;
AcpiGbl_NextPrefix++;
+
if (AcpiGbl_NextPrefix > ACPI_NUM_RES_PREFIX)
{
AcpiGbl_NextPrefix = 0;
@@ -1100,9 +1101,9 @@ AcpiDmAddResourceToNamespace (
ScopeInfo.Scope.Node = ACPI_CAST_PTR (ACPI_NAMESPACE_NODE, Context);
Status = AcpiNsLookup (&ScopeInfo, "_TMP", ACPI_TYPE_LOCAL_RESOURCE,
- ACPI_IMODE_LOAD_PASS2,
- ACPI_NS_NO_UPSEARCH | ACPI_NS_DONT_OPEN_SCOPE | ACPI_NS_PREFIX_IS_SCOPE,
- NULL, &Node);
+ ACPI_IMODE_LOAD_PASS2,
+ ACPI_NS_NO_UPSEARCH | ACPI_NS_DONT_OPEN_SCOPE | ACPI_NS_PREFIX_IS_SCOPE,
+ NULL, &Node);
if (ACPI_FAILURE (Status))
{
return (AE_OK);
diff --git a/src/acpica/source/common/dmtable.c b/src/acpica/source/common/dmtable.c
index c301da1..35e01f3 100644
--- a/src/acpica/source/common/dmtable.c
+++ b/src/acpica/source/common/dmtable.c
@@ -947,6 +947,7 @@ AcpiDmDumpTable (
AcpiOsPrintf ("\n");
LastOutputBlankLine = TRUE;
}
+
ByteLength = sizeof (ACPI_GENERIC_ADDRESS);
break;
@@ -957,6 +958,7 @@ AcpiDmDumpTable (
AcpiOsPrintf ("\n");
LastOutputBlankLine = TRUE;
}
+
ByteLength = sizeof (ACPI_HEST_NOTIFY);
break;
@@ -966,6 +968,7 @@ AcpiDmDumpTable (
{
LastOutputBlankLine = FALSE;
}
+
ByteLength = sizeof (ACPI_IORT_MEMORY_ACCESS);
break;
@@ -1099,6 +1102,7 @@ AcpiDmDumpTable (
}
}
}
+
AcpiOsPrintf ("\n");
break;
@@ -1122,6 +1126,7 @@ AcpiDmDumpTable (
AcpiDmCheckAscii (Target, RepairedName, 4);
AcpiOsPrintf ("\"%.4s\" ", RepairedName);
+
TableData = AcpiAhGetTableInfo (ACPI_CAST_PTR (char, Target));
if (TableData)
{
@@ -1167,6 +1172,7 @@ AcpiDmDumpTable (
AcpiOsPrintf (
" /* Incorrect checksum, should be %2.2X */", Temp8);
}
+
AcpiOsPrintf ("\n");
break;
diff --git a/src/acpica/source/common/dmtables.c b/src/acpica/source/common/dmtables.c
new file mode 100644
index 0000000..4ec8470
--- /dev/null
+++ b/src/acpica/source/common/dmtables.c
@@ -0,0 +1,571 @@
+/******************************************************************************
+ *
+ * Module Name: dmtables - disassembler ACPI table support
+ *
+ *****************************************************************************/
+
+/******************************************************************************
+ *
+ * 1. Copyright Notice
+ *
+ * Some or all of this work - Copyright (c) 1999 - 2015, 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"
+#include "acdispat.h"
+#include "acnamesp.h"
+#include "actables.h"
+#include "acparser.h"
+
+#include <stdio.h>
+#include <time.h>
+
+#define _COMPONENT ACPI_TOOLS
+ ACPI_MODULE_NAME ("dmtables")
+
+
+/* Local prototypes */
+
+static void
+AdCreateTableHeader (
+ char *Filename,
+ ACPI_TABLE_HEADER *Table);
+
+static ACPI_STATUS
+AdStoreTable (
+ ACPI_TABLE_HEADER *Table,
+ UINT32 *TableIndex);
+
+
+extern ACPI_TABLE_DESC LocalTables[1];
+extern ACPI_PARSE_OBJECT *AcpiGbl_ParseOpRoot;
+
+
+/******************************************************************************
+ *
+ * FUNCTION: AdDisassemblerHeader
+ *
+ * PARAMETERS: Filename - Input file for the table
+ * TableType - Either AML or DataTable
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Create the disassembler header, including ACPICA signon with
+ * current time and date.
+ *
+ *****************************************************************************/
+
+void
+AdDisassemblerHeader (
+ char *Filename,
+ UINT8 TableType)
+{
+ time_t Timer;
+
+
+ time (&Timer);
+
+ /* Header and input table info */
+
+ AcpiOsPrintf ("/*\n");
+ AcpiOsPrintf (ACPI_COMMON_HEADER (AML_DISASSEMBLER_NAME, " * "));
+
+ if (TableType == ACPI_IS_AML_TABLE)
+ {
+ if (AcpiGbl_CstyleDisassembly)
+ {
+ AcpiOsPrintf (
+ " * Disassembling to symbolic ASL+ operators\n"
+ " *\n");
+ }
+ else
+ {
+ AcpiOsPrintf (
+ " * Disassembling to non-symbolic legacy ASL operators\n"
+ " *\n");
+ }
+ }
+
+ AcpiOsPrintf (" * Disassembly of %s, %s", Filename, ctime (&Timer));
+ AcpiOsPrintf (" *\n");
+}
+
+
+/******************************************************************************
+ *
+ * FUNCTION: AdCreateTableHeader
+ *
+ * PARAMETERS: Filename - Input file for the table
+ * Table - Pointer to the raw table
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Create the ASL table header, including ACPICA signon with
+ * current time and date.
+ *
+ *****************************************************************************/
+
+static void
+AdCreateTableHeader (
+ char *Filename,
+ ACPI_TABLE_HEADER *Table)
+{
+ char *NewFilename;
+ UINT8 Checksum;
+
+
+ /*
+ * Print file header and dump original table header
+ */
+ AdDisassemblerHeader (Filename, ACPI_IS_AML_TABLE);
+
+ AcpiOsPrintf (" * Original Table Header:\n");
+ AcpiOsPrintf (" * Signature \"%4.4s\"\n", Table->Signature);
+ AcpiOsPrintf (" * Length 0x%8.8X (%u)\n", Table->Length, Table->Length);
+
+ /* Print and validate the revision */
+
+ AcpiOsPrintf (" * Revision 0x%2.2X", Table->Revision);
+
+ switch (Table->Revision)
+ {
+ case 0:
+
+ AcpiOsPrintf (" **** Invalid Revision");
+ break;
+
+ case 1:
+
+ /* Revision of DSDT controls the ACPI integer width */
+
+ if (ACPI_COMPARE_NAME (Table->Signature, ACPI_SIG_DSDT))
+ {
+ AcpiOsPrintf (" **** 32-bit table (V1), no 64-bit math support");
+ }
+ break;
+
+ default:
+
+ break;
+ }
+ AcpiOsPrintf ("\n");
+
+ /* Print and validate the table checksum */
+
+ AcpiOsPrintf (" * Checksum 0x%2.2X", Table->Checksum);
+
+ Checksum = AcpiTbChecksum (ACPI_CAST_PTR (UINT8, Table), Table->Length);
+ if (Checksum)
+ {
+ AcpiOsPrintf (" **** Incorrect checksum, should be 0x%2.2X",
+ (UINT8) (Table->Checksum - Checksum));
+ }
+
+ AcpiOsPrintf ("\n");
+ AcpiOsPrintf (" * OEM ID \"%.6s\"\n", Table->OemId);
+ AcpiOsPrintf (" * OEM Table ID \"%.8s\"\n", Table->OemTableId);
+ AcpiOsPrintf (" * OEM Revision 0x%8.8X (%u)\n", Table->OemRevision, Table->OemRevision);
+ AcpiOsPrintf (" * Compiler ID \"%.4s\"\n", Table->AslCompilerId);
+ AcpiOsPrintf (" * Compiler Version 0x%8.8X (%u)\n", Table->AslCompilerRevision, Table->AslCompilerRevision);
+ AcpiOsPrintf (" */\n");
+
+ /* Create AML output filename based on input filename */
+
+ if (Filename)
+ {
+ NewFilename = FlGenerateFilename (Filename, "aml");
+ }
+ else
+ {
+ NewFilename = UtStringCacheCalloc (9);
+ if (NewFilename)
+ {
+ strncat (NewFilename, Table->Signature, 4);
+ strcat (NewFilename, ".aml");
+ }
+ }
+
+ if (!NewFilename)
+ {
+ AcpiOsPrintf (" **** Could not generate AML output filename\n");
+ return;
+ }
+
+ /* Open the ASL definition block */
+
+ AcpiOsPrintf (
+ "DefinitionBlock (\"%s\", \"%4.4s\", %hu, \"%.6s\", \"%.8s\", 0x%8.8X)\n",
+ NewFilename, Table->Signature, Table->Revision,
+ Table->OemId, Table->OemTableId, Table->OemRevision);
+}
+
+
+/******************************************************************************
+ *
+ * FUNCTION: AdDisplayTables
+ *
+ * PARAMETERS: Filename - Input file for the table
+ * Table - Pointer to the raw table
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Display (disassemble) loaded tables and dump raw tables
+ *
+ *****************************************************************************/
+
+ACPI_STATUS
+AdDisplayTables (
+ char *Filename,
+ ACPI_TABLE_HEADER *Table)
+{
+
+
+ if (!AcpiGbl_ParseOpRoot)
+ {
+ return (AE_NOT_EXIST);
+ }
+
+ if (!AcpiGbl_DmOpt_Listing)
+ {
+ AdCreateTableHeader (Filename, Table);
+ }
+
+ AcpiDmDisassemble (NULL, AcpiGbl_ParseOpRoot, ACPI_UINT32_MAX);
+ MpEmitMappingInfo ();
+
+ if (AcpiGbl_DmOpt_Listing)
+ {
+ AcpiOsPrintf ("\n\nTable Header:\n");
+ AcpiUtDebugDumpBuffer ((UINT8 *) Table, sizeof (ACPI_TABLE_HEADER),
+ DB_BYTE_DISPLAY, ACPI_UINT32_MAX);
+
+ AcpiOsPrintf ("Table Body (Length 0x%X)\n", Table->Length);
+ AcpiUtDebugDumpBuffer (((UINT8 *) Table + sizeof (ACPI_TABLE_HEADER)),
+ Table->Length, DB_BYTE_DISPLAY, ACPI_UINT32_MAX);
+ }
+
+ return (AE_OK);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AdStoreTable
+ *
+ * PARAMETERS: Table - Table header
+ * TableIndex - Where the table index is returned
+ *
+ * RETURN: Status and table index.
+ *
+ * DESCRIPTION: Add an ACPI table to the global table list
+ *
+ ******************************************************************************/
+
+static ACPI_STATUS
+AdStoreTable (
+ ACPI_TABLE_HEADER *Table,
+ UINT32 *TableIndex)
+{
+ ACPI_STATUS Status;
+ ACPI_TABLE_DESC *TableDesc;
+
+
+ Status = AcpiTbGetNextTableDescriptor (TableIndex, &TableDesc);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ /* Initialize added table */
+
+ AcpiTbInitTableDescriptor (TableDesc, ACPI_PTR_TO_PHYSADDR (Table),
+ ACPI_TABLE_ORIGIN_INTERNAL_VIRTUAL, Table);
+ Status = AcpiTbValidateTable (TableDesc);
+ return (Status);
+}
+
+
+/******************************************************************************
+ *
+ * FUNCTION: AdGetLocalTables
+ *
+ * PARAMETERS: None
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Get the ACPI tables from either memory or a file
+ *
+ *****************************************************************************/
+
+ACPI_STATUS
+AdGetLocalTables (
+ void)
+{
+ ACPI_STATUS Status;
+ ACPI_TABLE_HEADER TableHeader;
+ ACPI_TABLE_HEADER *NewTable;
+ UINT32 TableIndex;
+
+
+ /* Get the DSDT via table override */
+
+ ACPI_MOVE_32_TO_32 (TableHeader.Signature, ACPI_SIG_DSDT);
+ AcpiOsTableOverride (&TableHeader, &NewTable);
+ if (!NewTable)
+ {
+ fprintf (stderr, "Could not obtain DSDT\n");
+ return (AE_NO_ACPI_TABLES);
+ }
+
+ AdWriteTable (NewTable, NewTable->Length,
+ ACPI_SIG_DSDT, NewTable->OemTableId);
+
+ /* Store DSDT in the Table Manager */
+
+ Status = AdStoreTable (NewTable, &TableIndex);
+ if (ACPI_FAILURE (Status))
+ {
+ fprintf (stderr, "Could not store DSDT\n");
+ return (AE_NO_ACPI_TABLES);
+ }
+
+ return (AE_OK);
+}
+
+
+/******************************************************************************
+ *
+ * FUNCTION: AdParseTable
+ *
+ * PARAMETERS: Table - Pointer to the raw table
+ * OwnerId - Returned OwnerId of the table
+ * LoadTable - If add table to the global table list
+ * External - If this is an external table
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Parse an ACPI AML table
+ *
+ *****************************************************************************/
+
+ACPI_STATUS
+AdParseTable (
+ ACPI_TABLE_HEADER *Table,
+ ACPI_OWNER_ID *OwnerId,
+ BOOLEAN LoadTable,
+ BOOLEAN External)
+{
+ ACPI_STATUS Status = AE_OK;
+ ACPI_WALK_STATE *WalkState;
+ UINT8 *AmlStart;
+ UINT32 AmlLength;
+ UINT32 TableIndex;
+
+
+ if (!Table)
+ {
+ return (AE_NOT_EXIST);
+ }
+
+ /* Pass 1: Parse everything except control method bodies */
+
+ fprintf (stderr, "Pass 1 parse of [%4.4s]\n", (char *) Table->Signature);
+
+ AmlLength = Table->Length - sizeof (ACPI_TABLE_HEADER);
+ AmlStart = ((UINT8 *) Table + sizeof (ACPI_TABLE_HEADER));
+
+ /* Create the root object */
+
+ AcpiGbl_ParseOpRoot = AcpiPsCreateScopeOp (AmlStart);
+ if (!AcpiGbl_ParseOpRoot)
+ {
+ return (AE_NO_MEMORY);
+ }
+
+ /* Create and initialize a new walk state */
+
+ WalkState = AcpiDsCreateWalkState (0, AcpiGbl_ParseOpRoot, NULL, NULL);
+ if (!WalkState)
+ {
+ return (AE_NO_MEMORY);
+ }
+
+ Status = AcpiDsInitAmlWalk (WalkState, AcpiGbl_ParseOpRoot,
+ NULL, AmlStart, AmlLength, NULL, ACPI_IMODE_LOAD_PASS1);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ WalkState->ParseFlags &= ~ACPI_PARSE_DELETE_TREE;
+ WalkState->ParseFlags |= ACPI_PARSE_DISASSEMBLE;
+
+ Status = AcpiPsParseAml (WalkState);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ /* If LoadTable is FALSE, we are parsing the last loaded table */
+
+ TableIndex = AcpiGbl_RootTableList.CurrentTableCount - 1;
+
+ /* Pass 2 */
+
+ if (LoadTable)
+ {
+ Status = AdStoreTable (Table, &TableIndex);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+ Status = AcpiTbAllocateOwnerId (TableIndex);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+ if (OwnerId)
+ {
+ Status = AcpiTbGetOwnerId (TableIndex, OwnerId);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+ }
+ }
+
+ fprintf (stderr, "Pass 2 parse of [%4.4s]\n", (char *) Table->Signature);
+
+ Status = AcpiNsOneCompleteParse (ACPI_IMODE_LOAD_PASS2, TableIndex, NULL);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ /* No need to parse control methods of external table */
+
+ if (External)
+ {
+ return (AE_OK);
+ }
+
+ /*
+ * Pass 3: Parse control methods and link their parse trees
+ * into the main parse tree
+ */
+ fprintf (stderr,
+ "Parsing Deferred Opcodes (Methods/Buffers/Packages/Regions)\n");
+
+ Status = AcpiDmParseDeferredOps (AcpiGbl_ParseOpRoot);
+ fprintf (stderr, "\n");
+
+ /* Process Resource Templates */
+
+ AcpiDmFindResources (AcpiGbl_ParseOpRoot);
+
+ fprintf (stderr, "Parsing completed\n");
+ return (AE_OK);
+}
diff --git a/src/acpica/source/common/dmtbdump.c b/src/acpica/source/common/dmtbdump.c
index f1b5512..b22d9bd 100644
--- a/src/acpica/source/common/dmtbdump.c
+++ b/src/acpica/source/common/dmtbdump.c
@@ -250,6 +250,7 @@ AcpiDmDumpUnicode (
{
AcpiOsPrintf ("%c", Buffer[i]);
}
+
AcpiOsPrintf ("\"\n");
return;
@@ -294,7 +295,7 @@ AcpiDmDumpRsdp (
/* Validate the first checksum */
Checksum = AcpiDmGenerateChecksum (Rsdp, sizeof (ACPI_RSDP_COMMON),
- Rsdp->Checksum);
+ Rsdp->Checksum);
if (Checksum != Rsdp->Checksum)
{
AcpiOsPrintf ("/* Incorrect Checksum above, should be 0x%2.2X */\n",
@@ -315,7 +316,7 @@ AcpiDmDumpRsdp (
/* Validate the extended checksum over entire RSDP */
Checksum = AcpiDmGenerateChecksum (Rsdp, sizeof (ACPI_TABLE_RSDP),
- Rsdp->ExtendedChecksum);
+ Rsdp->ExtendedChecksum);
if (Checksum != Rsdp->ExtendedChecksum)
{
AcpiOsPrintf (
@@ -433,7 +434,8 @@ AcpiDmDumpFadt (
/* Always dump the minimum FADT revision 1 fields (ACPI 1.0) */
- Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoFadt1);
+ Status = AcpiDmDumpTable (Table->Length, 0, Table, 0,
+ AcpiDmTableInfoFadt1);
if (ACPI_FAILURE (Status))
{
return;
@@ -444,7 +446,8 @@ AcpiDmDumpFadt (
if ((Table->Length > ACPI_FADT_V1_SIZE) &&
(Table->Length <= ACPI_FADT_V2_SIZE))
{
- Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoFadt2);
+ Status = AcpiDmDumpTable (Table->Length, 0, Table, 0,
+ AcpiDmTableInfoFadt2);
if (ACPI_FAILURE (Status))
{
return;
@@ -455,7 +458,8 @@ AcpiDmDumpFadt (
else if (Table->Length > ACPI_FADT_V2_SIZE)
{
- Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoFadt3);
+ Status = AcpiDmDumpTable (Table->Length, 0, Table, 0,
+ AcpiDmTableInfoFadt3);
if (ACPI_FAILURE (Status))
{
return;
@@ -465,7 +469,8 @@ AcpiDmDumpFadt (
if (Table->Length > ACPI_FADT_V3_SIZE)
{
- Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoFadt5);
+ Status = AcpiDmDumpTable (Table->Length, 0, Table, 0,
+ AcpiDmTableInfoFadt5);
if (ACPI_FAILURE (Status))
{
return;
@@ -476,7 +481,8 @@ AcpiDmDumpFadt (
if (Table->Length > ACPI_FADT_V3_SIZE)
{
- Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoFadt6);
+ Status = AcpiDmDumpTable (Table->Length, 0, Table, 0,
+ AcpiDmTableInfoFadt6);
if (ACPI_FAILURE (Status))
{
return;
@@ -557,7 +563,8 @@ AcpiDmValidateFadtLength (
}
AcpiOsPrintf (
- "\n// ACPI Warning: FADT revision %X does not match length: found %X expected %X\n",
+ "\n// ACPI Warning: FADT revision %X does not match length: "
+ "found %X expected %X\n",
Revision, Length, ExpectedLength);
}
@@ -599,7 +606,7 @@ AcpiDmDumpAsf (
/* Common subtable header */
Status = AcpiDmDumpTable (Table->Length, Offset, SubTable,
- SubTable->Header.Length, AcpiDmTableInfoAsfHdr);
+ SubTable->Header.Length, AcpiDmTableInfoAsfHdr);
if (ACPI_FAILURE (Status))
{
return;
@@ -651,12 +658,13 @@ AcpiDmDumpAsf (
default:
- AcpiOsPrintf ("\n**** Unknown ASF subtable type 0x%X\n", SubTable->Header.Type);
+ AcpiOsPrintf ("\n**** Unknown ASF subtable type 0x%X\n",
+ SubTable->Header.Type);
return;
}
Status = AcpiDmDumpTable (Table->Length, Offset, SubTable,
- SubTable->Header.Length, InfoTable);
+ SubTable->Header.Length, InfoTable);
if (ACPI_FAILURE (Status))
{
return;
@@ -673,7 +681,7 @@ AcpiDmDumpAsf (
{
AcpiOsPrintf ("\n");
Status = AcpiDmDumpTable (Table->Length, DataOffset,
- DataTable, DataLength, DataInfoTable);
+ DataTable, DataLength, DataInfoTable);
if (ACPI_FAILURE (Status))
{
return;
@@ -696,9 +704,12 @@ AcpiDmDumpAsf (
AcpiOsPrintf ("%2.2X ", *DataTable);
DataTable++;
DataOffset++;
+
if (DataOffset > Table->Length)
{
- AcpiOsPrintf ("**** ACPI table terminates in the middle of a data structure! (ASF! table)\n");
+ AcpiOsPrintf (
+ "**** ACPI table terminates in the middle of a "
+ "data structure! (ASF! table)\n");
return;
}
}
@@ -722,7 +733,8 @@ AcpiDmDumpAsf (
}
Offset += SubTable->Header.Length;
- SubTable = ACPI_ADD_PTR (ACPI_ASF_INFO, SubTable, SubTable->Header.Length);
+ SubTable = ACPI_ADD_PTR (ACPI_ASF_INFO, SubTable,
+ SubTable->Header.Length);
}
}
@@ -765,7 +777,7 @@ AcpiDmDumpCpep (
{
AcpiOsPrintf ("\n");
Status = AcpiDmDumpTable (Length, Offset, SubTable,
- SubTable->Header.Length, AcpiDmTableInfoCpep0);
+ SubTable->Header.Length, AcpiDmTableInfoCpep0);
if (ACPI_FAILURE (Status))
{
return;
@@ -775,7 +787,7 @@ AcpiDmDumpCpep (
Offset += SubTable->Header.Length;
SubTable = ACPI_ADD_PTR (ACPI_CPEP_POLLING, SubTable,
- SubTable->Header.Length);
+ SubTable->Header.Length);
}
}
@@ -819,7 +831,7 @@ AcpiDmDumpCsrt (
AcpiOsPrintf ("\n");
Status = AcpiDmDumpTable (Length, Offset, SubTable,
- SubTable->Length, AcpiDmTableInfoCsrt0);
+ SubTable->Length, AcpiDmTableInfoCsrt0);
if (ACPI_FAILURE (Status))
{
return;
@@ -833,7 +845,7 @@ AcpiDmDumpCsrt (
AcpiOsPrintf ("\n");
Status = AcpiDmDumpTable (Length, Offset + SubOffset, SharedInfoTable,
- sizeof (ACPI_CSRT_SHARED_INFO), AcpiDmTableInfoCsrt1);
+ sizeof (ACPI_CSRT_SHARED_INFO), AcpiDmTableInfoCsrt1);
if (ACPI_FAILURE (Status))
{
return;
@@ -851,7 +863,7 @@ AcpiDmDumpCsrt (
{
AcpiOsPrintf ("\n");
Status = AcpiDmDumpTable (Length, Offset + SubOffset, SubSubTable,
- SubSubTable->Length, AcpiDmTableInfoCsrt2);
+ SubSubTable->Length, AcpiDmTableInfoCsrt2);
if (ACPI_FAILURE (Status))
{
return;
@@ -865,8 +877,8 @@ AcpiDmDumpCsrt (
if (InfoLength)
{
Status = AcpiDmDumpTable (Length,
- Offset + SubOffset + SubSubOffset, Table,
- InfoLength, AcpiDmTableInfoCsrt2a);
+ Offset + SubOffset + SubSubOffset, Table,
+ InfoLength, AcpiDmTableInfoCsrt2a);
if (ACPI_FAILURE (Status))
{
return;
@@ -878,14 +890,14 @@ AcpiDmDumpCsrt (
SubOffset += SubSubTable->Length;
SubSubTable = ACPI_ADD_PTR (ACPI_CSRT_DESCRIPTOR, SubSubTable,
- SubSubTable->Length);
+ SubSubTable->Length);
}
/* Point to next subtable */
Offset += SubTable->Length;
SubTable = ACPI_ADD_PTR (ACPI_CSRT_GROUP, SubTable,
- SubTable->Length);
+ SubTable->Length);
}
}
@@ -932,7 +944,7 @@ AcpiDmDumpDbg2 (
{
AcpiOsPrintf ("\n");
Status = AcpiDmDumpTable (Length, Offset, SubTable,
- SubTable->Length, AcpiDmTableInfoDbg2Device);
+ SubTable->Length, AcpiDmTableInfoDbg2Device);
if (ACPI_FAILURE (Status))
{
return;
@@ -948,7 +960,7 @@ AcpiDmDumpDbg2 (
Array = (UINT8 *) SubTable + ArrayOffset;
Status = AcpiDmDumpTable (Length, AbsoluteOffset, Array,
- SubTable->Length, AcpiDmTableInfoDbg2Addr);
+ SubTable->Length, AcpiDmTableInfoDbg2Addr);
if (ACPI_FAILURE (Status))
{
return;
@@ -965,7 +977,7 @@ AcpiDmDumpDbg2 (
Array = (UINT8 *) SubTable + ArrayOffset;
Status = AcpiDmDumpTable (Length, AbsoluteOffset, Array,
- SubTable->Length, AcpiDmTableInfoDbg2Size);
+ SubTable->Length, AcpiDmTableInfoDbg2Size);
if (ACPI_FAILURE (Status))
{
return;
@@ -980,7 +992,7 @@ AcpiDmDumpDbg2 (
Array = (UINT8 *) SubTable + ArrayOffset;
Status = AcpiDmDumpTable (Length, AbsoluteOffset, Array,
- SubTable->Length, AcpiDmTableInfoDbg2Name);
+ SubTable->Length, AcpiDmTableInfoDbg2Name);
if (ACPI_FAILURE (Status))
{
return;
@@ -991,8 +1003,8 @@ AcpiDmDumpDbg2 (
if (SubTable->OemDataOffset)
{
Status = AcpiDmDumpTable (Length, Offset + SubTable->OemDataOffset,
- Table, SubTable->OemDataLength,
- AcpiDmTableInfoDbg2OemData);
+ Table, SubTable->OemDataLength,
+ AcpiDmTableInfoDbg2OemData);
if (ACPI_FAILURE (Status))
{
return;
@@ -1003,7 +1015,7 @@ AcpiDmDumpDbg2 (
Offset += SubTable->Length;
SubTable = ACPI_ADD_PTR (ACPI_DBG2_DEVICE, SubTable,
- SubTable->Length);
+ SubTable->Length);
}
}
@@ -1053,11 +1065,12 @@ AcpiDmDumpDmar (
AcpiOsPrintf ("\n");
Status = AcpiDmDumpTable (Length, Offset, SubTable,
- SubTable->Length, AcpiDmTableInfoDmarHdr);
+ SubTable->Length, AcpiDmTableInfoDmarHdr);
if (ACPI_FAILURE (Status))
{
return;
}
+
AcpiOsPrintf ("\n");
switch (SubTable->Type)
@@ -1094,12 +1107,13 @@ AcpiDmDumpDmar (
default:
- AcpiOsPrintf ("\n**** Unknown DMAR subtable type 0x%X\n\n", SubTable->Type);
+ AcpiOsPrintf ("\n**** Unknown DMAR subtable type 0x%X\n\n",
+ SubTable->Type);
return;
}
Status = AcpiDmDumpTable (Length, Offset, SubTable,
- SubTable->Length, InfoTable);
+ SubTable->Length, InfoTable);
if (ACPI_FAILURE (Status))
{
return;
@@ -1121,7 +1135,7 @@ AcpiDmDumpDmar (
{
AcpiOsPrintf ("\n");
Status = AcpiDmDumpTable (Length, Offset + ScopeOffset, ScopeTable,
- ScopeTable->Length, AcpiDmTableInfoDmarScope);
+ ScopeTable->Length, AcpiDmTableInfoDmarScope);
if (ACPI_FAILURE (Status))
{
return;
@@ -1137,7 +1151,8 @@ AcpiDmDumpDmar (
while (PathOffset < ScopeTable->Length)
{
- AcpiDmLineHeader ((PathOffset + ScopeOffset + Offset), 2, "PCI Path");
+ AcpiDmLineHeader ((PathOffset + ScopeOffset + Offset), 2,
+ "PCI Path");
AcpiOsPrintf ("%2.2X,%2.2X\n", PciPath[0], PciPath[1]);
/* Point to next PCI Path entry */
@@ -1158,7 +1173,8 @@ NextSubtable:
/* Point to next subtable */
Offset += SubTable->Length;
- SubTable = ACPI_ADD_PTR (ACPI_DMAR_HEADER, SubTable, SubTable->Length);
+ SubTable = ACPI_ADD_PTR (ACPI_DMAR_HEADER, SubTable,
+ SubTable->Length);
}
}
@@ -1190,7 +1206,7 @@ AcpiDmDumpDrtm (
/* Main table */
Status = AcpiDmDumpTable (Table->Length, 0, Table, 0,
- AcpiDmTableInfoDrtm);
+ AcpiDmTableInfoDrtm);
if (ACPI_FAILURE (Status))
{
return;
@@ -1205,12 +1221,13 @@ AcpiDmDumpDrtm (
DrtmVtl = ACPI_ADD_PTR (ACPI_DRTM_VTABLE_LIST, Table, Offset);
AcpiOsPrintf ("\n");
Status = AcpiDmDumpTable (Table->Length, Offset,
- DrtmVtl, ACPI_OFFSET (ACPI_DRTM_VTABLE_LIST, ValidatedTables),
- AcpiDmTableInfoDrtm0);
+ DrtmVtl, ACPI_OFFSET (ACPI_DRTM_VTABLE_LIST, ValidatedTables),
+ AcpiDmTableInfoDrtm0);
if (ACPI_FAILURE (Status))
{
return;
}
+
Offset += ACPI_OFFSET (ACPI_DRTM_VTABLE_LIST, ValidatedTables);
/* Dump Validated table addresses */
@@ -1220,12 +1237,13 @@ AcpiDmDumpDrtm (
(DrtmVtl->ValidatedTableCount > Count))
{
Status = AcpiDmDumpTable (Table->Length, Offset,
- ACPI_ADD_PTR (void, Table, Offset), sizeof (UINT64),
- AcpiDmTableInfoDrtm0a);
+ ACPI_ADD_PTR (void, Table, Offset), sizeof (UINT64),
+ AcpiDmTableInfoDrtm0a);
if (ACPI_FAILURE (Status))
{
return;
}
+
Offset += sizeof (UINT64);
Count++;
}
@@ -1235,8 +1253,8 @@ AcpiDmDumpDrtm (
DrtmRl = ACPI_ADD_PTR (ACPI_DRTM_RESOURCE_LIST, Table, Offset);
AcpiOsPrintf ("\n");
Status = AcpiDmDumpTable (Table->Length, Offset,
- DrtmRl, ACPI_OFFSET (ACPI_DRTM_RESOURCE_LIST, Resources),
- AcpiDmTableInfoDrtm1);
+ DrtmRl, ACPI_OFFSET (ACPI_DRTM_RESOURCE_LIST, Resources),
+ AcpiDmTableInfoDrtm1);
if (ACPI_FAILURE (Status))
{
return;
@@ -1251,9 +1269,8 @@ AcpiDmDumpDrtm (
(DrtmRl->ResourceCount > Count))
{
Status = AcpiDmDumpTable (Table->Length, Offset,
- ACPI_ADD_PTR (void, Table, Offset),
- sizeof (ACPI_DRTM_RESOURCE),
- AcpiDmTableInfoDrtm1a);
+ ACPI_ADD_PTR (void, Table, Offset),
+ sizeof (ACPI_DRTM_RESOURCE), AcpiDmTableInfoDrtm1a);
if (ACPI_FAILURE (Status))
{
return;
@@ -1268,8 +1285,7 @@ AcpiDmDumpDrtm (
DrtmDps = ACPI_ADD_PTR (ACPI_DRTM_DPS_ID, Table, Offset);
AcpiOsPrintf ("\n");
(void) AcpiDmDumpTable (Table->Length, Offset,
- DrtmDps, sizeof (ACPI_DRTM_DPS_ID),
- AcpiDmTableInfoDrtm2);
+ DrtmDps, sizeof (ACPI_DRTM_DPS_ID), AcpiDmTableInfoDrtm2);
}
@@ -1311,7 +1327,7 @@ AcpiDmDumpEinj (
{
AcpiOsPrintf ("\n");
Status = AcpiDmDumpTable (Length, Offset, SubTable,
- sizeof (ACPI_WHEA_HEADER), AcpiDmTableInfoEinj0);
+ sizeof (ACPI_WHEA_HEADER), AcpiDmTableInfoEinj0);
if (ACPI_FAILURE (Status))
{
return;
@@ -1321,7 +1337,7 @@ AcpiDmDumpEinj (
Offset += sizeof (ACPI_WHEA_HEADER);
SubTable = ACPI_ADD_PTR (ACPI_WHEA_HEADER, SubTable,
- sizeof (ACPI_WHEA_HEADER));
+ sizeof (ACPI_WHEA_HEADER));
}
}
@@ -1364,7 +1380,7 @@ AcpiDmDumpErst (
{
AcpiOsPrintf ("\n");
Status = AcpiDmDumpTable (Length, Offset, SubTable,
- sizeof (ACPI_WHEA_HEADER), AcpiDmTableInfoErst0);
+ sizeof (ACPI_WHEA_HEADER), AcpiDmTableInfoErst0);
if (ACPI_FAILURE (Status))
{
return;
@@ -1374,7 +1390,7 @@ AcpiDmDumpErst (
Offset += sizeof (ACPI_WHEA_HEADER);
SubTable = ACPI_ADD_PTR (ACPI_WHEA_HEADER, SubTable,
- sizeof (ACPI_WHEA_HEADER));
+ sizeof (ACPI_WHEA_HEADER));
}
}
@@ -1414,7 +1430,7 @@ AcpiDmDumpFpdt (
AcpiOsPrintf ("\n");
Status = AcpiDmDumpTable (Length, Offset, SubTable,
- SubTable->Length, AcpiDmTableInfoFpdtHdr);
+ SubTable->Length, AcpiDmTableInfoFpdtHdr);
if (ACPI_FAILURE (Status))
{
return;
@@ -1434,7 +1450,8 @@ AcpiDmDumpFpdt (
default:
- AcpiOsPrintf ("\n**** Unknown FPDT subtable type 0x%X\n\n", SubTable->Type);
+ AcpiOsPrintf ("\n**** Unknown FPDT subtable type 0x%X\n\n",
+ SubTable->Type);
/* Attempt to continue */
@@ -1447,7 +1464,7 @@ AcpiDmDumpFpdt (
}
Status = AcpiDmDumpTable (Length, Offset, SubTable,
- SubTable->Length, InfoTable);
+ SubTable->Length, InfoTable);
if (ACPI_FAILURE (Status))
{
return;
@@ -1457,7 +1474,8 @@ NextSubTable:
/* Point to next subtable */
Offset += SubTable->Length;
- SubTable = ACPI_ADD_PTR (ACPI_FPDT_HEADER, SubTable, SubTable->Length);
+ SubTable = ACPI_ADD_PTR (ACPI_FPDT_HEADER, SubTable,
+ SubTable->Length);
}
}
@@ -1506,7 +1524,7 @@ AcpiDmDumpGtdt (
AcpiOsPrintf ("\n");
Status = AcpiDmDumpTable (Length, Offset, SubTable,
- SubTable->Length, AcpiDmTableInfoGtdtHdr);
+ SubTable->Length, AcpiDmTableInfoGtdtHdr);
if (ACPI_FAILURE (Status))
{
return;
@@ -1519,7 +1537,7 @@ AcpiDmDumpGtdt (
SubTableLength = sizeof (ACPI_GTDT_TIMER_BLOCK);
GtCount = (ACPI_CAST_PTR (ACPI_GTDT_TIMER_BLOCK,
- SubTable))->TimerCount;
+ SubTable))->TimerCount;
InfoTable = AcpiDmTableInfoGtdt0;
break;
@@ -1535,12 +1553,13 @@ AcpiDmDumpGtdt (
/* Cannot continue on unknown type - no length */
- AcpiOsPrintf ("\n**** Unknown GTDT subtable type 0x%X\n", SubTable->Type);
+ AcpiOsPrintf ("\n**** Unknown GTDT subtable type 0x%X\n",
+ SubTable->Type);
return;
}
Status = AcpiDmDumpTable (Length, Offset, SubTable,
- SubTable->Length, InfoTable);
+ SubTable->Length, InfoTable);
if (ACPI_FAILURE (Status))
{
return;
@@ -1554,14 +1573,15 @@ AcpiDmDumpGtdt (
if (GtCount)
{
- GtxTable = ACPI_ADD_PTR (ACPI_GTDT_TIMER_ENTRY, SubTable, SubTableLength);
+ GtxTable = ACPI_ADD_PTR (
+ ACPI_GTDT_TIMER_ENTRY, SubTable, SubTableLength);
SubTableLength += GtCount * sizeof (ACPI_GTDT_TIMER_ENTRY);
while (GtCount)
{
AcpiOsPrintf ("\n");
Status = AcpiDmDumpTable (Length, Offset, GtxTable,
- sizeof (ACPI_GTDT_TIMER_ENTRY), AcpiDmTableInfoGtdt0a);
+ sizeof (ACPI_GTDT_TIMER_ENTRY), AcpiDmTableInfoGtdt0a);
if (ACPI_FAILURE (Status))
{
return;
@@ -1627,7 +1647,7 @@ AcpiDmDumpHest (
InfoTable = AcpiDmTableInfoHest0;
SubTableLength = sizeof (ACPI_HEST_IA_MACHINE_CHECK);
BankCount = (ACPI_CAST_PTR (ACPI_HEST_IA_MACHINE_CHECK,
- SubTable))->NumHardwareBanks;
+ SubTable))->NumHardwareBanks;
break;
case ACPI_HEST_TYPE_IA32_CORRECTED_CHECK:
@@ -1635,7 +1655,7 @@ AcpiDmDumpHest (
InfoTable = AcpiDmTableInfoHest1;
SubTableLength = sizeof (ACPI_HEST_IA_CORRECTED);
BankCount = (ACPI_CAST_PTR (ACPI_HEST_IA_CORRECTED,
- SubTable))->NumHardwareBanks;
+ SubTable))->NumHardwareBanks;
break;
case ACPI_HEST_TYPE_IA32_NMI:
@@ -1672,13 +1692,14 @@ AcpiDmDumpHest (
/* Cannot continue on unknown type - no length */
- AcpiOsPrintf ("\n**** Unknown HEST subtable type 0x%X\n", SubTable->Type);
+ AcpiOsPrintf ("\n**** Unknown HEST subtable type 0x%X\n",
+ SubTable->Type);
return;
}
AcpiOsPrintf ("\n");
Status = AcpiDmDumpTable (Length, Offset, SubTable,
- SubTableLength, InfoTable);
+ SubTableLength, InfoTable);
if (ACPI_FAILURE (Status))
{
return;
@@ -1692,18 +1713,20 @@ AcpiDmDumpHest (
if (BankCount)
{
- BankTable = ACPI_ADD_PTR (ACPI_HEST_IA_ERROR_BANK, SubTable, SubTableLength);
+ BankTable = ACPI_ADD_PTR (ACPI_HEST_IA_ERROR_BANK, SubTable,
+ SubTableLength);
SubTableLength += BankCount * sizeof (ACPI_HEST_IA_ERROR_BANK);
while (BankCount)
{
AcpiOsPrintf ("\n");
Status = AcpiDmDumpTable (Length, Offset, BankTable,
- sizeof (ACPI_HEST_IA_ERROR_BANK), AcpiDmTableInfoHestBank);
+ sizeof (ACPI_HEST_IA_ERROR_BANK), AcpiDmTableInfoHestBank);
if (ACPI_FAILURE (Status))
{
return;
}
+
Offset += sizeof (ACPI_HEST_IA_ERROR_BANK);
BankTable++;
BankCount--;
@@ -1762,7 +1785,7 @@ AcpiDmDumpIort (
if (Iort->NodeOffset > Offset)
{
Status = AcpiDmDumpTable (Table->Length, Offset, Table,
- Iort->NodeOffset - Offset, AcpiDmTableInfoIortPad);
+ Iort->NodeOffset - Offset, AcpiDmTableInfoIortPad);
if (ACPI_FAILURE (Status))
{
return;
@@ -1778,7 +1801,7 @@ AcpiDmDumpIort (
AcpiOsPrintf ("\n");
Length = ACPI_OFFSET (ACPI_IORT_NODE, NodeData);
Status = AcpiDmDumpTable (Table->Length, Offset,
- IortNode, Length, AcpiDmTableInfoIortHdr);
+ IortNode, Length, AcpiDmTableInfoIortHdr);
if (ACPI_FAILURE (Status))
{
return;
@@ -1835,8 +1858,8 @@ AcpiDmDumpIort (
AcpiOsPrintf ("\n");
Status = AcpiDmDumpTable (Table->Length, Offset + NodeOffset,
- ACPI_ADD_PTR (ACPI_IORT_NODE, IortNode, NodeOffset),
- Length, InfoTable);
+ ACPI_ADD_PTR (ACPI_IORT_NODE, IortNode, NodeOffset),
+ Length, InfoTable);
if (ACPI_FAILURE (Status))
{
return;
@@ -1857,8 +1880,8 @@ AcpiDmDumpIort (
for (i = 0; i < IortItsGroup->ItsCount; i++)
{
Status = AcpiDmDumpTable (Table->Length, Offset + NodeOffset,
- ACPI_ADD_PTR (ACPI_IORT_NODE, IortNode, NodeOffset),
- 4, AcpiDmTableInfoIort0a);
+ ACPI_ADD_PTR (ACPI_IORT_NODE, IortNode, NodeOffset),
+ 4, AcpiDmTableInfoIort0a);
NodeOffset += 4;
}
}
@@ -1871,8 +1894,8 @@ AcpiDmDumpIort (
if (IortNode->Length > NodeOffset)
{
Status = AcpiDmDumpTable (Table->Length, Offset + NodeOffset,
- Table, IortNode->Length - NodeOffset,
- AcpiDmTableInfoIort1a);
+ Table, IortNode->Length - NodeOffset,
+ AcpiDmTableInfoIort1a);
if (ACPI_FAILURE (Status))
{
return;
@@ -1891,8 +1914,8 @@ AcpiDmDumpIort (
Length = 2 * sizeof (UINT64);
NodeOffset = IortSmmu->GlobalInterruptOffset;
Status = AcpiDmDumpTable (Table->Length, Offset + NodeOffset,
- ACPI_ADD_PTR (ACPI_IORT_NODE, IortNode, NodeOffset),
- Length, AcpiDmTableInfoIort3a);
+ ACPI_ADD_PTR (ACPI_IORT_NODE, IortNode, NodeOffset),
+ Length, AcpiDmTableInfoIort3a);
if (ACPI_FAILURE (Status))
{
return;
@@ -1902,12 +1925,13 @@ AcpiDmDumpIort (
for (i = 0; i < IortSmmu->ContextInterruptCount; i++)
{
Status = AcpiDmDumpTable (Table->Length, Offset + NodeOffset,
- ACPI_ADD_PTR (ACPI_IORT_NODE, IortNode, NodeOffset),
- 8, AcpiDmTableInfoIort3b);
+ ACPI_ADD_PTR (ACPI_IORT_NODE, IortNode, NodeOffset),
+ 8, AcpiDmTableInfoIort3b);
if (ACPI_FAILURE (Status))
{
return;
}
+
NodeOffset += 8;
}
@@ -1915,12 +1939,13 @@ AcpiDmDumpIort (
for (i = 0; i < IortSmmu->PmuInterruptCount; i++)
{
Status = AcpiDmDumpTable (Table->Length, Offset + NodeOffset,
- ACPI_ADD_PTR (ACPI_IORT_NODE, IortNode, NodeOffset),
- 8, AcpiDmTableInfoIort3c);
+ ACPI_ADD_PTR (ACPI_IORT_NODE, IortNode, NodeOffset),
+ 8, AcpiDmTableInfoIort3c);
if (ACPI_FAILURE (Status))
{
return;
}
+
NodeOffset += 8;
}
}
@@ -1939,12 +1964,13 @@ AcpiDmDumpIort (
AcpiOsPrintf ("\n");
Length = sizeof (ACPI_IORT_ID_MAPPING);
Status = AcpiDmDumpTable (Table->Length, Offset + NodeOffset,
- ACPI_ADD_PTR (ACPI_IORT_NODE, IortNode, NodeOffset),
- Length, AcpiDmTableInfoIortMap);
+ ACPI_ADD_PTR (ACPI_IORT_NODE, IortNode, NodeOffset),
+ Length, AcpiDmTableInfoIortMap);
if (ACPI_FAILURE (Status))
{
return;
}
+
NodeOffset += Length;
}
@@ -2002,7 +2028,7 @@ AcpiDmDumpIvrs (
AcpiOsPrintf ("\n");
Status = AcpiDmDumpTable (Table->Length, Offset, SubTable,
- SubTable->Length, AcpiDmTableInfoIvrsHdr);
+ SubTable->Length, AcpiDmTableInfoIvrsHdr);
if (ACPI_FAILURE (Status))
{
return;
@@ -2041,7 +2067,7 @@ AcpiDmDumpIvrs (
AcpiOsPrintf ("\n");
Status = AcpiDmDumpTable (Table->Length, Offset, SubTable,
- SubTable->Length, InfoTable);
+ SubTable->Length, InfoTable);
if (ACPI_FAILURE (Status))
{
return;
@@ -2053,7 +2079,7 @@ AcpiDmDumpIvrs (
{
EntryOffset = Offset + sizeof (ACPI_IVRS_HARDWARE);
DeviceEntry = ACPI_ADD_PTR (ACPI_IVRS_DE_HEADER, SubTable,
- sizeof (ACPI_IVRS_HARDWARE));
+ sizeof (ACPI_IVRS_HARDWARE));
while (EntryOffset < (Offset + SubTable->Length))
{
@@ -2118,7 +2144,7 @@ AcpiDmDumpIvrs (
/* Dump the Device Entry */
Status = AcpiDmDumpTable (Table->Length, EntryOffset,
- DeviceEntry, EntryLength, InfoTable);
+ DeviceEntry, EntryLength, InfoTable);
if (ACPI_FAILURE (Status))
{
return;
@@ -2126,7 +2152,7 @@ AcpiDmDumpIvrs (
EntryOffset += EntryLength;
DeviceEntry = ACPI_ADD_PTR (ACPI_IVRS_DE_HEADER, DeviceEntry,
- EntryLength);
+ EntryLength);
}
}
@@ -2174,7 +2200,7 @@ AcpiDmDumpLpit (
/* Common subtable header */
Status = AcpiDmDumpTable (Length, Offset, SubTable,
- sizeof (ACPI_LPIT_HEADER), AcpiDmTableInfoLpitHdr);
+ sizeof (ACPI_LPIT_HEADER), AcpiDmTableInfoLpitHdr);
if (ACPI_FAILURE (Status))
{
return;
@@ -2192,16 +2218,18 @@ AcpiDmDumpLpit (
/* Cannot continue on unknown type - no length */
- AcpiOsPrintf ("\n**** Unknown LPIT subtable type 0x%X\n", SubTable->Type);
+ AcpiOsPrintf ("\n**** Unknown LPIT subtable type 0x%X\n",
+ SubTable->Type);
return;
}
Status = AcpiDmDumpTable (Length, Offset, SubTable,
- SubTableLength, InfoTable);
+ SubTableLength, InfoTable);
if (ACPI_FAILURE (Status))
{
return;
}
+
AcpiOsPrintf ("\n");
/* Point to next subtable */
@@ -2253,7 +2281,7 @@ AcpiDmDumpMadt (
AcpiOsPrintf ("\n");
Status = AcpiDmDumpTable (Length, Offset, SubTable,
- SubTable->Length, AcpiDmTableInfoMadtHdr);
+ SubTable->Length, AcpiDmTableInfoMadtHdr);
if (ACPI_FAILURE (Status))
{
return;
@@ -2343,7 +2371,8 @@ AcpiDmDumpMadt (
default:
- AcpiOsPrintf ("\n**** Unknown MADT subtable type 0x%X\n\n", SubTable->Type);
+ AcpiOsPrintf ("\n**** Unknown MADT subtable type 0x%X\n\n",
+ SubTable->Type);
/* Attempt to continue */
@@ -2352,11 +2381,12 @@ AcpiDmDumpMadt (
AcpiOsPrintf ("Invalid zero length subtable\n");
return;
}
+
goto NextSubTable;
}
Status = AcpiDmDumpTable (Length, Offset, SubTable,
- SubTable->Length, InfoTable);
+ SubTable->Length, InfoTable);
if (ACPI_FAILURE (Status))
{
return;
@@ -2366,7 +2396,8 @@ NextSubTable:
/* Point to next subtable */
Offset += SubTable->Length;
- SubTable = ACPI_ADD_PTR (ACPI_SUBTABLE_HEADER, SubTable, SubTable->Length);
+ SubTable = ACPI_ADD_PTR (ACPI_SUBTABLE_HEADER, SubTable,
+ SubTable->Length);
}
}
@@ -2414,7 +2445,7 @@ AcpiDmDumpMcfg (
AcpiOsPrintf ("\n");
Status = AcpiDmDumpTable (Table->Length, Offset, SubTable,
- sizeof (ACPI_MCFG_ALLOCATION), AcpiDmTableInfoMcfg0);
+ sizeof (ACPI_MCFG_ALLOCATION), AcpiDmTableInfoMcfg0);
if (ACPI_FAILURE (Status))
{
return;
@@ -2424,7 +2455,7 @@ AcpiDmDumpMcfg (
Offset += sizeof (ACPI_MCFG_ALLOCATION);
SubTable = ACPI_ADD_PTR (ACPI_MCFG_ALLOCATION, SubTable,
- sizeof (ACPI_MCFG_ALLOCATION));
+ sizeof (ACPI_MCFG_ALLOCATION));
}
}
@@ -2474,7 +2505,7 @@ AcpiDmDumpMpst (
{
AcpiOsPrintf ("\n");
Status = AcpiDmDumpTable (Table->Length, Offset, SubTable0,
- sizeof (ACPI_MPST_POWER_NODE), AcpiDmTableInfoMpst0);
+ sizeof (ACPI_MPST_POWER_NODE), AcpiDmTableInfoMpst0);
if (ACPI_FAILURE (Status))
{
return;
@@ -2495,7 +2526,7 @@ AcpiDmDumpMpst (
{
AcpiOsPrintf ("\n");
Status = AcpiDmDumpTable (Table->Length, Offset, SubTable0A,
- sizeof (ACPI_MPST_POWER_STATE), AcpiDmTableInfoMpst0A);
+ sizeof (ACPI_MPST_POWER_STATE), AcpiDmTableInfoMpst0A);
if (ACPI_FAILURE (Status))
{
return;
@@ -2518,7 +2549,7 @@ AcpiDmDumpMpst (
while (ComponentCount)
{
Status = AcpiDmDumpTable (Table->Length, Offset, SubTable0B,
- sizeof (ACPI_MPST_COMPONENT), AcpiDmTableInfoMpst0B);
+ sizeof (ACPI_MPST_COMPONENT), AcpiDmTableInfoMpst0B);
if (ACPI_FAILURE (Status))
{
return;
@@ -2543,7 +2574,7 @@ AcpiDmDumpMpst (
AcpiOsPrintf ("\n");
SubTable1 = ACPI_CAST_PTR (ACPI_MPST_DATA_HDR, SubTable0);
Status = AcpiDmDumpTable (Table->Length, Offset, SubTable1,
- sizeof (ACPI_MPST_DATA_HDR), AcpiDmTableInfoMpst1);
+ sizeof (ACPI_MPST_DATA_HDR), AcpiDmTableInfoMpst1);
if (ACPI_FAILURE (Status))
{
return;
@@ -2554,13 +2585,14 @@ AcpiDmDumpMpst (
/* Subtable: Memory Power State Characteristics structure(s) */
- SubTable2 = ACPI_ADD_PTR (ACPI_MPST_POWER_DATA, SubTable1, sizeof (ACPI_MPST_DATA_HDR));
+ SubTable2 = ACPI_ADD_PTR (ACPI_MPST_POWER_DATA, SubTable1,
+ sizeof (ACPI_MPST_DATA_HDR));
while ((Offset < Table->Length) && SubtableCount)
{
AcpiOsPrintf ("\n");
Status = AcpiDmDumpTable (Table->Length, Offset, SubTable2,
- sizeof (ACPI_MPST_POWER_DATA), AcpiDmTableInfoMpst2);
+ sizeof (ACPI_MPST_POWER_DATA), AcpiDmTableInfoMpst2);
if (ACPI_FAILURE (Status))
{
return;
@@ -2611,7 +2643,7 @@ AcpiDmDumpMsct (
AcpiOsPrintf ("\n");
Status = AcpiDmDumpTable (Table->Length, Offset, SubTable,
- sizeof (ACPI_MSCT_PROXIMITY), AcpiDmTableInfoMsct0);
+ sizeof (ACPI_MSCT_PROXIMITY), AcpiDmTableInfoMsct0);
if (ACPI_FAILURE (Status))
{
return;
@@ -2620,7 +2652,8 @@ AcpiDmDumpMsct (
/* Point to next subtable */
Offset += sizeof (ACPI_MSCT_PROXIMITY);
- SubTable = ACPI_ADD_PTR (ACPI_MSCT_PROXIMITY, SubTable, sizeof (ACPI_MSCT_PROXIMITY));
+ SubTable = ACPI_ADD_PTR (ACPI_MSCT_PROXIMITY, SubTable,
+ sizeof (ACPI_MSCT_PROXIMITY));
}
}
@@ -2663,7 +2696,7 @@ AcpiDmDumpMtmr (
AcpiOsPrintf ("\n");
Status = AcpiDmDumpTable (Table->Length, Offset, SubTable,
- sizeof (ACPI_MTMR_ENTRY), AcpiDmTableInfoMtmr0);
+ sizeof (ACPI_MTMR_ENTRY), AcpiDmTableInfoMtmr0);
if (ACPI_FAILURE (Status))
{
return;
@@ -2672,7 +2705,8 @@ AcpiDmDumpMtmr (
/* Point to next subtable */
Offset += sizeof (ACPI_MTMR_ENTRY);
- SubTable = ACPI_ADD_PTR (ACPI_MTMR_ENTRY, SubTable, sizeof (ACPI_MTMR_ENTRY));
+ SubTable = ACPI_ADD_PTR (ACPI_MTMR_ENTRY, SubTable,
+ sizeof (ACPI_MTMR_ENTRY));
}
}
@@ -2722,7 +2756,7 @@ AcpiDmDumpNfit (
AcpiOsPrintf ("\n");
Status = AcpiDmDumpTable (Table->Length, Offset, SubTable,
- SubTable->Length, AcpiDmTableInfoNfitHdr);
+ SubTable->Length, AcpiDmTableInfoNfitHdr);
if (ACPI_FAILURE (Status))
{
return;
@@ -2775,7 +2809,8 @@ AcpiDmDumpNfit (
break;
default:
- AcpiOsPrintf ("\n**** Unknown NFIT subtable type 0x%X\n", SubTable->Type);
+ AcpiOsPrintf ("\n**** Unknown NFIT subtable type 0x%X\n",
+ SubTable->Type);
/* Attempt to continue */
@@ -2789,7 +2824,7 @@ AcpiDmDumpNfit (
AcpiOsPrintf ("\n");
Status = AcpiDmDumpTable (Table->Length, Offset, SubTable,
- SubTable->Length, InfoTable);
+ SubTable->Length, InfoTable);
if (ACPI_FAILURE (Status))
{
return;
@@ -2804,8 +2839,8 @@ AcpiDmDumpNfit (
for (i = 0; i < Interleave->LineCount; i++)
{
Status = AcpiDmDumpTable (Table->Length, Offset + FieldOffset,
- &Interleave->LineOffset[i],
- sizeof (UINT32), AcpiDmTableInfoNfit2a);
+ &Interleave->LineOffset[i],
+ sizeof (UINT32), AcpiDmTableInfoNfit2a);
if (ACPI_FAILURE (Status))
{
return;
@@ -2817,13 +2852,15 @@ AcpiDmDumpNfit (
case ACPI_NFIT_TYPE_SMBIOS:
- Length = SubTable->Length - sizeof (ACPI_NFIT_SMBIOS) + sizeof (UINT8);
+ Length = SubTable->Length -
+ sizeof (ACPI_NFIT_SMBIOS) + sizeof (UINT8);
+
if (Length)
{
Status = AcpiDmDumpTable (Table->Length,
- sizeof (ACPI_NFIT_SMBIOS) - sizeof (UINT8),
- SmbiosInfo,
- Length, AcpiDmTableInfoNfit3a);
+ sizeof (ACPI_NFIT_SMBIOS) - sizeof (UINT8),
+ SmbiosInfo,
+ Length, AcpiDmTableInfoNfit3a);
if (ACPI_FAILURE (Status))
{
return;
@@ -2837,8 +2874,8 @@ AcpiDmDumpNfit (
for (i = 0; i < Hint->HintCount; i++)
{
Status = AcpiDmDumpTable (Table->Length, Offset + FieldOffset,
- &Hint->HintAddress[i],
- sizeof (UINT64), AcpiDmTableInfoNfit6a);
+ &Hint->HintAddress[i],
+ sizeof (UINT64), AcpiDmTableInfoNfit6a);
if (ACPI_FAILURE (Status))
{
return;
@@ -2902,7 +2939,7 @@ AcpiDmDumpPcct (
AcpiOsPrintf ("\n");
Status = AcpiDmDumpTable (Length, Offset, SubTable,
- SubTable->Header.Length, AcpiDmTableInfoPcctHdr);
+ SubTable->Header.Length, AcpiDmTableInfoPcctHdr);
if (ACPI_FAILURE (Status))
{
return;
@@ -2930,7 +2967,7 @@ AcpiDmDumpPcct (
AcpiOsPrintf ("\n");
Status = AcpiDmDumpTable (Length, Offset, SubTable,
- SubTable->Header.Length, InfoTable);
+ SubTable->Header.Length, InfoTable);
if (ACPI_FAILURE (Status))
{
return;
@@ -2940,7 +2977,7 @@ AcpiDmDumpPcct (
Offset += SubTable->Header.Length;
SubTable = ACPI_ADD_PTR (ACPI_PCCT_SUBSPACE, SubTable,
- SubTable->Header.Length);
+ SubTable->Header.Length);
}
}
@@ -2992,7 +3029,7 @@ AcpiDmDumpPmtt (
AcpiOsPrintf ("\n");
Status = AcpiDmDumpTable (Length, Offset, SubTable,
- SubTable->Length, AcpiDmTableInfoPmttHdr);
+ SubTable->Length, AcpiDmTableInfoPmttHdr);
if (ACPI_FAILURE (Status))
{
return;
@@ -3011,7 +3048,7 @@ AcpiDmDumpPmtt (
/* Dump the fixed-length portion of the subtable */
Status = AcpiDmDumpTable (Length, Offset, SubTable,
- SubTable->Length, AcpiDmTableInfoPmtt0);
+ SubTable->Length, AcpiDmTableInfoPmtt0);
if (ACPI_FAILURE (Status))
{
return;
@@ -3030,8 +3067,8 @@ AcpiDmDumpPmtt (
AcpiOsPrintf ("\n");
Status = AcpiDmDumpTable (Length,
- Offset + MemOffset, MemSubTable,
- MemSubTable->Length, AcpiDmTableInfoPmttHdr);
+ Offset + MemOffset, MemSubTable,
+ MemSubTable->Length, AcpiDmTableInfoPmttHdr);
if (ACPI_FAILURE (Status))
{
return;
@@ -3050,8 +3087,8 @@ AcpiDmDumpPmtt (
/* Dump the fixed-length portion of the controller subtable */
Status = AcpiDmDumpTable (Length,
- Offset + MemOffset, MemSubTable,
- MemSubTable->Length, AcpiDmTableInfoPmtt1);
+ Offset + MemOffset, MemSubTable,
+ MemSubTable->Length, AcpiDmTableInfoPmtt1);
if (ACPI_FAILURE (Status))
{
return;
@@ -3069,8 +3106,8 @@ AcpiDmDumpPmtt (
DomainCount)
{
Status = AcpiDmDumpTable (Length,
- Offset + MemOffset + DomainOffset, DomainArray,
- sizeof (ACPI_PMTT_DOMAIN), AcpiDmTableInfoPmtt1a);
+ Offset + MemOffset + DomainOffset, DomainArray,
+ sizeof (ACPI_PMTT_DOMAIN), AcpiDmTableInfoPmtt1a);
if (ACPI_FAILURE (Status))
{
return;
@@ -3100,8 +3137,8 @@ AcpiDmDumpPmtt (
AcpiOsPrintf ("\n");
Status = AcpiDmDumpTable (Length,
- Offset + MemOffset + DimmOffset, DimmSubTable,
- DimmSubTable->Length, AcpiDmTableInfoPmttHdr);
+ Offset + MemOffset + DimmOffset, DimmSubTable,
+ DimmSubTable->Length, AcpiDmTableInfoPmttHdr);
if (ACPI_FAILURE (Status))
{
return;
@@ -3120,8 +3157,8 @@ AcpiDmDumpPmtt (
/* Dump the fixed-length DIMM subtable */
Status = AcpiDmDumpTable (Length,
- Offset + MemOffset + DimmOffset, DimmSubTable,
- DimmSubTable->Length, AcpiDmTableInfoPmtt2);
+ Offset + MemOffset + DimmOffset, DimmSubTable,
+ DimmSubTable->Length, AcpiDmTableInfoPmtt2);
if (ACPI_FAILURE (Status))
{
return;
@@ -3188,7 +3225,7 @@ AcpiDmDumpS3pt (
AcpiOsPrintf ("\n");
Status = AcpiDmDumpTable (S3ptTable->Length, Offset, SubTable,
- SubTable->Length, AcpiDmTableInfoS3ptHdr);
+ SubTable->Length, AcpiDmTableInfoS3ptHdr);
if (ACPI_FAILURE (Status))
{
return 0;
@@ -3208,7 +3245,8 @@ AcpiDmDumpS3pt (
default:
- AcpiOsPrintf ("\n**** Unknown S3PT subtable type 0x%X\n", SubTable->Type);
+ AcpiOsPrintf ("\n**** Unknown S3PT subtable type 0x%X\n",
+ SubTable->Type);
/* Attempt to continue */
@@ -3222,7 +3260,7 @@ AcpiDmDumpS3pt (
AcpiOsPrintf ("\n");
Status = AcpiDmDumpTable (S3ptTable->Length, Offset, SubTable,
- SubTable->Length, InfoTable);
+ SubTable->Length, InfoTable);
if (ACPI_FAILURE (Status))
{
return 0;
@@ -3255,8 +3293,9 @@ void
AcpiDmDumpSlic (
ACPI_TABLE_HEADER *Table)
{
+
(void) AcpiDmDumpTable (Table->Length, sizeof (ACPI_TABLE_HEADER), Table,
- Table->Length - sizeof (*Table), AcpiDmTableInfoSlic);
+ Table->Length - sizeof (*Table), AcpiDmTableInfoSlic);
}
@@ -3309,7 +3348,8 @@ AcpiDmDumpSlit (
if (Offset >= Table->Length)
{
- AcpiOsPrintf ("\n**** Not enough room in table for all localities\n");
+ AcpiOsPrintf (
+ "\n**** Not enough room in table for all localities\n");
return;
}
@@ -3377,7 +3417,7 @@ AcpiDmDumpSrat (
AcpiOsPrintf ("\n");
Status = AcpiDmDumpTable (Table->Length, Offset, SubTable,
- SubTable->Length, AcpiDmTableInfoSratHdr);
+ SubTable->Length, AcpiDmTableInfoSratHdr);
if (ACPI_FAILURE (Status))
{
return;
@@ -3406,7 +3446,8 @@ AcpiDmDumpSrat (
break;
default:
- AcpiOsPrintf ("\n**** Unknown SRAT subtable type 0x%X\n", SubTable->Type);
+ AcpiOsPrintf ("\n**** Unknown SRAT subtable type 0x%X\n",
+ SubTable->Type);
/* Attempt to continue */
@@ -3420,7 +3461,7 @@ AcpiDmDumpSrat (
AcpiOsPrintf ("\n");
Status = AcpiDmDumpTable (Table->Length, Offset, SubTable,
- SubTable->Length, InfoTable);
+ SubTable->Length, InfoTable);
if (ACPI_FAILURE (Status))
{
return;
@@ -3430,7 +3471,8 @@ NextSubTable:
/* Point to next subtable */
Offset += SubTable->Length;
- SubTable = ACPI_ADD_PTR (ACPI_SUBTABLE_HEADER, SubTable, SubTable->Length);
+ SubTable = ACPI_ADD_PTR (ACPI_SUBTABLE_HEADER, SubTable,
+ SubTable->Length);
}
}
@@ -3594,7 +3636,7 @@ AcpiDmDumpVrtc (
AcpiOsPrintf ("\n");
Status = AcpiDmDumpTable (Table->Length, Offset, SubTable,
- sizeof (ACPI_VRTC_ENTRY), AcpiDmTableInfoVrtc0);
+ sizeof (ACPI_VRTC_ENTRY), AcpiDmTableInfoVrtc0);
if (ACPI_FAILURE (Status))
{
return;
@@ -3603,7 +3645,8 @@ AcpiDmDumpVrtc (
/* Point to next subtable */
Offset += sizeof (ACPI_VRTC_ENTRY);
- SubTable = ACPI_ADD_PTR (ACPI_VRTC_ENTRY, SubTable, sizeof (ACPI_VRTC_ENTRY));
+ SubTable = ACPI_ADD_PTR (ACPI_VRTC_ENTRY, SubTable,
+ sizeof (ACPI_VRTC_ENTRY));
}
}
@@ -3646,7 +3689,7 @@ AcpiDmDumpWdat (
AcpiOsPrintf ("\n");
Status = AcpiDmDumpTable (Table->Length, Offset, SubTable,
- sizeof (ACPI_WDAT_ENTRY), AcpiDmTableInfoWdat0);
+ sizeof (ACPI_WDAT_ENTRY), AcpiDmTableInfoWdat0);
if (ACPI_FAILURE (Status))
{
return;
@@ -3655,10 +3698,12 @@ AcpiDmDumpWdat (
/* Point to next subtable */
Offset += sizeof (ACPI_WDAT_ENTRY);
- SubTable = ACPI_ADD_PTR (ACPI_WDAT_ENTRY, SubTable, sizeof (ACPI_WDAT_ENTRY));
+ SubTable = ACPI_ADD_PTR (ACPI_WDAT_ENTRY, SubTable,
+ sizeof (ACPI_WDAT_ENTRY));
}
}
+
/*******************************************************************************
*
* FUNCTION: AcpiDmDumpWpbt
diff --git a/src/acpica/source/compiler/Makefile.am b/src/acpica/source/compiler/Makefile.am
index f0c48b1..d71068c 100644
--- a/src/acpica/source/compiler/Makefile.am
+++ b/src/acpica/source/compiler/Makefile.am
@@ -110,6 +110,8 @@ libfwtsiasl_la_SOURCES = \
dtsubtable.c \
dttemplate.c \
dttable.c \
+ dttable1.c \
+ dttable2.c \
dtutils.c \
dtexpress.c \
dtcompile.c \
@@ -207,6 +209,7 @@ libfwtsiasl_la_SOURCES = \
../common/dmextern.c \
../common/dmrestag.c \
../common/dmtable.c \
+ ../common/dmtables.c \
../common/dmtbinfo.c \
../common/dmtbdump.c \
../components/debugger/dbfileio.c \
diff --git a/src/acpica/source/compiler/aslanalyze.c b/src/acpica/source/compiler/aslanalyze.c
index dde91ba..0182605 100644
--- a/src/acpica/source/compiler/aslanalyze.c
+++ b/src/acpica/source/compiler/aslanalyze.c
@@ -211,8 +211,7 @@ AnCheckId (
Length = strlen (Op->Asl.Value.String);
if (!Length)
{
- AslError (ASL_ERROR, ASL_MSG_NULL_STRING,
- Op, NULL);
+ AslError (ASL_ERROR, ASL_MSG_NULL_STRING, Op, NULL);
return;
}
@@ -263,7 +262,7 @@ AnCheckId (
return;
}
- /* _HID Length is valid (7 or 8), now check the prefix (first 3 or 4 chars) */
+ /* _HID Length is valid (7 or 8), now check prefix (first 3 or 4 chars) */
if (Length == 7)
{
@@ -303,8 +302,8 @@ AnCheckId (
{
if (!isxdigit ((int) Op->Asl.Value.String[i]))
{
- AslError (ASL_ERROR, ASL_MSG_HID_SUFFIX,
- Op, &Op->Asl.Value.String[i]);
+ AslError (ASL_ERROR, ASL_MSG_HID_SUFFIX,
+ Op, &Op->Asl.Value.String[i]);
break;
}
}
@@ -395,7 +394,8 @@ AnCheckMethodReturnValue (
{
/* Method SOMETIMES returns a value, SOMETIMES not */
- AslError (ASL_WARNING, ASL_MSG_SOME_NO_RETVAL, Op, Op->Asl.ExternalName);
+ AslError (ASL_WARNING, ASL_MSG_SOME_NO_RETVAL,
+ Op, Op->Asl.ExternalName);
}
else if (!(ThisNodeBtype & RequiredBtypes))
{
@@ -472,12 +472,13 @@ AnIsResultUsed (
{
return (TRUE);
}
+
return (FALSE);
/* Not used if one of these is the parent */
case PARSEOP_METHOD:
- case PARSEOP_DEFINITIONBLOCK:
+ case PARSEOP_DEFINITION_BLOCK:
case PARSEOP_ELSE:
return (FALSE);
diff --git a/src/acpica/source/compiler/aslbtypes.c b/src/acpica/source/compiler/aslbtypes.c
index 96f234a..7328ad5 100644
--- a/src/acpica/source/compiler/aslbtypes.c
+++ b/src/acpica/source/compiler/aslbtypes.c
@@ -150,7 +150,6 @@ AnMapArgTypeToBtype (
switch (ArgType)
{
-
/* Simple types */
case ARGI_ANYTYPE:
@@ -293,7 +292,6 @@ AnMapEtypeToBtype (
UINT32 Etype)
{
-
if (Etype == ACPI_TYPE_ANY)
{
return (ACPI_BTYPE_OBJECTS_AND_REFS);
@@ -400,7 +398,6 @@ AnFormatBtype (
*Buffer = 0;
-
if (Btype == 0)
{
strcat (Buffer, "NoReturnValue");
@@ -415,6 +412,7 @@ AnFormatBtype (
{
strcat (Buffer, "|");
}
+
First = FALSE;
strcat (Buffer, AcpiUtGetTypeName (Type));
}
@@ -427,6 +425,7 @@ AnFormatBtype (
{
strcat (Buffer, "|");
}
+
First = FALSE;
strcat (Buffer, "Reference");
}
@@ -438,6 +437,7 @@ AnFormatBtype (
{
strcat (Buffer, "|");
}
+
First = FALSE;
strcat (Buffer, "Resource");
}
@@ -481,7 +481,8 @@ AnGetBtype (
if (!Node)
{
DbgPrint (ASL_DEBUG_OUTPUT,
- "No attached Nsnode: [%s] at line %u name [%s], ignoring typecheck\n",
+ "No attached Nsnode: [%s] at line %u name [%s], "
+ "ignoring typecheck\n",
Op->Asl.ParseOpName, Op->Asl.LineNumber,
Op->Asl.ExternalName);
return (ACPI_UINT32_MAX);
@@ -529,6 +530,7 @@ AnGetBtype (
return (ThisNodeBtype);
}
+
/*******************************************************************************
*
* FUNCTION: AnMapObjTypeToBtype
diff --git a/src/acpica/source/compiler/aslcodegen.c b/src/acpica/source/compiler/aslcodegen.c
index 1508231..864aca7 100644
--- a/src/acpica/source/compiler/aslcodegen.c
+++ b/src/acpica/source/compiler/aslcodegen.c
@@ -240,28 +240,28 @@ CgAmlWriteWalk (
}
DbgPrint (ASL_TREE_OUTPUT,
- "%08X %04X %04X %01X %04X %04X %04X %04X "
- "%08X %08X %08X %08X %08X %08X %04X %02d %02d %02d %02d %02d\n",
- /* 1 */ (UINT32) Op->Asl.Value.Integer,
- /* 2 */ Op->Asl.ParseOpcode,
- /* 3 */ Op->Asl.AmlOpcode,
- /* 4 */ Op->Asl.AmlOpcodeLength,
- /* 5 */ Op->Asl.AmlPkgLenBytes,
- /* 6 */ Op->Asl.AmlLength,
- /* 7 */ Op->Asl.AmlSubtreeLength,
- /* 8 */ Op->Asl.Parent ? Op->Asl.Parent->Asl.AmlSubtreeLength : 0,
- /* 9 */ Op,
- /* 10 */ Op->Asl.Parent,
- /* 11 */ Op->Asl.Child,
- /* 12 */ Op->Asl.Next,
- /* 13 */ Op->Asl.CompileFlags,
- /* 14 */ Op->Asl.AcpiBtype,
- /* 15 */ Op->Asl.FinalAmlLength,
- /* 16 */ Op->Asl.Column,
- /* 17 */ Op->Asl.LineNumber,
- /* 18 */ Op->Asl.EndLine,
- /* 19 */ Op->Asl.LogicalLineNumber,
- /* 20 */ Op->Asl.EndLogicalLine);
+ "%08X %04X %04X %01X %04X %04X %04X %04X "
+ "%08X %08X %08X %08X %08X %08X %04X %02d %02d %02d %02d %02d\n",
+ /* 1 */ (UINT32) Op->Asl.Value.Integer,
+ /* 2 */ Op->Asl.ParseOpcode,
+ /* 3 */ Op->Asl.AmlOpcode,
+ /* 4 */ Op->Asl.AmlOpcodeLength,
+ /* 5 */ Op->Asl.AmlPkgLenBytes,
+ /* 6 */ Op->Asl.AmlLength,
+ /* 7 */ Op->Asl.AmlSubtreeLength,
+ /* 8 */ Op->Asl.Parent ? Op->Asl.Parent->Asl.AmlSubtreeLength : 0,
+ /* 9 */ Op,
+ /* 10 */ Op->Asl.Parent,
+ /* 11 */ Op->Asl.Child,
+ /* 12 */ Op->Asl.Next,
+ /* 13 */ Op->Asl.CompileFlags,
+ /* 14 */ Op->Asl.AcpiBtype,
+ /* 15 */ Op->Asl.FinalAmlLength,
+ /* 16 */ Op->Asl.Column,
+ /* 17 */ Op->Asl.LineNumber,
+ /* 18 */ Op->Asl.EndLine,
+ /* 19 */ Op->Asl.LogicalLineNumber,
+ /* 20 */ Op->Asl.EndLogicalLine);
/* Generate the AML for this node */
@@ -346,7 +346,8 @@ CgWriteAmlOpcode (
/* These opcodes should not get here */
printf ("Found a node with an unassigned AML opcode\n");
- FlPrintFile (ASL_FILE_STDERR, "Found a node with an unassigned AML opcode\n");
+ FlPrintFile (ASL_FILE_STDERR,
+ "Found a node with an unassigned AML opcode\n");
return;
case AML_INT_RESERVEDFIELD_OP:
@@ -429,8 +430,10 @@ CgWriteAmlOpcode (
*/
PkgLen.Len >>= 4;
- /* Now we can write the remaining bytes - either 1, 2, or 3 bytes */
-
+ /*
+ * Now we can write the remaining bytes -
+ * either 1, 2, or 3 bytes
+ */
for (i = 0; i < (UINT32) (Op->Asl.AmlPkgLenBytes - 1); i++)
{
CgLocalWriteAmlData (Op, &PkgLen.LenBytes[i], 1);
@@ -539,50 +542,100 @@ CgWriteTableHeader (
/* Table length. Checksum zero for now, will rewrite later */
- TableHeader.Length = Gbl_TableLength;
+ TableHeader.Length = sizeof (ACPI_TABLE_HEADER) +
+ Op->Asl.AmlSubtreeLength;
TableHeader.Checksum = 0;
+ Op->Asl.FinalAmlOffset = ftell (Gbl_Files[ASL_FILE_AML_OUTPUT].Handle);
+
+ /* Write entire header and clear the table header global */
+
CgLocalWriteAmlData (Op, &TableHeader, sizeof (ACPI_TABLE_HEADER));
+ memset (&TableHeader, 0, sizeof (ACPI_TABLE_HEADER));
}
/*******************************************************************************
*
- * FUNCTION: CgCloseTable
+ * FUNCTION: CgUpdateHeader
*
- * PARAMETERS: None.
+ * PARAMETERS: Op - Op for the Definition Block
*
* RETURN: None.
*
* DESCRIPTION: Complete the ACPI table by calculating the checksum and
- * re-writing the header.
+ * re-writing the header for the input definition block
*
******************************************************************************/
static void
-CgCloseTable (
- void)
+CgUpdateHeader (
+ ACPI_PARSE_OBJECT *Op)
{
signed char Sum;
+ UINT32 i;
+ UINT32 Length;
UINT8 FileByte;
+ UINT8 Checksum;
- FlSeekFile (ASL_FILE_AML_OUTPUT, 0);
- Sum = 0;
+ /* Calculate the checksum over the entire definition block */
- /* Calculate the checksum over the entire file */
+ Sum = 0;
+ Length = sizeof (ACPI_TABLE_HEADER) + Op->Asl.AmlSubtreeLength;
+ FlSeekFile (ASL_FILE_AML_OUTPUT, Op->Asl.FinalAmlOffset);
- while (FlReadFile (ASL_FILE_AML_OUTPUT, &FileByte, 1) == AE_OK)
+ for (i = 0; i < Length; i++)
{
+ if (FlReadFile (ASL_FILE_AML_OUTPUT, &FileByte, 1) != AE_OK)
+ {
+ printf ("EOF while reading checksum bytes\n");
+ return;
+ }
+
Sum = (signed char) (Sum + FileByte);
}
- /* Re-write the table header with the checksum */
+ Checksum = (UINT8) (0 - Sum);
+
+ /* Re-write the the checksum byte */
- TableHeader.Checksum = (UINT8) (0 - Sum);
+ FlSeekFile (ASL_FILE_AML_OUTPUT, Op->Asl.FinalAmlOffset +
+ ACPI_OFFSET (ACPI_TABLE_HEADER, Checksum));
- FlSeekFile (ASL_FILE_AML_OUTPUT, 0);
- CgLocalWriteAmlData (NULL, &TableHeader, sizeof (ACPI_TABLE_HEADER));
+ FlWriteFile (ASL_FILE_AML_OUTPUT, &Checksum, 1);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: CgCloseTable
+ *
+ * PARAMETERS: None.
+ *
+ * RETURN: None.
+ *
+ * DESCRIPTION: Complete the ACPI table by calculating the checksum and
+ * re-writing each table header. This allows support for
+ * multiple definition blocks in a single source file.
+ *
+ ******************************************************************************/
+
+static void
+CgCloseTable (
+ void)
+{
+ ACPI_PARSE_OBJECT *Op;
+
+
+ /* Process all definition blocks */
+
+ Op = RootNode->Asl.Child;
+ while (Op)
+ {
+ CgUpdateHeader (Op);
+ Op = Op->Asl.Next;
+ }
}
@@ -658,7 +711,7 @@ CgWriteNode (
break;
- case PARSEOP_DEFINITIONBLOCK:
+ case PARSEOP_DEFINITION_BLOCK:
CgWriteTableHeader (Op);
break;
diff --git a/src/acpica/source/compiler/aslcompile.c b/src/acpica/source/compiler/aslcompile.c
index c76178c..e9575c7 100644
--- a/src/acpica/source/compiler/aslcompile.c
+++ b/src/acpica/source/compiler/aslcompile.c
@@ -202,7 +202,8 @@ CmDoCompile (
if (Gbl_SyntaxError)
{
- fprintf (stderr, "Compiler aborting due to parser-detected syntax error(s)\n");
+ fprintf (stderr,
+ "Compiler aborting due to parser-detected syntax error(s)\n");
LsDumpParseTree ();
goto ErrorExit;
}
@@ -237,7 +238,7 @@ CmDoCompile (
LsDumpParseTree ();
- OpcGetIntegerWidth (RootNode);
+ OpcGetIntegerWidth (RootNode->Asl.Child);
UtEndEvent (Event);
/* Pre-process parse tree for any operator transforms */
@@ -258,8 +259,8 @@ CmDoCompile (
/*
* Now that the input is parsed, we can open the AML output file.
- * Note: by default, the name of this file comes from the table descriptor
- * within the input file.
+ * Note: by default, the name of this file comes from the table
+ * descriptor within the input file.
*/
Event = UtBeginEvent ("Open AML output file");
Status = FlOpenAmlOutputFile (Gbl_OutputFilenamePrefix);
@@ -335,7 +336,8 @@ CmDoCompile (
/* Namespace cross-reference */
- AslGbl_NamespaceEvent = UtBeginEvent ("Cross reference parse tree and Namespace");
+ AslGbl_NamespaceEvent = UtBeginEvent (
+ "Cross reference parse tree and Namespace");
Status = XfCrossReferenceNamespace ();
if (ACPI_FAILURE (Status))
{
@@ -373,7 +375,8 @@ CmDoCompile (
/* Semantic error checking part three - operand type checking */
Event = UtBeginEvent ("Analyze AML operand types");
- DbgPrint (ASL_DEBUG_OUTPUT, "\nSemantic analysis - Operand type checking\n\n");
+ DbgPrint (ASL_DEBUG_OUTPUT,
+ "\nSemantic analysis - Operand type checking\n\n");
if (Gbl_DoTypechecking)
{
TrWalkParseTree (RootNode, ASL_WALK_VISIT_UPWARD,
@@ -662,8 +665,8 @@ CmDumpAllEvents (
{
ASL_EVENT_INFO *Event;
UINT32 Delta;
- UINT32 USec;
- UINT32 MSec;
+ UINT32 MicroSeconds;
+ UINT32 MilliSeconds;
UINT32 i;
@@ -683,23 +686,23 @@ CmDumpAllEvents (
Delta = (UINT32) (Event->EndTime - Event->StartTime);
- USec = Delta / ACPI_100NSEC_PER_USEC;
- MSec = Delta / ACPI_100NSEC_PER_MSEC;
+ MicroSeconds = Delta / ACPI_100NSEC_PER_USEC;
+ MilliSeconds = Delta / ACPI_100NSEC_PER_MSEC;
/* Round milliseconds up */
- if ((USec - (MSec * ACPI_USEC_PER_MSEC)) >= 500)
+ if ((MicroSeconds - (MilliSeconds * ACPI_USEC_PER_MSEC)) >= 500)
{
- MSec++;
+ MilliSeconds++;
}
DbgPrint (ASL_DEBUG_OUTPUT, "%8u usec %8u msec - %s\n",
- USec, MSec, Event->EventName);
+ MicroSeconds, MilliSeconds, Event->EventName);
if (Gbl_CompileTimesFlag)
{
printf ("%8u usec %8u msec - %s\n",
- USec, MSec, Event->EventName);
+ MicroSeconds, MilliSeconds, Event->EventName);
}
}
diff --git a/src/acpica/source/compiler/aslcompiler.l b/src/acpica/source/compiler/aslcompiler.l
index 0fc3535..dcfc9ab 100644
--- a/src/acpica/source/compiler/aslcompiler.l
+++ b/src/acpica/source/compiler/aslcompiler.l
@@ -282,7 +282,7 @@ NamePathTail [.]{NameSeg}
"Debug" { count (1); return (PARSEOP_DEBUG); }
"Decrement" { count (3); return (PARSEOP_DECREMENT); }
"Default" { count (3); return (PARSEOP_DEFAULT); }
-"DefinitionBlock" { count (1); return (PARSEOP_DEFINITIONBLOCK); }
+"DefinitionBlock" { count (1); return (PARSEOP_DEFINITION_BLOCK); }
"DeRefOf" { count (3); return (PARSEOP_DEREFOF); }
"Device" { count (2); return (PARSEOP_DEVICE); }
"Divide" { count (3); return (PARSEOP_DIVIDE); }
diff --git a/src/acpica/source/compiler/aslcompiler.y b/src/acpica/source/compiler/aslcompiler.y
index 20b728a..3a2b191 100644
--- a/src/acpica/source/compiler/aslcompiler.y
+++ b/src/acpica/source/compiler/aslcompiler.y
@@ -266,7 +266,7 @@ AslLocalAllocate (
%token <i> PARSEOP_DECREMENT
%token <i> PARSEOP_DEFAULT
%token <i> PARSEOP_DEFAULT_ARG
-%token <i> PARSEOP_DEFINITIONBLOCK
+%token <i> PARSEOP_DEFINITION_BLOCK
%token <i> PARSEOP_DEREFOF
%token <i> PARSEOP_DEVICE
%token <i> PARSEOP_DEVICEPOLARITY_HIGH
@@ -606,6 +606,9 @@ AslLocalAllocate (
/* PARSEOP_EXP_PAREN_OPEN */
/* PARSEOP_EXP_PAREN_CLOSE */
+
+%token <i> PARSEOP_ASL_CODE
+
/*
* Special functions. These should probably stay at the end of this
* table.
@@ -627,12 +630,13 @@ AslLocalAllocate (
*****************************************************************************/
%type <n> ArgList
-%type <n> ASLCode
+%type <n> AslCode
%type <n> BufferData
%type <n> BufferTermData
%type <n> CompilerDirective
%type <n> DataObject
%type <n> DefinitionBlockTerm
+%type <n> DefinitionBlockList
%type <n> IntegerData
%type <n> NamedObject
%type <n> NameSpaceModifier
@@ -985,11 +989,12 @@ AslLocalAllocate (
* Root term. Allow multiple #line directives before the definition block
* to handle output from preprocessors
*/
-ASLCode
- : DefinitionBlockTerm
+AslCode
+ : DefinitionBlockList {$<n>$ = TrLinkChildren (TrCreateLeafNode (PARSEOP_ASL_CODE),1, $1);}
| error {YYABORT; $$ = NULL;}
;
+
/*
* Note concerning support for "module-level code".
*
@@ -1006,7 +1011,7 @@ ASLCode
* of Type1 and Type2 opcodes at module level.
*/
DefinitionBlockTerm
- : PARSEOP_DEFINITIONBLOCK '(' {$<n>$ = TrCreateLeafNode (PARSEOP_DEFINITIONBLOCK);}
+ : PARSEOP_DEFINITION_BLOCK '(' {$<n>$ = TrCreateLeafNode (PARSEOP_DEFINITION_BLOCK);}
String ','
String ','
ByteConst ','
@@ -1017,6 +1022,12 @@ DefinitionBlockTerm
'{' TermList '}' {$$ = TrLinkChildren ($<n>3,7,$4,$6,$8,$10,$12,$14,$18);}
;
+DefinitionBlockList
+ : DefinitionBlockTerm
+ | DefinitionBlockTerm
+ DefinitionBlockList {$$ = TrLinkPeerNodes (2, $1,$2);}
+ ;
+
SuperName
: NameString {}
| ArgTerm {}
diff --git a/src/acpica/source/compiler/aslerror.c b/src/acpica/source/compiler/aslerror.c
index c9df5d8..0b2631d 100644
--- a/src/acpica/source/compiler/aslerror.c
+++ b/src/acpica/source/compiler/aslerror.c
@@ -339,8 +339,10 @@ AePrintException (
if (!Enode->SourceLine)
{
- /* Use the merged header/source file if present, otherwise use input file */
-
+ /*
+ * Use the merged header/source file if present, otherwise
+ * use input file
+ */
SourceFile = Gbl_Files[ASL_FILE_SOURCE_OUTPUT].Handle;
if (!SourceFile)
{
@@ -386,18 +388,18 @@ AePrintException (
fprintf (OutputFile, " %6u: ", Enode->LineNumber);
/*
- * If not at EOF, get the corresponding source code line and
- * display it. Don't attempt this if we have a premature EOF
- * condition.
+ * If not at EOF, get the corresponding source code line
+ * and display it. Don't attempt this if we have a
+ * premature EOF condition.
*/
if (!PrematureEOF)
{
/*
- * Seek to the offset in the combined source file, read
- * the source line, and write it to the output.
+ * Seek to the offset in the combined source file,
+ * read the source line, and write it to the output.
*/
- Actual = fseek (SourceFile, (long) Enode->LogicalByteOffset,
- (int) SEEK_SET);
+ Actual = fseek (SourceFile,
+ (long) Enode->LogicalByteOffset, (int) SEEK_SET);
if (Actual)
{
fprintf (OutputFile,
@@ -952,16 +954,17 @@ AslCoreSubsystemError (
if (Op)
{
- AslCommonError (ASL_ERROR, ASL_MSG_CORE_EXCEPTION, Op->Asl.LineNumber,
- Op->Asl.LogicalLineNumber,
- Op->Asl.LogicalByteOffset,
- Op->Asl.Column,
- Op->Asl.Filename, MsgBuffer);
+ AslCommonError (ASL_ERROR, ASL_MSG_CORE_EXCEPTION,
+ Op->Asl.LineNumber,
+ Op->Asl.LogicalLineNumber,
+ Op->Asl.LogicalByteOffset,
+ Op->Asl.Column,
+ Op->Asl.Filename, MsgBuffer);
}
else
{
- AslCommonError (ASL_ERROR, ASL_MSG_CORE_EXCEPTION, 0,
- 0, 0, 0, NULL, MsgBuffer);
+ AslCommonError (ASL_ERROR, ASL_MSG_CORE_EXCEPTION,
+ 0, 0, 0, 0, NULL, MsgBuffer);
}
if (Abort)
diff --git a/src/acpica/source/compiler/aslfileio.c b/src/acpica/source/compiler/aslfileio.c
index 9588528..7872396 100644
--- a/src/acpica/source/compiler/aslfileio.c
+++ b/src/acpica/source/compiler/aslfileio.c
@@ -142,6 +142,7 @@ FlFileError (
sprintf (MsgBuffer, "\"%s\" (%s) - %s", Gbl_Files[FileId].Filename,
Gbl_Files[FileId].Description, strerror (errno));
+
AslCommonError (ASL_ERROR, ErrorId, 0, 0, 0, 0, NULL, MsgBuffer);
}
@@ -341,7 +342,8 @@ FlPrintFile (
AslAbort ();
}
- if ((FileId == ASL_FILE_PREPROCESSOR) && Gbl_PreprocessorOutputFlag)
+ if ((FileId == ASL_FILE_PREPROCESSOR) &&
+ Gbl_PreprocessorOutputFlag)
{
/*
* Duplicate the output to the user preprocessor (.i) file,
@@ -363,7 +365,6 @@ FlPrintFile (
AslAbort ();
}
}
-
}
diff --git a/src/acpica/source/compiler/aslfiles.c b/src/acpica/source/compiler/aslfiles.c
index 234e9b4..1c1b1d8 100644
--- a/src/acpica/source/compiler/aslfiles.c
+++ b/src/acpica/source/compiler/aslfiles.c
@@ -128,7 +128,6 @@ FlOpenIncludeWithPrefix (
ACPI_PARSE_OBJECT *Op,
char *Filename);
-
#ifdef ACPI_OBSOLETE_FUNCTIONS
ACPI_STATUS
FlParseInputPathname (
@@ -334,7 +333,8 @@ FlMergePathnames (
/* Build the final merged pathname */
ConcatenatePaths:
- Pathname = UtStringCacheCalloc (strlen (CommonPath) + strlen (FilePathname) + 2);
+ Pathname = UtStringCacheCalloc (
+ strlen (CommonPath) + strlen (FilePathname) + 2);
if (LastElement && *CommonPath)
{
strcpy (Pathname, CommonPath);
@@ -494,7 +494,8 @@ FlOpenIncludeFile (
*
* Construct the file pathname from the global directory name.
*/
- IncludeFile = FlOpenIncludeWithPrefix (Gbl_DirectoryPath, Op, Op->Asl.Value.String);
+ IncludeFile = FlOpenIncludeWithPrefix (
+ Gbl_DirectoryPath, Op, Op->Asl.Value.String);
if (IncludeFile)
{
return;
@@ -507,7 +508,8 @@ FlOpenIncludeFile (
NextDir = Gbl_IncludeDirList;
while (NextDir)
{
- IncludeFile = FlOpenIncludeWithPrefix (NextDir->Dir, Op, Op->Asl.Value.String);
+ IncludeFile = FlOpenIncludeWithPrefix (
+ NextDir->Dir, Op, Op->Asl.Value.String);
if (IncludeFile)
{
return;
diff --git a/src/acpica/source/compiler/aslfold.c b/src/acpica/source/compiler/aslfold.c
index 7812907..d7a7bc1 100644
--- a/src/acpica/source/compiler/aslfold.c
+++ b/src/acpica/source/compiler/aslfold.c
@@ -172,7 +172,7 @@ TrInstallReducedConstant (
*
* RETURN: Status
*
- * DESCRIPTION: Reduce an Op and its subtree to a constant if possible
+ * DESCRIPTION: Reduce an Op and its subtree to a constant if possible.
*
******************************************************************************/
@@ -278,7 +278,8 @@ OpcAmlConstantWalk (
*
* RETURN: Status
*
- * DESCRIPTION: Check one Op for a type 3/4/5 AML opcode
+ * DESCRIPTION: Check one Op for a reducible type 3/4/5 AML opcode.
+ * This is performed via a downward walk of the parse subtree.
*
******************************************************************************/
@@ -290,6 +291,8 @@ OpcAmlCheckForConstant (
{
ACPI_WALK_STATE *WalkState = Context;
ACPI_STATUS Status = AE_OK;
+ ACPI_PARSE_OBJECT *NextOp;
+ const ACPI_OPCODE_INFO *OpInfo;
WalkState->Op = Op;
@@ -300,21 +303,6 @@ OpcAmlCheckForConstant (
Op->Asl.LogicalLineNumber, Op->Asl.ParseOpName);
/*
- * TBD: Ignore buffer constants for now. The problem is that these
- * constants have been transformed into RAW_DATA at this point, from
- * the parse tree transform process which currently happens before
- * the constant folding process. We may need to defer this transform
- * for buffer until after the constant folding.
- */
- if (WalkState->Opcode == AML_BUFFER_OP)
- {
- DbgPrint (ASL_PARSE_OUTPUT,
- "\nBuffer+Buffer->Buffer constant reduction is not supported yet");
- Status = AE_TYPE;
- goto CleanupAndExit;
- }
-
- /*
* These opcodes do not appear in the OpcodeInfo table, but
* they represent constants, so abort the constant walk now.
*/
@@ -328,11 +316,95 @@ OpcAmlCheckForConstant (
goto CleanupAndExit;
}
+ /*
+ * Search upwards for a possible Name() operator. This is done
+ * because a type 3/4/5 opcode within a Name() expression
+ * MUST be reduced to a simple constant.
+ */
+ NextOp = Op->Asl.Parent;
+ while (NextOp)
+ {
+ /* Finished if we find a Name() opcode */
+
+ if (NextOp->Asl.AmlOpcode == AML_NAME_OP)
+ {
+ break;
+ }
+
+ /*
+ * Any "deferred" opcodes contain one or more TermArg parameters,
+ * and thus are not required to be folded to constants at compile
+ * time. This affects things like Buffer() and Package() objects.
+ * We just ignore them here. However, any sub-expressions can and
+ * will still be typechecked. Note: These are called the
+ * "deferred" opcodes in the AML interpreter.
+ */
+ OpInfo = AcpiPsGetOpcodeInfo (NextOp->Common.AmlOpcode);
+ if (OpInfo->Flags & AML_DEFER)
+ {
+ NextOp = NULL;
+ break;
+ }
+
+ NextOp = NextOp->Asl.Parent;
+ }
+
/* Type 3/4/5 opcodes have the AML_CONSTANT flag set */
if (!(WalkState->OpInfo->Flags & AML_CONSTANT))
{
- /* Not 3/4/5 opcode, but maybe can convert to STORE */
+ /*
+ * From the ACPI specification:
+ *
+ * "The Type 3/4/5 opcodes return a value and can be used in an
+ * expression that evaluates to a constant. These opcodes may be
+ * evaluated at ASL compile-time. To ensure that these opcodes
+ * will evaluate to a constant, the following rules apply: The
+ * term cannot have a destination (target) operand, and must have
+ * either a Type3Opcode, Type4Opcode, Type5Opcode, ConstExprTerm,
+ * Integer, BufferTerm, Package, or String for all arguments."
+ */
+
+ /*
+ * The value (second) operand for the Name() operator MUST
+ * reduce to a single constant, as per the ACPI specification
+ * (the operand is a DataObject). This also implies that there
+ * can be no target operand. Name() is the only ASL operator
+ * with a "DataObject" as an operand and is thus special-
+ * cased here.
+ */
+ if (NextOp) /* Inspect a Name() operator */
+ {
+ /* Error if there is a target operand */
+
+ if (Op->Asl.CompileFlags & NODE_IS_TARGET)
+ {
+ AslError (ASL_ERROR, ASL_MSG_INVALID_TARGET, Op, NULL);
+ Status = AE_TYPE;
+ }
+
+ /* Error if expression cannot be reduced (folded) */
+
+ if (!(NextOp->Asl.CompileFlags & NODE_COULD_NOT_REDUCE))
+ {
+ /* Ensure only one error message per statement */
+
+ NextOp->Asl.CompileFlags |= NODE_COULD_NOT_REDUCE;
+ DbgPrint (ASL_PARSE_OUTPUT,
+ "**** Could not reduce operands for NAME opcode ****\n");
+
+ AslError (ASL_ERROR, ASL_MSG_CONSTANT_REQUIRED, Op,
+ "Constant is required for Name operator");
+ Status = AE_TYPE;
+ }
+ }
+
+ if (ACPI_FAILURE (Status))
+ {
+ goto CleanupAndExit;
+ }
+
+ /* This is not a 3/4/5 opcode, but maybe can convert to STORE */
if (Op->Asl.CompileFlags & NODE_IS_TARGET)
{
@@ -344,13 +416,36 @@ OpcAmlCheckForConstant (
/* Expression cannot be reduced */
DbgPrint (ASL_PARSE_OUTPUT,
- "**** Not a Type 3/4/5 opcode (%s) ****",
+ "**** Not a Type 3/4/5 opcode or cannot reduce/fold (%s) ****\n",
Op->Asl.ParseOpName);
Status = AE_TYPE;
goto CleanupAndExit;
}
+ /*
+ * TBD: Ignore buffer constants for now. The problem is that these
+ * constants have been transformed into RAW_DATA at this point, from
+ * the parse tree transform process which currently happens before
+ * the constant folding process. We may need to defer this transform
+ * for buffer until after the constant folding.
+ */
+ if (WalkState->Opcode == AML_BUFFER_OP)
+ {
+ DbgPrint (ASL_PARSE_OUTPUT,
+ "\nBuffer constant reduction is not supported yet\n");
+
+ if (NextOp) /* Found a Name() operator, error */
+ {
+ AslError (ASL_ERROR, ASL_MSG_UNSUPPORTED, Op,
+ "Buffer expression cannot be reduced");
+ }
+
+ Status = AE_TYPE;
+ goto CleanupAndExit;
+ }
+
+
/* Debug output */
DbgPrint (ASL_PARSE_OUTPUT, "TYPE_345");
@@ -366,6 +461,7 @@ OpcAmlCheckForConstant (
DbgPrint (ASL_PARSE_OUTPUT, "%-16s", " VALID TARGET");
}
}
+
if (Op->Asl.CompileFlags & NODE_IS_TERM_ARG)
{
DbgPrint (ASL_PARSE_OUTPUT, "%-16s", " TERMARG");
diff --git a/src/acpica/source/compiler/aslhex.c b/src/acpica/source/compiler/aslhex.c
index 39825c8..c7d53a9 100644
--- a/src/acpica/source/compiler/aslhex.c
+++ b/src/acpica/source/compiler/aslhex.c
@@ -122,7 +122,6 @@
* This module emits ASCII hex output files in either C, ASM, or ASL format
*/
-
/* Local prototypes */
static void
@@ -295,6 +294,7 @@ HxDoHexOutputC (
FlPrintFile (ASL_FILE_HEX_OUTPUT, " /* %8.8X", Offset);
LsDumpAsciiInComment (ASL_FILE_HEX_OUTPUT, LineLength, FileData);
+
FlPrintFile (ASL_FILE_HEX_OUTPUT, "%*s*/\n",
HEX_TABLE_LINE_SIZE - LineLength + 1, " ");
@@ -382,6 +382,7 @@ HxDoHexOutputAsl (
FlPrintFile (ASL_FILE_HEX_OUTPUT, " /* %8.8X", Offset);
LsDumpAsciiInComment (ASL_FILE_HEX_OUTPUT, LineLength, FileData);
+
FlPrintFile (ASL_FILE_HEX_OUTPUT, "%*s*/\n",
HEX_TABLE_LINE_SIZE - LineLength + 1, " ");
@@ -465,6 +466,7 @@ HxDoHexOutputAsm (
FlPrintFile (ASL_FILE_HEX_OUTPUT, " ; %8.8X", Offset);
LsDumpAsciiInComment (ASL_FILE_HEX_OUTPUT, LineLength, FileData);
+
FlPrintFile (ASL_FILE_HEX_OUTPUT, "\n");
Offset += LineLength;
diff --git a/src/acpica/source/compiler/asllength.c b/src/acpica/source/compiler/asllength.c
index 3fbf896..87dc874 100644
--- a/src/acpica/source/compiler/asllength.c
+++ b/src/acpica/source/compiler/asllength.c
@@ -204,10 +204,11 @@ LnPackageLengthWalk (
if ((Op->Asl.Parent) &&
(Op->Asl.ParseOpcode != PARSEOP_DEFAULT_ARG))
{
- Op->Asl.Parent->Asl.AmlSubtreeLength += (Op->Asl.AmlLength +
- Op->Asl.AmlOpcodeLength +
- Op->Asl.AmlPkgLenBytes +
- Op->Asl.AmlSubtreeLength);
+ Op->Asl.Parent->Asl.AmlSubtreeLength += (
+ Op->Asl.AmlLength +
+ Op->Asl.AmlOpcodeLength +
+ Op->Asl.AmlPkgLenBytes +
+ Op->Asl.AmlSubtreeLength);
}
return (AE_OK);
}
@@ -301,7 +302,7 @@ CgGenerateAmlOpcodeLength (
if (Op->Asl.CompileFlags & NODE_AML_PACKAGE)
{
Op->Asl.AmlPkgLenBytes = CgGetPackageLenByteCount (
- Op, Op->Asl.AmlSubtreeLength);
+ Op, Op->Asl.AmlSubtreeLength);
}
/* Data opcode lengths are easy */
@@ -404,10 +405,9 @@ CgGenerateAmlLengths (
switch (Op->Asl.ParseOpcode)
{
- case PARSEOP_DEFINITIONBLOCK:
+ case PARSEOP_DEFINITION_BLOCK:
- Gbl_TableLength = sizeof (ACPI_TABLE_HEADER) +
- Op->Asl.AmlSubtreeLength;
+ Gbl_TableLength = sizeof (ACPI_TABLE_HEADER) + Op->Asl.AmlSubtreeLength;
break;
case PARSEOP_NAMESEG:
@@ -437,7 +437,6 @@ CgGenerateAmlLengths (
Op->Asl.ExternalName = Op->Asl.Value.String;
Op->Asl.Value.String = Buffer;
Op->Asl.CompileFlags |= NODE_NAME_INTERNALIZED;
-
Op->Asl.AmlLength = strlen (Buffer);
/*
@@ -463,7 +462,7 @@ CgGenerateAmlLengths (
Op->Asl.AmlOpcodeLength = 0;
Op->Asl.AmlPkgLenBytes = CgGetPackageLenByteCount (Op,
- (UINT32) Op->Asl.Value.Integer);
+ (UINT32) Op->Asl.Value.Integer);
break;
case PARSEOP_RAW_DATA:
diff --git a/src/acpica/source/compiler/asllisting.c b/src/acpica/source/compiler/asllisting.c
index 8131cf4..6f76133 100644
--- a/src/acpica/source/compiler/asllisting.c
+++ b/src/acpica/source/compiler/asllisting.c
@@ -284,6 +284,12 @@ LsAmlListingWalk (
return (AE_OK);
}
+ if ((FileId == ASL_FILE_ASM_INCLUDE_OUTPUT) ||
+ (FileId == ASL_FILE_C_INCLUDE_OUTPUT))
+ {
+ return (AE_OK);
+ }
+
/* Write the hex bytes to the listing file(s) (if requested) */
for (i = 0; i < Op->Asl.FinalAmlLength; i++)
@@ -293,6 +299,7 @@ LsAmlListingWalk (
FlFileError (ASL_FILE_AML_OUTPUT, ASL_MSG_READ);
AslAbort ();
}
+
LsWriteListingHexBytes (&FileByte, 1, FileId);
}
@@ -388,7 +395,7 @@ LsWriteNodeToListing (
{
switch (Op->Asl.ParseOpcode)
{
- case PARSEOP_DEFINITIONBLOCK:
+ case PARSEOP_DEFINITION_BLOCK:
case PARSEOP_METHODCALL:
case PARSEOP_INCLUDE:
case PARSEOP_INCLUDE_END:
@@ -434,36 +441,46 @@ LsWriteNodeToListing (
switch (Op->Asl.ParseOpcode)
{
- case PARSEOP_DEFINITIONBLOCK:
+ case PARSEOP_DEFINITION_BLOCK:
LsWriteSourceLines (Op->Asl.EndLine, Op->Asl.EndLogicalLine, FileId);
/* Use the table Signature and TableId to build a unique name */
- if (FileId == ASL_FILE_ASM_SOURCE_OUTPUT)
+ switch (FileId)
{
+ case ASL_FILE_ASM_SOURCE_OUTPUT:
+
FlPrintFile (FileId,
"%s_%s_Header \\\n",
Gbl_TableSignature, Gbl_TableId);
- }
- if (FileId == ASL_FILE_C_SOURCE_OUTPUT)
- {
+ break;
+
+ case ASL_FILE_C_SOURCE_OUTPUT:
+
FlPrintFile (FileId,
" unsigned char %s_%s_Header [] =\n {\n",
Gbl_TableSignature, Gbl_TableId);
- }
- if (FileId == ASL_FILE_ASM_INCLUDE_OUTPUT)
- {
+ break;
+
+ case ASL_FILE_ASM_INCLUDE_OUTPUT:
+
FlPrintFile (FileId,
"extrn %s_%s_Header : byte\n",
Gbl_TableSignature, Gbl_TableId);
- }
- if (FileId == ASL_FILE_C_INCLUDE_OUTPUT)
- {
+ break;
+
+ case ASL_FILE_C_INCLUDE_OUTPUT:
+
FlPrintFile (FileId,
"extern unsigned char %s_%s_Header [];\n",
Gbl_TableSignature, Gbl_TableId);
+ break;
+
+ default:
+ break;
}
+
return;
@@ -612,31 +629,41 @@ LsWriteNodeToListing (
/* Create the appropriate symbol in the output file */
- if (FileId == ASL_FILE_ASM_SOURCE_OUTPUT)
+ switch (FileId)
{
+ case ASL_FILE_ASM_SOURCE_OUTPUT:
+
FlPrintFile (FileId,
"%s_%s_%s \\\n",
Gbl_TableSignature, Gbl_TableId, &Pathname[1]);
- }
- if (FileId == ASL_FILE_C_SOURCE_OUTPUT)
- {
+ break;
+
+ case ASL_FILE_C_SOURCE_OUTPUT:
+
FlPrintFile (FileId,
" unsigned char %s_%s_%s [] =\n {\n",
Gbl_TableSignature, Gbl_TableId, &Pathname[1]);
- }
- if (FileId == ASL_FILE_ASM_INCLUDE_OUTPUT)
- {
+ break;
+
+ case ASL_FILE_ASM_INCLUDE_OUTPUT:
+
FlPrintFile (FileId,
"extrn %s_%s_%s : byte\n",
Gbl_TableSignature, Gbl_TableId, &Pathname[1]);
- }
- if (FileId == ASL_FILE_C_INCLUDE_OUTPUT)
- {
+ break;
+
+ case ASL_FILE_C_INCLUDE_OUTPUT:
+
FlPrintFile (FileId,
"extern unsigned char %s_%s_%s [];\n",
Gbl_TableSignature, Gbl_TableId, &Pathname[1]);
+ break;
+
+ default:
+ break;
}
}
+
ACPI_FREE (Pathname);
}
break;
diff --git a/src/acpica/source/compiler/asllistsup.c b/src/acpica/source/compiler/asllistsup.c
index c71ace0..815a204 100644
--- a/src/acpica/source/compiler/asllistsup.c
+++ b/src/acpica/source/compiler/asllistsup.c
@@ -160,6 +160,7 @@ LsDumpAscii (
FlPrintFile (FileId, ".");
}
}
+
FlPrintFile (FileId, "\"");
}
@@ -257,7 +258,6 @@ LsCheckException (
(LineNumber >= Gbl_NextError->LogicalLineNumber))
{
AePrintException (FileId, Gbl_NextError, "\n[****iasl****]\n");
-
Gbl_NextError = Gbl_NextError->Next;
}
@@ -648,6 +648,7 @@ LsFlushListingBuffer (
{
FlPrintFile (FileId, ",");
}
+
FlPrintFile (FileId, "0%2.2Xh", Gbl_AmlBuffer[i]);
}
diff --git a/src/acpica/source/compiler/aslload.c b/src/acpica/source/compiler/aslload.c
index e6c1f85..9607679 100644
--- a/src/acpica/source/compiler/aslload.c
+++ b/src/acpica/source/compiler/aslload.c
@@ -268,12 +268,11 @@ LdLoadFieldElements (
default:
Status = AcpiNsLookup (WalkState->ScopeInfo,
- Child->Asl.Value.String,
- ACPI_TYPE_LOCAL_REGION_FIELD,
- ACPI_IMODE_LOAD_PASS1,
- ACPI_NS_NO_UPSEARCH | ACPI_NS_DONT_OPEN_SCOPE |
- ACPI_NS_ERROR_IF_FOUND,
- NULL, &Node);
+ Child->Asl.Value.String,
+ ACPI_TYPE_LOCAL_REGION_FIELD,
+ ACPI_IMODE_LOAD_PASS1,
+ ACPI_NS_NO_UPSEARCH | ACPI_NS_DONT_OPEN_SCOPE |
+ ACPI_NS_ERROR_IF_FOUND, NULL, &Node);
if (ACPI_FAILURE (Status))
{
if (Status != AE_ALREADY_EXISTS)
@@ -338,9 +337,9 @@ LdLoadResourceElements (
* This opens a scope, so later field names are guaranteed to be new/unique.
*/
Status = AcpiNsLookup (WalkState->ScopeInfo, Op->Asl.Namepath,
- ACPI_TYPE_LOCAL_RESOURCE, ACPI_IMODE_LOAD_PASS1,
- ACPI_NS_NO_UPSEARCH | ACPI_NS_ERROR_IF_FOUND,
- WalkState, &Node);
+ ACPI_TYPE_LOCAL_RESOURCE, ACPI_IMODE_LOAD_PASS1,
+ ACPI_NS_NO_UPSEARCH | ACPI_NS_ERROR_IF_FOUND,
+ WalkState, &Node);
if (ACPI_FAILURE (Status))
{
if (Status == AE_ALREADY_EXISTS)
@@ -368,11 +367,11 @@ LdLoadResourceElements (
if (InitializerOp->Asl.ExternalName)
{
Status = AcpiNsLookup (WalkState->ScopeInfo,
- InitializerOp->Asl.ExternalName,
- ACPI_TYPE_LOCAL_RESOURCE_FIELD,
- ACPI_IMODE_LOAD_PASS1,
- ACPI_NS_NO_UPSEARCH | ACPI_NS_DONT_OPEN_SCOPE,
- NULL, &Node);
+ InitializerOp->Asl.ExternalName,
+ ACPI_TYPE_LOCAL_RESOURCE_FIELD,
+ ACPI_IMODE_LOAD_PASS1,
+ ACPI_NS_NO_UPSEARCH | ACPI_NS_DONT_OPEN_SCOPE,
+ NULL, &Node);
if (ACPI_FAILURE (Status))
{
return (Status);
@@ -416,6 +415,7 @@ LdNamespace1Begin (
{
ACPI_WALK_STATE *WalkState = (ACPI_WALK_STATE *) Context;
ACPI_NAMESPACE_NODE *Node;
+ ACPI_PARSE_OBJECT *MethodOp;
ACPI_STATUS Status;
ACPI_OBJECT_TYPE ObjectType;
ACPI_OBJECT_TYPE ActualObjectType = ACPI_TYPE_ANY;
@@ -572,8 +572,8 @@ LdNamespace1Begin (
* handle this case. Perhaps someday this case can go away.
*/
Status = AcpiNsLookup (WalkState->ScopeInfo, Path, ACPI_TYPE_ANY,
- ACPI_IMODE_EXECUTE, ACPI_NS_SEARCH_PARENT,
- WalkState, &(Node));
+ ACPI_IMODE_EXECUTE, ACPI_NS_SEARCH_PARENT,
+ WalkState, &(Node));
if (ACPI_FAILURE (Status))
{
if (Status == AE_NOT_FOUND)
@@ -581,9 +581,9 @@ LdNamespace1Begin (
/* The name was not found, go ahead and create it */
Status = AcpiNsLookup (WalkState->ScopeInfo, Path,
- ACPI_TYPE_LOCAL_SCOPE,
- ACPI_IMODE_LOAD_PASS1, Flags,
- WalkState, &(Node));
+ ACPI_TYPE_LOCAL_SCOPE,
+ ACPI_IMODE_LOAD_PASS1, Flags,
+ WalkState, &(Node));
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
@@ -606,6 +606,35 @@ LdNamespace1Begin (
return_ACPI_STATUS (Status);
}
+ else /* Status AE_OK */
+ {
+ /*
+ * Do not allow references to external scopes from the DSDT.
+ * This is because the DSDT is always loaded first, and the
+ * external reference cannot be resolved -- causing a runtime
+ * error because Scope() must be resolved immediately.
+ * 10/2015.
+ */
+ if ((Node->Flags & ANOBJ_IS_EXTERNAL) &&
+ (ACPI_COMPARE_NAME (Gbl_TableSignature, "DSDT")))
+ {
+ /* However, allowed if the reference is within a method */
+
+ MethodOp = Op->Asl.Parent;
+ while (MethodOp &&
+ (MethodOp->Asl.ParseOpcode != PARSEOP_METHOD))
+ {
+ MethodOp = MethodOp->Asl.Parent;
+ }
+
+ if (!MethodOp)
+ {
+ /* Not in a control method, error */
+
+ AslError (ASL_ERROR, ASL_MSG_CROSS_TABLE_SCOPE, Op, NULL);
+ }
+ }
+ }
/* We found a node with this name, now check the type */
@@ -641,7 +670,7 @@ LdNamespace1Begin (
Node->Type = ACPI_TYPE_LOCAL_SCOPE;
Status = AcpiDsScopeStackPush (Node, ACPI_TYPE_LOCAL_SCOPE,
- WalkState);
+ WalkState);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
@@ -663,7 +692,7 @@ LdNamespace1Begin (
*/
Node->Type = ACPI_TYPE_LOCAL_SCOPE;
Status = AcpiDsScopeStackPush (Node, ACPI_TYPE_LOCAL_SCOPE,
- WalkState);
+ WalkState);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
@@ -683,7 +712,7 @@ LdNamespace1Begin (
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "Loading name: %s, (%s)\n",
- Op->Asl.ExternalName, AcpiUtGetTypeName (ObjectType)));
+ Op->Asl.ExternalName, AcpiUtGetTypeName (ObjectType)));
/* The name must not already exist */
@@ -696,7 +725,7 @@ LdNamespace1Begin (
* parse tree later.
*/
Status = AcpiNsLookup (WalkState->ScopeInfo, Path, ObjectType,
- ACPI_IMODE_LOAD_PASS1, Flags, WalkState, &Node);
+ ACPI_IMODE_LOAD_PASS1, Flags, WalkState, &Node);
if (ACPI_FAILURE (Status))
{
if (Status == AE_ALREADY_EXISTS)
@@ -730,6 +759,17 @@ LdNamespace1Begin (
return_ACPI_STATUS (Status);
}
}
+
+ Status = AE_OK;
+ }
+ else if (!(Node->Flags & ANOBJ_IS_EXTERNAL) &&
+ (Op->Asl.ParseOpcode == PARSEOP_EXTERNAL))
+ {
+ /*
+ * Allow externals in same scope as the definition of the
+ * actual object. Similar to C. Allows multiple definition
+ * blocks that refer to each other in the same file.
+ */
Status = AE_OK;
}
else
@@ -890,8 +930,8 @@ LdNamespace2Begin (
/* Get the NS node associated with the target. It must exist. */
Status = AcpiNsLookup (WalkState->ScopeInfo, Path, ACPI_TYPE_ANY,
- ACPI_IMODE_EXECUTE, ACPI_NS_SEARCH_PARENT | ACPI_NS_DONT_OPEN_SCOPE,
- WalkState, &TargetNode);
+ ACPI_IMODE_EXECUTE, ACPI_NS_SEARCH_PARENT | ACPI_NS_DONT_OPEN_SCOPE,
+ WalkState, &TargetNode);
if (ACPI_FAILURE (Status))
{
if (Status == AE_NOT_FOUND)
@@ -904,9 +944,9 @@ LdNamespace2Begin (
* This prevents more errors later.
*/
Status = AcpiNsLookup (WalkState->ScopeInfo, Path,
- ACPI_TYPE_ANY,
- ACPI_IMODE_LOAD_PASS1, ACPI_NS_NO_UPSEARCH,
- WalkState, &(Node));
+ ACPI_TYPE_ANY,
+ ACPI_IMODE_LOAD_PASS1, ACPI_NS_NO_UPSEARCH,
+ WalkState, &(Node));
return (AE_OK);
}
diff --git a/src/acpica/source/compiler/aslmap.c b/src/acpica/source/compiler/aslmap.c
index a06c246..50b84d1 100644
--- a/src/acpica/source/compiler/aslmap.c
+++ b/src/acpica/source/compiler/aslmap.c
@@ -551,6 +551,7 @@ const ASL_MAPPING_ENTRY AslKeywordMapping [] =
/* HORIZONTALOFFSET */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0),
/* PRINTF */ OP_TABLE_ENTRY (AML_STORE_OP, 0, 0, ACPI_BTYPE_DATA_REFERENCE),
/* FPRINTF */ OP_TABLE_ENTRY (AML_STORE_OP, 0, 0, ACPI_BTYPE_DATA_REFERENCE),
+/* ASLCODE */ OP_TABLE_ENTRY (0, 0, 0, 0)
/*! [End] no source code translation !*/
};
diff --git a/src/acpica/source/compiler/aslmapoutput.c b/src/acpica/source/compiler/aslmapoutput.c
index ef85594..d6234ab 100644
--- a/src/acpica/source/compiler/aslmapoutput.c
+++ b/src/acpica/source/compiler/aslmapoutput.c
@@ -525,7 +525,7 @@ MpEmitDeviceTree (
/* Walk the namespace from the root */
(void) AcpiNsWalkNamespace (ACPI_TYPE_DEVICE, ACPI_ROOT_OBJECT,
- ACPI_UINT32_MAX, FALSE, MpEmitOneDevice, NULL, NULL, NULL);
+ ACPI_UINT32_MAX, FALSE, MpEmitOneDevice, NULL, NULL, NULL);
}
diff --git a/src/acpica/source/compiler/aslmessages.c b/src/acpica/source/compiler/aslmessages.c
index 5373c2d..2245edd 100644
--- a/src/acpica/source/compiler/aslmessages.c
+++ b/src/acpica/source/compiler/aslmessages.c
@@ -310,8 +310,9 @@ const char *AslCompilerMsgs [] =
/* ASL_MSG_ILLEGAL_METHOD_REF */ "Illegal reference across two methods",
/* ASL_MSG_LOCAL_NOT_USED */ "Method Local is set but never used",
/* ASL_MSG_ARG_AS_LOCAL_NOT_USED */ "Method Argument (as a local) is set but never used",
-/* ASL_MSG_ARG_NOT_USED */ "Method Argument is never used"
-
+/* ASL_MSG_ARG_NOT_USED */ "Method Argument is never used",
+/* ASL_MSG_CONSTANT_REQUIRED */ "Non-reducible expression",
+/* ASL_MSG_CROSS_TABLE_SCOPE */ "Illegal open scope on external object from within DSDT"
};
/* Table compiler */
diff --git a/src/acpica/source/compiler/aslmessages.h b/src/acpica/source/compiler/aslmessages.h
index 0e5469d..aa00cf8 100644
--- a/src/acpica/source/compiler/aslmessages.h
+++ b/src/acpica/source/compiler/aslmessages.h
@@ -313,6 +313,8 @@ typedef enum
ASL_MSG_LOCAL_NOT_USED,
ASL_MSG_ARG_AS_LOCAL_NOT_USED,
ASL_MSG_ARG_NOT_USED,
+ ASL_MSG_CONSTANT_REQUIRED,
+ ASL_MSG_CROSS_TABLE_SCOPE,
/* 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 8ffb837..d4f20e8 100644
--- a/src/acpica/source/compiler/aslmethod.c
+++ b/src/acpica/source/compiler/aslmethod.c
@@ -173,7 +173,7 @@ MtMethodAnalysisWalkBegin (
/* Create and init method info */
- MethodInfo = UtLocalCalloc (sizeof (ASL_METHOD_INFO));
+ MethodInfo = UtLocalCalloc (sizeof (ASL_METHOD_INFO));
MethodInfo->Next = WalkInfo->MethodStack;
MethodInfo->Op = Op;
@@ -258,7 +258,9 @@ MtMethodAnalysisWalkBegin (
NextParamType = NextType->Asl.Child;
while (NextParamType)
{
- MethodInfo->ValidArgTypes[ActualArgs] |= AnMapObjTypeToBtype (NextParamType);
+ MethodInfo->ValidArgTypes[ActualArgs] |=
+ AnMapObjTypeToBtype (NextParamType);
+
NextParamType->Asl.ParseOpcode = PARSEOP_DEFAULT_ARG;
NextParamType = NextParamType->Asl.Next;
}
@@ -267,6 +269,7 @@ MtMethodAnalysisWalkBegin (
{
MethodInfo->ValidArgTypes[ActualArgs] =
AnMapObjTypeToBtype (NextType);
+
NextType->Asl.ParseOpcode = PARSEOP_DEFAULT_ARG;
ActualArgs++;
}
@@ -323,7 +326,8 @@ MtMethodAnalysisWalkBegin (
* Local was used outside a control method, or there was an error
* in the method declaration.
*/
- AslError (ASL_REMARK, ASL_MSG_LOCAL_OUTSIDE_METHOD, Op, Op->Asl.ExternalName);
+ AslError (ASL_REMARK, ASL_MSG_LOCAL_OUTSIDE_METHOD,
+ Op, Op->Asl.ExternalName);
return (AE_ERROR);
}
@@ -366,7 +370,8 @@ MtMethodAnalysisWalkBegin (
* Arg was used outside a control method, or there was an error
* in the method declaration.
*/
- AslError (ASL_REMARK, ASL_MSG_LOCAL_OUTSIDE_METHOD, Op, Op->Asl.ExternalName);
+ AslError (ASL_REMARK, ASL_MSG_LOCAL_OUTSIDE_METHOD,
+ Op, Op->Asl.ExternalName);
return (AE_ERROR);
}
@@ -389,7 +394,7 @@ MtMethodAnalysisWalkBegin (
* The only operator that accepts an uninitialized value is ObjectType()
*/
else if ((!MethodInfo->ArgInitialized[RegisterNumber]) &&
- (Op->Asl.Parent->Asl.ParseOpcode != PARSEOP_OBJECTTYPE))
+ (Op->Asl.Parent->Asl.ParseOpcode != PARSEOP_OBJECTTYPE))
{
AslError (ASL_ERROR, ASL_MSG_ARG_INIT, Op, ArgName);
}
@@ -490,7 +495,8 @@ MtMethodAnalysisWalkBegin (
i = ApCheckForPredefinedName (Op, Op->Asl.NameSeg);
if (i < ACPI_VALID_RESERVED_NAME_MAX)
{
- AslError (ASL_ERROR, ASL_MSG_RESERVED_USE, Op, Op->Asl.ExternalName);
+ AslError (ASL_ERROR, ASL_MSG_RESERVED_USE,
+ Op, Op->Asl.ExternalName);
}
break;
@@ -567,9 +573,10 @@ MtCheckNamedObjectInMethod (
const ACPI_OPCODE_INFO *OpInfo;
- /* We don't care about actual method declarations */
+ /* We don't care about actual method declarations or scopes */
- if (Op->Asl.AmlOpcode == AML_METHOD_OP)
+ if ((Op->Asl.AmlOpcode == AML_METHOD_OP) ||
+ (Op->Asl.AmlOpcode == AML_SCOPE_OP))
{
return;
}
@@ -749,7 +756,8 @@ MtMethodAnalysisWalkEnd (
*/
if (Op->Asl.Next)
{
- AslError (ASL_WARNING, ASL_MSG_UNREACHABLE_CODE, Op->Asl.Next, NULL);
+ AslError (ASL_WARNING, ASL_MSG_UNREACHABLE_CODE,
+ Op->Asl.Next, NULL);
}
break;
diff --git a/src/acpica/source/compiler/aslnamesp.c b/src/acpica/source/compiler/aslnamesp.c
index c5a6fbd..cdec53b 100644
--- a/src/acpica/source/compiler/aslnamesp.c
+++ b/src/acpica/source/compiler/aslnamesp.c
@@ -196,16 +196,16 @@ NsDisplayNamespace (
/* Walk entire namespace from the root */
Status = AcpiNsWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT,
- ACPI_UINT32_MAX, FALSE, NsDoOneNamespaceObject, NULL,
- NULL, NULL);
+ ACPI_UINT32_MAX, FALSE, NsDoOneNamespaceObject, NULL,
+ NULL, NULL);
/* Print the full pathname for each namespace node */
FlPrintFile (ASL_FILE_NAMESPACE_OUTPUT, "\nNamespace pathnames\n\n");
Status = AcpiNsWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT,
- ACPI_UINT32_MAX, FALSE, NsDoOnePathname, NULL,
- NULL, NULL);
+ ACPI_UINT32_MAX, FALSE, NsDoOnePathname, NULL,
+ NULL, NULL);
return (Status);
}
@@ -240,8 +240,7 @@ NsDoOneNamespaceObject (
FlPrintFile (ASL_FILE_NAMESPACE_OUTPUT, "%5u [%u] %*s %4.4s - %s",
Gbl_NumNamespaceObjects, Level, (Level * 3), " ",
- &Node->Name,
- AcpiUtGetTypeName (Node->Type));
+ &Node->Name, AcpiUtGetTypeName (Node->Type));
Op = Node->Op;
ObjDesc = ACPI_CAST_PTR (ACPI_OPERAND_OBJECT, Node->Object);
@@ -290,11 +289,13 @@ NsDoOneNamespaceObject (
{
Op = Op->Asl.Child;
}
+
if ((Op->Asl.ParseOpcode == PARSEOP_NAMESEG) ||
(Op->Asl.ParseOpcode == PARSEOP_NAMESTRING))
{
Op = Op->Asl.Next;
}
+
FlPrintFile (ASL_FILE_NAMESPACE_OUTPUT,
" [Initial Value 0x%8.8X%8.8X]",
ACPI_FORMAT_UINT64 (Op->Asl.Value.Integer));
@@ -306,11 +307,13 @@ NsDoOneNamespaceObject (
{
Op = Op->Asl.Child;
}
+
if ((Op->Asl.ParseOpcode == PARSEOP_NAMESEG) ||
(Op->Asl.ParseOpcode == PARSEOP_NAMESTRING))
{
Op = Op->Asl.Next;
}
+
FlPrintFile (ASL_FILE_NAMESPACE_OUTPUT,
" [Initial Value \"%s\"]",
Op->Asl.Value.String);
@@ -323,6 +326,7 @@ NsDoOneNamespaceObject (
{
Op = Op->Asl.Child;
}
+
FlPrintFile (ASL_FILE_NAMESPACE_OUTPUT,
" [Offset 0x%04X Length 0x%04X bits]",
Op->Asl.Parent->Asl.ExtraValue, (UINT32) Op->Asl.Value.Integer);
@@ -375,11 +379,13 @@ NsDoOneNamespaceObject (
{
Op = Op->Asl.Child;
}
+
if ((Op->Asl.ParseOpcode == PARSEOP_NAMESEG) ||
(Op->Asl.ParseOpcode == PARSEOP_NAMESTRING))
{
Op = Op->Asl.Next;
}
+
Op = Op->Asl.Child;
if ((Op->Asl.ParseOpcode == PARSEOP_BYTECONST) ||
@@ -397,11 +403,13 @@ NsDoOneNamespaceObject (
{
Op = Op->Asl.Child;
}
+
if ((Op->Asl.ParseOpcode == PARSEOP_NAMESEG) ||
(Op->Asl.ParseOpcode == PARSEOP_NAMESTRING))
{
Op = Op->Asl.Next;
}
+
Op = Op->Asl.Child;
if (Op && (Op->Asl.ParseOpcode == PARSEOP_INTEGER))
@@ -489,6 +497,5 @@ NsDoOnePathname (
FlPrintFile (ASL_FILE_NAMESPACE_OUTPUT, "%s\n", TargetPath.Pointer);
ACPI_FREE (TargetPath.Pointer);
-
return (AE_OK);
}
diff --git a/src/acpica/source/compiler/aslopcodes.c b/src/acpica/source/compiler/aslopcodes.c
index 4a00b74..08dc4a4 100644
--- a/src/acpica/source/compiler/aslopcodes.c
+++ b/src/acpica/source/compiler/aslopcodes.c
@@ -332,7 +332,7 @@ OpcSetOptimalIntegerSize (
*/
if (Op->Asl.Parent &&
Op->Asl.Parent->Asl.Parent &&
- (Op->Asl.Parent->Asl.Parent->Asl.ParseOpcode == PARSEOP_DEFINITIONBLOCK))
+ (Op->Asl.Parent->Asl.Parent->Asl.ParseOpcode == PARSEOP_DEFINITION_BLOCK))
{
return (0);
}
@@ -402,11 +402,13 @@ OpcSetOptimalIntegerSize (
Op->Asl.AmlOpcode = AML_BYTE_OP;
return (1);
}
+
if (Op->Asl.Value.Integer <= ACPI_UINT16_MAX)
{
Op->Asl.AmlOpcode = AML_WORD_OP;
return (2);
}
+
if (Op->Asl.Value.Integer <= ACPI_UINT32_MAX)
{
Op->Asl.AmlOpcode = AML_DWORD_OP;
@@ -470,6 +472,7 @@ OpcDoAccessAs (
{
AttribOp->Asl.Value.Integer = 0;
}
+
AttribOp->Asl.AmlOpcode = AML_RAW_DATA_BYTE;
AttribOp->Asl.ParseOpcode = PARSEOP_RAW_DATA;
@@ -558,21 +561,21 @@ OpcDoConnection (
* First Child -> BufferLength
* Second Child -> Descriptor Buffer (raw byte data)
*/
- BufferOp->Asl.ParseOpcode = PARSEOP_BUFFER;
- BufferOp->Asl.AmlOpcode = AML_BUFFER_OP;
- BufferOp->Asl.CompileFlags = NODE_AML_PACKAGE | NODE_IS_RESOURCE_DESC;
+ BufferOp->Asl.ParseOpcode = PARSEOP_BUFFER;
+ BufferOp->Asl.AmlOpcode = AML_BUFFER_OP;
+ BufferOp->Asl.CompileFlags = NODE_AML_PACKAGE | NODE_IS_RESOURCE_DESC;
UtSetParseOpName (BufferOp);
- BufferLengthOp->Asl.ParseOpcode = PARSEOP_INTEGER;
+ BufferLengthOp->Asl.ParseOpcode = PARSEOP_INTEGER;
BufferLengthOp->Asl.Value.Integer = Rnode->BufferLength;
(void) OpcSetOptimalIntegerSize (BufferLengthOp);
UtSetParseOpName (BufferLengthOp);
- BufferDataOp->Asl.ParseOpcode = PARSEOP_RAW_DATA;
- BufferDataOp->Asl.AmlOpcode = AML_RAW_DATA_CHAIN;
- BufferDataOp->Asl.AmlOpcodeLength = 0;
- BufferDataOp->Asl.AmlLength = Rnode->BufferLength;
- BufferDataOp->Asl.Value.Buffer = (UINT8 *) Rnode;
+ BufferDataOp->Asl.ParseOpcode = PARSEOP_RAW_DATA;
+ BufferDataOp->Asl.AmlOpcode = AML_RAW_DATA_CHAIN;
+ BufferDataOp->Asl.AmlOpcodeLength = 0;
+ BufferDataOp->Asl.AmlLength = Rnode->BufferLength;
+ BufferDataOp->Asl.Value.Buffer = (UINT8 *) Rnode;
UtSetParseOpName (BufferDataOp);
}
@@ -636,8 +639,8 @@ OpcDoUnicode (
* Just set the buffer size node to be the buffer length, regardless
* of whether it was previously an integer or a default_arg placeholder
*/
- BufferLengthOp->Asl.ParseOpcode = PARSEOP_INTEGER;
- BufferLengthOp->Asl.AmlOpcode = AML_DWORD_OP;
+ BufferLengthOp->Asl.ParseOpcode = PARSEOP_INTEGER;
+ BufferLengthOp->Asl.AmlOpcode = AML_DWORD_OP;
BufferLengthOp->Asl.Value.Integer = Length;
UtSetParseOpName (BufferLengthOp);
@@ -645,11 +648,11 @@ OpcDoUnicode (
/* The Unicode string is a raw data buffer */
- InitializerOp->Asl.Value.Buffer = (UINT8 *) UnicodeString;
- InitializerOp->Asl.AmlOpcode = AML_RAW_DATA_BUFFER;
- InitializerOp->Asl.AmlLength = Length;
- InitializerOp->Asl.ParseOpcode = PARSEOP_RAW_DATA;
- InitializerOp->Asl.Child = NULL;
+ InitializerOp->Asl.Value.Buffer = (UINT8 *) UnicodeString;
+ InitializerOp->Asl.AmlOpcode = AML_RAW_DATA_BUFFER;
+ InitializerOp->Asl.AmlLength = Length;
+ InitializerOp->Asl.ParseOpcode = PARSEOP_RAW_DATA;
+ InitializerOp->Asl.Child = NULL;
UtSetParseOpName (InitializerOp);
}
@@ -1402,9 +1405,9 @@ OpcDoPld (
NewOp = TrAllocateNode (PARSEOP_INTEGER);
- NewOp->Asl.AmlOpcode = AML_BYTE_OP;
+ NewOp->Asl.AmlOpcode = AML_BYTE_OP;
NewOp->Asl.Value.Integer = 20;
- NewOp->Asl.Parent = Op;
+ NewOp->Asl.Parent = Op;
Op->Asl.Child = NewOp;
Op = NewOp;
@@ -1412,10 +1415,10 @@ OpcDoPld (
/* Peer to the child is the raw buffer data */
NewOp = TrAllocateNode (PARSEOP_RAW_DATA);
- NewOp->Asl.AmlOpcode = AML_RAW_DATA_BUFFER;
- NewOp->Asl.AmlLength = 20;
- NewOp->Asl.Value.String = ACPI_CAST_PTR (char, Buffer);
- NewOp->Asl.Parent = Op->Asl.Parent;
+ NewOp->Asl.AmlOpcode = AML_RAW_DATA_BUFFER;
+ NewOp->Asl.AmlLength = 20;
+ NewOp->Asl.Value.String = ACPI_CAST_PTR (char, Buffer);
+ NewOp->Asl.Parent = Op->Asl.Parent;
Op->Asl.Next = NewOp;
}
@@ -1470,9 +1473,9 @@ OpcDoUuId (
NewOp = TrAllocateNode (PARSEOP_INTEGER);
- NewOp->Asl.AmlOpcode = AML_BYTE_OP;
+ NewOp->Asl.AmlOpcode = AML_BYTE_OP;
NewOp->Asl.Value.Integer = 16;
- NewOp->Asl.Parent = Op;
+ NewOp->Asl.Parent = Op;
Op->Asl.Child = NewOp;
Op = NewOp;
@@ -1480,10 +1483,10 @@ OpcDoUuId (
/* Peer to the child is the raw buffer data */
NewOp = TrAllocateNode (PARSEOP_RAW_DATA);
- NewOp->Asl.AmlOpcode = AML_RAW_DATA_BUFFER;
- NewOp->Asl.AmlLength = 16;
- NewOp->Asl.Value.String = ACPI_CAST_PTR (char, Buffer);
- NewOp->Asl.Parent = Op->Asl.Parent;
+ NewOp->Asl.AmlOpcode = AML_RAW_DATA_BUFFER;
+ NewOp->Asl.AmlLength = 16;
+ NewOp->Asl.Value.String = ACPI_CAST_PTR (char, Buffer);
+ NewOp->Asl.Parent = Op->Asl.Parent;
Op->Asl.Next = NewOp;
}
diff --git a/src/acpica/source/compiler/asloperands.c b/src/acpica/source/compiler/asloperands.c
index 8a7382a..ee9c9d9 100644
--- a/src/acpica/source/compiler/asloperands.c
+++ b/src/acpica/source/compiler/asloperands.c
@@ -260,14 +260,16 @@ OpnDoMethod (
{
AslError (ASL_ERROR, ASL_MSG_SYNC_LEVEL, Next, NULL);
}
+
Concurrency = (UINT8) Next->Asl.Value.Integer;
}
/* Put the bits in their proper places */
- MethodFlags = (UINT8) ((NumArgs & 0x7) |
- ((Serialized & 0x1) << 3) |
- ((Concurrency & 0xF) << 4));
+ MethodFlags = (UINT8)
+ ((NumArgs & 0x7) |
+ ((Serialized & 0x1) << 3) |
+ ((Concurrency & 0xF) << 4));
/* Use the last node for the combined flags byte */
@@ -344,9 +346,9 @@ OpnDoFieldCommon (
/* Set the node to RAW_DATA */
Next->Asl.Value.Integer = FieldFlags;
- Next->Asl.AmlOpcode = AML_RAW_DATA_BYTE;
- Next->Asl.AmlLength = 1;
- Next->Asl.ParseOpcode = PARSEOP_RAW_DATA;
+ Next->Asl.AmlOpcode = AML_RAW_DATA_BYTE;
+ Next->Asl.AmlLength = 1;
+ Next->Asl.ParseOpcode = PARSEOP_RAW_DATA;
/* Process the FieldUnitList */
@@ -417,8 +419,8 @@ OpnDoFieldCommon (
/* Named or reserved field entry */
- PkgLengthNode = Next->Asl.Child;
- NewBitOffset = (UINT32) PkgLengthNode->Asl.Value.Integer;
+ PkgLengthNode = Next->Asl.Child;
+ NewBitOffset = (UINT32) PkgLengthNode->Asl.Value.Integer;
CurrentBitOffset += NewBitOffset;
/* Save the current AccessAs value for error checking later */
@@ -673,9 +675,9 @@ OpnDoBuffer (
{
/* For buffers, this is a list of raw bytes */
- InitializerOp->Asl.AmlOpcode = AML_RAW_DATA_BYTE;
- InitializerOp->Asl.AmlLength = 1;
- InitializerOp->Asl.ParseOpcode = PARSEOP_RAW_DATA;
+ InitializerOp->Asl.AmlOpcode = AML_RAW_DATA_BYTE;
+ InitializerOp->Asl.AmlLength = 1;
+ InitializerOp->Asl.ParseOpcode = PARSEOP_RAW_DATA;
BufferLength++;
InitializerOp = ASL_GET_PEER_NODE (InitializerOp);
@@ -690,9 +692,9 @@ OpnDoBuffer (
*/
BufferLength = strlen (InitializerOp->Asl.Value.String) + 1;
- InitializerOp->Asl.AmlOpcode = AML_RAW_DATA_BUFFER;
- InitializerOp->Asl.AmlLength = BufferLength;
- InitializerOp->Asl.ParseOpcode = PARSEOP_RAW_DATA;
+ InitializerOp->Asl.AmlOpcode = AML_RAW_DATA_BUFFER;
+ InitializerOp->Asl.AmlLength = BufferLength;
+ InitializerOp->Asl.ParseOpcode = PARSEOP_RAW_DATA;
break;
case PARSEOP_RAW_DATA:
@@ -708,7 +710,7 @@ OpnDoBuffer (
AslError (ASL_ERROR, ASL_MSG_INVALID_OPERAND, InitializerOp,
"Unknown buffer initializer opcode");
printf ("Unknown buffer initializer opcode [%s]\n",
- UtGetOpName (InitializerOp->Asl.ParseOpcode));
+ UtGetOpName (InitializerOp->Asl.ParseOpcode));
return;
}
@@ -732,8 +734,8 @@ OpnDoBuffer (
* Just set the buffer size node to be the buffer length, regardless
* of whether it was previously an integer or a default_arg placeholder
*/
- BufferLengthOp->Asl.ParseOpcode = PARSEOP_INTEGER;
- BufferLengthOp->Asl.AmlOpcode = AML_DWORD_OP;
+ BufferLengthOp->Asl.ParseOpcode = PARSEOP_INTEGER;
+ BufferLengthOp->Asl.AmlOpcode = AML_DWORD_OP;
BufferLengthOp->Asl.Value.Integer = BufferLength;
(void) OpcSetOptimalIntegerSize (BufferLengthOp);
@@ -911,9 +913,9 @@ OpnDoLoadTable (
Next = Next->Asl.Next;
if (Next->Asl.ParseOpcode == PARSEOP_ZERO)
{
- Next->Asl.ParseOpcode = PARSEOP_STRING_LITERAL;
- Next->Asl.Value.String = "\\";
- Next->Asl.AmlLength = 2;
+ Next->Asl.ParseOpcode = PARSEOP_STRING_LITERAL;
+ Next->Asl.Value.String = "\\";
+ Next->Asl.AmlLength = 2;
OpcGenerateAmlOpcode (Next);
}
@@ -995,6 +997,7 @@ OpnDoDefinitionBlock (
Gbl_OutputFilenamePrefix = Filename;
UtConvertBackslashes (Gbl_OutputFilenamePrefix);
}
+
Child->Asl.ParseOpcode = PARSEOP_DEFAULT_ARG;
/* Signature */
@@ -1203,7 +1206,7 @@ OpnGenerateAmlOperands (
switch (Op->Asl.ParseOpcode)
{
- case PARSEOP_DEFINITIONBLOCK:
+ case PARSEOP_DEFINITION_BLOCK:
OpnDoDefinitionBlock (Op);
break;
diff --git a/src/acpica/source/compiler/aslopt.c b/src/acpica/source/compiler/aslopt.c
index ae8cbb3..62f3138 100644
--- a/src/acpica/source/compiler/aslopt.c
+++ b/src/acpica/source/compiler/aslopt.c
@@ -125,7 +125,7 @@
ACPI_MODULE_NAME ("aslopt")
-static UINT32 OptTotal = 0;
+static UINT32 OptTotal = 0;
/* Local prototypes */
@@ -204,15 +204,15 @@ OptSearchToRoot (
* name in the search path before the one we want, the nodes will
* not match, and we cannot use this optimization.
*/
- Path = &(((char *) TargetPath->Pointer)[TargetPath->Length -
- ACPI_NAME_SIZE]),
+ Path = &(((char *) TargetPath->Pointer)[
+ TargetPath->Length - ACPI_NAME_SIZE]),
ScopeInfo.Scope.Node = CurrentNode;
/* Lookup the NameSeg using SEARCH_PARENT (search-to-root) */
Status = AcpiNsLookup (&ScopeInfo, Path, ACPI_TYPE_ANY, ACPI_IMODE_EXECUTE,
- ACPI_NS_SEARCH_PARENT | ACPI_NS_DONT_OPEN_SCOPE,
- WalkState, &(Node));
+ ACPI_NS_SEARCH_PARENT | ACPI_NS_DONT_OPEN_SCOPE,
+ WalkState, &(Node));
if (ACPI_FAILURE (Status))
{
return (Status);
@@ -244,8 +244,8 @@ OptSearchToRoot (
if (strncmp (*NewPath, "_T_", 3))
{
- AslError (ASL_OPTIMIZATION, ASL_MSG_SINGLE_NAME_OPTIMIZATION, Op,
- *NewPath);
+ AslError (ASL_OPTIMIZATION, ASL_MSG_SINGLE_NAME_OPTIMIZATION,
+ Op, *NewPath);
}
return (AE_OK);
@@ -364,7 +364,7 @@ OptBuildShortestPath (
/* Determine how many prefix Carats are required */
NumCarats = (CurrentPath->Length / ACPI_PATH_SEGMENT_LENGTH) -
- NumCommonSegments;
+ NumCommonSegments;
/*
* Construct a new target string
@@ -445,8 +445,8 @@ OptBuildShortestPath (
* path that has been created.
*/
Status = AcpiNsLookup (&ScopeInfo, NewPath,
- ACPI_TYPE_ANY, ACPI_IMODE_EXECUTE,
- ACPI_NS_DONT_OPEN_SCOPE, WalkState, &(Node));
+ ACPI_TYPE_ANY, ACPI_IMODE_EXECUTE,
+ ACPI_NS_DONT_OPEN_SCOPE, WalkState, &(Node));
if (ACPI_SUCCESS (Status))
{
/* Found the namepath, but make sure the node is correct */
@@ -518,7 +518,7 @@ OptOptimizeNameDeclaration (
if (((CurrentNode == AcpiGbl_RootNode) ||
- (Op->Common.Parent->Asl.ParseOpcode == PARSEOP_DEFINITIONBLOCK)) &&
+ (Op->Common.Parent->Asl.ParseOpcode == PARSEOP_DEFINITION_BLOCK)) &&
(ACPI_IS_ROOT_PREFIX (AmlNameString[0])))
{
/*
@@ -530,7 +530,7 @@ OptOptimizeNameDeclaration (
/* Debug output */
Status = AcpiNsExternalizeName (ACPI_UINT32_MAX, *NewPath,
- NULL, &NewPathExternal);
+ NULL, &NewPathExternal);
if (ACPI_FAILURE (Status))
{
AslCoreSubsystemError (Op, Status, "Externalizing NamePath",
@@ -546,8 +546,8 @@ OptOptimizeNameDeclaration (
* We know that we are at the root, so NULL is used for the scope.
*/
Status = AcpiNsLookup (NULL, *NewPath,
- ACPI_TYPE_ANY, ACPI_IMODE_EXECUTE,
- ACPI_NS_DONT_OPEN_SCOPE, WalkState, &(Node));
+ ACPI_TYPE_ANY, ACPI_IMODE_EXECUTE,
+ ACPI_NS_DONT_OPEN_SCOPE, WalkState, &(Node));
if (ACPI_SUCCESS (Status))
{
/* Found the namepath, but make sure the node is correct */
@@ -705,6 +705,7 @@ OptOptimizeNamePath (
{
NextOp = NextOp->Asl.Parent;
}
+
if (NextOp && NextOp->Asl.Node)
{
CurrentNode = NextOp->Asl.Node;
@@ -734,6 +735,7 @@ OptOptimizeNamePath (
ASL_NO_ABORT);
return_VOID;
}
+
TargetPath.Length--; /* Subtract one for null terminator */
/* CurrentPath is the path to this scope (where we are in the namespace) */
@@ -746,12 +748,13 @@ OptOptimizeNamePath (
ASL_NO_ABORT);
return_VOID;
}
+
CurrentPath.Length--; /* Subtract one for null terminator */
/* Debug output only */
Status = AcpiNsExternalizeName (ACPI_UINT32_MAX, AmlNameString,
- NULL, &ExternalNameString);
+ NULL, &ExternalNameString);
if (ACPI_FAILURE (Status))
{
AslCoreSubsystemError (Op, Status, "Externalizing NamePath",
@@ -777,7 +780,7 @@ OptOptimizeNamePath (
* a reference.
*/
Status = OptOptimizeNameDeclaration (Op, WalkState, CurrentNode,
- TargetNode, AmlNameString, &NewPath);
+ TargetNode, AmlNameString, &NewPath);
if (ACPI_FAILURE (Status))
{
/*
@@ -785,8 +788,8 @@ OptOptimizeNamePath (
* optimize the namestring with carats (up-arrow)
*/
Status = OptBuildShortestPath (Op, WalkState, CurrentNode,
- TargetNode, &CurrentPath, &TargetPath,
- AmlNameStringLength, 1, &NewPath);
+ TargetNode, &CurrentPath, &TargetPath,
+ AmlNameStringLength, 1, &NewPath);
}
}
else
@@ -798,7 +801,7 @@ OptOptimizeNamePath (
* NameSeg of the NamePath
*/
Status = OptSearchToRoot (Op, WalkState, CurrentNode,
- TargetNode, &TargetPath, &NewPath);
+ TargetNode, &TargetPath, &NewPath);
if (ACPI_FAILURE (Status))
{
/*
@@ -806,8 +809,8 @@ OptOptimizeNamePath (
* optimize the namestring with carats (up-arrow)
*/
Status = OptBuildShortestPath (Op, WalkState, CurrentNode,
- TargetNode, &CurrentPath, &TargetPath,
- AmlNameStringLength, 0, &NewPath);
+ TargetNode, &CurrentPath, &TargetPath,
+ AmlNameStringLength, 0, &NewPath);
}
}
diff --git a/src/acpica/source/compiler/aslpredef.c b/src/acpica/source/compiler/aslpredef.c
index c39483b..680cb62 100644
--- a/src/acpica/source/compiler/aslpredef.c
+++ b/src/acpica/source/compiler/aslpredef.c
@@ -331,7 +331,7 @@ ApCheckPredefinedReturnValue (
*/
Gbl_AllExceptionsDisabled = TRUE;
Index = ApCheckForPredefinedName (MethodInfo->Op,
- MethodInfo->Op->Asl.NameSeg);
+ MethodInfo->Op->Asl.NameSeg);
Gbl_AllExceptionsDisabled = FALSE;
switch (Index)
@@ -643,7 +643,8 @@ ApCheckForSpecialName (
* warning and force the user to manually change the names. So, we
* will issue a remark instead.
*/
- AslError (ASL_REMARK, ASL_MSG_COMPILER_RESERVED, Op, Op->Asl.ExternalName);
+ AslError (ASL_REMARK, ASL_MSG_COMPILER_RESERVED,
+ Op, Op->Asl.ExternalName);
return (ACPI_COMPILER_RESERVED_NAME);
}
@@ -652,8 +653,8 @@ ApCheckForSpecialName (
* warning, since the entire namespace starting with an underscore is
* reserved by the ACPI spec.
*/
- AslError (ASL_WARNING, ASL_MSG_UNKNOWN_RESERVED_NAME, Op,
- Op->Asl.ExternalName);
+ AslError (ASL_WARNING, ASL_MSG_UNKNOWN_RESERVED_NAME,
+ Op, Op->Asl.ExternalName);
return (ACPI_NOT_RESERVED_NAME);
}
diff --git a/src/acpica/source/compiler/aslprepkg.c b/src/acpica/source/compiler/aslprepkg.c
index 6a74e88..4f6163f 100644
--- a/src/acpica/source/compiler/aslprepkg.c
+++ b/src/acpica/source/compiler/aslprepkg.c
@@ -310,6 +310,7 @@ ApCheckPackage (
ApCheckObjectType (Predefined->Info.Name, Op,
Package->RetInfo3.TailObjectType, i);
}
+
Op = Op->Asl.Next;
}
break;
diff --git a/src/acpica/source/compiler/aslprune.c b/src/acpica/source/compiler/aslprune.c
index 44221bb..7f0074f 100644
--- a/src/acpica/source/compiler/aslprune.c
+++ b/src/acpica/source/compiler/aslprune.c
@@ -135,6 +135,8 @@ PrPrintObjectAtLevel (
const char *ObjectName);
+/* Structure used for the pruning parse tree walk */
+
typedef struct acpi_prune_info
{
UINT32 PruneLevel;
diff --git a/src/acpica/source/compiler/aslresource.c b/src/acpica/source/compiler/aslresource.c
index 2abc7dd..4ae38b3 100644
--- a/src/acpica/source/compiler/aslresource.c
+++ b/src/acpica/source/compiler/aslresource.c
@@ -468,6 +468,7 @@ RsGetStringDataLength (
{
return ((UINT16) (strlen (InitializerOp->Asl.Value.String) + 1));
}
+
InitializerOp = ASL_GET_PEER_NODE (InitializerOp);
}
@@ -503,7 +504,6 @@ RsAllocateResourceNode (
Rnode->Buffer = UtLocalCalloc (Size);
Rnode->BufferLength = Size;
-
return (Rnode);
}
@@ -539,7 +539,6 @@ RsCreateResourceField (
Op->Asl.ExternalName = Name;
Op->Asl.CompileFlags |= NODE_IS_RESOURCE_FIELD;
-
Op->Asl.Value.Tag.BitOffset = (ByteOffset * 8) + BitOffset;
Op->Asl.Value.Tag.BitLength = BitLength;
}
@@ -960,7 +959,7 @@ RsDoOneResourceDescriptor (
default:
printf ("Unknown resource descriptor type [%s]\n",
- Info->DescriptorTypeOp->Asl.ParseOpName);
+ Info->DescriptorTypeOp->Asl.ParseOpName);
break;
}
@@ -976,7 +975,8 @@ RsDoOneResourceDescriptor (
if (Rnode)
{
Info->DescriptorTypeOp->Asl.FinalAmlLength = Rnode->BufferLength;
- Info->DescriptorTypeOp->Asl.Extra = ((AML_RESOURCE *) Rnode->Buffer)->DescriptorType;
+ Info->DescriptorTypeOp->Asl.Extra =
+ ((AML_RESOURCE *) Rnode->Buffer)->DescriptorType;
}
return (Rnode);
diff --git a/src/acpica/source/compiler/aslrestype1.c b/src/acpica/source/compiler/aslrestype1.c
index 945f1bf..a00b4e9 100644
--- a/src/acpica/source/compiler/aslrestype1.c
+++ b/src/acpica/source/compiler/aslrestype1.c
@@ -158,7 +158,6 @@ RsDoEndTagDescriptor (
Descriptor->EndTag.DescriptorType = ACPI_RESOURCE_NAME_END_TAG |
ASL_RDESC_END_TAG_SIZE;
Descriptor->EndTag.Checksum = 0;
-
return (Rnode);
}
@@ -186,8 +185,8 @@ RsDoEndDependentDescriptor (
Rnode = RsAllocateResourceNode (sizeof (AML_RESOURCE_END_DEPENDENT));
Descriptor = Rnode->Buffer;
- Descriptor->EndDpf.DescriptorType = ACPI_RESOURCE_NAME_END_DEPENDENT |
- ASL_RDESC_END_DEPEND_SIZE;
+ Descriptor->EndDpf.DescriptorType =
+ ACPI_RESOURCE_NAME_END_DEPENDENT | ASL_RDESC_END_DEPEND_SIZE;
return (Rnode);
}
@@ -223,7 +222,7 @@ RsDoMemory24Descriptor (
Rnode = RsAllocateResourceNode (sizeof (AML_RESOURCE_MEMORY24));
Descriptor = Rnode->Buffer;
- Descriptor->Memory24.DescriptorType = ACPI_RESOURCE_NAME_MEMORY24;
+ Descriptor->Memory24.DescriptorType = ACPI_RESOURCE_NAME_MEMORY24;
Descriptor->Memory24.ResourceLength = 9;
/* Process all child initialization nodes */
@@ -329,7 +328,7 @@ RsDoMemory32Descriptor (
Rnode = RsAllocateResourceNode (sizeof (AML_RESOURCE_MEMORY32));
Descriptor = Rnode->Buffer;
- Descriptor->Memory32.DescriptorType = ACPI_RESOURCE_NAME_MEMORY32;
+ Descriptor->Memory32.DescriptorType = ACPI_RESOURCE_NAME_MEMORY32;
Descriptor->Memory32.ResourceLength = 17;
/* Process all child initialization nodes */
@@ -432,7 +431,7 @@ RsDoMemory32FixedDescriptor (
Rnode = RsAllocateResourceNode (sizeof (AML_RESOURCE_FIXED_MEMORY32));
Descriptor = Rnode->Buffer;
- Descriptor->FixedMemory32.DescriptorType = ACPI_RESOURCE_NAME_FIXED_MEMORY32;
+ Descriptor->FixedMemory32.DescriptorType = ACPI_RESOURCE_NAME_FIXED_MEMORY32;
Descriptor->FixedMemory32.ResourceLength = 9;
/* Process all child initialization nodes */
@@ -520,8 +519,8 @@ RsDoStartDependentDescriptor (
/* Descriptor has priority byte */
- Descriptor->StartDpf.DescriptorType = ACPI_RESOURCE_NAME_START_DEPENDENT |
- (ASL_RDESC_ST_DEPEND_SIZE + 0x01);
+ Descriptor->StartDpf.DescriptorType =
+ ACPI_RESOURCE_NAME_START_DEPENDENT | (ASL_RDESC_ST_DEPEND_SIZE + 0x01);
/* Process all child initialization nodes */
@@ -565,8 +564,8 @@ RsDoStartDependentDescriptor (
* must keep track of the offset of not only each descriptor, but each
* element (field) within each descriptor as well.
*/
- CurrentByteOffset += RsLinkDescriptorChain (&PreviousRnode,
- NextRnode);
+ CurrentByteOffset += RsLinkDescriptorChain (
+ &PreviousRnode, NextRnode);
break;
}
@@ -608,8 +607,8 @@ RsDoStartDependentNoPriDescriptor (
Rnode = RsAllocateResourceNode (sizeof (AML_RESOURCE_START_DEPENDENT_NOPRIO));
Descriptor = Rnode->Buffer;
- Descriptor->StartDpf.DescriptorType = ACPI_RESOURCE_NAME_START_DEPENDENT |
- ASL_RDESC_ST_DEPEND_SIZE;
+ Descriptor->StartDpf.DescriptorType =
+ ACPI_RESOURCE_NAME_START_DEPENDENT | ASL_RDESC_ST_DEPEND_SIZE;
PreviousRnode = Rnode;
/* Increment offset past StartDependentNoPri descriptor */
@@ -671,7 +670,7 @@ RsDoVendorSmallDescriptor (
Rnode = RsAllocateResourceNode (sizeof (AML_RESOURCE_VENDOR_SMALL) + 7);
Descriptor = Rnode->Buffer;
- Descriptor->VendorSmall.DescriptorType = ACPI_RESOURCE_NAME_VENDOR_SMALL;
+ Descriptor->VendorSmall.DescriptorType = ACPI_RESOURCE_NAME_VENDOR_SMALL;
VendorData = ((UINT8 *) Descriptor) + sizeof (AML_RESOURCE_SMALL_HEADER);
/* Process all child initialization nodes */
diff --git a/src/acpica/source/compiler/aslrestype1i.c b/src/acpica/source/compiler/aslrestype1i.c
index 1394580..a974aa6 100644
--- a/src/acpica/source/compiler/aslrestype1i.c
+++ b/src/acpica/source/compiler/aslrestype1i.c
@@ -160,8 +160,8 @@ RsDoDmaDescriptor (
Rnode = RsAllocateResourceNode (sizeof (AML_RESOURCE_DMA));
Descriptor = Rnode->Buffer;
- Descriptor->Dma.DescriptorType = ACPI_RESOURCE_NAME_DMA |
- ASL_RDESC_DMA_SIZE;
+ Descriptor->Dma.DescriptorType =
+ ACPI_RESOURCE_NAME_DMA | ASL_RDESC_DMA_SIZE;
/* Process all child initialization nodes */
@@ -354,8 +354,8 @@ RsDoFixedIoDescriptor (
Rnode = RsAllocateResourceNode (sizeof (AML_RESOURCE_FIXED_IO));
Descriptor = Rnode->Buffer;
- Descriptor->Io.DescriptorType = ACPI_RESOURCE_NAME_FIXED_IO |
- ASL_RDESC_FIXED_IO_SIZE;
+ Descriptor->Io.DescriptorType =
+ ACPI_RESOURCE_NAME_FIXED_IO | ASL_RDESC_FIXED_IO_SIZE;
/* Process all child initialization nodes */
@@ -437,8 +437,8 @@ RsDoIoDescriptor (
Rnode = RsAllocateResourceNode (sizeof (AML_RESOURCE_IO));
Descriptor = Rnode->Buffer;
- Descriptor->Io.DescriptorType = ACPI_RESOURCE_NAME_IO |
- ASL_RDESC_IO_SIZE;
+ Descriptor->Io.DescriptorType =
+ ACPI_RESOURCE_NAME_IO | ASL_RDESC_IO_SIZE;
/* Process all child initialization nodes */
@@ -548,8 +548,8 @@ RsDoIrqDescriptor (
/* Length = 3 (with flag byte) */
Descriptor = Rnode->Buffer;
- Descriptor->Irq.DescriptorType = ACPI_RESOURCE_NAME_IRQ |
- (ASL_RDESC_IRQ_SIZE + 0x01);
+ Descriptor->Irq.DescriptorType =
+ ACPI_RESOURCE_NAME_IRQ | (ASL_RDESC_IRQ_SIZE + 0x01);
/* Process all child initialization nodes */
@@ -668,8 +668,8 @@ RsDoIrqNoFlagsDescriptor (
Rnode = RsAllocateResourceNode (sizeof (AML_RESOURCE_IRQ_NOFLAGS));
Descriptor = Rnode->Buffer;
- Descriptor->Irq.DescriptorType = ACPI_RESOURCE_NAME_IRQ |
- ASL_RDESC_IRQ_SIZE;
+ Descriptor->Irq.DescriptorType =
+ ACPI_RESOURCE_NAME_IRQ | ASL_RDESC_IRQ_SIZE;
/* Process all child initialization nodes */
diff --git a/src/acpica/source/compiler/aslrestype2.c b/src/acpica/source/compiler/aslrestype2.c
index 1cbca10..7e62a76 100644
--- a/src/acpica/source/compiler/aslrestype2.c
+++ b/src/acpica/source/compiler/aslrestype2.c
@@ -219,6 +219,7 @@ RsDoGeneralRegisterDescriptor (
InitializerOp = RsCompleteNodeAndGetNext (InitializerOp);
}
+
return (Rnode);
}
@@ -285,7 +286,7 @@ RsDoInterruptDescriptor (
1 + OptionIndex + StringLength);
Descriptor = Rnode->Buffer;
- Descriptor->ExtendedIrq.DescriptorType = ACPI_RESOURCE_NAME_EXTENDED_IRQ;
+ Descriptor->ExtendedIrq.DescriptorType = ACPI_RESOURCE_NAME_EXTENDED_IRQ;
/*
* Initial descriptor length -- may be enlarged if there are
@@ -295,7 +296,7 @@ RsDoInterruptDescriptor (
Descriptor->ExtendedIrq.InterruptCount = 0;
Rover = ACPI_CAST_PTR (AML_RESOURCE,
- (&(Descriptor->ExtendedIrq.Interrupts[0])));
+ (&(Descriptor->ExtendedIrq.Interrupts[0])));
/* Process all child initialization nodes */
@@ -454,9 +455,10 @@ RsDoInterruptDescriptor (
(Descriptor->ExtendedIrq.ResourceLength + StringLength);
}
- Rnode->BufferLength = (ASL_RESDESC_OFFSET (ExtendedIrq.Interrupts[0]) -
- ASL_RESDESC_OFFSET (ExtendedIrq.DescriptorType))
- + OptionIndex + StringLength;
+ Rnode->BufferLength =
+ (ASL_RESDESC_OFFSET (ExtendedIrq.Interrupts[0]) -
+ ASL_RESDESC_OFFSET (ExtendedIrq.DescriptorType))
+ + OptionIndex + StringLength;
return (Rnode);
}
@@ -503,7 +505,7 @@ RsDoVendorLargeDescriptor (
Rnode = RsAllocateResourceNode (sizeof (AML_RESOURCE_VENDOR_LARGE) + i);
Descriptor = Rnode->Buffer;
- Descriptor->VendorLarge.DescriptorType = ACPI_RESOURCE_NAME_VENDOR_LARGE;
+ Descriptor->VendorLarge.DescriptorType = ACPI_RESOURCE_NAME_VENDOR_LARGE;
Descriptor->VendorLarge.ResourceLength = (UINT16) i;
/* Point to end-of-descriptor for vendor data */
diff --git a/src/acpica/source/compiler/aslrestype2d.c b/src/acpica/source/compiler/aslrestype2d.c
index 083751f..c1fc003 100644
--- a/src/acpica/source/compiler/aslrestype2d.c
+++ b/src/acpica/source/compiler/aslrestype2d.c
@@ -163,11 +163,11 @@ RsDoDwordIoDescriptor (
CurrentByteOffset = Info->CurrentByteOffset;
Rnode = RsAllocateResourceNode (
- sizeof (AML_RESOURCE_ADDRESS32) + 1 + StringLength);
+ sizeof (AML_RESOURCE_ADDRESS32) + 1 + StringLength);
Descriptor = Rnode->Buffer;
Descriptor->Address32.DescriptorType = ACPI_RESOURCE_NAME_ADDRESS32;
- Descriptor->Address32.ResourceType = ACPI_ADDRESS_TYPE_IO_RANGE;
+ Descriptor->Address32.ResourceType = ACPI_ADDRESS_TYPE_IO_RANGE;
/*
* Initial descriptor length -- may be enlarged if there are
@@ -397,7 +397,7 @@ RsDoDwordMemoryDescriptor (
Descriptor = Rnode->Buffer;
Descriptor->Address32.DescriptorType = ACPI_RESOURCE_NAME_ADDRESS32;
- Descriptor->Address32.ResourceType = ACPI_ADDRESS_TYPE_MEMORY_RANGE;
+ Descriptor->Address32.ResourceType = ACPI_ADDRESS_TYPE_MEMORY_RANGE;
/*
* Initial descriptor length -- may be enlarged if there are
@@ -628,7 +628,7 @@ RsDoDwordSpaceDescriptor (
CurrentByteOffset = Info->CurrentByteOffset;
Rnode = RsAllocateResourceNode (
- sizeof (AML_RESOURCE_ADDRESS32) + 1 + StringLength);
+ sizeof (AML_RESOURCE_ADDRESS32) + 1 + StringLength);
Descriptor = Rnode->Buffer;
Descriptor->Address32.DescriptorType = ACPI_RESOURCE_NAME_ADDRESS32;
diff --git a/src/acpica/source/compiler/aslrestype2e.c b/src/acpica/source/compiler/aslrestype2e.c
index 2a24589..1f2cc95 100644
--- a/src/acpica/source/compiler/aslrestype2e.c
+++ b/src/acpica/source/compiler/aslrestype2e.c
@@ -159,14 +159,14 @@ RsDoExtendedIoDescriptor (
CurrentByteOffset = Info->CurrentByteOffset;
Rnode = RsAllocateResourceNode (
- sizeof (AML_RESOURCE_EXTENDED_ADDRESS64) + 1 + StringLength);
+ sizeof (AML_RESOURCE_EXTENDED_ADDRESS64) + 1 + StringLength);
Descriptor = Rnode->Buffer;
- Descriptor->ExtAddress64.DescriptorType = ACPI_RESOURCE_NAME_EXTENDED_ADDRESS64;
- Descriptor->ExtAddress64.ResourceType = ACPI_ADDRESS_TYPE_IO_RANGE;
- Descriptor->ExtAddress64.RevisionID = AML_RESOURCE_EXTENDED_ADDRESS_REVISION;
+ Descriptor->ExtAddress64.DescriptorType = ACPI_RESOURCE_NAME_EXTENDED_ADDRESS64;
+ Descriptor->ExtAddress64.ResourceType = ACPI_ADDRESS_TYPE_IO_RANGE;
+ Descriptor->ExtAddress64.RevisionID = AML_RESOURCE_EXTENDED_ADDRESS_REVISION;
- Descriptor->ExtAddress64.ResourceLength = (UINT16)
+ Descriptor->ExtAddress64.ResourceLength = (UINT16)
(sizeof (AML_RESOURCE_EXTENDED_ADDRESS64) -
sizeof (AML_RESOURCE_LARGE_HEADER));
@@ -335,11 +335,11 @@ RsDoExtendedMemoryDescriptor (
sizeof (AML_RESOURCE_EXTENDED_ADDRESS64) + 1 + StringLength);
Descriptor = Rnode->Buffer;
- Descriptor->ExtAddress64.DescriptorType = ACPI_RESOURCE_NAME_EXTENDED_ADDRESS64;
- Descriptor->ExtAddress64.ResourceType = ACPI_ADDRESS_TYPE_MEMORY_RANGE;
- Descriptor->ExtAddress64.RevisionID = AML_RESOURCE_EXTENDED_ADDRESS_REVISION;
+ Descriptor->ExtAddress64.DescriptorType = ACPI_RESOURCE_NAME_EXTENDED_ADDRESS64;
+ Descriptor->ExtAddress64.ResourceType = ACPI_ADDRESS_TYPE_MEMORY_RANGE;
+ Descriptor->ExtAddress64.RevisionID = AML_RESOURCE_EXTENDED_ADDRESS_REVISION;
- Descriptor->ExtAddress64.ResourceLength = (UINT16)
+ Descriptor->ExtAddress64.ResourceLength = (UINT16)
(sizeof (AML_RESOURCE_EXTENDED_ADDRESS64) -
sizeof (AML_RESOURCE_LARGE_HEADER));
@@ -513,13 +513,13 @@ RsDoExtendedSpaceDescriptor (
CurrentByteOffset = Info->CurrentByteOffset;
Rnode = RsAllocateResourceNode (
- sizeof (AML_RESOURCE_EXTENDED_ADDRESS64) + 1 + StringLength);
+ sizeof (AML_RESOURCE_EXTENDED_ADDRESS64) + 1 + StringLength);
Descriptor = Rnode->Buffer;
- Descriptor->ExtAddress64.DescriptorType = ACPI_RESOURCE_NAME_EXTENDED_ADDRESS64;
- Descriptor->ExtAddress64.RevisionID = AML_RESOURCE_EXTENDED_ADDRESS_REVISION;
+ Descriptor->ExtAddress64.DescriptorType = ACPI_RESOURCE_NAME_EXTENDED_ADDRESS64;
+ Descriptor->ExtAddress64.RevisionID = AML_RESOURCE_EXTENDED_ADDRESS_REVISION;
- Descriptor->ExtAddress64.ResourceLength = (UINT16)
+ Descriptor->ExtAddress64.ResourceLength = (UINT16)
(sizeof (AML_RESOURCE_EXTENDED_ADDRESS64) -
sizeof (AML_RESOURCE_LARGE_HEADER));
diff --git a/src/acpica/source/compiler/aslrestype2q.c b/src/acpica/source/compiler/aslrestype2q.c
index cfb0405..a24d554 100644
--- a/src/acpica/source/compiler/aslrestype2q.c
+++ b/src/acpica/source/compiler/aslrestype2q.c
@@ -163,11 +163,11 @@ RsDoQwordIoDescriptor (
CurrentByteOffset = Info->CurrentByteOffset;
Rnode = RsAllocateResourceNode (
- sizeof (AML_RESOURCE_ADDRESS64) + 1 + StringLength);
+ sizeof (AML_RESOURCE_ADDRESS64) + 1 + StringLength);
Descriptor = Rnode->Buffer;
- Descriptor->Address64.DescriptorType = ACPI_RESOURCE_NAME_ADDRESS64;
- Descriptor->Address64.ResourceType = ACPI_ADDRESS_TYPE_IO_RANGE;
+ Descriptor->Address64.DescriptorType = ACPI_RESOURCE_NAME_ADDRESS64;
+ Descriptor->Address64.ResourceType = ACPI_ADDRESS_TYPE_IO_RANGE;
/*
* Initial descriptor length -- may be enlarged if there are
@@ -384,11 +384,11 @@ RsDoQwordMemoryDescriptor (
CurrentByteOffset = Info->CurrentByteOffset;
Rnode = RsAllocateResourceNode (
- sizeof (AML_RESOURCE_ADDRESS64) + 1 + StringLength);
+ sizeof (AML_RESOURCE_ADDRESS64) + 1 + StringLength);
Descriptor = Rnode->Buffer;
- Descriptor->Address64.DescriptorType = ACPI_RESOURCE_NAME_ADDRESS64;
- Descriptor->Address64.ResourceType = ACPI_ADDRESS_TYPE_MEMORY_RANGE;
+ Descriptor->Address64.DescriptorType = ACPI_RESOURCE_NAME_ADDRESS64;
+ Descriptor->Address64.ResourceType = ACPI_ADDRESS_TYPE_MEMORY_RANGE;
/*
* Initial descriptor length -- may be enlarged if there are
@@ -613,7 +613,7 @@ RsDoQwordSpaceDescriptor (
CurrentByteOffset = Info->CurrentByteOffset;
Rnode = RsAllocateResourceNode (
- sizeof (AML_RESOURCE_ADDRESS64) + 1 + StringLength);
+ sizeof (AML_RESOURCE_ADDRESS64) + 1 + StringLength);
Descriptor = Rnode->Buffer;
Descriptor->Address64.DescriptorType = ACPI_RESOURCE_NAME_ADDRESS64;
diff --git a/src/acpica/source/compiler/aslrestype2s.c b/src/acpica/source/compiler/aslrestype2s.c
index 779edd0..469f06e 100644
--- a/src/acpica/source/compiler/aslrestype2s.c
+++ b/src/acpica/source/compiler/aslrestype2s.c
@@ -385,17 +385,19 @@ RsDoGpioIntDescriptor (
/* Allocate the local resource node and initialize */
- Rnode = RsAllocateResourceNode (DescriptorSize + sizeof (AML_RESOURCE_LARGE_HEADER));
+ Rnode = RsAllocateResourceNode (DescriptorSize +
+ sizeof (AML_RESOURCE_LARGE_HEADER));
Descriptor = Rnode->Buffer;
- Descriptor->Gpio.ResourceLength = DescriptorSize;
- Descriptor->Gpio.DescriptorType = ACPI_RESOURCE_NAME_GPIO;
- Descriptor->Gpio.RevisionId = AML_RESOURCE_GPIO_REVISION;
- Descriptor->Gpio.ConnectionType = AML_RESOURCE_GPIO_TYPE_INT;
+ Descriptor->Gpio.ResourceLength = DescriptorSize;
+ Descriptor->Gpio.DescriptorType = ACPI_RESOURCE_NAME_GPIO;
+ Descriptor->Gpio.RevisionId = AML_RESOURCE_GPIO_REVISION;
+ Descriptor->Gpio.ConnectionType = AML_RESOURCE_GPIO_TYPE_INT;
/* Build pointers to optional areas */
- InterruptList = ACPI_ADD_PTR (UINT16, Descriptor, sizeof (AML_RESOURCE_GPIO));
+ InterruptList = ACPI_ADD_PTR (UINT16, Descriptor,
+ sizeof (AML_RESOURCE_GPIO));
PinList = InterruptList;
ResourceSource = ACPI_ADD_PTR (char, InterruptList, InterruptLength);
VendorData = ACPI_ADD_PTR (UINT8, ResourceSource, ResSourceLength);
@@ -409,8 +411,10 @@ RsDoGpioIntDescriptor (
ACPI_PTR_DIFF (ResourceSource, Descriptor);
DbgPrint (ASL_DEBUG_OUTPUT,
- "%16s - Actual: %.2X, Base: %.2X, ResLen: %.2X, VendLen: %.2X, IntLen: %.2X\n",
- "GpioInt", Descriptor->Gpio.ResourceLength, (UINT16) sizeof (AML_RESOURCE_GPIO),
+ "%16s - Actual: %.2X, Base: %.2X, ResLen: "
+ "%.2X, VendLen: %.2X, IntLen: %.2X\n",
+ "GpioInt", Descriptor->Gpio.ResourceLength,
+ (UINT16) sizeof (AML_RESOURCE_GPIO),
ResSourceLength, VendorLength, InterruptLength);
/* Process all child initialization nodes */
@@ -469,7 +473,8 @@ RsDoGpioIntDescriptor (
if (InitializerOp->Asl.ParseOpcode != PARSEOP_DEFAULT_ARG)
{
- Descriptor->Gpio.ResSourceIndex = (UINT8) InitializerOp->Asl.Value.Integer;
+ Descriptor->Gpio.ResSourceIndex =
+ (UINT8) InitializerOp->Asl.Value.Integer;
}
break;
@@ -494,7 +499,7 @@ RsDoGpioIntDescriptor (
ACPI_PTR_DIFF (VendorData, Descriptor);
if (RsGetVendorData (InitializerOp, VendorData,
- (CurrentByteOffset + Descriptor->Gpio.VendorOffset)))
+ (CurrentByteOffset + Descriptor->Gpio.VendorOffset)))
{
Descriptor->Gpio.VendorLength = VendorLength;
}
@@ -540,7 +545,8 @@ RsDoGpioIntDescriptor (
InitializerOp = RsCompleteNodeAndGetNext (InitializerOp);
}
- MpSaveGpioInfo (Info->MappingOp, Descriptor, PinCount, PinList, ResourceSource);
+ MpSaveGpioInfo (Info->MappingOp, Descriptor,
+ PinCount, PinList, ResourceSource);
return (Rnode);
}
@@ -596,13 +602,14 @@ RsDoGpioIoDescriptor (
/* Allocate the local resource node and initialize */
- Rnode = RsAllocateResourceNode (DescriptorSize + sizeof (AML_RESOURCE_LARGE_HEADER));
+ Rnode = RsAllocateResourceNode (DescriptorSize +
+ sizeof (AML_RESOURCE_LARGE_HEADER));
Descriptor = Rnode->Buffer;
- Descriptor->Gpio.ResourceLength = DescriptorSize;
- Descriptor->Gpio.DescriptorType = ACPI_RESOURCE_NAME_GPIO;
- Descriptor->Gpio.RevisionId = AML_RESOURCE_GPIO_REVISION;
- Descriptor->Gpio.ConnectionType = AML_RESOURCE_GPIO_TYPE_IO;
+ Descriptor->Gpio.ResourceLength = DescriptorSize;
+ Descriptor->Gpio.DescriptorType = ACPI_RESOURCE_NAME_GPIO;
+ Descriptor->Gpio.RevisionId = AML_RESOURCE_GPIO_REVISION;
+ Descriptor->Gpio.ConnectionType = AML_RESOURCE_GPIO_TYPE_IO;
/* Build pointers to optional areas */
@@ -620,8 +627,10 @@ RsDoGpioIoDescriptor (
ACPI_PTR_DIFF (ResourceSource, Descriptor);
DbgPrint (ASL_DEBUG_OUTPUT,
- "%16s - Actual: %.2X, Base: %.2X, ResLen: %.2X, VendLen: %.2X, IntLen: %.2X\n",
- "GpioIo", Descriptor->Gpio.ResourceLength, (UINT16) sizeof (AML_RESOURCE_GPIO),
+ "%16s - Actual: %.2X, Base: %.2X, ResLen: "
+ "%.2X, VendLen: %.2X, IntLen: %.2X\n",
+ "GpioIo", Descriptor->Gpio.ResourceLength,
+ (UINT16) sizeof (AML_RESOURCE_GPIO),
ResSourceLength, VendorLength, InterruptLength);
/* Process all child initialization nodes */
@@ -704,7 +713,7 @@ RsDoGpioIoDescriptor (
ACPI_PTR_DIFF (VendorData, Descriptor);
if (RsGetVendorData (InitializerOp, VendorData,
- (CurrentByteOffset + Descriptor->Gpio.VendorOffset)))
+ (CurrentByteOffset + Descriptor->Gpio.VendorOffset)))
{
Descriptor->Gpio.VendorLength = VendorLength;
}
@@ -750,7 +759,8 @@ RsDoGpioIoDescriptor (
InitializerOp = RsCompleteNodeAndGetNext (InitializerOp);
}
- MpSaveGpioInfo (Info->MappingOp, Descriptor, PinCount, PinList, ResourceSource);
+ MpSaveGpioInfo (Info->MappingOp, Descriptor,
+ PinCount, PinList, ResourceSource);
return (Rnode);
}
@@ -799,14 +809,15 @@ RsDoI2cSerialBusDescriptor (
/* Allocate the local resource node and initialize */
- Rnode = RsAllocateResourceNode (DescriptorSize + sizeof (AML_RESOURCE_LARGE_HEADER));
+ Rnode = RsAllocateResourceNode (DescriptorSize +
+ sizeof (AML_RESOURCE_LARGE_HEADER));
Descriptor = Rnode->Buffer;
Descriptor->I2cSerialBus.ResourceLength = DescriptorSize;
Descriptor->I2cSerialBus.DescriptorType = ACPI_RESOURCE_NAME_SERIAL_BUS;
- Descriptor->I2cSerialBus.RevisionId = AML_RESOURCE_I2C_REVISION;
+ Descriptor->I2cSerialBus.RevisionId = AML_RESOURCE_I2C_REVISION;
Descriptor->I2cSerialBus.TypeRevisionId = AML_RESOURCE_I2C_TYPE_REVISION;
- Descriptor->I2cSerialBus.Type = AML_RESOURCE_I2C_SERIALBUSTYPE;
+ Descriptor->I2cSerialBus.Type = AML_RESOURCE_I2C_SERIALBUSTYPE;
Descriptor->I2cSerialBus.TypeDataLength = AML_RESOURCE_I2C_MIN_DATA_LEN + VendorLength;
/* Build pointers to optional areas */
@@ -815,7 +826,8 @@ RsDoI2cSerialBusDescriptor (
ResourceSource = ACPI_ADD_PTR (char, VendorData, VendorLength);
DbgPrint (ASL_DEBUG_OUTPUT,
- "%16s - Actual: %.2X, Base: %.2X, ResLen: %.2X, VendLen: %.2X, TypLen: %.2X\n",
+ "%16s - Actual: %.2X, Base: %.2X, ResLen: "
+ "%.2X, VendLen: %.2X, TypLen: %.2X\n",
"I2cSerialBus", Descriptor->I2cSerialBus.ResourceLength,
(UINT16) sizeof (AML_RESOURCE_I2C_SERIALBUS), ResSourceLength,
VendorLength, Descriptor->I2cSerialBus.TypeDataLength);
@@ -869,7 +881,8 @@ RsDoI2cSerialBusDescriptor (
if (InitializerOp->Asl.ParseOpcode != PARSEOP_DEFAULT_ARG)
{
- Descriptor->I2cSerialBus.ResSourceIndex = (UINT8) InitializerOp->Asl.Value.Integer;
+ Descriptor->I2cSerialBus.ResSourceIndex =
+ (UINT8) InitializerOp->Asl.Value.Integer;
}
break;
@@ -946,23 +959,26 @@ RsDoSpiSerialBusDescriptor (
/* Allocate the local resource node and initialize */
- Rnode = RsAllocateResourceNode (DescriptorSize + sizeof (AML_RESOURCE_LARGE_HEADER));
+ Rnode = RsAllocateResourceNode (DescriptorSize +
+ sizeof (AML_RESOURCE_LARGE_HEADER));
Descriptor = Rnode->Buffer;
Descriptor->SpiSerialBus.ResourceLength = DescriptorSize;
Descriptor->SpiSerialBus.DescriptorType = ACPI_RESOURCE_NAME_SERIAL_BUS;
- Descriptor->SpiSerialBus.RevisionId = AML_RESOURCE_SPI_REVISION;
+ Descriptor->SpiSerialBus.RevisionId = AML_RESOURCE_SPI_REVISION;
Descriptor->SpiSerialBus.TypeRevisionId = AML_RESOURCE_SPI_TYPE_REVISION;
- Descriptor->SpiSerialBus.Type = AML_RESOURCE_SPI_SERIALBUSTYPE;
+ Descriptor->SpiSerialBus.Type = AML_RESOURCE_SPI_SERIALBUSTYPE;
Descriptor->SpiSerialBus.TypeDataLength = AML_RESOURCE_SPI_MIN_DATA_LEN + VendorLength;
/* Build pointers to optional areas */
- VendorData = ACPI_ADD_PTR (UINT8, Descriptor, sizeof (AML_RESOURCE_SPI_SERIALBUS));
+ VendorData = ACPI_ADD_PTR (UINT8, Descriptor,
+ sizeof (AML_RESOURCE_SPI_SERIALBUS));
ResourceSource = ACPI_ADD_PTR (char, VendorData, VendorLength);
DbgPrint (ASL_DEBUG_OUTPUT,
- "%16s - Actual: %.2X, Base: %.2X, ResLen: %.2X, VendLen: %.2X, TypLen: %.2X\n",
+ "%16s - Actual: %.2X, Base: %.2X, ResLen: "
+ "%.2X, VendLen: %.2X, TypLen: %.2X\n",
"SpiSerialBus", Descriptor->SpiSerialBus.ResourceLength,
(UINT16) sizeof (AML_RESOURCE_SPI_SERIALBUS), ResSourceLength,
VendorLength, Descriptor->SpiSerialBus.TypeDataLength);
@@ -1044,7 +1060,8 @@ RsDoSpiSerialBusDescriptor (
if (InitializerOp->Asl.ParseOpcode != PARSEOP_DEFAULT_ARG)
{
- Descriptor->SpiSerialBus.ResSourceIndex = (UINT8) InitializerOp->Asl.Value.Integer;
+ Descriptor->SpiSerialBus.ResSourceIndex =
+ (UINT8) InitializerOp->Asl.Value.Integer;
}
break;
@@ -1121,14 +1138,15 @@ RsDoUartSerialBusDescriptor (
/* Allocate the local resource node and initialize */
- Rnode = RsAllocateResourceNode (DescriptorSize + sizeof (AML_RESOURCE_LARGE_HEADER));
+ Rnode = RsAllocateResourceNode (DescriptorSize +
+ sizeof (AML_RESOURCE_LARGE_HEADER));
Descriptor = Rnode->Buffer;
Descriptor->UartSerialBus.ResourceLength = DescriptorSize;
Descriptor->UartSerialBus.DescriptorType = ACPI_RESOURCE_NAME_SERIAL_BUS;
- Descriptor->UartSerialBus.RevisionId = AML_RESOURCE_UART_REVISION;
+ Descriptor->UartSerialBus.RevisionId = AML_RESOURCE_UART_REVISION;
Descriptor->UartSerialBus.TypeRevisionId = AML_RESOURCE_UART_TYPE_REVISION;
- Descriptor->UartSerialBus.Type = AML_RESOURCE_UART_SERIALBUSTYPE;
+ Descriptor->UartSerialBus.Type = AML_RESOURCE_UART_SERIALBUSTYPE;
Descriptor->UartSerialBus.TypeDataLength = AML_RESOURCE_UART_MIN_DATA_LEN + VendorLength;
/* Build pointers to optional areas */
@@ -1137,7 +1155,8 @@ RsDoUartSerialBusDescriptor (
ResourceSource = ACPI_ADD_PTR (char, VendorData, VendorLength);
DbgPrint (ASL_DEBUG_OUTPUT,
- "%16s - Actual: %.2X, Base: %.2X, ResLen: %.2X, VendLen: %.2X, TypLen: %.2X\n",
+ "%16s - Actual: %.2X, Base: %.2X, ResLen: "
+ "%.2X, VendLen: %.2X, TypLen: %.2X\n",
"UartSerialBus", Descriptor->UartSerialBus.ResourceLength,
(UINT16) sizeof (AML_RESOURCE_UART_SERIALBUS), ResSourceLength,
VendorLength, Descriptor->UartSerialBus.TypeDataLength);
@@ -1226,7 +1245,8 @@ RsDoUartSerialBusDescriptor (
if (InitializerOp->Asl.ParseOpcode != PARSEOP_DEFAULT_ARG)
{
- Descriptor->UartSerialBus.ResSourceIndex = (UINT8) InitializerOp->Asl.Value.Integer;
+ Descriptor->UartSerialBus.ResSourceIndex =
+ (UINT8) InitializerOp->Asl.Value.Integer;
}
break;
diff --git a/src/acpica/source/compiler/aslrestype2w.c b/src/acpica/source/compiler/aslrestype2w.c
index d00a979..1103ac4 100644
--- a/src/acpica/source/compiler/aslrestype2w.c
+++ b/src/acpica/source/compiler/aslrestype2w.c
@@ -163,11 +163,11 @@ RsDoWordIoDescriptor (
CurrentByteOffset = Info->CurrentByteOffset;
Rnode = RsAllocateResourceNode (
- sizeof (AML_RESOURCE_ADDRESS16) + 1 + StringLength);
+ sizeof (AML_RESOURCE_ADDRESS16) + 1 + StringLength);
Descriptor = Rnode->Buffer;
- Descriptor->Address16.DescriptorType = ACPI_RESOURCE_NAME_ADDRESS16;
- Descriptor->Address16.ResourceType = ACPI_ADDRESS_TYPE_IO_RANGE;
+ Descriptor->Address16.DescriptorType = ACPI_RESOURCE_NAME_ADDRESS16;
+ Descriptor->Address16.ResourceType = ACPI_ADDRESS_TYPE_IO_RANGE;
/*
* Initial descriptor length -- may be enlarged if there are
@@ -384,11 +384,11 @@ RsDoWordBusNumberDescriptor (
CurrentByteOffset = Info->CurrentByteOffset;
Rnode = RsAllocateResourceNode (
- sizeof (AML_RESOURCE_ADDRESS16) + 1 + StringLength);
+ sizeof (AML_RESOURCE_ADDRESS16) + 1 + StringLength);
Descriptor = Rnode->Buffer;
- Descriptor->Address16.DescriptorType = ACPI_RESOURCE_NAME_ADDRESS16;
- Descriptor->Address16.ResourceType = ACPI_ADDRESS_TYPE_BUS_NUMBER_RANGE;
+ Descriptor->Address16.DescriptorType = ACPI_RESOURCE_NAME_ADDRESS16;
+ Descriptor->Address16.ResourceType = ACPI_ADDRESS_TYPE_BUS_NUMBER_RANGE;
/*
* Initial descriptor length -- may be enlarged if there are
@@ -589,10 +589,10 @@ RsDoWordSpaceDescriptor (
CurrentByteOffset = Info->CurrentByteOffset;
Rnode = RsAllocateResourceNode (
- sizeof (AML_RESOURCE_ADDRESS16) + 1 + StringLength);
+ sizeof (AML_RESOURCE_ADDRESS16) + 1 + StringLength);
Descriptor = Rnode->Buffer;
- Descriptor->Address16.DescriptorType = ACPI_RESOURCE_NAME_ADDRESS16;
+ Descriptor->Address16.DescriptorType = ACPI_RESOURCE_NAME_ADDRESS16;
/*
* Initial descriptor length -- may be enlarged if there are
diff --git a/src/acpica/source/compiler/aslrules.y b/src/acpica/source/compiler/aslrules.y
index 789df32..4608f8d 100644
--- a/src/acpica/source/compiler/aslrules.y
+++ b/src/acpica/source/compiler/aslrules.y
@@ -126,11 +126,12 @@ NoEcho('
* Root term. Allow multiple #line directives before the definition block
* to handle output from preprocessors
*/
-ASLCode
- : DefinitionBlockTerm
+AslCode
+ : DefinitionBlockList {$<n>$ = TrLinkChildren (TrCreateLeafNode (PARSEOP_ASL_CODE),1, $1);}
| error {YYABORT; $$ = NULL;}
;
+
/*
* Note concerning support for "module-level code".
*
@@ -147,7 +148,7 @@ ASLCode
* of Type1 and Type2 opcodes at module level.
*/
DefinitionBlockTerm
- : PARSEOP_DEFINITIONBLOCK '(' {$<n>$ = TrCreateLeafNode (PARSEOP_DEFINITIONBLOCK);}
+ : PARSEOP_DEFINITION_BLOCK '(' {$<n>$ = TrCreateLeafNode (PARSEOP_DEFINITION_BLOCK);}
String ','
String ','
ByteConst ','
@@ -158,6 +159,12 @@ DefinitionBlockTerm
'{' TermList '}' {$$ = TrLinkChildren ($<n>3,7,$4,$6,$8,$10,$12,$14,$18);}
;
+DefinitionBlockList
+ : DefinitionBlockTerm
+ | DefinitionBlockTerm
+ DefinitionBlockList {$$ = TrLinkPeerNodes (2, $1,$2);}
+ ;
+
SuperName
: NameString {}
| ArgTerm {}
diff --git a/src/acpica/source/compiler/aslstubs.c b/src/acpica/source/compiler/aslstubs.c
index bdb94c1..6c61421 100644
--- a/src/acpica/source/compiler/aslstubs.c
+++ b/src/acpica/source/compiler/aslstubs.c
@@ -342,3 +342,45 @@ AcpiTbFindTable (
{
return (AE_SUPPORT);
}
+
+ACPI_STATUS
+AcpiNsLoadTable (
+ UINT32 TableIndex,
+ ACPI_NAMESPACE_NODE *Node)
+{
+ return (AE_NOT_IMPLEMENTED);
+}
+
+ACPI_STATUS
+AcpiDsRestartControlMethod (
+ ACPI_WALK_STATE *WalkState,
+ ACPI_OPERAND_OBJECT *ReturnDesc)
+{
+ return (AE_OK);
+}
+
+void
+AcpiDsTerminateControlMethod (
+ ACPI_OPERAND_OBJECT *MethodDesc,
+ ACPI_WALK_STATE *WalkState)
+{
+ return;
+}
+
+ACPI_STATUS
+AcpiDsCallControlMethod (
+ ACPI_THREAD_STATE *Thread,
+ ACPI_WALK_STATE *WalkState,
+ ACPI_PARSE_OBJECT *Op)
+{
+ return (AE_OK);
+}
+
+ACPI_STATUS
+AcpiDsMethodDataInitArgs (
+ ACPI_OPERAND_OBJECT **Params,
+ UINT32 MaxParamCount,
+ ACPI_WALK_STATE *WalkState)
+{
+ return (AE_OK);
+}
diff --git a/src/acpica/source/compiler/asltokens.y b/src/acpica/source/compiler/asltokens.y
index 89ce095..8dfd567 100644
--- a/src/acpica/source/compiler/asltokens.y
+++ b/src/acpica/source/compiler/asltokens.y
@@ -196,7 +196,7 @@ NoEcho('
%token <i> PARSEOP_DECREMENT
%token <i> PARSEOP_DEFAULT
%token <i> PARSEOP_DEFAULT_ARG
-%token <i> PARSEOP_DEFINITIONBLOCK
+%token <i> PARSEOP_DEFINITION_BLOCK
%token <i> PARSEOP_DEREFOF
%token <i> PARSEOP_DEVICE
%token <i> PARSEOP_DEVICEPOLARITY_HIGH
@@ -536,6 +536,9 @@ NoEcho('
/* PARSEOP_EXP_PAREN_OPEN */
/* PARSEOP_EXP_PAREN_CLOSE */
+
+%token <i> PARSEOP_ASL_CODE
+
/*
* Special functions. These should probably stay at the end of this
* table.
diff --git a/src/acpica/source/compiler/asltransform.c b/src/acpica/source/compiler/asltransform.c
index df5d994..fd91965 100644
--- a/src/acpica/source/compiler/asltransform.c
+++ b/src/acpica/source/compiler/asltransform.c
@@ -183,7 +183,7 @@ TrAmlGetNextTempName (
char *TempName;
- if (*TempCount >= (10+26)) /* 0-35 valid: 0-9 and A-Z for TempName[3] */
+ if (*TempCount >= (10 + 26)) /* 0-35 valid: 0-9 and A-Z for TempName[3] */
{
/* Too many temps */
@@ -201,6 +201,7 @@ TrAmlGetNextTempName (
{
TempName[3] = (char) (*TempCount + ('A' - 10));
}
+
(*TempCount)++;
/* First three characters are always "_T_" */
@@ -289,7 +290,7 @@ TrAmlSetSubtreeParent (
while (Next)
{
Next->Asl.Parent = Parent;
- Next = Next->Asl.Next;
+ Next = Next->Asl.Next;
}
}
@@ -314,7 +315,7 @@ TrAmlInsertPeer (
{
NewPeer->Asl.Next = Op->Asl.Next;
- Op->Asl.Next = NewPeer;
+ Op->Asl.Next = NewPeer;
}
@@ -369,7 +370,7 @@ TrTransformSubtree (
switch (Op->Asl.ParseOpcode)
{
- case PARSEOP_DEFINITIONBLOCK:
+ case PARSEOP_DEFINITION_BLOCK:
TrDoDefinitionBlock (Op);
break;
@@ -520,7 +521,7 @@ TrDoSwitch (
{
/* Add an ELSE to complete the previous CASE */
- NewOp = TrCreateLeafNode (PARSEOP_ELSE);
+ NewOp = TrCreateLeafNode (PARSEOP_ELSE);
NewOp->Asl.Parent = Conditional->Asl.Parent;
TrAmlInitLineNumbers (NewOp, NewOp->Asl.Parent);
@@ -530,9 +531,9 @@ TrDoSwitch (
CurrentParentNode = NewOp;
}
- CaseOp = Next;
+ CaseOp = Next;
Conditional = CaseOp;
- CaseBlock = CaseOp->Asl.Child->Asl.Next;
+ CaseBlock = CaseOp->Asl.Child->Asl.Next;
Conditional->Asl.Child->Asl.Next = NULL;
Predicate = CaseOp->Asl.Child;
@@ -609,7 +610,7 @@ TrDoSwitch (
* CaseOp->Child->Peer is the beginning of the case block
*/
NewOp = TrCreateValuedLeafNode (PARSEOP_NAMESTRING,
- (UINT64) ACPI_TO_INTEGER (PredicateValueName));
+ (UINT64) ACPI_TO_INTEGER (PredicateValueName));
NewOp->Asl.Next = Predicate;
TrAmlInitLineNumbers (NewOp, Predicate);
@@ -672,7 +673,7 @@ TrDoSwitch (
/* Unknown peer opcode */
AcpiOsPrintf ("Unknown parse opcode for switch statement: %s (%u)\n",
- Next->Asl.ParseOpName, Next->Asl.ParseOpcode);
+ Next->Asl.ParseOpName, Next->Asl.ParseOpcode);
}
}
@@ -717,7 +718,7 @@ TrDoSwitch (
Next = StartNode;
while ((Next->Asl.ParseOpcode != PARSEOP_METHOD) &&
- (Next->Asl.ParseOpcode != PARSEOP_DEFINITIONBLOCK))
+ (Next->Asl.ParseOpcode != PARSEOP_DEFINITION_BLOCK))
{
Next = Next->Asl.Parent;
}
@@ -740,7 +741,8 @@ TrDoSwitch (
*/
if (Next->Asl.ParseOpcode != PARSEOP_SERIALIZERULE_SERIAL)
{
- AslError (ASL_REMARK, ASL_MSG_SERIALIZED, MethodOp, "Due to use of Switch operator");
+ AslError (ASL_REMARK, ASL_MSG_SERIALIZED, MethodOp,
+ "Due to use of Switch operator");
Next->Asl.ParseOpcode = PARSEOP_SERIALIZERULE_SERIAL;
}
@@ -754,7 +756,7 @@ TrDoSwitch (
/* Create the NameSeg child for the Name node */
NewOp2 = TrCreateValuedLeafNode (PARSEOP_NAMESEG,
- (UINT64) ACPI_TO_INTEGER (PredicateValueName));
+ (UINT64) ACPI_TO_INTEGER (PredicateValueName));
TrAmlInitLineNumbers (NewOp2, NewOp);
NewOp2->Asl.CompileFlags |= NODE_IS_NAME_DECLARATION;
NewOp->Asl.Child = NewOp2;
@@ -766,25 +768,25 @@ TrDoSwitch (
case ACPI_BTYPE_INTEGER:
NewOp2->Asl.Next = TrCreateValuedLeafNode (PARSEOP_ZERO,
- (UINT64) 0);
+ (UINT64) 0);
TrAmlInitLineNumbers (NewOp2->Asl.Next, NewOp);
break;
case ACPI_BTYPE_STRING:
NewOp2->Asl.Next = TrCreateValuedLeafNode (PARSEOP_STRING_LITERAL,
- (UINT64) ACPI_TO_INTEGER (""));
+ (UINT64) ACPI_TO_INTEGER (""));
TrAmlInitLineNumbers (NewOp2->Asl.Next, NewOp);
break;
case ACPI_BTYPE_BUFFER:
(void) TrLinkPeerNode (NewOp2, TrCreateValuedLeafNode (PARSEOP_BUFFER,
- (UINT64) 0));
+ (UINT64) 0));
Next = NewOp2->Asl.Next;
TrAmlInitLineNumbers (Next, NewOp2);
(void) TrLinkChildren (Next, 1, TrCreateValuedLeafNode (PARSEOP_ZERO,
- (UINT64) 1));
+ (UINT64) 1));
TrAmlInitLineNumbers (Next->Asl.Child, Next);
BufferOp = TrCreateValuedLeafNode (PARSEOP_DEFAULT_ARG, (UINT64) 0);
@@ -827,7 +829,7 @@ TrDoSwitch (
Predicate->Asl.Parent = StoreOp;
NewOp = TrCreateValuedLeafNode (PARSEOP_NAMESEG,
- (UINT64) ACPI_TO_INTEGER (PredicateValueName));
+ (UINT64) ACPI_TO_INTEGER (PredicateValueName));
TrAmlInitLineNumbers (NewOp, StoreOp);
NewOp->Asl.Parent = StoreOp;
Predicate->Asl.Next = NewOp;
diff --git a/src/acpica/source/compiler/asltree.c b/src/acpica/source/compiler/asltree.c
index e54a690..6948b5d 100644
--- a/src/acpica/source/compiler/asltree.c
+++ b/src/acpica/source/compiler/asltree.c
@@ -412,6 +412,11 @@ TrPrintNodeCompileFlags (
FlagName = "NODE_METHOD_TYPED";
break;
+ case NODE_COULD_NOT_REDUCE:
+
+ FlagName = "NODE_COULD_NOT_REDUCE";
+ break;
+
case NODE_COMPILE_TIME_CONST:
FlagName = "NODE_COMPILE_TIME_CONST";
@@ -561,7 +566,7 @@ TrSetEndLineNumber (
return;
}
- Op->Asl.EndLine = Gbl_CurrentLineNumber;
+ Op->Asl.EndLine = Gbl_CurrentLineNumber;
Op->Asl.EndLogicalLine = Gbl_LogicalLineNumber;
}
@@ -825,7 +830,8 @@ TrCreateConstantLeafNode (
}
DbgPrint (ASL_PARSE_OUTPUT,
- "\nCreateConstantLeafNode Ln/Col %u/%u NewNode %p Op %s Value %8.8X%8.8X \n",
+ "\nCreateConstantLeafNode Ln/Col %u/%u NewNode %p "
+ "Op %s Value %8.8X%8.8X \n",
Op->Asl.LineNumber, Op->Asl.Column, Op, UtGetOpName (ParseOpcode),
ACPI_FORMAT_UINT64 (Op->Asl.Value.Integer));
return (Op);
@@ -932,7 +938,8 @@ TrCreateValuedLeafNode (
Op = TrAllocateNode (ParseOpcode);
DbgPrint (ASL_PARSE_OUTPUT,
- "\nCreateValuedLeafNode Ln/Col %u/%u NewNode %p Op %s Value %8.8X%8.8X ",
+ "\nCreateValuedLeafNode Ln/Col %u/%u NewNode %p "
+ "Op %s Value %8.8X%8.8X ",
Op->Asl.LineNumber, Op->Asl.Column, Op, UtGetOpName(ParseOpcode),
ACPI_FORMAT_UINT64 (Value));
Op->Asl.Value.Integer = Value;
@@ -1018,15 +1025,22 @@ TrCreateNode (
DbgPrint (ASL_PARSE_OUTPUT,
"\nCreateNode Ln/Col %u/%u NewParent %p Child %u Op %s ",
- Op->Asl.LineNumber, Op->Asl.Column, Op, NumChildren, UtGetOpName(ParseOpcode));
+ Op->Asl.LineNumber, Op->Asl.Column, Op,
+ NumChildren, UtGetOpName(ParseOpcode));
/* Some extra debug output based on the parse opcode */
switch (ParseOpcode)
{
- case PARSEOP_DEFINITIONBLOCK:
+ case PARSEOP_ASL_CODE:
RootNode = Op;
+ Op->Asl.ParseOpcode = PARSEOP_DEFAULT_ARG;
+ DbgPrint (ASL_PARSE_OUTPUT, "ASLCODE (Tree Completed)->");
+ break;
+
+ case PARSEOP_DEFINITION_BLOCK:
+
DbgPrint (ASL_PARSE_OUTPUT, "DEFINITION_BLOCK (Tree Completed)->");
break;
@@ -1147,9 +1161,15 @@ TrLinkChildren (
switch (Op->Asl.ParseOpcode)
{
- case PARSEOP_DEFINITIONBLOCK:
+ case PARSEOP_ASL_CODE:
RootNode = Op;
+ Op->Asl.ParseOpcode = PARSEOP_DEFAULT_ARG;
+ DbgPrint (ASL_PARSE_OUTPUT, "ASLCODE (Tree Completed)->");
+ break;
+
+ case PARSEOP_DEFINITION_BLOCK:
+
DbgPrint (ASL_PARSE_OUTPUT, "DEFINITION_BLOCK (Tree Completed)->");
break;
@@ -1227,6 +1247,7 @@ TrLinkChildren (
Child = Child->Asl.Next;
Child->Asl.Parent = Op;
}
+
PrevChild = Child;
}
diff --git a/src/acpica/source/compiler/asltypes.h b/src/acpica/source/compiler/asltypes.h
index b08c5df..34340a5 100644
--- a/src/acpica/source/compiler/asltypes.h
+++ b/src/acpica/source/compiler/asltypes.h
@@ -138,7 +138,7 @@
#define NODE_METHOD_SOME_NO_RETVAL 0x00000200
#define NODE_RESULT_NOT_USED 0x00000400
#define NODE_METHOD_TYPED 0x00000800
-#define NODE_UNUSED_FLAG 0x00001000
+#define NODE_COULD_NOT_REDUCE 0x00001000
#define NODE_COMPILE_TIME_CONST 0x00002000
#define NODE_IS_TERM_ARG 0x00004000
#define NODE_WAS_ONES_OP 0x00008000
diff --git a/src/acpica/source/compiler/asltypes.y b/src/acpica/source/compiler/asltypes.y
index 832d67c..52ea9c3 100644
--- a/src/acpica/source/compiler/asltypes.y
+++ b/src/acpica/source/compiler/asltypes.y
@@ -123,12 +123,13 @@ NoEcho('
*****************************************************************************/
%type <n> ArgList
-%type <n> ASLCode
+%type <n> AslCode
%type <n> BufferData
%type <n> BufferTermData
%type <n> CompilerDirective
%type <n> DataObject
%type <n> DefinitionBlockTerm
+%type <n> DefinitionBlockList
%type <n> IntegerData
%type <n> NamedObject
%type <n> NameSpaceModifier
diff --git a/src/acpica/source/compiler/aslutils.c b/src/acpica/source/compiler/aslutils.c
index 6c0e757..374fe50 100644
--- a/src/acpica/source/compiler/aslutils.c
+++ b/src/acpica/source/compiler/aslutils.c
@@ -271,7 +271,6 @@ UtBeginEvent (
AslGbl_Events[AslGbl_NextEvent].StartTime = AcpiOsGetTimer ();
AslGbl_Events[AslGbl_NextEvent].EventName = Name;
AslGbl_Events[AslGbl_NextEvent].Valid = TRUE;
-
return (AslGbl_NextEvent++);
}
@@ -878,6 +877,7 @@ UtPadNameWithUnderscores (
{
*PaddedNameSeg = '_';
}
+
PaddedNameSeg++;
}
}
@@ -1162,7 +1162,7 @@ stroul64 (
/* Check to see if value is out of range: */
if (ReturnValue > ((ACPI_UINT64_MAX - (UINT64) Index) /
- (UINT64) Base))
+ (UINT64) Base))
{
goto ErrorExit;
}
diff --git a/src/acpica/source/compiler/asluuid.c b/src/acpica/source/compiler/asluuid.c
index b9854b9..f1c47fe 100644
--- a/src/acpica/source/compiler/asluuid.c
+++ b/src/acpica/source/compiler/asluuid.c
@@ -119,7 +119,7 @@
ACPI_MODULE_NAME ("asluuid")
-extern UINT8 AcpiGbl_MapToUuidOffset[UUID_BUFFER_LENGTH];
+extern UINT8 AcpiGbl_MapToUuidOffset[UUID_BUFFER_LENGTH];
/*******************************************************************************
@@ -162,11 +162,10 @@ AuValidateUuid (
return (AE_BAD_PARAMETER);
}
}
-
- /* All other positions must contain hex digits */
-
else
{
+ /* All other positions must contain hex digits */
+
if (!isxdigit ((int) InString[i]))
{
return (AE_BAD_PARAMETER);
diff --git a/src/acpica/source/compiler/aslxref.c b/src/acpica/source/compiler/aslxref.c
index 200abf3..82e053b 100644
--- a/src/acpica/source/compiler/aslxref.c
+++ b/src/acpica/source/compiler/aslxref.c
@@ -220,7 +220,7 @@ XfCrossReferenceNamespace (
/* Walk the entire parse tree */
TrWalkParseTree (RootNode, ASL_WALK_VISIT_TWICE, XfNamespaceLocateBegin,
- XfNamespaceLocateEnd, WalkState);
+ XfNamespaceLocateEnd, WalkState);
ACPI_FREE (WalkState);
return (AE_OK);
@@ -249,8 +249,8 @@ XfObjectExists (
/* Walk entire namespace from the supplied root */
Status = AcpiNsWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT,
- ACPI_UINT32_MAX, FALSE, XfCompareOneNamespaceObject, NULL,
- Name, NULL);
+ ACPI_UINT32_MAX, FALSE, XfCompareOneNamespaceObject, NULL,
+ Name, NULL);
if (Status == AE_CTRL_TRUE)
{
/* At least one instance of the name was found */
@@ -647,6 +647,7 @@ XfNamespaceLocateBegin (
{
NextOp = NextOp->Asl.Next;
}
+
Path = NextOp->Asl.Value.String;
}
else
@@ -668,7 +669,7 @@ XfNamespaceLocateBegin (
Gbl_NsLookupCount++;
Status = AcpiNsLookup (WalkState->ScopeInfo, Path, ObjectType,
- ACPI_IMODE_EXECUTE, Flags, WalkState, &(Node));
+ ACPI_IMODE_EXECUTE, Flags, WalkState, &(Node));
if (ACPI_FAILURE (Status))
{
if (Status == AE_NOT_FOUND)
@@ -850,7 +851,8 @@ XfNamespaceLocateBegin (
if (Message)
{
- sprintf (MsgBuffer, "Size mismatch, Tag: %u bit%s, Field: %u bit%s",
+ sprintf (MsgBuffer,
+ "Size mismatch, Tag: %u bit%s, Field: %u bit%s",
TagBitLength, (TagBitLength > 1) ? "s" : "",
FieldBitLength, (FieldBitLength > 1) ? "s" : "");
@@ -919,7 +921,7 @@ XfNamespaceLocateBegin (
if (Node->Type != ACPI_TYPE_METHOD)
{
sprintf (MsgBuffer, "%s is a %s",
- Op->Asl.ExternalName, AcpiUtGetTypeName (Node->Type));
+ Op->Asl.ExternalName, AcpiUtGetTypeName (Node->Type));
AslError (ASL_ERROR, ASL_MSG_NOT_METHOD, Op, MsgBuffer);
return_ACPI_STATUS (AE_OK);
@@ -942,7 +944,7 @@ XfNamespaceLocateBegin (
UtSetParseOpName (Op);
PassedArgs = 0;
- NextOp = Op->Asl.Child;
+ NextOp = Op->Asl.Child;
while (NextOp)
{
@@ -1048,7 +1050,8 @@ XfNamespaceLocateBegin (
case ACPI_ADR_SPACE_CMOS:
case ACPI_ADR_SPACE_GPIO:
- if ((UINT8) Op->Asl.Parent->Asl.Value.Integer != AML_FIELD_ACCESS_BYTE)
+ if ((UINT8) Op->Asl.Parent->Asl.Value.Integer !=
+ AML_FIELD_ACCESS_BYTE)
{
AslError (ASL_ERROR, ASL_MSG_REGION_BYTE_ACCESS, Op, NULL);
}
@@ -1058,7 +1061,8 @@ XfNamespaceLocateBegin (
case ACPI_ADR_SPACE_IPMI:
case ACPI_ADR_SPACE_GSBUS:
- if ((UINT8) Op->Asl.Parent->Asl.Value.Integer != AML_FIELD_ACCESS_BUFFER)
+ if ((UINT8) Op->Asl.Parent->Asl.Value.Integer !=
+ AML_FIELD_ACCESS_BUFFER)
{
AslError (ASL_ERROR, ASL_MSG_REGION_BUFFER_ACCESS, Op, NULL);
}
@@ -1086,10 +1090,10 @@ XfNamespaceLocateBegin (
if (Op->Asl.Parent->Asl.ExtraValue && Op->Asl.Child)
{
XfCheckFieldRange (Op,
- Op->Asl.Parent->Asl.ExtraValue,
- Op->Asl.ExtraValue,
- (UINT32) Op->Asl.Child->Asl.Value.Integer,
- Op->Asl.Child->Asl.ExtraValue);
+ Op->Asl.Parent->Asl.ExtraValue,
+ Op->Asl.ExtraValue,
+ (UINT32) Op->Asl.Child->Asl.Value.Integer,
+ Op->Asl.Child->Asl.ExtraValue);
}
}
}
diff --git a/src/acpica/source/compiler/dtcompile.c b/src/acpica/source/compiler/dtcompile.c
index 98d663e..a863b48 100644
--- a/src/acpica/source/compiler/dtcompile.c
+++ b/src/acpica/source/compiler/dtcompile.c
@@ -417,7 +417,7 @@ DtCompileDataTable (
DtInsertCompilerIds (*FieldList);
Status = DtCompileTable (FieldList, AcpiDmTableInfoHeader,
- &Gbl_RootTable, TRUE);
+ &Gbl_RootTable, TRUE);
if (ACPI_FAILURE (Status))
{
return (Status);
@@ -454,7 +454,7 @@ DtCompileDataTable (
Subtable = NULL;
Status = DtCompileTable (FieldList, TableData->TableInfo,
- &Subtable, TRUE);
+ &Subtable, TRUE);
if (ACPI_FAILURE (Status))
{
return (Status);
@@ -711,6 +711,57 @@ Error:
/******************************************************************************
*
+ * FUNCTION: DtCompileTwoSubtables
+ *
+ * PARAMETERS: List - Current field list pointer
+ * TableInfo1 - Info table 1
+ * TableInfo1 - Info table 2
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Compile tables with a header and one or more same subtables.
+ * Include CPEP, EINJ, ERST, MCFG, MSCT, WDAT
+ *
+ *****************************************************************************/
+
+ACPI_STATUS
+DtCompileTwoSubtables (
+ void **List,
+ ACPI_DMTABLE_INFO *TableInfo1,
+ ACPI_DMTABLE_INFO *TableInfo2)
+{
+ ACPI_STATUS Status;
+ DT_SUBTABLE *Subtable;
+ DT_SUBTABLE *ParentTable;
+ DT_FIELD **PFieldList = (DT_FIELD **) List;
+
+
+ Status = DtCompileTable (PFieldList, TableInfo1, &Subtable, TRUE);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ ParentTable = DtPeekSubtable ();
+ DtInsertSubtable (ParentTable, Subtable);
+
+ while (*PFieldList)
+ {
+ Status = DtCompileTable (PFieldList, TableInfo2, &Subtable, FALSE);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ DtInsertSubtable (ParentTable, Subtable);
+ }
+
+ return (AE_OK);
+}
+
+
+/******************************************************************************
+ *
* FUNCTION: DtCompilePadding
*
* PARAMETERS: Length - Padding field size
diff --git a/src/acpica/source/compiler/dtcompiler.h b/src/acpica/source/compiler/dtcompiler.h
index b40f371..8a74c23 100644
--- a/src/acpica/source/compiler/dtcompiler.h
+++ b/src/acpica/source/compiler/dtcompiler.h
@@ -244,6 +244,12 @@ DtCompileTable (
BOOLEAN Required);
ACPI_STATUS
+DtCompileTwoSubtables (
+ void **List,
+ ACPI_DMTABLE_INFO *TableInfo1,
+ ACPI_DMTABLE_INFO *TableInfo2);
+
+ACPI_STATUS
DtCompilePadding (
UINT32 Length,
DT_SUBTABLE **RetSubtable);
diff --git a/src/acpica/source/compiler/dtexpress.c b/src/acpica/source/compiler/dtexpress.c
index e5af53b..6e0858a 100644
--- a/src/acpica/source/compiler/dtexpress.c
+++ b/src/acpica/source/compiler/dtexpress.c
@@ -219,6 +219,7 @@ DtDoOperator (
Gbl_CurrentField, NULL);
return (0);
}
+
Result = LeftValue / RightValue;
break;
@@ -230,6 +231,7 @@ DtDoOperator (
Gbl_CurrentField, NULL);
return (0);
}
+
Result = LeftValue % RightValue;
break;
@@ -489,6 +491,7 @@ DtLookupLabel (
{
return (LabelField);
}
+
LabelField = LabelField->NextLabel;
}
diff --git a/src/acpica/source/compiler/dtfield.c b/src/acpica/source/compiler/dtfield.c
index adde63d..06be3bf 100644
--- a/src/acpica/source/compiler/dtfield.c
+++ b/src/acpica/source/compiler/dtfield.c
@@ -171,6 +171,7 @@ DtCompileOneField (
{
ACPI_STATUS Status;
+
switch (Type)
{
case DT_FIELD_TYPE_INTEGER:
diff --git a/src/acpica/source/compiler/dtio.c b/src/acpica/source/compiler/dtio.c
index 5881ea6..3cdf1f3 100644
--- a/src/acpica/source/compiler/dtio.c
+++ b/src/acpica/source/compiler/dtio.c
@@ -174,7 +174,7 @@ DtDumpSubtableTree (
#define DT_MERGE_LINES 6
#define DT_ESCAPE_SEQUENCE 7
-static UINT32 Gbl_NextLineOffset;
+static UINT32 Gbl_NextLineOffset;
/******************************************************************************
@@ -426,6 +426,7 @@ DtParseLine (
End--;
break;
}
+
End++;
}
@@ -625,7 +626,8 @@ DtGetNextLine (
if (!(Flags & DT_ALLOW_MULTILINE_QUOTES))
{
- AcpiOsPrintf ("ERROR at line %u: Unterminated quoted string\n",
+ AcpiOsPrintf (
+ "ERROR at line %u: Unterminated quoted string\n",
Gbl_CurrentLineNumber++);
State = DT_NORMAL_TEXT;
}
@@ -827,7 +829,8 @@ DtScanFile (
ACPI_DEBUG_PRINT ((ACPI_DB_PARSE, "Line %2.2u/%4.4X - %s",
Gbl_CurrentLineNumber, Offset, Gbl_CurrentLineBuffer));
- Status = DtParseLine (Gbl_CurrentLineBuffer, Gbl_CurrentLineNumber, Offset);
+ Status = DtParseLine (Gbl_CurrentLineBuffer,
+ Gbl_CurrentLineNumber, Offset);
if (Status == AE_NOT_FOUND)
{
break;
@@ -1018,6 +1021,7 @@ DtDumpFieldList (
DbgPrint (ASL_DEBUG_OUTPUT, "\nField List:\n"
"LineNo ByteOff NameCol Column TableOff "
"Flags %32s : %s\n\n", "Name", "Value");
+
while (Field)
{
DbgPrint (ASL_DEBUG_OUTPUT,
@@ -1164,6 +1168,7 @@ DtWriteFieldToListing (
FlPrintFile (ASL_FILE_LISTING_OUTPUT, "...Additional data, length 0x%X\n",
strlen (Field->Value));
}
+
FlPrintFile (ASL_FILE_LISTING_OUTPUT, "\n");
/* Dump the hex data that will be output for this field */
diff --git a/src/acpica/source/compiler/dttable.c b/src/acpica/source/compiler/dttable.c
index 312c53f..f7a45fe 100644
--- a/src/acpica/source/compiler/dttable.c
+++ b/src/acpica/source/compiler/dttable.c
@@ -113,7 +113,7 @@
*
*****************************************************************************/
-/* Compile all complex data tables */
+/* Compile routines for the basic ACPI tables */
#include "aslcompiler.h"
#include "dtcompiler.h"
@@ -122,123 +122,6 @@
ACPI_MODULE_NAME ("dttable")
-/* TBD: merge these into dmtbinfo.c? */
-
-static ACPI_DMTABLE_INFO TableInfoAsfAddress[] =
-{
- {ACPI_DMT_BUFFER, 0, "Addresses", 0},
- {ACPI_DMT_EXIT, 0, NULL, 0}
-};
-
-static ACPI_DMTABLE_INFO TableInfoDmarPciPath[] =
-{
- {ACPI_DMT_PCI_PATH, 0, "PCI Path", 0},
- {ACPI_DMT_EXIT, 0, NULL, 0}
-};
-
-
-/* Local prototypes */
-
-static ACPI_STATUS
-DtCompileTwoSubtables (
- void **List,
- ACPI_DMTABLE_INFO *TableInfo1,
- ACPI_DMTABLE_INFO *TableInfo2);
-
-
-/******************************************************************************
- *
- * FUNCTION: DtCompileTwoSubtables
- *
- * PARAMETERS: List - Current field list pointer
- * TableInfo1 - Info table 1
- * TableInfo1 - Info table 2
- *
- * RETURN: Status
- *
- * DESCRIPTION: Compile tables with a header and one or more same subtables.
- * Include CPEP, EINJ, ERST, MCFG, MSCT, WDAT
- *
- *****************************************************************************/
-
-static ACPI_STATUS
-DtCompileTwoSubtables (
- void **List,
- ACPI_DMTABLE_INFO *TableInfo1,
- ACPI_DMTABLE_INFO *TableInfo2)
-{
- ACPI_STATUS Status;
- DT_SUBTABLE *Subtable;
- DT_SUBTABLE *ParentTable;
- DT_FIELD **PFieldList = (DT_FIELD **) List;
-
-
- Status = DtCompileTable (PFieldList, TableInfo1, &Subtable, TRUE);
- if (ACPI_FAILURE (Status))
- {
- return (Status);
- }
-
- ParentTable = DtPeekSubtable ();
- DtInsertSubtable (ParentTable, Subtable);
-
- while (*PFieldList)
- {
- Status = DtCompileTable (PFieldList, TableInfo2, &Subtable, FALSE);
- if (ACPI_FAILURE (Status))
- {
- return (Status);
- }
-
- DtInsertSubtable (ParentTable, Subtable);
- }
-
- return (AE_OK);
-}
-
-
-/******************************************************************************
- *
- * FUNCTION: DtCompileFacs
- *
- * PARAMETERS: PFieldList - Current field list pointer
- *
- * RETURN: Status
- *
- * DESCRIPTION: Compile FACS.
- *
- *****************************************************************************/
-
-ACPI_STATUS
-DtCompileFacs (
- DT_FIELD **PFieldList)
-{
- DT_SUBTABLE *Subtable;
- UINT8 *ReservedBuffer;
- ACPI_STATUS Status;
- UINT32 ReservedSize;
-
-
- Status = DtCompileTable (PFieldList, AcpiDmTableInfoFacs,
- &Gbl_RootTable, TRUE);
- if (ACPI_FAILURE (Status))
- {
- return (Status);
- }
-
- /* Large FACS reserved area at the end of the table */
-
- ReservedSize = (UINT32) sizeof (((ACPI_TABLE_FACS *) NULL)->Reserved1);
- ReservedBuffer = UtLocalCalloc (ReservedSize);
-
- DtCreateSubtable (ReservedBuffer, ReservedSize, &Subtable);
-
- ACPI_FREE (ReservedBuffer);
- DtInsertSubtable (Gbl_RootTable, Subtable);
- return (AE_OK);
-}
-
-
/******************************************************************************
*
* FUNCTION: DtCompileRsdp
@@ -264,7 +147,7 @@ DtCompileRsdp (
/* Compile the "common" RSDP (ACPI 1.0) */
Status = DtCompileTable (PFieldList, AcpiDmTableInfoRsdp1,
- &Gbl_RootTable, TRUE);
+ &Gbl_RootTable, TRUE);
if (ACPI_FAILURE (Status))
{
return (Status);
@@ -278,7 +161,7 @@ DtCompileRsdp (
/* Compile the "extended" part of the RSDP as a subtable */
Status = DtCompileTable (PFieldList, AcpiDmTableInfoRsdp2,
- &Subtable, TRUE);
+ &Subtable, TRUE);
if (ACPI_FAILURE (Status))
{
return (Status);
@@ -299,259 +182,56 @@ DtCompileRsdp (
/******************************************************************************
*
- * FUNCTION: DtCompileAsf
+ * FUNCTION: DtCompileFadt
*
* PARAMETERS: List - Current field list pointer
*
* RETURN: Status
*
- * DESCRIPTION: Compile ASF!.
+ * DESCRIPTION: Compile FADT.
*
*****************************************************************************/
ACPI_STATUS
-DtCompileAsf (
+DtCompileFadt (
void **List)
{
- ACPI_ASF_INFO *AsfTable;
+ ACPI_STATUS Status;
DT_SUBTABLE *Subtable;
DT_SUBTABLE *ParentTable;
- ACPI_DMTABLE_INFO *InfoTable;
- ACPI_DMTABLE_INFO *DataInfoTable = NULL;
- UINT32 DataCount = 0;
- ACPI_STATUS Status;
- UINT32 i;
DT_FIELD **PFieldList = (DT_FIELD **) List;
- DT_FIELD *SubtableStart;
+ ACPI_TABLE_HEADER *Table;
+ UINT8 Revision;
- while (*PFieldList)
+ Status = DtCompileTable (PFieldList, AcpiDmTableInfoFadt1,
+ &Subtable, TRUE);
+ if (ACPI_FAILURE (Status))
{
- SubtableStart = *PFieldList;
- Status = DtCompileTable (PFieldList, AcpiDmTableInfoAsfHdr,
- &Subtable, TRUE);
- if (ACPI_FAILURE (Status))
- {
- return (Status);
- }
-
- ParentTable = DtPeekSubtable ();
- DtInsertSubtable (ParentTable, Subtable);
- DtPushSubtable (Subtable);
-
- AsfTable = ACPI_CAST_PTR (ACPI_ASF_INFO, Subtable->Buffer);
-
- switch (AsfTable->Header.Type & 0x7F) /* Mask off top bit */
- {
- case ACPI_ASF_TYPE_INFO:
-
- InfoTable = AcpiDmTableInfoAsf0;
- break;
-
- case ACPI_ASF_TYPE_ALERT:
-
- InfoTable = AcpiDmTableInfoAsf1;
- break;
-
- case ACPI_ASF_TYPE_CONTROL:
-
- InfoTable = AcpiDmTableInfoAsf2;
- break;
-
- case ACPI_ASF_TYPE_BOOT:
-
- InfoTable = AcpiDmTableInfoAsf3;
- break;
-
- case ACPI_ASF_TYPE_ADDRESS:
-
- InfoTable = AcpiDmTableInfoAsf4;
- break;
-
- default:
-
- DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "ASF!");
- return (AE_ERROR);
- }
-
- Status = DtCompileTable (PFieldList, InfoTable, &Subtable, TRUE);
- if (ACPI_FAILURE (Status))
- {
- return (Status);
- }
-
- ParentTable = DtPeekSubtable ();
- DtInsertSubtable (ParentTable, Subtable);
-
- switch (AsfTable->Header.Type & 0x7F) /* Mask off top bit */
- {
- case ACPI_ASF_TYPE_INFO:
-
- DataInfoTable = NULL;
- break;
-
- case ACPI_ASF_TYPE_ALERT:
-
- DataInfoTable = AcpiDmTableInfoAsf1a;
- DataCount = ACPI_CAST_PTR (ACPI_ASF_ALERT,
- ACPI_SUB_PTR (UINT8, Subtable->Buffer,
- sizeof (ACPI_ASF_HEADER)))->Alerts;
- break;
-
- case ACPI_ASF_TYPE_CONTROL:
-
- DataInfoTable = AcpiDmTableInfoAsf2a;
- DataCount = ACPI_CAST_PTR (ACPI_ASF_REMOTE,
- ACPI_SUB_PTR (UINT8, Subtable->Buffer,
- sizeof (ACPI_ASF_HEADER)))->Controls;
- break;
-
- case ACPI_ASF_TYPE_BOOT:
-
- DataInfoTable = NULL;
- break;
-
- case ACPI_ASF_TYPE_ADDRESS:
-
- DataInfoTable = TableInfoAsfAddress;
- DataCount = ACPI_CAST_PTR (ACPI_ASF_ADDRESS,
- ACPI_SUB_PTR (UINT8, Subtable->Buffer,
- sizeof (ACPI_ASF_HEADER)))->Devices;
- break;
-
- default:
-
- DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "ASF!");
- return (AE_ERROR);
- }
-
- if (DataInfoTable)
- {
- switch (AsfTable->Header.Type & 0x7F)
- {
- case ACPI_ASF_TYPE_ADDRESS:
-
- while (DataCount > 0)
- {
- Status = DtCompileTable (PFieldList, DataInfoTable,
- &Subtable, TRUE);
- if (ACPI_FAILURE (Status))
- {
- return (Status);
- }
-
- DtInsertSubtable (ParentTable, Subtable);
- DataCount = DataCount - Subtable->Length;
- }
- break;
-
- default:
-
- for (i = 0; i < DataCount; i++)
- {
- Status = DtCompileTable (PFieldList, DataInfoTable,
- &Subtable, TRUE);
- if (ACPI_FAILURE (Status))
- {
- return (Status);
- }
-
- DtInsertSubtable (ParentTable, Subtable);
- }
- break;
- }
- }
-
- DtPopSubtable ();
+ return (Status);
}
- return (AE_OK);
-}
-
-
-/******************************************************************************
- *
- * FUNCTION: DtCompileCpep
- *
- * PARAMETERS: List - Current field list pointer
- *
- * RETURN: Status
- *
- * DESCRIPTION: Compile CPEP.
- *
- *****************************************************************************/
-
-ACPI_STATUS
-DtCompileCpep (
- void **List)
-{
- ACPI_STATUS Status;
-
-
- Status = DtCompileTwoSubtables (List,
- AcpiDmTableInfoCpep, AcpiDmTableInfoCpep0);
- return (Status);
-}
-
-
-/******************************************************************************
- *
- * FUNCTION: DtCompileCsrt
- *
- * PARAMETERS: List - Current field list pointer
- *
- * RETURN: Status
- *
- * DESCRIPTION: Compile CSRT.
- *
- *****************************************************************************/
-
-ACPI_STATUS
-DtCompileCsrt (
- void **List)
-{
- ACPI_STATUS Status = AE_OK;
- DT_SUBTABLE *Subtable;
- DT_SUBTABLE *ParentTable;
- DT_FIELD **PFieldList = (DT_FIELD **) List;
- UINT32 DescriptorCount;
- UINT32 GroupLength;
-
+ ParentTable = DtPeekSubtable ();
+ DtInsertSubtable (ParentTable, Subtable);
- /* Subtables (Resource Groups) */
+ Table = ACPI_CAST_PTR (ACPI_TABLE_HEADER, ParentTable->Buffer);
+ Revision = Table->Revision;
- ParentTable = DtPeekSubtable ();
- while (*PFieldList)
+ if (Revision == 2)
{
- /* Resource group subtable */
-
- Status = DtCompileTable (PFieldList, AcpiDmTableInfoCsrt0,
- &Subtable, TRUE);
+ Status = DtCompileTable (PFieldList, AcpiDmTableInfoFadt2,
+ &Subtable, TRUE);
if (ACPI_FAILURE (Status))
{
return (Status);
}
- /* Compute the number of resource descriptors */
-
- GroupLength =
- (ACPI_CAST_PTR (ACPI_CSRT_GROUP,
- Subtable->Buffer))->Length -
- (ACPI_CAST_PTR (ACPI_CSRT_GROUP,
- Subtable->Buffer))->SharedInfoLength -
- sizeof (ACPI_CSRT_GROUP);
-
- DescriptorCount = (GroupLength /
- sizeof (ACPI_CSRT_DESCRIPTOR));
-
DtInsertSubtable (ParentTable, Subtable);
- DtPushSubtable (Subtable);
- ParentTable = DtPeekSubtable ();
-
- /* Shared info subtable (One per resource group) */
-
- Status = DtCompileTable (PFieldList, AcpiDmTableInfoCsrt1,
- &Subtable, TRUE);
+ }
+ else if (Revision >= 2)
+ {
+ Status = DtCompileTable (PFieldList, AcpiDmTableInfoFadt3,
+ &Subtable, TRUE);
if (ACPI_FAILURE (Status))
{
return (Status);
@@ -559,3038 +239,72 @@ DtCompileCsrt (
DtInsertSubtable (ParentTable, Subtable);
- /* Sub-Subtables (Resource Descriptors) */
-
- while (*PFieldList && DescriptorCount)
+ if (Revision >= 5)
{
-
- Status = DtCompileTable (PFieldList, AcpiDmTableInfoCsrt2,
- &Subtable, TRUE);
+ Status = DtCompileTable (PFieldList, AcpiDmTableInfoFadt5,
+ &Subtable, TRUE);
if (ACPI_FAILURE (Status))
{
return (Status);
}
+
DtInsertSubtable (ParentTable, Subtable);
+ }
- DtPushSubtable (Subtable);
- ParentTable = DtPeekSubtable ();
- if (*PFieldList)
+ if (Revision >= 6)
+ {
+ Status = DtCompileTable (PFieldList, AcpiDmTableInfoFadt6,
+ &Subtable, TRUE);
+ if (ACPI_FAILURE (Status))
{
- Status = DtCompileTable (PFieldList, AcpiDmTableInfoCsrt2a,
- &Subtable, TRUE);
- if (ACPI_FAILURE (Status))
- {
- return (Status);
- }
- if (Subtable)
- {
- DtInsertSubtable (ParentTable, Subtable);
- }
+ return (Status);
}
- DtPopSubtable ();
- ParentTable = DtPeekSubtable ();
- DescriptorCount--;
+ DtInsertSubtable (ParentTable, Subtable);
}
-
- DtPopSubtable ();
- ParentTable = DtPeekSubtable ();
}
- return (Status);
+ return (AE_OK);
}
/******************************************************************************
*
- * FUNCTION: DtCompileDbg2
+ * FUNCTION: DtCompileFacs
*
- * PARAMETERS: List - Current field list pointer
+ * PARAMETERS: PFieldList - Current field list pointer
*
* RETURN: Status
*
- * DESCRIPTION: Compile DBG2.
+ * DESCRIPTION: Compile FACS.
*
*****************************************************************************/
ACPI_STATUS
-DtCompileDbg2 (
- void **List)
+DtCompileFacs (
+ DT_FIELD **PFieldList)
{
- ACPI_STATUS Status;
DT_SUBTABLE *Subtable;
- DT_SUBTABLE *ParentTable;
- DT_FIELD **PFieldList = (DT_FIELD **) List;
- UINT32 SubtableCount;
- ACPI_DBG2_HEADER *Dbg2Header;
- ACPI_DBG2_DEVICE *DeviceInfo;
- UINT16 CurrentOffset;
- UINT32 i;
-
+ UINT8 *ReservedBuffer;
+ ACPI_STATUS Status;
+ UINT32 ReservedSize;
- /* Main table */
- Status = DtCompileTable (PFieldList, AcpiDmTableInfoDbg2, &Subtable, TRUE);
+ Status = DtCompileTable (PFieldList, AcpiDmTableInfoFacs,
+ &Gbl_RootTable, TRUE);
if (ACPI_FAILURE (Status))
{
return (Status);
}
- ParentTable = DtPeekSubtable ();
- DtInsertSubtable (ParentTable, Subtable);
-
- /* Main table fields */
-
- Dbg2Header = ACPI_CAST_PTR (ACPI_DBG2_HEADER, Subtable->Buffer);
- Dbg2Header->InfoOffset = sizeof (ACPI_TABLE_HEADER) + ACPI_PTR_DIFF (
- ACPI_ADD_PTR (UINT8, Dbg2Header, sizeof (ACPI_DBG2_HEADER)), Dbg2Header);
-
- SubtableCount = Dbg2Header->InfoCount;
- DtPushSubtable (Subtable);
+ /* Large FACS reserved area at the end of the table */
- /* Process all Device Information subtables (Count = InfoCount) */
+ ReservedSize = (UINT32) sizeof (((ACPI_TABLE_FACS *) NULL)->Reserved1);
+ ReservedBuffer = UtLocalCalloc (ReservedSize);
- while (*PFieldList && SubtableCount)
- {
- /* Subtable: Debug Device Information */
-
- Status = DtCompileTable (PFieldList, AcpiDmTableInfoDbg2Device,
- &Subtable, TRUE);
- if (ACPI_FAILURE (Status))
- {
- return (Status);
- }
-
- DeviceInfo = ACPI_CAST_PTR (ACPI_DBG2_DEVICE, Subtable->Buffer);
- CurrentOffset = (UINT16) sizeof (ACPI_DBG2_DEVICE);
-
- ParentTable = DtPeekSubtable ();
- DtInsertSubtable (ParentTable, Subtable);
- DtPushSubtable (Subtable);
-
- ParentTable = DtPeekSubtable ();
-
- /* BaseAddressRegister GAS array (Required, size is RegisterCount) */
-
- DeviceInfo->BaseAddressOffset = CurrentOffset;
- for (i = 0; *PFieldList && (i < DeviceInfo->RegisterCount); i++)
- {
- Status = DtCompileTable (PFieldList, AcpiDmTableInfoDbg2Addr,
- &Subtable, TRUE);
- if (ACPI_FAILURE (Status))
- {
- return (Status);
- }
-
- CurrentOffset += (UINT16) sizeof (ACPI_GENERIC_ADDRESS);
- DtInsertSubtable (ParentTable, Subtable);
- }
-
- /* AddressSize array (Required, size = RegisterCount) */
-
- DeviceInfo->AddressSizeOffset = CurrentOffset;
- for (i = 0; *PFieldList && (i < DeviceInfo->RegisterCount); i++)
- {
- Status = DtCompileTable (PFieldList, AcpiDmTableInfoDbg2Size,
- &Subtable, TRUE);
- if (ACPI_FAILURE (Status))
- {
- return (Status);
- }
-
- CurrentOffset += (UINT16) sizeof (UINT32);
- DtInsertSubtable (ParentTable, Subtable);
- }
-
- /* NamespaceString device identifier (Required, size = NamePathLength) */
-
- DeviceInfo->NamepathOffset = CurrentOffset;
- Status = DtCompileTable (PFieldList, AcpiDmTableInfoDbg2Name,
- &Subtable, TRUE);
- if (ACPI_FAILURE (Status))
- {
- return (Status);
- }
-
- /* Update the device info header */
-
- DeviceInfo->NamepathLength = (UINT16) Subtable->Length;
- CurrentOffset += (UINT16) DeviceInfo->NamepathLength;
- DtInsertSubtable (ParentTable, Subtable);
-
- /* OemData - Variable-length data (Optional, size = OemDataLength) */
-
- Status = DtCompileTable (PFieldList, AcpiDmTableInfoDbg2OemData,
- &Subtable, TRUE);
- if (ACPI_FAILURE (Status))
- {
- return (Status);
- }
-
- /* Update the device info header (zeros if no OEM data present) */
-
- DeviceInfo->OemDataOffset = 0;
- DeviceInfo->OemDataLength = 0;
-
- /* Optional subtable (OemData) */
-
- if (Subtable && Subtable->Length)
- {
- DeviceInfo->OemDataOffset = CurrentOffset;
- DeviceInfo->OemDataLength = (UINT16) Subtable->Length;
-
- DtInsertSubtable (ParentTable, Subtable);
- }
-
- SubtableCount--;
- DtPopSubtable (); /* Get next Device Information subtable */
- }
-
- DtPopSubtable ();
- return (AE_OK);
-}
-
-
-/******************************************************************************
- *
- * FUNCTION: DtCompileDmar
- *
- * PARAMETERS: List - Current field list pointer
- *
- * RETURN: Status
- *
- * DESCRIPTION: Compile DMAR.
- *
- *****************************************************************************/
-
-ACPI_STATUS
-DtCompileDmar (
- void **List)
-{
- ACPI_STATUS Status;
- DT_SUBTABLE *Subtable;
- DT_SUBTABLE *ParentTable;
- DT_FIELD **PFieldList = (DT_FIELD **) List;
- DT_FIELD *SubtableStart;
- ACPI_DMTABLE_INFO *InfoTable;
- ACPI_DMAR_HEADER *DmarHeader;
- ACPI_DMAR_DEVICE_SCOPE *DmarDeviceScope;
- UINT32 DeviceScopeLength;
- UINT32 PciPathLength;
-
-
- Status = DtCompileTable (PFieldList, AcpiDmTableInfoDmar, &Subtable, TRUE);
- if (ACPI_FAILURE (Status))
- {
- return (Status);
- }
-
- ParentTable = DtPeekSubtable ();
- DtInsertSubtable (ParentTable, Subtable);
- DtPushSubtable (Subtable);
-
- while (*PFieldList)
- {
- /* DMAR Header */
-
- SubtableStart = *PFieldList;
- Status = DtCompileTable (PFieldList, AcpiDmTableInfoDmarHdr,
- &Subtable, TRUE);
- if (ACPI_FAILURE (Status))
- {
- return (Status);
- }
-
- ParentTable = DtPeekSubtable ();
- DtInsertSubtable (ParentTable, Subtable);
- DtPushSubtable (Subtable);
-
- DmarHeader = ACPI_CAST_PTR (ACPI_DMAR_HEADER, Subtable->Buffer);
-
- switch (DmarHeader->Type)
- {
- case ACPI_DMAR_TYPE_HARDWARE_UNIT:
-
- InfoTable = AcpiDmTableInfoDmar0;
- break;
-
- case ACPI_DMAR_TYPE_RESERVED_MEMORY:
-
- InfoTable = AcpiDmTableInfoDmar1;
- break;
-
- case ACPI_DMAR_TYPE_ROOT_ATS:
-
- InfoTable = AcpiDmTableInfoDmar2;
- break;
-
- case ACPI_DMAR_TYPE_HARDWARE_AFFINITY:
-
- InfoTable = AcpiDmTableInfoDmar3;
- break;
-
- case ACPI_DMAR_TYPE_NAMESPACE:
-
- InfoTable = AcpiDmTableInfoDmar4;
- break;
-
- default:
-
- DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "DMAR");
- return (AE_ERROR);
- }
-
- /* DMAR Subtable */
-
- Status = DtCompileTable (PFieldList, InfoTable, &Subtable, TRUE);
- if (ACPI_FAILURE (Status))
- {
- return (Status);
- }
-
- ParentTable = DtPeekSubtable ();
- DtInsertSubtable (ParentTable, Subtable);
-
- /*
- * Optional Device Scope subtables
- */
- if ((DmarHeader->Type == ACPI_DMAR_TYPE_HARDWARE_AFFINITY) ||
- (DmarHeader->Type == ACPI_DMAR_TYPE_NAMESPACE))
- {
- /* These types do not support device scopes */
-
- DtPopSubtable ();
- continue;
- }
-
- DtPushSubtable (Subtable);
- DeviceScopeLength = DmarHeader->Length - Subtable->Length -
- ParentTable->Length;
- while (DeviceScopeLength)
- {
- Status = DtCompileTable (PFieldList, AcpiDmTableInfoDmarScope,
- &Subtable, FALSE);
- if (Status == AE_NOT_FOUND)
- {
- break;
- }
-
- ParentTable = DtPeekSubtable ();
- DtInsertSubtable (ParentTable, Subtable);
- DtPushSubtable (Subtable);
-
- DmarDeviceScope = ACPI_CAST_PTR (ACPI_DMAR_DEVICE_SCOPE, Subtable->Buffer);
-
- /* Optional PCI Paths */
-
- PciPathLength = DmarDeviceScope->Length - Subtable->Length;
- while (PciPathLength)
- {
- Status = DtCompileTable (PFieldList, TableInfoDmarPciPath,
- &Subtable, FALSE);
- if (Status == AE_NOT_FOUND)
- {
- DtPopSubtable ();
- break;
- }
-
- ParentTable = DtPeekSubtable ();
- DtInsertSubtable (ParentTable, Subtable);
- PciPathLength -= Subtable->Length;
- }
-
- DtPopSubtable ();
- DeviceScopeLength -= DmarDeviceScope->Length;
- }
-
- DtPopSubtable ();
- DtPopSubtable ();
- }
-
- return (AE_OK);
-}
-
-
-/******************************************************************************
- *
- * FUNCTION: DtCompileDrtm
- *
- * PARAMETERS: List - Current field list pointer
- *
- * RETURN: Status
- *
- * DESCRIPTION: Compile DRTM.
- *
- *****************************************************************************/
-
-ACPI_STATUS
-DtCompileDrtm (
- void **List)
-{
- ACPI_STATUS Status;
- DT_SUBTABLE *Subtable;
- DT_SUBTABLE *ParentTable;
- DT_FIELD **PFieldList = (DT_FIELD **) List;
- UINT32 Count;
- /* ACPI_TABLE_DRTM *Drtm; */
- ACPI_DRTM_VTABLE_LIST *DrtmVtl;
- ACPI_DRTM_RESOURCE_LIST *DrtmRl;
- /* ACPI_DRTM_DPS_ID *DrtmDps; */
-
-
- ParentTable = DtPeekSubtable ();
-
- /* Compile DRTM header */
-
- Status = DtCompileTable (PFieldList, AcpiDmTableInfoDrtm,
- &Subtable, TRUE);
- if (ACPI_FAILURE (Status))
- {
- return (Status);
- }
- DtInsertSubtable (ParentTable, Subtable);
-
- /*
- * Using ACPI_SUB_PTR, We needn't define a seperate structure. Care
- * should be taken to avoid accessing ACPI_TABLE_HADER fields.
- */
-#if 0
- Drtm = ACPI_SUB_PTR (ACPI_TABLE_DRTM,
- Subtable->Buffer, sizeof (ACPI_TABLE_HEADER));
-#endif
- /* Compile VTL */
-
- Status = DtCompileTable (PFieldList, AcpiDmTableInfoDrtm0,
- &Subtable, TRUE);
- if (ACPI_FAILURE (Status))
- {
- return (Status);
- }
- DtInsertSubtable (ParentTable, Subtable);
- DrtmVtl = ACPI_CAST_PTR (ACPI_DRTM_VTABLE_LIST, Subtable->Buffer);
-
- DtPushSubtable (Subtable);
- ParentTable = DtPeekSubtable ();
- Count = 0;
- while (*PFieldList)
- {
- Status = DtCompileTable (PFieldList, AcpiDmTableInfoDrtm0a,
- &Subtable, TRUE);
- if (ACPI_FAILURE (Status))
- {
- return (Status);
- }
- if (!Subtable)
- {
- break;
- }
- DtInsertSubtable (ParentTable, Subtable);
- Count++;
- }
- DrtmVtl->ValidatedTableCount = Count;
- DtPopSubtable ();
- ParentTable = DtPeekSubtable ();
-
- /* Compile RL */
-
- Status = DtCompileTable (PFieldList, AcpiDmTableInfoDrtm1,
- &Subtable, TRUE);
- if (ACPI_FAILURE (Status))
- {
- return (Status);
- }
- DtInsertSubtable (ParentTable, Subtable);
- DrtmRl = ACPI_CAST_PTR (ACPI_DRTM_RESOURCE_LIST, Subtable->Buffer);
-
- DtPushSubtable (Subtable);
- ParentTable = DtPeekSubtable ();
- Count = 0;
- while (*PFieldList)
- {
- Status = DtCompileTable (PFieldList, AcpiDmTableInfoDrtm1a,
- &Subtable, TRUE);
- if (ACPI_FAILURE (Status))
- {
- return (Status);
- }
- if (!Subtable)
- {
- break;
- }
- DtInsertSubtable (ParentTable, Subtable);
- Count++;
- }
- DrtmRl->ResourceCount = Count;
- DtPopSubtable ();
- ParentTable = DtPeekSubtable ();
-
- /* Compile DPS */
-
- Status = DtCompileTable (PFieldList, AcpiDmTableInfoDrtm2,
- &Subtable, TRUE);
- if (ACPI_FAILURE (Status))
- {
- return (Status);
- }
- DtInsertSubtable (ParentTable, Subtable);
- /* DrtmDps = ACPI_CAST_PTR (ACPI_DRTM_DPS_ID, Subtable->Buffer);*/
-
-
- return (AE_OK);
-}
-
-
-/******************************************************************************
- *
- * FUNCTION: DtCompileEinj
- *
- * PARAMETERS: List - Current field list pointer
- *
- * RETURN: Status
- *
- * DESCRIPTION: Compile EINJ.
- *
- *****************************************************************************/
-
-ACPI_STATUS
-DtCompileEinj (
- void **List)
-{
- ACPI_STATUS Status;
-
-
- Status = DtCompileTwoSubtables (List,
- AcpiDmTableInfoEinj, AcpiDmTableInfoEinj0);
- return (Status);
-}
-
-
-/******************************************************************************
- *
- * FUNCTION: DtCompileErst
- *
- * PARAMETERS: List - Current field list pointer
- *
- * RETURN: Status
- *
- * DESCRIPTION: Compile ERST.
- *
- *****************************************************************************/
-
-ACPI_STATUS
-DtCompileErst (
- void **List)
-{
- ACPI_STATUS Status;
-
-
- Status = DtCompileTwoSubtables (List,
- AcpiDmTableInfoErst, AcpiDmTableInfoEinj0);
- return (Status);
-}
-
-
-/******************************************************************************
- *
- * FUNCTION: DtCompileFadt
- *
- * PARAMETERS: List - Current field list pointer
- *
- * RETURN: Status
- *
- * DESCRIPTION: Compile FADT.
- *
- *****************************************************************************/
-
-ACPI_STATUS
-DtCompileFadt (
- void **List)
-{
- ACPI_STATUS Status;
- DT_SUBTABLE *Subtable;
- DT_SUBTABLE *ParentTable;
- DT_FIELD **PFieldList = (DT_FIELD **) List;
- ACPI_TABLE_HEADER *Table;
- UINT8 Revision;
-
-
- Status = DtCompileTable (PFieldList, AcpiDmTableInfoFadt1,
- &Subtable, TRUE);
- if (ACPI_FAILURE (Status))
- {
- return (Status);
- }
-
- ParentTable = DtPeekSubtable ();
- DtInsertSubtable (ParentTable, Subtable);
-
- Table = ACPI_CAST_PTR (ACPI_TABLE_HEADER, ParentTable->Buffer);
- Revision = Table->Revision;
-
- if (Revision == 2)
- {
- Status = DtCompileTable (PFieldList, AcpiDmTableInfoFadt2,
- &Subtable, TRUE);
- if (ACPI_FAILURE (Status))
- {
- return (Status);
- }
-
- DtInsertSubtable (ParentTable, Subtable);
- }
- else if (Revision >= 2)
- {
- Status = DtCompileTable (PFieldList, AcpiDmTableInfoFadt3,
- &Subtable, TRUE);
- if (ACPI_FAILURE (Status))
- {
- return (Status);
- }
-
- DtInsertSubtable (ParentTable, Subtable);
-
- if (Revision >= 5)
- {
- Status = DtCompileTable (PFieldList, AcpiDmTableInfoFadt5,
- &Subtable, TRUE);
- if (ACPI_FAILURE (Status))
- {
- return (Status);
- }
-
- DtInsertSubtable (ParentTable, Subtable);
- }
-
- if (Revision >= 6)
- {
- Status = DtCompileTable (PFieldList, AcpiDmTableInfoFadt6,
- &Subtable, TRUE);
- if (ACPI_FAILURE (Status))
- {
- return (Status);
- }
-
- DtInsertSubtable (ParentTable, Subtable);
- }
- }
-
- return (AE_OK);
-}
-
-/******************************************************************************
- *
- * FUNCTION: DtCompileGtdt
- *
- * PARAMETERS: List - Current field list pointer
- *
- * RETURN: Status
- *
- * DESCRIPTION: Compile GTDT.
- *
- *****************************************************************************/
-
-ACPI_STATUS
-DtCompileGtdt (
- void **List)
-{
- ACPI_STATUS Status;
- DT_SUBTABLE *Subtable;
- DT_SUBTABLE *ParentTable;
- DT_FIELD **PFieldList = (DT_FIELD **) List;
- DT_FIELD *SubtableStart;
- ACPI_SUBTABLE_HEADER *GtdtHeader;
- ACPI_DMTABLE_INFO *InfoTable;
- UINT32 GtCount;
-
-
- Status = DtCompileTable (PFieldList, AcpiDmTableInfoGtdt,
- &Subtable, TRUE);
- if (ACPI_FAILURE (Status))
- {
- return (Status);
- }
-
- ParentTable = DtPeekSubtable ();
- DtInsertSubtable (ParentTable, Subtable);
-
- while (*PFieldList)
- {
- SubtableStart = *PFieldList;
- Status = DtCompileTable (PFieldList, AcpiDmTableInfoGtdtHdr,
- &Subtable, TRUE);
- if (ACPI_FAILURE (Status))
- {
- return (Status);
- }
-
- ParentTable = DtPeekSubtable ();
- DtInsertSubtable (ParentTable, Subtable);
- DtPushSubtable (Subtable);
-
- GtdtHeader = ACPI_CAST_PTR (ACPI_SUBTABLE_HEADER, Subtable->Buffer);
-
- switch (GtdtHeader->Type)
- {
- case ACPI_GTDT_TYPE_TIMER_BLOCK:
-
- InfoTable = AcpiDmTableInfoGtdt0;
- break;
-
- case ACPI_GTDT_TYPE_WATCHDOG:
-
- InfoTable = AcpiDmTableInfoGtdt1;
- break;
-
- default:
-
- DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "GTDT");
- return (AE_ERROR);
- }
-
- Status = DtCompileTable (PFieldList, InfoTable, &Subtable, TRUE);
- if (ACPI_FAILURE (Status))
- {
- return (Status);
- }
-
- ParentTable = DtPeekSubtable ();
- DtInsertSubtable (ParentTable, Subtable);
-
- /*
- * Additional GT block subtable data
- */
-
- switch (GtdtHeader->Type)
- {
- case ACPI_GTDT_TYPE_TIMER_BLOCK:
-
- DtPushSubtable (Subtable);
- ParentTable = DtPeekSubtable ();
-
- GtCount = (ACPI_CAST_PTR (ACPI_GTDT_TIMER_BLOCK,
- Subtable->Buffer - sizeof(ACPI_GTDT_HEADER)))->TimerCount;
- while (GtCount)
- {
- Status = DtCompileTable (PFieldList, AcpiDmTableInfoGtdt0a,
- &Subtable, TRUE);
- if (ACPI_FAILURE (Status))
- {
- return (Status);
- }
-
-
- DtInsertSubtable (ParentTable, Subtable);
- GtCount--;
- }
- DtPopSubtable ();
- break;
-
- default:
-
- break;
- }
-
- DtPopSubtable ();
- }
-
- return (AE_OK);
-}
-
-
-/******************************************************************************
- *
- * FUNCTION: DtCompileFpdt
- *
- * PARAMETERS: List - Current field list pointer
- *
- * RETURN: Status
- *
- * DESCRIPTION: Compile FPDT.
- *
- *****************************************************************************/
-
-ACPI_STATUS
-DtCompileFpdt (
- void **List)
-{
- ACPI_STATUS Status;
- ACPI_FPDT_HEADER *FpdtHeader;
- DT_SUBTABLE *Subtable;
- DT_SUBTABLE *ParentTable;
- ACPI_DMTABLE_INFO *InfoTable;
- DT_FIELD **PFieldList = (DT_FIELD **) List;
- DT_FIELD *SubtableStart;
-
-
- while (*PFieldList)
- {
- SubtableStart = *PFieldList;
- Status = DtCompileTable (PFieldList, AcpiDmTableInfoFpdtHdr,
- &Subtable, TRUE);
- if (ACPI_FAILURE (Status))
- {
- return (Status);
- }
-
- ParentTable = DtPeekSubtable ();
- DtInsertSubtable (ParentTable, Subtable);
- DtPushSubtable (Subtable);
-
- FpdtHeader = ACPI_CAST_PTR (ACPI_FPDT_HEADER, Subtable->Buffer);
-
- switch (FpdtHeader->Type)
- {
- case ACPI_FPDT_TYPE_BOOT:
-
- InfoTable = AcpiDmTableInfoFpdt0;
- break;
-
- case ACPI_FPDT_TYPE_S3PERF:
-
- InfoTable = AcpiDmTableInfoFpdt1;
- break;
-
- default:
-
- DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "FPDT");
- return (AE_ERROR);
- break;
- }
-
- Status = DtCompileTable (PFieldList, InfoTable, &Subtable, TRUE);
- if (ACPI_FAILURE (Status))
- {
- return (Status);
- }
-
- ParentTable = DtPeekSubtable ();
- DtInsertSubtable (ParentTable, Subtable);
- DtPopSubtable ();
- }
-
- return (AE_OK);
-}
-
-
-/******************************************************************************
- *
- * FUNCTION: DtCompileHest
- *
- * PARAMETERS: List - Current field list pointer
- *
- * RETURN: Status
- *
- * DESCRIPTION: Compile HEST.
- *
- *****************************************************************************/
-
-ACPI_STATUS
-DtCompileHest (
- void **List)
-{
- ACPI_STATUS Status;
- DT_SUBTABLE *Subtable;
- DT_SUBTABLE *ParentTable;
- DT_FIELD **PFieldList = (DT_FIELD **) List;
- DT_FIELD *SubtableStart;
- ACPI_DMTABLE_INFO *InfoTable;
- UINT16 Type;
- UINT32 BankCount;
-
-
- Status = DtCompileTable (PFieldList, AcpiDmTableInfoHest,
- &Subtable, TRUE);
- if (ACPI_FAILURE (Status))
- {
- return (Status);
- }
-
- ParentTable = DtPeekSubtable ();
- DtInsertSubtable (ParentTable, Subtable);
-
- while (*PFieldList)
- {
- /* Get subtable type */
-
- SubtableStart = *PFieldList;
- DtCompileInteger ((UINT8 *) &Type, *PFieldList, 2, 0);
-
- switch (Type)
- {
- case ACPI_HEST_TYPE_IA32_CHECK:
-
- InfoTable = AcpiDmTableInfoHest0;
- break;
-
- case ACPI_HEST_TYPE_IA32_CORRECTED_CHECK:
-
- InfoTable = AcpiDmTableInfoHest1;
- break;
-
- case ACPI_HEST_TYPE_IA32_NMI:
-
- InfoTable = AcpiDmTableInfoHest2;
- break;
-
- case ACPI_HEST_TYPE_AER_ROOT_PORT:
-
- InfoTable = AcpiDmTableInfoHest6;
- break;
-
- case ACPI_HEST_TYPE_AER_ENDPOINT:
-
- InfoTable = AcpiDmTableInfoHest7;
- break;
-
- case ACPI_HEST_TYPE_AER_BRIDGE:
-
- InfoTable = AcpiDmTableInfoHest8;
- break;
-
- case ACPI_HEST_TYPE_GENERIC_ERROR:
-
- InfoTable = AcpiDmTableInfoHest9;
- break;
-
- default:
-
- /* Cannot continue on unknown type */
-
- DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "HEST");
- return (AE_ERROR);
- }
-
- Status = DtCompileTable (PFieldList, InfoTable, &Subtable, TRUE);
- if (ACPI_FAILURE (Status))
- {
- return (Status);
- }
-
- DtInsertSubtable (ParentTable, Subtable);
-
- /*
- * Additional subtable data - IA32 Error Bank(s)
- */
- BankCount = 0;
- switch (Type)
- {
- case ACPI_HEST_TYPE_IA32_CHECK:
-
- BankCount = (ACPI_CAST_PTR (ACPI_HEST_IA_MACHINE_CHECK,
- Subtable->Buffer))->NumHardwareBanks;
- break;
-
- case ACPI_HEST_TYPE_IA32_CORRECTED_CHECK:
-
- BankCount = (ACPI_CAST_PTR (ACPI_HEST_IA_CORRECTED,
- Subtable->Buffer))->NumHardwareBanks;
- break;
-
- default:
-
- break;
- }
-
- while (BankCount)
- {
- Status = DtCompileTable (PFieldList, AcpiDmTableInfoHestBank,
- &Subtable, TRUE);
- if (ACPI_FAILURE (Status))
- {
- return (Status);
- }
-
- DtInsertSubtable (ParentTable, Subtable);
- BankCount--;
- }
- }
-
- return (AE_OK);
-}
-
-
-/******************************************************************************
- *
- * FUNCTION: DtCompileIort
- *
- * PARAMETERS: List - Current field list pointer
- *
- * RETURN: Status
- *
- * DESCRIPTION: Compile IORT.
- *
- *****************************************************************************/
-
-ACPI_STATUS
-DtCompileIort (
- void **List)
-{
- ACPI_STATUS Status;
- DT_SUBTABLE *Subtable;
- DT_SUBTABLE *ParentTable;
- DT_FIELD **PFieldList = (DT_FIELD **) List;
- DT_FIELD *SubtableStart;
- ACPI_TABLE_IORT *Iort;
- ACPI_IORT_NODE *IortNode;
- ACPI_IORT_ITS_GROUP *IortItsGroup;
- ACPI_IORT_SMMU *IortSmmu;
- UINT32 NodeNumber;
- UINT32 NodeLength;
- UINT32 IdMappingNumber;
- UINT32 ItsNumber;
- UINT32 ContextIrptNumber;
- UINT32 PmuIrptNumber;
- UINT32 PaddingLength;
-
-
- ParentTable = DtPeekSubtable ();
-
- Status = DtCompileTable (PFieldList, AcpiDmTableInfoIort,
- &Subtable, TRUE);
- if (ACPI_FAILURE (Status))
- {
- return (Status);
- }
- DtInsertSubtable (ParentTable, Subtable);
-
- /*
- * Using ACPI_SUB_PTR, We needn't define a seperate structure. Care
- * should be taken to avoid accessing ACPI_TABLE_HADER fields.
- */
- Iort = ACPI_SUB_PTR (ACPI_TABLE_IORT,
- Subtable->Buffer, sizeof (ACPI_TABLE_HEADER));
-
- /*
- * OptionalPadding - Variable-length data
- * (Optional, size = OffsetToNodes - sizeof (ACPI_TABLE_IORT))
- * Optionally allows the generic data types to be used for filling
- * this field.
- */
- Iort->NodeOffset = sizeof (ACPI_TABLE_IORT);
- Status = DtCompileTable (PFieldList, AcpiDmTableInfoIortPad,
- &Subtable, TRUE);
- if (ACPI_FAILURE (Status))
- {
- return (Status);
- }
- if (Subtable)
- {
- DtInsertSubtable (ParentTable, Subtable);
- Iort->NodeOffset += Subtable->Length;
- }
- else
- {
- Status = DtCompileGeneric (ACPI_CAST_PTR (void *, PFieldList),
- AcpiDmTableInfoIortHdr[0].Name, &PaddingLength);
- if (ACPI_FAILURE (Status))
- {
- return (Status);
- }
- Iort->NodeOffset += PaddingLength;
- }
-
- NodeNumber = 0;
- while (*PFieldList)
- {
- SubtableStart = *PFieldList;
- Status = DtCompileTable (PFieldList, AcpiDmTableInfoIortHdr,
- &Subtable, TRUE);
- if (ACPI_FAILURE (Status))
- {
- return (Status);
- }
- DtInsertSubtable (ParentTable, Subtable);
- IortNode = ACPI_CAST_PTR (ACPI_IORT_NODE, Subtable->Buffer);
- NodeLength = ACPI_OFFSET (ACPI_IORT_NODE, NodeData);
-
- DtPushSubtable (Subtable);
- ParentTable = DtPeekSubtable ();
-
- switch (IortNode->Type)
- {
- case ACPI_IORT_NODE_ITS_GROUP:
-
- Status = DtCompileTable (PFieldList, AcpiDmTableInfoIort0,
- &Subtable, TRUE);
- if (ACPI_FAILURE (Status))
- {
- return (Status);
- }
- DtInsertSubtable (ParentTable, Subtable);
- IortItsGroup = ACPI_CAST_PTR (ACPI_IORT_ITS_GROUP, Subtable->Buffer);
- NodeLength += Subtable->Length;
-
- ItsNumber = 0;
- while (*PFieldList)
- {
- Status = DtCompileTable (PFieldList, AcpiDmTableInfoIort0a,
- &Subtable, TRUE);
- if (ACPI_FAILURE (Status))
- {
- return (Status);
- }
- if (!Subtable)
- {
- break;
- }
- DtInsertSubtable (ParentTable, Subtable);
- NodeLength += Subtable->Length;
- ItsNumber++;
- }
-
- IortItsGroup->ItsCount = ItsNumber;
- break;
-
- case ACPI_IORT_NODE_NAMED_COMPONENT:
-
- Status = DtCompileTable (PFieldList, AcpiDmTableInfoIort1,
- &Subtable, TRUE);
- if (ACPI_FAILURE (Status))
- {
- return (Status);
- }
- DtInsertSubtable (ParentTable, Subtable);
- NodeLength += Subtable->Length;
-
- /*
- * Padding - Variable-length data
- * Optionally allows the offset of the ID mappings to be used
- * for filling this field.
- */
- Status = DtCompileTable (PFieldList, AcpiDmTableInfoIort1a,
- &Subtable, TRUE);
- if (ACPI_FAILURE (Status))
- {
- return (Status);
- }
- if (Subtable)
- {
- DtInsertSubtable (ParentTable, Subtable);
- NodeLength += Subtable->Length;
- }
- else
- {
- if (NodeLength > IortNode->MappingOffset)
- {
- return (AE_BAD_DATA);
- }
- if (NodeLength < IortNode->MappingOffset)
- {
- Status = DtCompilePadding (
- IortNode->MappingOffset - NodeLength,
- &Subtable);
- if (ACPI_FAILURE (Status))
- {
- return (Status);
- }
- DtInsertSubtable (ParentTable, Subtable);
- NodeLength = IortNode->MappingOffset;
- }
- }
- break;
-
- case ACPI_IORT_NODE_PCI_ROOT_COMPLEX:
-
- Status = DtCompileTable (PFieldList, AcpiDmTableInfoIort2,
- &Subtable, TRUE);
- if (ACPI_FAILURE (Status))
- {
- return (Status);
- }
- DtInsertSubtable (ParentTable, Subtable);
- NodeLength += Subtable->Length;
- break;
-
- case ACPI_IORT_NODE_SMMU:
-
- Status = DtCompileTable (PFieldList, AcpiDmTableInfoIort3,
- &Subtable, TRUE);
- if (ACPI_FAILURE (Status))
- {
- return (Status);
- }
- DtInsertSubtable (ParentTable, Subtable);
- IortSmmu = ACPI_CAST_PTR (ACPI_IORT_SMMU, Subtable->Buffer);
- NodeLength += Subtable->Length;
-
- /* Compile global interrupt array */
-
- IortSmmu->GlobalInterruptOffset = NodeLength;
- Status = DtCompileTable (PFieldList, AcpiDmTableInfoIort3a,
- &Subtable, TRUE);
- if (ACPI_FAILURE (Status))
- {
- return (Status);
- }
- DtInsertSubtable (ParentTable, Subtable);
- NodeLength += Subtable->Length;
-
- /* Compile context interrupt array */
-
- ContextIrptNumber = 0;
- IortSmmu->ContextInterruptOffset = NodeLength;
- while (*PFieldList)
- {
- Status = DtCompileTable (PFieldList, AcpiDmTableInfoIort3b,
- &Subtable, TRUE);
- if (ACPI_FAILURE (Status))
- {
- return (Status);
- }
- if (!Subtable)
- {
- break;
- }
- DtInsertSubtable (ParentTable, Subtable);
- NodeLength += Subtable->Length;
- ContextIrptNumber++;
- }
- IortSmmu->ContextInterruptCount = ContextIrptNumber;
-
- /* Compile PMU interrupt array */
-
- PmuIrptNumber = 0;
- IortSmmu->PmuInterruptOffset = NodeLength;
- while (*PFieldList)
- {
- Status = DtCompileTable (PFieldList, AcpiDmTableInfoIort3c,
- &Subtable, TRUE);
- if (ACPI_FAILURE (Status))
- {
- return (Status);
- }
- if (!Subtable)
- {
- break;
- }
- DtInsertSubtable (ParentTable, Subtable);
- NodeLength += Subtable->Length;
- PmuIrptNumber++;
- }
- IortSmmu->PmuInterruptCount = PmuIrptNumber;
- break;
-
- default:
-
- DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "IORT");
- return (AE_ERROR);
- }
-
- /* Compile Array of ID mappings */
-
- IortNode->MappingOffset = NodeLength;
- IdMappingNumber = 0;
- while (*PFieldList)
- {
- Status = DtCompileTable (PFieldList, AcpiDmTableInfoIortMap,
- &Subtable, TRUE);
- if (ACPI_FAILURE (Status))
- {
- return (Status);
- }
- if (!Subtable)
- {
- break;
- }
- DtInsertSubtable (ParentTable, Subtable);
- NodeLength += sizeof (ACPI_IORT_ID_MAPPING);
- IdMappingNumber++;
- }
- IortNode->MappingCount = IdMappingNumber;
-
- /*
- * Node length can be determined by DT_LENGTH option
- * IortNode->Length = NodeLength;
- */
- DtPopSubtable ();
- ParentTable = DtPeekSubtable ();
- NodeNumber++;
- }
- Iort->NodeCount = NodeNumber;
-
- return (AE_OK);
-}
-
-
-/******************************************************************************
- *
- * FUNCTION: DtCompileIvrs
- *
- * PARAMETERS: List - Current field list pointer
- *
- * RETURN: Status
- *
- * DESCRIPTION: Compile IVRS.
- *
- *****************************************************************************/
-
-ACPI_STATUS
-DtCompileIvrs (
- void **List)
-{
- ACPI_STATUS Status;
- DT_SUBTABLE *Subtable;
- DT_SUBTABLE *ParentTable;
- DT_FIELD **PFieldList = (DT_FIELD **) List;
- DT_FIELD *SubtableStart;
- ACPI_DMTABLE_INFO *InfoTable;
- ACPI_IVRS_HEADER *IvrsHeader;
- UINT8 EntryType;
-
-
- Status = DtCompileTable (PFieldList, AcpiDmTableInfoIvrs,
- &Subtable, TRUE);
- if (ACPI_FAILURE (Status))
- {
- return (Status);
- }
-
- ParentTable = DtPeekSubtable ();
- DtInsertSubtable (ParentTable, Subtable);
-
- while (*PFieldList)
- {
- SubtableStart = *PFieldList;
- Status = DtCompileTable (PFieldList, AcpiDmTableInfoIvrsHdr,
- &Subtable, TRUE);
- if (ACPI_FAILURE (Status))
- {
- return (Status);
- }
-
- ParentTable = DtPeekSubtable ();
- DtInsertSubtable (ParentTable, Subtable);
- DtPushSubtable (Subtable);
-
- IvrsHeader = ACPI_CAST_PTR (ACPI_IVRS_HEADER, Subtable->Buffer);
-
- switch (IvrsHeader->Type)
- {
- case ACPI_IVRS_TYPE_HARDWARE:
-
- InfoTable = AcpiDmTableInfoIvrs0;
- break;
-
- case ACPI_IVRS_TYPE_MEMORY1:
- case ACPI_IVRS_TYPE_MEMORY2:
- case ACPI_IVRS_TYPE_MEMORY3:
-
- InfoTable = AcpiDmTableInfoIvrs1;
- break;
-
- default:
-
- DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "IVRS");
- return (AE_ERROR);
- }
-
- Status = DtCompileTable (PFieldList, InfoTable, &Subtable, TRUE);
- if (ACPI_FAILURE (Status))
- {
- return (Status);
- }
-
- ParentTable = DtPeekSubtable ();
- DtInsertSubtable (ParentTable, Subtable);
-
- if (IvrsHeader->Type == ACPI_IVRS_TYPE_HARDWARE)
- {
- while (*PFieldList &&
- !strcmp ((*PFieldList)->Name, "Entry Type"))
- {
- SubtableStart = *PFieldList;
- DtCompileInteger (&EntryType, *PFieldList, 1, 0);
-
- switch (EntryType)
- {
- /* 4-byte device entries */
-
- case ACPI_IVRS_TYPE_PAD4:
- case ACPI_IVRS_TYPE_ALL:
- case ACPI_IVRS_TYPE_SELECT:
- case ACPI_IVRS_TYPE_START:
- case ACPI_IVRS_TYPE_END:
-
- InfoTable = AcpiDmTableInfoIvrs4;
- break;
-
- /* 8-byte entries, type A */
-
- case ACPI_IVRS_TYPE_ALIAS_SELECT:
- case ACPI_IVRS_TYPE_ALIAS_START:
-
- InfoTable = AcpiDmTableInfoIvrs8a;
- break;
-
- /* 8-byte entries, type B */
-
- case ACPI_IVRS_TYPE_PAD8:
- case ACPI_IVRS_TYPE_EXT_SELECT:
- case ACPI_IVRS_TYPE_EXT_START:
-
- InfoTable = AcpiDmTableInfoIvrs8b;
- break;
-
- /* 8-byte entries, type C */
-
- case ACPI_IVRS_TYPE_SPECIAL:
-
- InfoTable = AcpiDmTableInfoIvrs8c;
- break;
-
- default:
-
- DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart,
- "IVRS Device Entry");
- return (AE_ERROR);
- }
-
- Status = DtCompileTable (PFieldList, InfoTable,
- &Subtable, TRUE);
- if (ACPI_FAILURE (Status))
- {
- return (Status);
- }
-
- DtInsertSubtable (ParentTable, Subtable);
- }
- }
-
- DtPopSubtable ();
- }
-
- return (AE_OK);
-}
-
-
-/******************************************************************************
- *
- * FUNCTION: DtCompileLpit
- *
- * PARAMETERS: List - Current field list pointer
- *
- * RETURN: Status
- *
- * DESCRIPTION: Compile LPIT.
- *
- *****************************************************************************/
-
-ACPI_STATUS
-DtCompileLpit (
- void **List)
-{
- ACPI_STATUS Status;
- DT_SUBTABLE *Subtable;
- DT_SUBTABLE *ParentTable;
- DT_FIELD **PFieldList = (DT_FIELD **) List;
- DT_FIELD *SubtableStart;
- ACPI_DMTABLE_INFO *InfoTable;
- ACPI_LPIT_HEADER *LpitHeader;
-
-
- /* Note: Main table consists only of the standard ACPI table header */
-
- while (*PFieldList)
- {
- SubtableStart = *PFieldList;
-
- /* LPIT Subtable header */
-
- Status = DtCompileTable (PFieldList, AcpiDmTableInfoLpitHdr,
- &Subtable, TRUE);
- if (ACPI_FAILURE (Status))
- {
- return (Status);
- }
-
- ParentTable = DtPeekSubtable ();
- DtInsertSubtable (ParentTable, Subtable);
- DtPushSubtable (Subtable);
-
- LpitHeader = ACPI_CAST_PTR (ACPI_LPIT_HEADER, Subtable->Buffer);
-
- switch (LpitHeader->Type)
- {
- case ACPI_LPIT_TYPE_NATIVE_CSTATE:
-
- InfoTable = AcpiDmTableInfoLpit0;
- break;
-
- default:
-
- DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "LPIT");
- return (AE_ERROR);
- }
-
- /* LPIT Subtable */
-
- Status = DtCompileTable (PFieldList, InfoTable, &Subtable, TRUE);
- if (ACPI_FAILURE (Status))
- {
- return (Status);
- }
-
- ParentTable = DtPeekSubtable ();
- DtInsertSubtable (ParentTable, Subtable);
- DtPopSubtable ();
- }
-
- return (AE_OK);
-}
-
-
-/******************************************************************************
- *
- * FUNCTION: DtCompileMadt
- *
- * PARAMETERS: List - Current field list pointer
- *
- * RETURN: Status
- *
- * DESCRIPTION: Compile MADT.
- *
- *****************************************************************************/
-
-ACPI_STATUS
-DtCompileMadt (
- void **List)
-{
- ACPI_STATUS Status;
- DT_SUBTABLE *Subtable;
- DT_SUBTABLE *ParentTable;
- DT_FIELD **PFieldList = (DT_FIELD **) List;
- DT_FIELD *SubtableStart;
- ACPI_SUBTABLE_HEADER *MadtHeader;
- ACPI_DMTABLE_INFO *InfoTable;
-
-
- Status = DtCompileTable (PFieldList, AcpiDmTableInfoMadt,
- &Subtable, TRUE);
- if (ACPI_FAILURE (Status))
- {
- return (Status);
- }
-
- ParentTable = DtPeekSubtable ();
- DtInsertSubtable (ParentTable, Subtable);
-
- while (*PFieldList)
- {
- SubtableStart = *PFieldList;
- Status = DtCompileTable (PFieldList, AcpiDmTableInfoMadtHdr,
- &Subtable, TRUE);
- if (ACPI_FAILURE (Status))
- {
- return (Status);
- }
-
- ParentTable = DtPeekSubtable ();
- DtInsertSubtable (ParentTable, Subtable);
- DtPushSubtable (Subtable);
-
- MadtHeader = ACPI_CAST_PTR (ACPI_SUBTABLE_HEADER, Subtable->Buffer);
-
- switch (MadtHeader->Type)
- {
- case ACPI_MADT_TYPE_LOCAL_APIC:
-
- InfoTable = AcpiDmTableInfoMadt0;
- break;
-
- case ACPI_MADT_TYPE_IO_APIC:
-
- InfoTable = AcpiDmTableInfoMadt1;
- break;
-
- case ACPI_MADT_TYPE_INTERRUPT_OVERRIDE:
-
- InfoTable = AcpiDmTableInfoMadt2;
- break;
-
- case ACPI_MADT_TYPE_NMI_SOURCE:
-
- InfoTable = AcpiDmTableInfoMadt3;
- break;
-
- case ACPI_MADT_TYPE_LOCAL_APIC_NMI:
-
- InfoTable = AcpiDmTableInfoMadt4;
- break;
-
- case ACPI_MADT_TYPE_LOCAL_APIC_OVERRIDE:
-
- InfoTable = AcpiDmTableInfoMadt5;
- break;
-
- case ACPI_MADT_TYPE_IO_SAPIC:
-
- InfoTable = AcpiDmTableInfoMadt6;
- break;
-
- case ACPI_MADT_TYPE_LOCAL_SAPIC:
-
- InfoTable = AcpiDmTableInfoMadt7;
- break;
-
- case ACPI_MADT_TYPE_INTERRUPT_SOURCE:
-
- InfoTable = AcpiDmTableInfoMadt8;
- break;
-
- case ACPI_MADT_TYPE_LOCAL_X2APIC:
-
- InfoTable = AcpiDmTableInfoMadt9;
- break;
-
- case ACPI_MADT_TYPE_LOCAL_X2APIC_NMI:
-
- InfoTable = AcpiDmTableInfoMadt10;
- break;
-
- case ACPI_MADT_TYPE_GENERIC_INTERRUPT:
-
- InfoTable = AcpiDmTableInfoMadt11;
- break;
-
- case ACPI_MADT_TYPE_GENERIC_DISTRIBUTOR:
-
- InfoTable = AcpiDmTableInfoMadt12;
- break;
-
- case ACPI_MADT_TYPE_GENERIC_MSI_FRAME:
-
- InfoTable = AcpiDmTableInfoMadt13;
- break;
-
- case ACPI_MADT_TYPE_GENERIC_REDISTRIBUTOR:
-
- InfoTable = AcpiDmTableInfoMadt14;
- break;
-
- case ACPI_MADT_TYPE_GENERIC_TRANSLATOR:
-
- InfoTable = AcpiDmTableInfoMadt15;
- break;
-
- default:
-
- DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "MADT");
- return (AE_ERROR);
- }
-
- Status = DtCompileTable (PFieldList, InfoTable, &Subtable, TRUE);
- if (ACPI_FAILURE (Status))
- {
- return (Status);
- }
-
- ParentTable = DtPeekSubtable ();
- DtInsertSubtable (ParentTable, Subtable);
- DtPopSubtable ();
- }
-
- return (AE_OK);
-}
-
-
-/******************************************************************************
- *
- * FUNCTION: DtCompileMcfg
- *
- * PARAMETERS: List - Current field list pointer
- *
- * RETURN: Status
- *
- * DESCRIPTION: Compile MCFG.
- *
- *****************************************************************************/
-
-ACPI_STATUS
-DtCompileMcfg (
- void **List)
-{
- ACPI_STATUS Status;
-
-
- Status = DtCompileTwoSubtables (List,
- AcpiDmTableInfoMcfg, AcpiDmTableInfoMcfg0);
- return (Status);
-}
-
-
-/******************************************************************************
- *
- * FUNCTION: DtCompileMpst
- *
- * PARAMETERS: List - Current field list pointer
- *
- * RETURN: Status
- *
- * DESCRIPTION: Compile MPST.
- *
- *****************************************************************************/
-
-ACPI_STATUS
-DtCompileMpst (
- void **List)
-{
- ACPI_STATUS Status;
- DT_SUBTABLE *Subtable;
- DT_SUBTABLE *ParentTable;
- DT_FIELD **PFieldList = (DT_FIELD **) List;
- ACPI_MPST_CHANNEL *MpstChannelInfo;
- ACPI_MPST_POWER_NODE *MpstPowerNode;
- ACPI_MPST_DATA_HDR *MpstDataHeader;
- UINT16 SubtableCount;
- UINT32 PowerStateCount;
- UINT32 ComponentCount;
-
-
- /* Main table */
-
- Status = DtCompileTable (PFieldList, AcpiDmTableInfoMpst, &Subtable, TRUE);
- if (ACPI_FAILURE (Status))
- {
- return (Status);
- }
-
- ParentTable = DtPeekSubtable ();
- DtInsertSubtable (ParentTable, Subtable);
- DtPushSubtable (Subtable);
-
- MpstChannelInfo = ACPI_CAST_PTR (ACPI_MPST_CHANNEL, Subtable->Buffer);
- SubtableCount = MpstChannelInfo->PowerNodeCount;
-
- while (*PFieldList && SubtableCount)
- {
- /* Subtable: Memory Power Node(s) */
-
- Status = DtCompileTable (PFieldList, AcpiDmTableInfoMpst0,
- &Subtable, TRUE);
- if (ACPI_FAILURE (Status))
- {
- return (Status);
- }
-
- ParentTable = DtPeekSubtable ();
- DtInsertSubtable (ParentTable, Subtable);
- DtPushSubtable (Subtable);
-
- MpstPowerNode = ACPI_CAST_PTR (ACPI_MPST_POWER_NODE, Subtable->Buffer);
- PowerStateCount = MpstPowerNode->NumPowerStates;
- ComponentCount = MpstPowerNode->NumPhysicalComponents;
-
- ParentTable = DtPeekSubtable ();
-
- /* Sub-subtables - Memory Power State Structure(s) */
-
- while (*PFieldList && PowerStateCount)
- {
- Status = DtCompileTable (PFieldList, AcpiDmTableInfoMpst0A,
- &Subtable, TRUE);
- if (ACPI_FAILURE (Status))
- {
- return (Status);
- }
-
- DtInsertSubtable (ParentTable, Subtable);
- PowerStateCount--;
- }
-
- /* Sub-subtables - Physical Component ID Structure(s) */
-
- while (*PFieldList && ComponentCount)
- {
- Status = DtCompileTable (PFieldList, AcpiDmTableInfoMpst0B,
- &Subtable, TRUE);
- if (ACPI_FAILURE (Status))
- {
- return (Status);
- }
-
- DtInsertSubtable (ParentTable, Subtable);
- ComponentCount--;
- }
-
- SubtableCount--;
- DtPopSubtable ();
- }
-
- /* Subtable: Count of Memory Power State Characteristic structures */
-
- DtPopSubtable ();
-
- Status = DtCompileTable (PFieldList, AcpiDmTableInfoMpst1, &Subtable, TRUE);
- if (ACPI_FAILURE (Status))
- {
- return (Status);
- }
-
- ParentTable = DtPeekSubtable ();
- DtInsertSubtable (ParentTable, Subtable);
- DtPushSubtable (Subtable);
-
- MpstDataHeader = ACPI_CAST_PTR (ACPI_MPST_DATA_HDR, Subtable->Buffer);
- SubtableCount = MpstDataHeader->CharacteristicsCount;
-
- ParentTable = DtPeekSubtable ();
-
- /* Subtable: Memory Power State Characteristics structure(s) */
-
- while (*PFieldList && SubtableCount)
- {
- Status = DtCompileTable (PFieldList, AcpiDmTableInfoMpst2,
- &Subtable, TRUE);
- if (ACPI_FAILURE (Status))
- {
- return (Status);
- }
-
- DtInsertSubtable (ParentTable, Subtable);
- SubtableCount--;
- }
-
- DtPopSubtable ();
- return (AE_OK);
-}
-
-
-/******************************************************************************
- *
- * FUNCTION: DtCompileMsct
- *
- * PARAMETERS: List - Current field list pointer
- *
- * RETURN: Status
- *
- * DESCRIPTION: Compile MSCT.
- *
- *****************************************************************************/
-
-ACPI_STATUS
-DtCompileMsct (
- void **List)
-{
- ACPI_STATUS Status;
-
-
- Status = DtCompileTwoSubtables (List,
- AcpiDmTableInfoMsct, AcpiDmTableInfoMsct0);
- return (Status);
-}
-
-
-/******************************************************************************
- *
- * FUNCTION: DtCompileMtmr
- *
- * PARAMETERS: List - Current field list pointer
- *
- * RETURN: Status
- *
- * DESCRIPTION: Compile MTMR.
- *
- *****************************************************************************/
-
-ACPI_STATUS
-DtCompileMtmr (
- void **List)
-{
- ACPI_STATUS Status;
-
-
- Status = DtCompileTwoSubtables (List,
- AcpiDmTableInfoMtmr, AcpiDmTableInfoMtmr0);
- return (Status);
-}
-
-
-/******************************************************************************
- *
- * FUNCTION: DtCompileNfit
- *
- * PARAMETERS: List - Current field list pointer
- *
- * RETURN: Status
- *
- * DESCRIPTION: Compile NFIT.
- *
- *****************************************************************************/
-
-ACPI_STATUS
-DtCompileNfit (
- void **List)
-{
- ACPI_STATUS Status;
- DT_SUBTABLE *Subtable;
- DT_SUBTABLE *ParentTable;
- DT_FIELD **PFieldList = (DT_FIELD **) List;
- DT_FIELD *SubtableStart;
- ACPI_NFIT_HEADER *NfitHeader;
- ACPI_DMTABLE_INFO *InfoTable;
- UINT32 Count;
- ACPI_NFIT_INTERLEAVE *Interleave = NULL;
- ACPI_NFIT_FLUSH_ADDRESS *Hint = NULL;
-
- /* Main table */
-
- Status = DtCompileTable (PFieldList, AcpiDmTableInfoNfit,
- &Subtable, TRUE);
- if (ACPI_FAILURE (Status))
- {
- return (Status);
- }
-
- ParentTable = DtPeekSubtable ();
- DtInsertSubtable (ParentTable, Subtable);
- DtPushSubtable (Subtable);
-
- /* Subtables */
-
- while (*PFieldList)
- {
- SubtableStart = *PFieldList;
- Status = DtCompileTable (PFieldList, AcpiDmTableInfoNfitHdr,
- &Subtable, TRUE);
- if (ACPI_FAILURE (Status))
- {
- return (Status);
- }
-
- ParentTable = DtPeekSubtable ();
- DtInsertSubtable (ParentTable, Subtable);
- DtPushSubtable (Subtable);
-
- NfitHeader = ACPI_CAST_PTR (ACPI_NFIT_HEADER, Subtable->Buffer);
-
- switch (NfitHeader->Type)
- {
- case ACPI_NFIT_TYPE_SYSTEM_ADDRESS:
-
- InfoTable = AcpiDmTableInfoNfit0;
- break;
-
- case ACPI_NFIT_TYPE_MEMORY_MAP:
-
- InfoTable = AcpiDmTableInfoNfit1;
- break;
-
- case ACPI_NFIT_TYPE_INTERLEAVE:
-
- Interleave = ACPI_CAST_PTR (ACPI_NFIT_INTERLEAVE, Subtable->Buffer);
- InfoTable = AcpiDmTableInfoNfit2;
- break;
-
- case ACPI_NFIT_TYPE_SMBIOS:
-
- InfoTable = AcpiDmTableInfoNfit3;
- break;
-
- case ACPI_NFIT_TYPE_CONTROL_REGION:
-
- InfoTable = AcpiDmTableInfoNfit4;
- break;
-
- case ACPI_NFIT_TYPE_DATA_REGION:
-
- InfoTable = AcpiDmTableInfoNfit5;
- break;
-
- case ACPI_NFIT_TYPE_FLUSH_ADDRESS:
-
- Hint = ACPI_CAST_PTR (ACPI_NFIT_FLUSH_ADDRESS, Subtable->Buffer);
- InfoTable = AcpiDmTableInfoNfit6;
- break;
-
- default:
-
- DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "NFIT");
- return (AE_ERROR);
- }
-
- Status = DtCompileTable (PFieldList, InfoTable, &Subtable, TRUE);
- if (ACPI_FAILURE (Status))
- {
- return (Status);
- }
-
- ParentTable = DtPeekSubtable ();
- DtInsertSubtable (ParentTable, Subtable);
- DtPopSubtable ();
-
- switch (NfitHeader->Type)
- {
- case ACPI_NFIT_TYPE_INTERLEAVE:
-
- Count = 0;
- DtPushSubtable (Subtable);
- while (*PFieldList)
- {
- Status = DtCompileTable (PFieldList, AcpiDmTableInfoNfit2a,
- &Subtable, FALSE);
- if (ACPI_FAILURE (Status))
- {
- return (Status);
- }
- if (!Subtable)
- {
- DtPopSubtable ();
- break;
- }
-
- ParentTable = DtPeekSubtable ();
- DtInsertSubtable (ParentTable, Subtable);
- Count++;
- }
-
- Interleave->LineCount = Count;
- DtPopSubtable ();
- break;
-
- case ACPI_NFIT_TYPE_SMBIOS:
-
- if (*PFieldList)
- {
- Status = DtCompileTable (PFieldList, AcpiDmTableInfoNfit3a,
- &Subtable, TRUE);
- if (ACPI_FAILURE (Status))
- {
- return (Status);
- }
- if (Subtable)
- {
- DtInsertSubtable (ParentTable, Subtable);
- }
- }
- break;
-
- case ACPI_NFIT_TYPE_FLUSH_ADDRESS:
-
- Count = 0;
- DtPushSubtable (Subtable);
- while (*PFieldList)
- {
- Status = DtCompileTable (PFieldList, AcpiDmTableInfoNfit6a,
- &Subtable, FALSE);
- if (ACPI_FAILURE (Status))
- {
- return (Status);
- }
- if (!Subtable)
- {
- DtPopSubtable ();
- break;
- }
-
- ParentTable = DtPeekSubtable ();
- DtInsertSubtable (ParentTable, Subtable);
- Count++;
- }
-
- Hint->HintCount = (UINT16) Count;
- DtPopSubtable ();
- break;
-
- default:
- break;
- }
- }
-
- return (AE_OK);
-}
-
-
-/******************************************************************************
- *
- * FUNCTION: DtCompilePcct
- *
- * PARAMETERS: List - Current field list pointer
- *
- * RETURN: Status
- *
- * DESCRIPTION: Compile PCCT.
- *
- *****************************************************************************/
-
-ACPI_STATUS
-DtCompilePcct (
- void **List)
-{
- ACPI_STATUS Status;
- DT_SUBTABLE *Subtable;
- DT_SUBTABLE *ParentTable;
- DT_FIELD **PFieldList = (DT_FIELD **) List;
- DT_FIELD *SubtableStart;
- ACPI_SUBTABLE_HEADER *PcctHeader;
- ACPI_DMTABLE_INFO *InfoTable;
-
-
- /* Main table */
-
- Status = DtCompileTable (PFieldList, AcpiDmTableInfoPcct,
- &Subtable, TRUE);
- if (ACPI_FAILURE (Status))
- {
- return (Status);
- }
-
- ParentTable = DtPeekSubtable ();
- DtInsertSubtable (ParentTable, Subtable);
-
- /* Subtables */
-
- while (*PFieldList)
- {
- SubtableStart = *PFieldList;
- Status = DtCompileTable (PFieldList, AcpiDmTableInfoPcctHdr,
- &Subtable, TRUE);
- if (ACPI_FAILURE (Status))
- {
- return (Status);
- }
-
- ParentTable = DtPeekSubtable ();
- DtInsertSubtable (ParentTable, Subtable);
- DtPushSubtable (Subtable);
-
- PcctHeader = ACPI_CAST_PTR (ACPI_SUBTABLE_HEADER, Subtable->Buffer);
-
- switch (PcctHeader->Type)
- {
- case ACPI_PCCT_TYPE_GENERIC_SUBSPACE:
-
- InfoTable = AcpiDmTableInfoPcct0;
- break;
-
- case ACPI_PCCT_TYPE_HW_REDUCED_SUBSPACE:
-
- InfoTable = AcpiDmTableInfoPcct1;
- break;
-
- default:
-
- DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "PCCT");
- return (AE_ERROR);
- }
-
- Status = DtCompileTable (PFieldList, InfoTable, &Subtable, TRUE);
- if (ACPI_FAILURE (Status))
- {
- return (Status);
- }
-
- ParentTable = DtPeekSubtable ();
- DtInsertSubtable (ParentTable, Subtable);
- DtPopSubtable ();
- }
-
- return (AE_OK);
-}
-
-
-/******************************************************************************
- *
- * FUNCTION: DtCompilePmtt
- *
- * PARAMETERS: List - Current field list pointer
- *
- * RETURN: Status
- *
- * DESCRIPTION: Compile PMTT.
- *
- *****************************************************************************/
-
-ACPI_STATUS
-DtCompilePmtt (
- void **List)
-{
- ACPI_STATUS Status;
- DT_SUBTABLE *Subtable;
- DT_SUBTABLE *ParentTable;
- DT_FIELD **PFieldList = (DT_FIELD **) List;
- DT_FIELD *SubtableStart;
- ACPI_PMTT_HEADER *PmttHeader;
- ACPI_PMTT_CONTROLLER *PmttController;
- UINT16 DomainCount;
- UINT8 PrevType = ACPI_PMTT_TYPE_SOCKET;
-
-
- /* Main table */
-
- Status = DtCompileTable (PFieldList, AcpiDmTableInfoPmtt, &Subtable, TRUE);
- if (ACPI_FAILURE (Status))
- {
- return (Status);
- }
-
- ParentTable = DtPeekSubtable ();
- DtInsertSubtable (ParentTable, Subtable);
- DtPushSubtable (Subtable);
-
- while (*PFieldList)
- {
- SubtableStart = *PFieldList;
- Status = DtCompileTable (PFieldList, AcpiDmTableInfoPmttHdr,
- &Subtable, TRUE);
- if (ACPI_FAILURE (Status))
- {
- return (Status);
- }
-
- PmttHeader = ACPI_CAST_PTR (ACPI_PMTT_HEADER, Subtable->Buffer);
- while (PrevType >= PmttHeader->Type)
- {
- DtPopSubtable ();
-
- if (PrevType == ACPI_PMTT_TYPE_SOCKET)
- {
- break;
- }
- PrevType--;
- }
- PrevType = PmttHeader->Type;
-
- ParentTable = DtPeekSubtable ();
- DtInsertSubtable (ParentTable, Subtable);
- DtPushSubtable (Subtable);
-
- switch (PmttHeader->Type)
- {
- case ACPI_PMTT_TYPE_SOCKET:
-
- /* Subtable: Socket Structure */
-
- Status = DtCompileTable (PFieldList, AcpiDmTableInfoPmtt0,
- &Subtable, TRUE);
- if (ACPI_FAILURE (Status))
- {
- return (Status);
- }
-
- ParentTable = DtPeekSubtable ();
- DtInsertSubtable (ParentTable, Subtable);
- break;
-
- case ACPI_PMTT_TYPE_CONTROLLER:
-
- /* Subtable: Memory Controller Structure */
-
- Status = DtCompileTable (PFieldList, AcpiDmTableInfoPmtt1,
- &Subtable, TRUE);
- if (ACPI_FAILURE (Status))
- {
- return (Status);
- }
-
- ParentTable = DtPeekSubtable ();
- DtInsertSubtable (ParentTable, Subtable);
-
- PmttController = ACPI_CAST_PTR (ACPI_PMTT_CONTROLLER,
- (Subtable->Buffer - sizeof (ACPI_PMTT_HEADER)));
- DomainCount = PmttController->DomainCount;
-
- while (DomainCount)
- {
- Status = DtCompileTable (PFieldList, AcpiDmTableInfoPmtt1a,
- &Subtable, TRUE);
- if (ACPI_FAILURE (Status))
- {
- return (Status);
- }
-
- DtInsertSubtable (ParentTable, Subtable);
- DomainCount--;
- }
- break;
-
- case ACPI_PMTT_TYPE_DIMM:
-
- /* Subtable: Physical Component Structure */
-
- Status = DtCompileTable (PFieldList, AcpiDmTableInfoPmtt2,
- &Subtable, TRUE);
- if (ACPI_FAILURE (Status))
- {
- return (Status);
- }
-
- ParentTable = DtPeekSubtable ();
- DtInsertSubtable (ParentTable, Subtable);
- break;
-
- default:
-
- DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "PMTT");
- return (AE_ERROR);
- }
- }
-
- return (Status);
-}
-
-
-/******************************************************************************
- *
- * FUNCTION: DtCompileRsdt
- *
- * PARAMETERS: List - Current field list pointer
- *
- * RETURN: Status
- *
- * DESCRIPTION: Compile RSDT.
- *
- *****************************************************************************/
-
-ACPI_STATUS
-DtCompileRsdt (
- void **List)
-{
- DT_SUBTABLE *Subtable;
- DT_SUBTABLE *ParentTable;
- DT_FIELD *FieldList = *(DT_FIELD **) List;
- UINT32 Address;
-
-
- ParentTable = DtPeekSubtable ();
-
- while (FieldList)
- {
- DtCompileInteger ((UINT8 *) &Address, FieldList, 4, DT_NON_ZERO);
-
- DtCreateSubtable ((UINT8 *) &Address, 4, &Subtable);
- DtInsertSubtable (ParentTable, Subtable);
- FieldList = FieldList->Next;
- }
-
- return (AE_OK);
-}
-
-
-/******************************************************************************
- *
- * FUNCTION: DtCompileS3pt
- *
- * PARAMETERS: PFieldList - Current field list pointer
- *
- * RETURN: Status
- *
- * DESCRIPTION: Compile S3PT (Pointed to by FPDT)
- *
- *****************************************************************************/
-
-ACPI_STATUS
-DtCompileS3pt (
- DT_FIELD **PFieldList)
-{
- ACPI_STATUS Status;
- ACPI_S3PT_HEADER *S3ptHeader;
- DT_SUBTABLE *Subtable;
- DT_SUBTABLE *ParentTable;
- ACPI_DMTABLE_INFO *InfoTable;
- DT_FIELD *SubtableStart;
-
-
- Status = DtCompileTable (PFieldList, AcpiDmTableInfoS3pt,
- &Gbl_RootTable, TRUE);
- if (ACPI_FAILURE (Status))
- {
- return (Status);
- }
-
- DtPushSubtable (Gbl_RootTable);
-
- while (*PFieldList)
- {
- SubtableStart = *PFieldList;
- Status = DtCompileTable (PFieldList, AcpiDmTableInfoS3ptHdr,
- &Subtable, TRUE);
- if (ACPI_FAILURE (Status))
- {
- return (Status);
- }
-
- ParentTable = DtPeekSubtable ();
- DtInsertSubtable (ParentTable, Subtable);
- DtPushSubtable (Subtable);
-
- S3ptHeader = ACPI_CAST_PTR (ACPI_S3PT_HEADER, Subtable->Buffer);
-
- switch (S3ptHeader->Type)
- {
- case ACPI_S3PT_TYPE_RESUME:
-
- InfoTable = AcpiDmTableInfoS3pt0;
- break;
-
- case ACPI_S3PT_TYPE_SUSPEND:
-
- InfoTable = AcpiDmTableInfoS3pt1;
- break;
-
- default:
-
- DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "S3PT");
- return (AE_ERROR);
- }
-
- Status = DtCompileTable (PFieldList, InfoTable, &Subtable, TRUE);
- if (ACPI_FAILURE (Status))
- {
- return (Status);
- }
-
- ParentTable = DtPeekSubtable ();
- DtInsertSubtable (ParentTable, Subtable);
- DtPopSubtable ();
- }
-
- return (AE_OK);
-}
-
-
-/******************************************************************************
- *
- * FUNCTION: DtCompileSlic
- *
- * PARAMETERS: List - Current field list pointer
- *
- * RETURN: Status
- *
- * DESCRIPTION: Compile SLIC.
- *
- *****************************************************************************/
-
-ACPI_STATUS
-DtCompileSlic (
- void **List)
-{
- ACPI_STATUS Status;
- DT_SUBTABLE *Subtable;
- DT_SUBTABLE *ParentTable;
- DT_FIELD **PFieldList = (DT_FIELD **) List;
-
-
- while (*PFieldList)
- {
- Status = DtCompileTable (PFieldList, AcpiDmTableInfoSlic,
- &Subtable, TRUE);
- if (ACPI_FAILURE (Status))
- {
- return (Status);
- }
-
- ParentTable = DtPeekSubtable ();
- DtInsertSubtable (ParentTable, Subtable);
- DtPushSubtable (Subtable);
- DtPopSubtable ();
- }
-
- return (AE_OK);
-}
-
-
-/******************************************************************************
- *
- * FUNCTION: DtCompileSlit
- *
- * PARAMETERS: List - Current field list pointer
- *
- * RETURN: Status
- *
- * DESCRIPTION: Compile SLIT.
- *
- *****************************************************************************/
-
-ACPI_STATUS
-DtCompileSlit (
- void **List)
-{
- ACPI_STATUS Status;
- DT_SUBTABLE *Subtable;
- DT_SUBTABLE *ParentTable;
- DT_FIELD **PFieldList = (DT_FIELD **) List;
- DT_FIELD *FieldList;
- UINT32 Localities;
- UINT8 *LocalityBuffer;
-
-
- Status = DtCompileTable (PFieldList, AcpiDmTableInfoSlit,
- &Subtable, TRUE);
- if (ACPI_FAILURE (Status))
- {
- return (Status);
- }
-
- ParentTable = DtPeekSubtable ();
- DtInsertSubtable (ParentTable, Subtable);
-
- Localities = *ACPI_CAST_PTR (UINT32, Subtable->Buffer);
- LocalityBuffer = UtLocalCalloc (Localities);
-
- /* Compile each locality buffer */
-
- FieldList = *PFieldList;
- while (FieldList)
- {
- DtCompileBuffer (LocalityBuffer,
- FieldList->Value, FieldList, Localities);
-
- DtCreateSubtable (LocalityBuffer, Localities, &Subtable);
- DtInsertSubtable (ParentTable, Subtable);
- FieldList = FieldList->Next;
- }
-
- ACPI_FREE (LocalityBuffer);
- return (AE_OK);
-}
-
-
-/******************************************************************************
- *
- * FUNCTION: DtCompileSrat
- *
- * PARAMETERS: List - Current field list pointer
- *
- * RETURN: Status
- *
- * DESCRIPTION: Compile SRAT.
- *
- *****************************************************************************/
-
-ACPI_STATUS
-DtCompileSrat (
- void **List)
-{
- ACPI_STATUS Status;
- DT_SUBTABLE *Subtable;
- DT_SUBTABLE *ParentTable;
- DT_FIELD **PFieldList = (DT_FIELD **) List;
- DT_FIELD *SubtableStart;
- ACPI_SUBTABLE_HEADER *SratHeader;
- ACPI_DMTABLE_INFO *InfoTable;
-
-
- Status = DtCompileTable (PFieldList, AcpiDmTableInfoSrat,
- &Subtable, TRUE);
- if (ACPI_FAILURE (Status))
- {
- return (Status);
- }
-
- ParentTable = DtPeekSubtable ();
- DtInsertSubtable (ParentTable, Subtable);
-
- while (*PFieldList)
- {
- SubtableStart = *PFieldList;
- Status = DtCompileTable (PFieldList, AcpiDmTableInfoSratHdr,
- &Subtable, TRUE);
- if (ACPI_FAILURE (Status))
- {
- return (Status);
- }
-
- ParentTable = DtPeekSubtable ();
- DtInsertSubtable (ParentTable, Subtable);
- DtPushSubtable (Subtable);
-
- SratHeader = ACPI_CAST_PTR (ACPI_SUBTABLE_HEADER, Subtable->Buffer);
-
- switch (SratHeader->Type)
- {
- case ACPI_SRAT_TYPE_CPU_AFFINITY:
-
- InfoTable = AcpiDmTableInfoSrat0;
- break;
-
- case ACPI_SRAT_TYPE_MEMORY_AFFINITY:
-
- InfoTable = AcpiDmTableInfoSrat1;
- break;
-
- case ACPI_SRAT_TYPE_X2APIC_CPU_AFFINITY:
-
- InfoTable = AcpiDmTableInfoSrat2;
- break;
-
- case ACPI_SRAT_TYPE_GICC_AFFINITY:
-
- InfoTable = AcpiDmTableInfoSrat3;
- break;
-
- default:
-
- DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "SRAT");
- return (AE_ERROR);
- }
-
- Status = DtCompileTable (PFieldList, InfoTable, &Subtable, TRUE);
- if (ACPI_FAILURE (Status))
- {
- return (Status);
- }
-
- ParentTable = DtPeekSubtable ();
- DtInsertSubtable (ParentTable, Subtable);
- DtPopSubtable ();
- }
-
- return (AE_OK);
-}
-
-
-/******************************************************************************
- *
- * FUNCTION: DtCompileStao
- *
- * PARAMETERS: PFieldList - Current field list pointer
- *
- * RETURN: Status
- *
- * DESCRIPTION: Compile STAO.
- *
- *****************************************************************************/
-
-ACPI_STATUS
-DtCompileStao (
- void **List)
-{
- DT_FIELD **PFieldList = (DT_FIELD **) List;
- DT_SUBTABLE *Subtable;
- DT_SUBTABLE *ParentTable;
- ACPI_STATUS Status;
-
-
- /* Compile the main table */
-
- Status = DtCompileTable (PFieldList, AcpiDmTableInfoStao,
- &Subtable, TRUE);
- if (ACPI_FAILURE (Status))
- {
- return (Status);
- }
-
- ParentTable = DtPeekSubtable ();
- DtInsertSubtable (ParentTable, Subtable);
-
- /* Compile each ASCII namestring as a subtable */
-
- while (*PFieldList)
- {
- Status = DtCompileTable (PFieldList, AcpiDmTableInfoStaoStr,
- &Subtable, TRUE);
- if (ACPI_FAILURE (Status))
- {
- return (Status);
- }
-
- ParentTable = DtPeekSubtable ();
- DtInsertSubtable (ParentTable, Subtable);
- }
-
- return (AE_OK);
-}
-
-
-/******************************************************************************
- *
- * FUNCTION: DtCompileTcpa
- *
- * PARAMETERS: PFieldList - Current field list pointer
- *
- * RETURN: Status
- *
- * DESCRIPTION: Compile TCPA.
- *
- *****************************************************************************/
-
-ACPI_STATUS
-DtCompileTcpa (
- void **List)
-{
- DT_FIELD **PFieldList = (DT_FIELD **) List;
- DT_SUBTABLE *Subtable;
- ACPI_TABLE_TCPA_HDR *TcpaHeader;
- DT_SUBTABLE *ParentTable;
- ACPI_STATUS Status;
-
-
- /* Compile the main table */
-
- Status = DtCompileTable (PFieldList, AcpiDmTableInfoTcpaHdr,
- &Subtable, TRUE);
- if (ACPI_FAILURE (Status))
- {
- return (Status);
- }
-
- ParentTable = DtPeekSubtable ();
- DtInsertSubtable (ParentTable, Subtable);
-
- /*
- * Examine the PlatformClass field to determine the table type.
- * Either a client or server table. Only one.
- */
- TcpaHeader = ACPI_CAST_PTR (ACPI_TABLE_TCPA_HDR, ParentTable->Buffer);
-
- switch (TcpaHeader->PlatformClass)
- {
- case ACPI_TCPA_CLIENT_TABLE:
-
- Status = DtCompileTable (PFieldList, AcpiDmTableInfoTcpaClient,
- &Subtable, TRUE);
- break;
-
- case ACPI_TCPA_SERVER_TABLE:
-
- Status = DtCompileTable (PFieldList, AcpiDmTableInfoTcpaServer,
- &Subtable, TRUE);
- break;
-
- default:
-
- AcpiOsPrintf ("\n**** Unknown TCPA Platform Class 0x%X\n",
- TcpaHeader->PlatformClass);
- Status = AE_ERROR;
- break;
- }
-
-
- ParentTable = DtPeekSubtable ();
- DtInsertSubtable (ParentTable, Subtable);
-
- return (Status);
-}
-
-
-/******************************************************************************
- *
- * FUNCTION: DtGetGenericTableInfo
- *
- * PARAMETERS: Name - Generic type name
- *
- * RETURN: Info entry
- *
- * DESCRIPTION: Obtain table info for a generic name entry
- *
- *****************************************************************************/
-
-ACPI_DMTABLE_INFO *
-DtGetGenericTableInfo (
- char *Name)
-{
- ACPI_DMTABLE_INFO *Info;
- UINT32 i;
-
-
- if (!Name)
- {
- return (NULL);
- }
-
- /* Search info table for name match */
-
- for (i = 0; ; i++)
- {
- Info = AcpiDmTableInfoGeneric[i];
- if (Info->Opcode == ACPI_DMT_EXIT)
- {
- Info = NULL;
- break;
- }
-
- /* Use caseless compare for generic keywords */
-
- if (!AcpiUtStricmp (Name, Info->Name))
- {
- break;
- }
- }
-
- return (Info);
-}
-
-
-/******************************************************************************
- *
- * FUNCTION: DtCompileUefi
- *
- * PARAMETERS: List - Current field list pointer
- *
- * RETURN: Status
- *
- * DESCRIPTION: Compile UEFI.
- *
- *****************************************************************************/
-
-ACPI_STATUS
-DtCompileUefi (
- void **List)
-{
- ACPI_STATUS Status;
- DT_SUBTABLE *Subtable;
- DT_SUBTABLE *ParentTable;
- DT_FIELD **PFieldList = (DT_FIELD **) List;
- UINT16 *DataOffset;
-
-
- /* Compile the predefined portion of the UEFI table */
-
- Status = DtCompileTable (PFieldList, AcpiDmTableInfoUefi,
- &Subtable, TRUE);
- if (ACPI_FAILURE (Status))
- {
- return (Status);
- }
-
- DataOffset = (UINT16 *) (Subtable->Buffer + 16);
- *DataOffset = sizeof (ACPI_TABLE_UEFI);
-
- ParentTable = DtPeekSubtable ();
- DtInsertSubtable (ParentTable, Subtable);
-
- /*
- * Compile the "generic" portion of the UEFI table. This
- * part of the table is not predefined and any of the generic
- * operators may be used.
- */
-
- DtCompileGeneric ((void **) PFieldList, NULL, NULL);
-
- return (AE_OK);
-}
-
-
-/******************************************************************************
- *
- * FUNCTION: DtCompileVrtc
- *
- * PARAMETERS: List - Current field list pointer
- *
- * RETURN: Status
- *
- * DESCRIPTION: Compile VRTC.
- *
- *****************************************************************************/
-
-ACPI_STATUS
-DtCompileVrtc (
- void **List)
-{
- ACPI_STATUS Status;
-
-
- Status = DtCompileTwoSubtables (List,
- AcpiDmTableInfoVrtc, AcpiDmTableInfoVrtc0);
- return (Status);
-}
-
-
-/******************************************************************************
- *
- * FUNCTION: DtCompileWdat
- *
- * PARAMETERS: List - Current field list pointer
- *
- * RETURN: Status
- *
- * DESCRIPTION: Compile WDAT.
- *
- *****************************************************************************/
-
-ACPI_STATUS
-DtCompileWdat (
- void **List)
-{
- ACPI_STATUS Status;
-
-
- Status = DtCompileTwoSubtables (List,
- AcpiDmTableInfoWdat, AcpiDmTableInfoWdat0);
- return (Status);
-}
-
-
-/******************************************************************************
- *
- * FUNCTION: DtCompileWpbt
- *
- * PARAMETERS: List - Current field list pointer
- *
- * RETURN: Status
- *
- * DESCRIPTION: Compile WPBT.
- *
- *****************************************************************************/
-
-ACPI_STATUS
-DtCompileWpbt (
- void **List)
-{
- DT_FIELD **PFieldList = (DT_FIELD **) List;
- DT_SUBTABLE *Subtable;
- DT_SUBTABLE *ParentTable;
- ACPI_TABLE_WPBT *Table;
- ACPI_STATUS Status;
- UINT16 Length;
-
-
- /* Compile the main table */
-
- Status = DtCompileTable (PFieldList, AcpiDmTableInfoWpbt,
- &Subtable, TRUE);
- if (ACPI_FAILURE (Status))
- {
- return (Status);
- }
-
- ParentTable = DtPeekSubtable ();
- DtInsertSubtable (ParentTable, Subtable);
-
- /* Compile the argument list subtable */
-
- Status = DtCompileTable (PFieldList, AcpiDmTableInfoWpbt0,
- &Subtable, TRUE);
- if (ACPI_FAILURE (Status))
- {
- return (Status);
- }
-
- /* Extract the length of the Arguments buffer, insert into main table */
-
- Length = (UINT16) Subtable->TotalLength;
- Table = ACPI_CAST_PTR (ACPI_TABLE_WPBT, ParentTable->Buffer);
- Table->ArgumentsLength = Length;
-
- ParentTable = DtPeekSubtable ();
- DtInsertSubtable (ParentTable, Subtable);
- return (AE_OK);
-}
-
-
-/******************************************************************************
- *
- * FUNCTION: DtCompileXsdt
- *
- * PARAMETERS: List - Current field list pointer
- *
- * RETURN: Status
- *
- * DESCRIPTION: Compile XSDT.
- *
- *****************************************************************************/
-
-ACPI_STATUS
-DtCompileXsdt (
- void **List)
-{
- DT_SUBTABLE *Subtable;
- DT_SUBTABLE *ParentTable;
- DT_FIELD *FieldList = *(DT_FIELD **) List;
- UINT64 Address;
-
-
- ParentTable = DtPeekSubtable ();
-
- while (FieldList)
- {
- DtCompileInteger ((UINT8 *) &Address, FieldList, 8, DT_NON_ZERO);
-
- DtCreateSubtable ((UINT8 *) &Address, 8, &Subtable);
- DtInsertSubtable (ParentTable, Subtable);
- FieldList = FieldList->Next;
- }
-
- return (AE_OK);
-}
-
-
-/******************************************************************************
- *
- * FUNCTION: DtCompileGeneric
- *
- * PARAMETERS: List - Current field list pointer
- * Name - Field name to end generic compiling
- * Length - Compiled table length to return
- *
- * RETURN: Status
- *
- * DESCRIPTION: Compile generic unknown table.
- *
- *****************************************************************************/
-
-ACPI_STATUS
-DtCompileGeneric (
- void **List,
- char *Name,
- UINT32 *Length)
-{
- ACPI_STATUS Status;
- DT_SUBTABLE *Subtable;
- DT_SUBTABLE *ParentTable;
- DT_FIELD **PFieldList = (DT_FIELD **) List;
- ACPI_DMTABLE_INFO *Info;
-
-
- ParentTable = DtPeekSubtable ();
-
- /*
- * Compile the "generic" portion of the table. This
- * part of the table is not predefined and any of the generic
- * operators may be used.
- */
-
- /* Find any and all labels in the entire generic portion */
-
- DtDetectAllLabels (*PFieldList);
-
- /* Now we can actually compile the parse tree */
-
- if (Length && *Length)
- {
- *Length = 0;
- }
- while (*PFieldList)
- {
- if (Name && !strcmp ((*PFieldList)->Name, Name))
- {
- break;
- }
- Info = DtGetGenericTableInfo ((*PFieldList)->Name);
- if (!Info)
- {
- sprintf (MsgBuffer, "Generic data type \"%s\" not found",
- (*PFieldList)->Name);
- DtNameError (ASL_ERROR, ASL_MSG_INVALID_FIELD_NAME,
- (*PFieldList), MsgBuffer);
-
- *PFieldList = (*PFieldList)->Next;
- continue;
- }
-
- Status = DtCompileTable (PFieldList, Info,
- &Subtable, TRUE);
- if (ACPI_SUCCESS (Status))
- {
- DtInsertSubtable (ParentTable, Subtable);
- if (Length)
- {
- *Length += Subtable->Length;
- }
- }
- else
- {
- *PFieldList = (*PFieldList)->Next;
-
- if (Status == AE_NOT_FOUND)
- {
- sprintf (MsgBuffer, "Generic data type \"%s\" not found",
- (*PFieldList)->Name);
- DtNameError (ASL_ERROR, ASL_MSG_INVALID_FIELD_NAME,
- (*PFieldList), MsgBuffer);
- }
- }
- }
+ DtCreateSubtable (ReservedBuffer, ReservedSize, &Subtable);
+ ACPI_FREE (ReservedBuffer);
+ DtInsertSubtable (Gbl_RootTable, Subtable);
return (AE_OK);
}
diff --git a/src/acpica/source/compiler/dttable1.c b/src/acpica/source/compiler/dttable1.c
new file mode 100644
index 0000000..3db4b93
--- /dev/null
+++ b/src/acpica/source/compiler/dttable1.c
@@ -0,0 +1,1743 @@
+/******************************************************************************
+ *
+ * Module Name: dttable1.c - handling for specific ACPI tables
+ *
+ *****************************************************************************/
+
+/******************************************************************************
+ *
+ * 1. Copyright Notice
+ *
+ * Some or all of this work - Copyright (c) 1999 - 2015, 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.
+ *
+ *****************************************************************************/
+
+/* Compile all complex data tables, signatures starting with A-I */
+
+#include "aslcompiler.h"
+#include "dtcompiler.h"
+
+#define _COMPONENT DT_COMPILER
+ ACPI_MODULE_NAME ("dttable1")
+
+
+static ACPI_DMTABLE_INFO TableInfoAsfAddress[] =
+{
+ {ACPI_DMT_BUFFER, 0, "Addresses", 0},
+ {ACPI_DMT_EXIT, 0, NULL, 0}
+};
+
+static ACPI_DMTABLE_INFO TableInfoDmarPciPath[] =
+{
+ {ACPI_DMT_PCI_PATH, 0, "PCI Path", 0},
+ {ACPI_DMT_EXIT, 0, NULL, 0}
+};
+
+
+/******************************************************************************
+ *
+ * FUNCTION: DtCompileAsf
+ *
+ * PARAMETERS: List - Current field list pointer
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Compile ASF!.
+ *
+ *****************************************************************************/
+
+ACPI_STATUS
+DtCompileAsf (
+ void **List)
+{
+ ACPI_ASF_INFO *AsfTable;
+ DT_SUBTABLE *Subtable;
+ DT_SUBTABLE *ParentTable;
+ ACPI_DMTABLE_INFO *InfoTable;
+ ACPI_DMTABLE_INFO *DataInfoTable = NULL;
+ UINT32 DataCount = 0;
+ ACPI_STATUS Status;
+ UINT32 i;
+ DT_FIELD **PFieldList = (DT_FIELD **) List;
+ DT_FIELD *SubtableStart;
+
+
+ while (*PFieldList)
+ {
+ SubtableStart = *PFieldList;
+ Status = DtCompileTable (PFieldList, AcpiDmTableInfoAsfHdr,
+ &Subtable, TRUE);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ ParentTable = DtPeekSubtable ();
+ DtInsertSubtable (ParentTable, Subtable);
+ DtPushSubtable (Subtable);
+
+ AsfTable = ACPI_CAST_PTR (ACPI_ASF_INFO, Subtable->Buffer);
+
+ switch (AsfTable->Header.Type & 0x7F) /* Mask off top bit */
+ {
+ case ACPI_ASF_TYPE_INFO:
+
+ InfoTable = AcpiDmTableInfoAsf0;
+ break;
+
+ case ACPI_ASF_TYPE_ALERT:
+
+ InfoTable = AcpiDmTableInfoAsf1;
+ break;
+
+ case ACPI_ASF_TYPE_CONTROL:
+
+ InfoTable = AcpiDmTableInfoAsf2;
+ break;
+
+ case ACPI_ASF_TYPE_BOOT:
+
+ InfoTable = AcpiDmTableInfoAsf3;
+ break;
+
+ case ACPI_ASF_TYPE_ADDRESS:
+
+ InfoTable = AcpiDmTableInfoAsf4;
+ break;
+
+ default:
+
+ DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "ASF!");
+ return (AE_ERROR);
+ }
+
+ Status = DtCompileTable (PFieldList, InfoTable, &Subtable, TRUE);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ ParentTable = DtPeekSubtable ();
+ DtInsertSubtable (ParentTable, Subtable);
+
+ switch (AsfTable->Header.Type & 0x7F) /* Mask off top bit */
+ {
+ case ACPI_ASF_TYPE_INFO:
+
+ DataInfoTable = NULL;
+ break;
+
+ case ACPI_ASF_TYPE_ALERT:
+
+ DataInfoTable = AcpiDmTableInfoAsf1a;
+ DataCount = ACPI_CAST_PTR (ACPI_ASF_ALERT,
+ ACPI_SUB_PTR (UINT8, Subtable->Buffer,
+ sizeof (ACPI_ASF_HEADER)))->Alerts;
+ break;
+
+ case ACPI_ASF_TYPE_CONTROL:
+
+ DataInfoTable = AcpiDmTableInfoAsf2a;
+ DataCount = ACPI_CAST_PTR (ACPI_ASF_REMOTE,
+ ACPI_SUB_PTR (UINT8, Subtable->Buffer,
+ sizeof (ACPI_ASF_HEADER)))->Controls;
+ break;
+
+ case ACPI_ASF_TYPE_BOOT:
+
+ DataInfoTable = NULL;
+ break;
+
+ case ACPI_ASF_TYPE_ADDRESS:
+
+ DataInfoTable = TableInfoAsfAddress;
+ DataCount = ACPI_CAST_PTR (ACPI_ASF_ADDRESS,
+ ACPI_SUB_PTR (UINT8, Subtable->Buffer,
+ sizeof (ACPI_ASF_HEADER)))->Devices;
+ break;
+
+ default:
+
+ DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "ASF!");
+ return (AE_ERROR);
+ }
+
+ if (DataInfoTable)
+ {
+ switch (AsfTable->Header.Type & 0x7F)
+ {
+ case ACPI_ASF_TYPE_ADDRESS:
+
+ while (DataCount > 0)
+ {
+ Status = DtCompileTable (PFieldList, DataInfoTable,
+ &Subtable, TRUE);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ DtInsertSubtable (ParentTable, Subtable);
+ DataCount = DataCount - Subtable->Length;
+ }
+ break;
+
+ default:
+
+ for (i = 0; i < DataCount; i++)
+ {
+ Status = DtCompileTable (PFieldList, DataInfoTable,
+ &Subtable, TRUE);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ DtInsertSubtable (ParentTable, Subtable);
+ }
+ break;
+ }
+ }
+
+ DtPopSubtable ();
+ }
+
+ return (AE_OK);
+}
+
+
+/******************************************************************************
+ *
+ * FUNCTION: DtCompileCpep
+ *
+ * PARAMETERS: List - Current field list pointer
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Compile CPEP.
+ *
+ *****************************************************************************/
+
+ACPI_STATUS
+DtCompileCpep (
+ void **List)
+{
+ ACPI_STATUS Status;
+
+
+ Status = DtCompileTwoSubtables (List,
+ AcpiDmTableInfoCpep, AcpiDmTableInfoCpep0);
+ return (Status);
+}
+
+
+/******************************************************************************
+ *
+ * FUNCTION: DtCompileCsrt
+ *
+ * PARAMETERS: List - Current field list pointer
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Compile CSRT.
+ *
+ *****************************************************************************/
+
+ACPI_STATUS
+DtCompileCsrt (
+ void **List)
+{
+ ACPI_STATUS Status = AE_OK;
+ DT_SUBTABLE *Subtable;
+ DT_SUBTABLE *ParentTable;
+ DT_FIELD **PFieldList = (DT_FIELD **) List;
+ UINT32 DescriptorCount;
+ UINT32 GroupLength;
+
+
+ /* Subtables (Resource Groups) */
+
+ ParentTable = DtPeekSubtable ();
+ while (*PFieldList)
+ {
+ /* Resource group subtable */
+
+ Status = DtCompileTable (PFieldList, AcpiDmTableInfoCsrt0,
+ &Subtable, TRUE);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ /* Compute the number of resource descriptors */
+
+ GroupLength =
+ (ACPI_CAST_PTR (ACPI_CSRT_GROUP,
+ Subtable->Buffer))->Length -
+ (ACPI_CAST_PTR (ACPI_CSRT_GROUP,
+ Subtable->Buffer))->SharedInfoLength -
+ sizeof (ACPI_CSRT_GROUP);
+
+ DescriptorCount = (GroupLength /
+ sizeof (ACPI_CSRT_DESCRIPTOR));
+
+ DtInsertSubtable (ParentTable, Subtable);
+ DtPushSubtable (Subtable);
+ ParentTable = DtPeekSubtable ();
+
+ /* Shared info subtable (One per resource group) */
+
+ Status = DtCompileTable (PFieldList, AcpiDmTableInfoCsrt1,
+ &Subtable, TRUE);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ DtInsertSubtable (ParentTable, Subtable);
+
+ /* Sub-Subtables (Resource Descriptors) */
+
+ while (*PFieldList && DescriptorCount)
+ {
+
+ Status = DtCompileTable (PFieldList, AcpiDmTableInfoCsrt2,
+ &Subtable, TRUE);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ DtInsertSubtable (ParentTable, Subtable);
+
+ DtPushSubtable (Subtable);
+ ParentTable = DtPeekSubtable ();
+ if (*PFieldList)
+ {
+ Status = DtCompileTable (PFieldList, AcpiDmTableInfoCsrt2a,
+ &Subtable, TRUE);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+ if (Subtable)
+ {
+ DtInsertSubtable (ParentTable, Subtable);
+ }
+ }
+
+ DtPopSubtable ();
+ ParentTable = DtPeekSubtable ();
+ DescriptorCount--;
+ }
+
+ DtPopSubtable ();
+ ParentTable = DtPeekSubtable ();
+ }
+
+ return (Status);
+}
+
+
+/******************************************************************************
+ *
+ * FUNCTION: DtCompileDbg2
+ *
+ * PARAMETERS: List - Current field list pointer
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Compile DBG2.
+ *
+ *****************************************************************************/
+
+ACPI_STATUS
+DtCompileDbg2 (
+ void **List)
+{
+ ACPI_STATUS Status;
+ DT_SUBTABLE *Subtable;
+ DT_SUBTABLE *ParentTable;
+ DT_FIELD **PFieldList = (DT_FIELD **) List;
+ UINT32 SubtableCount;
+ ACPI_DBG2_HEADER *Dbg2Header;
+ ACPI_DBG2_DEVICE *DeviceInfo;
+ UINT16 CurrentOffset;
+ UINT32 i;
+
+
+ /* Main table */
+
+ Status = DtCompileTable (PFieldList, AcpiDmTableInfoDbg2, &Subtable, TRUE);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ ParentTable = DtPeekSubtable ();
+ DtInsertSubtable (ParentTable, Subtable);
+
+ /* Main table fields */
+
+ Dbg2Header = ACPI_CAST_PTR (ACPI_DBG2_HEADER, Subtable->Buffer);
+ Dbg2Header->InfoOffset = sizeof (ACPI_TABLE_HEADER) + ACPI_PTR_DIFF (
+ ACPI_ADD_PTR (UINT8, Dbg2Header, sizeof (ACPI_DBG2_HEADER)), Dbg2Header);
+
+ SubtableCount = Dbg2Header->InfoCount;
+ DtPushSubtable (Subtable);
+
+ /* Process all Device Information subtables (Count = InfoCount) */
+
+ while (*PFieldList && SubtableCount)
+ {
+ /* Subtable: Debug Device Information */
+
+ Status = DtCompileTable (PFieldList, AcpiDmTableInfoDbg2Device,
+ &Subtable, TRUE);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ DeviceInfo = ACPI_CAST_PTR (ACPI_DBG2_DEVICE, Subtable->Buffer);
+ CurrentOffset = (UINT16) sizeof (ACPI_DBG2_DEVICE);
+
+ ParentTable = DtPeekSubtable ();
+ DtInsertSubtable (ParentTable, Subtable);
+ DtPushSubtable (Subtable);
+
+ ParentTable = DtPeekSubtable ();
+
+ /* BaseAddressRegister GAS array (Required, size is RegisterCount) */
+
+ DeviceInfo->BaseAddressOffset = CurrentOffset;
+ for (i = 0; *PFieldList && (i < DeviceInfo->RegisterCount); i++)
+ {
+ Status = DtCompileTable (PFieldList, AcpiDmTableInfoDbg2Addr,
+ &Subtable, TRUE);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ CurrentOffset += (UINT16) sizeof (ACPI_GENERIC_ADDRESS);
+ DtInsertSubtable (ParentTable, Subtable);
+ }
+
+ /* AddressSize array (Required, size = RegisterCount) */
+
+ DeviceInfo->AddressSizeOffset = CurrentOffset;
+ for (i = 0; *PFieldList && (i < DeviceInfo->RegisterCount); i++)
+ {
+ Status = DtCompileTable (PFieldList, AcpiDmTableInfoDbg2Size,
+ &Subtable, TRUE);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ CurrentOffset += (UINT16) sizeof (UINT32);
+ DtInsertSubtable (ParentTable, Subtable);
+ }
+
+ /* NamespaceString device identifier (Required, size = NamePathLength) */
+
+ DeviceInfo->NamepathOffset = CurrentOffset;
+ Status = DtCompileTable (PFieldList, AcpiDmTableInfoDbg2Name,
+ &Subtable, TRUE);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ /* Update the device info header */
+
+ DeviceInfo->NamepathLength = (UINT16) Subtable->Length;
+ CurrentOffset += (UINT16) DeviceInfo->NamepathLength;
+ DtInsertSubtable (ParentTable, Subtable);
+
+ /* OemData - Variable-length data (Optional, size = OemDataLength) */
+
+ Status = DtCompileTable (PFieldList, AcpiDmTableInfoDbg2OemData,
+ &Subtable, TRUE);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ /* Update the device info header (zeros if no OEM data present) */
+
+ DeviceInfo->OemDataOffset = 0;
+ DeviceInfo->OemDataLength = 0;
+
+ /* Optional subtable (OemData) */
+
+ if (Subtable && Subtable->Length)
+ {
+ DeviceInfo->OemDataOffset = CurrentOffset;
+ DeviceInfo->OemDataLength = (UINT16) Subtable->Length;
+
+ DtInsertSubtable (ParentTable, Subtable);
+ }
+
+ SubtableCount--;
+ DtPopSubtable (); /* Get next Device Information subtable */
+ }
+
+ DtPopSubtable ();
+ return (AE_OK);
+}
+
+
+/******************************************************************************
+ *
+ * FUNCTION: DtCompileDmar
+ *
+ * PARAMETERS: List - Current field list pointer
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Compile DMAR.
+ *
+ *****************************************************************************/
+
+ACPI_STATUS
+DtCompileDmar (
+ void **List)
+{
+ ACPI_STATUS Status;
+ DT_SUBTABLE *Subtable;
+ DT_SUBTABLE *ParentTable;
+ DT_FIELD **PFieldList = (DT_FIELD **) List;
+ DT_FIELD *SubtableStart;
+ ACPI_DMTABLE_INFO *InfoTable;
+ ACPI_DMAR_HEADER *DmarHeader;
+ ACPI_DMAR_DEVICE_SCOPE *DmarDeviceScope;
+ UINT32 DeviceScopeLength;
+ UINT32 PciPathLength;
+
+
+ Status = DtCompileTable (PFieldList, AcpiDmTableInfoDmar, &Subtable, TRUE);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ ParentTable = DtPeekSubtable ();
+ DtInsertSubtable (ParentTable, Subtable);
+ DtPushSubtable (Subtable);
+
+ while (*PFieldList)
+ {
+ /* DMAR Header */
+
+ SubtableStart = *PFieldList;
+ Status = DtCompileTable (PFieldList, AcpiDmTableInfoDmarHdr,
+ &Subtable, TRUE);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ ParentTable = DtPeekSubtable ();
+ DtInsertSubtable (ParentTable, Subtable);
+ DtPushSubtable (Subtable);
+
+ DmarHeader = ACPI_CAST_PTR (ACPI_DMAR_HEADER, Subtable->Buffer);
+
+ switch (DmarHeader->Type)
+ {
+ case ACPI_DMAR_TYPE_HARDWARE_UNIT:
+
+ InfoTable = AcpiDmTableInfoDmar0;
+ break;
+
+ case ACPI_DMAR_TYPE_RESERVED_MEMORY:
+
+ InfoTable = AcpiDmTableInfoDmar1;
+ break;
+
+ case ACPI_DMAR_TYPE_ROOT_ATS:
+
+ InfoTable = AcpiDmTableInfoDmar2;
+ break;
+
+ case ACPI_DMAR_TYPE_HARDWARE_AFFINITY:
+
+ InfoTable = AcpiDmTableInfoDmar3;
+ break;
+
+ case ACPI_DMAR_TYPE_NAMESPACE:
+
+ InfoTable = AcpiDmTableInfoDmar4;
+ break;
+
+ default:
+
+ DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "DMAR");
+ return (AE_ERROR);
+ }
+
+ /* DMAR Subtable */
+
+ Status = DtCompileTable (PFieldList, InfoTable, &Subtable, TRUE);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ ParentTable = DtPeekSubtable ();
+ DtInsertSubtable (ParentTable, Subtable);
+
+ /*
+ * Optional Device Scope subtables
+ */
+ if ((DmarHeader->Type == ACPI_DMAR_TYPE_HARDWARE_AFFINITY) ||
+ (DmarHeader->Type == ACPI_DMAR_TYPE_NAMESPACE))
+ {
+ /* These types do not support device scopes */
+
+ DtPopSubtable ();
+ continue;
+ }
+
+ DtPushSubtable (Subtable);
+ DeviceScopeLength = DmarHeader->Length - Subtable->Length -
+ ParentTable->Length;
+ while (DeviceScopeLength)
+ {
+ Status = DtCompileTable (PFieldList, AcpiDmTableInfoDmarScope,
+ &Subtable, FALSE);
+ if (Status == AE_NOT_FOUND)
+ {
+ break;
+ }
+
+ ParentTable = DtPeekSubtable ();
+ DtInsertSubtable (ParentTable, Subtable);
+ DtPushSubtable (Subtable);
+
+ DmarDeviceScope = ACPI_CAST_PTR (ACPI_DMAR_DEVICE_SCOPE, Subtable->Buffer);
+
+ /* Optional PCI Paths */
+
+ PciPathLength = DmarDeviceScope->Length - Subtable->Length;
+ while (PciPathLength)
+ {
+ Status = DtCompileTable (PFieldList, TableInfoDmarPciPath,
+ &Subtable, FALSE);
+ if (Status == AE_NOT_FOUND)
+ {
+ DtPopSubtable ();
+ break;
+ }
+
+ ParentTable = DtPeekSubtable ();
+ DtInsertSubtable (ParentTable, Subtable);
+ PciPathLength -= Subtable->Length;
+ }
+
+ DtPopSubtable ();
+ DeviceScopeLength -= DmarDeviceScope->Length;
+ }
+
+ DtPopSubtable ();
+ DtPopSubtable ();
+ }
+
+ return (AE_OK);
+}
+
+
+/******************************************************************************
+ *
+ * FUNCTION: DtCompileDrtm
+ *
+ * PARAMETERS: List - Current field list pointer
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Compile DRTM.
+ *
+ *****************************************************************************/
+
+ACPI_STATUS
+DtCompileDrtm (
+ void **List)
+{
+ ACPI_STATUS Status;
+ DT_SUBTABLE *Subtable;
+ DT_SUBTABLE *ParentTable;
+ DT_FIELD **PFieldList = (DT_FIELD **) List;
+ UINT32 Count;
+ /* ACPI_TABLE_DRTM *Drtm; */
+ ACPI_DRTM_VTABLE_LIST *DrtmVtl;
+ ACPI_DRTM_RESOURCE_LIST *DrtmRl;
+ /* ACPI_DRTM_DPS_ID *DrtmDps; */
+
+
+ ParentTable = DtPeekSubtable ();
+
+ /* Compile DRTM header */
+
+ Status = DtCompileTable (PFieldList, AcpiDmTableInfoDrtm,
+ &Subtable, TRUE);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+ DtInsertSubtable (ParentTable, Subtable);
+
+ /*
+ * Using ACPI_SUB_PTR, We needn't define a seperate structure. Care
+ * should be taken to avoid accessing ACPI_TABLE_HADER fields.
+ */
+#if 0
+ Drtm = ACPI_SUB_PTR (ACPI_TABLE_DRTM,
+ Subtable->Buffer, sizeof (ACPI_TABLE_HEADER));
+#endif
+ /* Compile VTL */
+
+ Status = DtCompileTable (PFieldList, AcpiDmTableInfoDrtm0,
+ &Subtable, TRUE);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ DtInsertSubtable (ParentTable, Subtable);
+ DrtmVtl = ACPI_CAST_PTR (ACPI_DRTM_VTABLE_LIST, Subtable->Buffer);
+
+ DtPushSubtable (Subtable);
+ ParentTable = DtPeekSubtable ();
+ Count = 0;
+
+ while (*PFieldList)
+ {
+ Status = DtCompileTable (PFieldList, AcpiDmTableInfoDrtm0a,
+ &Subtable, TRUE);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+ if (!Subtable)
+ {
+ break;
+ }
+ DtInsertSubtable (ParentTable, Subtable);
+ Count++;
+ }
+
+ DrtmVtl->ValidatedTableCount = Count;
+ DtPopSubtable ();
+ ParentTable = DtPeekSubtable ();
+
+ /* Compile RL */
+
+ Status = DtCompileTable (PFieldList, AcpiDmTableInfoDrtm1,
+ &Subtable, TRUE);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ DtInsertSubtable (ParentTable, Subtable);
+ DrtmRl = ACPI_CAST_PTR (ACPI_DRTM_RESOURCE_LIST, Subtable->Buffer);
+
+ DtPushSubtable (Subtable);
+ ParentTable = DtPeekSubtable ();
+ Count = 0;
+
+ while (*PFieldList)
+ {
+ Status = DtCompileTable (PFieldList, AcpiDmTableInfoDrtm1a,
+ &Subtable, TRUE);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ if (!Subtable)
+ {
+ break;
+ }
+
+ DtInsertSubtable (ParentTable, Subtable);
+ Count++;
+ }
+
+ DrtmRl->ResourceCount = Count;
+ DtPopSubtable ();
+ ParentTable = DtPeekSubtable ();
+
+ /* Compile DPS */
+
+ Status = DtCompileTable (PFieldList, AcpiDmTableInfoDrtm2,
+ &Subtable, TRUE);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+ DtInsertSubtable (ParentTable, Subtable);
+ /* DrtmDps = ACPI_CAST_PTR (ACPI_DRTM_DPS_ID, Subtable->Buffer);*/
+
+
+ return (AE_OK);
+}
+
+
+/******************************************************************************
+ *
+ * FUNCTION: DtCompileEinj
+ *
+ * PARAMETERS: List - Current field list pointer
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Compile EINJ.
+ *
+ *****************************************************************************/
+
+ACPI_STATUS
+DtCompileEinj (
+ void **List)
+{
+ ACPI_STATUS Status;
+
+
+ Status = DtCompileTwoSubtables (List,
+ AcpiDmTableInfoEinj, AcpiDmTableInfoEinj0);
+ return (Status);
+}
+
+
+/******************************************************************************
+ *
+ * FUNCTION: DtCompileErst
+ *
+ * PARAMETERS: List - Current field list pointer
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Compile ERST.
+ *
+ *****************************************************************************/
+
+ACPI_STATUS
+DtCompileErst (
+ void **List)
+{
+ ACPI_STATUS Status;
+
+
+ Status = DtCompileTwoSubtables (List,
+ AcpiDmTableInfoErst, AcpiDmTableInfoEinj0);
+ return (Status);
+}
+
+
+/******************************************************************************
+ *
+ * FUNCTION: DtCompileGtdt
+ *
+ * PARAMETERS: List - Current field list pointer
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Compile GTDT.
+ *
+ *****************************************************************************/
+
+ACPI_STATUS
+DtCompileGtdt (
+ void **List)
+{
+ ACPI_STATUS Status;
+ DT_SUBTABLE *Subtable;
+ DT_SUBTABLE *ParentTable;
+ DT_FIELD **PFieldList = (DT_FIELD **) List;
+ DT_FIELD *SubtableStart;
+ ACPI_SUBTABLE_HEADER *GtdtHeader;
+ ACPI_DMTABLE_INFO *InfoTable;
+ UINT32 GtCount;
+
+
+ Status = DtCompileTable (PFieldList, AcpiDmTableInfoGtdt,
+ &Subtable, TRUE);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ ParentTable = DtPeekSubtable ();
+ DtInsertSubtable (ParentTable, Subtable);
+
+ while (*PFieldList)
+ {
+ SubtableStart = *PFieldList;
+ Status = DtCompileTable (PFieldList, AcpiDmTableInfoGtdtHdr,
+ &Subtable, TRUE);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ ParentTable = DtPeekSubtable ();
+ DtInsertSubtable (ParentTable, Subtable);
+ DtPushSubtable (Subtable);
+
+ GtdtHeader = ACPI_CAST_PTR (ACPI_SUBTABLE_HEADER, Subtable->Buffer);
+
+ switch (GtdtHeader->Type)
+ {
+ case ACPI_GTDT_TYPE_TIMER_BLOCK:
+
+ InfoTable = AcpiDmTableInfoGtdt0;
+ break;
+
+ case ACPI_GTDT_TYPE_WATCHDOG:
+
+ InfoTable = AcpiDmTableInfoGtdt1;
+ break;
+
+ default:
+
+ DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "GTDT");
+ return (AE_ERROR);
+ }
+
+ Status = DtCompileTable (PFieldList, InfoTable, &Subtable, TRUE);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ ParentTable = DtPeekSubtable ();
+ DtInsertSubtable (ParentTable, Subtable);
+
+ /*
+ * Additional GT block subtable data
+ */
+
+ switch (GtdtHeader->Type)
+ {
+ case ACPI_GTDT_TYPE_TIMER_BLOCK:
+
+ DtPushSubtable (Subtable);
+ ParentTable = DtPeekSubtable ();
+
+ GtCount = (ACPI_CAST_PTR (ACPI_GTDT_TIMER_BLOCK,
+ Subtable->Buffer - sizeof(ACPI_GTDT_HEADER)))->TimerCount;
+
+ while (GtCount)
+ {
+ Status = DtCompileTable (PFieldList, AcpiDmTableInfoGtdt0a,
+ &Subtable, TRUE);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ DtInsertSubtable (ParentTable, Subtable);
+ GtCount--;
+ }
+
+ DtPopSubtable ();
+ break;
+
+ default:
+
+ break;
+ }
+
+ DtPopSubtable ();
+ }
+
+ return (AE_OK);
+}
+
+
+/******************************************************************************
+ *
+ * FUNCTION: DtCompileFpdt
+ *
+ * PARAMETERS: List - Current field list pointer
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Compile FPDT.
+ *
+ *****************************************************************************/
+
+ACPI_STATUS
+DtCompileFpdt (
+ void **List)
+{
+ ACPI_STATUS Status;
+ ACPI_FPDT_HEADER *FpdtHeader;
+ DT_SUBTABLE *Subtable;
+ DT_SUBTABLE *ParentTable;
+ ACPI_DMTABLE_INFO *InfoTable;
+ DT_FIELD **PFieldList = (DT_FIELD **) List;
+ DT_FIELD *SubtableStart;
+
+
+ while (*PFieldList)
+ {
+ SubtableStart = *PFieldList;
+ Status = DtCompileTable (PFieldList, AcpiDmTableInfoFpdtHdr,
+ &Subtable, TRUE);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ ParentTable = DtPeekSubtable ();
+ DtInsertSubtable (ParentTable, Subtable);
+ DtPushSubtable (Subtable);
+
+ FpdtHeader = ACPI_CAST_PTR (ACPI_FPDT_HEADER, Subtable->Buffer);
+
+ switch (FpdtHeader->Type)
+ {
+ case ACPI_FPDT_TYPE_BOOT:
+
+ InfoTable = AcpiDmTableInfoFpdt0;
+ break;
+
+ case ACPI_FPDT_TYPE_S3PERF:
+
+ InfoTable = AcpiDmTableInfoFpdt1;
+ break;
+
+ default:
+
+ DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "FPDT");
+ return (AE_ERROR);
+ break;
+ }
+
+ Status = DtCompileTable (PFieldList, InfoTable, &Subtable, TRUE);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ ParentTable = DtPeekSubtable ();
+ DtInsertSubtable (ParentTable, Subtable);
+ DtPopSubtable ();
+ }
+
+ return (AE_OK);
+}
+
+
+/******************************************************************************
+ *
+ * FUNCTION: DtCompileHest
+ *
+ * PARAMETERS: List - Current field list pointer
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Compile HEST.
+ *
+ *****************************************************************************/
+
+ACPI_STATUS
+DtCompileHest (
+ void **List)
+{
+ ACPI_STATUS Status;
+ DT_SUBTABLE *Subtable;
+ DT_SUBTABLE *ParentTable;
+ DT_FIELD **PFieldList = (DT_FIELD **) List;
+ DT_FIELD *SubtableStart;
+ ACPI_DMTABLE_INFO *InfoTable;
+ UINT16 Type;
+ UINT32 BankCount;
+
+
+ Status = DtCompileTable (PFieldList, AcpiDmTableInfoHest,
+ &Subtable, TRUE);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ ParentTable = DtPeekSubtable ();
+ DtInsertSubtable (ParentTable, Subtable);
+
+ while (*PFieldList)
+ {
+ /* Get subtable type */
+
+ SubtableStart = *PFieldList;
+ DtCompileInteger ((UINT8 *) &Type, *PFieldList, 2, 0);
+
+ switch (Type)
+ {
+ case ACPI_HEST_TYPE_IA32_CHECK:
+
+ InfoTable = AcpiDmTableInfoHest0;
+ break;
+
+ case ACPI_HEST_TYPE_IA32_CORRECTED_CHECK:
+
+ InfoTable = AcpiDmTableInfoHest1;
+ break;
+
+ case ACPI_HEST_TYPE_IA32_NMI:
+
+ InfoTable = AcpiDmTableInfoHest2;
+ break;
+
+ case ACPI_HEST_TYPE_AER_ROOT_PORT:
+
+ InfoTable = AcpiDmTableInfoHest6;
+ break;
+
+ case ACPI_HEST_TYPE_AER_ENDPOINT:
+
+ InfoTable = AcpiDmTableInfoHest7;
+ break;
+
+ case ACPI_HEST_TYPE_AER_BRIDGE:
+
+ InfoTable = AcpiDmTableInfoHest8;
+ break;
+
+ case ACPI_HEST_TYPE_GENERIC_ERROR:
+
+ InfoTable = AcpiDmTableInfoHest9;
+ break;
+
+ default:
+
+ /* Cannot continue on unknown type */
+
+ DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "HEST");
+ return (AE_ERROR);
+ }
+
+ Status = DtCompileTable (PFieldList, InfoTable, &Subtable, TRUE);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ DtInsertSubtable (ParentTable, Subtable);
+
+ /*
+ * Additional subtable data - IA32 Error Bank(s)
+ */
+ BankCount = 0;
+ switch (Type)
+ {
+ case ACPI_HEST_TYPE_IA32_CHECK:
+
+ BankCount = (ACPI_CAST_PTR (ACPI_HEST_IA_MACHINE_CHECK,
+ Subtable->Buffer))->NumHardwareBanks;
+ break;
+
+ case ACPI_HEST_TYPE_IA32_CORRECTED_CHECK:
+
+ BankCount = (ACPI_CAST_PTR (ACPI_HEST_IA_CORRECTED,
+ Subtable->Buffer))->NumHardwareBanks;
+ break;
+
+ default:
+
+ break;
+ }
+
+ while (BankCount)
+ {
+ Status = DtCompileTable (PFieldList, AcpiDmTableInfoHestBank,
+ &Subtable, TRUE);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ DtInsertSubtable (ParentTable, Subtable);
+ BankCount--;
+ }
+ }
+
+ return (AE_OK);
+}
+
+
+/******************************************************************************
+ *
+ * FUNCTION: DtCompileIort
+ *
+ * PARAMETERS: List - Current field list pointer
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Compile IORT.
+ *
+ *****************************************************************************/
+
+ACPI_STATUS
+DtCompileIort (
+ void **List)
+{
+ ACPI_STATUS Status;
+ DT_SUBTABLE *Subtable;
+ DT_SUBTABLE *ParentTable;
+ DT_FIELD **PFieldList = (DT_FIELD **) List;
+ DT_FIELD *SubtableStart;
+ ACPI_TABLE_IORT *Iort;
+ ACPI_IORT_NODE *IortNode;
+ ACPI_IORT_ITS_GROUP *IortItsGroup;
+ ACPI_IORT_SMMU *IortSmmu;
+ UINT32 NodeNumber;
+ UINT32 NodeLength;
+ UINT32 IdMappingNumber;
+ UINT32 ItsNumber;
+ UINT32 ContextIrptNumber;
+ UINT32 PmuIrptNumber;
+ UINT32 PaddingLength;
+
+
+ ParentTable = DtPeekSubtable ();
+
+ Status = DtCompileTable (PFieldList, AcpiDmTableInfoIort,
+ &Subtable, TRUE);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+ DtInsertSubtable (ParentTable, Subtable);
+
+ /*
+ * Using ACPI_SUB_PTR, We needn't define a seperate structure. Care
+ * should be taken to avoid accessing ACPI_TABLE_HADER fields.
+ */
+ Iort = ACPI_SUB_PTR (ACPI_TABLE_IORT,
+ Subtable->Buffer, sizeof (ACPI_TABLE_HEADER));
+
+ /*
+ * OptionalPadding - Variable-length data
+ * (Optional, size = OffsetToNodes - sizeof (ACPI_TABLE_IORT))
+ * Optionally allows the generic data types to be used for filling
+ * this field.
+ */
+ Iort->NodeOffset = sizeof (ACPI_TABLE_IORT);
+ Status = DtCompileTable (PFieldList, AcpiDmTableInfoIortPad,
+ &Subtable, TRUE);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+ if (Subtable)
+ {
+ DtInsertSubtable (ParentTable, Subtable);
+ Iort->NodeOffset += Subtable->Length;
+ }
+ else
+ {
+ Status = DtCompileGeneric (ACPI_CAST_PTR (void *, PFieldList),
+ AcpiDmTableInfoIortHdr[0].Name, &PaddingLength);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+ Iort->NodeOffset += PaddingLength;
+ }
+
+ NodeNumber = 0;
+ while (*PFieldList)
+ {
+ SubtableStart = *PFieldList;
+ Status = DtCompileTable (PFieldList, AcpiDmTableInfoIortHdr,
+ &Subtable, TRUE);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ DtInsertSubtable (ParentTable, Subtable);
+ IortNode = ACPI_CAST_PTR (ACPI_IORT_NODE, Subtable->Buffer);
+ NodeLength = ACPI_OFFSET (ACPI_IORT_NODE, NodeData);
+
+ DtPushSubtable (Subtable);
+ ParentTable = DtPeekSubtable ();
+
+ switch (IortNode->Type)
+ {
+ case ACPI_IORT_NODE_ITS_GROUP:
+
+ Status = DtCompileTable (PFieldList, AcpiDmTableInfoIort0,
+ &Subtable, TRUE);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ DtInsertSubtable (ParentTable, Subtable);
+ IortItsGroup = ACPI_CAST_PTR (ACPI_IORT_ITS_GROUP, Subtable->Buffer);
+ NodeLength += Subtable->Length;
+
+ ItsNumber = 0;
+ while (*PFieldList)
+ {
+ Status = DtCompileTable (PFieldList, AcpiDmTableInfoIort0a,
+ &Subtable, TRUE);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+ if (!Subtable)
+ {
+ break;
+ }
+
+ DtInsertSubtable (ParentTable, Subtable);
+ NodeLength += Subtable->Length;
+ ItsNumber++;
+ }
+
+ IortItsGroup->ItsCount = ItsNumber;
+ break;
+
+ case ACPI_IORT_NODE_NAMED_COMPONENT:
+
+ Status = DtCompileTable (PFieldList, AcpiDmTableInfoIort1,
+ &Subtable, TRUE);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ DtInsertSubtable (ParentTable, Subtable);
+ NodeLength += Subtable->Length;
+
+ /*
+ * Padding - Variable-length data
+ * Optionally allows the offset of the ID mappings to be used
+ * for filling this field.
+ */
+ Status = DtCompileTable (PFieldList, AcpiDmTableInfoIort1a,
+ &Subtable, TRUE);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ if (Subtable)
+ {
+ DtInsertSubtable (ParentTable, Subtable);
+ NodeLength += Subtable->Length;
+ }
+ else
+ {
+ if (NodeLength > IortNode->MappingOffset)
+ {
+ return (AE_BAD_DATA);
+ }
+
+ if (NodeLength < IortNode->MappingOffset)
+ {
+ Status = DtCompilePadding (
+ IortNode->MappingOffset - NodeLength,
+ &Subtable);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ DtInsertSubtable (ParentTable, Subtable);
+ NodeLength = IortNode->MappingOffset;
+ }
+ }
+ break;
+
+ case ACPI_IORT_NODE_PCI_ROOT_COMPLEX:
+
+ Status = DtCompileTable (PFieldList, AcpiDmTableInfoIort2,
+ &Subtable, TRUE);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ DtInsertSubtable (ParentTable, Subtable);
+ NodeLength += Subtable->Length;
+ break;
+
+ case ACPI_IORT_NODE_SMMU:
+
+ Status = DtCompileTable (PFieldList, AcpiDmTableInfoIort3,
+ &Subtable, TRUE);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ DtInsertSubtable (ParentTable, Subtable);
+ IortSmmu = ACPI_CAST_PTR (ACPI_IORT_SMMU, Subtable->Buffer);
+ NodeLength += Subtable->Length;
+
+ /* Compile global interrupt array */
+
+ IortSmmu->GlobalInterruptOffset = NodeLength;
+ Status = DtCompileTable (PFieldList, AcpiDmTableInfoIort3a,
+ &Subtable, TRUE);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ DtInsertSubtable (ParentTable, Subtable);
+ NodeLength += Subtable->Length;
+
+ /* Compile context interrupt array */
+
+ ContextIrptNumber = 0;
+ IortSmmu->ContextInterruptOffset = NodeLength;
+ while (*PFieldList)
+ {
+ Status = DtCompileTable (PFieldList, AcpiDmTableInfoIort3b,
+ &Subtable, TRUE);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ if (!Subtable)
+ {
+ break;
+ }
+
+ DtInsertSubtable (ParentTable, Subtable);
+ NodeLength += Subtable->Length;
+ ContextIrptNumber++;
+ }
+
+ IortSmmu->ContextInterruptCount = ContextIrptNumber;
+
+ /* Compile PMU interrupt array */
+
+ PmuIrptNumber = 0;
+ IortSmmu->PmuInterruptOffset = NodeLength;
+ while (*PFieldList)
+ {
+ Status = DtCompileTable (PFieldList, AcpiDmTableInfoIort3c,
+ &Subtable, TRUE);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ if (!Subtable)
+ {
+ break;
+ }
+
+ DtInsertSubtable (ParentTable, Subtable);
+ NodeLength += Subtable->Length;
+ PmuIrptNumber++;
+ }
+
+ IortSmmu->PmuInterruptCount = PmuIrptNumber;
+ break;
+
+ default:
+
+ DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "IORT");
+ return (AE_ERROR);
+ }
+
+ /* Compile Array of ID mappings */
+
+ IortNode->MappingOffset = NodeLength;
+ IdMappingNumber = 0;
+ while (*PFieldList)
+ {
+ Status = DtCompileTable (PFieldList, AcpiDmTableInfoIortMap,
+ &Subtable, TRUE);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ if (!Subtable)
+ {
+ break;
+ }
+
+ DtInsertSubtable (ParentTable, Subtable);
+ NodeLength += sizeof (ACPI_IORT_ID_MAPPING);
+ IdMappingNumber++;
+ }
+
+ IortNode->MappingCount = IdMappingNumber;
+
+ /*
+ * Node length can be determined by DT_LENGTH option
+ * IortNode->Length = NodeLength;
+ */
+ DtPopSubtable ();
+ ParentTable = DtPeekSubtable ();
+ NodeNumber++;
+ }
+
+ Iort->NodeCount = NodeNumber;
+ return (AE_OK);
+}
+
+
+/******************************************************************************
+ *
+ * FUNCTION: DtCompileIvrs
+ *
+ * PARAMETERS: List - Current field list pointer
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Compile IVRS.
+ *
+ *****************************************************************************/
+
+ACPI_STATUS
+DtCompileIvrs (
+ void **List)
+{
+ ACPI_STATUS Status;
+ DT_SUBTABLE *Subtable;
+ DT_SUBTABLE *ParentTable;
+ DT_FIELD **PFieldList = (DT_FIELD **) List;
+ DT_FIELD *SubtableStart;
+ ACPI_DMTABLE_INFO *InfoTable;
+ ACPI_IVRS_HEADER *IvrsHeader;
+ UINT8 EntryType;
+
+
+ Status = DtCompileTable (PFieldList, AcpiDmTableInfoIvrs,
+ &Subtable, TRUE);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ ParentTable = DtPeekSubtable ();
+ DtInsertSubtable (ParentTable, Subtable);
+
+ while (*PFieldList)
+ {
+ SubtableStart = *PFieldList;
+ Status = DtCompileTable (PFieldList, AcpiDmTableInfoIvrsHdr,
+ &Subtable, TRUE);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ ParentTable = DtPeekSubtable ();
+ DtInsertSubtable (ParentTable, Subtable);
+ DtPushSubtable (Subtable);
+
+ IvrsHeader = ACPI_CAST_PTR (ACPI_IVRS_HEADER, Subtable->Buffer);
+
+ switch (IvrsHeader->Type)
+ {
+ case ACPI_IVRS_TYPE_HARDWARE:
+
+ InfoTable = AcpiDmTableInfoIvrs0;
+ break;
+
+ case ACPI_IVRS_TYPE_MEMORY1:
+ case ACPI_IVRS_TYPE_MEMORY2:
+ case ACPI_IVRS_TYPE_MEMORY3:
+
+ InfoTable = AcpiDmTableInfoIvrs1;
+ break;
+
+ default:
+
+ DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "IVRS");
+ return (AE_ERROR);
+ }
+
+ Status = DtCompileTable (PFieldList, InfoTable, &Subtable, TRUE);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ ParentTable = DtPeekSubtable ();
+ DtInsertSubtable (ParentTable, Subtable);
+
+ if (IvrsHeader->Type == ACPI_IVRS_TYPE_HARDWARE)
+ {
+ while (*PFieldList &&
+ !strcmp ((*PFieldList)->Name, "Entry Type"))
+ {
+ SubtableStart = *PFieldList;
+ DtCompileInteger (&EntryType, *PFieldList, 1, 0);
+
+ switch (EntryType)
+ {
+ /* 4-byte device entries */
+
+ case ACPI_IVRS_TYPE_PAD4:
+ case ACPI_IVRS_TYPE_ALL:
+ case ACPI_IVRS_TYPE_SELECT:
+ case ACPI_IVRS_TYPE_START:
+ case ACPI_IVRS_TYPE_END:
+
+ InfoTable = AcpiDmTableInfoIvrs4;
+ break;
+
+ /* 8-byte entries, type A */
+
+ case ACPI_IVRS_TYPE_ALIAS_SELECT:
+ case ACPI_IVRS_TYPE_ALIAS_START:
+
+ InfoTable = AcpiDmTableInfoIvrs8a;
+ break;
+
+ /* 8-byte entries, type B */
+
+ case ACPI_IVRS_TYPE_PAD8:
+ case ACPI_IVRS_TYPE_EXT_SELECT:
+ case ACPI_IVRS_TYPE_EXT_START:
+
+ InfoTable = AcpiDmTableInfoIvrs8b;
+ break;
+
+ /* 8-byte entries, type C */
+
+ case ACPI_IVRS_TYPE_SPECIAL:
+
+ InfoTable = AcpiDmTableInfoIvrs8c;
+ break;
+
+ default:
+
+ DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart,
+ "IVRS Device Entry");
+ return (AE_ERROR);
+ }
+
+ Status = DtCompileTable (PFieldList, InfoTable,
+ &Subtable, TRUE);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ DtInsertSubtable (ParentTable, Subtable);
+ }
+ }
+
+ DtPopSubtable ();
+ }
+
+ return (AE_OK);
+}
diff --git a/src/acpica/source/compiler/dttable2.c b/src/acpica/source/compiler/dttable2.c
new file mode 100644
index 0000000..0632ffe
--- /dev/null
+++ b/src/acpica/source/compiler/dttable2.c
@@ -0,0 +1,1758 @@
+/******************************************************************************
+ *
+ * Module Name: dttable2.c - handling for specific ACPI tables
+ *
+ *****************************************************************************/
+
+/******************************************************************************
+ *
+ * 1. Copyright Notice
+ *
+ * Some or all of this work - Copyright (c) 1999 - 2015, 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.
+ *
+ *****************************************************************************/
+
+/* Compile all complex data tables, signatures starting with L-Z */
+
+#include "aslcompiler.h"
+#include "dtcompiler.h"
+
+#define _COMPONENT DT_COMPILER
+ ACPI_MODULE_NAME ("dttable2")
+
+
+/******************************************************************************
+ *
+ * FUNCTION: DtCompileLpit
+ *
+ * PARAMETERS: List - Current field list pointer
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Compile LPIT.
+ *
+ *****************************************************************************/
+
+ACPI_STATUS
+DtCompileLpit (
+ void **List)
+{
+ ACPI_STATUS Status;
+ DT_SUBTABLE *Subtable;
+ DT_SUBTABLE *ParentTable;
+ DT_FIELD **PFieldList = (DT_FIELD **) List;
+ DT_FIELD *SubtableStart;
+ ACPI_DMTABLE_INFO *InfoTable;
+ ACPI_LPIT_HEADER *LpitHeader;
+
+
+ /* Note: Main table consists only of the standard ACPI table header */
+
+ while (*PFieldList)
+ {
+ SubtableStart = *PFieldList;
+
+ /* LPIT Subtable header */
+
+ Status = DtCompileTable (PFieldList, AcpiDmTableInfoLpitHdr,
+ &Subtable, TRUE);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ ParentTable = DtPeekSubtable ();
+ DtInsertSubtable (ParentTable, Subtable);
+ DtPushSubtable (Subtable);
+
+ LpitHeader = ACPI_CAST_PTR (ACPI_LPIT_HEADER, Subtable->Buffer);
+
+ switch (LpitHeader->Type)
+ {
+ case ACPI_LPIT_TYPE_NATIVE_CSTATE:
+
+ InfoTable = AcpiDmTableInfoLpit0;
+ break;
+
+ default:
+
+ DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "LPIT");
+ return (AE_ERROR);
+ }
+
+ /* LPIT Subtable */
+
+ Status = DtCompileTable (PFieldList, InfoTable, &Subtable, TRUE);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ ParentTable = DtPeekSubtable ();
+ DtInsertSubtable (ParentTable, Subtable);
+ DtPopSubtable ();
+ }
+
+ return (AE_OK);
+}
+
+
+/******************************************************************************
+ *
+ * FUNCTION: DtCompileMadt
+ *
+ * PARAMETERS: List - Current field list pointer
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Compile MADT.
+ *
+ *****************************************************************************/
+
+ACPI_STATUS
+DtCompileMadt (
+ void **List)
+{
+ ACPI_STATUS Status;
+ DT_SUBTABLE *Subtable;
+ DT_SUBTABLE *ParentTable;
+ DT_FIELD **PFieldList = (DT_FIELD **) List;
+ DT_FIELD *SubtableStart;
+ ACPI_SUBTABLE_HEADER *MadtHeader;
+ ACPI_DMTABLE_INFO *InfoTable;
+
+
+ Status = DtCompileTable (PFieldList, AcpiDmTableInfoMadt,
+ &Subtable, TRUE);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ ParentTable = DtPeekSubtable ();
+ DtInsertSubtable (ParentTable, Subtable);
+
+ while (*PFieldList)
+ {
+ SubtableStart = *PFieldList;
+ Status = DtCompileTable (PFieldList, AcpiDmTableInfoMadtHdr,
+ &Subtable, TRUE);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ ParentTable = DtPeekSubtable ();
+ DtInsertSubtable (ParentTable, Subtable);
+ DtPushSubtable (Subtable);
+
+ MadtHeader = ACPI_CAST_PTR (ACPI_SUBTABLE_HEADER, Subtable->Buffer);
+
+ switch (MadtHeader->Type)
+ {
+ case ACPI_MADT_TYPE_LOCAL_APIC:
+
+ InfoTable = AcpiDmTableInfoMadt0;
+ break;
+
+ case ACPI_MADT_TYPE_IO_APIC:
+
+ InfoTable = AcpiDmTableInfoMadt1;
+ break;
+
+ case ACPI_MADT_TYPE_INTERRUPT_OVERRIDE:
+
+ InfoTable = AcpiDmTableInfoMadt2;
+ break;
+
+ case ACPI_MADT_TYPE_NMI_SOURCE:
+
+ InfoTable = AcpiDmTableInfoMadt3;
+ break;
+
+ case ACPI_MADT_TYPE_LOCAL_APIC_NMI:
+
+ InfoTable = AcpiDmTableInfoMadt4;
+ break;
+
+ case ACPI_MADT_TYPE_LOCAL_APIC_OVERRIDE:
+
+ InfoTable = AcpiDmTableInfoMadt5;
+ break;
+
+ case ACPI_MADT_TYPE_IO_SAPIC:
+
+ InfoTable = AcpiDmTableInfoMadt6;
+ break;
+
+ case ACPI_MADT_TYPE_LOCAL_SAPIC:
+
+ InfoTable = AcpiDmTableInfoMadt7;
+ break;
+
+ case ACPI_MADT_TYPE_INTERRUPT_SOURCE:
+
+ InfoTable = AcpiDmTableInfoMadt8;
+ break;
+
+ case ACPI_MADT_TYPE_LOCAL_X2APIC:
+
+ InfoTable = AcpiDmTableInfoMadt9;
+ break;
+
+ case ACPI_MADT_TYPE_LOCAL_X2APIC_NMI:
+
+ InfoTable = AcpiDmTableInfoMadt10;
+ break;
+
+ case ACPI_MADT_TYPE_GENERIC_INTERRUPT:
+
+ InfoTable = AcpiDmTableInfoMadt11;
+ break;
+
+ case ACPI_MADT_TYPE_GENERIC_DISTRIBUTOR:
+
+ InfoTable = AcpiDmTableInfoMadt12;
+ break;
+
+ case ACPI_MADT_TYPE_GENERIC_MSI_FRAME:
+
+ InfoTable = AcpiDmTableInfoMadt13;
+ break;
+
+ case ACPI_MADT_TYPE_GENERIC_REDISTRIBUTOR:
+
+ InfoTable = AcpiDmTableInfoMadt14;
+ break;
+
+ case ACPI_MADT_TYPE_GENERIC_TRANSLATOR:
+
+ InfoTable = AcpiDmTableInfoMadt15;
+ break;
+
+ default:
+
+ DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "MADT");
+ return (AE_ERROR);
+ }
+
+ Status = DtCompileTable (PFieldList, InfoTable, &Subtable, TRUE);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ ParentTable = DtPeekSubtable ();
+ DtInsertSubtable (ParentTable, Subtable);
+ DtPopSubtable ();
+ }
+
+ return (AE_OK);
+}
+
+
+/******************************************************************************
+ *
+ * FUNCTION: DtCompileMcfg
+ *
+ * PARAMETERS: List - Current field list pointer
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Compile MCFG.
+ *
+ *****************************************************************************/
+
+ACPI_STATUS
+DtCompileMcfg (
+ void **List)
+{
+ ACPI_STATUS Status;
+
+
+ Status = DtCompileTwoSubtables (List,
+ AcpiDmTableInfoMcfg, AcpiDmTableInfoMcfg0);
+ return (Status);
+}
+
+
+/******************************************************************************
+ *
+ * FUNCTION: DtCompileMpst
+ *
+ * PARAMETERS: List - Current field list pointer
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Compile MPST.
+ *
+ *****************************************************************************/
+
+ACPI_STATUS
+DtCompileMpst (
+ void **List)
+{
+ ACPI_STATUS Status;
+ DT_SUBTABLE *Subtable;
+ DT_SUBTABLE *ParentTable;
+ DT_FIELD **PFieldList = (DT_FIELD **) List;
+ ACPI_MPST_CHANNEL *MpstChannelInfo;
+ ACPI_MPST_POWER_NODE *MpstPowerNode;
+ ACPI_MPST_DATA_HDR *MpstDataHeader;
+ UINT16 SubtableCount;
+ UINT32 PowerStateCount;
+ UINT32 ComponentCount;
+
+
+ /* Main table */
+
+ Status = DtCompileTable (PFieldList, AcpiDmTableInfoMpst, &Subtable, TRUE);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ ParentTable = DtPeekSubtable ();
+ DtInsertSubtable (ParentTable, Subtable);
+ DtPushSubtable (Subtable);
+
+ MpstChannelInfo = ACPI_CAST_PTR (ACPI_MPST_CHANNEL, Subtable->Buffer);
+ SubtableCount = MpstChannelInfo->PowerNodeCount;
+
+ while (*PFieldList && SubtableCount)
+ {
+ /* Subtable: Memory Power Node(s) */
+
+ Status = DtCompileTable (PFieldList, AcpiDmTableInfoMpst0,
+ &Subtable, TRUE);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ ParentTable = DtPeekSubtable ();
+ DtInsertSubtable (ParentTable, Subtable);
+ DtPushSubtable (Subtable);
+
+ MpstPowerNode = ACPI_CAST_PTR (ACPI_MPST_POWER_NODE, Subtable->Buffer);
+ PowerStateCount = MpstPowerNode->NumPowerStates;
+ ComponentCount = MpstPowerNode->NumPhysicalComponents;
+
+ ParentTable = DtPeekSubtable ();
+
+ /* Sub-subtables - Memory Power State Structure(s) */
+
+ while (*PFieldList && PowerStateCount)
+ {
+ Status = DtCompileTable (PFieldList, AcpiDmTableInfoMpst0A,
+ &Subtable, TRUE);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ DtInsertSubtable (ParentTable, Subtable);
+ PowerStateCount--;
+ }
+
+ /* Sub-subtables - Physical Component ID Structure(s) */
+
+ while (*PFieldList && ComponentCount)
+ {
+ Status = DtCompileTable (PFieldList, AcpiDmTableInfoMpst0B,
+ &Subtable, TRUE);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ DtInsertSubtable (ParentTable, Subtable);
+ ComponentCount--;
+ }
+
+ SubtableCount--;
+ DtPopSubtable ();
+ }
+
+ /* Subtable: Count of Memory Power State Characteristic structures */
+
+ DtPopSubtable ();
+
+ Status = DtCompileTable (PFieldList, AcpiDmTableInfoMpst1, &Subtable, TRUE);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ ParentTable = DtPeekSubtable ();
+ DtInsertSubtable (ParentTable, Subtable);
+ DtPushSubtable (Subtable);
+
+ MpstDataHeader = ACPI_CAST_PTR (ACPI_MPST_DATA_HDR, Subtable->Buffer);
+ SubtableCount = MpstDataHeader->CharacteristicsCount;
+
+ ParentTable = DtPeekSubtable ();
+
+ /* Subtable: Memory Power State Characteristics structure(s) */
+
+ while (*PFieldList && SubtableCount)
+ {
+ Status = DtCompileTable (PFieldList, AcpiDmTableInfoMpst2,
+ &Subtable, TRUE);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ DtInsertSubtable (ParentTable, Subtable);
+ SubtableCount--;
+ }
+
+ DtPopSubtable ();
+ return (AE_OK);
+}
+
+
+/******************************************************************************
+ *
+ * FUNCTION: DtCompileMsct
+ *
+ * PARAMETERS: List - Current field list pointer
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Compile MSCT.
+ *
+ *****************************************************************************/
+
+ACPI_STATUS
+DtCompileMsct (
+ void **List)
+{
+ ACPI_STATUS Status;
+
+
+ Status = DtCompileTwoSubtables (List,
+ AcpiDmTableInfoMsct, AcpiDmTableInfoMsct0);
+ return (Status);
+}
+
+
+/******************************************************************************
+ *
+ * FUNCTION: DtCompileMtmr
+ *
+ * PARAMETERS: List - Current field list pointer
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Compile MTMR.
+ *
+ *****************************************************************************/
+
+ACPI_STATUS
+DtCompileMtmr (
+ void **List)
+{
+ ACPI_STATUS Status;
+
+
+ Status = DtCompileTwoSubtables (List,
+ AcpiDmTableInfoMtmr, AcpiDmTableInfoMtmr0);
+ return (Status);
+}
+
+
+/******************************************************************************
+ *
+ * FUNCTION: DtCompileNfit
+ *
+ * PARAMETERS: List - Current field list pointer
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Compile NFIT.
+ *
+ *****************************************************************************/
+
+ACPI_STATUS
+DtCompileNfit (
+ void **List)
+{
+ ACPI_STATUS Status;
+ DT_SUBTABLE *Subtable;
+ DT_SUBTABLE *ParentTable;
+ DT_FIELD **PFieldList = (DT_FIELD **) List;
+ DT_FIELD *SubtableStart;
+ ACPI_NFIT_HEADER *NfitHeader;
+ ACPI_DMTABLE_INFO *InfoTable;
+ UINT32 Count;
+ ACPI_NFIT_INTERLEAVE *Interleave = NULL;
+ ACPI_NFIT_FLUSH_ADDRESS *Hint = NULL;
+
+
+ /* Main table */
+
+ Status = DtCompileTable (PFieldList, AcpiDmTableInfoNfit,
+ &Subtable, TRUE);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ ParentTable = DtPeekSubtable ();
+ DtInsertSubtable (ParentTable, Subtable);
+ DtPushSubtable (Subtable);
+
+ /* Subtables */
+
+ while (*PFieldList)
+ {
+ SubtableStart = *PFieldList;
+ Status = DtCompileTable (PFieldList, AcpiDmTableInfoNfitHdr,
+ &Subtable, TRUE);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ ParentTable = DtPeekSubtable ();
+ DtInsertSubtable (ParentTable, Subtable);
+ DtPushSubtable (Subtable);
+
+ NfitHeader = ACPI_CAST_PTR (ACPI_NFIT_HEADER, Subtable->Buffer);
+
+ switch (NfitHeader->Type)
+ {
+ case ACPI_NFIT_TYPE_SYSTEM_ADDRESS:
+
+ InfoTable = AcpiDmTableInfoNfit0;
+ break;
+
+ case ACPI_NFIT_TYPE_MEMORY_MAP:
+
+ InfoTable = AcpiDmTableInfoNfit1;
+ break;
+
+ case ACPI_NFIT_TYPE_INTERLEAVE:
+
+ Interleave = ACPI_CAST_PTR (ACPI_NFIT_INTERLEAVE, Subtable->Buffer);
+ InfoTable = AcpiDmTableInfoNfit2;
+ break;
+
+ case ACPI_NFIT_TYPE_SMBIOS:
+
+ InfoTable = AcpiDmTableInfoNfit3;
+ break;
+
+ case ACPI_NFIT_TYPE_CONTROL_REGION:
+
+ InfoTable = AcpiDmTableInfoNfit4;
+ break;
+
+ case ACPI_NFIT_TYPE_DATA_REGION:
+
+ InfoTable = AcpiDmTableInfoNfit5;
+ break;
+
+ case ACPI_NFIT_TYPE_FLUSH_ADDRESS:
+
+ Hint = ACPI_CAST_PTR (ACPI_NFIT_FLUSH_ADDRESS, Subtable->Buffer);
+ InfoTable = AcpiDmTableInfoNfit6;
+ break;
+
+ default:
+
+ DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "NFIT");
+ return (AE_ERROR);
+ }
+
+ Status = DtCompileTable (PFieldList, InfoTable, &Subtable, TRUE);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ ParentTable = DtPeekSubtable ();
+ DtInsertSubtable (ParentTable, Subtable);
+ DtPopSubtable ();
+
+ switch (NfitHeader->Type)
+ {
+ case ACPI_NFIT_TYPE_INTERLEAVE:
+
+ Count = 0;
+ DtPushSubtable (Subtable);
+ while (*PFieldList)
+ {
+ Status = DtCompileTable (PFieldList, AcpiDmTableInfoNfit2a,
+ &Subtable, FALSE);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ if (!Subtable)
+ {
+ DtPopSubtable ();
+ break;
+ }
+
+ ParentTable = DtPeekSubtable ();
+ DtInsertSubtable (ParentTable, Subtable);
+ Count++;
+ }
+
+ Interleave->LineCount = Count;
+ DtPopSubtable ();
+ break;
+
+ case ACPI_NFIT_TYPE_SMBIOS:
+
+ if (*PFieldList)
+ {
+ Status = DtCompileTable (PFieldList, AcpiDmTableInfoNfit3a,
+ &Subtable, TRUE);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ if (Subtable)
+ {
+ DtInsertSubtable (ParentTable, Subtable);
+ }
+ }
+ break;
+
+ case ACPI_NFIT_TYPE_FLUSH_ADDRESS:
+
+ Count = 0;
+ DtPushSubtable (Subtable);
+ while (*PFieldList)
+ {
+ Status = DtCompileTable (PFieldList, AcpiDmTableInfoNfit6a,
+ &Subtable, FALSE);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ if (!Subtable)
+ {
+ DtPopSubtable ();
+ break;
+ }
+
+ ParentTable = DtPeekSubtable ();
+ DtInsertSubtable (ParentTable, Subtable);
+ Count++;
+ }
+
+ Hint->HintCount = (UINT16) Count;
+ DtPopSubtable ();
+ break;
+
+ default:
+ break;
+ }
+ }
+
+ return (AE_OK);
+}
+
+
+/******************************************************************************
+ *
+ * FUNCTION: DtCompilePcct
+ *
+ * PARAMETERS: List - Current field list pointer
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Compile PCCT.
+ *
+ *****************************************************************************/
+
+ACPI_STATUS
+DtCompilePcct (
+ void **List)
+{
+ ACPI_STATUS Status;
+ DT_SUBTABLE *Subtable;
+ DT_SUBTABLE *ParentTable;
+ DT_FIELD **PFieldList = (DT_FIELD **) List;
+ DT_FIELD *SubtableStart;
+ ACPI_SUBTABLE_HEADER *PcctHeader;
+ ACPI_DMTABLE_INFO *InfoTable;
+
+
+ /* Main table */
+
+ Status = DtCompileTable (PFieldList, AcpiDmTableInfoPcct,
+ &Subtable, TRUE);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ ParentTable = DtPeekSubtable ();
+ DtInsertSubtable (ParentTable, Subtable);
+
+ /* Subtables */
+
+ while (*PFieldList)
+ {
+ SubtableStart = *PFieldList;
+ Status = DtCompileTable (PFieldList, AcpiDmTableInfoPcctHdr,
+ &Subtable, TRUE);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ ParentTable = DtPeekSubtable ();
+ DtInsertSubtable (ParentTable, Subtable);
+ DtPushSubtable (Subtable);
+
+ PcctHeader = ACPI_CAST_PTR (ACPI_SUBTABLE_HEADER, Subtable->Buffer);
+
+ switch (PcctHeader->Type)
+ {
+ case ACPI_PCCT_TYPE_GENERIC_SUBSPACE:
+
+ InfoTable = AcpiDmTableInfoPcct0;
+ break;
+
+ case ACPI_PCCT_TYPE_HW_REDUCED_SUBSPACE:
+
+ InfoTable = AcpiDmTableInfoPcct1;
+ break;
+
+ default:
+
+ DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "PCCT");
+ return (AE_ERROR);
+ }
+
+ Status = DtCompileTable (PFieldList, InfoTable, &Subtable, TRUE);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ ParentTable = DtPeekSubtable ();
+ DtInsertSubtable (ParentTable, Subtable);
+ DtPopSubtable ();
+ }
+
+ return (AE_OK);
+}
+
+
+/******************************************************************************
+ *
+ * FUNCTION: DtCompilePmtt
+ *
+ * PARAMETERS: List - Current field list pointer
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Compile PMTT.
+ *
+ *****************************************************************************/
+
+ACPI_STATUS
+DtCompilePmtt (
+ void **List)
+{
+ ACPI_STATUS Status;
+ DT_SUBTABLE *Subtable;
+ DT_SUBTABLE *ParentTable;
+ DT_FIELD **PFieldList = (DT_FIELD **) List;
+ DT_FIELD *SubtableStart;
+ ACPI_PMTT_HEADER *PmttHeader;
+ ACPI_PMTT_CONTROLLER *PmttController;
+ UINT16 DomainCount;
+ UINT8 PrevType = ACPI_PMTT_TYPE_SOCKET;
+
+
+ /* Main table */
+
+ Status = DtCompileTable (PFieldList, AcpiDmTableInfoPmtt, &Subtable, TRUE);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ ParentTable = DtPeekSubtable ();
+ DtInsertSubtable (ParentTable, Subtable);
+ DtPushSubtable (Subtable);
+
+ while (*PFieldList)
+ {
+ SubtableStart = *PFieldList;
+ Status = DtCompileTable (PFieldList, AcpiDmTableInfoPmttHdr,
+ &Subtable, TRUE);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ PmttHeader = ACPI_CAST_PTR (ACPI_PMTT_HEADER, Subtable->Buffer);
+ while (PrevType >= PmttHeader->Type)
+ {
+ DtPopSubtable ();
+
+ if (PrevType == ACPI_PMTT_TYPE_SOCKET)
+ {
+ break;
+ }
+
+ PrevType--;
+ }
+
+ PrevType = PmttHeader->Type;
+
+ ParentTable = DtPeekSubtable ();
+ DtInsertSubtable (ParentTable, Subtable);
+ DtPushSubtable (Subtable);
+
+ switch (PmttHeader->Type)
+ {
+ case ACPI_PMTT_TYPE_SOCKET:
+
+ /* Subtable: Socket Structure */
+
+ Status = DtCompileTable (PFieldList, AcpiDmTableInfoPmtt0,
+ &Subtable, TRUE);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ ParentTable = DtPeekSubtable ();
+ DtInsertSubtable (ParentTable, Subtable);
+ break;
+
+ case ACPI_PMTT_TYPE_CONTROLLER:
+
+ /* Subtable: Memory Controller Structure */
+
+ Status = DtCompileTable (PFieldList, AcpiDmTableInfoPmtt1,
+ &Subtable, TRUE);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ ParentTable = DtPeekSubtable ();
+ DtInsertSubtable (ParentTable, Subtable);
+
+ PmttController = ACPI_CAST_PTR (ACPI_PMTT_CONTROLLER,
+ (Subtable->Buffer - sizeof (ACPI_PMTT_HEADER)));
+ DomainCount = PmttController->DomainCount;
+
+ while (DomainCount)
+ {
+ Status = DtCompileTable (PFieldList, AcpiDmTableInfoPmtt1a,
+ &Subtable, TRUE);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ DtInsertSubtable (ParentTable, Subtable);
+ DomainCount--;
+ }
+ break;
+
+ case ACPI_PMTT_TYPE_DIMM:
+
+ /* Subtable: Physical Component Structure */
+
+ Status = DtCompileTable (PFieldList, AcpiDmTableInfoPmtt2,
+ &Subtable, TRUE);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ ParentTable = DtPeekSubtable ();
+ DtInsertSubtable (ParentTable, Subtable);
+ break;
+
+ default:
+
+ DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "PMTT");
+ return (AE_ERROR);
+ }
+ }
+
+ return (Status);
+}
+
+
+/******************************************************************************
+ *
+ * FUNCTION: DtCompileRsdt
+ *
+ * PARAMETERS: List - Current field list pointer
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Compile RSDT.
+ *
+ *****************************************************************************/
+
+ACPI_STATUS
+DtCompileRsdt (
+ void **List)
+{
+ DT_SUBTABLE *Subtable;
+ DT_SUBTABLE *ParentTable;
+ DT_FIELD *FieldList = *(DT_FIELD **) List;
+ UINT32 Address;
+
+
+ ParentTable = DtPeekSubtable ();
+
+ while (FieldList)
+ {
+ DtCompileInteger ((UINT8 *) &Address, FieldList, 4, DT_NON_ZERO);
+
+ DtCreateSubtable ((UINT8 *) &Address, 4, &Subtable);
+ DtInsertSubtable (ParentTable, Subtable);
+ FieldList = FieldList->Next;
+ }
+
+ return (AE_OK);
+}
+
+
+/******************************************************************************
+ *
+ * FUNCTION: DtCompileS3pt
+ *
+ * PARAMETERS: PFieldList - Current field list pointer
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Compile S3PT (Pointed to by FPDT)
+ *
+ *****************************************************************************/
+
+ACPI_STATUS
+DtCompileS3pt (
+ DT_FIELD **PFieldList)
+{
+ ACPI_STATUS Status;
+ ACPI_S3PT_HEADER *S3ptHeader;
+ DT_SUBTABLE *Subtable;
+ DT_SUBTABLE *ParentTable;
+ ACPI_DMTABLE_INFO *InfoTable;
+ DT_FIELD *SubtableStart;
+
+
+ Status = DtCompileTable (PFieldList, AcpiDmTableInfoS3pt,
+ &Gbl_RootTable, TRUE);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ DtPushSubtable (Gbl_RootTable);
+
+ while (*PFieldList)
+ {
+ SubtableStart = *PFieldList;
+ Status = DtCompileTable (PFieldList, AcpiDmTableInfoS3ptHdr,
+ &Subtable, TRUE);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ ParentTable = DtPeekSubtable ();
+ DtInsertSubtable (ParentTable, Subtable);
+ DtPushSubtable (Subtable);
+
+ S3ptHeader = ACPI_CAST_PTR (ACPI_S3PT_HEADER, Subtable->Buffer);
+
+ switch (S3ptHeader->Type)
+ {
+ case ACPI_S3PT_TYPE_RESUME:
+
+ InfoTable = AcpiDmTableInfoS3pt0;
+ break;
+
+ case ACPI_S3PT_TYPE_SUSPEND:
+
+ InfoTable = AcpiDmTableInfoS3pt1;
+ break;
+
+ default:
+
+ DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "S3PT");
+ return (AE_ERROR);
+ }
+
+ Status = DtCompileTable (PFieldList, InfoTable, &Subtable, TRUE);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ ParentTable = DtPeekSubtable ();
+ DtInsertSubtable (ParentTable, Subtable);
+ DtPopSubtable ();
+ }
+
+ return (AE_OK);
+}
+
+
+/******************************************************************************
+ *
+ * FUNCTION: DtCompileSlic
+ *
+ * PARAMETERS: List - Current field list pointer
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Compile SLIC.
+ *
+ *****************************************************************************/
+
+ACPI_STATUS
+DtCompileSlic (
+ void **List)
+{
+ ACPI_STATUS Status;
+ DT_SUBTABLE *Subtable;
+ DT_SUBTABLE *ParentTable;
+ DT_FIELD **PFieldList = (DT_FIELD **) List;
+
+
+ while (*PFieldList)
+ {
+ Status = DtCompileTable (PFieldList, AcpiDmTableInfoSlic,
+ &Subtable, TRUE);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ ParentTable = DtPeekSubtable ();
+ DtInsertSubtable (ParentTable, Subtable);
+ DtPushSubtable (Subtable);
+ DtPopSubtable ();
+ }
+
+ return (AE_OK);
+}
+
+
+/******************************************************************************
+ *
+ * FUNCTION: DtCompileSlit
+ *
+ * PARAMETERS: List - Current field list pointer
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Compile SLIT.
+ *
+ *****************************************************************************/
+
+ACPI_STATUS
+DtCompileSlit (
+ void **List)
+{
+ ACPI_STATUS Status;
+ DT_SUBTABLE *Subtable;
+ DT_SUBTABLE *ParentTable;
+ DT_FIELD **PFieldList = (DT_FIELD **) List;
+ DT_FIELD *FieldList;
+ UINT32 Localities;
+ UINT8 *LocalityBuffer;
+
+
+ Status = DtCompileTable (PFieldList, AcpiDmTableInfoSlit,
+ &Subtable, TRUE);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ ParentTable = DtPeekSubtable ();
+ DtInsertSubtable (ParentTable, Subtable);
+
+ Localities = *ACPI_CAST_PTR (UINT32, Subtable->Buffer);
+ LocalityBuffer = UtLocalCalloc (Localities);
+
+ /* Compile each locality buffer */
+
+ FieldList = *PFieldList;
+ while (FieldList)
+ {
+ DtCompileBuffer (LocalityBuffer,
+ FieldList->Value, FieldList, Localities);
+
+ DtCreateSubtable (LocalityBuffer, Localities, &Subtable);
+ DtInsertSubtable (ParentTable, Subtable);
+ FieldList = FieldList->Next;
+ }
+
+ ACPI_FREE (LocalityBuffer);
+ return (AE_OK);
+}
+
+
+/******************************************************************************
+ *
+ * FUNCTION: DtCompileSrat
+ *
+ * PARAMETERS: List - Current field list pointer
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Compile SRAT.
+ *
+ *****************************************************************************/
+
+ACPI_STATUS
+DtCompileSrat (
+ void **List)
+{
+ ACPI_STATUS Status;
+ DT_SUBTABLE *Subtable;
+ DT_SUBTABLE *ParentTable;
+ DT_FIELD **PFieldList = (DT_FIELD **) List;
+ DT_FIELD *SubtableStart;
+ ACPI_SUBTABLE_HEADER *SratHeader;
+ ACPI_DMTABLE_INFO *InfoTable;
+
+
+ Status = DtCompileTable (PFieldList, AcpiDmTableInfoSrat,
+ &Subtable, TRUE);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ ParentTable = DtPeekSubtable ();
+ DtInsertSubtable (ParentTable, Subtable);
+
+ while (*PFieldList)
+ {
+ SubtableStart = *PFieldList;
+ Status = DtCompileTable (PFieldList, AcpiDmTableInfoSratHdr,
+ &Subtable, TRUE);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ ParentTable = DtPeekSubtable ();
+ DtInsertSubtable (ParentTable, Subtable);
+ DtPushSubtable (Subtable);
+
+ SratHeader = ACPI_CAST_PTR (ACPI_SUBTABLE_HEADER, Subtable->Buffer);
+
+ switch (SratHeader->Type)
+ {
+ case ACPI_SRAT_TYPE_CPU_AFFINITY:
+
+ InfoTable = AcpiDmTableInfoSrat0;
+ break;
+
+ case ACPI_SRAT_TYPE_MEMORY_AFFINITY:
+
+ InfoTable = AcpiDmTableInfoSrat1;
+ break;
+
+ case ACPI_SRAT_TYPE_X2APIC_CPU_AFFINITY:
+
+ InfoTable = AcpiDmTableInfoSrat2;
+ break;
+
+ case ACPI_SRAT_TYPE_GICC_AFFINITY:
+
+ InfoTable = AcpiDmTableInfoSrat3;
+ break;
+
+ default:
+
+ DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "SRAT");
+ return (AE_ERROR);
+ }
+
+ Status = DtCompileTable (PFieldList, InfoTable, &Subtable, TRUE);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ ParentTable = DtPeekSubtable ();
+ DtInsertSubtable (ParentTable, Subtable);
+ DtPopSubtable ();
+ }
+
+ return (AE_OK);
+}
+
+
+/******************************************************************************
+ *
+ * FUNCTION: DtCompileStao
+ *
+ * PARAMETERS: PFieldList - Current field list pointer
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Compile STAO.
+ *
+ *****************************************************************************/
+
+ACPI_STATUS
+DtCompileStao (
+ void **List)
+{
+ DT_FIELD **PFieldList = (DT_FIELD **) List;
+ DT_SUBTABLE *Subtable;
+ DT_SUBTABLE *ParentTable;
+ ACPI_STATUS Status;
+
+
+ /* Compile the main table */
+
+ Status = DtCompileTable (PFieldList, AcpiDmTableInfoStao,
+ &Subtable, TRUE);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ ParentTable = DtPeekSubtable ();
+ DtInsertSubtable (ParentTable, Subtable);
+
+ /* Compile each ASCII namestring as a subtable */
+
+ while (*PFieldList)
+ {
+ Status = DtCompileTable (PFieldList, AcpiDmTableInfoStaoStr,
+ &Subtable, TRUE);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ ParentTable = DtPeekSubtable ();
+ DtInsertSubtable (ParentTable, Subtable);
+ }
+
+ return (AE_OK);
+}
+
+
+/******************************************************************************
+ *
+ * FUNCTION: DtCompileTcpa
+ *
+ * PARAMETERS: PFieldList - Current field list pointer
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Compile TCPA.
+ *
+ *****************************************************************************/
+
+ACPI_STATUS
+DtCompileTcpa (
+ void **List)
+{
+ DT_FIELD **PFieldList = (DT_FIELD **) List;
+ DT_SUBTABLE *Subtable;
+ ACPI_TABLE_TCPA_HDR *TcpaHeader;
+ DT_SUBTABLE *ParentTable;
+ ACPI_STATUS Status;
+
+
+ /* Compile the main table */
+
+ Status = DtCompileTable (PFieldList, AcpiDmTableInfoTcpaHdr,
+ &Subtable, TRUE);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ ParentTable = DtPeekSubtable ();
+ DtInsertSubtable (ParentTable, Subtable);
+
+ /*
+ * Examine the PlatformClass field to determine the table type.
+ * Either a client or server table. Only one.
+ */
+ TcpaHeader = ACPI_CAST_PTR (ACPI_TABLE_TCPA_HDR, ParentTable->Buffer);
+
+ switch (TcpaHeader->PlatformClass)
+ {
+ case ACPI_TCPA_CLIENT_TABLE:
+
+ Status = DtCompileTable (PFieldList, AcpiDmTableInfoTcpaClient,
+ &Subtable, TRUE);
+ break;
+
+ case ACPI_TCPA_SERVER_TABLE:
+
+ Status = DtCompileTable (PFieldList, AcpiDmTableInfoTcpaServer,
+ &Subtable, TRUE);
+ break;
+
+ default:
+
+ AcpiOsPrintf ("\n**** Unknown TCPA Platform Class 0x%X\n",
+ TcpaHeader->PlatformClass);
+ Status = AE_ERROR;
+ break;
+ }
+
+ ParentTable = DtPeekSubtable ();
+ DtInsertSubtable (ParentTable, Subtable);
+ return (Status);
+}
+
+
+/******************************************************************************
+ *
+ * FUNCTION: DtGetGenericTableInfo
+ *
+ * PARAMETERS: Name - Generic type name
+ *
+ * RETURN: Info entry
+ *
+ * DESCRIPTION: Obtain table info for a generic name entry
+ *
+ *****************************************************************************/
+
+ACPI_DMTABLE_INFO *
+DtGetGenericTableInfo (
+ char *Name)
+{
+ ACPI_DMTABLE_INFO *Info;
+ UINT32 i;
+
+
+ if (!Name)
+ {
+ return (NULL);
+ }
+
+ /* Search info table for name match */
+
+ for (i = 0; ; i++)
+ {
+ Info = AcpiDmTableInfoGeneric[i];
+ if (Info->Opcode == ACPI_DMT_EXIT)
+ {
+ Info = NULL;
+ break;
+ }
+
+ /* Use caseless compare for generic keywords */
+
+ if (!AcpiUtStricmp (Name, Info->Name))
+ {
+ break;
+ }
+ }
+
+ return (Info);
+}
+
+
+/******************************************************************************
+ *
+ * FUNCTION: DtCompileUefi
+ *
+ * PARAMETERS: List - Current field list pointer
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Compile UEFI.
+ *
+ *****************************************************************************/
+
+ACPI_STATUS
+DtCompileUefi (
+ void **List)
+{
+ ACPI_STATUS Status;
+ DT_SUBTABLE *Subtable;
+ DT_SUBTABLE *ParentTable;
+ DT_FIELD **PFieldList = (DT_FIELD **) List;
+ UINT16 *DataOffset;
+
+
+ /* Compile the predefined portion of the UEFI table */
+
+ Status = DtCompileTable (PFieldList, AcpiDmTableInfoUefi,
+ &Subtable, TRUE);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ DataOffset = (UINT16 *) (Subtable->Buffer + 16);
+ *DataOffset = sizeof (ACPI_TABLE_UEFI);
+
+ ParentTable = DtPeekSubtable ();
+ DtInsertSubtable (ParentTable, Subtable);
+
+ /*
+ * Compile the "generic" portion of the UEFI table. This
+ * part of the table is not predefined and any of the generic
+ * operators may be used.
+ */
+ DtCompileGeneric ((void **) PFieldList, NULL, NULL);
+ return (AE_OK);
+}
+
+
+/******************************************************************************
+ *
+ * FUNCTION: DtCompileVrtc
+ *
+ * PARAMETERS: List - Current field list pointer
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Compile VRTC.
+ *
+ *****************************************************************************/
+
+ACPI_STATUS
+DtCompileVrtc (
+ void **List)
+{
+ ACPI_STATUS Status;
+
+
+ Status = DtCompileTwoSubtables (List,
+ AcpiDmTableInfoVrtc, AcpiDmTableInfoVrtc0);
+ return (Status);
+}
+
+
+/******************************************************************************
+ *
+ * FUNCTION: DtCompileWdat
+ *
+ * PARAMETERS: List - Current field list pointer
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Compile WDAT.
+ *
+ *****************************************************************************/
+
+ACPI_STATUS
+DtCompileWdat (
+ void **List)
+{
+ ACPI_STATUS Status;
+
+
+ Status = DtCompileTwoSubtables (List,
+ AcpiDmTableInfoWdat, AcpiDmTableInfoWdat0);
+ return (Status);
+}
+
+
+/******************************************************************************
+ *
+ * FUNCTION: DtCompileWpbt
+ *
+ * PARAMETERS: List - Current field list pointer
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Compile WPBT.
+ *
+ *****************************************************************************/
+
+ACPI_STATUS
+DtCompileWpbt (
+ void **List)
+{
+ DT_FIELD **PFieldList = (DT_FIELD **) List;
+ DT_SUBTABLE *Subtable;
+ DT_SUBTABLE *ParentTable;
+ ACPI_TABLE_WPBT *Table;
+ ACPI_STATUS Status;
+ UINT16 Length;
+
+
+ /* Compile the main table */
+
+ Status = DtCompileTable (PFieldList, AcpiDmTableInfoWpbt,
+ &Subtable, TRUE);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ ParentTable = DtPeekSubtable ();
+ DtInsertSubtable (ParentTable, Subtable);
+
+ /* Compile the argument list subtable */
+
+ Status = DtCompileTable (PFieldList, AcpiDmTableInfoWpbt0,
+ &Subtable, TRUE);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ /* Extract the length of the Arguments buffer, insert into main table */
+
+ Length = (UINT16) Subtable->TotalLength;
+ Table = ACPI_CAST_PTR (ACPI_TABLE_WPBT, ParentTable->Buffer);
+ Table->ArgumentsLength = Length;
+
+ ParentTable = DtPeekSubtable ();
+ DtInsertSubtable (ParentTable, Subtable);
+ return (AE_OK);
+}
+
+
+/******************************************************************************
+ *
+ * FUNCTION: DtCompileXsdt
+ *
+ * PARAMETERS: List - Current field list pointer
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Compile XSDT.
+ *
+ *****************************************************************************/
+
+ACPI_STATUS
+DtCompileXsdt (
+ void **List)
+{
+ DT_SUBTABLE *Subtable;
+ DT_SUBTABLE *ParentTable;
+ DT_FIELD *FieldList = *(DT_FIELD **) List;
+ UINT64 Address;
+
+
+ ParentTable = DtPeekSubtable ();
+
+ while (FieldList)
+ {
+ DtCompileInteger ((UINT8 *) &Address, FieldList, 8, DT_NON_ZERO);
+
+ DtCreateSubtable ((UINT8 *) &Address, 8, &Subtable);
+ DtInsertSubtable (ParentTable, Subtable);
+ FieldList = FieldList->Next;
+ }
+
+ return (AE_OK);
+}
+
+
+/******************************************************************************
+ *
+ * FUNCTION: DtCompileGeneric
+ *
+ * PARAMETERS: List - Current field list pointer
+ * Name - Field name to end generic compiling
+ * Length - Compiled table length to return
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Compile generic unknown table.
+ *
+ *****************************************************************************/
+
+ACPI_STATUS
+DtCompileGeneric (
+ void **List,
+ char *Name,
+ UINT32 *Length)
+{
+ ACPI_STATUS Status;
+ DT_SUBTABLE *Subtable;
+ DT_SUBTABLE *ParentTable;
+ DT_FIELD **PFieldList = (DT_FIELD **) List;
+ ACPI_DMTABLE_INFO *Info;
+
+
+ ParentTable = DtPeekSubtable ();
+
+ /*
+ * Compile the "generic" portion of the table. This
+ * part of the table is not predefined and any of the generic
+ * operators may be used.
+ */
+
+ /* Find any and all labels in the entire generic portion */
+
+ DtDetectAllLabels (*PFieldList);
+
+ /* Now we can actually compile the parse tree */
+
+ if (Length && *Length)
+ {
+ *Length = 0;
+ }
+ while (*PFieldList)
+ {
+ if (Name && !strcmp ((*PFieldList)->Name, Name))
+ {
+ break;
+ }
+
+ Info = DtGetGenericTableInfo ((*PFieldList)->Name);
+ if (!Info)
+ {
+ sprintf (MsgBuffer, "Generic data type \"%s\" not found",
+ (*PFieldList)->Name);
+ DtNameError (ASL_ERROR, ASL_MSG_INVALID_FIELD_NAME,
+ (*PFieldList), MsgBuffer);
+
+ *PFieldList = (*PFieldList)->Next;
+ continue;
+ }
+
+ Status = DtCompileTable (PFieldList, Info,
+ &Subtable, TRUE);
+ if (ACPI_SUCCESS (Status))
+ {
+ DtInsertSubtable (ParentTable, Subtable);
+ if (Length)
+ {
+ *Length += Subtable->Length;
+ }
+ }
+ else
+ {
+ *PFieldList = (*PFieldList)->Next;
+
+ if (Status == AE_NOT_FOUND)
+ {
+ sprintf (MsgBuffer, "Generic data type \"%s\" not found",
+ (*PFieldList)->Name);
+ DtNameError (ASL_ERROR, ASL_MSG_INVALID_FIELD_NAME,
+ (*PFieldList), MsgBuffer);
+ }
+ }
+ }
+
+ return (AE_OK);
+}
diff --git a/src/acpica/source/compiler/dttemplate.c b/src/acpica/source/compiler/dttemplate.c
index 8c2f8b2..6e4c9f9 100644
--- a/src/acpica/source/compiler/dttemplate.c
+++ b/src/acpica/source/compiler/dttemplate.c
@@ -261,7 +261,6 @@ GetTemplate:
Status = DtCreateOneTemplate (Signature, TableData);
-
/* Shutdown ACPICA subsystem */
(void) AcpiTerminate ();
@@ -307,7 +306,7 @@ DtCreateAllTemplates (
if (TableData->Template)
{
Status = DtCreateOneTemplate (TableData->Signature,
- TableData);
+ TableData);
if (ACPI_FAILURE (Status))
{
return (Status);
diff --git a/src/acpica/source/compiler/prexpress.c b/src/acpica/source/compiler/prexpress.c
index 513a443..b54b7e0 100644
--- a/src/acpica/source/compiler/prexpress.c
+++ b/src/acpica/source/compiler/prexpress.c
@@ -156,6 +156,7 @@ PrUnTokenize (
{
return;
}
+
if (Buffer[Length] != '\n')
{
Buffer[strlen(Buffer)] = ' ';
diff --git a/src/acpica/source/compiler/prmacros.c b/src/acpica/source/compiler/prmacros.c
index 798e29b..1770803 100644
--- a/src/acpica/source/compiler/prmacros.c
+++ b/src/acpica/source/compiler/prmacros.c
@@ -459,7 +459,8 @@ PrAddMacro (
{
UseCount = Args[i].UseCount;
- Args[i].Offset[UseCount] = (Token - Gbl_MainTokenBuffer) - MacroBodyOffset;
+ Args[i].Offset[UseCount] =
+ (Token - Gbl_MainTokenBuffer) - MacroBodyOffset;
DbgPrint (ASL_DEBUG_OUTPUT, PR_PREFIX_ID
"Macro Arg #%u: %s UseCount %u Offset %u \n",
diff --git a/src/acpica/source/compiler/prscan.c b/src/acpica/source/compiler/prscan.c
index bc88f76..ceffadc 100644
--- a/src/acpica/source/compiler/prscan.c
+++ b/src/acpica/source/compiler/prscan.c
@@ -571,7 +571,8 @@ PrDoDirective (
case PR_DIRECTIVE_ELSE:
case PR_DIRECTIVE_ELIF:
- if (Gbl_DirectiveStack && Gbl_DirectiveStack->IgnoringThisCodeBlock)
+ if (Gbl_DirectiveStack &&
+ Gbl_DirectiveStack->IgnoringThisCodeBlock)
{
PrDbgPrint ("Ignoring", Gbl_DirectiveInfo[Directive].Name);
return;
@@ -746,7 +747,8 @@ PrDoDirective (
if (*(&Gbl_CurrentLineBuffer[TokenOffset]) == '(')
{
#ifndef MACROS_SUPPORTED
- AcpiOsPrintf ("%s ERROR - line %u: #define macros are not supported yet\n",
+ AcpiOsPrintf (
+ "%s ERROR - line %u: #define macros are not supported yet\n",
Gbl_CurrentLineBuffer, Gbl_LogicalLineNumber);
exit(1);
#else
@@ -764,11 +766,13 @@ PrDoDirective (
{
Token2++;
}
+
End = Token2;
while (*End != '\n')
{
End++;
}
+
*End = 0;
}
else
@@ -1071,6 +1075,7 @@ PrGetNextLine (
{
return (ASL_BLANK_LINE);
}
+
return (AE_OK);
}
}
diff --git a/src/acpica/source/compiler/prutils.c b/src/acpica/source/compiler/prutils.c
index b367650..fc6bece 100644
--- a/src/acpica/source/compiler/prutils.c
+++ b/src/acpica/source/compiler/prutils.c
@@ -194,8 +194,10 @@ PrGetNextToken (
{
*Next = NULL;
}
+
return (TokenStart);
}
+
Buffer++;
}
diff --git a/src/acpica/source/components/debugger/dbcmds.c b/src/acpica/source/components/debugger/dbcmds.c
index 17e1265..280e135 100644
--- a/src/acpica/source/components/debugger/dbcmds.c
+++ b/src/acpica/source/components/debugger/dbcmds.c
@@ -189,8 +189,7 @@ AcpiDbConvertToNode (
Node = ACPI_TO_POINTER (Address);
if (!AcpiOsReadable (Node, sizeof (ACPI_NAMESPACE_NODE)))
{
- AcpiOsPrintf ("Address %p is invalid",
- Node);
+ AcpiOsPrintf ("Address %p is invalid", Node);
return (NULL);
}
@@ -199,7 +198,7 @@ AcpiDbConvertToNode (
if (ACPI_GET_DESCRIPTOR_TYPE (Node) != ACPI_DESC_TYPE_NAMED)
{
AcpiOsPrintf ("Address %p is not a valid namespace node [%s]\n",
- Node, AcpiUtGetDescriptorName (Node));
+ Node, AcpiUtGetDescriptorName (Node));
return (NULL);
}
}
@@ -986,7 +985,7 @@ AcpiDbDeviceResources (
Node = ACPI_CAST_PTR (ACPI_NAMESPACE_NODE, ObjHandle);
- ParentPath = AcpiNsGetExternalPathname (Node);
+ ParentPath = AcpiNsGetNormalizedPathname (Node, TRUE);
if (!ParentPath)
{
return (AE_NO_MEMORY);
@@ -1077,7 +1076,7 @@ GetCrs:
/* Get the _CRS resource list (test ALLOCATE buffer) */
ReturnBuffer.Pointer = NULL;
- ReturnBuffer.Length = ACPI_ALLOCATE_LOCAL_BUFFER;
+ ReturnBuffer.Length = ACPI_ALLOCATE_LOCAL_BUFFER;
Status = AcpiGetCurrentResources (Node, &ReturnBuffer);
if (ACPI_FAILURE (Status))
@@ -1146,7 +1145,7 @@ GetPrs:
}
ReturnBuffer.Pointer = AcpiGbl_DbBuffer;
- ReturnBuffer.Length = ACPI_DEBUG_BUFFER_SIZE;
+ ReturnBuffer.Length = ACPI_DEBUG_BUFFER_SIZE;
Status = AcpiGetPossibleResources (Node, &ReturnBuffer);
if (ACPI_FAILURE (Status))
@@ -1169,7 +1168,7 @@ GetAei:
AcpiOsPrintf ("Evaluating _AEI\n");
ReturnBuffer.Pointer = AcpiGbl_DbBuffer;
- ReturnBuffer.Length = ACPI_DEBUG_BUFFER_SIZE;
+ ReturnBuffer.Length = ACPI_DEBUG_BUFFER_SIZE;
Status = AcpiEvaluateObject (AeiNode, NULL, NULL, &ReturnBuffer);
if (ACPI_FAILURE (Status))
@@ -1180,7 +1179,7 @@ GetAei:
}
ReturnBuffer.Pointer = AcpiGbl_DbBuffer;
- ReturnBuffer.Length = ACPI_DEBUG_BUFFER_SIZE;
+ ReturnBuffer.Length = ACPI_DEBUG_BUFFER_SIZE;
Status = AcpiGetEventResources (Node, &ReturnBuffer);
if (ACPI_FAILURE (Status))
@@ -1296,8 +1295,8 @@ AcpiDbGenerateGpe (
}
}
- GpeEventInfo = AcpiEvGetGpeEventInfo (ACPI_TO_POINTER (BlockNumber),
- GpeNumber);
+ GpeEventInfo = AcpiEvGetGpeEventInfo (
+ ACPI_TO_POINTER (BlockNumber), GpeNumber);
if (!GpeEventInfo)
{
AcpiOsPrintf ("Invalid GPE\n");
@@ -1356,15 +1355,8 @@ AcpiDbTrace (
UINT32 Flags = 0;
- if (EnableArg)
- {
- AcpiUtStrupr (EnableArg);
- }
-
- if (OnceArg)
- {
- AcpiUtStrupr (OnceArg);
- }
+ AcpiUtStrupr (EnableArg);
+ AcpiUtStrupr (OnceArg);
if (MethodArg)
{
diff --git a/src/acpica/source/components/debugger/dbconvert.c b/src/acpica/source/components/debugger/dbconvert.c
index d1201f3..034a204 100644
--- a/src/acpica/source/components/debugger/dbconvert.c
+++ b/src/acpica/source/components/debugger/dbconvert.c
@@ -270,7 +270,7 @@ AcpiDbConvertToBuffer (
}
j++;
- i+=2;
+ i += 2;
while (String[i] &&
((String[i] == ',') || (String[i] == ' ')))
{
diff --git a/src/acpica/source/components/debugger/dbdisply.c b/src/acpica/source/components/debugger/dbdisply.c
index 3a3ca15..1fa02a1 100644
--- a/src/acpica/source/components/debugger/dbdisply.c
+++ b/src/acpica/source/components/debugger/dbdisply.c
@@ -485,14 +485,13 @@ AcpiDbDisplayMethodInfo (
}
ObjDesc = WalkState->MethodDesc;
- Node = WalkState->MethodNode;
+ Node = WalkState->MethodNode;
AcpiOsPrintf ("Currently executing control method is [%4.4s]\n",
- AcpiUtGetNodeName (Node));
+ AcpiUtGetNodeName (Node));
AcpiOsPrintf ("%X Arguments, SyncLevel = %X\n",
- (UINT32) ObjDesc->Method.ParamCount,
- (UINT32) ObjDesc->Method.SyncLevel);
-
+ (UINT32) ObjDesc->Method.ParamCount,
+ (UINT32) ObjDesc->Method.SyncLevel);
RootOp = StartOp;
while (RootOp->Common.Parent)
@@ -653,7 +652,7 @@ AcpiDbDisplayResults (
}
ObjDesc = WalkState->MethodDesc;
- Node = WalkState->MethodNode;
+ Node = WalkState->MethodNode;
if (WalkState->Results)
{
@@ -729,7 +728,7 @@ AcpiDbDisplayCallingTree (
*
* FUNCTION: AcpiDbDisplayObjectType
*
- * PARAMETERS: Name - User entered NS node handle or name
+ * PARAMETERS: ObjectArg - User entered NS node handle
*
* RETURN: None
*
@@ -739,21 +738,17 @@ AcpiDbDisplayCallingTree (
void
AcpiDbDisplayObjectType (
- char *Name)
+ char *ObjectArg)
{
- ACPI_NAMESPACE_NODE *Node;
+ ACPI_HANDLE Handle;
ACPI_DEVICE_INFO *Info;
ACPI_STATUS Status;
UINT32 i;
- Node = AcpiDbConvertToNode (Name);
- if (!Node)
- {
- return;
- }
+ Handle = ACPI_TO_POINTER (strtoul (ObjectArg, NULL, 16));
- Status = AcpiGetObjectInfo (ACPI_CAST_PTR (ACPI_HANDLE, Node), &Info);
+ Status = AcpiGetObjectInfo (Handle, &Info);
if (ACPI_FAILURE (Status))
{
AcpiOsPrintf ("Could not get object info, %s\n",
@@ -761,25 +756,18 @@ AcpiDbDisplayObjectType (
return;
}
- if (Info->Valid & ACPI_VALID_ADR)
- {
- AcpiOsPrintf ("ADR: %8.8X%8.8X, STA: %8.8X, Flags: %X\n",
- ACPI_FORMAT_UINT64 (Info->Address),
- Info->CurrentStatus, Info->Flags);
- }
- if (Info->Valid & ACPI_VALID_SXDS)
- {
- AcpiOsPrintf ("S1D-%2.2X S2D-%2.2X S3D-%2.2X S4D-%2.2X\n",
- Info->HighestDstates[0], Info->HighestDstates[1],
- Info->HighestDstates[2], Info->HighestDstates[3]);
- }
- if (Info->Valid & ACPI_VALID_SXWS)
- {
- AcpiOsPrintf ("S0W-%2.2X S1W-%2.2X S2W-%2.2X S3W-%2.2X S4W-%2.2X\n",
- Info->LowestDstates[0], Info->LowestDstates[1],
- Info->LowestDstates[2], Info->LowestDstates[3],
- Info->LowestDstates[4]);
- }
+ AcpiOsPrintf ("ADR: %8.8X%8.8X, STA: %8.8X, Flags: %X\n",
+ ACPI_FORMAT_UINT64 (Info->Address),
+ Info->CurrentStatus, Info->Flags);
+
+ AcpiOsPrintf ("S1D-%2.2X S2D-%2.2X S3D-%2.2X S4D-%2.2X\n",
+ Info->HighestDstates[0], Info->HighestDstates[1],
+ Info->HighestDstates[2], Info->HighestDstates[3]);
+
+ AcpiOsPrintf ("S0W-%2.2X S1W-%2.2X S2W-%2.2X S3W-%2.2X S4W-%2.2X\n",
+ Info->LowestDstates[0], Info->LowestDstates[1],
+ Info->LowestDstates[2], Info->LowestDstates[3],
+ Info->LowestDstates[4]);
if (Info->Valid & ACPI_VALID_HID)
{
@@ -791,11 +779,6 @@ AcpiDbDisplayObjectType (
AcpiOsPrintf ("UID: %s\n", Info->UniqueId.String);
}
- if (Info->Valid & ACPI_VALID_SUB)
- {
- AcpiOsPrintf ("SUB: %s\n", Info->SubsystemId.String);
- }
-
if (Info->Valid & ACPI_VALID_CID)
{
for (i = 0; i < Info->CompatibleIdList.Count; i++)
@@ -832,6 +815,13 @@ AcpiDbDisplayResultObject (
ACPI_WALK_STATE *WalkState)
{
+#ifndef ACPI_APPLICATION
+ if (AcpiGbl_DbThreadId != AcpiOsGetThreadId())
+ {
+ return;
+ }
+#endif
+
/* Only display if single stepping */
if (!AcpiGbl_CmSingleStep)
@@ -864,6 +854,13 @@ AcpiDbDisplayArgumentObject (
ACPI_WALK_STATE *WalkState)
{
+#ifndef ACPI_APPLICATION
+ if (AcpiGbl_DbThreadId != AcpiOsGetThreadId())
+ {
+ return;
+ }
+#endif
+
if (!AcpiGbl_CmSingleStep)
{
return;
@@ -1243,7 +1240,7 @@ AcpiDbDisplayNonRootHandlers (
return (AE_OK);
}
- Pathname = AcpiNsGetExternalPathname (Node);
+ Pathname = AcpiNsGetNormalizedPathname (Node, TRUE);
if (!Pathname)
{
return (AE_OK);
diff --git a/src/acpica/source/components/debugger/dbexec.c b/src/acpica/source/components/debugger/dbexec.c
index c2b02d2..f69e27a 100644
--- a/src/acpica/source/components/debugger/dbexec.c
+++ b/src/acpica/source/components/debugger/dbexec.c
@@ -600,8 +600,8 @@ AcpiDbExecute (
/* Dump a _PLD buffer if present */
if (ACPI_COMPARE_NAME ((ACPI_CAST_PTR (ACPI_NAMESPACE_NODE,
- AcpiGbl_DbMethodInfo.Method)->Name.Ascii),
- METHOD_NAME__PLD))
+ AcpiGbl_DbMethodInfo.Method)->Name.Ascii),
+ METHOD_NAME__PLD))
{
AcpiDbDumpPldBuffer (ReturnObj.Pointer);
}
@@ -699,7 +699,8 @@ AcpiDbMethodThread (
if (ReturnObj.Length)
{
AcpiOsPrintf ("Evaluation of %s returned object %p Buflen %X\n",
- Info->Pathname, ReturnObj.Pointer, (UINT32) ReturnObj.Length);
+ Info->Pathname, ReturnObj.Pointer,
+ (UINT32) ReturnObj.Length);
AcpiDbDumpExternalObject (ReturnObj.Pointer, 1);
}
#endif
@@ -766,7 +767,7 @@ AcpiDbCreateExecutionThreads (
/* Get the arguments */
NumThreads = strtoul (NumThreadsArg, NULL, 0);
- NumLoops = strtoul (NumLoopsArg, NULL, 0);
+ NumLoops = strtoul (NumLoopsArg, NULL, 0);
if (!NumThreads || !NumLoops)
{
@@ -882,7 +883,7 @@ AcpiDbCreateExecutionThreads (
for (i = 0; i < (NumThreads); i++)
{
- Status = AcpiOsExecute (OSL_DEBUGGER_THREAD, AcpiDbMethodThread,
+ Status = AcpiOsExecute (OSL_DEBUGGER_EXEC_THREAD, AcpiDbMethodThread,
&AcpiGbl_DbMethodInfo);
if (ACPI_FAILURE (Status))
{
diff --git a/src/acpica/source/components/debugger/dbfileio.c b/src/acpica/source/components/debugger/dbfileio.c
index 4cdbc01..eaae9a0 100644
--- a/src/acpica/source/components/debugger/dbfileio.c
+++ b/src/acpica/source/components/debugger/dbfileio.c
@@ -118,7 +118,10 @@
#include "accommon.h"
#include "acdebug.h"
#include "actables.h"
-
+#include <stdio.h>
+#ifdef ACPI_APPLICATION
+#include "acapps.h"
+#endif
#define _COMPONENT ACPI_CA_DEBUGGER
ACPI_MODULE_NAME ("dbfileio")
@@ -193,134 +196,35 @@ AcpiDbOpenDebugFile (
#endif
-#ifdef ACPI_APPLICATION
-#include "acapps.h"
-
/*******************************************************************************
*
- * FUNCTION: AeLocalLoadTable
+ * FUNCTION: AcpiDbLoadTables
*
- * PARAMETERS: Table - pointer to a buffer containing the entire
- * table to be loaded
+ * PARAMETERS: ListHead - List of ACPI tables to load
*
* RETURN: Status
*
- * DESCRIPTION: This function is called to load a table from the caller's
- * buffer. The buffer must contain an entire ACPI Table including
- * a valid header. The header fields will be verified, and if it
- * is determined that the table is invalid, the call will fail.
- *
- ******************************************************************************/
-
-static ACPI_STATUS
-AeLocalLoadTable (
- ACPI_TABLE_HEADER *Table)
-{
- ACPI_STATUS Status = AE_OK;
-
-
- ACPI_FUNCTION_TRACE (AeLocalLoadTable);
-
-#if 0
-/* ACPI_TABLE_DESC TableInfo; */
-
- if (!Table)
- {
- return_ACPI_STATUS (AE_BAD_PARAMETER);
- }
-
- TableInfo.Pointer = Table;
- Status = AcpiTbRecognizeTable (&TableInfo, ACPI_TABLE_ALL);
- if (ACPI_FAILURE (Status))
- {
- return_ACPI_STATUS (Status);
- }
-
- /* Install the new table into the local data structures */
-
- Status = AcpiTbInitTableDescriptor (&TableInfo);
- if (ACPI_FAILURE (Status))
- {
- if (Status == AE_ALREADY_EXISTS)
- {
- /* Table already exists, no error */
-
- Status = AE_OK;
- }
-
- /* Free table allocated by AcpiTbGetTable */
-
- AcpiTbDeleteSingleTable (&TableInfo);
- return_ACPI_STATUS (Status);
- }
-
-#if (!defined (ACPI_NO_METHOD_EXECUTION) && !defined (ACPI_CONSTANT_EVAL_ONLY))
-
- Status = AcpiNsLoadTable (TableInfo.InstalledDesc, AcpiGbl_RootNode);
- if (ACPI_FAILURE (Status))
- {
- /* Uninstall table and free the buffer */
-
- AcpiTbDeleteTablesByType (ACPI_TABLE_ID_DSDT);
- return_ACPI_STATUS (Status);
- }
-#endif
-#endif
-
- return_ACPI_STATUS (Status);
-}
-#endif
-
-
-/*******************************************************************************
- *
- * FUNCTION: AcpiDbGetTableFromFile
- *
- * PARAMETERS: Filename - File where table is located
- * ReturnTable - Where a pointer to the table is returned
- *
- * RETURN: Status
- *
- * DESCRIPTION: Load an ACPI table from a file
+ * DESCRIPTION: Load ACPI tables from a previously constructed table list.
*
******************************************************************************/
ACPI_STATUS
-AcpiDbGetTableFromFile (
- char *Filename,
- ACPI_TABLE_HEADER **ReturnTable,
- BOOLEAN MustBeAmlFile)
+AcpiDbLoadTables (
+ ACPI_NEW_TABLE_DESC *ListHead)
{
-#ifdef ACPI_APPLICATION
ACPI_STATUS Status;
+ ACPI_NEW_TABLE_DESC *TableListHead;
ACPI_TABLE_HEADER *Table;
- BOOLEAN IsAmlTable = TRUE;
- Status = AcpiUtReadTableFromFile (Filename, &Table);
- if (ACPI_FAILURE (Status))
- {
- return (Status);
- }
-
- if (MustBeAmlFile)
- {
- IsAmlTable = AcpiUtIsAmlTable (Table);
- if (!IsAmlTable)
- {
- ACPI_EXCEPTION ((AE_INFO, AE_OK,
- "Input for -e is not an AML table: "
- "\"%4.4s\" (must be DSDT/SSDT)",
- Table->Signature));
- return (AE_TYPE);
- }
- }
+ /* Load all ACPI tables in the list */
- if (IsAmlTable)
+ TableListHead = ListHead;
+ while (TableListHead)
{
- /* Attempt to recognize and install the table */
+ Table = TableListHead->Table;
- Status = AeLocalLoadTable (Table);
+ Status = AcpiLoadTable (Table);
if (ACPI_FAILURE (Status))
{
if (Status == AE_ALREADY_EXISTS)
@@ -337,20 +241,12 @@ AcpiDbGetTableFromFile (
return (Status);
}
- AcpiTbPrintTableHeader (0, Table);
-
fprintf (stderr,
"Acpi table [%4.4s] successfully installed and loaded\n",
Table->Signature);
- }
- AcpiGbl_AcpiHardwarePresent = FALSE;
- if (ReturnTable)
- {
- *ReturnTable = Table;
+ TableListHead = TableListHead->Next;
}
-
-#endif /* ACPI_APPLICATION */
return (AE_OK);
}
diff --git a/src/acpica/source/components/debugger/dbinput.c b/src/acpica/source/components/debugger/dbinput.c
index b3ee71f..a051e78 100644
--- a/src/acpica/source/components/debugger/dbinput.c
+++ b/src/acpica/source/components/debugger/dbinput.c
@@ -117,6 +117,9 @@
#include "accommon.h"
#include "acdebug.h"
+#ifdef ACPI_APPLICATION
+#include "acapps.h"
+#endif
#define _COMPONENT ACPI_CA_DEBUGGER
ACPI_MODULE_NAME ("dbinput")
@@ -751,10 +754,7 @@ AcpiDbGetLine (
/* Uppercase the actual command */
- if (AcpiGbl_DbArgs[0])
- {
- AcpiUtStrupr (AcpiGbl_DbArgs[0]);
- }
+ AcpiUtStrupr (AcpiGbl_DbArgs[0]);
Count = i;
if (Count)
@@ -834,7 +834,7 @@ AcpiDbCommandDispatch (
/* If AcpiTerminate has been called, terminate this thread */
- if (AcpiGbl_DbTerminateThreads)
+ if (AcpiGbl_DbTerminateLoop)
{
return (AE_CTRL_TERMINATE);
}
@@ -1014,8 +1014,8 @@ AcpiDbCommandDispatch (
else if (ParamCount == 2)
{
Temp = AcpiGbl_DbConsoleDebugLevel;
- AcpiGbl_DbConsoleDebugLevel = strtoul (AcpiGbl_DbArgs[1],
- NULL, 16);
+ AcpiGbl_DbConsoleDebugLevel =
+ strtoul (AcpiGbl_DbArgs[1], NULL, 16);
AcpiOsPrintf (
"Debug Level for console output was %8.8lX, now %8.8lX\n",
Temp, AcpiGbl_DbConsoleDebugLevel);
@@ -1191,8 +1191,16 @@ AcpiDbCommandDispatch (
break;
case CMD_LOAD:
+ {
+ ACPI_NEW_TABLE_DESC *ListHead = NULL;
- Status = AcpiDbGetTableFromFile (AcpiGbl_DbArgs[1], NULL, FALSE);
+ Status = AcpiAcGetAllTablesFromFile (AcpiGbl_DbArgs[1],
+ ACPI_GET_ALL_TABLES, &ListHead);
+ if (ACPI_SUCCESS (Status))
+ {
+ AcpiDbLoadTables (ListHead);
+ }
+ }
break;
case CMD_OPEN:
@@ -1212,6 +1220,7 @@ AcpiDbCommandDispatch (
* re-creating the semaphores!
*/
+ AcpiGbl_DbTerminateLoop = TRUE;
/* AcpiInitialize (NULL); */
break;
@@ -1256,7 +1265,7 @@ AcpiDbCommandDispatch (
#ifdef ACPI_APPLICATION
AcpiDbCloseDebugFile ();
#endif
- AcpiGbl_DbTerminateThreads = TRUE;
+ AcpiGbl_DbTerminateLoop = TRUE;
return (AE_CTRL_TERMINATE);
case CMD_NOT_FOUND:
@@ -1296,7 +1305,7 @@ AcpiDbExecuteThread (
ACPI_STATUS MStatus;
- while (Status != AE_CTRL_TERMINATE)
+ while (Status != AE_CTRL_TERMINATE && !AcpiGbl_DbTerminateLoop)
{
AcpiGbl_MethodExecuting = FALSE;
AcpiGbl_StepToNextCall = FALSE;
@@ -1312,6 +1321,7 @@ AcpiDbExecuteThread (
AcpiOsReleaseMutex (AcpiGbl_DbCommandComplete);
}
+ AcpiGbl_DbThreadsTerminated = TRUE;
}
@@ -1366,7 +1376,7 @@ AcpiDbUserCommands (
/* TBD: [Restructure] Need a separate command line buffer for step mode */
- while (!AcpiGbl_DbTerminateThreads)
+ while (!AcpiGbl_DbTerminateLoop)
{
/* Force output to console until a command is entered */
@@ -1402,10 +1412,6 @@ AcpiDbUserCommands (
* and wait for the command to complete.
*/
AcpiOsReleaseMutex (AcpiGbl_DbCommandReady);
- if (ACPI_FAILURE (Status))
- {
- return (Status);
- }
Status = AcpiOsAcquireMutex (AcpiGbl_DbCommandComplete,
ACPI_WAIT_FOREVER);
@@ -1422,14 +1428,5 @@ AcpiDbUserCommands (
}
}
- /* Shut down the debugger */
-
- AcpiTerminateDebugger ();
-
- /*
- * Only this thread (the original thread) should actually terminate the
- * subsystem, because all the semaphores are deleted during termination
- */
- Status = AcpiTerminate ();
return (Status);
}
diff --git a/src/acpica/source/components/debugger/dbmethod.c b/src/acpica/source/components/debugger/dbmethod.c
index 92f53a2..455656e 100644
--- a/src/acpica/source/components/debugger/dbmethod.c
+++ b/src/acpica/source/components/debugger/dbmethod.c
@@ -161,7 +161,7 @@ AcpiDbSetMethodBreakpoint (
Address = strtoul (Location, NULL, 16);
AmlOffset = (UINT32) ACPI_PTR_DIFF (Op->Common.Aml,
- WalkState->ParserState.AmlStart);
+ WalkState->ParserState.AmlStart);
if (Address <= AmlOffset)
{
AcpiOsPrintf ("Breakpoint %X is beyond current address %X\n",
diff --git a/src/acpica/source/components/debugger/dbnames.c b/src/acpica/source/components/debugger/dbnames.c
index 0af1b1f..88e8e77 100644
--- a/src/acpica/source/components/debugger/dbnames.c
+++ b/src/acpica/source/components/debugger/dbnames.c
@@ -270,7 +270,7 @@ AcpiDbSetScope (
/* Build the final pathname */
if (AcpiUtSafeStrcat (AcpiGbl_DbScopeBuf, sizeof (AcpiGbl_DbScopeBuf),
- Name))
+ Name))
{
Status = AE_BUFFER_OVERFLOW;
goto ErrorExit;
@@ -571,7 +571,7 @@ AcpiDbWalkForPredefinedNames (
return (AE_OK);
}
- Pathname = AcpiNsGetExternalPathname (Node);
+ Pathname = AcpiNsGetNormalizedPathname (Node, TRUE);
if (!Pathname)
{
return (AE_OK);
@@ -632,7 +632,8 @@ AcpiDbCheckPredefinedNames (
/* Search all nodes in namespace */
(void) AcpiWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT,
- ACPI_UINT32_MAX, AcpiDbWalkForPredefinedNames, NULL, (void *) &Count, NULL);
+ ACPI_UINT32_MAX, AcpiDbWalkForPredefinedNames,
+ NULL, (void *) &Count, NULL);
AcpiOsPrintf ("Found %u predefined names in the namespace\n", Count);
}
@@ -1034,7 +1035,7 @@ AcpiDbBusWalk (
/* Exit if there is no _PRT under this device */
Status = AcpiGetHandle (Node, METHOD_NAME__PRT,
- ACPI_CAST_PTR (ACPI_HANDLE, &TempNode));
+ ACPI_CAST_PTR (ACPI_HANDLE, &TempNode));
if (ACPI_FAILURE (Status))
{
return (AE_OK);
diff --git a/src/acpica/source/components/debugger/dbobject.c b/src/acpica/source/components/debugger/dbobject.c
index e52d1ca..32c71b1 100644
--- a/src/acpica/source/components/debugger/dbobject.c
+++ b/src/acpica/source/components/debugger/dbobject.c
@@ -567,7 +567,8 @@ AcpiDbDecodeLocals (
}
else
{
- AcpiOsPrintf ("No Local Variables are initialized for method [%4.4s]\n",
+ AcpiOsPrintf (
+ "No Local Variables are initialized for method [%4.4s]\n",
AcpiUtGetNodeName (Node));
}
}
@@ -644,7 +645,8 @@ AcpiDbDecodeArguments (
}
else
{
- AcpiOsPrintf ("No Arguments are initialized for method [%4.4s]\n",
+ AcpiOsPrintf (
+ "No Arguments are initialized for method [%4.4s]\n",
AcpiUtGetNodeName (Node));
}
}
diff --git a/src/acpica/source/components/debugger/dbstats.c b/src/acpica/source/components/debugger/dbstats.c
index 1b757a4..d00e295 100644
--- a/src/acpica/source/components/debugger/dbstats.c
+++ b/src/acpica/source/components/debugger/dbstats.c
@@ -411,7 +411,7 @@ AcpiDbClassifyOneObject (
Op = AcpiPsGetDepthNext (Root, Op);
SizeOfParseTree = (NumGrammarElements - NumMethodElements) *
- (UINT32) sizeof (ACPI_PARSE_OBJECT);
+ (UINT32) sizeof (ACPI_PARSE_OBJECT);
SizeOfMethodTrees = NumMethodElements * (UINT32) sizeof (ACPI_PARSE_OBJECT);
SizeOfNodeEntries = NumNodes * (UINT32) sizeof (ACPI_NAMESPACE_NODE);
SizeOfAcpiObjects = NumNodes * (UINT32) sizeof (ACPI_OPERAND_OBJECT);
@@ -511,6 +511,7 @@ AcpiDbDisplayStatistics (
AcpiOsPrintf ("%16.16s % 10ld% 10ld\n", AcpiUtGetTypeName (i),
AcpiGbl_NodeTypeCount [i], AcpiGbl_ObjTypeCount [i]);
}
+
AcpiOsPrintf ("%16.16s % 10ld% 10ld\n", "Misc/Unknown",
AcpiGbl_NodeTypeCountMisc, AcpiGbl_ObjTypeCountMisc);
diff --git a/src/acpica/source/components/debugger/dbtest.c b/src/acpica/source/components/debugger/dbtest.c
index 679a9d6..2e3332e 100644
--- a/src/acpica/source/components/debugger/dbtest.c
+++ b/src/acpica/source/components/debugger/dbtest.c
@@ -1052,7 +1052,8 @@ AcpiDbEvaluateAllPredefinedNames (
ACPI_UINT32_MAX, AcpiDbEvaluateOnePredefinedName, NULL,
(void *) &Info, NULL);
- AcpiOsPrintf ("Evaluated %u predefined names in the namespace\n", Info.Count);
+ AcpiOsPrintf (
+ "Evaluated %u predefined names in the namespace\n", Info.Count);
}
@@ -1105,7 +1106,7 @@ AcpiDbEvaluateOnePredefinedName (
return (AE_OK);
}
- Pathname = AcpiNsGetExternalPathname (Node);
+ Pathname = AcpiNsGetNormalizedPathname (Node, TRUE);
if (!Pathname)
{
return (AE_OK);
diff --git a/src/acpica/source/components/debugger/dbutils.c b/src/acpica/source/components/debugger/dbutils.c
index a52a201..6cdb683 100644
--- a/src/acpica/source/components/debugger/dbutils.c
+++ b/src/acpica/source/components/debugger/dbutils.c
@@ -271,6 +271,7 @@ AcpiDbDumpExternalObject (
{
AcpiOsPrintf ("\n");
}
+
AcpiUtDebugDumpBuffer (
ACPI_CAST_PTR (UINT8, ObjDesc->Buffer.Pointer),
ObjDesc->Buffer.Length, DB_BYTE_DISPLAY, _COMPONENT);
diff --git a/src/acpica/source/components/debugger/dbxface.c b/src/acpica/source/components/debugger/dbxface.c
index 0004665..ad99ad1 100644
--- a/src/acpica/source/components/debugger/dbxface.c
+++ b/src/acpica/source/components/debugger/dbxface.c
@@ -224,6 +224,40 @@ AcpiDbStartCommand (
/*******************************************************************************
*
+ * FUNCTION: AcpiDbSignalBreakPoint
+ *
+ * PARAMETERS: WalkState - Current walk
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Called for AML_BREAK_POINT_OP
+ *
+ ******************************************************************************/
+
+void
+AcpiDbSignalBreakPoint (
+ ACPI_WALK_STATE *WalkState)
+{
+
+#ifndef ACPI_APPLICATION
+ if (AcpiGbl_DbThreadId != AcpiOsGetThreadId ())
+ {
+ return;
+ }
+#endif
+
+ /*
+ * Set the single-step flag. This will cause the debugger (if present)
+ * to break to the console within the AML debugger at the start of the
+ * next AML instruction.
+ */
+ AcpiGbl_CmSingleStep = TRUE;
+ AcpiOsPrintf ("**break** Executed AML BreakPoint opcode\n");
+}
+
+
+/*******************************************************************************
+ *
* FUNCTION: AcpiDbSingleStep
*
* PARAMETERS: WalkState - Current walk
@@ -253,6 +287,13 @@ AcpiDbSingleStep (
ACPI_FUNCTION_ENTRY ();
+#ifndef ACPI_APPLICATION
+ if (AcpiGbl_DbThreadId != AcpiOsGetThreadId ())
+ {
+ return (AE_OK);
+ }
+#endif
+
/* Check the abort flag */
if (AcpiGbl_AbortMethod)
@@ -511,6 +552,10 @@ AcpiInitializeDebugger (
AcpiGbl_DbScopeBuf [1] = 0;
AcpiGbl_DbScopeNode = AcpiGbl_RootNode;
+ /* Initialize user commands loop */
+
+ AcpiGbl_DbTerminateLoop = FALSE;
+
/*
* If configured for multi-thread support, the debug executor runs in
* a separate thread so that the front end can be in another address
@@ -538,15 +583,21 @@ AcpiInitializeDebugger (
/* Create the debug execution thread to execute commands */
- Status = AcpiOsExecute (OSL_DEBUGGER_THREAD,
+ AcpiGbl_DbThreadsTerminated = FALSE;
+ Status = AcpiOsExecute (OSL_DEBUGGER_MAIN_THREAD,
AcpiDbExecuteThread, NULL);
if (ACPI_FAILURE (Status))
{
ACPI_EXCEPTION ((AE_INFO, Status,
"Could not start debugger thread"));
+ AcpiGbl_DbThreadsTerminated = TRUE;
return_ACPI_STATUS (Status);
}
}
+ else
+ {
+ AcpiGbl_DbThreadId = AcpiOsGetThreadId ();
+ }
return_ACPI_STATUS (AE_OK);
}
@@ -571,6 +622,22 @@ AcpiTerminateDebugger (
void)
{
+ /* Terminate the AML Debugger */
+
+ AcpiGbl_DbTerminateLoop = TRUE;
+
+ if (AcpiGbl_DebuggerConfiguration & DEBUGGER_MULTI_THREADED)
+ {
+ AcpiOsReleaseMutex (AcpiGbl_DbCommandReady);
+
+ /* Wait the AML Debugger threads */
+
+ while (!AcpiGbl_DbThreadsTerminated)
+ {
+ AcpiOsSleep (100);
+ }
+ }
+
if (AcpiGbl_DbBuffer)
{
AcpiOsFree (AcpiGbl_DbBuffer);
@@ -583,3 +650,25 @@ AcpiTerminateDebugger (
}
ACPI_EXPORT_SYMBOL (AcpiTerminateDebugger)
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiSetDebuggerThreadId
+ *
+ * PARAMETERS: ThreadId - Debugger thread ID
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Set debugger thread ID
+ *
+ ******************************************************************************/
+
+void
+AcpiSetDebuggerThreadId (
+ ACPI_THREAD_ID ThreadId)
+{
+ AcpiGbl_DbThreadId = ThreadId;
+}
+
+ACPI_EXPORT_SYMBOL (AcpiSetDebuggerThreadId)
diff --git a/src/acpica/source/components/disassembler/dmbuffer.c b/src/acpica/source/components/disassembler/dmbuffer.c
index d6985ef..4ad8be9 100644
--- a/src/acpica/source/components/disassembler/dmbuffer.c
+++ b/src/acpica/source/components/disassembler/dmbuffer.c
@@ -326,7 +326,8 @@ AcpiDmByteList (
{
case ACPI_DASM_RESOURCE:
- AcpiDmResourceTemplate (Info, Op->Common.Parent, ByteData, ByteCount);
+ AcpiDmResourceTemplate (
+ Info, Op->Common.Parent, ByteData, ByteCount);
break;
case ACPI_DASM_STRING:
@@ -823,13 +824,17 @@ AcpiDmPldBuffer (
AcpiOsPrintf (ACPI_PLD_OUTPUT08, "PLD_Lid", PldInfo->Lid);
AcpiOsPrintf (ACPI_PLD_OUTPUTSTR, "PLD_Panel",
AcpiDmFindNameByIndex(PldInfo->Panel, DmPanelList));
+
AcpiOsPrintf (ACPI_PLD_OUTPUTSTR, "PLD_VerticalPosition",
AcpiDmFindNameByIndex(PldInfo->VerticalPosition, DmVerticalPositionList));
+
AcpiOsPrintf (ACPI_PLD_OUTPUTSTR, "PLD_HorizontalPosition",
AcpiDmFindNameByIndex(PldInfo->HorizontalPosition, DmHorizontalPositionList));
+
AcpiOsPrintf (ACPI_PLD_OUTPUTSTR, "PLD_Shape",
AcpiDmFindNameByIndex(PldInfo->Shape, DmShapeList));
AcpiOsPrintf (ACPI_PLD_OUTPUT08, "PLD_GroupOrientation", PldInfo->GroupOrientation);
+
AcpiOsPrintf (ACPI_PLD_OUTPUT08, "PLD_GroupToken", PldInfo->GroupToken);
AcpiOsPrintf (ACPI_PLD_OUTPUT08, "PLD_GroupPosition", PldInfo->GroupPosition);
AcpiOsPrintf (ACPI_PLD_OUTPUT08, "PLD_Bay", PldInfo->Bay);
diff --git a/src/acpica/source/components/disassembler/dmcstyle.c b/src/acpica/source/components/disassembler/dmcstyle.c
index 0dbbb60..0e23133 100644
--- a/src/acpica/source/components/disassembler/dmcstyle.c
+++ b/src/acpica/source/components/disassembler/dmcstyle.c
@@ -757,6 +757,7 @@ AcpiDmGetCompoundSymbol (
default:
/* No operator string for all other opcodes */
+
return (NULL);
}
diff --git a/src/acpica/source/components/disassembler/dmdeferred.c b/src/acpica/source/components/disassembler/dmdeferred.c
index 6599c04..b6db169 100644
--- a/src/acpica/source/components/disassembler/dmdeferred.c
+++ b/src/acpica/source/components/disassembler/dmdeferred.c
@@ -177,7 +177,8 @@ AcpiDmParseDeferredOps (
case AML_PACKAGE_OP:
case AML_VAR_PACKAGE_OP:
- Status = AcpiDmDeferredParse (Op, Op->Named.Data, Op->Named.Length);
+ Status = AcpiDmDeferredParse (
+ Op, Op->Named.Data, Op->Named.Length);
if (ACPI_FAILURE (Status))
{
return (Status);
diff --git a/src/acpica/source/components/disassembler/dmnames.c b/src/acpica/source/components/disassembler/dmnames.c
index 673d726..9409e21 100644
--- a/src/acpica/source/components/disassembler/dmnames.c
+++ b/src/acpica/source/components/disassembler/dmnames.c
@@ -227,15 +227,15 @@ AcpiPsDisplayObjectPathname (
/* Node not defined in this scope, look it up */
Status = AcpiNsLookup (WalkState->ScopeInfo, Op->Common.Value.String,
- ACPI_TYPE_ANY, ACPI_IMODE_EXECUTE, ACPI_NS_SEARCH_PARENT,
- WalkState, &(Node));
+ ACPI_TYPE_ANY, ACPI_IMODE_EXECUTE, ACPI_NS_SEARCH_PARENT,
+ WalkState, &(Node));
if (ACPI_FAILURE (Status))
{
/*
- * We can't get the pathname since the object
- * is not in the namespace. This can happen during single
- * stepping where a dynamic named object is *about* to be created.
+ * We can't get the pathname since the object is not in the
+ * namespace. This can happen during single stepping
+ * where a dynamic named object is *about* to be created.
*/
AcpiOsPrintf (" [Path not found]");
goto Exit;
@@ -341,6 +341,7 @@ AcpiDmNamestring (
AcpiOsPrintf (".");
}
+
Name += ACPI_NAME_SIZE;
}
}
@@ -404,7 +405,6 @@ AcpiDmDisplayPath (
}
Prev = NULL; /* Start with Root Node */
-
while (Prev != Op)
{
/* Search upwards in the tree to find scope with "prev" as its parent */
@@ -462,6 +462,7 @@ AcpiDmDisplayPath (
DoDot = TRUE;
}
}
+
Prev = Search;
}
}
diff --git a/src/acpica/source/components/disassembler/dmopcode.c b/src/acpica/source/components/disassembler/dmopcode.c
index 866da38..68dda89 100644
--- a/src/acpica/source/components/disassembler/dmopcode.c
+++ b/src/acpica/source/components/disassembler/dmopcode.c
@@ -892,7 +892,9 @@ AcpiDmDisassembleOneOp (
}
else if (Status == AE_AML_NO_RESOURCE_END_TAG)
{
- AcpiOsPrintf ("/**** Is ResourceTemplate, but EndTag not at buffer end ****/ ");
+ AcpiOsPrintf (
+ "/**** Is ResourceTemplate, "
+ "but EndTag not at buffer end ****/ ");
}
}
@@ -967,7 +969,8 @@ AcpiDmDisassembleOneOp (
if (Op->Common.AmlOpcode == AML_INT_EXTACCESSFIELD_OP)
{
- AcpiOsPrintf (" (0x%2.2X)", (unsigned) ((Op->Common.Value.Integer >> 16) & 0xFF));
+ AcpiOsPrintf (" (0x%2.2X)", (unsigned)
+ ((Op->Common.Value.Integer >> 16) & 0xFF));
}
AcpiOsPrintf (")");
diff --git a/src/acpica/source/components/disassembler/dmresrc.c b/src/acpica/source/components/disassembler/dmresrc.c
index 5c9e7b9..923d5da 100644
--- a/src/acpica/source/components/disassembler/dmresrc.c
+++ b/src/acpica/source/components/disassembler/dmresrc.c
@@ -284,6 +284,7 @@ AcpiDmBitList (
{
AcpiOsPrintf (",");
}
+
Previous = TRUE;
AcpiOsPrintf ("%u", i);
}
@@ -357,7 +358,8 @@ AcpiDmResourceTemplate (
Status = AcpiUtValidateResource (NULL, Aml, &ResourceIndex);
if (ACPI_FAILURE (Status))
{
- AcpiOsPrintf ("/*** Could not validate Resource, type (%X) %s***/\n",
+ AcpiOsPrintf (
+ "/*** Could not validate Resource, type (%X) %s***/\n",
ResourceType, AcpiFormatException (Status));
return;
}
@@ -407,7 +409,8 @@ AcpiDmResourceTemplate (
AcpiDmIndent (Level);
AcpiOsPrintf (
- "/*** Disassembler: inserted missing EndDependentFn () ***/\n");
+ "/*** Disassembler: inserted "
+ "missing EndDependentFn () ***/\n");
}
return;
diff --git a/src/acpica/source/components/disassembler/dmresrcl.c b/src/acpica/source/components/disassembler/dmresrcl.c
index 155f01c..ab68cdb 100644
--- a/src/acpica/source/components/disassembler/dmresrcl.c
+++ b/src/acpica/source/components/disassembler/dmresrcl.c
@@ -379,7 +379,8 @@ AcpiDmAddressCommon (
if ((ResourceType > 2) && (ResourceType < 0xC0))
{
- AcpiOsPrintf ("/**** Invalid Resource Type: 0x%X ****/", ResourceType);
+ AcpiOsPrintf (
+ "/**** Invalid Resource Type: 0x%X ****/", ResourceType);
return;
}
@@ -399,7 +400,8 @@ AcpiDmAddressCommon (
/* This is either a Memory, IO, or BusNumber descriptor (0,1,2) */
- AcpiOsPrintf ("%s (", AcpiGbl_WordDecode [ACPI_GET_2BIT_FLAG (ResourceType)]);
+ AcpiOsPrintf ("%s (",
+ AcpiGbl_WordDecode [ACPI_GET_2BIT_FLAG (ResourceType)]);
/* Decode the general and type-specific flags */
@@ -412,7 +414,8 @@ AcpiDmAddressCommon (
AcpiDmIoFlags (Flags);
if (ResourceType == ACPI_IO_RANGE)
{
- AcpiOsPrintf (" %s,", AcpiGbl_RngDecode [ACPI_GET_2BIT_FLAG (SpecificFlags)]);
+ AcpiOsPrintf (" %s,",
+ AcpiGbl_RngDecode [ACPI_GET_2BIT_FLAG (SpecificFlags)]);
}
}
}
@@ -807,7 +810,8 @@ AcpiDmExtendedDescriptor (
/* Dump resource name and flags */
- AcpiDmAddressCommon (Resource, ACPI_RESOURCE_TYPE_EXTENDED_ADDRESS64, Level);
+ AcpiDmAddressCommon (
+ Resource, ACPI_RESOURCE_TYPE_EXTENDED_ADDRESS64, Level);
/* Dump the 5 contiguous QWORD values */
@@ -943,10 +947,12 @@ AcpiDmFixedMemory32Descriptor (
AcpiGbl_RwDecode [ACPI_GET_1BIT_FLAG (Resource->FixedMemory32.Flags)]);
AcpiDmIndent (Level + 1);
- AcpiDmDumpInteger32 (Resource->FixedMemory32.Address, "Address Base");
+ AcpiDmDumpInteger32 (Resource->FixedMemory32.Address,
+ "Address Base");
AcpiDmIndent (Level + 1);
- AcpiDmDumpInteger32 (Resource->FixedMemory32.AddressLength, "Address Length");
+ AcpiDmDumpInteger32 (Resource->FixedMemory32.AddressLength,
+ "Address Length");
/* Insert a descriptor name */
diff --git a/src/acpica/source/components/disassembler/dmresrcl2.c b/src/acpica/source/components/disassembler/dmresrcl2.c
index 8006458..8a972ff 100644
--- a/src/acpica/source/components/disassembler/dmresrcl2.c
+++ b/src/acpica/source/components/disassembler/dmresrcl2.c
@@ -224,6 +224,7 @@ AcpiDmDumpRawDataBuffer (
AcpiOsPrintf (", ");
}
+
AcpiOsPrintf ("\n");
AcpiDmIndent (Level + 2);
@@ -269,7 +270,8 @@ AcpiDmGpioCommon (
AcpiDmIndent (Level + 1);
if (Resource->Gpio.ResSourceOffset)
{
- DeviceName = ACPI_ADD_PTR (char, Resource, Resource->Gpio.ResSourceOffset),
+ DeviceName = ACPI_ADD_PTR (char,
+ Resource, Resource->Gpio.ResSourceOffset),
AcpiUtPrintString (DeviceName, ACPI_UINT16_MAX);
}
@@ -313,13 +315,15 @@ AcpiDmGpioCommon (
for (i = 0; i < PinCount; i++)
{
AcpiDmIndent (Level + 2);
- AcpiOsPrintf ("0x%4.4X%s\n", PinList[i], ((i + 1) < PinCount) ? "," : "");
+ AcpiOsPrintf ("0x%4.4X%s\n", PinList[i],
+ ((i + 1) < PinCount) ? "," : "");
}
AcpiDmIndent (Level + 1);
AcpiOsPrintf ("}\n");
- MpSaveGpioInfo (Info->MappingOp, Resource, PinCount, PinList, DeviceName);
+ MpSaveGpioInfo (Info->MappingOp, Resource,
+ PinCount, PinList, DeviceName);
}
diff --git a/src/acpica/source/components/disassembler/dmresrcs.c b/src/acpica/source/components/disassembler/dmresrcs.c
index 99d0dfc..670ee48 100644
--- a/src/acpica/source/components/disassembler/dmresrcs.c
+++ b/src/acpica/source/components/disassembler/dmresrcs.c
@@ -243,7 +243,8 @@ AcpiDmFixedDmaDescriptor (
}
else
{
- AcpiOsPrintf ("%X /* INVALID DMA WIDTH */, ", Resource->FixedDma.Width);
+ AcpiOsPrintf ("%X /* INVALID DMA WIDTH */, ",
+ Resource->FixedDma.Width);
}
/* Insert a descriptor name */
diff --git a/src/acpica/source/components/disassembler/dmwalk.c b/src/acpica/source/components/disassembler/dmwalk.c
index a2a5c51..ccc1200 100644
--- a/src/acpica/source/components/disassembler/dmwalk.c
+++ b/src/acpica/source/components/disassembler/dmwalk.c
@@ -536,7 +536,7 @@ AcpiDmDescendingOp (
if (Info->WalkState)
{
AmlOffset = (UINT32) ACPI_PTR_DIFF (Op->Common.Aml,
- Info->WalkState->ParserState.AmlStart);
+ Info->WalkState->ParserState.AmlStart);
if (AcpiGbl_DmOpt_Verbose)
{
AcpiOsPrintf (DB_FULL_OP_INFO,
@@ -559,8 +559,8 @@ AcpiDmDescendingOp (
}
}
else if ((AcpiDmBlockType (Op->Common.Parent) & BLOCK_BRACE) &&
- (!(Op->Common.DisasmFlags & ACPI_PARSEOP_PARAMLIST)) &&
- (Op->Common.AmlOpcode != AML_INT_BYTELIST_OP))
+ (!(Op->Common.DisasmFlags & ACPI_PARSEOP_PARAMLIST)) &&
+ (Op->Common.AmlOpcode != AML_INT_BYTELIST_OP))
{
/*
* This is a first-level element of a term list,
@@ -978,8 +978,8 @@ AcpiDmAscendingOp (
if (!AcpiDmCommaIfListMember (Op))
{
if ((AcpiDmBlockType (Op->Common.Parent) & BLOCK_BRACE) &&
- (!(Op->Common.DisasmFlags & ACPI_PARSEOP_PARAMLIST)) &&
- (Op->Common.AmlOpcode != AML_INT_BYTELIST_OP))
+ (!(Op->Common.DisasmFlags & ACPI_PARSEOP_PARAMLIST)) &&
+ (Op->Common.AmlOpcode != AML_INT_BYTELIST_OP))
{
/*
* This is a first-level element of a term list
@@ -1040,8 +1040,8 @@ AcpiDmAscendingOp (
if (!AcpiDmCommaIfListMember (Op))
{
if ((AcpiDmBlockType (Op->Common.Parent) & BLOCK_BRACE) &&
- (!(Op->Common.DisasmFlags & ACPI_PARSEOP_PARAMLIST)) &&
- (Op->Common.AmlOpcode != AML_INT_BYTELIST_OP))
+ (!(Op->Common.DisasmFlags & ACPI_PARSEOP_PARAMLIST)) &&
+ (Op->Common.AmlOpcode != AML_INT_BYTELIST_OP))
{
/*
* This is a first-level element of a term list
diff --git a/src/acpica/source/components/dispatcher/dsargs.c b/src/acpica/source/components/dispatcher/dsargs.c
index 344e55e..6343d32 100644
--- a/src/acpica/source/components/dispatcher/dsargs.c
+++ b/src/acpica/source/components/dispatcher/dsargs.c
@@ -186,7 +186,7 @@ AcpiDsExecuteArguments (
}
Status = AcpiDsInitAmlWalk (WalkState, Op, NULL, AmlStart,
- AmlLength, NULL, ACPI_IMODE_LOAD_PASS1);
+ AmlLength, NULL, ACPI_IMODE_LOAD_PASS1);
if (ACPI_FAILURE (Status))
{
AcpiDsDeleteWalkState (WalkState);
@@ -233,7 +233,7 @@ AcpiDsExecuteArguments (
/* Execute the opcode and arguments */
Status = AcpiDsInitAmlWalk (WalkState, Op, NULL, AmlStart,
- AmlLength, NULL, ACPI_IMODE_EXECUTE);
+ AmlLength, NULL, ACPI_IMODE_EXECUTE);
if (ACPI_FAILURE (Status))
{
AcpiDsDeleteWalkState (WalkState);
@@ -286,8 +286,8 @@ AcpiDsGetBufferFieldArguments (
ExtraDesc = AcpiNsGetSecondaryObject (ObjDesc);
Node = ObjDesc->BufferField.Node;
- ACPI_DEBUG_EXEC (AcpiUtDisplayInitPathname (ACPI_TYPE_BUFFER_FIELD,
- Node, NULL));
+ ACPI_DEBUG_EXEC (AcpiUtDisplayInitPathname (
+ ACPI_TYPE_BUFFER_FIELD, Node, NULL));
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "[%4.4s] BufferField Arg Init\n",
AcpiUtGetNodeName (Node)));
@@ -295,7 +295,7 @@ AcpiDsGetBufferFieldArguments (
/* Execute the AML code for the TermArg arguments */
Status = AcpiDsExecuteArguments (Node, Node->Parent,
- ExtraDesc->Extra.AmlLength, ExtraDesc->Extra.AmlStart);
+ ExtraDesc->Extra.AmlLength, ExtraDesc->Extra.AmlStart);
return_ACPI_STATUS (Status);
}
@@ -335,8 +335,8 @@ AcpiDsGetBankFieldArguments (
ExtraDesc = AcpiNsGetSecondaryObject (ObjDesc);
Node = ObjDesc->BankField.Node;
- ACPI_DEBUG_EXEC (AcpiUtDisplayInitPathname (ACPI_TYPE_LOCAL_BANK_FIELD,
- Node, NULL));
+ ACPI_DEBUG_EXEC (AcpiUtDisplayInitPathname (
+ ACPI_TYPE_LOCAL_BANK_FIELD, Node, NULL));
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "[%4.4s] BankField Arg Init\n",
AcpiUtGetNodeName (Node)));
@@ -344,7 +344,7 @@ AcpiDsGetBankFieldArguments (
/* Execute the AML code for the TermArg arguments */
Status = AcpiDsExecuteArguments (Node, Node->Parent,
- ExtraDesc->Extra.AmlLength, ExtraDesc->Extra.AmlStart);
+ ExtraDesc->Extra.AmlLength, ExtraDesc->Extra.AmlStart);
return_ACPI_STATUS (Status);
}
@@ -384,7 +384,8 @@ AcpiDsGetBufferArguments (
if (!Node)
{
ACPI_ERROR ((AE_INFO,
- "No pointer back to namespace node in buffer object %p", ObjDesc));
+ "No pointer back to namespace node in buffer object %p",
+ ObjDesc));
return_ACPI_STATUS (AE_AML_INTERNAL);
}
@@ -393,7 +394,7 @@ AcpiDsGetBufferArguments (
/* Execute the AML code for the TermArg arguments */
Status = AcpiDsExecuteArguments (Node, Node,
- ObjDesc->Buffer.AmlLength, ObjDesc->Buffer.AmlStart);
+ ObjDesc->Buffer.AmlLength, ObjDesc->Buffer.AmlStart);
return_ACPI_STATUS (Status);
}
@@ -442,7 +443,7 @@ AcpiDsGetPackageArguments (
/* Execute the AML code for the TermArg arguments */
Status = AcpiDsExecuteArguments (Node, Node,
- ObjDesc->Package.AmlLength, ObjDesc->Package.AmlStart);
+ ObjDesc->Package.AmlLength, ObjDesc->Package.AmlStart);
return_ACPI_STATUS (Status);
}
@@ -487,22 +488,23 @@ AcpiDsGetRegionArguments (
Node = ObjDesc->Region.Node;
- ACPI_DEBUG_EXEC (AcpiUtDisplayInitPathname (ACPI_TYPE_REGION, Node, NULL));
+ ACPI_DEBUG_EXEC (AcpiUtDisplayInitPathname (
+ ACPI_TYPE_REGION, Node, NULL));
- ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "[%4.4s] OpRegion Arg Init at AML %p\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
+ "[%4.4s] OpRegion Arg Init at AML %p\n",
AcpiUtGetNodeName (Node), ExtraDesc->Extra.AmlStart));
/* Execute the argument AML */
Status = AcpiDsExecuteArguments (Node, ExtraDesc->Extra.ScopeNode,
- ExtraDesc->Extra.AmlLength, ExtraDesc->Extra.AmlStart);
+ ExtraDesc->Extra.AmlLength, ExtraDesc->Extra.AmlStart);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
}
Status = AcpiUtAddAddressRange (ObjDesc->Region.SpaceId,
- ObjDesc->Region.Address, ObjDesc->Region.Length,
- Node);
+ ObjDesc->Region.Address, ObjDesc->Region.Length, Node);
return_ACPI_STATUS (Status);
}
diff --git a/src/acpica/source/components/dispatcher/dscontrol.c b/src/acpica/source/components/dispatcher/dscontrol.c
index a069ed5..270cf0e 100644
--- a/src/acpica/source/components/dispatcher/dscontrol.c
+++ b/src/acpica/source/components/dispatcher/dscontrol.c
@@ -119,6 +119,7 @@
#include "amlcode.h"
#include "acdispat.h"
#include "acinterp.h"
+#include "acdebug.h"
#define _COMPONENT ACPI_DISPATCHER
ACPI_MODULE_NAME ("dscontrol")
@@ -191,9 +192,12 @@ AcpiDsExecBeginControlOp (
* Save a pointer to the predicate for multiple executions
* of a loop
*/
- ControlState->Control.AmlPredicateStart = WalkState->ParserState.Aml - 1;
- ControlState->Control.PackageEnd = WalkState->ParserState.PkgEnd;
- ControlState->Control.Opcode = Op->Common.AmlOpcode;
+ ControlState->Control.AmlPredicateStart =
+ WalkState->ParserState.Aml - 1;
+ ControlState->Control.PackageEnd =
+ WalkState->ParserState.PkgEnd;
+ ControlState->Control.Opcode =
+ Op->Common.AmlOpcode;
/* Push the control state on this walk's control stack */
@@ -304,7 +308,8 @@ AcpiDsExecEndControlOp (
* another time
*/
Status = AE_CTRL_PENDING;
- WalkState->AmlLastWhile = ControlState->Control.AmlPredicateStart;
+ WalkState->AmlLastWhile =
+ ControlState->Control.AmlPredicateStart;
break;
}
@@ -348,7 +353,8 @@ AcpiDsExecEndControlOp (
* an arg or local), resolve it now because it may
* cease to exist at the end of the method.
*/
- Status = AcpiExResolveToValue (&WalkState->Operands [0], WalkState);
+ Status = AcpiExResolveToValue (
+ &WalkState->Operands [0], WalkState);
if (ACPI_FAILURE (Status))
{
return (Status);
@@ -377,11 +383,15 @@ AcpiDsExecEndControlOp (
* Allow references created by the Index operator to return
* unchanged.
*/
- if ((ACPI_GET_DESCRIPTOR_TYPE (WalkState->Results->Results.ObjDesc[0]) == ACPI_DESC_TYPE_OPERAND) &&
- ((WalkState->Results->Results.ObjDesc [0])->Common.Type == ACPI_TYPE_LOCAL_REFERENCE) &&
- ((WalkState->Results->Results.ObjDesc [0])->Reference.Class != ACPI_REFCLASS_INDEX))
+ if ((ACPI_GET_DESCRIPTOR_TYPE (WalkState->Results->Results.ObjDesc[0]) ==
+ ACPI_DESC_TYPE_OPERAND) &&
+ ((WalkState->Results->Results.ObjDesc [0])->Common.Type ==
+ ACPI_TYPE_LOCAL_REFERENCE) &&
+ ((WalkState->Results->Results.ObjDesc [0])->Reference.Class !=
+ ACPI_REFCLASS_INDEX))
{
- Status = AcpiExResolveToValue (&WalkState->Results->Results.ObjDesc [0], WalkState);
+ Status = AcpiExResolveToValue (
+ &WalkState->Results->Results.ObjDesc [0], WalkState);
if (ACPI_FAILURE (Status))
{
return (Status);
@@ -399,9 +409,9 @@ AcpiDsExecEndControlOp (
AcpiUtRemoveReference (WalkState->Operands [0]);
}
- WalkState->Operands [0] = NULL;
- WalkState->NumOperands = 0;
- WalkState->ReturnDesc = NULL;
+ WalkState->Operands[0] = NULL;
+ WalkState->NumOperands = 0;
+ WalkState->ReturnDesc = NULL;
}
@@ -422,20 +432,12 @@ AcpiDsExecEndControlOp (
case AML_BREAK_POINT_OP:
- /*
- * Set the single-step flag. This will cause the debugger (if present)
- * to break to the console within the AML debugger at the start of the
- * next AML instruction.
- */
- ACPI_DEBUGGER_EXEC (
- AcpiGbl_CmSingleStep = TRUE);
- ACPI_DEBUGGER_EXEC (
- AcpiOsPrintf ("**break** Executed AML BreakPoint opcode\n"));
+ AcpiDbSignalBreakPoint (WalkState);
/* Call to the OSL in case OS wants a piece of the action */
Status = AcpiOsSignal (ACPI_SIGNAL_BREAKPOINT,
- "Executed AML Breakpoint opcode");
+ "Executed AML Breakpoint opcode");
break;
case AML_BREAK_OP:
@@ -459,7 +461,8 @@ AcpiDsExecEndControlOp (
/* Was: WalkState->AmlLastWhile = WalkState->ControlState->Control.AmlPredicateStart; */
- WalkState->AmlLastWhile = WalkState->ControlState->Control.PackageEnd;
+ WalkState->AmlLastWhile =
+ WalkState->ControlState->Control.PackageEnd;
/* Return status depending on opcode */
diff --git a/src/acpica/source/components/dispatcher/dsdebug.c b/src/acpica/source/components/dispatcher/dsdebug.c
index 80b3e0c..02fdebc 100644
--- a/src/acpica/source/components/dispatcher/dsdebug.c
+++ b/src/acpica/source/components/dispatcher/dsdebug.c
@@ -247,6 +247,7 @@ AcpiDsDumpMethodStack (
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
"\n**** Exception %s during execution of method ",
AcpiFormatException (Status)));
+
AcpiDsPrintNodePathname (WalkState->MethodNode, NULL);
/* Display stack of executing methods */
@@ -263,8 +264,8 @@ AcpiDsDumpMethodStack (
if (MethodDesc)
{
AcpiExStopTraceMethod (
- (ACPI_NAMESPACE_NODE *) MethodDesc->Method.Node,
- MethodDesc, WalkState);
+ (ACPI_NAMESPACE_NODE *) MethodDesc->Method.Node,
+ MethodDesc, WalkState);
}
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
@@ -292,8 +293,8 @@ AcpiDsDumpMethodStack (
{
/*
* This method has called another method
- * NOTE: the method call parse subtree is already deleted at this
- * point, so we cannot disassemble the method invocation.
+ * NOTE: the method call parse subtree is already deleted at
+ * this point, so we cannot disassemble the method invocation.
*/
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_DISPATCH, "Call to method "));
AcpiDsPrintNodePathname (PreviousMethod, NULL);
diff --git a/src/acpica/source/components/dispatcher/dsfield.c b/src/acpica/source/components/dispatcher/dsfield.c
index cf8c189..b2d5cfd 100644
--- a/src/acpica/source/components/dispatcher/dsfield.c
+++ b/src/acpica/source/components/dispatcher/dsfield.c
@@ -187,6 +187,7 @@ AcpiDsCreateExternalRegion (
* insert the name into the namespace.
*/
AcpiDmAddOpToExternalList (Op, Path, ACPI_TYPE_REGION, 0, 0);
+
Status = AcpiNsLookup (WalkState->ScopeInfo, Path, ACPI_TYPE_REGION,
ACPI_IMODE_LOAD_PASS1, ACPI_NS_SEARCH_PARENT, WalkState, Node);
if (ACPI_FAILURE (Status))
@@ -282,7 +283,7 @@ AcpiDsCreateBufferField (
/* Creating new namespace node, should not already exist */
Flags = ACPI_NS_NO_UPSEARCH | ACPI_NS_DONT_OPEN_SCOPE |
- ACPI_NS_ERROR_IF_FOUND;
+ ACPI_NS_ERROR_IF_FOUND;
/*
* Mark node temporary if we are executing a normal control
@@ -296,9 +297,9 @@ AcpiDsCreateBufferField (
/* Enter the NameString into the namespace */
- Status = AcpiNsLookup (WalkState->ScopeInfo, Arg->Common.Value.String,
- ACPI_TYPE_ANY, ACPI_IMODE_LOAD_PASS1,
- Flags, WalkState, &Node);
+ Status = AcpiNsLookup (WalkState->ScopeInfo,
+ Arg->Common.Value.String, ACPI_TYPE_ANY,
+ ACPI_IMODE_LOAD_PASS1, Flags, WalkState, &Node);
if (ACPI_FAILURE (Status))
{
ACPI_ERROR_NAMESPACE (Arg->Common.Value.String, Status);
@@ -339,13 +340,13 @@ AcpiDsCreateBufferField (
}
/*
- * Remember location in AML stream of the field unit opcode and operands --
- * since the buffer and index operands must be evaluated.
+ * Remember location in AML stream of the field unit opcode and operands
+ * -- since the buffer and index operands must be evaluated.
*/
- SecondDesc = ObjDesc->Common.NextObject;
- SecondDesc->Extra.AmlStart = Op->Named.Data;
+ SecondDesc = ObjDesc->Common.NextObject;
+ SecondDesc->Extra.AmlStart = Op->Named.Data;
SecondDesc->Extra.AmlLength = Op->Named.Length;
- ObjDesc->BufferField.Node = Node;
+ ObjDesc->BufferField.Node = Node;
/* Attach constructed field descriptors to parent node */
@@ -413,8 +414,8 @@ AcpiDsGetFieldNames (
{
case AML_INT_RESERVEDFIELD_OP:
- Position = (UINT64) Info->FieldBitPosition
- + (UINT64) Arg->Common.Value.Size;
+ Position = (UINT64) Info->FieldBitPosition +
+ (UINT64) Arg->Common.Value.Size;
if (Position > ACPI_UINT32_MAX)
{
@@ -447,11 +448,13 @@ AcpiDsGetFieldNames (
/* AccessAttribute (AttribQuick, AttribByte, etc.) */
- Info->Attribute = (UINT8) ((Arg->Common.Value.Integer >> 8) & 0xFF);
+ Info->Attribute = (UINT8)
+ ((Arg->Common.Value.Integer >> 8) & 0xFF);
/* AccessLength (for serial/buffer protocols) */
- Info->AccessLength = (UINT8) ((Arg->Common.Value.Integer >> 16) & 0xFF);
+ Info->AccessLength = (UINT8)
+ ((Arg->Common.Value.Integer >> 16) & 0xFF);
break;
case AML_INT_CONNECTION_OP:
@@ -478,9 +481,9 @@ AcpiDsGetFieldNames (
/* Lookup the Connection() namepath, it should already exist */
Status = AcpiNsLookup (WalkState->ScopeInfo,
- Child->Common.Value.Name, ACPI_TYPE_ANY,
- ACPI_IMODE_EXECUTE, ACPI_NS_DONT_OPEN_SCOPE,
- WalkState, &Info->ConnectionNode);
+ Child->Common.Value.Name, ACPI_TYPE_ANY,
+ ACPI_IMODE_EXECUTE, ACPI_NS_DONT_OPEN_SCOPE,
+ WalkState, &Info->ConnectionNode);
if (ACPI_FAILURE (Status))
{
ACPI_ERROR_NAMESPACE (Child->Common.Value.Name, Status);
@@ -494,9 +497,9 @@ AcpiDsGetFieldNames (
/* Lookup the name, it should already exist */
Status = AcpiNsLookup (WalkState->ScopeInfo,
- (char *) &Arg->Named.Name, Info->FieldType,
- ACPI_IMODE_EXECUTE, ACPI_NS_DONT_OPEN_SCOPE,
- WalkState, &Info->FieldNode);
+ (char *) &Arg->Named.Name, Info->FieldType,
+ ACPI_IMODE_EXECUTE, ACPI_NS_DONT_OPEN_SCOPE,
+ WalkState, &Info->FieldNode);
if (ACPI_FAILURE (Status))
{
ACPI_ERROR_NAMESPACE ((char *) &Arg->Named.Name, Status);
@@ -525,8 +528,8 @@ AcpiDsGetFieldNames (
/* Keep track of bit position for the next field */
- Position = (UINT64) Info->FieldBitPosition
- + (UINT64) Arg->Common.Value.Size;
+ Position = (UINT64) Info->FieldBitPosition +
+ (UINT64) Arg->Common.Value.Size;
if (Position > ACPI_UINT32_MAX)
{
@@ -543,7 +546,8 @@ AcpiDsGetFieldNames (
default:
ACPI_ERROR ((AE_INFO,
- "Invalid opcode in field list: 0x%X", Arg->Common.AmlOpcode));
+ "Invalid opcode in field list: 0x%X",
+ Arg->Common.AmlOpcode));
return_ACPI_STATUS (AE_AML_BAD_OPCODE);
}
@@ -589,8 +593,8 @@ AcpiDsCreateField (
if (!RegionNode)
{
Status = AcpiNsLookup (WalkState->ScopeInfo, Arg->Common.Value.Name,
- ACPI_TYPE_REGION, ACPI_IMODE_EXECUTE,
- ACPI_NS_SEARCH_PARENT, WalkState, &RegionNode);
+ ACPI_TYPE_REGION, ACPI_IMODE_EXECUTE,
+ ACPI_NS_SEARCH_PARENT, WalkState, &RegionNode);
#ifdef ACPI_ASL_COMPILER
Status = AcpiDsCreateExternalRegion (Status, Arg,
Arg->Common.Value.Name, WalkState, &RegionNode);
@@ -696,7 +700,7 @@ AcpiDsInitFieldObjects (
/* Creating new namespace node(s), should not already exist */
Flags = ACPI_NS_NO_UPSEARCH | ACPI_NS_DONT_OPEN_SCOPE |
- ACPI_NS_ERROR_IF_FOUND;
+ ACPI_NS_ERROR_IF_FOUND;
/*
* Mark node(s) temporary if we are executing a normal control
@@ -721,8 +725,8 @@ AcpiDsInitFieldObjects (
if (Arg->Common.AmlOpcode == AML_INT_NAMEDFIELD_OP)
{
Status = AcpiNsLookup (WalkState->ScopeInfo,
- (char *) &Arg->Named.Name, Type, ACPI_IMODE_LOAD_PASS1,
- Flags, WalkState, &Node);
+ (char *) &Arg->Named.Name, Type, ACPI_IMODE_LOAD_PASS1,
+ Flags, WalkState, &Node);
if (ACPI_FAILURE (Status))
{
ACPI_ERROR_NAMESPACE ((char *) &Arg->Named.Name, Status);
@@ -782,8 +786,8 @@ AcpiDsCreateBankField (
if (!RegionNode)
{
Status = AcpiNsLookup (WalkState->ScopeInfo, Arg->Common.Value.Name,
- ACPI_TYPE_REGION, ACPI_IMODE_EXECUTE,
- ACPI_NS_SEARCH_PARENT, WalkState, &RegionNode);
+ ACPI_TYPE_REGION, ACPI_IMODE_EXECUTE,
+ ACPI_NS_SEARCH_PARENT, WalkState, &RegionNode);
#ifdef ACPI_ASL_COMPILER
Status = AcpiDsCreateExternalRegion (Status, Arg,
Arg->Common.Value.Name, WalkState, &RegionNode);
@@ -799,8 +803,8 @@ AcpiDsCreateBankField (
Arg = Arg->Common.Next;
Status = AcpiNsLookup (WalkState->ScopeInfo, Arg->Common.Value.String,
- ACPI_TYPE_ANY, ACPI_IMODE_EXECUTE,
- ACPI_NS_SEARCH_PARENT, WalkState, &Info.RegisterNode);
+ ACPI_TYPE_ANY, ACPI_IMODE_EXECUTE,
+ ACPI_NS_SEARCH_PARENT, WalkState, &Info.RegisterNode);
if (ACPI_FAILURE (Status))
{
ACPI_ERROR_NAMESPACE (Arg->Common.Value.String, Status);
@@ -826,11 +830,12 @@ AcpiDsCreateBankField (
/*
* Use Info.DataRegisterNode to store BankField Op
- * It's safe because DataRegisterNode will never be used when create bank field
- * We store AmlStart and AmlLength in the BankField Op for late evaluation
- * Used in AcpiExPrepFieldValue(Info)
+ * It's safe because DataRegisterNode will never be used when create
+ * bank field \we store AmlStart and AmlLength in the BankField Op for
+ * late evaluation. Used in AcpiExPrepFieldValue(Info)
*
- * TBD: Or, should we add a field in ACPI_CREATE_FIELD_INFO, like "void *ParentOp"?
+ * TBD: Or, should we add a field in ACPI_CREATE_FIELD_INFO, like
+ * "void *ParentOp"?
*/
Info.DataRegisterNode = (ACPI_NAMESPACE_NODE*) Op;
@@ -871,8 +876,8 @@ AcpiDsCreateIndexField (
Arg = Op->Common.Value.Arg;
Status = AcpiNsLookup (WalkState->ScopeInfo, Arg->Common.Value.String,
- ACPI_TYPE_ANY, ACPI_IMODE_EXECUTE,
- ACPI_NS_SEARCH_PARENT, WalkState, &Info.RegisterNode);
+ ACPI_TYPE_ANY, ACPI_IMODE_EXECUTE,
+ ACPI_NS_SEARCH_PARENT, WalkState, &Info.RegisterNode);
if (ACPI_FAILURE (Status))
{
ACPI_ERROR_NAMESPACE (Arg->Common.Value.String, Status);
@@ -883,8 +888,8 @@ AcpiDsCreateIndexField (
Arg = Arg->Common.Next;
Status = AcpiNsLookup (WalkState->ScopeInfo, Arg->Common.Value.String,
- ACPI_TYPE_ANY, ACPI_IMODE_EXECUTE,
- ACPI_NS_SEARCH_PARENT, WalkState, &Info.DataRegisterNode);
+ ACPI_TYPE_ANY, ACPI_IMODE_EXECUTE,
+ ACPI_NS_SEARCH_PARENT, WalkState, &Info.DataRegisterNode);
if (ACPI_FAILURE (Status))
{
ACPI_ERROR_NAMESPACE (Arg->Common.Value.String, Status);
diff --git a/src/acpica/source/components/dispatcher/dsinit.c b/src/acpica/source/components/dispatcher/dsinit.c
index d24cc01..4d30879 100644
--- a/src/acpica/source/components/dispatcher/dsinit.c
+++ b/src/acpica/source/components/dispatcher/dsinit.c
@@ -314,7 +314,7 @@ AcpiDsInitializeObjects (
* the namespace reader lock.
*/
Status = AcpiNsWalkNamespace (ACPI_TYPE_ANY, StartNode, ACPI_UINT32_MAX,
- ACPI_NS_WALK_UNLOCK, AcpiDsInitOneObject, NULL, &Info, NULL);
+ ACPI_NS_WALK_UNLOCK, AcpiDsInitOneObject, NULL, &Info, NULL);
if (ACPI_FAILURE (Status))
{
ACPI_EXCEPTION ((AE_INFO, Status, "During WalkNamespace"));
@@ -331,7 +331,8 @@ AcpiDsInitializeObjects (
if (ACPI_COMPARE_NAME (Table->Signature, ACPI_SIG_DSDT))
{
- ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INIT, "\nInitializing Namespace objects:\n"));
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INIT,
+ "\nInitializing Namespace objects:\n"));
}
/* Summary of objects initialized */
@@ -339,9 +340,10 @@ AcpiDsInitializeObjects (
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INIT,
"Table [%4.4s:%8.8s] (id %.2X) - %4u Objects with %3u Devices, "
"%3u Regions, %4u Methods (%u/%u/%u Serial/Non/Cvt)\n",
- Table->Signature, Table->OemTableId, OwnerId, Info.ObjectCount, Info.DeviceCount,
- Info.OpRegionCount, Info.MethodCount, Info.SerialMethodCount,
- Info.NonSerialMethodCount, Info.SerializedMethodCount));
+ Table->Signature, Table->OemTableId, OwnerId, Info.ObjectCount,
+ Info.DeviceCount,Info.OpRegionCount, Info.MethodCount,
+ Info.SerialMethodCount, Info.NonSerialMethodCount,
+ Info.SerializedMethodCount));
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "%u Methods, %u Regions\n",
Info.MethodCount, Info.OpRegionCount));
diff --git a/src/acpica/source/components/dispatcher/dsmethod.c b/src/acpica/source/components/dispatcher/dsmethod.c
index 10c3548..0436ee1 100644
--- a/src/acpica/source/components/dispatcher/dsmethod.c
+++ b/src/acpica/source/components/dispatcher/dsmethod.c
@@ -199,8 +199,8 @@ AcpiDsAutoSerializeMethod (
return_ACPI_STATUS (AE_NO_MEMORY);
}
- Status = AcpiDsInitAmlWalk (WalkState, Op, Node, ObjDesc->Method.AmlStart,
- ObjDesc->Method.AmlLength, NULL, 0);
+ Status = AcpiDsInitAmlWalk (WalkState, Op, Node,
+ ObjDesc->Method.AmlStart, ObjDesc->Method.AmlLength, NULL, 0);
if (ACPI_FAILURE (Status))
{
AcpiDsDeleteWalkState (WalkState);
@@ -323,12 +323,12 @@ AcpiDsMethodError (
* AE_OK, in which case the executing method will not be aborted.
*/
AmlOffset = (UINT32) ACPI_PTR_DIFF (WalkState->Aml,
- WalkState->ParserState.AmlStart);
+ WalkState->ParserState.AmlStart);
Status = AcpiGbl_ExceptionHandler (Status,
- WalkState->MethodNode ?
- WalkState->MethodNode->Name.Integer : 0,
- WalkState->Opcode, AmlOffset, NULL);
+ WalkState->MethodNode ?
+ WalkState->MethodNode->Name.Integer : 0,
+ WalkState->Opcode, AmlOffset, NULL);
AcpiExEnterInterpreter ();
}
@@ -472,10 +472,12 @@ AcpiDsBeginMethodExecution (
*/
if (WalkState &&
(!(ObjDesc->Method.InfoFlags & ACPI_METHOD_IGNORE_SYNC_LEVEL)) &&
- (WalkState->Thread->CurrentSyncLevel > ObjDesc->Method.Mutex->Mutex.SyncLevel))
+ (WalkState->Thread->CurrentSyncLevel >
+ ObjDesc->Method.Mutex->Mutex.SyncLevel))
{
ACPI_ERROR ((AE_INFO,
- "Cannot acquire Mutex for method [%4.4s], current SyncLevel is too large (%u)",
+ "Cannot acquire Mutex for method [%4.4s]"
+ ", current SyncLevel is too large (%u)",
AcpiUtGetNodeName (MethodNode),
WalkState->Thread->CurrentSyncLevel));
@@ -488,14 +490,15 @@ AcpiDsBeginMethodExecution (
*/
if (!WalkState ||
!ObjDesc->Method.Mutex->Mutex.ThreadId ||
- (WalkState->Thread->ThreadId != ObjDesc->Method.Mutex->Mutex.ThreadId))
+ (WalkState->Thread->ThreadId !=
+ ObjDesc->Method.Mutex->Mutex.ThreadId))
{
/*
* Acquire the method mutex. This releases the interpreter if we
* block (and reacquires it before it returns)
*/
- Status = AcpiExSystemWaitMutex (ObjDesc->Method.Mutex->Mutex.OsMutex,
- ACPI_WAIT_FOREVER);
+ Status = AcpiExSystemWaitMutex (
+ ObjDesc->Method.Mutex->Mutex.OsMutex, ACPI_WAIT_FOREVER);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
@@ -508,8 +511,22 @@ AcpiDsBeginMethodExecution (
ObjDesc->Method.Mutex->Mutex.OriginalSyncLevel =
WalkState->Thread->CurrentSyncLevel;
- ObjDesc->Method.Mutex->Mutex.ThreadId = WalkState->Thread->ThreadId;
- WalkState->Thread->CurrentSyncLevel = ObjDesc->Method.SyncLevel;
+ ObjDesc->Method.Mutex->Mutex.ThreadId =
+ WalkState->Thread->ThreadId;
+
+ /*
+ * Update the current SyncLevel only if this is not an auto-
+ * serialized method. In the auto case, we have to ignore
+ * the sync level for the method mutex (created for the
+ * auto-serialization) because we have no idea of what the
+ * sync level should be. Therefore, just ignore it.
+ */
+ if (!(ObjDesc->Method.InfoFlags &
+ ACPI_METHOD_IGNORE_SYNC_LEVEL))
+ {
+ WalkState->Thread->CurrentSyncLevel =
+ ObjDesc->Method.SyncLevel;
+ }
}
else
{
@@ -587,7 +604,8 @@ AcpiDsCallControlMethod (
ACPI_FUNCTION_TRACE_PTR (DsCallControlMethod, ThisWalkState);
- ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "Calling method %p, currentstate=%p\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
+ "Calling method %p, currentstate=%p\n",
ThisWalkState->PrevOp, ThisWalkState));
/*
@@ -607,8 +625,8 @@ AcpiDsCallControlMethod (
/* Init for new method, possibly wait on method mutex */
- Status = AcpiDsBeginMethodExecution (MethodNode, ObjDesc,
- ThisWalkState);
+ Status = AcpiDsBeginMethodExecution (
+ MethodNode, ObjDesc, ThisWalkState);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
@@ -616,8 +634,8 @@ AcpiDsCallControlMethod (
/* Begin method parse/execution. Create a new walk state */
- NextWalkState = AcpiDsCreateWalkState (ObjDesc->Method.OwnerId,
- NULL, ObjDesc, Thread);
+ NextWalkState = AcpiDsCreateWalkState (
+ ObjDesc->Method.OwnerId, NULL, ObjDesc, Thread);
if (!NextWalkState)
{
Status = AE_NO_MEMORY;
@@ -646,8 +664,8 @@ AcpiDsCallControlMethod (
Info->Parameters = &ThisWalkState->Operands[0];
Status = AcpiDsInitAmlWalk (NextWalkState, NULL, MethodNode,
- ObjDesc->Method.AmlStart, ObjDesc->Method.AmlLength,
- Info, ACPI_IMODE_EXECUTE);
+ ObjDesc->Method.AmlStart, ObjDesc->Method.AmlLength,
+ Info, ACPI_IMODE_EXECUTE);
ACPI_FREE (Info);
if (ACPI_FAILURE (Status))
@@ -842,7 +860,8 @@ AcpiDsTerminateControlMethod (
WalkState->Thread->CurrentSyncLevel =
MethodDesc->Method.Mutex->Mutex.OriginalSyncLevel;
- AcpiOsReleaseMutex (MethodDesc->Method.Mutex->Mutex.OsMutex);
+ AcpiOsReleaseMutex (
+ MethodDesc->Method.Mutex->Mutex.OsMutex);
MethodDesc->Method.Mutex->Mutex.ThreadId = 0;
}
}
@@ -872,7 +891,8 @@ AcpiDsTerminateControlMethod (
if (MethodDesc->Method.InfoFlags & ACPI_METHOD_MODIFIED_NAMESPACE)
{
AcpiNsDeleteNamespaceByOwner (MethodDesc->Method.OwnerId);
- MethodDesc->Method.InfoFlags &= ~ACPI_METHOD_MODIFIED_NAMESPACE;
+ MethodDesc->Method.InfoFlags &=
+ ~ACPI_METHOD_MODIFIED_NAMESPACE;
}
}
}
@@ -920,7 +940,8 @@ AcpiDsTerminateControlMethod (
if (WalkState)
{
ACPI_INFO ((AE_INFO,
- "Marking method %4.4s as Serialized because of AE_ALREADY_EXISTS error",
+ "Marking method %4.4s as Serialized "
+ "because of AE_ALREADY_EXISTS error",
WalkState->MethodNode->Name.Ascii));
}
@@ -935,7 +956,9 @@ AcpiDsTerminateControlMethod (
* marking the method permanently as Serialized when the last
* thread exits here.
*/
- MethodDesc->Method.InfoFlags &= ~ACPI_METHOD_SERIALIZED_PENDING;
+ MethodDesc->Method.InfoFlags &=
+ ~ACPI_METHOD_SERIALIZED_PENDING;
+
MethodDesc->Method.InfoFlags |=
(ACPI_METHOD_SERIALIZED | ACPI_METHOD_IGNORE_SYNC_LEVEL);
MethodDesc->Method.SyncLevel = 0;
@@ -950,7 +973,7 @@ AcpiDsTerminateControlMethod (
}
AcpiExStopTraceMethod ((ACPI_NAMESPACE_NODE *) MethodDesc->Method.Node,
- MethodDesc, WalkState);
+ MethodDesc, WalkState);
return_VOID;
}
diff --git a/src/acpica/source/components/dispatcher/dsmthdat.c b/src/acpica/source/components/dispatcher/dsmthdat.c
index 2b7fce2..04892a6 100644
--- a/src/acpica/source/components/dispatcher/dsmthdat.c
+++ b/src/acpica/source/components/dispatcher/dsmthdat.c
@@ -182,7 +182,9 @@ AcpiDsMethodDataInit (
for (i = 0; i < ACPI_METHOD_NUM_ARGS; i++)
{
- ACPI_MOVE_32_TO_32 (&WalkState->Arguments[i].Name, NAMEOF_ARG_NTE);
+ ACPI_MOVE_32_TO_32 (&WalkState->Arguments[i].Name,
+ NAMEOF_ARG_NTE);
+
WalkState->Arguments[i].Name.Integer |= (i << 24);
WalkState->Arguments[i].DescriptorType = ACPI_DESC_TYPE_NAMED;
WalkState->Arguments[i].Type = ACPI_TYPE_ANY;
@@ -193,7 +195,8 @@ AcpiDsMethodDataInit (
for (i = 0; i < ACPI_METHOD_NUM_LOCALS; i++)
{
- ACPI_MOVE_32_TO_32 (&WalkState->LocalVariables[i].Name, NAMEOF_LOCAL_NTE);
+ ACPI_MOVE_32_TO_32 (&WalkState->LocalVariables[i].Name,
+ NAMEOF_LOCAL_NTE);
WalkState->LocalVariables[i].Name.Integer |= (i << 24);
WalkState->LocalVariables[i].DescriptorType = ACPI_DESC_TYPE_NAMED;
@@ -235,7 +238,7 @@ AcpiDsMethodDataDeleteAll (
if (WalkState->LocalVariables[Index].Object)
{
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Deleting Local%u=%p\n",
- Index, WalkState->LocalVariables[Index].Object));
+ Index, WalkState->LocalVariables[Index].Object));
/* Detach object (if present) and remove a reference */
@@ -250,7 +253,7 @@ AcpiDsMethodDataDeleteAll (
if (WalkState->Arguments[Index].Object)
{
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Deleting Arg%u=%p\n",
- Index, WalkState->Arguments[Index].Object));
+ Index, WalkState->Arguments[Index].Object));
/* Detach object (if present) and remove a reference */
@@ -293,7 +296,8 @@ AcpiDsMethodDataInitArgs (
if (!Params)
{
- ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "No param list passed to method\n"));
+ ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
+ "No parameter list passed to method\n"));
return_ACPI_STATUS (AE_OK);
}
@@ -308,8 +312,8 @@ AcpiDsMethodDataInitArgs (
* Store the argument in the method/walk descriptor.
* Do not copy the arg in order to implement call by reference
*/
- Status = AcpiDsMethodDataSetValue (ACPI_REFCLASS_ARG, Index,
- Params[Index], WalkState);
+ Status = AcpiDsMethodDataSetValue (
+ ACPI_REFCLASS_ARG, Index, Params[Index], WalkState);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
@@ -699,7 +703,8 @@ AcpiDsStoreObjectToLocal (
NewObjDesc = ObjDesc;
if (ObjDesc->Common.ReferenceCount > 1)
{
- Status = AcpiUtCopyIobjectToIobject (ObjDesc, &NewObjDesc, WalkState);
+ Status = AcpiUtCopyIobjectToIobject (
+ ObjDesc, &NewObjDesc, WalkState);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
@@ -736,13 +741,16 @@ AcpiDsStoreObjectToLocal (
* If we have a valid reference object that came from RefOf(),
* do the indirect store
*/
- if ((ACPI_GET_DESCRIPTOR_TYPE (CurrentObjDesc) == ACPI_DESC_TYPE_OPERAND) &&
- (CurrentObjDesc->Common.Type == ACPI_TYPE_LOCAL_REFERENCE) &&
- (CurrentObjDesc->Reference.Class == ACPI_REFCLASS_REFOF))
+ if ((ACPI_GET_DESCRIPTOR_TYPE (CurrentObjDesc) ==
+ ACPI_DESC_TYPE_OPERAND) &&
+ (CurrentObjDesc->Common.Type ==
+ ACPI_TYPE_LOCAL_REFERENCE) &&
+ (CurrentObjDesc->Reference.Class ==
+ ACPI_REFCLASS_REFOF))
{
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
- "Arg (%p) is an ObjRef(Node), storing in node %p\n",
- NewObjDesc, CurrentObjDesc));
+ "Arg (%p) is an ObjRef(Node), storing in node %p\n",
+ NewObjDesc, CurrentObjDesc));
/*
* Store this object to the Node (perform the indirect store)
@@ -750,8 +758,8 @@ AcpiDsStoreObjectToLocal (
* specification rules on storing to Locals/Args.
*/
Status = AcpiExStoreObjectToNode (NewObjDesc,
- CurrentObjDesc->Reference.Object, WalkState,
- ACPI_NO_IMPLICIT_CONVERSION);
+ CurrentObjDesc->Reference.Object, WalkState,
+ ACPI_NO_IMPLICIT_CONVERSION);
/* Remove local reference if we copied the object above */
@@ -759,6 +767,7 @@ AcpiDsStoreObjectToLocal (
{
AcpiUtRemoveReference (NewObjDesc);
}
+
return_ACPI_STATUS (Status);
}
}
diff --git a/src/acpica/source/components/dispatcher/dsobject.c b/src/acpica/source/components/dispatcher/dsobject.c
index 0eb2f44..d448aaf 100644
--- a/src/acpica/source/components/dispatcher/dsobject.c
+++ b/src/acpica/source/components/dispatcher/dsobject.c
@@ -174,10 +174,10 @@ AcpiDsBuildInternalObject (
if (!Op->Common.Node)
{
Status = AcpiNsLookup (WalkState->ScopeInfo,
- Op->Common.Value.String,
- ACPI_TYPE_ANY, ACPI_IMODE_EXECUTE,
- ACPI_NS_SEARCH_PARENT | ACPI_NS_DONT_OPEN_SCOPE, NULL,
- ACPI_CAST_INDIRECT_PTR (ACPI_NAMESPACE_NODE, &(Op->Common.Node)));
+ Op->Common.Value.String,
+ ACPI_TYPE_ANY, ACPI_IMODE_EXECUTE,
+ ACPI_NS_SEARCH_PARENT | ACPI_NS_DONT_OPEN_SCOPE, NULL,
+ ACPI_CAST_INDIRECT_PTR (ACPI_NAMESPACE_NODE, &(Op->Common.Node)));
if (ACPI_FAILURE (Status))
{
/* Check if we are resolving a named reference within a package */
@@ -233,8 +233,8 @@ AcpiDsBuildInternalObject (
ObjDesc = ACPI_CAST_PTR (ACPI_OPERAND_OBJECT, Op->Common.Node);
Status = AcpiExResolveNodeToValue (
- ACPI_CAST_INDIRECT_PTR (ACPI_NAMESPACE_NODE, &ObjDesc),
- WalkState);
+ ACPI_CAST_INDIRECT_PTR (ACPI_NAMESPACE_NODE, &ObjDesc),
+ WalkState);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
@@ -294,14 +294,14 @@ AcpiDsBuildInternalObject (
/* Create and init a new internal ACPI object */
ObjDesc = AcpiUtCreateInternalObject (
- (AcpiPsGetOpcodeInfo (Op->Common.AmlOpcode))->ObjectType);
+ (AcpiPsGetOpcodeInfo (Op->Common.AmlOpcode))->ObjectType);
if (!ObjDesc)
{
return_ACPI_STATUS (AE_NO_MEMORY);
}
- Status = AcpiDsInitObjectFromOp (WalkState, Op, Op->Common.AmlOpcode,
- &ObjDesc);
+ Status = AcpiDsInitObjectFromOp (
+ WalkState, Op, Op->Common.AmlOpcode, &ObjDesc);
if (ACPI_FAILURE (Status))
{
AcpiUtRemoveReference (ObjDesc);
@@ -408,8 +408,8 @@ AcpiDsBuildInternalBufferObj (
}
else
{
- ObjDesc->Buffer.Pointer = ACPI_ALLOCATE_ZEROED (
- ObjDesc->Buffer.Length);
+ ObjDesc->Buffer.Pointer =
+ ACPI_ALLOCATE_ZEROED (ObjDesc->Buffer.Length);
if (!ObjDesc->Buffer.Pointer)
{
AcpiUtDeleteObjectDesc (ObjDesc);
@@ -421,7 +421,7 @@ AcpiDsBuildInternalBufferObj (
if (ByteList)
{
memcpy (ObjDesc->Buffer.Pointer, ByteList->Named.Data,
- ByteListLength);
+ ByteListLength);
}
}
@@ -540,8 +540,8 @@ AcpiDsBuildInternalPackageObj (
* invocation, so we special case it here
*/
Arg->Common.AmlOpcode = AML_INT_NAMEPATH_OP;
- Status = AcpiDsBuildInternalObject (WalkState, Arg,
- &ObjDesc->Package.Elements[i]);
+ Status = AcpiDsBuildInternalObject (
+ WalkState, Arg, &ObjDesc->Package.Elements[i]);
}
else
{
@@ -553,8 +553,8 @@ AcpiDsBuildInternalPackageObj (
}
else
{
- Status = AcpiDsBuildInternalObject (WalkState, Arg,
- &ObjDesc->Package.Elements[i]);
+ Status = AcpiDsBuildInternalObject (
+ WalkState, Arg, &ObjDesc->Package.Elements[i]);
}
if (*ObjDescPtr)
@@ -611,7 +611,8 @@ AcpiDsBuildInternalPackageObj (
}
ACPI_INFO ((AE_INFO,
- "Actual Package length (%u) is larger than NumElements field (%u), truncated",
+ "Actual Package length (%u) is larger than "
+ "NumElements field (%u), truncated",
i, ElementCount));
}
else if (i < ElementCount)
@@ -621,7 +622,8 @@ AcpiDsBuildInternalPackageObj (
* Note: this is not an error, the package is padded out with NULLs.
*/
ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
- "Package List length (%u) smaller than NumElements count (%u), padded with null elements\n",
+ "Package List length (%u) smaller than NumElements "
+ "count (%u), padded with null elements\n",
i, ElementCount));
}
@@ -677,8 +679,8 @@ AcpiDsCreateNode (
/* Build an internal object for the argument(s) */
- Status = AcpiDsBuildInternalObject (WalkState, Op->Common.Value.Arg,
- &ObjDesc);
+ Status = AcpiDsBuildInternalObject (
+ WalkState, Op->Common.Value.Arg, &ObjDesc);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
@@ -750,9 +752,9 @@ AcpiDsInitObjectFromOp (
/*
* Defer evaluation of Buffer TermArg operand
*/
- ObjDesc->Buffer.Node = ACPI_CAST_PTR (ACPI_NAMESPACE_NODE,
- WalkState->Operands[0]);
- ObjDesc->Buffer.AmlStart = Op->Named.Data;
+ ObjDesc->Buffer.Node = ACPI_CAST_PTR (
+ ACPI_NAMESPACE_NODE, WalkState->Operands[0]);
+ ObjDesc->Buffer.AmlStart = Op->Named.Data;
ObjDesc->Buffer.AmlLength = Op->Named.Length;
break;
@@ -760,9 +762,9 @@ AcpiDsInitObjectFromOp (
/*
* Defer evaluation of Package TermArg operand
*/
- ObjDesc->Package.Node = ACPI_CAST_PTR (ACPI_NAMESPACE_NODE,
- WalkState->Operands[0]);
- ObjDesc->Package.AmlStart = Op->Named.Data;
+ ObjDesc->Package.Node = ACPI_CAST_PTR (
+ ACPI_NAMESPACE_NODE, WalkState->Operands[0]);
+ ObjDesc->Package.AmlStart = Op->Named.Data;
ObjDesc->Package.AmlLength = Op->Named.Length;
break;
@@ -872,9 +874,9 @@ AcpiDsInitObjectFromOp (
#ifndef ACPI_NO_METHOD_EXECUTION
Status = AcpiDsMethodDataGetNode (ACPI_REFCLASS_LOCAL,
- ObjDesc->Reference.Value, WalkState,
- ACPI_CAST_INDIRECT_PTR (ACPI_NAMESPACE_NODE,
- &ObjDesc->Reference.Object));
+ ObjDesc->Reference.Value, WalkState,
+ ACPI_CAST_INDIRECT_PTR (ACPI_NAMESPACE_NODE,
+ &ObjDesc->Reference.Object));
#endif
break;
@@ -887,9 +889,9 @@ AcpiDsInitObjectFromOp (
#ifndef ACPI_NO_METHOD_EXECUTION
Status = AcpiDsMethodDataGetNode (ACPI_REFCLASS_ARG,
- ObjDesc->Reference.Value, WalkState,
- ACPI_CAST_INDIRECT_PTR (ACPI_NAMESPACE_NODE,
- &ObjDesc->Reference.Object));
+ ObjDesc->Reference.Value, WalkState,
+ ACPI_CAST_INDIRECT_PTR (ACPI_NAMESPACE_NODE,
+ &ObjDesc->Reference.Object));
#endif
break;
diff --git a/src/acpica/source/components/dispatcher/dsopcode.c b/src/acpica/source/components/dispatcher/dsopcode.c
index 6e2c784..45a7e7a 100644
--- a/src/acpica/source/components/dispatcher/dsopcode.c
+++ b/src/acpica/source/components/dispatcher/dsopcode.c
@@ -331,8 +331,8 @@ AcpiDsInitBufferField (
* For FieldFlags, use LOCK_RULE = 0 (NO_LOCK),
* UPDATE_RULE = 0 (UPDATE_PRESERVE)
*/
- Status = AcpiExPrepCommonFieldObject (ObjDesc, FieldFlags, 0,
- BitOffset, BitCount);
+ Status = AcpiExPrepCommonFieldObject (
+ ObjDesc, FieldFlags, 0, BitOffset, BitCount);
if (ACPI_FAILURE (Status))
{
goto Cleanup;
@@ -429,8 +429,8 @@ AcpiDsEvalBufferFieldOperands (
/* Resolve the operands */
- Status = AcpiExResolveOperands (Op->Common.AmlOpcode,
- ACPI_WALK_OPERANDS, WalkState);
+ Status = AcpiExResolveOperands (
+ Op->Common.AmlOpcode, ACPI_WALK_OPERANDS, WalkState);
if (ACPI_FAILURE (Status))
{
ACPI_ERROR ((AE_INFO, "(%s) bad operand(s), status 0x%X",
@@ -446,16 +446,16 @@ AcpiDsEvalBufferFieldOperands (
/* NOTE: Slightly different operands for this opcode */
Status = AcpiDsInitBufferField (Op->Common.AmlOpcode, ObjDesc,
- WalkState->Operands[0], WalkState->Operands[1],
- WalkState->Operands[2], WalkState->Operands[3]);
+ WalkState->Operands[0], WalkState->Operands[1],
+ WalkState->Operands[2], WalkState->Operands[3]);
}
else
{
/* All other, CreateXxxField opcodes */
Status = AcpiDsInitBufferField (Op->Common.AmlOpcode, ObjDesc,
- WalkState->Operands[0], WalkState->Operands[1],
- NULL, WalkState->Operands[2]);
+ WalkState->Operands[0], WalkState->Operands[1],
+ NULL, WalkState->Operands[2]);
}
return_ACPI_STATUS (Status);
@@ -515,8 +515,8 @@ AcpiDsEvalRegionOperands (
/* Resolve the length and address operands to numbers */
- Status = AcpiExResolveOperands (Op->Common.AmlOpcode,
- ACPI_WALK_OPERANDS, WalkState);
+ Status = AcpiExResolveOperands (
+ Op->Common.AmlOpcode, ACPI_WALK_OPERANDS, WalkState);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
@@ -544,18 +544,16 @@ AcpiDsEvalRegionOperands (
OperandDesc = WalkState->Operands[WalkState->NumOperands - 2];
ObjDesc->Region.Address = (ACPI_PHYSICAL_ADDRESS)
- OperandDesc->Integer.Value;
+ OperandDesc->Integer.Value;
AcpiUtRemoveReference (OperandDesc);
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "RgnObj %p Addr %8.8X%8.8X Len %X\n",
- ObjDesc,
- ACPI_FORMAT_UINT64 (ObjDesc->Region.Address),
+ ObjDesc, ACPI_FORMAT_UINT64 (ObjDesc->Region.Address),
ObjDesc->Region.Length));
/* Now the address and length are valid for this opregion */
ObjDesc->Region.Flags |= AOPOBJ_DATA_VALID;
-
return_ACPI_STATUS (Status);
}
@@ -618,8 +616,8 @@ AcpiDsEvalTableRegionOperands (
* Resolve the Signature string, OemId string,
* and OemTableId string operands
*/
- Status = AcpiExResolveOperands (Op->Common.AmlOpcode,
- ACPI_WALK_OPERANDS, WalkState);
+ Status = AcpiExResolveOperands (
+ Op->Common.AmlOpcode, ACPI_WALK_OPERANDS, WalkState);
if (ACPI_FAILURE (Status))
{
goto Cleanup;
@@ -628,9 +626,9 @@ AcpiDsEvalTableRegionOperands (
/* Find the ACPI table */
Status = AcpiTbFindTable (
- Operand[0]->String.Pointer,
- Operand[1]->String.Pointer,
- Operand[2]->String.Pointer, &TableIndex);
+ Operand[0]->String.Pointer,
+ Operand[1]->String.Pointer,
+ Operand[2]->String.Pointer, &TableIndex);
if (ACPI_FAILURE (Status))
{
if (Status == AE_NOT_FOUND)
@@ -721,8 +719,8 @@ AcpiDsEvalDataObjectOperands (
}
Status = AcpiExResolveOperands (WalkState->Opcode,
- &(WalkState->Operands [WalkState->NumOperands -1]),
- WalkState);
+ &(WalkState->Operands [WalkState->NumOperands -1]),
+ WalkState);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
@@ -750,13 +748,15 @@ AcpiDsEvalDataObjectOperands (
{
case AML_BUFFER_OP:
- Status = AcpiDsBuildInternalBufferObj (WalkState, Op, Length, &ObjDesc);
+ Status = AcpiDsBuildInternalBufferObj (
+ WalkState, Op, Length, &ObjDesc);
break;
case AML_PACKAGE_OP:
case AML_VAR_PACKAGE_OP:
- Status = AcpiDsBuildInternalPackageObj (WalkState, Op, Length, &ObjDesc);
+ Status = AcpiDsBuildInternalPackageObj (
+ WalkState, Op, Length, &ObjDesc);
break;
default:
diff --git a/src/acpica/source/components/dispatcher/dsutils.c b/src/acpica/source/components/dispatcher/dsutils.c
index 0ba26fa..35611d7 100644
--- a/src/acpica/source/components/dispatcher/dsutils.c
+++ b/src/acpica/source/components/dispatcher/dsutils.c
@@ -212,9 +212,9 @@ AcpiDsDoImplicitReturn (
}
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
- "Result %p will be implicitly returned; Prev=%p\n",
- ReturnDesc,
- WalkState->ImplicitReturnObj));
+ "Result %p will be implicitly returned; Prev=%p\n",
+ ReturnDesc,
+ WalkState->ImplicitReturnObj));
/*
* Delete any "stale" implicit return value first. However, in
@@ -338,7 +338,8 @@ AcpiDsIsResultUsed (
* If we are executing the predicate AND this is the predicate op,
* we will use the return value
*/
- if ((WalkState->ControlState->Common.State == ACPI_CONTROL_PREDICATE_EXECUTING) &&
+ if ((WalkState->ControlState->Common.State ==
+ ACPI_CONTROL_PREDICATE_EXECUTING) &&
(WalkState->ControlState->Control.PredicateOp == Op))
{
goto ResultUsed;
@@ -595,8 +596,8 @@ AcpiDsCreateOperand (
/* Get the entire name string from the AML stream */
- Status = AcpiExGetNameString (ACPI_TYPE_ANY, Arg->Common.Value.Buffer,
- &NameString, &NameLength);
+ Status = AcpiExGetNameString (ACPI_TYPE_ANY,
+ Arg->Common.Value.Buffer, &NameString, &NameLength);
if (ACPI_FAILURE (Status))
{
@@ -616,10 +617,11 @@ AcpiDsCreateOperand (
*/
if ((WalkState->DeferredNode) &&
(WalkState->DeferredNode->Type == ACPI_TYPE_BUFFER_FIELD) &&
- (ArgIndex == (UINT32) ((WalkState->Opcode == AML_CREATE_FIELD_OP) ? 3 : 2)))
+ (ArgIndex == (UINT32)
+ ((WalkState->Opcode == AML_CREATE_FIELD_OP) ? 3 : 2)))
{
ObjDesc = ACPI_CAST_PTR (
- ACPI_OPERAND_OBJECT, WalkState->DeferredNode);
+ ACPI_OPERAND_OBJECT, WalkState->DeferredNode);
Status = AE_OK;
}
else /* All other opcodes */
@@ -632,6 +634,7 @@ AcpiDsCreateOperand (
*/
ParentOp = Arg->Common.Parent;
OpInfo = AcpiPsGetOpcodeInfo (ParentOp->Common.AmlOpcode);
+
if ((OpInfo->Flags & AML_NSNODE) &&
(ParentOp->Common.AmlOpcode != AML_INT_METHODCALL_OP) &&
(ParentOp->Common.AmlOpcode != AML_REGION_OP) &&
@@ -649,10 +652,9 @@ AcpiDsCreateOperand (
}
Status = AcpiNsLookup (WalkState->ScopeInfo, NameString,
- ACPI_TYPE_ANY, InterpreterMode,
- ACPI_NS_SEARCH_PARENT | ACPI_NS_DONT_OPEN_SCOPE,
- WalkState,
- ACPI_CAST_INDIRECT_PTR (ACPI_NAMESPACE_NODE, &ObjDesc));
+ ACPI_TYPE_ANY, InterpreterMode,
+ ACPI_NS_SEARCH_PARENT | ACPI_NS_DONT_OPEN_SCOPE, WalkState,
+ ACPI_CAST_INDIRECT_PTR (ACPI_NAMESPACE_NODE, &ObjDesc));
/*
* The only case where we pass through (ignore) a NOT_FOUND
* error is for the CondRefOf opcode.
@@ -668,7 +670,7 @@ AcpiDsCreateOperand (
* object to the root
*/
ObjDesc = ACPI_CAST_PTR (
- ACPI_OPERAND_OBJECT, AcpiGbl_RootNode);
+ ACPI_OPERAND_OBJECT, AcpiGbl_RootNode);
Status = AE_OK;
}
else if (ParentOp->Common.AmlOpcode == AML_EXTERNAL_OP)
@@ -714,7 +716,8 @@ AcpiDsCreateOperand (
{
return_ACPI_STATUS (Status);
}
- ACPI_DEBUGGER_EXEC (AcpiDbDisplayArgumentObject (ObjDesc, WalkState));
+
+ AcpiDbDisplayArgumentObject (ObjDesc, WalkState);
}
else
{
@@ -747,13 +750,14 @@ AcpiDsCreateOperand (
return_ACPI_STATUS (AE_NOT_IMPLEMENTED);
}
- if ((OpInfo->Flags & AML_HAS_RETVAL) || (Arg->Common.Flags & ACPI_PARSEOP_IN_STACK))
+ if ((OpInfo->Flags & AML_HAS_RETVAL) ||
+ (Arg->Common.Flags & ACPI_PARSEOP_IN_STACK))
{
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
"Argument previously created, already stacked\n"));
- ACPI_DEBUGGER_EXEC (AcpiDbDisplayArgumentObject (
- WalkState->Operands [WalkState->NumOperands - 1], WalkState));
+ AcpiDbDisplayArgumentObject (
+ WalkState->Operands [WalkState->NumOperands - 1], WalkState);
/*
* Use value that was already previously returned
@@ -784,7 +788,7 @@ AcpiDsCreateOperand (
/* Initialize the new object */
Status = AcpiDsInitObjectFromOp (
- WalkState, Arg, Opcode, &ObjDesc);
+ WalkState, Arg, Opcode, &ObjDesc);
if (ACPI_FAILURE (Status))
{
AcpiUtDeleteObjectDesc (ObjDesc);
@@ -800,7 +804,7 @@ AcpiDsCreateOperand (
return_ACPI_STATUS (Status);
}
- ACPI_DEBUGGER_EXEC (AcpiDbDisplayArgumentObject (ObjDesc, WalkState));
+ AcpiDbDisplayArgumentObject (ObjDesc, WalkState);
}
return_ACPI_STATUS (AE_OK);
@@ -970,7 +974,8 @@ AcpiDsEvaluateNamePath (
AcpiUtRemoveReference (*Operand);
- Status = AcpiUtCopyIobjectToIobject (*Operand, &NewObjDesc, WalkState);
+ Status = AcpiUtCopyIobjectToIobject (
+ *Operand, &NewObjDesc, WalkState);
if (ACPI_FAILURE (Status))
{
goto Exit;
diff --git a/src/acpica/source/components/dispatcher/dswexec.c b/src/acpica/source/components/dispatcher/dswexec.c
index f650ced..4cdc53d 100644
--- a/src/acpica/source/components/dispatcher/dswexec.c
+++ b/src/acpica/source/components/dispatcher/dswexec.c
@@ -261,12 +261,13 @@ AcpiDsGetPredicateValue (
Cleanup:
- ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Completed a predicate eval=%X Op=%p\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
+ "Completed a predicate eval=%X Op=%p\n",
WalkState->ControlState->Common.Value, WalkState->Op));
- /* Break to debugger to display result */
+ /* Break to debugger to display result */
- ACPI_DEBUGGER_EXEC (AcpiDbDisplayResultObject (LocalObjDesc, WalkState));
+ AcpiDbDisplayResultObject (LocalObjDesc, WalkState);
/*
* Delete the predicate result object (we know that
@@ -358,10 +359,12 @@ AcpiDsExecBeginOp (
(WalkState->ControlState->Common.State ==
ACPI_CONTROL_CONDITIONAL_EXECUTING))
{
- ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Exec predicate Op=%p State=%p\n",
- Op, WalkState));
+ ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
+ "Exec predicate Op=%p State=%p\n",
+ Op, WalkState));
- WalkState->ControlState->Common.State = ACPI_CONTROL_PREDICATE_EXECUTING;
+ WalkState->ControlState->Common.State =
+ ACPI_CONTROL_PREDICATE_EXECUTING;
/* Save start of predicate */
@@ -409,8 +412,8 @@ AcpiDsExecBeginOp (
}
else
{
- Status = AcpiDsScopeStackPush (Op->Named.Node,
- Op->Named.Node->Type, WalkState);
+ Status = AcpiDsScopeStackPush (
+ Op->Named.Node, Op->Named.Node->Type, WalkState);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
@@ -469,8 +472,8 @@ AcpiDsExecEndOp (
ACPI_FUNCTION_TRACE_PTR (DsExecEndOp, WalkState);
- Op = WalkState->Op;
- OpType = WalkState->OpInfo->Type;
+ Op = WalkState->Op;
+ OpType = WalkState->OpInfo->Type;
OpClass = WalkState->OpInfo->Class;
if (OpClass == AML_CLASS_UNKNOWN)
@@ -490,8 +493,11 @@ AcpiDsExecEndOp (
/* Call debugger for single step support (DEBUG build only) */
- ACPI_DEBUGGER_EXEC (Status = AcpiDbSingleStep (WalkState, Op, OpClass));
- ACPI_DEBUGGER_EXEC (if (ACPI_FAILURE (Status)) {return_ACPI_STATUS (Status);});
+ Status = AcpiDbSingleStep (WalkState, Op, OpClass);
+ if (ACPI_FAILURE (Status))
+ {
+ return_ACPI_STATUS (Status);
+ }
/* Decode the Opcode Class */
@@ -528,8 +534,8 @@ AcpiDsExecEndOp (
/* Resolve all operands */
Status = AcpiExResolveOperands (WalkState->Opcode,
- &(WalkState->Operands [WalkState->NumOperands -1]),
- WalkState);
+ &(WalkState->Operands [WalkState->NumOperands -1]),
+ WalkState);
}
if (ACPI_SUCCESS (Status))
@@ -606,7 +612,8 @@ AcpiDsExecEndOp (
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
"Method Reference in a Package, Op=%p\n", Op));
- Op->Common.Node = (ACPI_NAMESPACE_NODE *) Op->Asl.Value.Arg->Asl.Node;
+ Op->Common.Node = (ACPI_NAMESPACE_NODE *)
+ Op->Asl.Value.Arg->Asl.Node;
AcpiUtAddReference (Op->Asl.Value.Arg->Asl.Node->Object);
return_ACPI_STATUS (AE_OK);
}
@@ -688,12 +695,12 @@ AcpiDsExecEndOp (
* Put the Node on the object stack (Contains the ACPI Name
* of this object)
*/
- WalkState->Operands[0] = (void *) Op->Common.Parent->Common.Node;
+ WalkState->Operands[0] = (void *)
+ Op->Common.Parent->Common.Node;
WalkState->NumOperands = 1;
Status = AcpiDsCreateNode (WalkState,
- Op->Common.Parent->Common.Node,
- Op->Common.Parent);
+ Op->Common.Parent->Common.Node, Op->Common.Parent);
if (ACPI_FAILURE (Status))
{
break;
@@ -705,7 +712,7 @@ AcpiDsExecEndOp (
case AML_INT_EVAL_SUBTREE_OP:
Status = AcpiDsEvalDataObjectOperands (WalkState, Op,
- AcpiNsGetAttachedObject (Op->Common.Parent->Common.Node));
+ AcpiNsGetAttachedObject (Op->Common.Parent->Common.Node));
break;
default:
@@ -786,7 +793,8 @@ AcpiDsExecEndOp (
default:
ACPI_ERROR ((AE_INFO,
- "Unimplemented opcode, class=0x%X type=0x%X Opcode=0x%X Op=%p",
+ "Unimplemented opcode, class=0x%X "
+ "type=0x%X Opcode=0x%X Op=%p",
OpClass, OpType, Op->Common.AmlOpcode, Op));
Status = AE_NOT_IMPLEMENTED;
@@ -821,8 +829,7 @@ Cleanup:
{
/* Break to debugger to display result */
- ACPI_DEBUGGER_EXEC (AcpiDbDisplayResultObject (WalkState->ResultObj,
- WalkState));
+ AcpiDbDisplayResultObject (WalkState->ResultObj,WalkState);
/*
* Delete the result op if and only if:
diff --git a/src/acpica/source/components/dispatcher/dswload.c b/src/acpica/source/components/dispatcher/dswload.c
index a984075..765102d 100644
--- a/src/acpica/source/components/dispatcher/dswload.c
+++ b/src/acpica/source/components/dispatcher/dswload.c
@@ -260,7 +260,8 @@ AcpiDsLoad1BeginOp (
ObjectType = WalkState->OpInfo->ObjectType;
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
- "State=%p Op=%p [%s]\n", WalkState, Op, AcpiUtGetTypeName (ObjectType)));
+ "State=%p Op=%p [%s]\n", WalkState, Op,
+ AcpiUtGetTypeName (ObjectType)));
switch (WalkState->Opcode)
{
@@ -271,7 +272,7 @@ AcpiDsLoad1BeginOp (
* Allow search-to-root for single namesegs.
*/
Status = AcpiNsLookup (WalkState->ScopeInfo, Path, ObjectType,
- ACPI_IMODE_EXECUTE, ACPI_NS_SEARCH_PARENT, WalkState, &(Node));
+ ACPI_IMODE_EXECUTE, ACPI_NS_SEARCH_PARENT, WalkState, &(Node));
#ifdef ACPI_ASL_COMPILER
if (Status == AE_NOT_FOUND)
{
@@ -282,8 +283,8 @@ AcpiDsLoad1BeginOp (
*/
AcpiDmAddOpToExternalList (Op, Path, ACPI_TYPE_DEVICE, 0, 0);
Status = AcpiNsLookup (WalkState->ScopeInfo, Path, ObjectType,
- ACPI_IMODE_LOAD_PASS1, ACPI_NS_SEARCH_PARENT,
- WalkState, &Node);
+ ACPI_IMODE_LOAD_PASS1, ACPI_NS_SEARCH_PARENT,
+ WalkState, &Node);
}
#endif
if (ACPI_FAILURE (Status))
@@ -401,20 +402,20 @@ AcpiDsLoad1BeginOp (
{
Flags |= ACPI_NS_OVERRIDE_IF_FOUND;
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "[%s] Override allowed\n",
- AcpiUtGetTypeName (ObjectType)));
+ AcpiUtGetTypeName (ObjectType)));
}
else
{
Flags |= ACPI_NS_ERROR_IF_FOUND;
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "[%s] Cannot already exist\n",
- AcpiUtGetTypeName (ObjectType)));
+ AcpiUtGetTypeName (ObjectType)));
}
}
else
{
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
"[%s] Both Find or Create allowed\n",
- AcpiUtGetTypeName (ObjectType)));
+ AcpiUtGetTypeName (ObjectType)));
}
/*
@@ -424,7 +425,7 @@ AcpiDsLoad1BeginOp (
* parse tree later.
*/
Status = AcpiNsLookup (WalkState->ScopeInfo, Path, ObjectType,
- ACPI_IMODE_LOAD_PASS1, Flags, WalkState, &Node);
+ ACPI_IMODE_LOAD_PASS1, Flags, WalkState, &Node);
if (ACPI_FAILURE (Status))
{
if (Status == AE_ALREADY_EXISTS)
@@ -444,7 +445,8 @@ AcpiDsLoad1BeginOp (
if (AcpiNsOpensScope (ObjectType))
{
- Status = AcpiDsScopeStackPush (Node, ObjectType, WalkState);
+ Status = AcpiDsScopeStackPush (
+ Node, ObjectType, WalkState);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
@@ -566,8 +568,9 @@ AcpiDsLoad1EndOp (
if (Op->Common.AmlOpcode == AML_REGION_OP)
{
Status = AcpiExCreateRegion (Op->Named.Data, Op->Named.Length,
- (ACPI_ADR_SPACE_TYPE) ((Op->Common.Value.Arg)->Common.Value.Integer),
- WalkState);
+ (ACPI_ADR_SPACE_TYPE)
+ ((Op->Common.Value.Arg)->Common.Value.Integer),
+ WalkState);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
@@ -576,7 +579,7 @@ AcpiDsLoad1EndOp (
else if (Op->Common.AmlOpcode == AML_DATA_REGION_OP)
{
Status = AcpiExCreateRegion (Op->Named.Data, Op->Named.Length,
- ACPI_ADR_SPACE_DATA_TABLE, WalkState);
+ ACPI_ADR_SPACE_DATA_TABLE, WalkState);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
@@ -628,11 +631,12 @@ AcpiDsLoad1EndOp (
WalkState->Operands[0] = ACPI_CAST_PTR (void, Op->Named.Node);
WalkState->NumOperands = 1;
- Status = AcpiDsCreateOperands (WalkState, Op->Common.Value.Arg);
+ Status = AcpiDsCreateOperands (
+ WalkState, Op->Common.Value.Arg);
if (ACPI_SUCCESS (Status))
{
Status = AcpiExCreateMethod (Op->Named.Data,
- Op->Named.Length, WalkState);
+ Op->Named.Length, WalkState);
}
WalkState->Operands[0] = NULL;
diff --git a/src/acpica/source/components/dispatcher/dswload2.c b/src/acpica/source/components/dispatcher/dswload2.c
index d5f9b1c..1a01a43 100644
--- a/src/acpica/source/components/dispatcher/dswload2.c
+++ b/src/acpica/source/components/dispatcher/dswload2.c
@@ -231,8 +231,8 @@ AcpiDsLoad2BeginOp (
* for use later.
*/
Status = AcpiNsLookup (WalkState->ScopeInfo, BufferPtr, ObjectType,
- ACPI_IMODE_EXECUTE, ACPI_NS_SEARCH_PARENT,
- WalkState, &(Node));
+ ACPI_IMODE_EXECUTE, ACPI_NS_SEARCH_PARENT,
+ WalkState, &(Node));
break;
case AML_SCOPE_OP:
@@ -257,8 +257,8 @@ AcpiDsLoad2BeginOp (
* for use later.
*/
Status = AcpiNsLookup (WalkState->ScopeInfo, BufferPtr, ObjectType,
- ACPI_IMODE_EXECUTE, ACPI_NS_SEARCH_PARENT,
- WalkState, &(Node));
+ ACPI_IMODE_EXECUTE, ACPI_NS_SEARCH_PARENT,
+ WalkState, &(Node));
if (ACPI_FAILURE (Status))
{
#ifdef ACPI_ASL_COMPILER
@@ -395,7 +395,7 @@ AcpiDsLoad2BeginOp (
/* Add new entry or lookup existing entry */
Status = AcpiNsLookup (WalkState->ScopeInfo, BufferPtr, ObjectType,
- ACPI_IMODE_LOAD_PASS2, Flags, WalkState, &Node);
+ ACPI_IMODE_LOAD_PASS2, Flags, WalkState, &Node);
if (ACPI_SUCCESS (Status) && (Flags & ACPI_NS_TEMPORARY))
{
@@ -473,7 +473,7 @@ AcpiDsLoad2EndOp (
Op = WalkState->Op;
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "Opcode [%s] Op %p State %p\n",
- WalkState->OpInfo->Name, Op, WalkState));
+ WalkState->OpInfo->Name, Op, WalkState));
/* Check if opcode had an associated namespace object */
@@ -579,8 +579,8 @@ AcpiDsLoad2EndOp (
{
case AML_INDEX_FIELD_OP:
- Status = AcpiDsCreateIndexField (Op, (ACPI_HANDLE) Arg->Common.Node,
- WalkState);
+ Status = AcpiDsCreateIndexField (
+ Op, (ACPI_HANDLE) Arg->Common.Node, WalkState);
break;
case AML_BANK_FIELD_OP:
@@ -665,7 +665,7 @@ AcpiDsLoad2EndOp (
if (Op->Common.AmlOpcode == AML_REGION_OP)
{
RegionSpace = (ACPI_ADR_SPACE_TYPE)
- ((Op->Common.Value.Arg)->Common.Value.Integer);
+ ((Op->Common.Value.Arg)->Common.Value.Integer);
}
else
{
@@ -690,8 +690,8 @@ AcpiDsLoad2EndOp (
* Executing a method: initialize the region and unlock
* the interpreter
*/
- Status = AcpiExCreateRegion (Op->Named.Data, Op->Named.Length,
- RegionSpace, WalkState);
+ Status = AcpiExCreateRegion (Op->Named.Data,
+ Op->Named.Length, RegionSpace, WalkState);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
@@ -700,8 +700,8 @@ AcpiDsLoad2EndOp (
AcpiExExitInterpreter ();
}
- Status = AcpiEvInitializeRegion (AcpiNsGetAttachedObject (Node),
- FALSE);
+ Status = AcpiEvInitializeRegion (
+ AcpiNsGetAttachedObject (Node), FALSE);
if (WalkState->MethodNode)
{
AcpiExEnterInterpreter ();
@@ -744,12 +744,14 @@ AcpiDsLoad2EndOp (
WalkState->Operands[0] = ACPI_CAST_PTR (void, Op->Named.Node);
WalkState->NumOperands = 1;
- Status = AcpiDsCreateOperands (WalkState, Op->Common.Value.Arg);
+ Status = AcpiDsCreateOperands (
+ WalkState, Op->Common.Value.Arg);
if (ACPI_SUCCESS (Status))
{
- Status = AcpiExCreateMethod (Op->Named.Data,
- Op->Named.Length, WalkState);
+ Status = AcpiExCreateMethod (
+ Op->Named.Data, Op->Named.Length, WalkState);
}
+
WalkState->Operands[0] = NULL;
WalkState->NumOperands = 0;
@@ -784,9 +786,9 @@ AcpiDsLoad2EndOp (
* Lookup the method name and save the Node
*/
Status = AcpiNsLookup (WalkState->ScopeInfo, Arg->Common.Value.String,
- ACPI_TYPE_ANY, ACPI_IMODE_LOAD_PASS2,
- ACPI_NS_SEARCH_PARENT | ACPI_NS_DONT_OPEN_SCOPE,
- WalkState, &(NewNode));
+ ACPI_TYPE_ANY, ACPI_IMODE_LOAD_PASS2,
+ ACPI_NS_SEARCH_PARENT | ACPI_NS_DONT_OPEN_SCOPE,
+ WalkState, &(NewNode));
if (ACPI_SUCCESS (Status))
{
/*
diff --git a/src/acpica/source/components/dispatcher/dswscope.c b/src/acpica/source/components/dispatcher/dswscope.c
index 9865dcd..1ce2ed9 100644
--- a/src/acpica/source/components/dispatcher/dswscope.c
+++ b/src/acpica/source/components/dispatcher/dswscope.c
@@ -154,6 +154,7 @@ AcpiDsScopeStackClear (
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
"Popped object type (%s)\n",
AcpiUtGetTypeName (ScopeInfo->Common.Value)));
+
AcpiUtDeleteGenericState (ScopeInfo);
}
}
diff --git a/src/acpica/source/components/dispatcher/dswstate.c b/src/acpica/source/components/dispatcher/dswstate.c
index e5ea508..faf6a2b 100644
--- a/src/acpica/source/components/dispatcher/dswstate.c
+++ b/src/acpica/source/components/dispatcher/dswstate.c
@@ -371,8 +371,8 @@ AcpiDsResultStackPop (
if (WalkState->Results == NULL)
{
- ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Result stack underflow - State=%p\n",
- WalkState));
+ ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
+ "Result stack underflow - State=%p\n", WalkState));
return (AE_AML_NO_OPERAND);
}
@@ -779,7 +779,8 @@ AcpiDsInitAmlWalk (
/* Push start scope on scope stack and make it current */
- Status = AcpiDsScopeStackPush (MethodNode, ACPI_TYPE_METHOD, WalkState);
+ Status = AcpiDsScopeStackPush (
+ MethodNode, ACPI_TYPE_METHOD, WalkState);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
@@ -822,7 +823,7 @@ AcpiDsInitAmlWalk (
/* Push start scope on scope stack and make it current */
Status = AcpiDsScopeStackPush (ParserState->StartNode,
- ParserState->StartNode->Type, WalkState);
+ ParserState->StartNode->Type, WalkState);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
diff --git a/src/acpica/source/components/events/evevent.c b/src/acpica/source/components/events/evevent.c
index e447356..eda09eb 100644
--- a/src/acpica/source/components/events/evevent.c
+++ b/src/acpica/source/components/events/evevent.c
@@ -275,8 +275,8 @@ AcpiEvFixedEventInitialize (
if (AcpiGbl_FixedEventInfo[i].EnableRegisterId != 0xFF)
{
Status = AcpiWriteBitRegister (
- AcpiGbl_FixedEventInfo[i].EnableRegisterId,
- ACPI_DISABLE_EVENT);
+ AcpiGbl_FixedEventInfo[i].EnableRegisterId,
+ ACPI_DISABLE_EVENT);
if (ACPI_FAILURE (Status))
{
return (Status);
@@ -379,8 +379,8 @@ AcpiEvFixedEventDispatch (
/* Clear the status bit */
(void) AcpiWriteBitRegister (
- AcpiGbl_FixedEventInfo[Event].StatusRegisterId,
- ACPI_CLEAR_STATUS);
+ AcpiGbl_FixedEventInfo[Event].StatusRegisterId,
+ ACPI_CLEAR_STATUS);
/*
* Make sure that a handler exists. If not, report an error
@@ -389,8 +389,8 @@ AcpiEvFixedEventDispatch (
if (!AcpiGbl_FixedEventHandlers[Event].Handler)
{
(void) AcpiWriteBitRegister (
- AcpiGbl_FixedEventInfo[Event].EnableRegisterId,
- ACPI_DISABLE_EVENT);
+ AcpiGbl_FixedEventInfo[Event].EnableRegisterId,
+ ACPI_DISABLE_EVENT);
ACPI_ERROR ((AE_INFO,
"No installed handler for fixed event - %s (%u), disabling",
@@ -402,7 +402,7 @@ AcpiEvFixedEventDispatch (
/* Invoke the Fixed Event handler */
return ((AcpiGbl_FixedEventHandlers[Event].Handler)(
- AcpiGbl_FixedEventHandlers[Event].Context));
+ AcpiGbl_FixedEventHandlers[Event].Context));
}
#endif /* !ACPI_REDUCED_HARDWARE */
diff --git a/src/acpica/source/components/events/evglock.c b/src/acpica/source/components/events/evglock.c
index e1ebf19..8353ffb 100644
--- a/src/acpica/source/components/events/evglock.c
+++ b/src/acpica/source/components/events/evglock.c
@@ -162,7 +162,7 @@ AcpiEvInitGlobalLockHandler (
/* Attempt installation of the global lock handler */
Status = AcpiInstallFixedEventHandler (ACPI_EVENT_GLOBAL,
- AcpiEvGlobalLockHandler, NULL);
+ AcpiEvGlobalLockHandler, NULL);
/*
* If the global lock does not exist on this platform, the attempt to
@@ -212,9 +212,10 @@ AcpiEvRemoveGlobalLockHandler (
ACPI_FUNCTION_TRACE (EvRemoveGlobalLockHandler);
+
AcpiGbl_GlobalLockPresent = FALSE;
Status = AcpiRemoveFixedEventHandler (ACPI_EVENT_GLOBAL,
- AcpiEvGlobalLockHandler);
+ AcpiEvGlobalLockHandler);
AcpiOsDeleteLock (AcpiGbl_GlobalLockPendingLock);
return_ACPI_STATUS (Status);
@@ -374,8 +375,8 @@ AcpiEvAcquireGlobalLock (
* Wait for handshake with the global lock interrupt handler.
* This interface releases the interpreter if we must wait.
*/
- Status = AcpiExSystemWaitSemaphore (AcpiGbl_GlobalLockSemaphore,
- ACPI_WAIT_FOREVER);
+ Status = AcpiExSystemWaitSemaphore (
+ AcpiGbl_GlobalLockSemaphore, ACPI_WAIT_FOREVER);
Flags = AcpiOsAcquireLock (AcpiGbl_GlobalLockPendingLock);
@@ -433,7 +434,7 @@ AcpiEvReleaseGlobalLock (
if (Pending)
{
Status = AcpiWriteBitRegister (
- ACPI_BITREG_GLOBAL_LOCK_RELEASE, ACPI_ENABLE_EVENT);
+ ACPI_BITREG_GLOBAL_LOCK_RELEASE, ACPI_ENABLE_EVENT);
}
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Released hardware Global Lock\n"));
diff --git a/src/acpica/source/components/events/evgpe.c b/src/acpica/source/components/events/evgpe.c
index 4dceaa4..54316fe 100644
--- a/src/acpica/source/components/events/evgpe.c
+++ b/src/acpica/source/components/events/evgpe.c
@@ -176,8 +176,8 @@ AcpiEvUpdateGpeEnableMask (
{
ACPI_SET_BIT (GpeRegisterInfo->EnableForRun, (UINT8) RegisterBit);
}
- GpeRegisterInfo->EnableMask = GpeRegisterInfo->EnableForRun;
+ GpeRegisterInfo->EnableMask = GpeRegisterInfo->EnableForRun;
return_ACPI_STATUS (AE_OK);
}
@@ -399,7 +399,7 @@ AcpiEvGetGpeEventInfo (
for (i = 0; i < ACPI_MAX_GPE_BLOCKS; i++)
{
GpeInfo = AcpiEvLowGetGpeInfo (GpeNumber,
- AcpiGbl_GpeFadtBlocks[i]);
+ AcpiGbl_GpeFadtBlocks[i]);
if (GpeInfo)
{
return (GpeInfo);
@@ -660,8 +660,8 @@ AcpiEvAsynchExecuteGpeMethod (
Notify = GpeEventInfo->Dispatch.NotifyList;
while (ACPI_SUCCESS (Status) && Notify)
{
- Status = AcpiEvQueueNotifyRequest (Notify->DeviceNode,
- ACPI_NOTIFY_DEVICE_WAKE);
+ Status = AcpiEvQueueNotifyRequest (
+ Notify->DeviceNode, ACPI_NOTIFY_DEVICE_WAKE);
Notify = Notify->Next;
}
@@ -705,7 +705,7 @@ AcpiEvAsynchExecuteGpeMethod (
/* Defer enabling of GPE until all notify handlers are done */
Status = AcpiOsExecute (OSL_NOTIFY_HANDLER,
- AcpiEvAsynchEnableGpe, GpeEventInfo);
+ AcpiEvAsynchEnableGpe, GpeEventInfo);
if (ACPI_SUCCESS (Status))
{
return_VOID;
@@ -850,8 +850,8 @@ AcpiEvGpeDispatch (
{
ACPI_EXCEPTION ((AE_INFO, Status,
"Unable to clear GPE %02X", GpeNumber));
- (void) AcpiHwLowSetGpe (GpeEventInfo,
- ACPI_GPE_CONDITIONAL_ENABLE);
+ (void) AcpiHwLowSetGpe (
+ GpeEventInfo, ACPI_GPE_CONDITIONAL_ENABLE);
return_UINT32 (ACPI_INTERRUPT_NOT_HANDLED);
}
}
@@ -888,7 +888,7 @@ AcpiEvGpeDispatch (
* NOTE: Level-triggered GPEs are cleared after the method completes.
*/
Status = AcpiOsExecute (OSL_GPE_HANDLER,
- AcpiEvAsynchExecuteGpeMethod, GpeEventInfo);
+ AcpiEvAsynchExecuteGpeMethod, GpeEventInfo);
if (ACPI_FAILURE (Status))
{
ACPI_EXCEPTION ((AE_INFO, Status,
diff --git a/src/acpica/source/components/events/evgpeblk.c b/src/acpica/source/components/events/evgpeblk.c
index e067457..7a3c15d 100644
--- a/src/acpica/source/components/events/evgpeblk.c
+++ b/src/acpica/source/components/events/evgpeblk.c
@@ -265,6 +265,7 @@ AcpiEvDeleteGpeBlock (
{
GpeBlock->Next->Previous = GpeBlock->Previous;
}
+
AcpiOsReleaseLock (AcpiGbl_GpeLock, Flags);
}
@@ -313,8 +314,8 @@ AcpiEvCreateGpeInfoBlocks (
/* Allocate the GPE register information block */
GpeRegisterInfo = ACPI_ALLOCATE_ZEROED (
- (ACPI_SIZE) GpeBlock->RegisterCount *
- sizeof (ACPI_GPE_REGISTER_INFO));
+ (ACPI_SIZE) GpeBlock->RegisterCount *
+ sizeof (ACPI_GPE_REGISTER_INFO));
if (!GpeRegisterInfo)
{
ACPI_ERROR ((AE_INFO,
@@ -327,7 +328,7 @@ AcpiEvCreateGpeInfoBlocks (
* per register. Initialization to zeros is sufficient.
*/
GpeEventInfo = ACPI_ALLOCATE_ZEROED ((ACPI_SIZE) GpeBlock->GpeCount *
- sizeof (ACPI_GPE_EVENT_INFO));
+ sizeof (ACPI_GPE_EVENT_INFO));
if (!GpeEventInfo)
{
ACPI_ERROR ((AE_INFO,
@@ -339,7 +340,7 @@ AcpiEvCreateGpeInfoBlocks (
/* Save the new Info arrays in the GPE block */
GpeBlock->RegisterInfo = GpeRegisterInfo;
- GpeBlock->EventInfo = GpeEventInfo;
+ GpeBlock->EventInfo = GpeEventInfo;
/*
* Initialize the GPE Register and Event structures. A goal of these
@@ -348,7 +349,7 @@ AcpiEvCreateGpeInfoBlocks (
* first half, and the enable registers occupy the second half.
*/
ThisRegister = GpeRegisterInfo;
- ThisEvent = GpeEventInfo;
+ ThisEvent = GpeEventInfo;
for (i = 0; i < GpeBlock->RegisterCount; i++)
{
@@ -506,8 +507,8 @@ AcpiEvCreateGpeBlock (
WalkInfo.ExecuteByOwnerId = FALSE;
Status = AcpiNsWalkNamespace (ACPI_TYPE_METHOD, GpeDevice,
- ACPI_UINT32_MAX, ACPI_NS_WALK_NO_UNLOCK,
- AcpiEvMatchGpeMethod, NULL, &WalkInfo, NULL);
+ ACPI_UINT32_MAX, ACPI_NS_WALK_NO_UNLOCK,
+ AcpiEvMatchGpeMethod, NULL, &WalkInfo, NULL);
/* Return the new block */
diff --git a/src/acpica/source/components/events/evgpeinit.c b/src/acpica/source/components/events/evgpeinit.c
index bf3c6e5..d8e4ee9 100644
--- a/src/acpica/source/components/events/evgpeinit.c
+++ b/src/acpica/source/components/events/evgpeinit.c
@@ -210,10 +210,10 @@ AcpiEvGpeInitialize (
/* Install GPE Block 0 */
Status = AcpiEvCreateGpeBlock (AcpiGbl_FadtGpeDevice,
- AcpiGbl_FADT.XGpe0Block.Address,
- AcpiGbl_FADT.XGpe0Block.SpaceId,
- RegisterCount0, 0,
- AcpiGbl_FADT.SciInterrupt, &AcpiGbl_GpeFadtBlocks[0]);
+ AcpiGbl_FADT.XGpe0Block.Address,
+ AcpiGbl_FADT.XGpe0Block.SpaceId,
+ RegisterCount0, 0,
+ AcpiGbl_FADT.SciInterrupt, &AcpiGbl_GpeFadtBlocks[0]);
if (ACPI_FAILURE (Status))
{
@@ -250,11 +250,11 @@ AcpiEvGpeInitialize (
/* Install GPE Block 1 */
Status = AcpiEvCreateGpeBlock (AcpiGbl_FadtGpeDevice,
- AcpiGbl_FADT.XGpe1Block.Address,
- AcpiGbl_FADT.XGpe1Block.SpaceId,
- RegisterCount1,
- AcpiGbl_FADT.Gpe1Base,
- AcpiGbl_FADT.SciInterrupt, &AcpiGbl_GpeFadtBlocks[1]);
+ AcpiGbl_FADT.XGpe1Block.Address,
+ AcpiGbl_FADT.XGpe1Block.SpaceId,
+ RegisterCount1,
+ AcpiGbl_FADT.Gpe1Base,
+ AcpiGbl_FADT.SciInterrupt, &AcpiGbl_GpeFadtBlocks[1]);
if (ACPI_FAILURE (Status))
{
@@ -267,7 +267,7 @@ AcpiEvGpeInitialize (
* space. However, GPE0 always starts at GPE number zero.
*/
GpeNumberMax = AcpiGbl_FADT.Gpe1Base +
- ((RegisterCount1 * ACPI_GPE_REGISTER_WIDTH) - 1);
+ ((RegisterCount1 * ACPI_GPE_REGISTER_WIDTH) - 1);
}
}
@@ -347,9 +347,9 @@ AcpiEvUpdateGpes (
WalkInfo.GpeDevice = GpeBlock->Node;
Status = AcpiNsWalkNamespace (ACPI_TYPE_METHOD,
- WalkInfo.GpeDevice, ACPI_UINT32_MAX,
- ACPI_NS_WALK_NO_UNLOCK, AcpiEvMatchGpeMethod,
- NULL, &WalkInfo, NULL);
+ WalkInfo.GpeDevice, ACPI_UINT32_MAX,
+ ACPI_NS_WALK_NO_UNLOCK, AcpiEvMatchGpeMethod,
+ NULL, &WalkInfo, NULL);
if (ACPI_FAILURE (Status))
{
ACPI_EXCEPTION ((AE_INFO, Status,
@@ -502,7 +502,7 @@ AcpiEvMatchGpeMethod (
}
if (ACPI_GPE_DISPATCH_TYPE (GpeEventInfo->Flags) ==
- ACPI_GPE_DISPATCH_METHOD)
+ ACPI_GPE_DISPATCH_METHOD)
{
/*
* If there is already a method, ignore this method. But check
diff --git a/src/acpica/source/components/events/evgpeutil.c b/src/acpica/source/components/events/evgpeutil.c
index f204bba..aafbac9 100644
--- a/src/acpica/source/components/events/evgpeutil.c
+++ b/src/acpica/source/components/events/evgpeutil.c
@@ -310,7 +310,7 @@ AcpiEvGetGpeXruptBlock (
if (InterruptNumber != AcpiGbl_FADT.SciInterrupt)
{
Status = AcpiOsInstallInterruptHandler (InterruptNumber,
- AcpiEvGpeXruptHandler, GpeXrupt);
+ AcpiEvGpeXruptHandler, GpeXrupt);
if (ACPI_FAILURE (Status))
{
ACPI_EXCEPTION ((AE_INFO, Status,
@@ -360,7 +360,7 @@ AcpiEvDeleteGpeXrupt (
/* Disable this interrupt */
Status = AcpiOsRemoveInterruptHandler (
- GpeXrupt->InterruptNumber, AcpiEvGpeXruptHandler);
+ GpeXrupt->InterruptNumber, AcpiEvGpeXruptHandler);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
@@ -446,7 +446,7 @@ AcpiEvDeleteGpeHandlers (
GpeEventInfo->Flags &= ~ACPI_GPE_DISPATCH_MASK;
}
else if (ACPI_GPE_DISPATCH_TYPE (GpeEventInfo->Flags) ==
- ACPI_GPE_DISPATCH_NOTIFY)
+ ACPI_GPE_DISPATCH_NOTIFY)
{
/* Delete the implicit notification device list */
@@ -457,6 +457,7 @@ AcpiEvDeleteGpeHandlers (
ACPI_FREE (Notify);
Notify = Next;
}
+
GpeEventInfo->Dispatch.NotifyList = NULL;
GpeEventInfo->Flags &= ~ACPI_GPE_DISPATCH_MASK;
}
diff --git a/src/acpica/source/components/events/evhandler.c b/src/acpica/source/components/events/evhandler.c
index d02ea53..4375e7c 100644
--- a/src/acpica/source/components/events/evhandler.c
+++ b/src/acpica/source/components/events/evhandler.c
@@ -194,8 +194,8 @@ AcpiEvInstallRegionHandlers (
for (i = 0; i < ACPI_NUM_DEFAULT_SPACES; i++)
{
Status = AcpiEvInstallSpaceHandler (AcpiGbl_RootNode,
- AcpiGbl_DefaultAddressSpaces[i],
- ACPI_DEFAULT_HANDLER, NULL, NULL);
+ AcpiGbl_DefaultAddressSpaces[i],
+ ACPI_DEFAULT_HANDLER, NULL, NULL);
switch (Status)
{
case AE_OK:
@@ -256,7 +256,7 @@ AcpiEvHasDefaultHandler (
if (HandlerObj->AddressSpace.SpaceId == SpaceId)
{
if (HandlerObj->AddressSpace.HandlerFlags &
- ACPI_ADDR_HANDLER_DEFAULT_INSTALLED)
+ ACPI_ADDR_HANDLER_DEFAULT_INSTALLED)
{
return (TRUE);
}
@@ -354,7 +354,7 @@ AcpiEvInstallHandler (
/* Found a handler, is it for the same address space? */
if (NextHandlerObj->AddressSpace.SpaceId ==
- HandlerObj->AddressSpace.SpaceId)
+ HandlerObj->AddressSpace.SpaceId)
{
ACPI_DEBUG_PRINT ((ACPI_DB_OPREGION,
"Found handler for region [%s] in device %p(%p) "
@@ -646,8 +646,8 @@ AcpiEvInstallSpaceHandler (
* of the branch
*/
Status = AcpiNsWalkNamespace (ACPI_TYPE_ANY, Node, ACPI_UINT32_MAX,
- ACPI_NS_WALK_UNLOCK, AcpiEvInstallHandler, NULL,
- HandlerObj, NULL);
+ ACPI_NS_WALK_UNLOCK, AcpiEvInstallHandler, NULL,
+ HandlerObj, NULL);
UnlockAndExit:
return_ACPI_STATUS (Status);
diff --git a/src/acpica/source/components/events/evmisc.c b/src/acpica/source/components/events/evmisc.c
index 1735038..0d6492f 100644
--- a/src/acpica/source/components/events/evmisc.c
+++ b/src/acpica/source/components/events/evmisc.c
@@ -147,6 +147,7 @@ BOOLEAN
AcpiEvIsNotifyObject (
ACPI_NAMESPACE_NODE *Node)
{
+
switch (Node->Type)
{
case ACPI_TYPE_DEVICE:
@@ -255,8 +256,8 @@ AcpiEvQueueNotifyRequest (
AcpiUtGetNodeName (Node), AcpiUtGetTypeName (Node->Type),
NotifyValue, AcpiUtGetNotifyName (NotifyValue, ACPI_TYPE_ANY), Node));
- Status = AcpiOsExecute (OSL_NOTIFY_HANDLER, AcpiEvNotifyDispatch,
- Info);
+ Status = AcpiOsExecute (OSL_NOTIFY_HANDLER,
+ AcpiEvNotifyDispatch, Info);
if (ACPI_FAILURE (Status))
{
AcpiUtDeleteGenericState (Info);
diff --git a/src/acpica/source/components/events/evregion.c b/src/acpica/source/components/events/evregion.c
index 24848db..2b00616 100644
--- a/src/acpica/source/components/events/evregion.c
+++ b/src/acpica/source/components/events/evregion.c
@@ -182,7 +182,7 @@ AcpiEvInitializeOpRegions (
AcpiGbl_DefaultAddressSpaces[i]))
{
Status = AcpiEvExecuteRegMethods (AcpiGbl_RootNode,
- AcpiGbl_DefaultAddressSpaces[i]);
+ AcpiGbl_DefaultAddressSpaces[i]);
}
}
@@ -282,7 +282,7 @@ AcpiEvAddressSpaceDispatch (
AcpiExExitInterpreter ();
Status = RegionSetup (RegionObj, ACPI_REGION_ACTIVATE,
- Context, &RegionContext);
+ Context, &RegionContext);
/* Re-enter the interpreter */
@@ -364,7 +364,7 @@ AcpiEvAddressSpaceDispatch (
AcpiUtGetRegionName (RegionObj->Region.SpaceId)));
if (!(HandlerDesc->AddressSpace.HandlerFlags &
- ACPI_ADDR_HANDLER_DEFAULT_INSTALLED))
+ ACPI_ADDR_HANDLER_DEFAULT_INSTALLED))
{
/*
* For handlers other than the default (supplied) handlers, we must
@@ -386,7 +386,7 @@ AcpiEvAddressSpaceDispatch (
}
if (!(HandlerDesc->AddressSpace.HandlerFlags &
- ACPI_ADDR_HANDLER_DEFAULT_INSTALLED))
+ ACPI_ADDR_HANDLER_DEFAULT_INSTALLED))
{
/*
* We just returned from a non-default handler, we must re-enter the
diff --git a/src/acpica/source/components/events/evrgnini.c b/src/acpica/source/components/events/evrgnini.c
index 405af22..ebc3b59 100644
--- a/src/acpica/source/components/events/evrgnini.c
+++ b/src/acpica/source/components/events/evrgnini.c
@@ -320,9 +320,9 @@ AcpiEvPciConfigRegionSetup (
/* Install a handler for this PCI root bridge */
Status = AcpiInstallAddressSpaceHandler (
- (ACPI_HANDLE) PciRootNode,
- ACPI_ADR_SPACE_PCI_CONFIG,
- ACPI_DEFAULT_HANDLER, NULL, NULL);
+ (ACPI_HANDLE) PciRootNode,
+ ACPI_ADR_SPACE_PCI_CONFIG,
+ ACPI_DEFAULT_HANDLER, NULL, NULL);
if (ACPI_FAILURE (Status))
{
if (Status == AE_SAME_HANDLER)
@@ -396,7 +396,7 @@ AcpiEvPciConfigRegionSetup (
* contained in the parent's scope.
*/
Status = AcpiUtEvaluateNumericObject (METHOD_NAME__ADR,
- PciDeviceNode, &PciValue);
+ PciDeviceNode, &PciValue);
/*
* The default is zero, and since the allocation above zeroed the data,
@@ -411,7 +411,7 @@ AcpiEvPciConfigRegionSetup (
/* The PCI segment number comes from the _SEG method */
Status = AcpiUtEvaluateNumericObject (METHOD_NAME__SEG,
- PciRootNode, &PciValue);
+ PciRootNode, &PciValue);
if (ACPI_SUCCESS (Status))
{
PciId->Segment = ACPI_LOWORD (PciValue);
@@ -420,7 +420,7 @@ AcpiEvPciConfigRegionSetup (
/* The PCI bus number comes from the _BBN method */
Status = AcpiUtEvaluateNumericObject (METHOD_NAME__BBN,
- PciRootNode, &PciValue);
+ PciRootNode, &PciValue);
if (ACPI_SUCCESS (Status))
{
PciId->Bus = ACPI_LOWORD (PciValue);
@@ -676,7 +676,7 @@ AcpiEvInitializeRegion (
/* Find any "_REG" method associated with this region definition */
Status = AcpiNsSearchOneScope (
- *RegNamePtr, Node, ACPI_TYPE_METHOD, &MethodNode);
+ *RegNamePtr, Node, ACPI_TYPE_METHOD, &MethodNode);
if (ACPI_SUCCESS (Status))
{
/*
@@ -752,7 +752,7 @@ AcpiEvInitializeRegion (
HandlerObj, RegionObj, ObjDesc));
Status = AcpiEvAttachRegion (HandlerObj, RegionObj,
- AcpiNsLocked);
+ AcpiNsLocked);
/*
* Tell all users that this region is usable by
diff --git a/src/acpica/source/components/events/evsci.c b/src/acpica/source/components/events/evsci.c
index 987b03c..f021ab8 100644
--- a/src/acpica/source/components/events/evsci.c
+++ b/src/acpica/source/components/events/evsci.c
@@ -291,7 +291,7 @@ AcpiEvInstallSciHandler (
Status = AcpiOsInstallInterruptHandler ((UINT32) AcpiGbl_FADT.SciInterrupt,
- AcpiEvSciXruptHandler, AcpiGbl_GpeXruptListHead);
+ AcpiEvSciXruptHandler, AcpiGbl_GpeXruptListHead);
return_ACPI_STATUS (Status);
}
@@ -330,7 +330,7 @@ AcpiEvRemoveAllSciHandlers (
/* Just let the OS remove the handler and disable the level */
Status = AcpiOsRemoveInterruptHandler ((UINT32) AcpiGbl_FADT.SciInterrupt,
- AcpiEvSciXruptHandler);
+ AcpiEvSciXruptHandler);
if (!AcpiGbl_SciHandlerList)
{
diff --git a/src/acpica/source/components/events/evxface.c b/src/acpica/source/components/events/evxface.c
index 5e3391d..5469a22 100644
--- a/src/acpica/source/components/events/evxface.c
+++ b/src/acpica/source/components/events/evxface.c
@@ -1074,8 +1074,8 @@ AcpiInstallGpeHandler (
ACPI_FUNCTION_TRACE (AcpiInstallGpeHandler);
- Status = AcpiEvInstallGpeHandler (GpeDevice, GpeNumber, Type, FALSE,
- Address, Context);
+ Status = AcpiEvInstallGpeHandler (GpeDevice, GpeNumber, Type,
+ FALSE, Address, Context);
return_ACPI_STATUS (Status);
}
@@ -1115,8 +1115,8 @@ AcpiInstallGpeRawHandler (
ACPI_FUNCTION_TRACE (AcpiInstallGpeRawHandler);
- Status = AcpiEvInstallGpeHandler (GpeDevice, GpeNumber, Type, TRUE,
- Address, Context);
+ Status = AcpiEvInstallGpeHandler (GpeDevice, GpeNumber, Type,
+ TRUE, Address, Context);
return_ACPI_STATUS (Status);
}
@@ -1282,7 +1282,7 @@ AcpiAcquireGlobalLock (
AcpiExEnterInterpreter ();
Status = AcpiExAcquireMutexObject (Timeout,
- AcpiGbl_GlobalLockMutex, AcpiOsGetThreadId ());
+ AcpiGbl_GlobalLockMutex, AcpiOsGetThreadId ());
if (ACPI_SUCCESS (Status))
{
diff --git a/src/acpica/source/components/events/evxfevnt.c b/src/acpica/source/components/events/evxfevnt.c
index 271aacc..b4fd27e 100644
--- a/src/acpica/source/components/events/evxfevnt.c
+++ b/src/acpica/source/components/events/evxfevnt.c
@@ -148,7 +148,7 @@ AcpiEnable (
/* ACPI tables must be present */
- if (!AcpiTbTablesLoaded ())
+ if (AcpiGbl_FadtIndex == ACPI_INVALID_TABLE_INDEX)
{
return_ACPI_STATUS (AE_NO_ACPI_TABLES);
}
@@ -164,7 +164,8 @@ AcpiEnable (
if (AcpiHwGetMode() == ACPI_SYS_MODE_ACPI)
{
- ACPI_DEBUG_PRINT ((ACPI_DB_INIT, "System is already in ACPI mode\n"));
+ ACPI_DEBUG_PRINT ((ACPI_DB_INIT,
+ "System is already in ACPI mode\n"));
}
else
{
@@ -234,7 +235,8 @@ AcpiDisable (
return_ACPI_STATUS (Status);
}
- ACPI_DEBUG_PRINT ((ACPI_DB_INIT, "ACPI mode disabled\n"));
+ ACPI_DEBUG_PRINT ((ACPI_DB_INIT,
+ "ACPI mode disabled\n"));
}
return_ACPI_STATUS (Status);
@@ -280,8 +282,8 @@ AcpiEnableEvent (
* register bit)
*/
Status = AcpiWriteBitRegister (
- AcpiGbl_FixedEventInfo[Event].EnableRegisterId,
- ACPI_ENABLE_EVENT);
+ AcpiGbl_FixedEventInfo[Event].EnableRegisterId,
+ ACPI_ENABLE_EVENT);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
@@ -290,7 +292,7 @@ AcpiEnableEvent (
/* Make sure that the hardware responded */
Status = AcpiReadBitRegister (
- AcpiGbl_FixedEventInfo[Event].EnableRegisterId, &Value);
+ AcpiGbl_FixedEventInfo[Event].EnableRegisterId, &Value);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
@@ -346,15 +348,15 @@ AcpiDisableEvent (
* register bit)
*/
Status = AcpiWriteBitRegister (
- AcpiGbl_FixedEventInfo[Event].EnableRegisterId,
- ACPI_DISABLE_EVENT);
+ AcpiGbl_FixedEventInfo[Event].EnableRegisterId,
+ ACPI_DISABLE_EVENT);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
}
Status = AcpiReadBitRegister (
- AcpiGbl_FixedEventInfo[Event].EnableRegisterId, &Value);
+ AcpiGbl_FixedEventInfo[Event].EnableRegisterId, &Value);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
@@ -407,8 +409,8 @@ AcpiClearEvent (
* register bit)
*/
Status = AcpiWriteBitRegister (
- AcpiGbl_FixedEventInfo[Event].StatusRegisterId,
- ACPI_CLEAR_STATUS);
+ AcpiGbl_FixedEventInfo[Event].StatusRegisterId,
+ ACPI_CLEAR_STATUS);
return_ACPI_STATUS (Status);
}
@@ -465,7 +467,7 @@ AcpiGetEventStatus (
/* Fixed event currently enabled? */
Status = AcpiReadBitRegister (
- AcpiGbl_FixedEventInfo[Event].EnableRegisterId, &InByte);
+ AcpiGbl_FixedEventInfo[Event].EnableRegisterId, &InByte);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
@@ -480,7 +482,7 @@ AcpiGetEventStatus (
/* Fixed event currently active? */
Status = AcpiReadBitRegister (
- AcpiGbl_FixedEventInfo[Event].StatusRegisterId, &InByte);
+ AcpiGbl_FixedEventInfo[Event].StatusRegisterId, &InByte);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
diff --git a/src/acpica/source/components/events/evxfgpe.c b/src/acpica/source/components/events/evxfgpe.c
index f4f0da1..f55261f 100644
--- a/src/acpica/source/components/events/evxfgpe.c
+++ b/src/acpica/source/components/events/evxfgpe.c
@@ -512,7 +512,7 @@ AcpiSetupGpeForWake (
* level-triggered (for windows compatibility).
*/
if (ACPI_GPE_DISPATCH_TYPE (GpeEventInfo->Flags) ==
- ACPI_GPE_DISPATCH_NONE)
+ ACPI_GPE_DISPATCH_NONE)
{
/*
* This is the first device for implicit notify on this GPE.
@@ -527,7 +527,7 @@ AcpiSetupGpeForWake (
* this device to the notify list.
*/
if (ACPI_GPE_DISPATCH_TYPE (GpeEventInfo->Flags) ==
- ACPI_GPE_DISPATCH_NOTIFY)
+ ACPI_GPE_DISPATCH_NOTIFY)
{
/* Ensure that the device is not already in the list */
@@ -992,8 +992,8 @@ AcpiInstallGpeBlock (
* is always zero
*/
Status = AcpiEvCreateGpeBlock (Node, GpeBlockAddress->Address,
- GpeBlockAddress->SpaceId, RegisterCount,
- 0, InterruptNumber, &GpeBlock);
+ GpeBlockAddress->SpaceId, RegisterCount,
+ 0, InterruptNumber, &GpeBlock);
if (ACPI_FAILURE (Status))
{
goto UnlockAndExit;
diff --git a/src/acpica/source/components/events/evxfregn.c b/src/acpica/source/components/events/evxfregn.c
index e220676..4b70d09 100644
--- a/src/acpica/source/components/events/evxfregn.c
+++ b/src/acpica/source/components/events/evxfregn.c
@@ -186,7 +186,8 @@ AcpiInstallAddressSpaceHandler (
/* Install the handler for all Regions for this Space ID */
- Status = AcpiEvInstallSpaceHandler (Node, SpaceId, Handler, Setup, Context);
+ Status = AcpiEvInstallSpaceHandler (
+ Node, SpaceId, Handler, Setup, Context);
if (ACPI_FAILURE (Status))
{
goto UnlockAndExit;
@@ -216,6 +217,7 @@ AcpiInstallAddressSpaceHandler (
if (!AcpiGbl_RegMethodsExecuted)
{
/* We will defer execution of the _REG methods for this space */
+
goto UnlockAndExit;
}
break;
diff --git a/src/acpica/source/components/executer/exconfig.c b/src/acpica/source/components/executer/exconfig.c
index d4f7087..06aca94 100644
--- a/src/acpica/source/components/executer/exconfig.c
+++ b/src/acpica/source/components/executer/exconfig.c
@@ -254,9 +254,9 @@ AcpiExLoadTableOp (
/* Find the ACPI table in the RSDT/XSDT */
Status = AcpiTbFindTable (
- Operand[0]->String.Pointer,
- Operand[1]->String.Pointer,
- Operand[2]->String.Pointer, &TableIndex);
+ Operand[0]->String.Pointer,
+ Operand[1]->String.Pointer,
+ Operand[2]->String.Pointer, &TableIndex);
if (ACPI_FAILURE (Status))
{
if (Status != AE_NOT_FOUND)
@@ -290,7 +290,7 @@ AcpiExLoadTableOp (
* location within the namespace where the table will be loaded.
*/
Status = AcpiNsGetNode (StartNode, Operand[3]->String.Pointer,
- ACPI_NS_SEARCH_PARENT, &ParentNode);
+ ACPI_NS_SEARCH_PARENT, &ParentNode);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
@@ -314,7 +314,7 @@ AcpiExLoadTableOp (
/* Find the node referenced by the ParameterPathString */
Status = AcpiNsGetNode (StartNode, Operand[4]->String.Pointer,
- ACPI_NS_SEARCH_PARENT, &ParameterNode);
+ ACPI_NS_SEARCH_PARENT, &ParameterNode);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
@@ -336,8 +336,7 @@ AcpiExLoadTableOp (
/* Store the parameter data into the optional parameter object */
Status = AcpiExStore (Operand[5],
- ACPI_CAST_PTR (ACPI_OPERAND_OBJECT, ParameterNode),
- WalkState);
+ ACPI_CAST_PTR (ACPI_OPERAND_OBJECT, ParameterNode), WalkState);
if (ACPI_FAILURE (Status))
{
(void) AcpiExUnloadTable (DdbHandle);
@@ -359,7 +358,7 @@ AcpiExLoadTableOp (
if (AcpiGbl_TableHandler)
{
(void) AcpiGbl_TableHandler (ACPI_TABLE_EVENT_LOAD, Table,
- AcpiGbl_TableHandlerContext);
+ AcpiGbl_TableHandlerContext);
}
*ReturnDesc = DdbHandle;
@@ -399,7 +398,7 @@ AcpiExRegionRead (
for (i = 0; i < Length; i++)
{
Status = AcpiEvAddressSpaceDispatch (ObjDesc, NULL, ACPI_READ,
- RegionOffset, 8, &Value);
+ RegionOffset, 8, &Value);
if (ACPI_FAILURE (Status))
{
return (Status);
@@ -469,8 +468,8 @@ AcpiExLoadOp (
}
/*
- * If the Region Address and Length have not been previously evaluated,
- * evaluate them now and save the results.
+ * If the Region Address and Length have not been previously
+ * evaluated, evaluate them now and save the results.
*/
if (!(ObjDesc->Common.Flags & AOPOBJ_DATA_VALID))
{
@@ -490,7 +489,7 @@ AcpiExLoadOp (
}
Status = AcpiExRegionRead (ObjDesc, sizeof (ACPI_TABLE_HEADER),
- ACPI_CAST_PTR (UINT8, TableHeader));
+ ACPI_CAST_PTR (UINT8, TableHeader));
Length = TableHeader->Length;
ACPI_FREE (TableHeader);
@@ -533,7 +532,7 @@ AcpiExLoadOp (
/* Read the entire table */
Status = AcpiExRegionRead (ObjDesc, Length,
- ACPI_CAST_PTR (UINT8, Table));
+ ACPI_CAST_PTR (UINT8, Table));
if (ACPI_FAILURE (Status))
{
ACPI_FREE (Table);
@@ -555,7 +554,8 @@ AcpiExLoadOp (
/* Get the actual table length from the table header */
- TableHeader = ACPI_CAST_PTR (ACPI_TABLE_HEADER, ObjDesc->Buffer.Pointer);
+ TableHeader = ACPI_CAST_PTR (
+ ACPI_TABLE_HEADER, ObjDesc->Buffer.Pointer);
Length = TableHeader->Length;
/* Table cannot extend beyond the buffer */
@@ -570,8 +570,8 @@ AcpiExLoadOp (
}
/*
- * Copy the table from the buffer because the buffer could be modified
- * or even deleted in the future
+ * Copy the table from the buffer because the buffer could be
+ * modified or even deleted in the future
*/
Table = ACPI_ALLOCATE (Length);
if (!Table)
@@ -593,8 +593,8 @@ AcpiExLoadOp (
(void) AcpiUtAcquireMutex (ACPI_MTX_TABLES);
Status = AcpiTbInstallStandardTable (ACPI_PTR_TO_PHYSADDR (Table),
- ACPI_TABLE_ORIGIN_INTERNAL_VIRTUAL, TRUE, TRUE,
- &TableIndex);
+ ACPI_TABLE_ORIGIN_INTERNAL_VIRTUAL, TRUE, TRUE,
+ &TableIndex);
(void) AcpiUtReleaseMutex (ACPI_MTX_TABLES);
if (ACPI_FAILURE (Status))
@@ -609,7 +609,8 @@ AcpiExLoadOp (
* Note: Now table is "INSTALLED", it must be validated before
* loading.
*/
- Status = AcpiTbValidateTable (&AcpiGbl_RootTableList.Tables[TableIndex]);
+ Status = AcpiTbValidateTable (
+ &AcpiGbl_RootTableList.Tables[TableIndex]);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
@@ -652,7 +653,7 @@ AcpiExLoadOp (
if (AcpiGbl_TableHandler)
{
(void) AcpiGbl_TableHandler (ACPI_TABLE_EVENT_LOAD, Table,
- AcpiGbl_TableHandlerContext);
+ AcpiGbl_TableHandlerContext);
}
return_ACPI_STATUS (Status);
@@ -729,7 +730,7 @@ AcpiExUnloadTable (
if (ACPI_SUCCESS (Status))
{
(void) AcpiGbl_TableHandler (ACPI_TABLE_EVENT_UNLOAD, Table,
- AcpiGbl_TableHandlerContext);
+ AcpiGbl_TableHandlerContext);
}
}
diff --git a/src/acpica/source/components/executer/exconvrt.c b/src/acpica/source/components/executer/exconvrt.c
index 019a490..dc5fd9f 100644
--- a/src/acpica/source/components/executer/exconvrt.c
+++ b/src/acpica/source/components/executer/exconvrt.c
@@ -323,9 +323,7 @@ AcpiExConvertToBuffer (
/* Copy the integer to the buffer, LSB first */
NewBuf = ReturnDesc->Buffer.Pointer;
- memcpy (NewBuf,
- &ObjDesc->Integer.Value,
- AcpiGbl_IntegerByteWidth);
+ memcpy (NewBuf, &ObjDesc->Integer.Value, AcpiGbl_IntegerByteWidth);
break;
case ACPI_TYPE_STRING:
@@ -338,8 +336,8 @@ AcpiExConvertToBuffer (
* ASL/AML code that depends on the null being transferred to the new
* buffer.
*/
- ReturnDesc = AcpiUtCreateBufferObject (
- (ACPI_SIZE) ObjDesc->String.Length + 1);
+ ReturnDesc = AcpiUtCreateBufferObject ((ACPI_SIZE)
+ ObjDesc->String.Length + 1);
if (!ReturnDesc)
{
return_ACPI_STATUS (AE_NO_MEMORY);
@@ -462,7 +460,8 @@ AcpiExConvertToAscii (
{
/* Get one hex digit, most significant digits first */
- String[k] = (UINT8) AcpiUtHexToAsciiChar (Integer, ACPI_MUL_4 (j));
+ String[k] = (UINT8)
+ AcpiUtHexToAsciiChar (Integer, ACPI_MUL_4 (j));
k++;
}
break;
@@ -563,8 +562,8 @@ AcpiExConvertToString (
/* Convert integer to string */
- StringLength = AcpiExConvertToAscii (ObjDesc->Integer.Value, Base,
- NewBuf, AcpiGbl_IntegerByteWidth);
+ StringLength = AcpiExConvertToAscii (
+ ObjDesc->Integer.Value, Base, NewBuf, AcpiGbl_IntegerByteWidth);
/* Null terminate at the correct place */
@@ -653,8 +652,7 @@ AcpiExConvertToString (
for (i = 0; i < ObjDesc->Buffer.Length; i++)
{
NewBuf += AcpiExConvertToAscii (
- (UINT64) ObjDesc->Buffer.Pointer[i], Base,
- NewBuf, 1);
+ (UINT64) ObjDesc->Buffer.Pointer[i], Base, NewBuf, 1);
*NewBuf++ = Separator; /* each separated by a comma or space */
}
@@ -757,8 +755,7 @@ AcpiExConvertToTargetType (
* These types require an Integer operand. We can convert
* a Buffer or a String to an Integer if necessary.
*/
- Status = AcpiExConvertToInteger (SourceDesc, ResultDesc,
- 16);
+ Status = AcpiExConvertToInteger (SourceDesc, ResultDesc, 16);
break;
case ACPI_TYPE_STRING:
@@ -767,7 +764,7 @@ AcpiExConvertToTargetType (
* Integer or Buffer if necessary
*/
Status = AcpiExConvertToString (SourceDesc, ResultDesc,
- ACPI_IMPLICIT_CONVERT_HEX);
+ ACPI_IMPLICIT_CONVERT_HEX);
break;
case ACPI_TYPE_BUFFER:
@@ -780,7 +777,8 @@ AcpiExConvertToTargetType (
default:
- ACPI_ERROR ((AE_INFO, "Bad destination type during conversion: 0x%X",
+ ACPI_ERROR ((AE_INFO,
+ "Bad destination type during conversion: 0x%X",
DestinationType));
Status = AE_AML_INTERNAL;
break;
diff --git a/src/acpica/source/components/executer/excreate.c b/src/acpica/source/components/executer/excreate.c
index 9c7ffc1..fc36956 100644
--- a/src/acpica/source/components/executer/excreate.c
+++ b/src/acpica/source/components/executer/excreate.c
@@ -220,7 +220,7 @@ AcpiExCreateAlias (
* target node or the alias Node
*/
Status = AcpiNsAttachObject (AliasNode,
- AcpiNsGetAttachedObject (TargetNode), TargetNode->Type);
+ AcpiNsGetAttachedObject (TargetNode), TargetNode->Type);
break;
}
@@ -265,7 +265,7 @@ AcpiExCreateEvent (
* that the event is created in an unsignalled state
*/
Status = AcpiOsCreateSemaphore (ACPI_NO_UNIT_LIMIT, 0,
- &ObjDesc->Event.OsSemaphore);
+ &ObjDesc->Event.OsSemaphore);
if (ACPI_FAILURE (Status))
{
goto Cleanup;
@@ -273,8 +273,9 @@ AcpiExCreateEvent (
/* Attach object to the Node */
- Status = AcpiNsAttachObject ((ACPI_NAMESPACE_NODE *) WalkState->Operands[0],
- ObjDesc, ACPI_TYPE_EVENT);
+ Status = AcpiNsAttachObject (
+ (ACPI_NAMESPACE_NODE *) WalkState->Operands[0],
+ ObjDesc, ACPI_TYPE_EVENT);
Cleanup:
/*
@@ -333,7 +334,8 @@ AcpiExCreateMutex (
ObjDesc->Mutex.SyncLevel = (UINT8) WalkState->Operands[1]->Integer.Value;
ObjDesc->Mutex.Node = (ACPI_NAMESPACE_NODE *) WalkState->Operands[0];
- Status = AcpiNsAttachObject (ObjDesc->Mutex.Node, ObjDesc, ACPI_TYPE_MUTEX);
+ Status = AcpiNsAttachObject (
+ ObjDesc->Mutex.Node, ObjDesc, ACPI_TYPE_MUTEX);
Cleanup:
@@ -401,7 +403,8 @@ AcpiExCreateRegion (
* a table load for this exception. Instead, if the region is
* actually used at runtime, abort the executing method.
*/
- ACPI_ERROR ((AE_INFO, "Invalid/unknown Address Space ID: 0x%2.2X", SpaceId));
+ ACPI_ERROR ((AE_INFO,
+ "Invalid/unknown Address Space ID: 0x%2.2X", SpaceId));
}
ACPI_DEBUG_PRINT ((ACPI_DB_LOAD, "Region Type - %s (0x%X)\n",
@@ -496,7 +499,7 @@ AcpiExCreateProcessor (
/* Install the processor object in the parent Node */
Status = AcpiNsAttachObject ((ACPI_NAMESPACE_NODE *) Operand[0],
- ObjDesc, ACPI_TYPE_PROCESSOR);
+ ObjDesc, ACPI_TYPE_PROCESSOR);
/* Remove local reference to the object */
@@ -547,7 +550,7 @@ AcpiExCreatePowerResource (
/* Install the power resource object in the parent Node */
Status = AcpiNsAttachObject ((ACPI_NAMESPACE_NODE *) Operand[0],
- ObjDesc, ACPI_TYPE_POWER);
+ ObjDesc, ACPI_TYPE_POWER);
/* Remove local reference to the object */
@@ -606,7 +609,8 @@ AcpiExCreateMethod (
* flag, and SyncLevel for efficiency.
*/
MethodFlags = (UINT8) Operand[1]->Integer.Value;
- ObjDesc->Method.ParamCount = (UINT8) (MethodFlags & AML_METHOD_ARG_COUNT);
+ ObjDesc->Method.ParamCount = (UINT8)
+ (MethodFlags & AML_METHOD_ARG_COUNT);
/*
* Get the SyncLevel. If method is serialized, a mutex will be
@@ -627,7 +631,7 @@ AcpiExCreateMethod (
/* Attach the new object to the method Node */
Status = AcpiNsAttachObject ((ACPI_NAMESPACE_NODE *) Operand[0],
- ObjDesc, ACPI_TYPE_METHOD);
+ ObjDesc, ACPI_TYPE_METHOD);
/* Remove local reference to the object */
diff --git a/src/acpica/source/components/executer/exdebug.c b/src/acpica/source/components/executer/exdebug.c
index 00ec43f..67bd8fc 100644
--- a/src/acpica/source/components/executer/exdebug.c
+++ b/src/acpica/source/components/executer/exdebug.c
@@ -115,26 +115,13 @@
#include "acpi.h"
#include "accommon.h"
-#include "acnamesp.h"
#include "acinterp.h"
-#include "acparser.h"
#define _COMPONENT ACPI_EXECUTER
ACPI_MODULE_NAME ("exdebug")
-static ACPI_OPERAND_OBJECT *AcpiGbl_TraceMethodObject = NULL;
-
-/* Local prototypes */
-
-#ifdef ACPI_DEBUG_OUTPUT
-static const char *
-AcpiExGetTraceEventName (
- ACPI_TRACE_EVENT_TYPE Type);
-#endif
-
-
#ifndef ACPI_NO_ERROR_MESSAGES
/*******************************************************************************
*
@@ -225,7 +212,7 @@ AcpiExDoDebugObject (
{
AcpiOsPrintf ("%s: %p\n",
AcpiUtGetTypeName (((ACPI_NAMESPACE_NODE *) SourceDesc)->Type),
- SourceDesc);
+ SourceDesc);
return_VOID;
}
else
@@ -277,7 +264,7 @@ AcpiExDoDebugObject (
for (i = 0; i < SourceDesc->Package.Count; i++)
{
AcpiExDoDebugObject (SourceDesc->Package.Elements[i],
- Level+4, i+1);
+ Level + 4, i + 1);
}
break;
@@ -313,7 +300,7 @@ AcpiExDoDebugObject (
if (SourceDesc->Reference.Node)
{
if (ACPI_GET_DESCRIPTOR_TYPE (SourceDesc->Reference.Node) !=
- ACPI_DESC_TYPE_NAMED)
+ ACPI_DESC_TYPE_NAMED)
{
AcpiOsPrintf (" %p - Not a valid namespace node\n",
SourceDesc->Reference.Node);
@@ -338,7 +325,7 @@ AcpiExDoDebugObject (
default:
AcpiExDoDebugObject ((SourceDesc->Reference.Node)->Object,
- Level+4, 0);
+ Level + 4, 0);
break;
}
}
@@ -346,11 +333,11 @@ AcpiExDoDebugObject (
else if (SourceDesc->Reference.Object)
{
if (ACPI_GET_DESCRIPTOR_TYPE (SourceDesc->Reference.Object) ==
- ACPI_DESC_TYPE_NAMED)
+ ACPI_DESC_TYPE_NAMED)
{
AcpiExDoDebugObject (((ACPI_NAMESPACE_NODE *)
SourceDesc->Reference.Object)->Object,
- Level+4, 0);
+ Level + 4, 0);
}
else
{
@@ -399,362 +386,3 @@ AcpiExDoDebugObject (
return_VOID;
}
#endif
-
-
-/*******************************************************************************
- *
- * FUNCTION: AcpiExInterpreterTraceEnabled
- *
- * PARAMETERS: Name - Whether method name should be matched,
- * this should be checked before starting
- * the tracer
- *
- * RETURN: TRUE if interpreter trace is enabled.
- *
- * DESCRIPTION: Check whether interpreter trace is enabled
- *
- ******************************************************************************/
-
-static BOOLEAN
-AcpiExInterpreterTraceEnabled (
- char *Name)
-{
-
- /* Check if tracing is enabled */
-
- if (!(AcpiGbl_TraceFlags & ACPI_TRACE_ENABLED))
- {
- return (FALSE);
- }
-
- /*
- * Check if tracing is filtered:
- *
- * 1. If the tracer is started, AcpiGbl_TraceMethodObject should have
- * been filled by the trace starter
- * 2. If the tracer is not started, AcpiGbl_TraceMethodName should be
- * matched if it is specified
- * 3. If the tracer is oneshot style, AcpiGbl_TraceMethodName should
- * not be cleared by the trace stopper during the first match
- */
- if (AcpiGbl_TraceMethodObject)
- {
- return (TRUE);
- }
- if (Name &&
- (AcpiGbl_TraceMethodName &&
- strcmp (AcpiGbl_TraceMethodName, Name)))
- {
- return (FALSE);
- }
- if ((AcpiGbl_TraceFlags & ACPI_TRACE_ONESHOT) &&
- !AcpiGbl_TraceMethodName)
- {
- return (FALSE);
- }
-
- return (TRUE);
-}
-
-
-/*******************************************************************************
- *
- * FUNCTION: AcpiExGetTraceEventName
- *
- * PARAMETERS: Type - Trace event type
- *
- * RETURN: Trace event name.
- *
- * DESCRIPTION: Used to obtain the full trace event name.
- *
- ******************************************************************************/
-
-#ifdef ACPI_DEBUG_OUTPUT
-
-static const char *
-AcpiExGetTraceEventName (
- ACPI_TRACE_EVENT_TYPE Type)
-{
- switch (Type)
- {
- case ACPI_TRACE_AML_METHOD:
-
- return "Method";
-
- case ACPI_TRACE_AML_OPCODE:
-
- return "Opcode";
-
- case ACPI_TRACE_AML_REGION:
-
- return "Region";
-
- default:
-
- return "";
- }
-}
-
-#endif
-
-
-/*******************************************************************************
- *
- * FUNCTION: AcpiExTracePoint
- *
- * PARAMETERS: Type - Trace event type
- * Begin - TRUE if before execution
- * Aml - Executed AML address
- * Pathname - Object path
- *
- * RETURN: None
- *
- * DESCRIPTION: Internal interpreter execution trace.
- *
- ******************************************************************************/
-
-void
-AcpiExTracePoint (
- ACPI_TRACE_EVENT_TYPE Type,
- BOOLEAN Begin,
- UINT8 *Aml,
- char *Pathname)
-{
-
- ACPI_FUNCTION_NAME (ExTracePoint);
-
-
- if (Pathname)
- {
- ACPI_DEBUG_PRINT ((ACPI_DB_TRACE_POINT,
- "%s %s [0x%p:%s] execution.\n",
- AcpiExGetTraceEventName (Type), Begin ? "Begin" : "End",
- Aml, Pathname));
- }
- else
- {
- ACPI_DEBUG_PRINT ((ACPI_DB_TRACE_POINT,
- "%s %s [0x%p] execution.\n",
- AcpiExGetTraceEventName (Type), Begin ? "Begin" : "End",
- Aml));
- }
-}
-
-
-/*******************************************************************************
- *
- * FUNCTION: AcpiExStartTraceMethod
- *
- * PARAMETERS: MethodNode - Node of the method
- * ObjDesc - The method object
- * WalkState - current state, NULL if not yet executing
- * a method.
- *
- * RETURN: None
- *
- * DESCRIPTION: Start control method execution trace
- *
- ******************************************************************************/
-
-void
-AcpiExStartTraceMethod (
- ACPI_NAMESPACE_NODE *MethodNode,
- ACPI_OPERAND_OBJECT *ObjDesc,
- ACPI_WALK_STATE *WalkState)
-{
- ACPI_STATUS Status;
- char *Pathname = NULL;
- BOOLEAN Enabled = FALSE;
-
-
- ACPI_FUNCTION_NAME (ExStartTraceMethod);
-
-
- if (MethodNode)
- {
- Pathname = AcpiNsGetNormalizedPathname (MethodNode, TRUE);
- }
-
- Status = AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE);
- if (ACPI_FAILURE (Status))
- {
- goto Exit;
- }
-
- Enabled = AcpiExInterpreterTraceEnabled (Pathname);
- if (Enabled && !AcpiGbl_TraceMethodObject)
- {
- AcpiGbl_TraceMethodObject = ObjDesc;
- AcpiGbl_OriginalDbgLevel = AcpiDbgLevel;
- AcpiGbl_OriginalDbgLayer = AcpiDbgLayer;
- AcpiDbgLevel = ACPI_TRACE_LEVEL_ALL;
- AcpiDbgLayer = ACPI_TRACE_LAYER_ALL;
-
- if (AcpiGbl_TraceDbgLevel)
- {
- AcpiDbgLevel = AcpiGbl_TraceDbgLevel;
- }
- if (AcpiGbl_TraceDbgLayer)
- {
- AcpiDbgLayer = AcpiGbl_TraceDbgLayer;
- }
- }
- (void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE);
-
-Exit:
- if (Enabled)
- {
- ACPI_TRACE_POINT (ACPI_TRACE_AML_METHOD, TRUE,
- ObjDesc ? ObjDesc->Method.AmlStart : NULL, Pathname);
- }
- if (Pathname)
- {
- ACPI_FREE (Pathname);
- }
-}
-
-
-/*******************************************************************************
- *
- * FUNCTION: AcpiExStopTraceMethod
- *
- * PARAMETERS: MethodNode - Node of the method
- * ObjDesc - The method object
- * WalkState - current state, NULL if not yet executing
- * a method.
- *
- * RETURN: None
- *
- * DESCRIPTION: Stop control method execution trace
- *
- ******************************************************************************/
-
-void
-AcpiExStopTraceMethod (
- ACPI_NAMESPACE_NODE *MethodNode,
- ACPI_OPERAND_OBJECT *ObjDesc,
- ACPI_WALK_STATE *WalkState)
-{
- ACPI_STATUS Status;
- char *Pathname = NULL;
- BOOLEAN Enabled;
-
-
- ACPI_FUNCTION_NAME (ExStopTraceMethod);
-
-
- if (MethodNode)
- {
- Pathname = AcpiNsGetNormalizedPathname (MethodNode, TRUE);
- }
-
- Status = AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE);
- if (ACPI_FAILURE (Status))
- {
- goto ExitPath;
- }
-
- Enabled = AcpiExInterpreterTraceEnabled (NULL);
-
- (void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE);
-
- if (Enabled)
- {
- ACPI_TRACE_POINT (ACPI_TRACE_AML_METHOD, FALSE,
- ObjDesc ? ObjDesc->Method.AmlStart : NULL, Pathname);
- }
-
- Status = AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE);
- if (ACPI_FAILURE (Status))
- {
- goto ExitPath;
- }
-
- /* Check whether the tracer should be stopped */
-
- if (AcpiGbl_TraceMethodObject == ObjDesc)
- {
- /* Disable further tracing if type is one-shot */
-
- if (AcpiGbl_TraceFlags & ACPI_TRACE_ONESHOT)
- {
- AcpiGbl_TraceMethodName = NULL;
- }
-
- AcpiDbgLevel = AcpiGbl_OriginalDbgLevel;
- AcpiDbgLayer = AcpiGbl_OriginalDbgLayer;
- AcpiGbl_TraceMethodObject = NULL;
- }
-
- (void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE);
-
-ExitPath:
- if (Pathname)
- {
- ACPI_FREE (Pathname);
- }
-}
-
-
-/*******************************************************************************
- *
- * FUNCTION: AcpiExStartTraceOpcode
- *
- * PARAMETERS: Op - The parser opcode object
- * WalkState - current state, NULL if not yet executing
- * a method.
- *
- * RETURN: None
- *
- * DESCRIPTION: Start opcode execution trace
- *
- ******************************************************************************/
-
-void
-AcpiExStartTraceOpcode (
- ACPI_PARSE_OBJECT *Op,
- ACPI_WALK_STATE *WalkState)
-{
-
- ACPI_FUNCTION_NAME (ExStartTraceOpcode);
-
-
- if (AcpiExInterpreterTraceEnabled (NULL) &&
- (AcpiGbl_TraceFlags & ACPI_TRACE_OPCODE))
- {
- ACPI_TRACE_POINT (ACPI_TRACE_AML_OPCODE, TRUE,
- Op->Common.Aml, Op->Common.AmlOpName);
- }
-}
-
-
-/*******************************************************************************
- *
- * FUNCTION: AcpiExStopTraceOpcode
- *
- * PARAMETERS: Op - The parser opcode object
- * WalkState - current state, NULL if not yet executing
- * a method.
- *
- * RETURN: None
- *
- * DESCRIPTION: Stop opcode execution trace
- *
- ******************************************************************************/
-
-void
-AcpiExStopTraceOpcode (
- ACPI_PARSE_OBJECT *Op,
- ACPI_WALK_STATE *WalkState)
-{
-
- ACPI_FUNCTION_NAME (ExStopTraceOpcode);
-
-
- if (AcpiExInterpreterTraceEnabled (NULL) &&
- (AcpiGbl_TraceFlags & ACPI_TRACE_OPCODE))
- {
- ACPI_TRACE_POINT (ACPI_TRACE_AML_OPCODE, FALSE,
- Op->Common.Aml, Op->Common.AmlOpName);
- }
-}
diff --git a/src/acpica/source/components/executer/exdump.c b/src/acpica/source/components/executer/exdump.c
index c682777..73acfd4 100644
--- a/src/acpica/source/components/executer/exdump.c
+++ b/src/acpica/source/components/executer/exdump.c
@@ -525,7 +525,8 @@ AcpiExDumpObject (
case ACPI_EXD_BUFFER:
- ACPI_DUMP_BUFFER (ObjDesc->Buffer.Pointer, ObjDesc->Buffer.Length);
+ ACPI_DUMP_BUFFER (
+ ObjDesc->Buffer.Pointer, ObjDesc->Buffer.Length);
break;
case ACPI_EXD_PACKAGE:
@@ -544,7 +545,8 @@ AcpiExDumpObject (
case ACPI_EXD_REFERENCE:
ReferenceName = AcpiUtGetReferenceName (ObjDesc);
- AcpiExOutString ("Class Name", ACPI_CAST_PTR (char, ReferenceName));
+ AcpiExOutString (
+ "Class Name", ACPI_CAST_PTR (char, ReferenceName));
AcpiExDumpReferenceObj (ObjDesc);
break;
@@ -573,7 +575,8 @@ AcpiExDumpObject (
if ((Next == Start) || (Next == Data))
{
- AcpiOsPrintf ("\n**** Error: Object list appears to be circular linked");
+ AcpiOsPrintf (
+ "\n**** Error: Object list appears to be circular linked");
break;
}
}
@@ -607,7 +610,8 @@ AcpiExDumpObject (
if ((Next == Start) || (Next == Data))
{
- AcpiOsPrintf ("\n**** Error: Handler list appears to be circular linked");
+ AcpiOsPrintf (
+ "\n**** Error: Handler list appears to be circular linked");
break;
}
}
@@ -641,7 +645,8 @@ AcpiExDumpObject (
if ((Next == Start) || (Next == Data))
{
- AcpiOsPrintf ("\n**** Error: Region list appears to be circular linked");
+ AcpiOsPrintf (
+ "\n**** Error: Region list appears to be circular linked");
break;
}
}
@@ -749,7 +754,8 @@ AcpiExDumpOperand (
{
case ACPI_TYPE_LOCAL_REFERENCE:
- AcpiOsPrintf ("Reference: [%s] ", AcpiUtGetReferenceName (ObjDesc));
+ AcpiOsPrintf ("Reference: [%s] ",
+ AcpiUtGetReferenceName (ObjDesc));
switch (ObjDesc->Reference.Class)
{
@@ -777,7 +783,8 @@ AcpiExDumpOperand (
case ACPI_REFCLASS_NAME:
- AcpiOsPrintf ("- [%4.4s]\n", ObjDesc->Reference.Node->Name.Ascii);
+ AcpiOsPrintf ("- [%4.4s]\n",
+ ObjDesc->Reference.Node->Name.Ascii);
break;
case ACPI_REFCLASS_ARG:
@@ -808,8 +815,8 @@ AcpiExDumpOperand (
Length = 128;
}
- AcpiOsPrintf ("Buffer Contents: (displaying length 0x%.2X)\n",
- Length);
+ AcpiOsPrintf (
+ "Buffer Contents: (displaying length 0x%.2X)\n", Length);
ACPI_DUMP_BUFFER (ObjDesc->Buffer.Pointer, Length);
}
break;
@@ -835,7 +842,8 @@ AcpiExDumpOperand (
{
for (Index = 0; Index < ObjDesc->Package.Count; Index++)
{
- AcpiExDumpOperand (ObjDesc->Package.Elements[Index], Depth+1);
+ AcpiExDumpOperand (
+ ObjDesc->Package.Elements[Index], Depth + 1);
}
}
break;
@@ -888,7 +896,7 @@ AcpiExDumpOperand (
ObjDesc->Field.BaseByteOffset,
ObjDesc->Field.StartFieldBitOffset);
- AcpiExDumpOperand (ObjDesc->Field.RegionObj, Depth+1);
+ AcpiExDumpOperand (ObjDesc->Field.RegionObj, Depth + 1);
break;
case ACPI_TYPE_LOCAL_INDEX_FIELD:
@@ -908,13 +916,13 @@ AcpiExDumpOperand (
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "*NULL*\n"));
}
else if ((ObjDesc->BufferField.BufferObj)->Common.Type !=
- ACPI_TYPE_BUFFER)
+ ACPI_TYPE_BUFFER)
{
AcpiOsPrintf ("*not a Buffer*\n");
}
else
{
- AcpiExDumpOperand (ObjDesc->BufferField.BufferObj, Depth+1);
+ AcpiExDumpOperand (ObjDesc->BufferField.BufferObj, Depth + 1);
}
break;
@@ -1214,7 +1222,8 @@ AcpiExDumpPackageObj (
AcpiOsPrintf ("[Buffer] Length %.2X = ", ObjDesc->Buffer.Length);
if (ObjDesc->Buffer.Length)
{
- AcpiUtDebugDumpBuffer (ACPI_CAST_PTR (UINT8, ObjDesc->Buffer.Pointer),
+ AcpiUtDebugDumpBuffer (
+ ACPI_CAST_PTR (UINT8, ObjDesc->Buffer.Pointer),
ObjDesc->Buffer.Length, DB_DWORD_DISPLAY, _COMPONENT);
}
else
@@ -1230,7 +1239,8 @@ AcpiExDumpPackageObj (
for (i = 0; i < ObjDesc->Package.Count; i++)
{
- AcpiExDumpPackageObj (ObjDesc->Package.Elements[i], Level+1, i);
+ AcpiExDumpPackageObj (
+ ObjDesc->Package.Elements[i], Level + 1, i);
}
break;
@@ -1328,7 +1338,8 @@ DumpObject:
ObjDesc = ObjDesc->Common.NextObject;
if (ObjDesc->Common.Type > ACPI_TYPE_LOCAL_MAX)
{
- AcpiOsPrintf ("Secondary object is not a known object type: %2.2X\n",
+ AcpiOsPrintf (
+ "Secondary object is not a known object type: %2.2X\n",
ObjDesc->Common.Type);
return_VOID;
diff --git a/src/acpica/source/components/executer/exfield.c b/src/acpica/source/components/executer/exfield.c
index dbd294b..b70e080 100644
--- a/src/acpica/source/components/executer/exfield.c
+++ b/src/acpica/source/components/executer/exfield.c
@@ -256,28 +256,31 @@ AcpiExReadDataFromField (
ObjDesc->Field.RegionObj->Region.SpaceId == ACPI_ADR_SPACE_IPMI))
{
/*
- * This is an SMBus, GSBus or IPMI read. We must create a buffer to hold
- * the data and then directly access the region handler.
+ * This is an SMBus, GSBus or IPMI read. We must create a buffer to
+ * hold the data and then directly access the region handler.
*
- * Note: SMBus and GSBus protocol value is passed in upper 16-bits of Function
+ * Note: SMBus and GSBus protocol value is passed in upper 16-bits
+ * of Function
*/
- if (ObjDesc->Field.RegionObj->Region.SpaceId == ACPI_ADR_SPACE_SMBUS)
+ if (ObjDesc->Field.RegionObj->Region.SpaceId ==
+ ACPI_ADR_SPACE_SMBUS)
{
Length = ACPI_SMBUS_BUFFER_SIZE;
Function = ACPI_READ | (ObjDesc->Field.Attribute << 16);
}
- else if (ObjDesc->Field.RegionObj->Region.SpaceId == ACPI_ADR_SPACE_GSBUS)
+ else if (ObjDesc->Field.RegionObj->Region.SpaceId ==
+ ACPI_ADR_SPACE_GSBUS)
{
AccessorType = ObjDesc->Field.Attribute;
- Length = AcpiExGetSerialAccessLength (AccessorType,
- ObjDesc->Field.AccessLength);
+ Length = AcpiExGetSerialAccessLength (
+ AccessorType, ObjDesc->Field.AccessLength);
/*
* Add additional 2 bytes for the GenericSerialBus data buffer:
*
- * Status; (Byte 0 of the data buffer)
- * Length; (Byte 1 of the data buffer)
- * Data[x-1]; (Bytes 2-x of the arbitrary length data buffer)
+ * Status; (Byte 0 of the data buffer)
+ * Length; (Byte 1 of the data buffer)
+ * Data[x-1]: (Bytes 2-x of the arbitrary length data buffer)
*/
Length += 2;
Function = ACPI_READ | (AccessorType << 16);
@@ -301,8 +304,8 @@ AcpiExReadDataFromField (
/* Call the region handler for the read */
Status = AcpiExAccessRegion (ObjDesc, 0,
- ACPI_CAST_PTR (UINT64, BufferDesc->Buffer.Pointer),
- Function);
+ ACPI_CAST_PTR (UINT64, BufferDesc->Buffer.Pointer), Function);
+
AcpiExReleaseGlobalLock (ObjDesc->CommonField.FieldFlags);
goto Exit;
}
@@ -317,7 +320,9 @@ AcpiExReadDataFromField (
*
* Note: Field.length is in bits.
*/
- Length = (ACPI_SIZE) ACPI_ROUND_BITS_UP_TO_BYTES (ObjDesc->Field.BitLength);
+ Length = (ACPI_SIZE) ACPI_ROUND_BITS_UP_TO_BYTES (
+ ObjDesc->Field.BitLength);
+
if (Length > AcpiGbl_IntegerByteWidth)
{
/* Field is too large for an Integer, create a Buffer instead */
@@ -362,8 +367,9 @@ AcpiExReadDataFromField (
/* Perform the write */
- Status = AcpiExAccessRegion (ObjDesc, 0,
- (UINT64 *) Buffer, ACPI_READ);
+ Status = AcpiExAccessRegion (
+ ObjDesc, 0, (UINT64 *) Buffer, ACPI_READ);
+
AcpiExReleaseGlobalLock (ObjDesc->CommonField.FieldFlags);
if (ACPI_FAILURE (Status))
{
@@ -468,42 +474,47 @@ AcpiExWriteDataToField (
ObjDesc->Field.RegionObj->Region.SpaceId == ACPI_ADR_SPACE_IPMI))
{
/*
- * This is an SMBus, GSBus or IPMI write. We will bypass the entire field
- * mechanism and handoff the buffer directly to the handler. For
- * these address spaces, the buffer is bi-directional; on a write,
- * return data is returned in the same buffer.
+ * This is an SMBus, GSBus or IPMI write. We will bypass the entire
+ * field mechanism and handoff the buffer directly to the handler.
+ * For these address spaces, the buffer is bi-directional; on a
+ * write, return data is returned in the same buffer.
*
* Source must be a buffer of sufficient size:
- * ACPI_SMBUS_BUFFER_SIZE, ACPI_GSBUS_BUFFER_SIZE, or ACPI_IPMI_BUFFER_SIZE.
+ * ACPI_SMBUS_BUFFER_SIZE, ACPI_GSBUS_BUFFER_SIZE, or
+ * ACPI_IPMI_BUFFER_SIZE.
*
- * Note: SMBus and GSBus protocol type is passed in upper 16-bits of Function
+ * Note: SMBus and GSBus protocol type is passed in upper 16-bits
+ * of Function
*/
if (SourceDesc->Common.Type != ACPI_TYPE_BUFFER)
{
ACPI_ERROR ((AE_INFO,
- "SMBus/IPMI/GenericSerialBus write requires Buffer, found type %s",
+ "SMBus/IPMI/GenericSerialBus write requires "
+ "Buffer, found type %s",
AcpiUtGetObjectTypeName (SourceDesc)));
return_ACPI_STATUS (AE_AML_OPERAND_TYPE);
}
- if (ObjDesc->Field.RegionObj->Region.SpaceId == ACPI_ADR_SPACE_SMBUS)
+ if (ObjDesc->Field.RegionObj->Region.SpaceId ==
+ ACPI_ADR_SPACE_SMBUS)
{
Length = ACPI_SMBUS_BUFFER_SIZE;
Function = ACPI_WRITE | (ObjDesc->Field.Attribute << 16);
}
- else if (ObjDesc->Field.RegionObj->Region.SpaceId == ACPI_ADR_SPACE_GSBUS)
+ else if (ObjDesc->Field.RegionObj->Region.SpaceId ==
+ ACPI_ADR_SPACE_GSBUS)
{
AccessorType = ObjDesc->Field.Attribute;
- Length = AcpiExGetSerialAccessLength (AccessorType,
- ObjDesc->Field.AccessLength);
+ Length = AcpiExGetSerialAccessLength (
+ AccessorType, ObjDesc->Field.AccessLength);
/*
* Add additional 2 bytes for the GenericSerialBus data buffer:
*
- * Status; (Byte 0 of the data buffer)
- * Length; (Byte 1 of the data buffer)
- * Data[x-1]; (Bytes 2-x of the arbitrary length data buffer)
+ * Status; (Byte 0 of the data buffer)
+ * Length; (Byte 1 of the data buffer)
+ * Data[x-1]: (Bytes 2-x of the arbitrary length data buffer)
*/
Length += 2;
Function = ACPI_WRITE | (AccessorType << 16);
@@ -517,7 +528,8 @@ AcpiExWriteDataToField (
if (SourceDesc->Buffer.Length < Length)
{
ACPI_ERROR ((AE_INFO,
- "SMBus/IPMI/GenericSerialBus write requires Buffer of length %u, found length %u",
+ "SMBus/IPMI/GenericSerialBus write requires "
+ "Buffer of length %u, found length %u",
Length, SourceDesc->Buffer.Length));
return_ACPI_STATUS (AE_AML_BUFFER_LIMIT);
@@ -542,8 +554,8 @@ AcpiExWriteDataToField (
* Perform the write (returns status and perhaps data in the
* same buffer)
*/
- Status = AcpiExAccessRegion (ObjDesc, 0,
- (UINT64 *) Buffer, Function);
+ Status = AcpiExAccessRegion (
+ ObjDesc, 0, (UINT64 *) Buffer, Function);
AcpiExReleaseGlobalLock (ObjDesc->CommonField.FieldFlags);
*ResultDesc = BufferDesc;
@@ -566,7 +578,7 @@ AcpiExWriteDataToField (
}
ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD,
- "GPIO FieldWrite [FROM]: (%s:%X), Val %.8X [TO]: Pin %u Bits %u\n",
+ "GPIO FieldWrite [FROM]: (%s:%X), Val %.8X [TO]: Pin %u Bits %u\n",
AcpiUtGetTypeName (SourceDesc->Common.Type),
SourceDesc->Common.Type, (UINT32) SourceDesc->Integer.Value,
ObjDesc->Field.PinNumberIndex, ObjDesc->Field.BitLength));
@@ -579,8 +591,8 @@ AcpiExWriteDataToField (
/* Perform the write */
- Status = AcpiExAccessRegion (ObjDesc, 0,
- (UINT64 *) Buffer, ACPI_WRITE);
+ Status = AcpiExAccessRegion (
+ ObjDesc, 0, (UINT64 *) Buffer, ACPI_WRITE);
AcpiExReleaseGlobalLock (ObjDesc->CommonField.FieldFlags);
return_ACPI_STATUS (Status);
}
diff --git a/src/acpica/source/components/executer/exfldio.c b/src/acpica/source/components/executer/exfldio.c
index 39a0f37..106405a 100644
--- a/src/acpica/source/components/executer/exfldio.c
+++ b/src/acpica/source/components/executer/exfldio.c
@@ -192,7 +192,8 @@ AcpiExSetupRegion (
if (!AcpiIsValidSpaceId (SpaceId))
{
- ACPI_ERROR ((AE_INFO, "Invalid/unknown Address Space ID: 0x%2.2X", SpaceId));
+ ACPI_ERROR ((AE_INFO,
+ "Invalid/unknown Address Space ID: 0x%2.2X", SpaceId));
return_ACPI_STATUS (AE_AML_INVALID_SPACE_ID);
}
@@ -242,8 +243,8 @@ AcpiExSetupRegion (
* (Region length is specified in bytes)
*/
if (RgnDesc->Region.Length <
- (ObjDesc->CommonField.BaseByteOffset + FieldDatumByteOffset +
- ObjDesc->CommonField.AccessByteWidth))
+ (ObjDesc->CommonField.BaseByteOffset + FieldDatumByteOffset +
+ ObjDesc->CommonField.AccessByteWidth))
{
if (AcpiGbl_EnableInterpreterSlack)
{
@@ -270,7 +271,8 @@ AcpiExSetupRegion (
* byte, and a field with Dword access specified.
*/
ACPI_ERROR ((AE_INFO,
- "Field [%4.4s] access width (%u bytes) too large for region [%4.4s] (length %u)",
+ "Field [%4.4s] access width (%u bytes) "
+ "too large for region [%4.4s] (length %u)",
AcpiUtGetNodeName (ObjDesc->CommonField.Node),
ObjDesc->CommonField.AccessByteWidth,
AcpiUtGetNodeName (RgnDesc->Region.Node),
@@ -282,7 +284,8 @@ AcpiExSetupRegion (
* exceeds region length, indicate an error
*/
ACPI_ERROR ((AE_INFO,
- "Field [%4.4s] Base+Offset+Width %u+%u+%u is beyond end of region [%4.4s] (length %u)",
+ "Field [%4.4s] Base+Offset+Width %u+%u+%u "
+ "is beyond end of region [%4.4s] (length %u)",
AcpiUtGetNodeName (ObjDesc->CommonField.Node),
ObjDesc->CommonField.BaseByteOffset,
FieldDatumByteOffset, ObjDesc->CommonField.AccessByteWidth,
@@ -372,8 +375,8 @@ AcpiExAccessRegion (
/* Invoke the appropriate AddressSpace/OpRegion handler */
Status = AcpiEvAddressSpaceDispatch (RgnDesc, ObjDesc,
- Function, RegionOffset,
- ACPI_MUL_8 (ObjDesc->CommonField.AccessByteWidth), Value);
+ Function, RegionOffset,
+ ACPI_MUL_8 (ObjDesc->CommonField.AccessByteWidth), Value);
if (ACPI_FAILURE (Status))
{
@@ -584,8 +587,8 @@ AcpiExFieldDatumIo (
* For simple RegionFields, we just directly access the owning
* Operation Region.
*/
- Status = AcpiExAccessRegion (ObjDesc, FieldDatumByteOffset, Value,
- ReadWrite);
+ Status = AcpiExAccessRegion (
+ ObjDesc, FieldDatumByteOffset, Value, ReadWrite);
break;
case ACPI_TYPE_LOCAL_INDEX_FIELD:
@@ -608,8 +611,7 @@ AcpiExFieldDatumIo (
FieldDatumByteOffset));
Status = AcpiExInsertIntoField (ObjDesc->IndexField.IndexObj,
- &FieldDatumByteOffset,
- sizeof (FieldDatumByteOffset));
+ &FieldDatumByteOffset, sizeof (FieldDatumByteOffset));
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
@@ -622,8 +624,8 @@ AcpiExFieldDatumIo (
ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD,
"Read from Data Register\n"));
- Status = AcpiExExtractFromField (ObjDesc->IndexField.DataObj,
- Value, sizeof (UINT64));
+ Status = AcpiExExtractFromField (
+ ObjDesc->IndexField.DataObj, Value, sizeof (UINT64));
}
else
{
@@ -633,8 +635,8 @@ AcpiExFieldDatumIo (
"Write to Data Register: Value %8.8X%8.8X\n",
ACPI_FORMAT_UINT64 (*Value)));
- Status = AcpiExInsertIntoField (ObjDesc->IndexField.DataObj,
- Value, sizeof (UINT64));
+ Status = AcpiExInsertIntoField (
+ ObjDesc->IndexField.DataObj, Value, sizeof (UINT64));
}
break;
@@ -716,14 +718,14 @@ AcpiExWriteWithUpdateRule (
* ones) The left shift drops the bits we want to ignore.
*/
if ((~Mask << (ACPI_MUL_8 (sizeof (Mask)) -
- ACPI_MUL_8 (ObjDesc->CommonField.AccessByteWidth))) != 0)
+ ACPI_MUL_8 (ObjDesc->CommonField.AccessByteWidth))) != 0)
{
/*
* Read the current contents of the byte/word/dword containing
* the field, and merge with the new field value.
*/
- Status = AcpiExFieldDatumIo (ObjDesc, FieldDatumByteOffset,
- &CurrentValue, ACPI_READ);
+ Status = AcpiExFieldDatumIo (
+ ObjDesc, FieldDatumByteOffset, &CurrentValue, ACPI_READ);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
@@ -751,13 +753,15 @@ AcpiExWriteWithUpdateRule (
ACPI_ERROR ((AE_INFO,
"Unknown UpdateRule value: 0x%X",
- (ObjDesc->CommonField.FieldFlags & AML_FIELD_UPDATE_RULE_MASK)));
+ (ObjDesc->CommonField.FieldFlags &
+ AML_FIELD_UPDATE_RULE_MASK)));
return_ACPI_STATUS (AE_AML_OPERAND_VALUE);
}
}
ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD,
- "Mask %8.8X%8.8X, DatumOffset %X, Width %X, Value %8.8X%8.8X, MergedValue %8.8X%8.8X\n",
+ "Mask %8.8X%8.8X, DatumOffset %X, Width %X, "
+ "Value %8.8X%8.8X, MergedValue %8.8X%8.8X\n",
ACPI_FORMAT_UINT64 (Mask),
FieldDatumByteOffset,
ObjDesc->CommonField.AccessByteWidth,
@@ -766,8 +770,8 @@ AcpiExWriteWithUpdateRule (
/* Write the merged value */
- Status = AcpiExFieldDatumIo (ObjDesc, FieldDatumByteOffset,
- &MergedValue, ACPI_WRITE);
+ Status = AcpiExFieldDatumIo (
+ ObjDesc, FieldDatumByteOffset, &MergedValue, ACPI_WRITE);
return_ACPI_STATUS (Status);
}
@@ -878,8 +882,8 @@ AcpiExExtractFromField (
/* Get next input datum from the field */
FieldOffset += ObjDesc->CommonField.AccessByteWidth;
- Status = AcpiExFieldDatumIo (ObjDesc, FieldOffset,
- &RawDatum, ACPI_READ);
+ Status = AcpiExFieldDatumIo (
+ ObjDesc, FieldOffset, &RawDatum, ACPI_READ);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
@@ -976,7 +980,8 @@ AcpiExInsertIntoField (
NewBuffer = NULL;
RequiredLength = ACPI_ROUND_BITS_UP_TO_BYTES (
- ObjDesc->CommonField.BitLength);
+ ObjDesc->CommonField.BitLength);
+
/*
* We must have a buffer that is at least as long as the field
* we are writing to. This is because individual fields are
@@ -1054,8 +1059,8 @@ AcpiExInsertIntoField (
/* Write merged datum to the target field */
MergedDatum &= Mask;
- Status = AcpiExWriteWithUpdateRule (ObjDesc, Mask,
- MergedDatum, FieldOffset);
+ Status = AcpiExWriteWithUpdateRule (
+ ObjDesc, Mask, MergedDatum, FieldOffset);
if (ACPI_FAILURE (Status))
{
goto Exit;
@@ -1112,8 +1117,8 @@ AcpiExInsertIntoField (
/* Write the last datum to the field */
MergedDatum &= Mask;
- Status = AcpiExWriteWithUpdateRule (ObjDesc,
- Mask, MergedDatum, FieldOffset);
+ Status = AcpiExWriteWithUpdateRule (
+ ObjDesc, Mask, MergedDatum, FieldOffset);
Exit:
/* Free temporary buffer if we used one */
diff --git a/src/acpica/source/components/executer/exmisc.c b/src/acpica/source/components/executer/exmisc.c
index f678670..c2e04bb 100644
--- a/src/acpica/source/components/executer/exmisc.c
+++ b/src/acpica/source/components/executer/exmisc.c
@@ -360,8 +360,8 @@ AcpiExDoConcatenate (
case ACPI_TYPE_STRING:
- Status = AcpiExConvertToString (Operand1, &LocalOperand1,
- ACPI_IMPLICIT_CONVERT_HEX);
+ Status = AcpiExConvertToString (
+ Operand1, &LocalOperand1, ACPI_IMPLICIT_CONVERT_HEX);
break;
case ACPI_TYPE_BUFFER:
@@ -401,8 +401,8 @@ AcpiExDoConcatenate (
/* Result of two Integers is a Buffer */
/* Need enough buffer space for two integers */
- ReturnDesc = AcpiUtCreateBufferObject ((ACPI_SIZE)
- ACPI_MUL_2 (AcpiGbl_IntegerByteWidth));
+ ReturnDesc = AcpiUtCreateBufferObject (
+ (ACPI_SIZE) ACPI_MUL_2 (AcpiGbl_IntegerByteWidth));
if (!ReturnDesc)
{
Status = AE_NO_MEMORY;
@@ -414,13 +414,12 @@ AcpiExDoConcatenate (
/* Copy the first integer, LSB first */
memcpy (NewBuf, &Operand0->Integer.Value,
- AcpiGbl_IntegerByteWidth);
+ AcpiGbl_IntegerByteWidth);
/* Copy the second integer (LSB first) after the first */
memcpy (NewBuf + AcpiGbl_IntegerByteWidth,
- &LocalOperand1->Integer.Value,
- AcpiGbl_IntegerByteWidth);
+ &LocalOperand1->Integer.Value, AcpiGbl_IntegerByteWidth);
break;
case ACPI_TYPE_STRING:
@@ -428,8 +427,8 @@ AcpiExDoConcatenate (
/* Result of two Strings is a String */
ReturnDesc = AcpiUtCreateStringObject (
- ((ACPI_SIZE) Operand0->String.Length +
- LocalOperand1->String.Length));
+ ((ACPI_SIZE) Operand0->String.Length +
+ LocalOperand1->String.Length));
if (!ReturnDesc)
{
Status = AE_NO_MEMORY;
@@ -442,7 +441,7 @@ AcpiExDoConcatenate (
strcpy (NewBuf, Operand0->String.Pointer);
strcpy (NewBuf + Operand0->String.Length,
- LocalOperand1->String.Pointer);
+ LocalOperand1->String.Pointer);
break;
case ACPI_TYPE_BUFFER:
@@ -450,8 +449,8 @@ AcpiExDoConcatenate (
/* Result of two Buffers is a Buffer */
ReturnDesc = AcpiUtCreateBufferObject (
- ((ACPI_SIZE) Operand0->Buffer.Length +
- LocalOperand1->Buffer.Length));
+ ((ACPI_SIZE) Operand0->Buffer.Length +
+ LocalOperand1->Buffer.Length));
if (!ReturnDesc)
{
Status = AE_NO_MEMORY;
@@ -463,10 +462,10 @@ AcpiExDoConcatenate (
/* Concatenate the buffers */
memcpy (NewBuf, Operand0->Buffer.Pointer,
- Operand0->Buffer.Length);
+ Operand0->Buffer.Length);
memcpy (NewBuf + Operand0->Buffer.Length,
- LocalOperand1->Buffer.Pointer,
- LocalOperand1->Buffer.Length);
+ LocalOperand1->Buffer.Pointer,
+ LocalOperand1->Buffer.Length);
break;
default:
@@ -708,8 +707,8 @@ AcpiExDoLogicalOp (
case ACPI_TYPE_STRING:
- Status = AcpiExConvertToString (Operand1, &LocalOperand1,
- ACPI_IMPLICIT_CONVERT_HEX);
+ Status = AcpiExConvertToString (
+ Operand1, &LocalOperand1, ACPI_IMPLICIT_CONVERT_HEX);
break;
case ACPI_TYPE_BUFFER:
@@ -786,8 +785,8 @@ AcpiExDoLogicalOp (
/* Lexicographic compare: compare the data bytes */
Compare = memcmp (Operand0->Buffer.Pointer,
- LocalOperand1->Buffer.Pointer,
- (Length0 > Length1) ? Length1 : Length0);
+ LocalOperand1->Buffer.Pointer,
+ (Length0 > Length1) ? Length1 : Length0);
switch (Opcode)
{
diff --git a/src/acpica/source/components/executer/exmutex.c b/src/acpica/source/components/executer/exmutex.c
index c688a50..f3cf1bb 100644
--- a/src/acpica/source/components/executer/exmutex.c
+++ b/src/acpica/source/components/executer/exmutex.c
@@ -281,8 +281,7 @@ AcpiExAcquireMutexObject (
}
else
{
- Status = AcpiExSystemWaitMutex (ObjDesc->Mutex.OsMutex,
- Timeout);
+ Status = AcpiExSystemWaitMutex (ObjDesc->Mutex.OsMutex, Timeout);
}
if (ACPI_FAILURE (Status))
@@ -345,33 +344,48 @@ AcpiExAcquireMutex (
}
/*
- * Current sync level must be less than or equal to the sync level of the
- * mutex. This mechanism provides some deadlock prevention
+ * Current sync level must be less than or equal to the sync level
+ * of the mutex. This mechanism provides some deadlock prevention.
*/
if (WalkState->Thread->CurrentSyncLevel > ObjDesc->Mutex.SyncLevel)
{
ACPI_ERROR ((AE_INFO,
- "Cannot acquire Mutex [%4.4s], current SyncLevel is too large (%u)",
+ "Cannot acquire Mutex [%4.4s], "
+ "current SyncLevel is too large (%u)",
AcpiUtGetNodeName (ObjDesc->Mutex.Node),
WalkState->Thread->CurrentSyncLevel));
return_ACPI_STATUS (AE_AML_MUTEX_ORDER);
}
+ ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
+ "Acquiring: Mutex SyncLevel %u, Thread SyncLevel %u, "
+ "Depth %u TID %p\n",
+ ObjDesc->Mutex.SyncLevel, WalkState->Thread->CurrentSyncLevel,
+ ObjDesc->Mutex.AcquisitionDepth, WalkState->Thread));
+
Status = AcpiExAcquireMutexObject ((UINT16) TimeDesc->Integer.Value,
- ObjDesc, WalkState->Thread->ThreadId);
+ ObjDesc, WalkState->Thread->ThreadId);
+
if (ACPI_SUCCESS (Status) && ObjDesc->Mutex.AcquisitionDepth == 1)
{
/* Save Thread object, original/current sync levels */
ObjDesc->Mutex.OwnerThread = WalkState->Thread;
- ObjDesc->Mutex.OriginalSyncLevel = WalkState->Thread->CurrentSyncLevel;
- WalkState->Thread->CurrentSyncLevel = ObjDesc->Mutex.SyncLevel;
+ ObjDesc->Mutex.OriginalSyncLevel =
+ WalkState->Thread->CurrentSyncLevel;
+ WalkState->Thread->CurrentSyncLevel =
+ ObjDesc->Mutex.SyncLevel;
/* Link the mutex to the current thread for force-unlock at method exit */
AcpiExLinkMutex (ObjDesc, WalkState->Thread);
}
+ ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
+ "Acquired: Mutex SyncLevel %u, Thread SyncLevel %u, Depth %u\n",
+ ObjDesc->Mutex.SyncLevel, WalkState->Thread->CurrentSyncLevel,
+ ObjDesc->Mutex.AcquisitionDepth));
+
return_ACPI_STATUS (Status);
}
@@ -467,9 +481,9 @@ AcpiExReleaseMutex (
ACPI_OPERAND_OBJECT *ObjDesc,
ACPI_WALK_STATE *WalkState)
{
- ACPI_STATUS Status = AE_OK;
UINT8 PreviousSyncLevel;
ACPI_THREAD_STATE *OwnerThread;
+ ACPI_STATUS Status = AE_OK;
ACPI_FUNCTION_TRACE (ExReleaseMutex);
@@ -527,7 +541,8 @@ AcpiExReleaseMutex (
if (ObjDesc->Mutex.SyncLevel != OwnerThread->CurrentSyncLevel)
{
ACPI_ERROR ((AE_INFO,
- "Cannot release Mutex [%4.4s], SyncLevel mismatch: mutex %u current %u",
+ "Cannot release Mutex [%4.4s], SyncLevel mismatch: "
+ "mutex %u current %u",
AcpiUtGetNodeName (ObjDesc->Mutex.Node),
ObjDesc->Mutex.SyncLevel, WalkState->Thread->CurrentSyncLevel));
return_ACPI_STATUS (AE_AML_MUTEX_ORDER);
@@ -541,6 +556,13 @@ AcpiExReleaseMutex (
PreviousSyncLevel =
OwnerThread->AcquiredMutexList->Mutex.OriginalSyncLevel;
+ ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
+ "Releasing: Object SyncLevel %u, Thread SyncLevel %u, "
+ "Prev SyncLevel %u, Depth %u TID %p\n",
+ ObjDesc->Mutex.SyncLevel, WalkState->Thread->CurrentSyncLevel,
+ PreviousSyncLevel, ObjDesc->Mutex.AcquisitionDepth,
+ WalkState->Thread));
+
Status = AcpiExReleaseMutexObject (ObjDesc);
if (ACPI_FAILURE (Status))
{
@@ -554,6 +576,12 @@ AcpiExReleaseMutex (
OwnerThread->CurrentSyncLevel = PreviousSyncLevel;
}
+ ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
+ "Released: Object SyncLevel %u, Thread SyncLevel, %u, "
+ "Prev SyncLevel %u, Depth %u\n",
+ ObjDesc->Mutex.SyncLevel, WalkState->Thread->CurrentSyncLevel,
+ PreviousSyncLevel, ObjDesc->Mutex.AcquisitionDepth));
+
return_ACPI_STATUS (Status);
}
@@ -584,7 +612,7 @@ AcpiExReleaseAllMutexes (
ACPI_OPERAND_OBJECT *ObjDesc;
- ACPI_FUNCTION_NAME (ExReleaseAllMutexes);
+ ACPI_FUNCTION_TRACE (ExReleaseAllMutexes);
/* Traverse the list of owned mutexes, releasing each one */
@@ -592,14 +620,10 @@ AcpiExReleaseAllMutexes (
while (Next)
{
ObjDesc = Next;
- Next = ObjDesc->Mutex.Next;
-
- ObjDesc->Mutex.Prev = NULL;
- ObjDesc->Mutex.Next = NULL;
- ObjDesc->Mutex.AcquisitionDepth = 0;
-
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
- "Force-releasing held mutex: %p\n", ObjDesc));
+ "Mutex [%4.4s] force-release, SyncLevel %u Depth %u\n",
+ ObjDesc->Mutex.Node->Name.Ascii, ObjDesc->Mutex.SyncLevel,
+ ObjDesc->Mutex.AcquisitionDepth));
/* Release the mutex, special case for Global Lock */
@@ -614,13 +638,20 @@ AcpiExReleaseAllMutexes (
AcpiOsReleaseMutex (ObjDesc->Mutex.OsMutex);
}
+ /* Update Thread SyncLevel (Last mutex is the important one) */
+
+ Thread->CurrentSyncLevel = ObjDesc->Mutex.OriginalSyncLevel;
+
/* Mark mutex unowned */
+ Next = ObjDesc->Mutex.Next;
+
+ ObjDesc->Mutex.Prev = NULL;
+ ObjDesc->Mutex.Next = NULL;
+ ObjDesc->Mutex.AcquisitionDepth = 0;
ObjDesc->Mutex.OwnerThread = NULL;
ObjDesc->Mutex.ThreadId = 0;
-
- /* Update Thread SyncLevel (Last mutex is the important one) */
-
- Thread->CurrentSyncLevel = ObjDesc->Mutex.OriginalSyncLevel;
}
+
+ return_VOID;
}
diff --git a/src/acpica/source/components/executer/exnames.c b/src/acpica/source/components/executer/exnames.c
index 38ceba0..d222a21 100644
--- a/src/acpica/source/components/executer/exnames.c
+++ b/src/acpica/source/components/executer/exnames.c
@@ -232,6 +232,7 @@ AcpiExAllocateNameString (
return_PTR (NameString);
}
+
/*******************************************************************************
*
* FUNCTION: AcpiExNameSegment
@@ -261,8 +262,8 @@ AcpiExNameSegment (
/*
- * If first character is a digit, then we know that we aren't looking at a
- * valid name segment
+ * If first character is a digit, then we know that we aren't looking
+ * at a valid name segment
*/
CharBuf[0] = *AmlAddress;
@@ -466,7 +467,8 @@ AcpiExGetNameString (
AmlAddress++;
NumSegments = *AmlAddress;
- NameString = AcpiExAllocateNameString (PrefixCount, NumSegments);
+ NameString = AcpiExAllocateNameString (
+ PrefixCount, NumSegments);
if (!NameString)
{
Status = AE_NO_MEMORY;
diff --git a/src/acpica/source/components/executer/exoparg1.c b/src/acpica/source/components/executer/exoparg1.c
index c7addbd..466c886 100644
--- a/src/acpica/source/components/executer/exoparg1.c
+++ b/src/acpica/source/components/executer/exoparg1.c
@@ -403,7 +403,7 @@ AcpiExOpcode_1A_1T_1R (
* endian unsigned value, so this boundary condition is valid.
*/
for (Temp32 = 0; ReturnDesc->Integer.Value &&
- Temp32 < ACPI_INTEGER_BIT_SIZE; ++Temp32)
+ Temp32 < ACPI_INTEGER_BIT_SIZE; ++Temp32)
{
ReturnDesc->Integer.Value >>= 1;
}
@@ -420,7 +420,7 @@ AcpiExOpcode_1A_1T_1R (
* endian unsigned value, so this boundary condition is valid.
*/
for (Temp32 = 0; ReturnDesc->Integer.Value &&
- Temp32 < ACPI_INTEGER_BIT_SIZE; ++Temp32)
+ Temp32 < ACPI_INTEGER_BIT_SIZE; ++Temp32)
{
ReturnDesc->Integer.Value <<= 1;
}
@@ -526,7 +526,7 @@ AcpiExOpcode_1A_1T_1R (
/* Get the object reference, store it, and remove our reference */
Status = AcpiExGetObjectReference (Operand[0],
- &ReturnDesc2, WalkState);
+ &ReturnDesc2, WalkState);
if (ACPI_FAILURE (Status))
{
goto Cleanup;
@@ -581,28 +581,30 @@ AcpiExOpcode_1A_1T_1R (
*/
case AML_COPY_OP: /* Copy (Source, Target) */
- Status = AcpiUtCopyIobjectToIobject (Operand[0], &ReturnDesc,
- WalkState);
+ Status = AcpiUtCopyIobjectToIobject (
+ Operand[0], &ReturnDesc, WalkState);
break;
case AML_TO_DECSTRING_OP: /* ToDecimalString (Data, Result) */
- Status = AcpiExConvertToString (Operand[0], &ReturnDesc,
- ACPI_EXPLICIT_CONVERT_DECIMAL);
+ Status = AcpiExConvertToString (
+ Operand[0], &ReturnDesc, ACPI_EXPLICIT_CONVERT_DECIMAL);
if (ReturnDesc == Operand[0])
{
/* No conversion performed, add ref to handle return value */
+
AcpiUtAddReference (ReturnDesc);
}
break;
case AML_TO_HEXSTRING_OP: /* ToHexString (Data, Result) */
- Status = AcpiExConvertToString (Operand[0], &ReturnDesc,
- ACPI_EXPLICIT_CONVERT_HEX);
+ Status = AcpiExConvertToString (
+ Operand[0], &ReturnDesc, ACPI_EXPLICIT_CONVERT_HEX);
if (ReturnDesc == Operand[0])
{
/* No conversion performed, add ref to handle return value */
+
AcpiUtAddReference (ReturnDesc);
}
break;
@@ -613,17 +615,19 @@ AcpiExOpcode_1A_1T_1R (
if (ReturnDesc == Operand[0])
{
/* No conversion performed, add ref to handle return value */
+
AcpiUtAddReference (ReturnDesc);
}
break;
case AML_TO_INTEGER_OP: /* ToInteger (Data, Result) */
- Status = AcpiExConvertToInteger (Operand[0], &ReturnDesc,
- ACPI_ANY_BASE);
+ Status = AcpiExConvertToInteger (
+ Operand[0], &ReturnDesc, ACPI_ANY_BASE);
if (ReturnDesc == Operand[0])
{
/* No conversion performed, add ref to handle return value */
+
AcpiUtAddReference (ReturnDesc);
}
break;
@@ -774,11 +778,11 @@ AcpiExOpcode_1A_0T_1R (
*/
if (WalkState->Opcode == AML_INCREMENT_OP)
{
- ReturnDesc->Integer.Value = TempDesc->Integer.Value +1;
+ ReturnDesc->Integer.Value = TempDesc->Integer.Value + 1;
}
else
{
- ReturnDesc->Integer.Value = TempDesc->Integer.Value -1;
+ ReturnDesc->Integer.Value = TempDesc->Integer.Value - 1;
}
/* Finished with this Integer object */
@@ -826,8 +830,8 @@ AcpiExOpcode_1A_0T_1R (
/* Get the base object */
- Status = AcpiExResolveMultiple (WalkState,
- Operand[0], &Type, &TempDesc);
+ Status = AcpiExResolveMultiple (
+ WalkState, Operand[0], &Type, &TempDesc);
if (ACPI_FAILURE (Status))
{
goto Cleanup;
@@ -873,8 +877,10 @@ AcpiExOpcode_1A_0T_1R (
default:
ACPI_ERROR ((AE_INFO,
- "Operand must be Buffer/Integer/String/Package - found type %s",
+ "Operand must be Buffer/Integer/String/Package"
+ " - found type %s",
AcpiUtGetTypeName (Type)));
+
Status = AE_AML_OPERAND_TYPE;
goto Cleanup;
}
@@ -899,7 +905,8 @@ AcpiExOpcode_1A_0T_1R (
case AML_REF_OF_OP: /* RefOf (SourceObject) */
- Status = AcpiExGetObjectReference (Operand[0], &ReturnDesc, WalkState);
+ Status = AcpiExGetObjectReference (
+ Operand[0], &ReturnDesc, WalkState);
if (ACPI_FAILURE (Status))
{
goto Cleanup;
@@ -946,9 +953,9 @@ AcpiExOpcode_1A_0T_1R (
/* Set Operand[0] to the value of the local/arg */
Status = AcpiDsMethodDataGetValue (
- Operand[0]->Reference.Class,
- Operand[0]->Reference.Value,
- WalkState, &TempDesc);
+ Operand[0]->Reference.Class,
+ Operand[0]->Reference.Value,
+ WalkState, &TempDesc);
if (ACPI_FAILURE (Status))
{
goto Cleanup;
@@ -1002,19 +1009,19 @@ AcpiExOpcode_1A_0T_1R (
* Field, so we need to resolve the node to a value.
*/
Status = AcpiNsGetNode (WalkState->ScopeInfo->Scope.Node,
- Operand[0]->String.Pointer,
- ACPI_NS_SEARCH_PARENT,
- ACPI_CAST_INDIRECT_PTR (
- ACPI_NAMESPACE_NODE, &ReturnDesc));
+ Operand[0]->String.Pointer,
+ ACPI_NS_SEARCH_PARENT,
+ ACPI_CAST_INDIRECT_PTR (
+ ACPI_NAMESPACE_NODE, &ReturnDesc));
if (ACPI_FAILURE (Status))
{
goto Cleanup;
}
Status = AcpiExResolveNodeToValue (
- ACPI_CAST_INDIRECT_PTR (
- ACPI_NAMESPACE_NODE, &ReturnDesc),
- WalkState);
+ ACPI_CAST_INDIRECT_PTR (
+ ACPI_NAMESPACE_NODE, &ReturnDesc),
+ WalkState);
goto Cleanup;
}
}
@@ -1030,7 +1037,7 @@ AcpiExOpcode_1A_0T_1R (
* dereferenced above.
*/
ReturnDesc = AcpiNsGetAttachedObject (
- (ACPI_NAMESPACE_NODE *) Operand[0]);
+ (ACPI_NAMESPACE_NODE *) Operand[0]);
AcpiUtAddReference (ReturnDesc);
}
else
@@ -1097,6 +1104,7 @@ AcpiExOpcode_1A_0T_1R (
ACPI_ERROR ((AE_INFO,
"Unknown Index TargetType 0x%X in reference object %p",
Operand[0]->Reference.TargetType, Operand[0]));
+
Status = AE_AML_OPERAND_TYPE;
goto Cleanup;
}
@@ -1127,8 +1135,8 @@ AcpiExOpcode_1A_0T_1R (
case ACPI_TYPE_LOCAL_BANK_FIELD:
case ACPI_TYPE_LOCAL_INDEX_FIELD:
- Status = AcpiExReadDataFromField (WalkState,
- ReturnDesc, &TempDesc);
+ Status = AcpiExReadDataFromField (
+ WalkState, ReturnDesc, &TempDesc);
if (ACPI_FAILURE (Status))
{
goto Cleanup;
@@ -1163,6 +1171,7 @@ AcpiExOpcode_1A_0T_1R (
ACPI_ERROR ((AE_INFO, "Unknown AML opcode 0x%X",
WalkState->Opcode));
+
Status = AE_AML_BAD_OPCODE;
goto Cleanup;
}
diff --git a/src/acpica/source/components/executer/exoparg2.c b/src/acpica/source/components/executer/exoparg2.c
index f1ab706..29b41a5 100644
--- a/src/acpica/source/components/executer/exoparg2.c
+++ b/src/acpica/source/components/executer/exoparg2.c
@@ -275,10 +275,11 @@ AcpiExOpcode_2A_2T_1R (
/* Quotient to ReturnDesc1, remainder to ReturnDesc2 */
- Status = AcpiUtDivide (Operand[0]->Integer.Value,
- Operand[1]->Integer.Value,
- &ReturnDesc1->Integer.Value,
- &ReturnDesc2->Integer.Value);
+ Status = AcpiUtDivide (
+ Operand[0]->Integer.Value,
+ Operand[1]->Integer.Value,
+ &ReturnDesc1->Integer.Value,
+ &ReturnDesc2->Integer.Value);
if (ACPI_FAILURE (Status))
{
goto Cleanup;
@@ -289,6 +290,7 @@ AcpiExOpcode_2A_2T_1R (
ACPI_ERROR ((AE_INFO, "Unknown AML opcode 0x%X",
WalkState->Opcode));
+
Status = AE_AML_BAD_OPCODE;
goto Cleanup;
}
@@ -373,9 +375,10 @@ AcpiExOpcode_2A_1T_1R (
goto Cleanup;
}
- ReturnDesc->Integer.Value = AcpiExDoMathOp (WalkState->Opcode,
- Operand[0]->Integer.Value,
- Operand[1]->Integer.Value);
+ ReturnDesc->Integer.Value = AcpiExDoMathOp (
+ WalkState->Opcode,
+ Operand[0]->Integer.Value,
+ Operand[1]->Integer.Value);
goto StoreResultToTarget;
}
@@ -392,16 +395,17 @@ AcpiExOpcode_2A_1T_1R (
/* ReturnDesc will contain the remainder */
- Status = AcpiUtDivide (Operand[0]->Integer.Value,
- Operand[1]->Integer.Value,
- NULL,
- &ReturnDesc->Integer.Value);
+ Status = AcpiUtDivide (
+ Operand[0]->Integer.Value,
+ Operand[1]->Integer.Value,
+ NULL,
+ &ReturnDesc->Integer.Value);
break;
case AML_CONCAT_OP: /* Concatenate (Data1, Data2, Result) */
- Status = AcpiExDoConcatenate (Operand[0], Operand[1],
- &ReturnDesc, WalkState);
+ Status = AcpiExDoConcatenate (
+ Operand[0], Operand[1], &ReturnDesc, WalkState);
break;
case AML_TO_STRING_OP: /* ToString (Buffer, Length, Result) (ACPI 2.0) */
@@ -448,8 +452,8 @@ AcpiExOpcode_2A_1T_1R (
/* ConcatenateResTemplate (Buffer, Buffer, Result) (ACPI 2.0) */
- Status = AcpiExConcatTemplate (Operand[0], Operand[1],
- &ReturnDesc, WalkState);
+ Status = AcpiExConcatTemplate (
+ Operand[0], Operand[1], &ReturnDesc, WalkState);
break;
case AML_INDEX_OP: /* Index (Source Index Result) */
@@ -632,8 +636,8 @@ AcpiExOpcode_2A_0T_1R (
/* LogicalOp (Operand0, Operand1) */
Status = AcpiExDoLogicalNumericOp (WalkState->Opcode,
- Operand[0]->Integer.Value, Operand[1]->Integer.Value,
- &LogicalResult);
+ Operand[0]->Integer.Value, Operand[1]->Integer.Value,
+ &LogicalResult);
goto StoreLogicalResult;
}
else if (WalkState->OpInfo->Flags & AML_LOGICAL)
@@ -641,7 +645,7 @@ AcpiExOpcode_2A_0T_1R (
/* LogicalOp (Operand0, Operand1) */
Status = AcpiExDoLogicalOp (WalkState->Opcode, Operand[0],
- Operand[1], &LogicalResult);
+ Operand[1], &LogicalResult);
goto StoreLogicalResult;
}
@@ -672,6 +676,7 @@ AcpiExOpcode_2A_0T_1R (
ACPI_ERROR ((AE_INFO, "Unknown AML opcode 0x%X",
WalkState->Opcode));
+
Status = AE_AML_BAD_OPCODE;
goto Cleanup;
}
diff --git a/src/acpica/source/components/executer/exoparg3.c b/src/acpica/source/components/executer/exoparg3.c
index b2c49be..aa52392 100644
--- a/src/acpica/source/components/executer/exoparg3.c
+++ b/src/acpica/source/components/executer/exoparg3.c
@@ -178,7 +178,8 @@ AcpiExOpcode_3A_0T_0R (
case AML_FATAL_OP: /* Fatal (FatalType FatalCode FatalArg) */
ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
- "FatalOp: Type %X Code %X Arg %X <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n",
+ "FatalOp: Type %X Code %X Arg %X "
+ "<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n",
(UINT32) Operand[0]->Integer.Value,
(UINT32) Operand[1]->Integer.Value,
(UINT32) Operand[2]->Integer.Value));
@@ -186,8 +187,8 @@ AcpiExOpcode_3A_0T_0R (
Fatal = ACPI_ALLOCATE (sizeof (ACPI_SIGNAL_FATAL_INFO));
if (Fatal)
{
- Fatal->Type = (UINT32) Operand[0]->Integer.Value;
- Fatal->Code = (UINT32) Operand[1]->Integer.Value;
+ Fatal->Type = (UINT32) Operand[0]->Integer.Value;
+ Fatal->Code = (UINT32) Operand[1]->Integer.Value;
Fatal->Argument = (UINT32) Operand[2]->Integer.Value;
}
@@ -215,6 +216,7 @@ AcpiExOpcode_3A_0T_0R (
ACPI_ERROR ((AE_INFO, "Unknown AML opcode 0x%X",
WalkState->Opcode));
+
Status = AE_AML_BAD_OPCODE;
goto Cleanup;
}
@@ -262,7 +264,7 @@ AcpiExOpcode_3A_1T_1R (
* either a String or a Buffer, so just use its type.
*/
ReturnDesc = AcpiUtCreateInternalObject (
- (Operand[0])->Common.Type);
+ (Operand[0])->Common.Type);
if (!ReturnDesc)
{
Status = AE_NO_MEMORY;
@@ -287,8 +289,8 @@ AcpiExOpcode_3A_1T_1R (
else if ((Index + Length) > Operand[0]->String.Length)
{
- Length = (ACPI_SIZE) Operand[0]->String.Length -
- (ACPI_SIZE) Index;
+ Length =
+ (ACPI_SIZE) Operand[0]->String.Length - (ACPI_SIZE) Index;
}
/* Strings always have a sub-pointer, not so for buffers */
@@ -334,8 +336,8 @@ AcpiExOpcode_3A_1T_1R (
{
/* We have a buffer, copy the portion requested */
- memcpy (Buffer, Operand[0]->String.Pointer + Index,
- Length);
+ memcpy (Buffer,
+ Operand[0]->String.Pointer + Index, Length);
}
/* Set the length of the new String/Buffer */
@@ -352,6 +354,7 @@ AcpiExOpcode_3A_1T_1R (
ACPI_ERROR ((AE_INFO, "Unknown AML opcode 0x%X",
WalkState->Opcode));
+
Status = AE_AML_BAD_OPCODE;
goto Cleanup;
}
@@ -369,12 +372,12 @@ Cleanup:
AcpiUtRemoveReference (ReturnDesc);
WalkState->ResultObj = NULL;
}
-
- /* Set the return object and exit */
-
else
{
+ /* Set the return object and exit */
+
WalkState->ResultObj = ReturnDesc;
}
+
return_ACPI_STATUS (Status);
}
diff --git a/src/acpica/source/components/executer/exoparg6.c b/src/acpica/source/components/executer/exoparg6.c
index a7d76d6..6423334 100644
--- a/src/acpica/source/components/executer/exoparg6.c
+++ b/src/acpica/source/components/executer/exoparg6.c
@@ -205,8 +205,8 @@ AcpiExDoMatch (
* True if equal: (P[i] == M)
* Change to: (M == P[i])
*/
- Status = AcpiExDoLogicalOp (AML_LEQUAL_OP, MatchObj, PackageObj,
- &LogicalResult);
+ Status = AcpiExDoLogicalOp (
+ AML_LEQUAL_OP, MatchObj, PackageObj, &LogicalResult);
if (ACPI_FAILURE (Status))
{
return (FALSE);
@@ -218,8 +218,8 @@ AcpiExDoMatch (
* True if less than or equal: (P[i] <= M) (P[i] NotGreater than M)
* Change to: (M >= P[i]) (M NotLess than P[i])
*/
- Status = AcpiExDoLogicalOp (AML_LLESS_OP, MatchObj, PackageObj,
- &LogicalResult);
+ Status = AcpiExDoLogicalOp (
+ AML_LLESS_OP, MatchObj, PackageObj, &LogicalResult);
if (ACPI_FAILURE (Status))
{
return (FALSE);
@@ -232,8 +232,8 @@ AcpiExDoMatch (
* True if less than: (P[i] < M)
* Change to: (M > P[i])
*/
- Status = AcpiExDoLogicalOp (AML_LGREATER_OP, MatchObj, PackageObj,
- &LogicalResult);
+ Status = AcpiExDoLogicalOp (
+ AML_LGREATER_OP, MatchObj, PackageObj, &LogicalResult);
if (ACPI_FAILURE (Status))
{
return (FALSE);
@@ -245,8 +245,8 @@ AcpiExDoMatch (
* True if greater than or equal: (P[i] >= M) (P[i] NotLess than M)
* Change to: (M <= P[i]) (M NotGreater than P[i])
*/
- Status = AcpiExDoLogicalOp (AML_LGREATER_OP, MatchObj, PackageObj,
- &LogicalResult);
+ Status = AcpiExDoLogicalOp (
+ AML_LGREATER_OP, MatchObj, PackageObj, &LogicalResult);
if (ACPI_FAILURE (Status))
{
return (FALSE);
@@ -259,8 +259,8 @@ AcpiExDoMatch (
* True if greater than: (P[i] > M)
* Change to: (M < P[i])
*/
- Status = AcpiExDoLogicalOp (AML_LLESS_OP, MatchObj, PackageObj,
- &LogicalResult);
+ Status = AcpiExDoLogicalOp (
+ AML_LLESS_OP, MatchObj, PackageObj, &LogicalResult);
if (ACPI_FAILURE (Status))
{
return (FALSE);
@@ -376,13 +376,13 @@ AcpiExOpcode_6A_0T_1R (
* non-match.
*/
if (!AcpiExDoMatch ((UINT32) Operand[1]->Integer.Value,
- ThisElement, Operand[2]))
+ ThisElement, Operand[2]))
{
continue;
}
if (!AcpiExDoMatch ((UINT32) Operand[3]->Integer.Value,
- ThisElement, Operand[4]))
+ ThisElement, Operand[4]))
{
continue;
}
@@ -403,6 +403,7 @@ AcpiExOpcode_6A_0T_1R (
ACPI_ERROR ((AE_INFO, "Unknown AML opcode 0x%X",
WalkState->Opcode));
+
Status = AE_AML_BAD_OPCODE;
goto Cleanup;
}
diff --git a/src/acpica/source/components/executer/exprep.c b/src/acpica/source/components/executer/exprep.c
index d84ccc3..91ee2b8 100644
--- a/src/acpica/source/components/executer/exprep.c
+++ b/src/acpica/source/components/executer/exprep.c
@@ -1,6 +1,6 @@
/******************************************************************************
*
- * Module Name: exprep - ACPI AML (p-code) execution - field prep utilities
+ * Module Name: exprep - ACPI AML field prep utilities
*
*****************************************************************************/
@@ -141,6 +141,7 @@ AcpiExGenerateAccess (
UINT32 FieldBitLength,
UINT32 RegionLength);
+
/*******************************************************************************
*
* FUNCTION: AcpiExGenerateAccess
@@ -185,10 +186,13 @@ AcpiExGenerateAccess (
/* Round Field start offset and length to "minimal" byte boundaries */
- FieldByteOffset = ACPI_DIV_8 (ACPI_ROUND_DOWN (FieldBitOffset, 8));
- FieldByteEndOffset = ACPI_DIV_8 (ACPI_ROUND_UP (FieldBitLength +
- FieldBitOffset, 8));
- FieldByteLength = FieldByteEndOffset - FieldByteOffset;
+ FieldByteOffset = ACPI_DIV_8 (
+ ACPI_ROUND_DOWN (FieldBitOffset, 8));
+
+ FieldByteEndOffset = ACPI_DIV_8 (
+ ACPI_ROUND_UP (FieldBitLength + FieldBitOffset, 8));
+
+ FieldByteLength = FieldByteEndOffset - FieldByteOffset;
ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD,
"Bit length %u, Bit offset %u\n",
@@ -213,7 +217,8 @@ AcpiExGenerateAccess (
* are done. (This does not optimize for the perfectly aligned
* case yet).
*/
- if (ACPI_ROUND_UP (FieldByteEndOffset, AccessByteWidth) <= RegionLength)
+ if (ACPI_ROUND_UP (FieldByteEndOffset, AccessByteWidth) <=
+ RegionLength)
{
FieldStartOffset =
ACPI_ROUND_DOWN (FieldByteOffset, AccessByteWidth) /
@@ -237,7 +242,8 @@ AcpiExGenerateAccess (
if (Accesses <= 1)
{
ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD,
- "Entire field can be accessed with one operation of size %u\n",
+ "Entire field can be accessed "
+ "with one operation of size %u\n",
AccessByteWidth));
return_VALUE (AccessByteWidth);
}
@@ -248,14 +254,15 @@ AcpiExGenerateAccess (
*/
if (Accesses < MinimumAccesses)
{
- MinimumAccesses = Accesses;
+ MinimumAccesses = Accesses;
MinimumAccessWidth = AccessByteWidth;
}
}
else
{
ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD,
- "AccessWidth %u end is NOT within region\n", AccessByteWidth));
+ "AccessWidth %u end is NOT within region\n",
+ AccessByteWidth));
if (AccessByteWidth == 1)
{
ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD,
@@ -283,6 +290,7 @@ AcpiExGenerateAccess (
*/
ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD,
"Cannot access field in one operation, using width 8\n"));
+
return_VALUE (8);
}
#endif /* ACPI_UNDER_DEVELOPMENT */
@@ -367,6 +375,7 @@ AcpiExDecodeFieldAccess (
ACPI_ERROR ((AE_INFO,
"Unknown field access type 0x%X",
Access));
+
return_UINT32 (0);
}
@@ -446,8 +455,8 @@ AcpiExPrepCommonFieldObject (
* For all other access types (Byte, Word, Dword, Qword), the Bitwidth is
* the same (equivalent) as the ByteAlignment.
*/
- AccessBitWidth = AcpiExDecodeFieldAccess (ObjDesc, FieldFlags,
- &ByteAlignment);
+ AccessBitWidth = AcpiExDecodeFieldAccess (
+ ObjDesc, FieldFlags, &ByteAlignment);
if (!AccessBitWidth)
{
return_ACPI_STATUS (AE_AML_OPERAND_VALUE);
@@ -543,8 +552,8 @@ AcpiExPrepFieldValue (
ObjDesc->CommonField.Node = Info->FieldNode;
Status = AcpiExPrepCommonFieldObject (ObjDesc,
- Info->FieldFlags, Info->Attribute,
- Info->FieldBitPosition, Info->FieldBitLength);
+ Info->FieldFlags, Info->Attribute,
+ Info->FieldBitPosition, Info->FieldBitLength);
if (ACPI_FAILURE (Status))
{
AcpiUtDeleteObjectDesc (ObjDesc);
@@ -576,8 +585,10 @@ AcpiExPrepFieldValue (
}
}
- ObjDesc->Field.ResourceBuffer = SecondDesc->Buffer.Pointer;
- ObjDesc->Field.ResourceLength = (UINT16) SecondDesc->Buffer.Length;
+ ObjDesc->Field.ResourceBuffer =
+ SecondDesc->Buffer.Pointer;
+ ObjDesc->Field.ResourceLength =
+ (UINT16) SecondDesc->Buffer.Length;
}
else if (Info->ResourceBuffer)
{
@@ -599,7 +610,8 @@ AcpiExPrepFieldValue (
if (AccessByteWidth < 256)
{
- ObjDesc->CommonField.AccessByteWidth = (UINT8) AccessByteWidth;
+ ObjDesc->CommonField.AccessByteWidth =
+ (UINT8) AccessByteWidth;
}
}
@@ -609,8 +621,10 @@ AcpiExPrepFieldValue (
ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD,
"RegionField: BitOff %X, Off %X, Gran %X, Region %p\n",
- ObjDesc->Field.StartFieldBitOffset, ObjDesc->Field.BaseByteOffset,
- ObjDesc->Field.AccessByteWidth, ObjDesc->Field.RegionObj));
+ ObjDesc->Field.StartFieldBitOffset,
+ ObjDesc->Field.BaseByteOffset,
+ ObjDesc->Field.AccessByteWidth,
+ ObjDesc->Field.RegionObj));
break;
case ACPI_TYPE_LOCAL_BANK_FIELD:
@@ -690,7 +704,8 @@ AcpiExPrepFieldValue (
ObjDesc->IndexField.AccessByteWidth);
ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD,
- "IndexField: BitOff %X, Off %X, Value %X, Gran %X, Index %p, Data %p\n",
+ "IndexField: BitOff %X, Off %X, Value %X, "
+ "Gran %X, Index %p, Data %p\n",
ObjDesc->IndexField.StartFieldBitOffset,
ObjDesc->IndexField.BaseByteOffset,
ObjDesc->IndexField.Value,
@@ -710,10 +725,11 @@ AcpiExPrepFieldValue (
* Store the constructed descriptor (ObjDesc) into the parent Node,
* preserving the current type of that NamedObj.
*/
- Status = AcpiNsAttachObject (Info->FieldNode, ObjDesc,
- AcpiNsGetType (Info->FieldNode));
+ Status = AcpiNsAttachObject (
+ Info->FieldNode, ObjDesc, AcpiNsGetType (Info->FieldNode));
- ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD, "Set NamedObj %p [%4.4s], ObjDesc %p\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD,
+ "Set NamedObj %p [%4.4s], ObjDesc %p\n",
Info->FieldNode, AcpiUtGetNodeName (Info->FieldNode), ObjDesc));
/* Remove local reference to the object */
diff --git a/src/acpica/source/components/executer/exregion.c b/src/acpica/source/components/executer/exregion.c
index cf60500..23c04dc 100644
--- a/src/acpica/source/components/executer/exregion.c
+++ b/src/acpica/source/components/executer/exregion.c
@@ -489,7 +489,8 @@ AcpiExPciConfigSpaceHandler (
PciRegister = (UINT16) (UINT32) Address;
ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
- "Pci-Config %u (%u) Seg(%04x) Bus(%04x) Dev(%04x) Func(%04x) Reg(%04x)\n",
+ "Pci-Config %u (%u) Seg(%04x) Bus(%04x) "
+ "Dev(%04x) Func(%04x) Reg(%04x)\n",
Function, BitWidth, PciId->Segment, PciId->Bus, PciId->Device,
PciId->Function, PciRegister));
@@ -498,14 +499,14 @@ AcpiExPciConfigSpaceHandler (
case ACPI_READ:
*Value = 0;
- Status = AcpiOsReadPciConfiguration (PciId, PciRegister,
- Value, BitWidth);
+ Status = AcpiOsReadPciConfiguration (
+ PciId, PciRegister, Value, BitWidth);
break;
case ACPI_WRITE:
- Status = AcpiOsWritePciConfiguration (PciId, PciRegister,
- *Value, BitWidth);
+ Status = AcpiOsWritePciConfiguration (
+ PciId, PciRegister, *Value, BitWidth);
break;
default:
diff --git a/src/acpica/source/components/executer/exresnte.c b/src/acpica/source/components/executer/exresnte.c
index 6967bbb..4c334f6 100644
--- a/src/acpica/source/components/executer/exresnte.c
+++ b/src/acpica/source/components/executer/exresnte.c
@@ -170,9 +170,9 @@ AcpiExResolveNodeToValue (
* The stack pointer points to a ACPI_NAMESPACE_NODE (Node). Get the
* object that is attached to the Node.
*/
- Node = *ObjectPtr;
+ Node = *ObjectPtr;
SourceDesc = AcpiNsGetAttachedObject (Node);
- EntryType = AcpiNsGetType ((ACPI_HANDLE) Node);
+ EntryType = AcpiNsGetType ((ACPI_HANDLE) Node);
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Entry=%p SourceDesc=%p [%s]\n",
Node, SourceDesc, AcpiUtGetTypeName (EntryType)));
@@ -182,15 +182,15 @@ AcpiExResolveNodeToValue (
{
/* There is always exactly one level of indirection */
- Node = ACPI_CAST_PTR (ACPI_NAMESPACE_NODE, Node->Object);
+ Node = ACPI_CAST_PTR (ACPI_NAMESPACE_NODE, Node->Object);
SourceDesc = AcpiNsGetAttachedObject (Node);
- EntryType = AcpiNsGetType ((ACPI_HANDLE) Node);
+ EntryType = AcpiNsGetType ((ACPI_HANDLE) Node);
*ObjectPtr = Node;
}
/*
* Several object types require no further processing:
- * 1) Device/Thermal objects don't have a "real" subobject, return the Node
+ * 1) Device/Thermal objects don't have a "real" subobject, return Node
* 2) Method locals and arguments have a pseudo-Node
* 3) 10/2007: Added method type to assist with Package construction.
*/
diff --git a/src/acpica/source/components/executer/exresolv.c b/src/acpica/source/components/executer/exresolv.c
index a273a71..6628e93 100644
--- a/src/acpica/source/components/executer/exresolv.c
+++ b/src/acpica/source/components/executer/exresolv.c
@@ -191,8 +191,8 @@ AcpiExResolveToValue (
if (ACPI_GET_DESCRIPTOR_TYPE (*StackPtr) == ACPI_DESC_TYPE_NAMED)
{
Status = AcpiExResolveNodeToValue (
- ACPI_CAST_INDIRECT_PTR (ACPI_NAMESPACE_NODE, StackPtr),
- WalkState);
+ ACPI_CAST_INDIRECT_PTR (ACPI_NAMESPACE_NODE, StackPtr),
+ WalkState);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
@@ -251,7 +251,7 @@ AcpiExResolveObjectToValue (
* Note: this increments the local's object reference count
*/
Status = AcpiDsMethodDataGetValue (RefType,
- StackDesc->Reference.Value, WalkState, &ObjDesc);
+ StackDesc->Reference.Value, WalkState, &ObjDesc);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
@@ -307,7 +307,8 @@ AcpiExResolveObjectToValue (
* the package, can't dereference it
*/
ACPI_ERROR ((AE_INFO,
- "Attempt to dereference an Index to NULL package element Idx=%p",
+ "Attempt to dereference an Index to "
+ "NULL package element Idx=%p",
StackDesc));
Status = AE_AML_UNINITIALIZED_ELEMENT;
}
@@ -358,7 +359,8 @@ AcpiExResolveObjectToValue (
default:
ACPI_ERROR ((AE_INFO,
- "Unknown Reference type 0x%X in %p", RefType, StackDesc));
+ "Unknown Reference type 0x%X in %p",
+ RefType, StackDesc));
Status = AE_AML_INTERNAL;
break;
}
@@ -379,7 +381,8 @@ AcpiExResolveObjectToValue (
case ACPI_TYPE_LOCAL_BANK_FIELD:
case ACPI_TYPE_LOCAL_INDEX_FIELD:
- ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "FieldRead SourceDesc=%p Type=%X\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
+ "FieldRead SourceDesc=%p Type=%X\n",
StackDesc, StackDesc->Common.Type));
Status = AcpiExReadDataFromField (WalkState, StackDesc, &ObjDesc);
@@ -450,7 +453,8 @@ AcpiExResolveMultiple (
if (Type == ACPI_TYPE_LOCAL_ALIAS)
{
Type = ((ACPI_NAMESPACE_NODE *) ObjDesc)->Type;
- ObjDesc = AcpiNsGetAttachedObject ((ACPI_NAMESPACE_NODE *) ObjDesc);
+ ObjDesc = AcpiNsGetAttachedObject (
+ (ACPI_NAMESPACE_NODE *) ObjDesc);
}
if (!ObjDesc)
@@ -564,7 +568,7 @@ AcpiExResolveMultiple (
if (ReturnDesc)
{
Status = AcpiDsMethodDataGetValue (ObjDesc->Reference.Class,
- ObjDesc->Reference.Value, WalkState, &ObjDesc);
+ ObjDesc->Reference.Value, WalkState, &ObjDesc);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
@@ -574,7 +578,7 @@ AcpiExResolveMultiple (
else
{
Status = AcpiDsMethodDataGetNode (ObjDesc->Reference.Class,
- ObjDesc->Reference.Value, WalkState, &Node);
+ ObjDesc->Reference.Value, WalkState, &Node);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
@@ -599,7 +603,8 @@ AcpiExResolveMultiple (
default:
ACPI_ERROR ((AE_INFO,
- "Unknown Reference Class 0x%2.2X", ObjDesc->Reference.Class));
+ "Unknown Reference Class 0x%2.2X",
+ ObjDesc->Reference.Class));
return_ACPI_STATUS (AE_AML_INTERNAL);
}
}
diff --git a/src/acpica/source/components/executer/exresop.c b/src/acpica/source/components/executer/exresop.c
index 3cfe472..214e6de 100644
--- a/src/acpica/source/components/executer/exresop.c
+++ b/src/acpica/source/components/executer/exresop.c
@@ -171,7 +171,8 @@ AcpiExCheckObjectType (
* specification, a store to a constant is a noop.)
*/
if ((ThisType == ACPI_TYPE_INTEGER) &&
- (((ACPI_OPERAND_OBJECT *) Object)->Common.Flags & AOPOBJ_AML_CONSTANT))
+ (((ACPI_OPERAND_OBJECT *) Object)->Common.Flags &
+ AOPOBJ_AML_CONSTANT))
{
return (AE_OK);
}
@@ -288,7 +289,8 @@ AcpiExResolveOperands (
*/
if (ObjectType == ACPI_TYPE_LOCAL_ALIAS)
{
- ObjDesc = AcpiNsGetAttachedObject ((ACPI_NAMESPACE_NODE *) ObjDesc);
+ ObjDesc = AcpiNsGetAttachedObject (
+ (ACPI_NAMESPACE_NODE *) ObjDesc);
*StackPtr = ObjDesc;
ObjectType = ((ACPI_NAMESPACE_NODE *) ObjDesc)->Type;
}
@@ -369,7 +371,8 @@ AcpiExResolveOperands (
{
case ARGI_REF_OR_STRING: /* Can be a String or Reference */
- if ((ACPI_GET_DESCRIPTOR_TYPE (ObjDesc) == ACPI_DESC_TYPE_OPERAND) &&
+ if ((ACPI_GET_DESCRIPTOR_TYPE (ObjDesc) ==
+ ACPI_DESC_TYPE_OPERAND) &&
(ObjDesc->Common.Type == ACPI_TYPE_STRING))
{
/*
@@ -403,8 +406,8 @@ AcpiExResolveOperands (
goto NextOperand;
}
- Status = AcpiExCheckObjectType (ACPI_TYPE_LOCAL_REFERENCE,
- ObjectType, ObjDesc);
+ Status = AcpiExCheckObjectType (
+ ACPI_TYPE_LOCAL_REFERENCE, ObjectType, ObjDesc);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
@@ -555,8 +558,8 @@ AcpiExResolveOperands (
* But we can implicitly convert from a BUFFER or INTEGER
* Aka - "Implicit Source Operand Conversion"
*/
- Status = AcpiExConvertToString (ObjDesc, StackPtr,
- ACPI_IMPLICIT_CONVERT_HEX);
+ Status = AcpiExConvertToString (
+ ObjDesc, StackPtr, ACPI_IMPLICIT_CONVERT_HEX);
if (ACPI_FAILURE (Status))
{
if (Status == AE_TYPE)
@@ -689,8 +692,10 @@ AcpiExResolveOperands (
case ARGI_REGION_OR_BUFFER: /* Used by Load() only */
- /* Need an operand of type REGION or a BUFFER (which could be a resolved region field) */
-
+ /*
+ * Need an operand of type REGION or a BUFFER
+ * (which could be a resolved region field)
+ */
switch (ObjDesc->Common.Type)
{
case ACPI_TYPE_BUFFER:
@@ -734,9 +739,9 @@ AcpiExResolveOperands (
if (AcpiGbl_EnableInterpreterSlack)
{
/*
- * Enable original behavior of Store(), allowing any and all
- * objects as the source operand. The ACPI spec does not
- * allow this, however.
+ * Enable original behavior of Store(), allowing any
+ * and all objects as the source operand. The ACPI
+ * spec does not allow this, however.
*/
break;
}
@@ -749,7 +754,8 @@ AcpiExResolveOperands (
}
ACPI_ERROR ((AE_INFO,
- "Needed Integer/Buffer/String/Package/Ref/Ddb], found [%s] %p",
+ "Needed Integer/Buffer/String/Package/Ref/Ddb]"
+ ", found [%s] %p",
AcpiUtGetObjectTypeName (ObjDesc), ObjDesc));
return_ACPI_STATUS (AE_AML_OPERAND_TYPE);
@@ -771,8 +777,8 @@ AcpiExResolveOperands (
* Make sure that the original object was resolved to the
* required object type (Simple cases only).
*/
- Status = AcpiExCheckObjectType (TypeNeeded,
- (*StackPtr)->Common.Type, *StackPtr);
+ Status = AcpiExCheckObjectType (
+ TypeNeeded, (*StackPtr)->Common.Type, *StackPtr);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
diff --git a/src/acpica/source/components/executer/exstore.c b/src/acpica/source/components/executer/exstore.c
index cb6ebc0..096d65d 100644
--- a/src/acpica/source/components/executer/exstore.c
+++ b/src/acpica/source/components/executer/exstore.c
@@ -189,8 +189,8 @@ AcpiExStore (
* Storing an object into a Named node.
*/
Status = AcpiExStoreObjectToNode (SourceDesc,
- (ACPI_NAMESPACE_NODE *) DestDesc, WalkState,
- ACPI_IMPLICIT_CONVERSION);
+ (ACPI_NAMESPACE_NODE *) DestDesc, WalkState,
+ ACPI_IMPLICIT_CONVERSION);
return_ACPI_STATUS (Status);
}
@@ -240,8 +240,8 @@ AcpiExStore (
/* Storing an object into a Name "container" */
Status = AcpiExStoreObjectToNode (SourceDesc,
- RefDesc->Reference.Object,
- WalkState, ACPI_IMPLICIT_CONVERSION);
+ RefDesc->Reference.Object,
+ WalkState, ACPI_IMPLICIT_CONVERSION);
break;
case ACPI_REFCLASS_INDEX:
@@ -257,7 +257,7 @@ AcpiExStore (
/* Store to a method local/arg */
Status = AcpiDsStoreObjectToLocal (RefDesc->Reference.Class,
- RefDesc->Reference.Value, SourceDesc, WalkState);
+ RefDesc->Reference.Value, SourceDesc, WalkState);
break;
case ACPI_REFCLASS_DEBUG:
@@ -346,7 +346,8 @@ AcpiExStoreObjectToIndex (
{
/* Normal object, copy it */
- Status = AcpiUtCopyIobjectToIobject (SourceDesc, &NewDesc, WalkState);
+ Status = AcpiUtCopyIobjectToIobject (
+ SourceDesc, &NewDesc, WalkState);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
@@ -559,7 +560,8 @@ AcpiExStoreObjectToNode (
case ACPI_TYPE_THERMAL:
ACPI_ERROR ((AE_INFO,
- "Target must be [Buffer/Integer/String/Reference], found [%s] (%4.4s)",
+ "Target must be [Buffer/Integer/String/Reference]"
+ ", found [%s] (%4.4s)",
AcpiUtGetTypeName (Node->Type), Node->Name.Ascii));
return_ACPI_STATUS (AE_AML_TARGET_TYPE);
@@ -599,8 +601,7 @@ AcpiExStoreObjectToNode (
* an implicit conversion, as per the ACPI specification.
* A direct store is performed instead.
*/
- Status = AcpiExStoreDirectToNode (SourceDesc, Node,
- WalkState);
+ Status = AcpiExStoreDirectToNode (SourceDesc, Node, WalkState);
break;
}
@@ -624,8 +625,8 @@ AcpiExStoreObjectToNode (
* store has been performed such that the node/object type
* has been changed.
*/
- Status = AcpiNsAttachObject (Node, NewDesc,
- NewDesc->Common.Type);
+ Status = AcpiNsAttachObject (
+ Node, NewDesc, NewDesc->Common.Type);
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
"Store type [%s] into [%s] via Convert/Attach\n",
@@ -657,8 +658,7 @@ AcpiExStoreObjectToNode (
* operator. (Note, for this default case, all normal
* Store/Target operations exited above with an error).
*/
- Status = AcpiExStoreDirectToNode (SourceDesc, Node,
- WalkState);
+ Status = AcpiExStoreDirectToNode (SourceDesc, Node, WalkState);
break;
}
diff --git a/src/acpica/source/components/executer/exstoren.c b/src/acpica/source/components/executer/exstoren.c
index 6a1be4c..f563f8a 100644
--- a/src/acpica/source/components/executer/exstoren.c
+++ b/src/acpica/source/components/executer/exstoren.c
@@ -196,7 +196,7 @@ AcpiExResolveObject (
(SourceDesc->Common.Type != ACPI_TYPE_BUFFER) &&
(SourceDesc->Common.Type != ACPI_TYPE_STRING) &&
!((SourceDesc->Common.Type == ACPI_TYPE_LOCAL_REFERENCE) &&
- (SourceDesc->Reference.Class== ACPI_REFCLASS_TABLE)))
+ (SourceDesc->Reference.Class== ACPI_REFCLASS_TABLE)))
{
/* Conversion successful but still not a valid type */
@@ -305,7 +305,7 @@ AcpiExStoreObjectToObject (
* converted object.
*/
Status = AcpiExConvertToTargetType (DestDesc->Common.Type,
- SourceDesc, &ActualSrcDesc, WalkState);
+ SourceDesc, &ActualSrcDesc, WalkState);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
diff --git a/src/acpica/source/components/executer/exstorob.c b/src/acpica/source/components/executer/exstorob.c
index 8c23aee..bcfe800 100644
--- a/src/acpica/source/components/executer/exstorob.c
+++ b/src/acpica/source/components/executer/exstorob.c
@@ -1,6 +1,6 @@
/******************************************************************************
*
- * Module Name: exstorob - AML Interpreter object store support, store to object
+ * Module Name: exstorob - AML object store support, store to object
*
*****************************************************************************/
@@ -293,8 +293,9 @@ AcpiExStoreStringToString (
ACPI_FREE (TargetDesc->String.Pointer);
}
- TargetDesc->String.Pointer = ACPI_ALLOCATE_ZEROED (
- (ACPI_SIZE) Length + 1);
+ TargetDesc->String.Pointer =
+ ACPI_ALLOCATE_ZEROED ((ACPI_SIZE) Length + 1);
+
if (!TargetDesc->String.Pointer)
{
return_ACPI_STATUS (AE_NO_MEMORY);
diff --git a/src/acpica/source/components/executer/exsystem.c b/src/acpica/source/components/executer/exsystem.c
index 49ec2e9..7813480 100644
--- a/src/acpica/source/components/executer/exsystem.c
+++ b/src/acpica/source/components/executer/exsystem.c
@@ -158,7 +158,6 @@ AcpiExSystemWaitSemaphore (
/* We must wait, so unlock the interpreter */
AcpiExExitInterpreter ();
-
Status = AcpiOsWaitSemaphore (Semaphore, 1, Timeout);
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
@@ -211,7 +210,6 @@ AcpiExSystemWaitMutex (
/* We must wait, so unlock the interpreter */
AcpiExExitInterpreter ();
-
Status = AcpiOsAcquireMutex (Mutex, Timeout);
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
@@ -262,8 +260,8 @@ AcpiExSystemDoStall (
* (ACPI specifies 100 usec as max, but this gives some slack in
* order to support existing BIOSs)
*/
- ACPI_ERROR ((AE_INFO, "Time parameter is too large (%u)",
- HowLong));
+ ACPI_ERROR ((AE_INFO,
+ "Time parameter is too large (%u)", HowLong));
Status = AE_AML_OPERAND_VALUE;
}
else
@@ -378,7 +376,7 @@ AcpiExSystemWaitEvent (
if (ObjDesc)
{
Status = AcpiExSystemWaitSemaphore (ObjDesc->Event.OsSemaphore,
- (UINT16) TimeDesc->Integer.Value);
+ (UINT16) TimeDesc->Integer.Value);
}
return_ACPI_STATUS (Status);
diff --git a/src/acpica/source/components/executer/extrace.c b/src/acpica/source/components/executer/extrace.c
new file mode 100644
index 0000000..60d020e
--- /dev/null
+++ b/src/acpica/source/components/executer/extrace.c
@@ -0,0 +1,499 @@
+/******************************************************************************
+ *
+ * Module Name: extrace - Support for interpreter execution tracing
+ *
+ *****************************************************************************/
+
+/******************************************************************************
+ *
+ * 1. Copyright Notice
+ *
+ * Some or all of this work - Copyright (c) 1999 - 2015, 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 "acpi.h"
+#include "accommon.h"
+#include "acnamesp.h"
+#include "acinterp.h"
+
+
+#define _COMPONENT ACPI_EXECUTER
+ ACPI_MODULE_NAME ("extrace")
+
+
+static ACPI_OPERAND_OBJECT *AcpiGbl_TraceMethodObject = NULL;
+
+/* Local prototypes */
+
+#ifdef ACPI_DEBUG_OUTPUT
+static const char *
+AcpiExGetTraceEventName (
+ ACPI_TRACE_EVENT_TYPE Type);
+#endif
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiExInterpreterTraceEnabled
+ *
+ * PARAMETERS: Name - Whether method name should be matched,
+ * this should be checked before starting
+ * the tracer
+ *
+ * RETURN: TRUE if interpreter trace is enabled.
+ *
+ * DESCRIPTION: Check whether interpreter trace is enabled
+ *
+ ******************************************************************************/
+
+static BOOLEAN
+AcpiExInterpreterTraceEnabled (
+ char *Name)
+{
+
+ /* Check if tracing is enabled */
+
+ if (!(AcpiGbl_TraceFlags & ACPI_TRACE_ENABLED))
+ {
+ return (FALSE);
+ }
+
+ /*
+ * Check if tracing is filtered:
+ *
+ * 1. If the tracer is started, AcpiGbl_TraceMethodObject should have
+ * been filled by the trace starter
+ * 2. If the tracer is not started, AcpiGbl_TraceMethodName should be
+ * matched if it is specified
+ * 3. If the tracer is oneshot style, AcpiGbl_TraceMethodName should
+ * not be cleared by the trace stopper during the first match
+ */
+ if (AcpiGbl_TraceMethodObject)
+ {
+ return (TRUE);
+ }
+
+ if (Name &&
+ (AcpiGbl_TraceMethodName &&
+ strcmp (AcpiGbl_TraceMethodName, Name)))
+ {
+ return (FALSE);
+ }
+
+ if ((AcpiGbl_TraceFlags & ACPI_TRACE_ONESHOT) &&
+ !AcpiGbl_TraceMethodName)
+ {
+ return (FALSE);
+ }
+
+ return (TRUE);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiExGetTraceEventName
+ *
+ * PARAMETERS: Type - Trace event type
+ *
+ * RETURN: Trace event name.
+ *
+ * DESCRIPTION: Used to obtain the full trace event name.
+ *
+ ******************************************************************************/
+
+#ifdef ACPI_DEBUG_OUTPUT
+
+static const char *
+AcpiExGetTraceEventName (
+ ACPI_TRACE_EVENT_TYPE Type)
+{
+
+ switch (Type)
+ {
+ case ACPI_TRACE_AML_METHOD:
+
+ return "Method";
+
+ case ACPI_TRACE_AML_OPCODE:
+
+ return "Opcode";
+
+ case ACPI_TRACE_AML_REGION:
+
+ return "Region";
+
+ default:
+
+ return "";
+ }
+}
+
+#endif
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiExTracePoint
+ *
+ * PARAMETERS: Type - Trace event type
+ * Begin - TRUE if before execution
+ * Aml - Executed AML address
+ * Pathname - Object path
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Internal interpreter execution trace.
+ *
+ ******************************************************************************/
+
+void
+AcpiExTracePoint (
+ ACPI_TRACE_EVENT_TYPE Type,
+ BOOLEAN Begin,
+ UINT8 *Aml,
+ char *Pathname)
+{
+
+ ACPI_FUNCTION_NAME (ExTracePoint);
+
+
+ if (Pathname)
+ {
+ ACPI_DEBUG_PRINT ((ACPI_DB_TRACE_POINT,
+ "%s %s [0x%p:%s] execution.\n",
+ AcpiExGetTraceEventName (Type), Begin ? "Begin" : "End",
+ Aml, Pathname));
+ }
+ else
+ {
+ ACPI_DEBUG_PRINT ((ACPI_DB_TRACE_POINT,
+ "%s %s [0x%p] execution.\n",
+ AcpiExGetTraceEventName (Type), Begin ? "Begin" : "End",
+ Aml));
+ }
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiExStartTraceMethod
+ *
+ * PARAMETERS: MethodNode - Node of the method
+ * ObjDesc - The method object
+ * WalkState - current state, NULL if not yet executing
+ * a method.
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Start control method execution trace
+ *
+ ******************************************************************************/
+
+void
+AcpiExStartTraceMethod (
+ ACPI_NAMESPACE_NODE *MethodNode,
+ ACPI_OPERAND_OBJECT *ObjDesc,
+ ACPI_WALK_STATE *WalkState)
+{
+ ACPI_STATUS Status;
+ char *Pathname = NULL;
+ BOOLEAN Enabled = FALSE;
+
+
+ ACPI_FUNCTION_NAME (ExStartTraceMethod);
+
+
+ if (MethodNode)
+ {
+ Pathname = AcpiNsGetNormalizedPathname (MethodNode, TRUE);
+ }
+
+ Status = AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE);
+ if (ACPI_FAILURE (Status))
+ {
+ goto Exit;
+ }
+
+ Enabled = AcpiExInterpreterTraceEnabled (Pathname);
+ if (Enabled && !AcpiGbl_TraceMethodObject)
+ {
+ AcpiGbl_TraceMethodObject = ObjDesc;
+ AcpiGbl_OriginalDbgLevel = AcpiDbgLevel;
+ AcpiGbl_OriginalDbgLayer = AcpiDbgLayer;
+ AcpiDbgLevel = ACPI_TRACE_LEVEL_ALL;
+ AcpiDbgLayer = ACPI_TRACE_LAYER_ALL;
+
+ if (AcpiGbl_TraceDbgLevel)
+ {
+ AcpiDbgLevel = AcpiGbl_TraceDbgLevel;
+ }
+
+ if (AcpiGbl_TraceDbgLayer)
+ {
+ AcpiDbgLayer = AcpiGbl_TraceDbgLayer;
+ }
+ }
+
+ (void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE);
+
+Exit:
+ if (Enabled)
+ {
+ ACPI_TRACE_POINT (ACPI_TRACE_AML_METHOD, TRUE,
+ ObjDesc ? ObjDesc->Method.AmlStart : NULL, Pathname);
+ }
+
+ if (Pathname)
+ {
+ ACPI_FREE (Pathname);
+ }
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiExStopTraceMethod
+ *
+ * PARAMETERS: MethodNode - Node of the method
+ * ObjDesc - The method object
+ * WalkState - current state, NULL if not yet executing
+ * a method.
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Stop control method execution trace
+ *
+ ******************************************************************************/
+
+void
+AcpiExStopTraceMethod (
+ ACPI_NAMESPACE_NODE *MethodNode,
+ ACPI_OPERAND_OBJECT *ObjDesc,
+ ACPI_WALK_STATE *WalkState)
+{
+ ACPI_STATUS Status;
+ char *Pathname = NULL;
+ BOOLEAN Enabled;
+
+
+ ACPI_FUNCTION_NAME (ExStopTraceMethod);
+
+
+ if (MethodNode)
+ {
+ Pathname = AcpiNsGetNormalizedPathname (MethodNode, TRUE);
+ }
+
+ Status = AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE);
+ if (ACPI_FAILURE (Status))
+ {
+ goto ExitPath;
+ }
+
+ Enabled = AcpiExInterpreterTraceEnabled (NULL);
+
+ (void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE);
+
+ if (Enabled)
+ {
+ ACPI_TRACE_POINT (ACPI_TRACE_AML_METHOD, FALSE,
+ ObjDesc ? ObjDesc->Method.AmlStart : NULL, Pathname);
+ }
+
+ Status = AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE);
+ if (ACPI_FAILURE (Status))
+ {
+ goto ExitPath;
+ }
+
+ /* Check whether the tracer should be stopped */
+
+ if (AcpiGbl_TraceMethodObject == ObjDesc)
+ {
+ /* Disable further tracing if type is one-shot */
+
+ if (AcpiGbl_TraceFlags & ACPI_TRACE_ONESHOT)
+ {
+ AcpiGbl_TraceMethodName = NULL;
+ }
+
+ AcpiDbgLevel = AcpiGbl_OriginalDbgLevel;
+ AcpiDbgLayer = AcpiGbl_OriginalDbgLayer;
+ AcpiGbl_TraceMethodObject = NULL;
+ }
+
+ (void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE);
+
+ExitPath:
+ if (Pathname)
+ {
+ ACPI_FREE (Pathname);
+ }
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiExStartTraceOpcode
+ *
+ * PARAMETERS: Op - The parser opcode object
+ * WalkState - current state, NULL if not yet executing
+ * a method.
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Start opcode execution trace
+ *
+ ******************************************************************************/
+
+void
+AcpiExStartTraceOpcode (
+ ACPI_PARSE_OBJECT *Op,
+ ACPI_WALK_STATE *WalkState)
+{
+
+ ACPI_FUNCTION_NAME (ExStartTraceOpcode);
+
+
+ if (AcpiExInterpreterTraceEnabled (NULL) &&
+ (AcpiGbl_TraceFlags & ACPI_TRACE_OPCODE))
+ {
+ ACPI_TRACE_POINT (ACPI_TRACE_AML_OPCODE, TRUE,
+ Op->Common.Aml, Op->Common.AmlOpName);
+ }
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiExStopTraceOpcode
+ *
+ * PARAMETERS: Op - The parser opcode object
+ * WalkState - current state, NULL if not yet executing
+ * a method.
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Stop opcode execution trace
+ *
+ ******************************************************************************/
+
+void
+AcpiExStopTraceOpcode (
+ ACPI_PARSE_OBJECT *Op,
+ ACPI_WALK_STATE *WalkState)
+{
+
+ ACPI_FUNCTION_NAME (ExStopTraceOpcode);
+
+
+ if (AcpiExInterpreterTraceEnabled (NULL) &&
+ (AcpiGbl_TraceFlags & ACPI_TRACE_OPCODE))
+ {
+ ACPI_TRACE_POINT (ACPI_TRACE_AML_OPCODE, FALSE,
+ Op->Common.Aml, Op->Common.AmlOpName);
+ }
+}
diff --git a/src/acpica/source/components/executer/exutils.c b/src/acpica/source/components/executer/exutils.c
index 90a791d..0356a8d 100644
--- a/src/acpica/source/components/executer/exutils.c
+++ b/src/acpica/source/components/executer/exutils.c
@@ -259,8 +259,8 @@ AcpiExTruncateFor32bitTable (
(ObjDesc->Integer.Value > (UINT64) ACPI_UINT32_MAX))
{
/*
- * We are executing in a 32-bit ACPI table.
- * Truncate the value to 32 bits by zeroing out the upper 32-bit field
+ * We are executing in a 32-bit ACPI table. Truncate
+ * the value to 32 bits by zeroing out the upper 32-bit field
*/
ObjDesc->Integer.Value &= (UINT64) ACPI_UINT32_MAX;
return (TRUE);
@@ -304,7 +304,7 @@ AcpiExAcquireGlobalLock (
/* Attempt to get the global lock, wait forever */
Status = AcpiExAcquireMutexObject (ACPI_WAIT_FOREVER,
- AcpiGbl_GlobalLockMutex, AcpiOsGetThreadId ());
+ AcpiGbl_GlobalLockMutex, AcpiOsGetThreadId ());
if (ACPI_FAILURE (Status))
{
@@ -441,7 +441,8 @@ AcpiExEisaIdToString (
if (CompressedId > ACPI_UINT32_MAX)
{
ACPI_WARNING ((AE_INFO,
- "Expected EISAID is larger than 32 bits: 0x%8.8X%8.8X, truncating",
+ "Expected EISAID is larger than 32 bits: "
+ "0x%8.8X%8.8X, truncating",
ACPI_FORMAT_UINT64 (CompressedId)));
}
@@ -568,5 +569,4 @@ AcpiIsValidSpaceId (
return (TRUE);
}
-
#endif
diff --git a/src/acpica/source/components/hardware/hwacpi.c b/src/acpica/source/components/hardware/hwacpi.c
index 0530383..87a41c3 100644
--- a/src/acpica/source/components/hardware/hwacpi.c
+++ b/src/acpica/source/components/hardware/hwacpi.c
@@ -185,7 +185,7 @@ AcpiHwSetMode (
/* BIOS should have disabled ALL fixed and GP events */
Status = AcpiHwWritePort (AcpiGbl_FADT.SmiCommand,
- (UINT32) AcpiGbl_FADT.AcpiEnable, 8);
+ (UINT32) AcpiGbl_FADT.AcpiEnable, 8);
ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Attempting to enable ACPI mode\n"));
break;
@@ -195,9 +195,9 @@ AcpiHwSetMode (
* enable bits to default
*/
Status = AcpiHwWritePort (AcpiGbl_FADT.SmiCommand,
- (UINT32) AcpiGbl_FADT.AcpiDisable, 8);
+ (UINT32) AcpiGbl_FADT.AcpiDisable, 8);
ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
- "Attempting to enable Legacy (non-ACPI) mode\n"));
+ "Attempting to enable Legacy (non-ACPI) mode\n"));
break;
default:
@@ -221,8 +221,8 @@ AcpiHwSetMode (
{
if (AcpiHwGetMode () == Mode)
{
- ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Mode %X successfully enabled\n",
- Mode));
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
+ "Mode %X successfully enabled\n", Mode));
return_ACPI_STATUS (AE_OK);
}
AcpiOsStall (ACPI_USEC_PER_MSEC);
diff --git a/src/acpica/source/components/hardware/hwesleep.c b/src/acpica/source/components/hardware/hwesleep.c
index ba8acdc..ecc729c 100644
--- a/src/acpica/source/components/hardware/hwesleep.c
+++ b/src/acpica/source/components/hardware/hwesleep.c
@@ -202,7 +202,8 @@ AcpiHwExtendedSleep (
/* Clear wake status (WAK_STS) */
- Status = AcpiWrite ((UINT64) ACPI_X_WAKE_STATUS, &AcpiGbl_FADT.SleepStatus);
+ Status = AcpiWrite ((UINT64) ACPI_X_WAKE_STATUS,
+ &AcpiGbl_FADT.SleepStatus);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
@@ -274,7 +275,7 @@ AcpiHwExtendedWakePrep (
Status = AcpiGetSleepTypeData (ACPI_STATE_S0,
- &AcpiGbl_SleepTypeA, &AcpiGbl_SleepTypeB);
+ &AcpiGbl_SleepTypeA, &AcpiGbl_SleepTypeB);
if (ACPI_SUCCESS (Status))
{
SleepTypeValue = ((AcpiGbl_SleepTypeA << ACPI_X_SLEEP_TYPE_POSITION) &
diff --git a/src/acpica/source/components/hardware/hwgpe.c b/src/acpica/source/components/hardware/hwgpe.c
index 1ab6965..8e4cc8b 100644
--- a/src/acpica/source/components/hardware/hwgpe.c
+++ b/src/acpica/source/components/hardware/hwgpe.c
@@ -280,9 +280,7 @@ AcpiHwClearGpe (
*/
RegisterBit = AcpiHwGetGpeRegisterBit (GpeEventInfo);
- Status = AcpiHwWrite (RegisterBit,
- &GpeRegisterInfo->StatusAddress);
-
+ Status = AcpiHwWrite (RegisterBit, &GpeRegisterInfo->StatusAddress);
return (Status);
}
@@ -323,7 +321,7 @@ AcpiHwGetGpeStatus (
/* GPE currently handled? */
if (ACPI_GPE_DISPATCH_TYPE (GpeEventInfo->Flags) !=
- ACPI_GPE_DISPATCH_NONE)
+ ACPI_GPE_DISPATCH_NONE)
{
LocalEventStatus |= ACPI_EVENT_FLAG_HAS_HANDLER;
}
@@ -405,8 +403,8 @@ AcpiHwGpeEnableWrite (
GpeRegisterInfo->EnableMask = EnableMask;
- Status = AcpiHwWrite (EnableMask, &GpeRegisterInfo->EnableAddress);
+ Status = AcpiHwWrite (EnableMask, &GpeRegisterInfo->EnableAddress);
return (Status);
}
@@ -531,7 +529,7 @@ AcpiHwEnableRuntimeGpeBlock (
/* Enable all "runtime" GPEs in this register */
Status = AcpiHwGpeEnableWrite (GpeRegisterInfo->EnableForRun,
- GpeRegisterInfo);
+ GpeRegisterInfo);
if (ACPI_FAILURE (Status))
{
return (Status);
@@ -578,7 +576,7 @@ AcpiHwEnableWakeupGpeBlock (
* remaining ones.
*/
Status = AcpiHwGpeEnableWrite (GpeRegisterInfo->EnableForWake,
- GpeRegisterInfo);
+ GpeRegisterInfo);
if (ACPI_FAILURE (Status))
{
return (Status);
diff --git a/src/acpica/source/components/hardware/hwregs.c b/src/acpica/source/components/hardware/hwregs.c
index 492833e..8cc2f47 100644
--- a/src/acpica/source/components/hardware/hwregs.c
+++ b/src/acpica/source/components/hardware/hwregs.c
@@ -140,6 +140,7 @@ AcpiHwWriteMultiple (
#endif /* !ACPI_REDUCED_HARDWARE */
+
/******************************************************************************
*
* FUNCTION: AcpiHwValidateRegister
@@ -268,14 +269,14 @@ AcpiHwRead (
if (Reg->SpaceId == ACPI_ADR_SPACE_SYSTEM_MEMORY)
{
Status = AcpiOsReadMemory ((ACPI_PHYSICAL_ADDRESS)
- Address, &Value64, Reg->BitWidth);
+ Address, &Value64, Reg->BitWidth);
*Value = (UINT32) Value64;
}
else /* ACPI_ADR_SPACE_SYSTEM_IO, validated earlier */
{
Status = AcpiHwReadPort ((ACPI_IO_ADDRESS)
- Address, Value, Reg->BitWidth);
+ Address, Value, Reg->BitWidth);
}
ACPI_DEBUG_PRINT ((ACPI_DB_IO,
@@ -329,12 +330,12 @@ AcpiHwWrite (
if (Reg->SpaceId == ACPI_ADR_SPACE_SYSTEM_MEMORY)
{
Status = AcpiOsWriteMemory ((ACPI_PHYSICAL_ADDRESS)
- Address, (UINT64) Value, Reg->BitWidth);
+ Address, (UINT64) Value, Reg->BitWidth);
}
else /* ACPI_ADR_SPACE_SYSTEM_IO, validated earlier */
{
Status = AcpiHwWritePort ((ACPI_IO_ADDRESS)
- Address, Value, Reg->BitWidth);
+ Address, Value, Reg->BitWidth);
}
ACPI_DEBUG_PRINT ((ACPI_DB_IO,
@@ -379,7 +380,7 @@ AcpiHwClearAcpiStatus (
/* Clear the fixed events in PM1 A/B */
Status = AcpiHwRegisterWrite (ACPI_REGISTER_PM1_STATUS,
- ACPI_BITMASK_ALL_FIXED_STATUS);
+ ACPI_BITMASK_ALL_FIXED_STATUS);
AcpiOsReleaseLock (AcpiGbl_HardwareLock, LockFlags);
@@ -498,22 +499,22 @@ AcpiHwRegisterRead (
case ACPI_REGISTER_PM1_STATUS: /* PM1 A/B: 16-bit access each */
Status = AcpiHwReadMultiple (&Value,
- &AcpiGbl_XPm1aStatus,
- &AcpiGbl_XPm1bStatus);
+ &AcpiGbl_XPm1aStatus,
+ &AcpiGbl_XPm1bStatus);
break;
case ACPI_REGISTER_PM1_ENABLE: /* PM1 A/B: 16-bit access each */
Status = AcpiHwReadMultiple (&Value,
- &AcpiGbl_XPm1aEnable,
- &AcpiGbl_XPm1bEnable);
+ &AcpiGbl_XPm1aEnable,
+ &AcpiGbl_XPm1bEnable);
break;
case ACPI_REGISTER_PM1_CONTROL: /* PM1 A/B: 16-bit access each */
Status = AcpiHwReadMultiple (&Value,
- &AcpiGbl_FADT.XPm1aControlBlock,
- &AcpiGbl_FADT.XPm1bControlBlock);
+ &AcpiGbl_FADT.XPm1aControlBlock,
+ &AcpiGbl_FADT.XPm1bControlBlock);
/*
* Zero the write-only bits. From the ACPI specification, "Hardware
@@ -609,15 +610,15 @@ AcpiHwRegisterWrite (
Value &= ~ACPI_PM1_STATUS_PRESERVED_BITS;
Status = AcpiHwWriteMultiple (Value,
- &AcpiGbl_XPm1aStatus,
- &AcpiGbl_XPm1bStatus);
+ &AcpiGbl_XPm1aStatus,
+ &AcpiGbl_XPm1bStatus);
break;
case ACPI_REGISTER_PM1_ENABLE: /* PM1 A/B: 16-bit access each */
Status = AcpiHwWriteMultiple (Value,
- &AcpiGbl_XPm1aEnable,
- &AcpiGbl_XPm1bEnable);
+ &AcpiGbl_XPm1aEnable,
+ &AcpiGbl_XPm1bEnable);
break;
case ACPI_REGISTER_PM1_CONTROL: /* PM1 A/B: 16-bit access each */
@@ -626,8 +627,8 @@ AcpiHwRegisterWrite (
* Note: This includes SCI_EN, we never want to change this bit
*/
Status = AcpiHwReadMultiple (&ReadValue,
- &AcpiGbl_FADT.XPm1aControlBlock,
- &AcpiGbl_FADT.XPm1bControlBlock);
+ &AcpiGbl_FADT.XPm1aControlBlock,
+ &AcpiGbl_FADT.XPm1bControlBlock);
if (ACPI_FAILURE (Status))
{
goto Exit;
@@ -640,8 +641,8 @@ AcpiHwRegisterWrite (
/* Now we can write the data */
Status = AcpiHwWriteMultiple (Value,
- &AcpiGbl_FADT.XPm1aControlBlock,
- &AcpiGbl_FADT.XPm1bControlBlock);
+ &AcpiGbl_FADT.XPm1aControlBlock,
+ &AcpiGbl_FADT.XPm1bControlBlock);
break;
case ACPI_REGISTER_PM2_CONTROL: /* 8-bit access */
diff --git a/src/acpica/source/components/hardware/hwsleep.c b/src/acpica/source/components/hardware/hwsleep.c
index 6438ea7..f80f421 100644
--- a/src/acpica/source/components/hardware/hwsleep.c
+++ b/src/acpica/source/components/hardware/hwsleep.c
@@ -155,7 +155,8 @@ AcpiHwLegacySleep (
/* Clear wake status */
- Status = AcpiWriteBitRegister (ACPI_BITREG_WAKE_STATUS, ACPI_CLEAR_STATUS);
+ Status = AcpiWriteBitRegister (ACPI_BITREG_WAKE_STATUS,
+ ACPI_CLEAR_STATUS);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
@@ -189,7 +190,7 @@ AcpiHwLegacySleep (
/* Get current value of PM1A control */
Status = AcpiHwRegisterRead (ACPI_REGISTER_PM1_CONTROL,
- &Pm1aControl);
+ &Pm1aControl);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
@@ -200,7 +201,7 @@ AcpiHwLegacySleep (
/* Clear the SLP_EN and SLP_TYP fields */
Pm1aControl &= ~(SleepTypeRegInfo->AccessBitMask |
- SleepEnableRegInfo->AccessBitMask);
+ SleepEnableRegInfo->AccessBitMask);
Pm1bControl = Pm1aControl;
/* Insert the SLP_TYP bits */
@@ -254,7 +255,7 @@ AcpiHwLegacySleep (
AcpiOsStall (10 * ACPI_USEC_PER_SEC);
Status = AcpiHwRegisterWrite (ACPI_REGISTER_PM1_CONTROL,
- SleepEnableRegInfo->AccessBitMask);
+ SleepEnableRegInfo->AccessBitMask);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
@@ -310,7 +311,7 @@ AcpiHwLegacyWakePrep (
* by some machines.
*/
Status = AcpiGetSleepTypeData (ACPI_STATE_S0,
- &AcpiGbl_SleepTypeA, &AcpiGbl_SleepTypeB);
+ &AcpiGbl_SleepTypeA, &AcpiGbl_SleepTypeB);
if (ACPI_SUCCESS (Status))
{
SleepTypeRegInfo =
@@ -321,7 +322,7 @@ AcpiHwLegacyWakePrep (
/* Get current value of PM1A control */
Status = AcpiHwRegisterRead (ACPI_REGISTER_PM1_CONTROL,
- &Pm1aControl);
+ &Pm1aControl);
if (ACPI_SUCCESS (Status))
{
/* Clear the SLP_EN and SLP_TYP fields */
@@ -406,7 +407,8 @@ AcpiHwLegacyWake (
* and use it to determine whether the system is rebooting or
* resuming. Clear WAK_STS for compatibility.
*/
- (void) AcpiWriteBitRegister (ACPI_BITREG_WAKE_STATUS, ACPI_CLEAR_STATUS);
+ (void) AcpiWriteBitRegister (ACPI_BITREG_WAKE_STATUS,
+ ACPI_CLEAR_STATUS);
AcpiGbl_SystemAwakeAndRunning = TRUE;
/* Enable power button */
diff --git a/src/acpica/source/components/hardware/hwxface.c b/src/acpica/source/components/hardware/hwxface.c
index 12c4ffb..1a30db6 100644
--- a/src/acpica/source/components/hardware/hwxface.c
+++ b/src/acpica/source/components/hardware/hwxface.c
@@ -241,7 +241,7 @@ AcpiRead (
if (Reg->SpaceId == ACPI_ADR_SPACE_SYSTEM_MEMORY)
{
Status = AcpiOsReadMemory ((ACPI_PHYSICAL_ADDRESS)
- Address, ReturnValue, Reg->BitWidth);
+ Address, ReturnValue, Reg->BitWidth);
if (ACPI_FAILURE (Status))
{
return (Status);
@@ -259,7 +259,7 @@ AcpiRead (
}
Status = AcpiHwReadPort ((ACPI_IO_ADDRESS)
- Address, &ValueLo, Width);
+ Address, &ValueLo, Width);
if (ACPI_FAILURE (Status))
{
return (Status);
@@ -270,7 +270,7 @@ AcpiRead (
/* Read the top 32 bits */
Status = AcpiHwReadPort ((ACPI_IO_ADDRESS)
- (Address + 4), &ValueHi, 32);
+ (Address + 4), &ValueHi, 32);
if (ACPI_FAILURE (Status))
{
return (Status);
@@ -335,7 +335,7 @@ AcpiWrite (
if (Reg->SpaceId == ACPI_ADR_SPACE_SYSTEM_MEMORY)
{
Status = AcpiOsWriteMemory ((ACPI_PHYSICAL_ADDRESS)
- Address, Value, Reg->BitWidth);
+ Address, Value, Reg->BitWidth);
if (ACPI_FAILURE (Status))
{
return (Status);
@@ -350,7 +350,7 @@ AcpiWrite (
}
Status = AcpiHwWritePort ((ACPI_IO_ADDRESS)
- Address, ACPI_LODWORD (Value), Width);
+ Address, ACPI_LODWORD (Value), Width);
if (ACPI_FAILURE (Status))
{
return (Status);
@@ -359,7 +359,7 @@ AcpiWrite (
if (Reg->BitWidth == 64)
{
Status = AcpiHwWritePort ((ACPI_IO_ADDRESS)
- (Address + 4), ACPI_HIDWORD (Value), 32);
+ (Address + 4), ACPI_HIDWORD (Value), 32);
if (ACPI_FAILURE (Status))
{
return (Status);
@@ -430,7 +430,7 @@ AcpiReadBitRegister (
/* Read the entire parent register */
Status = AcpiHwRegisterRead (BitRegInfo->ParentRegister,
- &RegisterValue);
+ &RegisterValue);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
@@ -439,7 +439,7 @@ AcpiReadBitRegister (
/* Normalize the value that was read, mask off other bits */
Value = ((RegisterValue & BitRegInfo->AccessBitMask)
- >> BitRegInfo->BitPosition);
+ >> BitRegInfo->BitPosition);
ACPI_DEBUG_PRINT ((ACPI_DB_IO,
"BitReg %X, ParentReg %X, Actual %8.8X, ReturnValue %8.8X\n",
@@ -511,7 +511,7 @@ AcpiWriteBitRegister (
* interested in
*/
Status = AcpiHwRegisterRead (BitRegInfo->ParentRegister,
- &RegisterValue);
+ &RegisterValue);
if (ACPI_FAILURE (Status))
{
goto UnlockAndExit;
@@ -525,7 +525,7 @@ AcpiWriteBitRegister (
BitRegInfo->AccessBitMask, Value);
Status = AcpiHwRegisterWrite (BitRegInfo->ParentRegister,
- RegisterValue);
+ RegisterValue);
}
else
{
@@ -545,7 +545,7 @@ AcpiWriteBitRegister (
if (RegisterValue)
{
Status = AcpiHwRegisterWrite (ACPI_REGISTER_PM1_STATUS,
- RegisterValue);
+ RegisterValue);
}
}
@@ -637,12 +637,20 @@ AcpiGetSleepTypeData (
* Evaluate the \_Sx namespace object containing the register values
* for this state
*/
- Info->RelativePathname = ACPI_CAST_PTR (
- char, AcpiGbl_SleepStateNames[SleepState]);
+ Info->RelativePathname = ACPI_CAST_PTR (char,
+ AcpiGbl_SleepStateNames[SleepState]);
+
Status = AcpiNsEvaluate (Info);
if (ACPI_FAILURE (Status))
{
- goto Cleanup;
+ if (Status == AE_NOT_FOUND)
+ {
+ /* The _Sx states are optional, ignore NOT_FOUND */
+
+ goto FinalCleanup;
+ }
+
+ goto WarningCleanup;
}
/* Must have a return object */
@@ -652,7 +660,7 @@ AcpiGetSleepTypeData (
ACPI_ERROR ((AE_INFO, "No Sleep State object returned from [%s]",
Info->RelativePathname));
Status = AE_AML_NO_RETURN_VALUE;
- goto Cleanup;
+ goto WarningCleanup;
}
/* Return object must be of type Package */
@@ -661,7 +669,7 @@ AcpiGetSleepTypeData (
{
ACPI_ERROR ((AE_INFO, "Sleep State return object is not a Package"));
Status = AE_AML_OPERAND_TYPE;
- goto Cleanup1;
+ goto ReturnValueCleanup;
}
/*
@@ -708,16 +716,18 @@ AcpiGetSleepTypeData (
break;
}
-Cleanup1:
+ReturnValueCleanup:
AcpiUtRemoveReference (Info->ReturnObject);
-Cleanup:
+WarningCleanup:
if (ACPI_FAILURE (Status))
{
ACPI_EXCEPTION ((AE_INFO, Status,
- "While evaluating Sleep State [%s]", Info->RelativePathname));
+ "While evaluating Sleep State [%s]",
+ Info->RelativePathname));
}
+FinalCleanup:
ACPI_FREE (Info);
return_ACPI_STATUS (Status);
}
diff --git a/src/acpica/source/components/hardware/hwxfsleep.c b/src/acpica/source/components/hardware/hwxfsleep.c
index ce6e8ee..b0abf1a 100644
--- a/src/acpica/source/components/hardware/hwxfsleep.c
+++ b/src/acpica/source/components/hardware/hwxfsleep.c
@@ -244,7 +244,7 @@ AcpiSetFirmwareWakingVector (
if (AcpiGbl_FACS)
{
(void) AcpiHwSetFirmwareWakingVector (AcpiGbl_FACS,
- PhysicalAddress, PhysicalAddress64);
+ PhysicalAddress, PhysicalAddress64);
}
return_ACPI_STATUS (AE_OK);
@@ -311,7 +311,7 @@ AcpiEnterSleepStateS4bios (
ACPI_FLUSH_CPU_CACHE ();
Status = AcpiHwWritePort (AcpiGbl_FADT.SmiCommand,
- (UINT32) AcpiGbl_FADT.S4BiosRequest, 8);
+ (UINT32) AcpiGbl_FADT.S4BiosRequest, 8);
do {
AcpiOsStall (ACPI_USEC_PER_MSEC);
@@ -320,6 +320,7 @@ AcpiEnterSleepStateS4bios (
{
return_ACPI_STATUS (Status);
}
+
} while (!InValue);
return_ACPI_STATUS (AE_OK);
@@ -415,7 +416,7 @@ AcpiEnterSleepStatePrep (
Status = AcpiGetSleepTypeData (SleepState,
- &AcpiGbl_SleepTypeA, &AcpiGbl_SleepTypeB);
+ &AcpiGbl_SleepTypeA, &AcpiGbl_SleepTypeB);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
diff --git a/src/acpica/source/components/namespace/nsaccess.c b/src/acpica/source/components/namespace/nsaccess.c
index 6667308..e44164f 100644
--- a/src/acpica/source/components/namespace/nsaccess.c
+++ b/src/acpica/source/components/namespace/nsaccess.c
@@ -189,8 +189,8 @@ AcpiNsRootInitialize (
}
Status = AcpiNsLookup (NULL, InitVal->Name, InitVal->Type,
- ACPI_IMODE_LOAD_PASS2, ACPI_NS_NO_UPSEARCH,
- NULL, &NewNode);
+ ACPI_IMODE_LOAD_PASS2, ACPI_NS_NO_UPSEARCH,
+ NULL, &NewNode);
if (ACPI_FAILURE (Status))
{
ACPI_EXCEPTION ((AE_INFO, Status,
@@ -291,7 +291,7 @@ AcpiNsRootInitialize (
/* Create additional counting semaphore for global lock */
Status = AcpiOsCreateSemaphore (
- 1, 0, &AcpiGbl_GlobalLockSemaphore);
+ 1, 0, &AcpiGbl_GlobalLockSemaphore);
if (ACPI_FAILURE (Status))
{
AcpiUtRemoveReference (ObjDesc);
@@ -312,7 +312,7 @@ AcpiNsRootInitialize (
/* Store pointer to value descriptor in the Node */
Status = AcpiNsAttachObject (NewNode, ObjDesc,
- ObjDesc->Common.Type);
+ ObjDesc->Common.Type);
/* Remove local reference to the object */
@@ -329,7 +329,7 @@ UnlockAndExit:
if (ACPI_SUCCESS (Status))
{
Status = AcpiNsGetNode (NULL, "\\_GPE", ACPI_NS_NO_UPSEARCH,
- &AcpiGbl_FadtGpeDevice);
+ &AcpiGbl_FadtGpeDevice);
}
return_ACPI_STATUS (Status);
@@ -661,7 +661,7 @@ AcpiNsLookup (
/* Try to find the single (4 character) ACPI name */
Status = AcpiNsSearchAndEnter (SimpleName, WalkState, CurrentNode,
- InterpreterMode, ThisSearchType, LocalFlags, &ThisNode);
+ InterpreterMode, ThisSearchType, LocalFlags, &ThisNode);
if (ACPI_FAILURE (Status))
{
if (Status == AE_NOT_FOUND)
diff --git a/src/acpica/source/components/namespace/nsalloc.c b/src/acpica/source/components/namespace/nsalloc.c
index 293bf26..65d6ba2 100644
--- a/src/acpica/source/components/namespace/nsalloc.c
+++ b/src/acpica/source/components/namespace/nsalloc.c
@@ -157,7 +157,7 @@ AcpiNsCreateNode (
#ifdef ACPI_DBG_TRACK_ALLOCATIONS
Temp = AcpiGbl_NsNodeList->TotalAllocated -
- AcpiGbl_NsNodeList->TotalFreed;
+ AcpiGbl_NsNodeList->TotalFreed;
if (Temp > AcpiGbl_NsNodeList->MaxOccupied)
{
AcpiGbl_NsNodeList->MaxOccupied = Temp;
@@ -349,7 +349,8 @@ AcpiNsInstallNode (
* modified the namespace. This is used for cleanup when the
* method exits.
*/
- WalkState->MethodDesc->Method.InfoFlags |= ACPI_METHOD_MODIFIED_NAMESPACE;
+ WalkState->MethodDesc->Method.InfoFlags |=
+ ACPI_METHOD_MODIFIED_NAMESPACE;
}
}
diff --git a/src/acpica/source/components/namespace/nsarguments.c b/src/acpica/source/components/namespace/nsarguments.c
index 08e0716..a5b3490 100644
--- a/src/acpica/source/components/namespace/nsarguments.c
+++ b/src/acpica/source/components/namespace/nsarguments.c
@@ -209,7 +209,8 @@ AcpiNsCheckAcpiCompliance (
/* Get the ACPI-required arg count from the predefined info table */
- RequiredParamCount = METHOD_GET_ARG_COUNT (Predefined->Info.ArgumentList);
+ RequiredParamCount =
+ METHOD_GET_ARG_COUNT (Predefined->Info.ArgumentList);
/*
* If this object is not a control method, we can check if the ACPI
@@ -355,7 +356,8 @@ AcpiNsCheckArgumentCount (
* Some methods are allowed to have a "minimum" number of args (_SCP)
* because their definition in ACPI has changed over time.
*/
- RequiredParamCount = METHOD_GET_ARG_COUNT (Predefined->Info.ArgumentList);
+ RequiredParamCount =
+ METHOD_GET_ARG_COUNT (Predefined->Info.ArgumentList);
if (UserParamCount < RequiredParamCount)
{
diff --git a/src/acpica/source/components/namespace/nsconvert.c b/src/acpica/source/components/namespace/nsconvert.c
index b79458e..ee361ea 100644
--- a/src/acpica/source/components/namespace/nsconvert.c
+++ b/src/acpica/source/components/namespace/nsconvert.c
@@ -156,7 +156,7 @@ AcpiNsConvertToInteger (
/* String-to-Integer conversion */
Status = AcpiUtStrtoul64 (OriginalObject->String.Pointer,
- ACPI_ANY_BASE, &Value);
+ ACPI_ANY_BASE, &Value);
if (ACPI_FAILURE (Status))
{
return (Status);
@@ -176,7 +176,8 @@ AcpiNsConvertToInteger (
for (i = 0; i < OriginalObject->Buffer.Length; i++)
{
- Value |= ((UINT64) OriginalObject->Buffer.Pointer[i] << (i * 8));
+ Value |= ((UINT64)
+ OriginalObject->Buffer.Pointer[i] << (i * 8));
}
break;
@@ -239,8 +240,8 @@ AcpiNsConvertToString (
}
else
{
- Status = AcpiExConvertToString (OriginalObject, &NewObject,
- ACPI_IMPLICIT_CONVERT_HEX);
+ Status = AcpiExConvertToString (OriginalObject,
+ &NewObject, ACPI_IMPLICIT_CONVERT_HEX);
if (ACPI_FAILURE (Status))
{
return (Status);
@@ -335,7 +336,8 @@ AcpiNsConvertToBuffer (
/* String-to-Buffer conversion. Simple data copy */
- NewObject = AcpiUtCreateBufferObject (OriginalObject->String.Length);
+ NewObject = AcpiUtCreateBufferObject
+ (OriginalObject->String.Length);
if (!NewObject)
{
return (AE_NO_MEMORY);
diff --git a/src/acpica/source/components/namespace/nsdump.c b/src/acpica/source/components/namespace/nsdump.c
index 0d3b57e..6510b4f 100644
--- a/src/acpica/source/components/namespace/nsdump.c
+++ b/src/acpica/source/components/namespace/nsdump.c
@@ -331,7 +331,8 @@ AcpiNsDumpOneObject (
if (Type > ACPI_TYPE_LOCAL_MAX)
{
- ACPI_WARNING ((AE_INFO, "Invalid ACPI Object Type 0x%08X", Type));
+ ACPI_WARNING ((AE_INFO,
+ "Invalid ACPI Object Type 0x%08X", Type));
}
AcpiOsPrintf ("%4.4s", AcpiUtGetNodeName (ThisNode));
@@ -340,7 +341,7 @@ AcpiNsDumpOneObject (
/* Now we can print out the pertinent information */
AcpiOsPrintf (" %-12s %p %2.2X ",
- AcpiUtGetTypeName (Type), ThisNode, ThisNode->OwnerId);
+ AcpiUtGetTypeName (Type), ThisNode, ThisNode->OwnerId);
DbgLevel = AcpiDbgLevel;
AcpiDbgLevel = 0;
@@ -427,7 +428,7 @@ AcpiNsDumpOneObject (
if (ObjDesc->Common.Flags & AOPOBJ_DATA_VALID)
{
AcpiOsPrintf ("Len %.2X",
- ObjDesc->Buffer.Length);
+ ObjDesc->Buffer.Length);
/* Dump some of the buffer */
@@ -608,9 +609,9 @@ AcpiNsDumpOneObject (
/* If there is an attached object, display it */
- DbgLevel = AcpiDbgLevel;
+ DbgLevel = AcpiDbgLevel;
AcpiDbgLevel = 0;
- ObjDesc = AcpiNsGetAttachedObject (ThisNode);
+ ObjDesc = AcpiNsGetAttachedObject (ThisNode);
AcpiDbgLevel = DbgLevel;
/* Dump attached objects */
@@ -637,14 +638,18 @@ AcpiNsDumpOneObject (
if (ObjType > ACPI_TYPE_LOCAL_MAX)
{
- AcpiOsPrintf ("(Pointer to ACPI Object type %.2X [UNKNOWN])\n",
+ AcpiOsPrintf (
+ "(Pointer to ACPI Object type %.2X [UNKNOWN])\n",
ObjType);
+
BytesToDump = 32;
}
else
{
- AcpiOsPrintf ("(Pointer to ACPI Object type %.2X [%s])\n",
+ AcpiOsPrintf (
+ "(Pointer to ACPI Object type %.2X [%s])\n",
ObjType, AcpiUtGetTypeName (ObjType));
+
BytesToDump = sizeof (ACPI_OPERAND_OBJECT);
}
@@ -674,7 +679,8 @@ AcpiNsDumpOneObject (
*/
BytesToDump = ObjDesc->String.Length;
ObjDesc = (void *) ObjDesc->String.Pointer;
- AcpiOsPrintf ( "(Buffer/String pointer %p length %X)\n",
+
+ AcpiOsPrintf ("(Buffer/String pointer %p length %X)\n",
ObjDesc, BytesToDump);
ACPI_DUMP_BUFFER (ObjDesc, BytesToDump);
goto Cleanup;
@@ -775,8 +781,8 @@ AcpiNsDumpObjects (
Info.DisplayType = DisplayType;
(void) AcpiNsWalkNamespace (Type, StartHandle, MaxDepth,
- ACPI_NS_WALK_NO_UNLOCK | ACPI_NS_WALK_TEMP_NODES,
- AcpiNsDumpOneObject, NULL, (void *) &Info, NULL);
+ ACPI_NS_WALK_NO_UNLOCK | ACPI_NS_WALK_TEMP_NODES,
+ AcpiNsDumpOneObject, NULL, (void *) &Info, NULL);
(void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE);
}
@@ -826,7 +832,7 @@ AcpiNsDumpOneObjectPath (
return (AE_OK);
}
- Pathname = AcpiNsGetExternalPathname (Node);
+ Pathname = AcpiNsGetNormalizedPathname (Node, TRUE);
PathIndent = 1;
if (Level <= MaxLevel)
@@ -912,14 +918,14 @@ AcpiNsDumpObjectPaths (
/* Get the max depth of the namespace tree, for formatting later */
(void) AcpiNsWalkNamespace (Type, StartHandle, MaxDepth,
- ACPI_NS_WALK_NO_UNLOCK | ACPI_NS_WALK_TEMP_NODES,
- AcpiNsGetMaxDepth, NULL, (void *) &MaxLevel, NULL);
+ ACPI_NS_WALK_NO_UNLOCK | ACPI_NS_WALK_TEMP_NODES,
+ AcpiNsGetMaxDepth, NULL, (void *) &MaxLevel, NULL);
/* Now dump the entire namespace */
(void) AcpiNsWalkNamespace (Type, StartHandle, MaxDepth,
- ACPI_NS_WALK_NO_UNLOCK | ACPI_NS_WALK_TEMP_NODES,
- AcpiNsDumpOneObjectPath, NULL, (void *) &MaxLevel, NULL);
+ ACPI_NS_WALK_NO_UNLOCK | ACPI_NS_WALK_TEMP_NODES,
+ AcpiNsDumpOneObjectPath, NULL, (void *) &MaxLevel, NULL);
(void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE);
}
@@ -990,7 +996,8 @@ AcpiNsDumpTables (
* If the name space has not been initialized,
* there is nothing to dump.
*/
- ACPI_DEBUG_PRINT ((ACPI_DB_TABLES, "namespace not initialized!\n"));
+ ACPI_DEBUG_PRINT ((ACPI_DB_TABLES,
+ "namespace not initialized!\n"));
return_VOID;
}
@@ -1003,7 +1010,7 @@ AcpiNsDumpTables (
}
AcpiNsDumpObjects (ACPI_TYPE_ANY, ACPI_DISPLAY_OBJECTS, MaxDepth,
- ACPI_OWNER_ID_MAX, SearchHandle);
+ ACPI_OWNER_ID_MAX, SearchHandle);
return_VOID;
}
#endif
diff --git a/src/acpica/source/components/namespace/nsdumpdv.c b/src/acpica/source/components/namespace/nsdumpdv.c
index 8e570d1..9afad0b 100644
--- a/src/acpica/source/components/namespace/nsdumpdv.c
+++ b/src/acpica/source/components/namespace/nsdumpdv.c
@@ -222,8 +222,8 @@ AcpiNsDumpRootDevices (
"Display of all devices in the namespace:\n"));
Status = AcpiNsWalkNamespace (ACPI_TYPE_DEVICE, SysBusHandle,
- ACPI_UINT32_MAX, ACPI_NS_WALK_NO_UNLOCK,
- AcpiNsDumpOneDevice, NULL, NULL, NULL);
+ ACPI_UINT32_MAX, ACPI_NS_WALK_NO_UNLOCK,
+ AcpiNsDumpOneDevice, NULL, NULL, NULL);
}
#endif
diff --git a/src/acpica/source/components/namespace/nseval.c b/src/acpica/source/components/namespace/nseval.c
index 7c8d6fd..9847e93 100644
--- a/src/acpica/source/components/namespace/nseval.c
+++ b/src/acpica/source/components/namespace/nseval.c
@@ -217,7 +217,7 @@ AcpiNsEvaluate (
/* Get the full pathname to the object, for use in warning messages */
- Info->FullPathname = AcpiNsGetExternalPathname (Info->Node);
+ Info->FullPathname = AcpiNsGetNormalizedPathname (Info->Node, TRUE);
if (!Info->FullPathname)
{
return_ACPI_STATUS (AE_NO_MEMORY);
@@ -514,7 +514,7 @@ AcpiNsExecModuleCode (
* of the method object descriptor.
*/
ParentNode = ACPI_CAST_PTR (ACPI_NAMESPACE_NODE,
- MethodObj->Method.NextObject);
+ MethodObj->Method.NextObject);
Type = AcpiNsGetType (ParentNode);
/*
@@ -553,7 +553,7 @@ AcpiNsExecModuleCode (
/* Install the method (module-level code) in the parent node */
Status = AcpiNsAttachObject (ParentNode, MethodObj,
- ACPI_TYPE_METHOD);
+ ACPI_TYPE_METHOD);
if (ACPI_FAILURE (Status))
{
goto Exit;
diff --git a/src/acpica/source/components/namespace/nsinit.c b/src/acpica/source/components/namespace/nsinit.c
index 6bedef9..7b4acc1 100644
--- a/src/acpica/source/components/namespace/nsinit.c
+++ b/src/acpica/source/components/namespace/nsinit.c
@@ -182,8 +182,8 @@ AcpiNsInitializeObjects (
/* Walk entire namespace from the supplied root */
Status = AcpiWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT,
- ACPI_UINT32_MAX, AcpiNsInitOneObject, NULL,
- &Info, NULL);
+ ACPI_UINT32_MAX, AcpiNsInitOneObject, NULL,
+ &Info, NULL);
if (ACPI_FAILURE (Status))
{
ACPI_EXCEPTION ((AE_INFO, Status, "During WalkNamespace"));
@@ -245,7 +245,7 @@ AcpiNsInitializeDevices (
/* Tree analysis: find all subtrees that contain _INI methods */
Status = AcpiNsWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT,
- ACPI_UINT32_MAX, FALSE, AcpiNsFindIniMethods, NULL, &Info, NULL);
+ ACPI_UINT32_MAX, FALSE, AcpiNsFindIniMethods, NULL, &Info, NULL);
if (ACPI_FAILURE (Status))
{
goto ErrorExit;
@@ -279,7 +279,7 @@ AcpiNsInitializeDevices (
/* Walk namespace to execute all _INIs on present devices */
Status = AcpiNsWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT,
- ACPI_UINT32_MAX, FALSE, AcpiNsInitOneDevice, NULL, &Info, NULL);
+ ACPI_UINT32_MAX, FALSE, AcpiNsInitOneDevice, NULL, &Info, NULL);
/*
* Any _OSI requests should be completed by now. If the BIOS has
@@ -703,7 +703,7 @@ AcpiNsInitOneDevice (
{
/* Ignore error and move on to next device */
- char *ScopeName = AcpiNsGetExternalPathname (Info->Node);
+ char *ScopeName = AcpiNsGetNormalizedPathname (DeviceNode, TRUE);
ACPI_EXCEPTION ((AE_INFO, Status, "during %s._INI execution",
ScopeName));
diff --git a/src/acpica/source/components/namespace/nsload.c b/src/acpica/source/components/namespace/nsload.c
index 8e1a0c2..cae1616 100644
--- a/src/acpica/source/components/namespace/nsload.c
+++ b/src/acpica/source/components/namespace/nsload.c
@@ -331,8 +331,8 @@ AcpiNsDeleteSubtree (
ParentHandle = StartHandle;
- ChildHandle = NULL;
- Level = 1;
+ ChildHandle = NULL;
+ Level = 1;
/*
* Traverse the tree of objects until we bubble back up
@@ -343,7 +343,7 @@ AcpiNsDeleteSubtree (
/* Attempt to get the next object in this scope */
Status = AcpiGetNextObject (ACPI_TYPE_ANY, ParentHandle,
- ChildHandle, &NextChildHandle);
+ ChildHandle, &NextChildHandle);
ChildHandle = NextChildHandle;
@@ -354,7 +354,7 @@ AcpiNsDeleteSubtree (
/* Check if this object has any children */
if (ACPI_SUCCESS (AcpiGetNextObject (ACPI_TYPE_ANY, ChildHandle,
- NULL, &Dummy)))
+ NULL, &Dummy)))
{
/*
* There is at least one child of this object,
@@ -432,7 +432,6 @@ AcpiNsUnloadNamespace (
/* This function does the real work */
Status = AcpiNsDeleteSubtree (Handle);
-
return_ACPI_STATUS (Status);
}
#endif
diff --git a/src/acpica/source/components/namespace/nsnames.c b/src/acpica/source/components/namespace/nsnames.c
index 3ca04f0..cd11cb4 100644
--- a/src/acpica/source/components/namespace/nsnames.c
+++ b/src/acpica/source/components/namespace/nsnames.c
@@ -149,7 +149,6 @@ AcpiNsGetExternalPathname (
NameBuffer = AcpiNsGetNormalizedPathname (Node, FALSE);
-
return_PTR (NameBuffer);
}
@@ -177,7 +176,6 @@ AcpiNsGetPathnameLength (
Size = AcpiNsBuildNormalizedPath (Node, NULL, 0, FALSE);
-
return (Size);
}
@@ -237,7 +235,7 @@ AcpiNsHandleToPathname (
/* Build the path in the caller buffer */
(void) AcpiNsBuildNormalizedPath (Node, Buffer->Pointer,
- RequiredSize, NoTrailing);
+ RequiredSize, NoTrailing);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
@@ -318,6 +316,7 @@ AcpiNsBuildNormalizedPath (
{
ACPI_PATH_PUT8(FullPath, PathSize, AML_DUAL_NAME_PREFIX, Length);
}
+
ACPI_MOVE_32_TO_32 (Name, &NextNode->Name);
DoNoTrailing = NoTrailing;
for (i = 0; i < 4; i++)
@@ -332,8 +331,10 @@ AcpiNsBuildNormalizedPath (
ACPI_PATH_PUT8(FullPath, PathSize, c, Length);
}
}
+
NextNode = NextNode->Parent;
}
+
ACPI_PATH_PUT8(FullPath, PathSize, AML_ROOT_PREFIX, Length);
/* Reverse the path string */
@@ -341,7 +342,8 @@ AcpiNsBuildNormalizedPath (
if (Length <= PathSize)
{
Left = FullPath;
- Right = FullPath+Length-1;
+ Right = FullPath+Length - 1;
+
while (Left < Right)
{
c = *Left;
@@ -353,7 +355,7 @@ AcpiNsBuildNormalizedPath (
/* Append the trailing null */
BuildTrailingNull:
- ACPI_PATH_PUT8(FullPath, PathSize, '\0', Length);
+ ACPI_PATH_PUT8 (FullPath, PathSize, '\0', Length);
#undef ACPI_PATH_PUT8
@@ -403,7 +405,8 @@ AcpiNsGetNormalizedPathname (
NameBuffer = ACPI_ALLOCATE_ZEROED (Size);
if (!NameBuffer)
{
- ACPI_ERROR ((AE_INFO, "Could not allocate %u bytes", (UINT32) Size));
+ ACPI_ERROR ((AE_INFO,
+ "Could not allocate %u bytes", (UINT32) Size));
return_PTR (NULL);
}
diff --git a/src/acpica/source/components/namespace/nsobject.c b/src/acpica/source/components/namespace/nsobject.c
index 50b1d65..a6f8876 100644
--- a/src/acpica/source/components/namespace/nsobject.c
+++ b/src/acpica/source/components/namespace/nsobject.c
@@ -217,7 +217,7 @@ AcpiNsAttachObject (
* Value passed is a name handle and that name has a
* non-null value. Use that name's value and type.
*/
- ObjDesc = ((ACPI_NAMESPACE_NODE *) Object)->Object;
+ ObjDesc = ((ACPI_NAMESPACE_NODE *) Object)->Object;
ObjectType = ((ACPI_NAMESPACE_NODE *) Object)->Type;
}
@@ -267,8 +267,8 @@ AcpiNsAttachObject (
LastObjDesc->Common.NextObject = Node->Object;
}
- Node->Type = (UINT8) ObjectType;
- Node->Object = ObjDesc;
+ Node->Type = (UINT8) ObjectType;
+ Node->Object = ObjDesc;
return_ACPI_STATUS (AE_OK);
}
diff --git a/src/acpica/source/components/namespace/nsparse.c b/src/acpica/source/components/namespace/nsparse.c
index 26dd9f3..9fcc47f 100644
--- a/src/acpica/source/components/namespace/nsparse.c
+++ b/src/acpica/source/components/namespace/nsparse.c
@@ -196,7 +196,7 @@ AcpiNsOneCompleteParse (
}
Status = AcpiDsInitAmlWalk (WalkState, ParseRoot, NULL,
- AmlStart, AmlLength, NULL, (UINT8) PassNumber);
+ AmlStart, AmlLength, NULL, (UINT8) PassNumber);
if (ACPI_FAILURE (Status))
{
AcpiDsDeleteWalkState (WalkState);
@@ -215,7 +215,8 @@ AcpiNsOneCompleteParse (
if (StartNode && StartNode != AcpiGbl_RootNode)
{
- Status = AcpiDsScopeStackPush (StartNode, ACPI_TYPE_METHOD, WalkState);
+ Status = AcpiDsScopeStackPush (
+ StartNode, ACPI_TYPE_METHOD, WalkState);
if (ACPI_FAILURE (Status))
{
AcpiDsDeleteWalkState (WalkState);
@@ -225,7 +226,8 @@ AcpiNsOneCompleteParse (
/* Parse the AML */
- ACPI_DEBUG_PRINT ((ACPI_DB_PARSE, "*PARSE* pass %u parse\n", PassNumber));
+ ACPI_DEBUG_PRINT ((ACPI_DB_PARSE,
+ "*PARSE* pass %u parse\n", PassNumber));
Status = AcpiPsParseAml (WalkState);
Cleanup:
@@ -269,8 +271,9 @@ AcpiNsParseTable (
* performs another complete parse of the AML.
*/
ACPI_DEBUG_PRINT ((ACPI_DB_PARSE, "**** Start pass 1\n"));
+
Status = AcpiNsOneCompleteParse (ACPI_IMODE_LOAD_PASS1,
- TableIndex, StartNode);
+ TableIndex, StartNode);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
@@ -287,7 +290,7 @@ AcpiNsParseTable (
*/
ACPI_DEBUG_PRINT ((ACPI_DB_PARSE, "**** Start pass 2\n"));
Status = AcpiNsOneCompleteParse (ACPI_IMODE_LOAD_PASS2,
- TableIndex, StartNode);
+ TableIndex, StartNode);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
diff --git a/src/acpica/source/components/namespace/nsprepkg.c b/src/acpica/source/components/namespace/nsprepkg.c
index 627ee3e..aa7134e 100644
--- a/src/acpica/source/components/namespace/nsprepkg.c
+++ b/src/acpica/source/components/namespace/nsprepkg.c
@@ -243,8 +243,8 @@ AcpiNsCheckPackage (
/* Validate all elements of the returned package */
Status = AcpiNsCheckPackageElements (Info, Elements,
- Package->RetInfo.ObjectType1, Package->RetInfo.Count1,
- Package->RetInfo.ObjectType2, Package->RetInfo.Count2, 0);
+ Package->RetInfo.ObjectType1, Package->RetInfo.Count1,
+ Package->RetInfo.ObjectType2, Package->RetInfo.Count2, 0);
break;
case ACPI_PTYPE1_VAR:
@@ -255,7 +255,7 @@ AcpiNsCheckPackage (
for (i = 0; i < Count; i++)
{
Status = AcpiNsCheckObjectType (Info, Elements,
- Package->RetInfo.ObjectType1, i);
+ Package->RetInfo.ObjectType1, i);
if (ACPI_FAILURE (Status))
{
return (Status);
@@ -287,7 +287,7 @@ AcpiNsCheckPackage (
/* These are the required package elements (0, 1, or 2) */
Status = AcpiNsCheckObjectType (Info, Elements,
- Package->RetInfo3.ObjectType[i], i);
+ Package->RetInfo3.ObjectType[i], i);
if (ACPI_FAILURE (Status))
{
return (Status);
@@ -298,7 +298,7 @@ AcpiNsCheckPackage (
/* These are the optional package elements */
Status = AcpiNsCheckObjectType (Info, Elements,
- Package->RetInfo3.TailObjectType, i);
+ Package->RetInfo3.TailObjectType, i);
if (ACPI_FAILURE (Status))
{
return (Status);
@@ -312,8 +312,8 @@ AcpiNsCheckPackage (
/* First element is the (Integer) revision */
- Status = AcpiNsCheckObjectType (Info, Elements,
- ACPI_RTYPE_INTEGER, 0);
+ Status = AcpiNsCheckObjectType (
+ Info, Elements, ACPI_RTYPE_INTEGER, 0);
if (ACPI_FAILURE (Status))
{
return (Status);
@@ -331,8 +331,8 @@ AcpiNsCheckPackage (
/* First element is the (Integer) count of subpackages to follow */
- Status = AcpiNsCheckObjectType (Info, Elements,
- ACPI_RTYPE_INTEGER, 0);
+ Status = AcpiNsCheckObjectType (
+ Info, Elements, ACPI_RTYPE_INTEGER, 0);
if (ACPI_FAILURE (Status))
{
return (Status);
@@ -375,7 +375,8 @@ AcpiNsCheckPackage (
{
/* Create the new outer package and populate it */
- Status = AcpiNsWrapWithPackage (Info, ReturnObject, ReturnObjectPtr);
+ Status = AcpiNsWrapWithPackage (
+ Info, ReturnObject, ReturnObjectPtr);
if (ACPI_FAILURE (Status))
{
return (Status);
diff --git a/src/acpica/source/components/namespace/nsrepair.c b/src/acpica/source/components/namespace/nsrepair.c
index fbb9c7e..98265bc 100644
--- a/src/acpica/source/components/namespace/nsrepair.c
+++ b/src/acpica/source/components/namespace/nsrepair.c
@@ -294,7 +294,7 @@ AcpiNsSimpleRepair (
ACPI_WARN_ALWAYS, "Found unexpected NULL package element"));
Status = AcpiNsRepairNullElement (Info, ExpectedBtypes,
- PackageIndex, ReturnObjectPtr);
+ PackageIndex, ReturnObjectPtr);
if (ACPI_SUCCESS (Status))
{
return (AE_OK); /* Repair was successful */
@@ -452,6 +452,7 @@ AcpiNsMatchSimpleRepair (
return (NULL);
}
+
ThisName++;
}
@@ -536,11 +537,13 @@ AcpiNsRepairNullElement (
/* Set the reference count according to the parent Package object */
- NewObject->Common.ReferenceCount = Info->ParentPackage->Common.ReferenceCount;
+ NewObject->Common.ReferenceCount =
+ Info->ParentPackage->Common.ReferenceCount;
ACPI_DEBUG_PRINT ((ACPI_DB_REPAIR,
"%s: Converted NULL package element to expected %s at index %u\n",
- Info->FullPathname, AcpiUtGetObjectTypeName (NewObject), PackageIndex));
+ Info->FullPathname, AcpiUtGetObjectTypeName (NewObject),
+ PackageIndex));
*ReturnObjectPtr = NewObject;
Info->ReturnFlags |= ACPI_OBJECT_REPAIRED;
@@ -623,6 +626,7 @@ AcpiNsRemoveNullElements (
*Dest = *Source;
Dest++;
}
+
Source++;
}
@@ -679,8 +683,8 @@ AcpiNsWrapWithPackage (
/*
- * Create the new outer package and populate it. The new package will
- * have a single element, the lone sub-object.
+ * Create the new outer package and populate it. The new
+ * package will have a single element, the lone sub-object.
*/
PkgObjDesc = AcpiUtCreatePackageObject (1);
if (!PkgObjDesc)
diff --git a/src/acpica/source/components/namespace/nsrepair2.c b/src/acpica/source/components/namespace/nsrepair2.c
index a252d41..dda6c98 100644
--- a/src/acpica/source/components/namespace/nsrepair2.c
+++ b/src/acpica/source/components/namespace/nsrepair2.c
@@ -326,6 +326,7 @@ AcpiNsMatchComplexRepair (
{
return (ThisName);
}
+
ThisName++;
}
@@ -358,7 +359,7 @@ AcpiNsRepair_ALR (
Status = AcpiNsCheckSortedList (Info, ReturnObject, 0, 2, 1,
- ACPI_SORT_ASCENDING, "AmbientIlluminance");
+ ACPI_SORT_ASCENDING, "AmbientIlluminance");
return (Status);
}
@@ -411,7 +412,8 @@ AcpiNsRepair_FDE (
if (ReturnObject->Buffer.Length != ACPI_FDE_BYTE_BUFFER_SIZE)
{
- ACPI_WARN_PREDEFINED ((AE_INFO, Info->FullPathname, Info->NodeFlags,
+ ACPI_WARN_PREDEFINED ((AE_INFO,
+ Info->FullPathname, Info->NodeFlags,
"Incorrect return buffer length %u, expected %u",
ReturnObject->Buffer.Length, ACPI_FDE_DWORD_BUFFER_SIZE));
@@ -420,7 +422,8 @@ AcpiNsRepair_FDE (
/* Create the new (larger) buffer object */
- BufferObject = AcpiUtCreateBufferObject (ACPI_FDE_DWORD_BUFFER_SIZE);
+ BufferObject = AcpiUtCreateBufferObject (
+ ACPI_FDE_DWORD_BUFFER_SIZE);
if (!BufferObject)
{
return (AE_NO_MEMORY);
@@ -429,7 +432,8 @@ AcpiNsRepair_FDE (
/* Expand each byte to a DWORD */
ByteBuffer = ReturnObject->Buffer.Pointer;
- DwordBuffer = ACPI_CAST_PTR (UINT32, BufferObject->Buffer.Pointer);
+ DwordBuffer = ACPI_CAST_PTR (UINT32,
+ BufferObject->Buffer.Pointer);
for (i = 0; i < ACPI_FDE_FIELD_COUNT; i++)
{
@@ -582,7 +586,8 @@ AcpiNsRepair_CST (
if ((*OuterElements)->Package.Count == 0)
{
- ACPI_WARN_PREDEFINED ((AE_INFO, Info->FullPathname, Info->NodeFlags,
+ ACPI_WARN_PREDEFINED ((AE_INFO,
+ Info->FullPathname, Info->NodeFlags,
"SubPackage[%u] - removing entry due to zero count", i));
Removing = TRUE;
goto RemoveElement;
@@ -591,7 +596,8 @@ AcpiNsRepair_CST (
ObjDesc = (*OuterElements)->Package.Elements[1]; /* Index1 = Type */
if ((UINT32) ObjDesc->Integer.Value == 0)
{
- ACPI_WARN_PREDEFINED ((AE_INFO, Info->FullPathname, Info->NodeFlags,
+ ACPI_WARN_PREDEFINED ((AE_INFO,
+ Info->FullPathname, Info->NodeFlags,
"SubPackage[%u] - removing entry due to invalid Type(0)", i));
Removing = TRUE;
}
@@ -618,7 +624,7 @@ RemoveElement:
* C-state type, in ascending order.
*/
Status = AcpiNsCheckSortedList (Info, ReturnObject, 1, 4, 1,
- ACPI_SORT_ASCENDING, "C-State Type");
+ ACPI_SORT_ASCENDING, "C-State Type");
if (ACPI_FAILURE (Status))
{
return (Status);
@@ -666,7 +672,8 @@ AcpiNsRepair_HID (
if (ReturnObject->String.Length == 0)
{
- ACPI_WARN_PREDEFINED ((AE_INFO, Info->FullPathname, Info->NodeFlags,
+ ACPI_WARN_PREDEFINED ((AE_INFO,
+ Info->FullPathname, Info->NodeFlags,
"Invalid zero-length _HID or _CID string"));
/* Return AE_OK anyway, let driver handle it */
@@ -828,8 +835,8 @@ AcpiNsRepair_PSS (
* incorrectly sorted, sort it. We sort by CpuFrequency, since this
* should be proportional to the power.
*/
- Status =AcpiNsCheckSortedList (Info, ReturnObject, 0, 6, 0,
- ACPI_SORT_DESCENDING, "CpuFrequency");
+ Status = AcpiNsCheckSortedList (Info, ReturnObject, 0, 6, 0,
+ ACPI_SORT_DESCENDING, "CpuFrequency");
if (ACPI_FAILURE (Status))
{
return (Status);
@@ -850,7 +857,8 @@ AcpiNsRepair_PSS (
if ((UINT32) ObjDesc->Integer.Value > PreviousValue)
{
- ACPI_WARN_PREDEFINED ((AE_INFO, Info->FullPathname, Info->NodeFlags,
+ ACPI_WARN_PREDEFINED ((AE_INFO,
+ Info->FullPathname, Info->NodeFlags,
"SubPackage[%u,%u] - suspicious power dissipation values",
i-1, i));
}
@@ -904,7 +912,7 @@ AcpiNsRepair_TSS (
}
Status = AcpiNsCheckSortedList (Info, ReturnObject, 0, 5, 1,
- ACPI_SORT_DESCENDING, "PowerDissipation");
+ ACPI_SORT_DESCENDING, "PowerDissipation");
return (Status);
}
@@ -1136,6 +1144,7 @@ AcpiNsRemoveElement (
*Dest = *Source;
Dest++;
}
+
Source++;
}
diff --git a/src/acpica/source/components/namespace/nssearch.c b/src/acpica/source/components/namespace/nssearch.c
index 060b10c..94de93e 100644
--- a/src/acpica/source/components/namespace/nssearch.c
+++ b/src/acpica/source/components/namespace/nssearch.c
@@ -184,7 +184,7 @@ AcpiNsSearchOneScope (
{
char *ScopeName;
- ScopeName = AcpiNsGetExternalPathname (ParentNode);
+ ScopeName = AcpiNsGetNormalizedPathname (ParentNode, TRUE);
if (ScopeName)
{
ACPI_DEBUG_PRINT ((ACPI_DB_NAMES,
@@ -320,7 +320,7 @@ AcpiNsSearchParentTree (
* the actual name we are searching for. Typechecking comes later.
*/
Status = AcpiNsSearchOneScope (
- TargetName, ParentNode, ACPI_TYPE_ANY, ReturnNode);
+ TargetName, ParentNode, ACPI_TYPE_ANY, ReturnNode);
if (ACPI_SUCCESS (Status))
{
return_ACPI_STATUS (Status);
diff --git a/src/acpica/source/components/namespace/nsutils.c b/src/acpica/source/components/namespace/nsutils.c
index acee749..fd207e5 100644
--- a/src/acpica/source/components/namespace/nsutils.c
+++ b/src/acpica/source/components/namespace/nsutils.c
@@ -268,9 +268,10 @@ AcpiNsGetInternalNameLength (
Info->FullyQualified = FALSE;
/*
- * For the internal name, the required length is 4 bytes per segment, plus
- * 1 each for RootPrefix, MultiNamePrefixOp, segment count, trailing null
- * (which is not really needed, but no there's harm in putting it there)
+ * For the internal name, the required length is 4 bytes per segment,
+ * plus 1 each for RootPrefix, MultiNamePrefixOp, segment count,
+ * trailing null (which is not really needed, but no there's harm in
+ * putting it there)
*
* strlen() + 1 covers the first NameSeg, which has no path separator
*/
@@ -315,7 +316,7 @@ AcpiNsGetInternalNameLength (
}
Info->Length = (ACPI_NAME_SIZE * Info->NumSegments) +
- 4 + Info->NumCarats;
+ 4 + Info->NumCarats;
Info->NextExternalChar = NextExternalChar;
}
@@ -646,7 +647,7 @@ AcpiNsExternalizeName (
* punctuation ('.') between object names, plus the NULL terminator.
*/
RequiredLength = PrefixLength + (4 * NumSegments) +
- ((NumSegments > 0) ? (NumSegments - 1) : 0) + 1;
+ ((NumSegments > 0) ? (NumSegments - 1) : 0) + 1;
/*
* Check to see if we're still in bounds. If not, there's a problem
@@ -684,7 +685,8 @@ AcpiNsExternalizeName (
/* Copy and validate the 4-char name segment */
- ACPI_MOVE_NAME (&(*ConvertedName)[j], &InternalName[NamesIndex]);
+ ACPI_MOVE_NAME (&(*ConvertedName)[j],
+ &InternalName[NamesIndex]);
AcpiUtRepairName (&(*ConvertedName)[j]);
j += ACPI_NAME_SIZE;
@@ -885,6 +887,7 @@ AcpiNsGetNode (
{
*ReturnNode = AcpiGbl_RootNode;
}
+
return_ACPI_STATUS (AE_OK);
}
@@ -919,12 +922,12 @@ AcpiNsGetNode (
/* Lookup the name in the namespace */
Status = AcpiNsLookup (&ScopeInfo, InternalPath, ACPI_TYPE_ANY,
- ACPI_IMODE_EXECUTE, (Flags | ACPI_NS_DONT_OPEN_SCOPE),
- NULL, ReturnNode);
+ ACPI_IMODE_EXECUTE, (Flags | ACPI_NS_DONT_OPEN_SCOPE),
+ NULL, ReturnNode);
if (ACPI_FAILURE (Status))
{
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "%s, %s\n",
- Pathname, AcpiFormatException (Status)));
+ Pathname, AcpiFormatException (Status)));
}
(void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE);
diff --git a/src/acpica/source/components/namespace/nswalk.c b/src/acpica/source/components/namespace/nswalk.c
index aa23760..f02fbf4 100644
--- a/src/acpica/source/components/namespace/nswalk.c
+++ b/src/acpica/source/components/namespace/nswalk.c
@@ -290,10 +290,10 @@ AcpiNsWalkNamespace (
/* Null child means "get first node" */
- ParentNode = StartNode;
- ChildNode = AcpiNsGetNextNode (ParentNode, NULL);
- ChildType = ACPI_TYPE_ANY;
- Level = 1;
+ ParentNode = StartNode;
+ ChildNode = AcpiNsGetNextNode (ParentNode, NULL);
+ ChildType = ACPI_TYPE_ANY;
+ Level = 1;
/*
* Traverse the tree of nodes until we bubble back up to where we
@@ -351,7 +351,7 @@ AcpiNsWalkNamespace (
if (DescendingCallback)
{
Status = DescendingCallback (ChildNode, Level,
- Context, ReturnValue);
+ Context, ReturnValue);
}
}
else
@@ -359,7 +359,7 @@ AcpiNsWalkNamespace (
if (AscendingCallback)
{
Status = AscendingCallback (ChildNode, Level,
- Context, ReturnValue);
+ Context, ReturnValue);
}
}
diff --git a/src/acpica/source/components/namespace/nsxfeval.c b/src/acpica/source/components/namespace/nsxfeval.c
index 06328a6..8a4aaa8 100644
--- a/src/acpica/source/components/namespace/nsxfeval.c
+++ b/src/acpica/source/components/namespace/nsxfeval.c
@@ -504,13 +504,13 @@ AcpiEvaluateObject (
/* Get the size of the returned object */
Status = AcpiUtGetObjectSize (Info->ReturnObject,
- &BufferSpaceNeeded);
+ &BufferSpaceNeeded);
if (ACPI_SUCCESS (Status))
{
/* Validate/Allocate/Clear caller buffer */
Status = AcpiUtInitializeBuffer (ReturnBuffer,
- BufferSpaceNeeded);
+ BufferSpaceNeeded);
if (ACPI_FAILURE (Status))
{
/*
@@ -526,8 +526,8 @@ AcpiEvaluateObject (
{
/* We have enough space for the object, build it */
- Status = AcpiUtCopyIobjectToEobject (Info->ReturnObject,
- ReturnBuffer);
+ Status = AcpiUtCopyIobjectToEobject (
+ Info->ReturnObject, ReturnBuffer);
}
}
}
@@ -740,8 +740,8 @@ AcpiWalkNamespace (
}
Status = AcpiNsWalkNamespace (Type, StartObject, MaxDepth,
- ACPI_NS_WALK_UNLOCK, DescendingCallback,
- AscendingCallback, Context, ReturnValue);
+ ACPI_NS_WALK_UNLOCK, DescendingCallback,
+ AscendingCallback, Context, ReturnValue);
UnlockAndExit2:
(void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE);
@@ -892,8 +892,8 @@ AcpiNsGetDeviceCallback (
/* We have a valid device, invoke the user function */
- Status = Info->UserFunction (ObjHandle, NestingLevel, Info->Context,
- ReturnValue);
+ Status = Info->UserFunction (ObjHandle, NestingLevel,
+ Info->Context, ReturnValue);
return (Status);
}
@@ -948,8 +948,8 @@ AcpiGetDevices (
* We're going to call their callback from OUR callback, so we need
* to know what it is, and their context parameter.
*/
- Info.Hid = HID;
- Info.Context = Context;
+ Info.Hid = HID;
+ Info.Context = Context;
Info.UserFunction = UserFunction;
/*
@@ -965,8 +965,8 @@ AcpiGetDevices (
}
Status = AcpiNsWalkNamespace (ACPI_TYPE_DEVICE, ACPI_ROOT_OBJECT,
- ACPI_UINT32_MAX, ACPI_NS_WALK_UNLOCK,
- AcpiNsGetDeviceCallback, NULL, &Info, ReturnValue);
+ ACPI_UINT32_MAX, ACPI_NS_WALK_UNLOCK,
+ AcpiNsGetDeviceCallback, NULL, &Info, ReturnValue);
(void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE);
return_ACPI_STATUS (Status);
diff --git a/src/acpica/source/components/namespace/nsxfname.c b/src/acpica/source/components/namespace/nsxfname.c
index 51cc4f4..82d1c21 100644
--- a/src/acpica/source/components/namespace/nsxfname.c
+++ b/src/acpica/source/components/namespace/nsxfname.c
@@ -249,7 +249,7 @@ AcpiGetName (
{
ACPI_STATUS Status;
ACPI_NAMESPACE_NODE *Node;
- char *NodeName;
+ const char *NodeName;
/* Parameter validation */
@@ -271,7 +271,7 @@ AcpiGetName (
/* Get the full pathname (From the namespace root) */
Status = AcpiNsHandleToPathname (Handle, Buffer,
- NameType == ACPI_FULL_PATHNAME ? FALSE : TRUE);
+ NameType == ACPI_FULL_PATHNAME ? FALSE : TRUE);
return (Status);
}
@@ -337,7 +337,6 @@ AcpiNsCopyDeviceId (
ACPI_PNP_DEVICE_ID *Source,
char *StringArea)
{
-
/* Create the destination PNP_DEVICE_ID */
Dest->String = StringArea;
@@ -363,11 +362,18 @@ AcpiNsCopyDeviceId (
* namespace node and possibly by running several standard
* control methods (Such as in the case of a device.)
*
- * For Device and Processor objects, run the Device _HID, _UID, _CID, _SUB,
- * _CLS, _STA, _ADR, _SxW, and _SxD methods.
+ * For Device and Processor objects, run the Device _HID, _UID, _CID, _STA,
+ * _CLS, _ADR, _SxW, and _SxD methods.
*
* Note: Allocates the return buffer, must be freed by the caller.
*
+ * Note: This interface is intended to be used during the initial device
+ * discovery namespace traversal. Therefore, no complex methods can be
+ * executed, especially those that access operation regions. Therefore, do
+ * not add any additional methods that could cause problems in this area.
+ * this was the fate of the _SUB method which was found to cause such
+ * problems and was removed (11/2015).
+ *
******************************************************************************/
ACPI_STATUS
@@ -380,7 +386,6 @@ AcpiGetObjectInfo (
ACPI_PNP_DEVICE_ID_LIST *CidList = NULL;
ACPI_PNP_DEVICE_ID *Hid = NULL;
ACPI_PNP_DEVICE_ID *Uid = NULL;
- ACPI_PNP_DEVICE_ID *Sub = NULL;
ACPI_PNP_DEVICE_ID *Cls = NULL;
char *NextIdString;
ACPI_OBJECT_TYPE Type;
@@ -434,7 +439,7 @@ AcpiGetObjectInfo (
{
/*
* Get extra info for ACPI Device/Processor objects only:
- * Run the Device _HID, _UID, _SUB, _CID, and _CLS methods.
+ * Run the Device _HID, _UID, _CLS, and _CID methods.
*
* Note: none of these methods are required, so they may or may
* not be present for this device. The Info->Valid bitfield is used
@@ -459,15 +464,6 @@ AcpiGetObjectInfo (
Valid |= ACPI_VALID_UID;
}
- /* Execute the Device._SUB method */
-
- Status = AcpiUtExecute_SUB (Node, &Sub);
- if (ACPI_SUCCESS (Status))
- {
- InfoSize += Sub->Length;
- Valid |= ACPI_VALID_SUB;
- }
-
/* Execute the Device._CID method */
Status = AcpiUtExecute_CID (Node, &CidList);
@@ -530,7 +526,7 @@ AcpiGetObjectInfo (
/* Execute the Device._ADR method */
Status = AcpiUtEvaluateNumericObject (METHOD_NAME__ADR, Node,
- &Info->Address);
+ &Info->Address);
if (ACPI_SUCCESS (Status))
{
Valid |= ACPI_VALID_ADR;
@@ -539,8 +535,8 @@ AcpiGetObjectInfo (
/* Execute the Device._SxW methods */
Status = AcpiUtExecutePowerMethods (Node,
- AcpiGbl_LowestDstateNames, ACPI_NUM_SxW_METHODS,
- Info->LowestDstates);
+ AcpiGbl_LowestDstateNames, ACPI_NUM_SxW_METHODS,
+ Info->LowestDstates);
if (ACPI_SUCCESS (Status))
{
Valid |= ACPI_VALID_SXWS;
@@ -549,8 +545,8 @@ AcpiGetObjectInfo (
/* Execute the Device._SxD methods */
Status = AcpiUtExecutePowerMethods (Node,
- AcpiGbl_HighestDstateNames, ACPI_NUM_SxD_METHODS,
- Info->HighestDstates);
+ AcpiGbl_HighestDstateNames, ACPI_NUM_SxD_METHODS,
+ Info->HighestDstates);
if (ACPI_SUCCESS (Status))
{
Valid |= ACPI_VALID_SXDS;
@@ -570,9 +566,8 @@ AcpiGetObjectInfo (
}
/*
- * Copy the HID, UID, SUB, and CIDs to the return buffer.
- * The variable-length strings are copied to the reserved area
- * at the end of the buffer.
+ * Copy the HID, UID, and CIDs to the return buffer. The variable-length
+ * strings are copied to the reserved area at the end of the buffer.
*
* For HID and CID, check if the ID is a PCI Root Bridge.
*/
@@ -593,12 +588,6 @@ AcpiGetObjectInfo (
Uid, NextIdString);
}
- if (Sub)
- {
- NextIdString = AcpiNsCopyDeviceId (&Info->SubsystemId,
- Sub, NextIdString);
- }
-
if (CidList)
{
Info->CompatibleIdList.Count = CidList->Count;
@@ -645,10 +634,6 @@ Cleanup:
{
ACPI_FREE (Uid);
}
- if (Sub)
- {
- ACPI_FREE (Sub);
- }
if (CidList)
{
ACPI_FREE (CidList);
@@ -724,6 +709,7 @@ AcpiInstallMethod (
ParserState.Aml += AcpiPsGetOpcodeSize (Opcode);
ParserState.PkgEnd = AcpiPsGetNextPackageEnd (&ParserState);
Path = AcpiPsGetNextNamestring (&ParserState);
+
MethodFlags = *ParserState.Aml++;
AmlStart = ParserState.Aml;
AmlLength = ACPI_PTR_DIFF (ParserState.PkgEnd, AmlStart);
@@ -756,7 +742,7 @@ AcpiInstallMethod (
/* The lookup either returns an existing node or creates a new one */
Status = AcpiNsLookup (NULL, Path, ACPI_TYPE_METHOD, ACPI_IMODE_LOAD_PASS1,
- ACPI_NS_DONT_OPEN_SCOPE | ACPI_NS_ERROR_IF_FOUND, NULL, &Node);
+ ACPI_NS_DONT_OPEN_SCOPE | ACPI_NS_ERROR_IF_FOUND, NULL, &Node);
(void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE);
diff --git a/src/acpica/source/components/namespace/nsxfobj.c b/src/acpica/source/components/namespace/nsxfobj.c
index 2ca409f..d2c19d6 100644
--- a/src/acpica/source/components/namespace/nsxfobj.c
+++ b/src/acpica/source/components/namespace/nsxfobj.c
@@ -153,10 +153,8 @@ AcpiGetType (
return (AE_BAD_PARAMETER);
}
- /*
- * Special case for the predefined Root Node
- * (return type ANY)
- */
+ /* Special case for the predefined Root Node (return type ANY) */
+
if (Handle == ACPI_ROOT_OBJECT)
{
*RetType = ACPI_TYPE_ANY;
@@ -180,7 +178,6 @@ AcpiGetType (
*RetType = Node->Type;
-
Status = AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE);
return (Status);
}
diff --git a/src/acpica/source/components/parser/psargs.c b/src/acpica/source/components/parser/psargs.c
index cbb24a9..4ee5f0a 100644
--- a/src/acpica/source/components/parser/psargs.c
+++ b/src/acpica/source/components/parser/psargs.c
@@ -359,8 +359,8 @@ AcpiPsGetNextNamepath (
* the upsearch)
*/
Status = AcpiNsLookup (WalkState->ScopeInfo, Path,
- ACPI_TYPE_ANY, ACPI_IMODE_EXECUTE,
- ACPI_NS_SEARCH_PARENT | ACPI_NS_DONT_OPEN_SCOPE, NULL, &Node);
+ ACPI_TYPE_ANY, ACPI_IMODE_EXECUTE,
+ ACPI_NS_SEARCH_PARENT | ACPI_NS_DONT_OPEN_SCOPE, NULL, &Node);
/*
* If this name is a control method invocation, we must
@@ -431,7 +431,7 @@ AcpiPsGetNextNamepath (
/* 1) NotFound is ok during load pass 1/2 (allow forward references) */
if ((WalkState->ParseFlags & ACPI_PARSE_MODE_MASK) !=
- ACPI_PARSE_EXECUTE)
+ ACPI_PARSE_EXECUTE)
{
Status = AE_OK;
}
@@ -463,7 +463,7 @@ AcpiPsGetNextNamepath (
ACPI_ERROR_NAMESPACE (Path, Status);
if ((WalkState->ParseFlags & ACPI_PARSE_MODE_MASK) ==
- ACPI_PARSE_EXECUTE)
+ ACPI_PARSE_EXECUTE)
{
/* Report a control method execution error */
@@ -859,6 +859,7 @@ AcpiPsGetNextArg (
{
return_ACPI_STATUS (AE_NO_MEMORY);
}
+
AcpiPsGetNextSimpleArg (ParserState, ArgType, Arg);
break;
@@ -907,7 +908,7 @@ AcpiPsGetNextArg (
/* Non-empty list */
Arg = AcpiPsAllocOp (AML_INT_BYTELIST_OP,
- ParserState->Aml);
+ ParserState->Aml);
if (!Arg)
{
return_ACPI_STATUS (AE_NO_MEMORY);
diff --git a/src/acpica/source/components/parser/psloop.c b/src/acpica/source/components/parser/psloop.c
index bd7166f..2fa4e72 100644
--- a/src/acpica/source/components/parser/psloop.c
+++ b/src/acpica/source/components/parser/psloop.c
@@ -192,7 +192,8 @@ AcpiPsGetArguments (
case AML_INT_NAMEPATH_OP: /* AML_NAMESTRING_ARG */
- Status = AcpiPsGetNextNamepath (WalkState, &(WalkState->ParserState), Op, 1);
+ Status = AcpiPsGetNextNamepath (
+ WalkState, &(WalkState->ParserState), Op, 1);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
@@ -205,12 +206,13 @@ AcpiPsGetArguments (
/*
* Op is not a constant or string, append each argument to the Op
*/
- while (GET_CURRENT_ARG_TYPE (WalkState->ArgTypes) && !WalkState->ArgCount)
+ while (GET_CURRENT_ARG_TYPE (WalkState->ArgTypes) &&
+ !WalkState->ArgCount)
{
WalkState->Aml = WalkState->ParserState.Aml;
Status = AcpiPsGetNextArg (WalkState, &(WalkState->ParserState),
- GET_CURRENT_ARG_TYPE (WalkState->ArgTypes), &Arg);
+ GET_CURRENT_ARG_TYPE (WalkState->ArgTypes), &Arg);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
@@ -622,7 +624,7 @@ AcpiPsParseLoop (
* prepare for argument
*/
Status = AcpiPsPushScope (ParserState, Op,
- WalkState->ArgTypes, WalkState->ArgCount);
+ WalkState->ArgTypes, WalkState->ArgCount);
if (ACPI_FAILURE (Status))
{
Status = AcpiPsCompleteOp (WalkState, &Op, Status);
diff --git a/src/acpica/source/components/parser/psobject.c b/src/acpica/source/components/parser/psobject.c
index 77e9434..0037871 100644
--- a/src/acpica/source/components/parser/psobject.c
+++ b/src/acpica/source/components/parser/psobject.c
@@ -181,7 +181,7 @@ AcpiPsGetAmlOpcode (
if (WalkState->PassNumber == 2)
{
AmlOffset = (UINT32) ACPI_PTR_DIFF (WalkState->Aml,
- WalkState->ParserState.AmlStart);
+ WalkState->ParserState.AmlStart);
ACPI_ERROR ((AE_INFO,
"Unknown opcode 0x%.2X at table offset 0x%.4X, ignoring",
@@ -223,7 +223,8 @@ AcpiPsGetAmlOpcode (
/* Found opcode info, this is a normal opcode */
- WalkState->ParserState.Aml += AcpiPsGetOpcodeSize (WalkState->Opcode);
+ WalkState->ParserState.Aml +=
+ AcpiPsGetOpcodeSize (WalkState->Opcode);
WalkState->ArgTypes = WalkState->OpInfo->ParseArgs;
break;
}
@@ -273,7 +274,7 @@ AcpiPsBuildNamedOp (
(GET_CURRENT_ARG_TYPE (WalkState->ArgTypes) != ARGP_NAME))
{
Status = AcpiPsGetNextArg (WalkState, &(WalkState->ParserState),
- GET_CURRENT_ARG_TYPE (WalkState->ArgTypes), &Arg);
+ GET_CURRENT_ARG_TYPE (WalkState->ArgTypes), &Arg);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
diff --git a/src/acpica/source/components/parser/psparse.c b/src/acpica/source/components/parser/psparse.c
index 599a766..a1d6612 100644
--- a/src/acpica/source/components/parser/psparse.c
+++ b/src/acpica/source/components/parser/psparse.c
@@ -272,8 +272,8 @@ AcpiPsCompleteThisOp (
* These opcodes contain TermArg operands. The current
* op must be replaced by a placeholder return op
*/
- ReplacementOp = AcpiPsAllocOp (AML_INT_RETURN_VALUE_OP,
- Op->Common.Aml);
+ ReplacementOp = AcpiPsAllocOp (
+ AML_INT_RETURN_VALUE_OP, Op->Common.Aml);
if (!ReplacementOp)
{
Status = AE_NO_MEMORY;
@@ -292,8 +292,8 @@ AcpiPsCompleteThisOp (
(Op->Common.Parent->Common.AmlOpcode == AML_BANK_FIELD_OP) ||
(Op->Common.Parent->Common.AmlOpcode == AML_VAR_PACKAGE_OP))
{
- ReplacementOp = AcpiPsAllocOp (AML_INT_RETURN_VALUE_OP,
- Op->Common.Aml);
+ ReplacementOp = AcpiPsAllocOp (
+ AML_INT_RETURN_VALUE_OP, Op->Common.Aml);
if (!ReplacementOp)
{
Status = AE_NO_MEMORY;
@@ -307,7 +307,7 @@ AcpiPsCompleteThisOp (
(Op->Common.AmlOpcode == AML_VAR_PACKAGE_OP))
{
ReplacementOp = AcpiPsAllocOp (Op->Common.AmlOpcode,
- Op->Common.Aml);
+ Op->Common.Aml);
if (!ReplacementOp)
{
Status = AE_NO_MEMORY;
@@ -323,8 +323,8 @@ AcpiPsCompleteThisOp (
default:
- ReplacementOp = AcpiPsAllocOp (AML_INT_RETURN_VALUE_OP,
- Op->Common.Aml);
+ ReplacementOp = AcpiPsAllocOp (
+ AML_INT_RETURN_VALUE_OP, Op->Common.Aml);
if (!ReplacementOp)
{
Status = AE_NO_MEMORY;
@@ -339,11 +339,11 @@ AcpiPsCompleteThisOp (
if (ReplacementOp)
{
- ReplacementOp->Common.Parent = Op->Common.Parent;
- ReplacementOp->Common.Value.Arg = NULL;
- ReplacementOp->Common.Node = Op->Common.Node;
+ ReplacementOp->Common.Parent = Op->Common.Parent;
+ ReplacementOp->Common.Value.Arg = NULL;
+ ReplacementOp->Common.Node = Op->Common.Node;
Op->Common.Parent->Common.Value.Arg = ReplacementOp;
- ReplacementOp->Common.Next = Op->Common.Next;
+ ReplacementOp->Common.Next = Op->Common.Next;
}
else
{
@@ -362,11 +362,11 @@ AcpiPsCompleteThisOp (
{
if (ReplacementOp)
{
- ReplacementOp->Common.Parent = Op->Common.Parent;
+ ReplacementOp->Common.Parent = Op->Common.Parent;
ReplacementOp->Common.Value.Arg = NULL;
- ReplacementOp->Common.Node = Op->Common.Node;
- Prev->Common.Next = ReplacementOp;
- ReplacementOp->Common.Next = Op->Common.Next;
+ ReplacementOp->Common.Node = Op->Common.Node;
+ Prev->Common.Next = ReplacementOp;
+ ReplacementOp->Common.Next = Op->Common.Next;
Next = NULL;
}
else
@@ -566,7 +566,8 @@ AcpiPsParseAml (
*/
if (WalkState->MethodDesc)
{
- WalkState->Thread->CurrentSyncLevel = WalkState->MethodDesc->Method.SyncLevel;
+ WalkState->Thread->CurrentSyncLevel =
+ WalkState->MethodDesc->Method.SyncLevel;
}
AcpiDsPushWalkState (WalkState, Thread);
@@ -612,8 +613,8 @@ AcpiPsParseAml (
}
/*
- * If the transfer to the new method method call worked, a new walk
- * state was created -- get it
+ * If the transfer to the new method method call worked
+ *, a new walk state was created -- get it
*/
WalkState = AcpiDsGetCurrentWalkState (Thread);
continue;
@@ -632,7 +633,8 @@ AcpiPsParseAml (
/* Check for possible multi-thread reentrancy problem */
if ((Status == AE_ALREADY_EXISTS) &&
- (!(WalkState->MethodDesc->Method.InfoFlags & ACPI_METHOD_SERIALIZED)))
+ (!(WalkState->MethodDesc->Method.InfoFlags &
+ ACPI_METHOD_SERIALIZED)))
{
/*
* Method is not serialized and tried to create an object
@@ -658,7 +660,8 @@ AcpiPsParseAml (
* encountered an error during the method parse phase, there's lots of
* cleanup to do
*/
- if (((WalkState->ParseFlags & ACPI_PARSE_MODE_MASK) == ACPI_PARSE_EXECUTE) ||
+ if (((WalkState->ParseFlags & ACPI_PARSE_MODE_MASK) ==
+ ACPI_PARSE_EXECUTE) ||
(ACPI_FAILURE (Status)))
{
AcpiDsTerminateControlMethod (WalkState->MethodDesc, WalkState);
@@ -705,7 +708,7 @@ AcpiPsParseAml (
/* Restart the calling control method */
Status = AcpiDsRestartControlMethod (WalkState,
- PreviousWalkState->ImplicitReturnObj);
+ PreviousWalkState->ImplicitReturnObj);
}
else
{
@@ -716,7 +719,7 @@ AcpiPsParseAml (
AcpiDsClearImplicitReturn (PreviousWalkState);
Status = AcpiDsRestartControlMethod (WalkState,
- PreviousWalkState->ReturnDesc);
+ PreviousWalkState->ReturnDesc);
}
if (ACPI_SUCCESS (Status))
{
diff --git a/src/acpica/source/components/parser/psscope.c b/src/acpica/source/components/parser/psscope.c
index f44ea48..60e03b4 100644
--- a/src/acpica/source/components/parser/psscope.c
+++ b/src/acpica/source/components/parser/psscope.c
@@ -308,9 +308,9 @@ AcpiPsPopScope (
/* Return to parsing previous op */
- *Op = Scope->ParseScope.Op;
- *ArgList = Scope->ParseScope.ArgList;
- *ArgCount = Scope->ParseScope.ArgCount;
+ *Op = Scope->ParseScope.Op;
+ *ArgList = Scope->ParseScope.ArgList;
+ *ArgCount = Scope->ParseScope.ArgCount;
ParserState->PkgEnd = Scope->ParseScope.PkgEnd;
/* All done with this scope state structure */
@@ -321,8 +321,8 @@ AcpiPsPopScope (
{
/* Empty parse stack, prepare to fetch next opcode */
- *Op = NULL;
- *ArgList = 0;
+ *Op = NULL;
+ *ArgList = 0;
*ArgCount = 0;
}
diff --git a/src/acpica/source/components/parser/psutils.c b/src/acpica/source/components/parser/psutils.c
index 3aa4954..168f098 100644
--- a/src/acpica/source/components/parser/psutils.c
+++ b/src/acpica/source/components/parser/psutils.c
@@ -177,8 +177,8 @@ AcpiPsInitOp (
Op->Common.AmlOpcode = Opcode;
ACPI_DISASM_ONLY_MEMBERS (strncpy (Op->Common.AmlOpName,
- (AcpiPsGetOpcodeInfo (Opcode))->Name,
- sizeof (Op->Common.AmlOpName)));
+ (AcpiPsGetOpcodeInfo (Opcode))->Name,
+ sizeof (Op->Common.AmlOpName)));
}
@@ -277,7 +277,8 @@ AcpiPsFreeOp (
if (Op->Common.AmlOpcode == AML_INT_RETURN_VALUE_OP)
{
- ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS, "Free retval op: %p\n", Op));
+ ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS,
+ "Free retval op: %p\n", Op));
}
if (Op->Common.Flags & ACPI_PARSEOP_GENERIC)
diff --git a/src/acpica/source/components/parser/pswalk.c b/src/acpica/source/components/parser/pswalk.c
index a447970..fa837ee 100644
--- a/src/acpica/source/components/parser/pswalk.c
+++ b/src/acpica/source/components/parser/pswalk.c
@@ -178,6 +178,7 @@ AcpiPsDeleteParseTree (
{
return_VOID;
}
+
if (Next)
{
Op = Next;
diff --git a/src/acpica/source/components/parser/psxface.c b/src/acpica/source/components/parser/psxface.c
index eb5c018..b03f776 100644
--- a/src/acpica/source/components/parser/psxface.c
+++ b/src/acpica/source/components/parser/psxface.c
@@ -255,7 +255,7 @@ AcpiPsExecuteMethod (
Info->PassNumber = ACPI_IMODE_EXECUTE;
WalkState = AcpiDsCreateWalkState (
- Info->ObjDesc->Method.OwnerId, NULL, NULL, NULL);
+ Info->ObjDesc->Method.OwnerId, NULL, NULL, NULL);
if (!WalkState)
{
Status = AE_NO_MEMORY;
@@ -263,8 +263,8 @@ AcpiPsExecuteMethod (
}
Status = AcpiDsInitAmlWalk (WalkState, Op, Info->Node,
- Info->ObjDesc->Method.AmlStart,
- Info->ObjDesc->Method.AmlLength, Info, Info->PassNumber);
+ Info->ObjDesc->Method.AmlStart,
+ Info->ObjDesc->Method.AmlLength, Info, Info->PassNumber);
if (ACPI_FAILURE (Status))
{
AcpiDsDeleteWalkState (WalkState);
@@ -375,7 +375,8 @@ AcpiPsUpdateParameterList (
{
/* Ignore errors, just do them all */
- (void) AcpiUtUpdateObjectReference (Info->Parameters[i], Action);
+ (void) AcpiUtUpdateObjectReference (
+ Info->Parameters[i], Action);
}
}
}
diff --git a/src/acpica/source/components/resources/rsaddr.c b/src/acpica/source/components/resources/rsaddr.c
index 9d1d4d7..2b603f0 100644
--- a/src/acpica/source/components/resources/rsaddr.c
+++ b/src/acpica/source/components/resources/rsaddr.c
@@ -400,30 +400,35 @@ AcpiRsGetAddressCommon (
/* Validate the Resource Type */
- if ((Aml->Address.ResourceType > 2) && (Aml->Address.ResourceType < 0xC0))
+ if ((Aml->Address.ResourceType > 2) &&
+ (Aml->Address.ResourceType < 0xC0))
{
return (FALSE);
}
/* Get the Resource Type and General Flags */
- (void) AcpiRsConvertAmlToResource (Resource, Aml, AcpiRsConvertGeneralFlags);
+ (void) AcpiRsConvertAmlToResource (
+ Resource, Aml, AcpiRsConvertGeneralFlags);
/* Get the Type-Specific Flags (Memory and I/O descriptors only) */
if (Resource->Data.Address.ResourceType == ACPI_MEMORY_RANGE)
{
- (void) AcpiRsConvertAmlToResource (Resource, Aml, AcpiRsConvertMemFlags);
+ (void) AcpiRsConvertAmlToResource (
+ Resource, Aml, AcpiRsConvertMemFlags);
}
else if (Resource->Data.Address.ResourceType == ACPI_IO_RANGE)
{
- (void) AcpiRsConvertAmlToResource (Resource, Aml, AcpiRsConvertIoFlags);
+ (void) AcpiRsConvertAmlToResource (
+ Resource, Aml, AcpiRsConvertIoFlags);
}
else
{
/* Generic resource type, just grab the TypeSpecific byte */
- Resource->Data.Address.Info.TypeSpecific = Aml->Address.SpecificFlags;
+ Resource->Data.Address.Info.TypeSpecific =
+ Aml->Address.SpecificFlags;
}
return (TRUE);
@@ -454,22 +459,26 @@ AcpiRsSetAddressCommon (
/* Set the Resource Type and General Flags */
- (void) AcpiRsConvertResourceToAml (Resource, Aml, AcpiRsConvertGeneralFlags);
+ (void) AcpiRsConvertResourceToAml (
+ Resource, Aml, AcpiRsConvertGeneralFlags);
/* Set the Type-Specific Flags (Memory and I/O descriptors only) */
if (Resource->Data.Address.ResourceType == ACPI_MEMORY_RANGE)
{
- (void) AcpiRsConvertResourceToAml (Resource, Aml, AcpiRsConvertMemFlags);
+ (void) AcpiRsConvertResourceToAml (
+ Resource, Aml, AcpiRsConvertMemFlags);
}
else if (Resource->Data.Address.ResourceType == ACPI_IO_RANGE)
{
- (void) AcpiRsConvertResourceToAml (Resource, Aml, AcpiRsConvertIoFlags);
+ (void) AcpiRsConvertResourceToAml (
+ Resource, Aml, AcpiRsConvertIoFlags);
}
else
{
/* Generic resource type, just copy the TypeSpecific byte */
- Aml->Address.SpecificFlags = Resource->Data.Address.Info.TypeSpecific;
+ Aml->Address.SpecificFlags =
+ Resource->Data.Address.Info.TypeSpecific;
}
}
diff --git a/src/acpica/source/components/resources/rscalc.c b/src/acpica/source/components/resources/rscalc.c
index 33a438e..deab7e2 100644
--- a/src/acpica/source/components/resources/rscalc.c
+++ b/src/acpica/source/components/resources/rscalc.c
@@ -236,16 +236,17 @@ AcpiRsStreamOptionLength (
/*
- * The ResourceSourceIndex and ResourceSource are optional elements of some
- * Large-type resource descriptors.
+ * The ResourceSourceIndex and ResourceSource are optional elements of
+ * some Large-type resource descriptors.
*/
/*
- * If the length of the actual resource descriptor is greater than the ACPI
- * spec-defined minimum length, it means that a ResourceSourceIndex exists
- * and is followed by a (required) null terminated string. The string length
- * (including the null terminator) is the resource length minus the minimum
- * length, minus one byte for the ResourceSourceIndex itself.
+ * If the length of the actual resource descriptor is greater than the
+ * ACPI spec-defined minimum length, it means that a ResourceSourceIndex
+ * exists and is followed by a (required) null terminated string. The
+ * string length (including the null terminator) is the resource length
+ * minus the minimum length, minus one byte for the ResourceSourceIndex
+ * itself.
*/
if (ResourceLength > MinimumAmlResourceLength)
{
@@ -381,9 +382,9 @@ AcpiRsGetAmlLength (
* 16-Bit Address Resource:
* Add the size of the optional ResourceSource info
*/
- TotalSize = (ACPI_RS_LENGTH)
- (TotalSize + AcpiRsStructOptionLength (
- &Resource->Data.Address16.ResourceSource));
+ TotalSize = (ACPI_RS_LENGTH) (TotalSize +
+ AcpiRsStructOptionLength (
+ &Resource->Data.Address16.ResourceSource));
break;
@@ -392,9 +393,9 @@ AcpiRsGetAmlLength (
* 32-Bit Address Resource:
* Add the size of the optional ResourceSource info
*/
- TotalSize = (ACPI_RS_LENGTH)
- (TotalSize + AcpiRsStructOptionLength (
- &Resource->Data.Address32.ResourceSource));
+ TotalSize = (ACPI_RS_LENGTH) (TotalSize +
+ AcpiRsStructOptionLength (
+ &Resource->Data.Address32.ResourceSource));
break;
@@ -403,9 +404,9 @@ AcpiRsGetAmlLength (
* 64-Bit Address Resource:
* Add the size of the optional ResourceSource info
*/
- TotalSize = (ACPI_RS_LENGTH)
- (TotalSize + AcpiRsStructOptionLength (
- &Resource->Data.Address64.ResourceSource));
+ TotalSize = (ACPI_RS_LENGTH) (TotalSize +
+ AcpiRsStructOptionLength (
+ &Resource->Data.Address64.ResourceSource));
break;
@@ -415,8 +416,7 @@ AcpiRsGetAmlLength (
* Add the size of each additional optional interrupt beyond the
* required 1 (4 bytes for each UINT32 interrupt number)
*/
- TotalSize = (ACPI_RS_LENGTH)
- (TotalSize +
+ TotalSize = (ACPI_RS_LENGTH) (TotalSize +
((Resource->Data.ExtendedIrq.InterruptCount - 1) * 4) +
/* Add the size of the optional ResourceSource info */
@@ -428,7 +428,8 @@ AcpiRsGetAmlLength (
case ACPI_RESOURCE_TYPE_GPIO:
- TotalSize = (ACPI_RS_LENGTH) (TotalSize + (Resource->Data.Gpio.PinTableLength * 2) +
+ TotalSize = (ACPI_RS_LENGTH) (TotalSize +
+ (Resource->Data.Gpio.PinTableLength * 2) +
Resource->Data.Gpio.ResourceSource.StringLength +
Resource->Data.Gpio.VendorLength);
@@ -437,7 +438,8 @@ AcpiRsGetAmlLength (
case ACPI_RESOURCE_TYPE_SERIAL_BUS:
- TotalSize = AcpiGbl_AmlResourceSerialBusSizes [Resource->Data.CommonSerialBus.Type];
+ TotalSize = AcpiGbl_AmlResourceSerialBusSizes [
+ Resource->Data.CommonSerialBus.Type];
TotalSize = (ACPI_RS_LENGTH) (TotalSize +
Resource->Data.I2cSerialBus.ResourceSource.StringLength +
@@ -616,12 +618,15 @@ AcpiRsGetListLength (
if (AmlResource->Gpio.VendorLength)
{
- ExtraStructBytes += AmlResource->Gpio.VendorOffset -
- AmlResource->Gpio.PinTableOffset + AmlResource->Gpio.VendorLength;
+ ExtraStructBytes +=
+ AmlResource->Gpio.VendorOffset -
+ AmlResource->Gpio.PinTableOffset +
+ AmlResource->Gpio.VendorLength;
}
else
{
- ExtraStructBytes += AmlResource->LargeHeader.ResourceLength +
+ ExtraStructBytes +=
+ AmlResource->LargeHeader.ResourceLength +
sizeof (AML_RESOURCE_LARGE_HEADER) -
AmlResource->Gpio.PinTableOffset;
}
@@ -631,7 +636,8 @@ AcpiRsGetListLength (
MinimumAmlResourceLength = AcpiGbl_ResourceAmlSerialBusSizes[
AmlResource->CommonSerialBus.Type];
- ExtraStructBytes += AmlResource->CommonSerialBus.ResourceLength -
+ ExtraStructBytes +=
+ AmlResource->CommonSerialBus.ResourceLength -
MinimumAmlResourceLength;
break;
@@ -646,7 +652,8 @@ AcpiRsGetListLength (
* Important: Round the size up for the appropriate alignment. This
* is a requirement on IA64.
*/
- if (AcpiUtGetResourceType (AmlBuffer) == ACPI_RESOURCE_NAME_SERIAL_BUS)
+ if (AcpiUtGetResourceType (AmlBuffer) ==
+ ACPI_RESOURCE_NAME_SERIAL_BUS)
{
BufferSize = AcpiGbl_ResourceStructSerialBusSizes[
AmlResource->CommonSerialBus.Type] + ExtraStructBytes;
@@ -654,10 +661,10 @@ AcpiRsGetListLength (
else
{
BufferSize = AcpiGbl_ResourceStructSizes[ResourceIndex] +
- ExtraStructBytes;
+ ExtraStructBytes;
}
- BufferSize = (UINT32) ACPI_ROUND_UP_TO_NATIVE_WORD (BufferSize);
+ BufferSize = (UINT32) ACPI_ROUND_UP_TO_NATIVE_WORD (BufferSize);
*SizeNeeded += BufferSize;
ACPI_DEBUG_PRINT ((ACPI_DB_RESOURCES,
@@ -794,7 +801,7 @@ AcpiRsGetPciRoutingTableLength (
else
{
TempSizeNeeded += AcpiNsGetPathnameLength (
- (*SubObjectList)->Reference.Node);
+ (*SubObjectList)->Reference.Node);
}
}
else
diff --git a/src/acpica/source/components/resources/rscreate.c b/src/acpica/source/components/resources/rscreate.c
index 8cf00d3..0bf0ec5 100644
--- a/src/acpica/source/components/resources/rscreate.c
+++ b/src/acpica/source/components/resources/rscreate.c
@@ -158,8 +158,8 @@ AcpiBufferToResource (
/* Get the required length for the converted resource */
- Status = AcpiRsGetListLength (AmlBuffer, AmlBufferLength,
- &ListSizeNeeded);
+ Status = AcpiRsGetListLength (
+ AmlBuffer, AmlBufferLength, &ListSizeNeeded);
if (Status == AE_AML_NO_RESOURCE_END_TAG)
{
Status = AE_OK;
@@ -181,7 +181,7 @@ AcpiBufferToResource (
/* Perform the AML-to-Resource conversion */
Status = AcpiUtWalkAmlResources (NULL, AmlBuffer, AmlBufferLength,
- AcpiRsConvertAmlToResources, &CurrentResourcePtr);
+ AcpiRsConvertAmlToResources, &CurrentResourcePtr);
if (Status == AE_AML_NO_RESOURCE_END_TAG)
{
Status = AE_OK;
@@ -269,14 +269,14 @@ AcpiRsCreateResourceList (
Resource = OutputBuffer->Pointer;
Status = AcpiUtWalkAmlResources (NULL, AmlStart, AmlBufferLength,
- AcpiRsConvertAmlToResources, &Resource);
+ AcpiRsConvertAmlToResources, &Resource);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
}
ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "OutputBuffer %p Length %X\n",
- OutputBuffer->Pointer, (UINT32) OutputBuffer->Length));
+ OutputBuffer->Pointer, (UINT32) OutputBuffer->Length));
return_ACPI_STATUS (AE_OK);
}
@@ -327,8 +327,8 @@ AcpiRsCreatePciRoutingTable (
/* Get the required buffer length */
- Status = AcpiRsGetPciRoutingTableLength (PackageObject,
- &BufferSizeNeeded);
+ Status = AcpiRsGetPciRoutingTableLength (
+ PackageObject,&BufferSizeNeeded);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
@@ -350,10 +350,10 @@ AcpiRsCreatePciRoutingTable (
* package that in turn contains an UINT64 Address, a UINT8 Pin,
* a Name, and a UINT8 SourceIndex.
*/
- TopObjectList = PackageObject->Package.Elements;
+ TopObjectList = PackageObject->Package.Elements;
NumberOfElements = PackageObject->Package.Count;
- Buffer = OutputBuffer->Pointer;
- UserPrt = ACPI_CAST_PTR (ACPI_PCI_ROUTING_TABLE, Buffer);
+ Buffer = OutputBuffer->Pointer;
+ UserPrt = ACPI_CAST_PTR (ACPI_PCI_ROUTING_TABLE, Buffer);
for (Index = 0; Index < NumberOfElements; Index++)
{
@@ -367,9 +367,9 @@ AcpiRsCreatePciRoutingTable (
UserPrt = ACPI_CAST_PTR (ACPI_PCI_ROUTING_TABLE, Buffer);
/*
- * Fill in the Length field with the information we have at this point.
- * The minus four is to subtract the size of the UINT8 Source[4] member
- * because it is added below.
+ * Fill in the Length field with the information we have at this
+ * point. The minus four is to subtract the size of the UINT8
+ * Source[4] member because it is added below.
*/
UserPrt->Length = (sizeof (ACPI_PCI_ROUTING_TABLE) - 4);
@@ -395,7 +395,8 @@ AcpiRsCreatePciRoutingTable (
ObjDesc = SubObjectList[0];
if (!ObjDesc || ObjDesc->Common.Type != ACPI_TYPE_INTEGER)
{
- ACPI_ERROR ((AE_INFO, "(PRT[%u].Address) Need Integer, found %s",
+ ACPI_ERROR ((AE_INFO,
+ "(PRT[%u].Address) Need Integer, found %s",
Index, AcpiUtGetObjectTypeName (ObjDesc)));
return_ACPI_STATUS (AE_BAD_DATA);
}
@@ -438,12 +439,12 @@ AcpiRsCreatePciRoutingTable (
/* Use *remaining* length of the buffer as max for pathname */
PathBuffer.Length = OutputBuffer->Length -
- (UINT32) ((UINT8 *) UserPrt->Source -
- (UINT8 *) OutputBuffer->Pointer);
+ (UINT32) ((UINT8 *) UserPrt->Source -
+ (UINT8 *) OutputBuffer->Pointer);
PathBuffer.Pointer = UserPrt->Source;
- Status = AcpiNsHandleToPathname ((ACPI_HANDLE) Node,
- &PathBuffer, FALSE);
+ Status = AcpiNsHandleToPathname (
+ (ACPI_HANDLE) Node, &PathBuffer, FALSE);
/* +1 to include null terminator */
@@ -463,8 +464,8 @@ AcpiRsCreatePciRoutingTable (
case ACPI_TYPE_INTEGER:
/*
- * If this is a number, then the Source Name is NULL, since the
- * entire buffer was zeroed out, we can leave this alone.
+ * If this is a number, then the Source Name is NULL, since
+ * the entire buffer was zeroed out, we can leave this alone.
*
* Add to the Length field the length of the UINT32 NULL
*/
@@ -503,7 +504,7 @@ AcpiRsCreatePciRoutingTable (
}
ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "OutputBuffer %p Length %X\n",
- OutputBuffer->Pointer, (UINT32) OutputBuffer->Length));
+ OutputBuffer->Pointer, (UINT32) OutputBuffer->Length));
return_ACPI_STATUS (AE_OK);
}
@@ -544,8 +545,8 @@ AcpiRsCreateAmlResources (
/* Get the buffer size needed for the AML byte stream */
- Status = AcpiRsGetAmlLength (ResourceList->Pointer,
- ResourceList->Length, &AmlSizeNeeded);
+ Status = AcpiRsGetAmlLength (
+ ResourceList->Pointer, ResourceList->Length, &AmlSizeNeeded);
ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "AmlSizeNeeded=%X, %s\n",
(UINT32) AmlSizeNeeded, AcpiFormatException (Status)));
@@ -565,7 +566,7 @@ AcpiRsCreateAmlResources (
/* Do the conversion */
Status = AcpiRsConvertResourcesToAml (ResourceList->Pointer,
- AmlSizeNeeded, OutputBuffer->Pointer);
+ AmlSizeNeeded, OutputBuffer->Pointer);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
diff --git a/src/acpica/source/components/resources/rsdump.c b/src/acpica/source/components/resources/rsdump.c
index 07d308a..cc8afa0 100644
--- a/src/acpica/source/components/resources/rsdump.c
+++ b/src/acpica/source/components/resources/rsdump.c
@@ -617,6 +617,7 @@ AcpiRsOutString (
char *Title,
char *Value)
{
+
AcpiOsPrintf ("%27s : %s", Title, Value);
if (!*Value)
{
@@ -638,6 +639,7 @@ AcpiRsOutInteger16 (
char *Title,
UINT16 Value)
{
+
AcpiOsPrintf ("%27s : %4.4X\n", Title, Value);
}
@@ -646,6 +648,7 @@ AcpiRsOutInteger32 (
char *Title,
UINT32 Value)
{
+
AcpiOsPrintf ("%27s : %8.8X\n", Title, Value);
}
@@ -654,6 +657,7 @@ AcpiRsOutInteger64 (
char *Title,
UINT64 Value)
{
+
AcpiOsPrintf ("%27s : %8.8X%8.8X\n", Title,
ACPI_FORMAT_UINT64 (Value));
}
@@ -662,6 +666,7 @@ static void
AcpiRsOutTitle (
char *Title)
{
+
AcpiOsPrintf ("%27s : ", Title);
}
@@ -689,8 +694,7 @@ AcpiRsDumpByteList (
for (i = 0; i < Length; i++)
{
- AcpiOsPrintf ("%25s%2.2X : %2.2X\n",
- "Byte", i, Data[i]);
+ AcpiOsPrintf ("%25s%2.2X : %2.2X\n", "Byte", i, Data[i]);
}
}
@@ -706,6 +710,7 @@ AcpiRsDumpShortByteList (
{
AcpiOsPrintf ("%X ", Data[i]);
}
+
AcpiOsPrintf ("\n");
}
@@ -719,8 +724,7 @@ AcpiRsDumpDwordList (
for (i = 0; i < Length; i++)
{
- AcpiOsPrintf ("%25s%2.2X : %8.8X\n",
- "Dword", i, Data[i]);
+ AcpiOsPrintf ("%25s%2.2X : %8.8X\n", "Dword", i, Data[i]);
}
}
@@ -734,7 +738,6 @@ AcpiRsDumpWordList (
for (i = 0; i < Length; i++)
{
- AcpiOsPrintf ("%25s%2.2X : %4.4X\n",
- "Word", i, Data[i]);
+ AcpiOsPrintf ("%25s%2.2X : %4.4X\n", "Word", i, Data[i]);
}
}
diff --git a/src/acpica/source/components/resources/rslist.c b/src/acpica/source/components/resources/rslist.c
index 4fda294..8e6460f 100644
--- a/src/acpica/source/components/resources/rslist.c
+++ b/src/acpica/source/components/resources/rslist.c
@@ -169,9 +169,12 @@ AcpiRsConvertAmlToResources (
/* Get the appropriate conversion info table */
AmlResource = ACPI_CAST_PTR (AML_RESOURCE, Aml);
- if (AcpiUtGetResourceType (Aml) == ACPI_RESOURCE_NAME_SERIAL_BUS)
+
+ if (AcpiUtGetResourceType (Aml) ==
+ ACPI_RESOURCE_NAME_SERIAL_BUS)
{
- if (AmlResource->CommonSerialBus.Type > AML_RESOURCE_MAX_SERIALBUSTYPE)
+ if (AmlResource->CommonSerialBus.Type >
+ AML_RESOURCE_MAX_SERIALBUSTYPE)
{
ConversionTable = NULL;
}
@@ -179,15 +182,13 @@ AcpiRsConvertAmlToResources (
{
/* This is an I2C, SPI, or UART SerialBus descriptor */
- ConversionTable =
- AcpiGbl_ConvertResourceSerialBusDispatch[
- AmlResource->CommonSerialBus.Type];
+ ConversionTable = AcpiGbl_ConvertResourceSerialBusDispatch [
+ AmlResource->CommonSerialBus.Type];
}
}
else
{
- ConversionTable =
- AcpiGbl_GetResourceDispatch[ResourceIndex];
+ ConversionTable = AcpiGbl_GetResourceDispatch[ResourceIndex];
}
if (!ConversionTable)
@@ -282,7 +283,8 @@ AcpiRsConvertResourcesToAml (
if (Resource->Type == ACPI_RESOURCE_TYPE_SERIAL_BUS)
{
- if (Resource->Data.CommonSerialBus.Type > AML_RESOURCE_MAX_SERIALBUSTYPE)
+ if (Resource->Data.CommonSerialBus.Type >
+ AML_RESOURCE_MAX_SERIALBUSTYPE)
{
ConversionTable = NULL;
}
@@ -308,8 +310,7 @@ AcpiRsConvertResourcesToAml (
}
Status = AcpiRsConvertResourceToAml (Resource,
- ACPI_CAST_PTR (AML_RESOURCE, Aml),
- ConversionTable);
+ ACPI_CAST_PTR (AML_RESOURCE, Aml), ConversionTable);
if (ACPI_FAILURE (Status))
{
ACPI_EXCEPTION ((AE_INFO, Status,
@@ -320,8 +321,8 @@ AcpiRsConvertResourcesToAml (
/* Perform final sanity check on the new AML resource descriptor */
- Status = AcpiUtValidateResource (NULL,
- ACPI_CAST_PTR (AML_RESOURCE, Aml), NULL);
+ Status = AcpiUtValidateResource (
+ NULL, ACPI_CAST_PTR (AML_RESOURCE, Aml), NULL);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
diff --git a/src/acpica/source/components/resources/rsmisc.c b/src/acpica/source/components/resources/rsmisc.c
index 1a5512e..04c1765 100644
--- a/src/acpica/source/components/resources/rsmisc.c
+++ b/src/acpica/source/components/resources/rsmisc.c
@@ -193,7 +193,7 @@ AcpiRsConvertAmlToResource (
* Source is the external AML byte stream buffer,
* destination is the internal resource descriptor
*/
- Source = ACPI_ADD_PTR (void, Aml, Info->AmlOffset);
+ Source = ACPI_ADD_PTR (void, Aml, Info->AmlOffset);
Destination = ACPI_ADD_PTR (void, Resource, Info->ResourceOffset);
switch (Info->Opcode)
@@ -272,8 +272,7 @@ AcpiRsConvertAmlToResource (
ItemCount = ACPI_GET8 (Source);
ACPI_SET8 (Destination, ItemCount);
- Resource->Length = Resource->Length +
- (Info->Value * ItemCount);
+ Resource->Length = Resource->Length + (Info->Value * ItemCount);
break;
case ACPI_RSC_COUNT_GPIO_RES:
@@ -345,7 +344,7 @@ AcpiRsConvertAmlToResource (
/* Generate and set the PIN data pointer */
Target = (char *) ACPI_ADD_PTR (void, Resource,
- (Resource->Length - ItemCount * 2));
+ (Resource->Length - ItemCount * 2));
*(UINT16 **) Destination = ACPI_CAST_PTR (UINT16, Target);
/* Copy the PIN data */
@@ -359,7 +358,7 @@ AcpiRsConvertAmlToResource (
/* Generate and set the ResourceSource string pointer */
Target = (char *) ACPI_ADD_PTR (void, Resource,
- (Resource->Length - ItemCount));
+ (Resource->Length - ItemCount));
*(UINT8 **) Destination = ACPI_CAST_PTR (UINT8, Target);
/* Copy the ResourceSource string */
@@ -373,7 +372,7 @@ AcpiRsConvertAmlToResource (
/* Generate and set the Vendor Data pointer */
Target = (char *) ACPI_ADD_PTR (void, Resource,
- (Resource->Length - ItemCount));
+ (Resource->Length - ItemCount));
*(UINT8 **) Destination = ACPI_CAST_PTR (UINT8, Target);
/* Copy the Vendor Data */
@@ -387,12 +386,13 @@ AcpiRsConvertAmlToResource (
/* Generate and set the ResourceSource string pointer */
Target = (char *) ACPI_ADD_PTR (void, Resource,
- (Resource->Length - ItemCount));
+ (Resource->Length - ItemCount));
*(UINT8 **) Destination = ACPI_CAST_PTR (UINT8, Target);
/* Copy the ResourceSource string */
- Source = ACPI_ADD_PTR (void, Aml, (ACPI_GET16 (Source) + Info->Value));
+ Source = ACPI_ADD_PTR (
+ void, Aml, (ACPI_GET16 (Source) + Info->Value));
AcpiRsMoveData (Target, Source, ItemCount, Info->Opcode);
break;
@@ -514,7 +514,8 @@ Exit:
{
/* Round the resource struct length up to the next boundary (32 or 64) */
- Resource->Length = (UINT32) ACPI_ROUND_UP_TO_NATIVE_WORD (Resource->Length);
+ Resource->Length = (UINT32)
+ ACPI_ROUND_UP_TO_NATIVE_WORD (Resource->Length);
}
return_ACPI_STATUS (AE_OK);
}
@@ -570,7 +571,7 @@ AcpiRsConvertResourceToAml (
* Source is the internal resource descriptor,
* destination is the external AML byte stream buffer
*/
- Source = ACPI_ADD_PTR (void, Resource, Info->ResourceOffset);
+ Source = ACPI_ADD_PTR (void, Resource, Info->ResourceOffset);
Destination = ACPI_ADD_PTR (void, Aml, Info->AmlOffset);
switch (Info->Opcode)
@@ -579,7 +580,8 @@ AcpiRsConvertResourceToAml (
memset (Aml, 0, INIT_RESOURCE_LENGTH (Info));
AmlLength = INIT_RESOURCE_LENGTH (Info);
- AcpiRsSetResourceHeader (INIT_RESOURCE_TYPE (Info), AmlLength, Aml);
+ AcpiRsSetResourceHeader (
+ INIT_RESOURCE_TYPE (Info), AmlLength, Aml);
break;
case ACPI_RSC_INITGET:
@@ -621,7 +623,8 @@ AcpiRsConvertResourceToAml (
ItemCount = ACPI_GET8 (Source);
ACPI_SET8 (Destination, ItemCount);
- AmlLength = (UINT16) (AmlLength + (Info->Value * (ItemCount - 1)));
+ AmlLength = (UINT16)
+ (AmlLength + (Info->Value * (ItemCount - 1)));
break;
case ACPI_RSC_COUNT16:
@@ -647,7 +650,8 @@ AcpiRsConvertResourceToAml (
ItemCount = ACPI_GET16 (Source);
ACPI_SET16 (Destination, ItemCount);
- AmlLength = (UINT16) (AmlLength + (Info->Value * ItemCount));
+ AmlLength = (UINT16) (
+ AmlLength + (Info->Value * ItemCount));
AcpiRsSetResourceLength (AmlLength, Aml);
break;
@@ -708,7 +712,7 @@ AcpiRsConvertResourceToAml (
case ACPI_RSC_MOVE_GPIO_PIN:
Destination = (char *) ACPI_ADD_PTR (void, Aml,
- ACPI_GET16 (Destination));
+ ACPI_GET16 (Destination));
Source = * (UINT16 **) Source;
AcpiRsMoveData (Destination, Source, ItemCount, Info->Opcode);
break;
@@ -718,7 +722,7 @@ AcpiRsConvertResourceToAml (
/* Used for both ResourceSource string and VendorData */
Destination = (char *) ACPI_ADD_PTR (void, Aml,
- ACPI_GET16 (Destination));
+ ACPI_GET16 (Destination));
Source = * (UINT8 **) Source;
AcpiRsMoveData (Destination, Source, ItemCount, Info->Opcode);
break;
@@ -726,7 +730,7 @@ AcpiRsConvertResourceToAml (
case ACPI_RSC_MOVE_SERIAL_VEN:
Destination = (char *) ACPI_ADD_PTR (void, Aml,
- (AmlLength - ItemCount));
+ (AmlLength - ItemCount));
Source = * (UINT8 **) Source;
AcpiRsMoveData (Destination, Source, ItemCount, Info->Opcode);
break;
@@ -734,7 +738,7 @@ AcpiRsConvertResourceToAml (
case ACPI_RSC_MOVE_SERIAL_RES:
Destination = (char *) ACPI_ADD_PTR (void, Aml,
- (AmlLength - ItemCount));
+ (AmlLength - ItemCount));
Source = * (UINT8 **) Source;
AcpiRsMoveData (Destination, Source, ItemCount, Info->Opcode);
break;
@@ -751,7 +755,7 @@ AcpiRsConvertResourceToAml (
* Optional ResourceSource (Index and String)
*/
AmlLength = AcpiRsSetResourceSource (
- Aml, (ACPI_RS_LENGTH) AmlLength, Source);
+ Aml, (ACPI_RS_LENGTH) AmlLength, Source);
AcpiRsSetResourceLength (AmlLength, Aml);
break;
@@ -777,8 +781,8 @@ AcpiRsConvertResourceToAml (
/*
* 16-bit encoded bitmask (IRQ macro)
*/
- Temp16 = AcpiRsEncodeBitmask (Source,
- *ACPI_ADD_PTR (UINT8, Resource, Info->Value));
+ Temp16 = AcpiRsEncodeBitmask (
+ Source, *ACPI_ADD_PTR (UINT8, Resource, Info->Value));
ACPI_MOVE_16_TO_16 (Destination, &Temp16);
break;
@@ -801,7 +805,7 @@ AcpiRsConvertResourceToAml (
case ACPI_RSC_COMPARE_VALUE:
if (*ACPI_ADD_PTR (UINT8, Resource,
- COMPARE_TARGET (Info)) != COMPARE_VALUE (Info))
+ COMPARE_TARGET (Info)) != COMPARE_VALUE (Info))
{
goto Exit;
}
@@ -819,7 +823,7 @@ AcpiRsConvertResourceToAml (
* Control - Exit conversion if equal
*/
if (*ACPI_ADD_PTR (UINT8, Resource,
- COMPARE_TARGET (Info)) == COMPARE_VALUE (Info))
+ COMPARE_TARGET (Info)) == COMPARE_VALUE (Info))
{
goto Exit;
}
@@ -843,7 +847,8 @@ Exit:
#if 0
/* Previous resource validations */
- if (Aml->ExtAddress64.RevisionID != AML_RESOURCE_EXTENDED_ADDRESS_REVISION)
+ if (Aml->ExtAddress64.RevisionID !=
+ AML_RESOURCE_EXTENDED_ADDRESS_REVISION)
{
return_ACPI_STATUS (AE_SUPPORT);
}
diff --git a/src/acpica/source/components/resources/rsutils.c b/src/acpica/source/components/resources/rsutils.c
index a7dc215..f8d5cef 100644
--- a/src/acpica/source/components/resources/rsutils.c
+++ b/src/acpica/source/components/resources/rsutils.c
@@ -257,20 +257,23 @@ AcpiRsMoveData (
case ACPI_RSC_MOVE16:
case ACPI_RSC_MOVE_GPIO_PIN:
- ACPI_MOVE_16_TO_16 (&ACPI_CAST_PTR (UINT16, Destination)[i],
- &ACPI_CAST_PTR (UINT16, Source)[i]);
+ ACPI_MOVE_16_TO_16 (
+ &ACPI_CAST_PTR (UINT16, Destination)[i],
+ &ACPI_CAST_PTR (UINT16, Source)[i]);
break;
case ACPI_RSC_MOVE32:
- ACPI_MOVE_32_TO_32 (&ACPI_CAST_PTR (UINT32, Destination)[i],
- &ACPI_CAST_PTR (UINT32, Source)[i]);
+ ACPI_MOVE_32_TO_32 (
+ &ACPI_CAST_PTR (UINT32, Destination)[i],
+ &ACPI_CAST_PTR (UINT32, Source)[i]);
break;
case ACPI_RSC_MOVE64:
- ACPI_MOVE_64_TO_64 (&ACPI_CAST_PTR (UINT64, Destination)[i],
- &ACPI_CAST_PTR (UINT64, Source)[i]);
+ ACPI_MOVE_64_TO_64 (
+ &ACPI_CAST_PTR (UINT64, Destination)[i],
+ &ACPI_CAST_PTR (UINT64, Source)[i]);
break;
default:
@@ -320,18 +323,18 @@ AcpiRsSetResourceLength (
{
/* Large descriptor -- bytes 1-2 contain the 16-bit length */
- ACPI_MOVE_16_TO_16 (&Aml->LargeHeader.ResourceLength, &ResourceLength);
+ ACPI_MOVE_16_TO_16 (
+ &Aml->LargeHeader.ResourceLength, &ResourceLength);
}
else
{
- /* Small descriptor -- bits 2:0 of byte 0 contain the length */
-
+ /*
+ * Small descriptor -- bits 2:0 of byte 0 contain the length
+ * Clear any existing length, preserving descriptor type bits
+ */
Aml->SmallHeader.DescriptorType = (UINT8)
-
- /* Clear any existing length, preserving descriptor type bits */
-
- ((Aml->SmallHeader.DescriptorType & ~ACPI_RESOURCE_NAME_SMALL_LENGTH_MASK)
-
+ ((Aml->SmallHeader.DescriptorType &
+ ~ACPI_RESOURCE_NAME_SMALL_LENGTH_MASK)
| ResourceLength);
}
}
@@ -450,8 +453,8 @@ AcpiRsGetResourceSource (
AmlResourceSource = ACPI_ADD_PTR (UINT8, Aml, MinimumLength);
/*
- * ResourceSource is present if the length of the descriptor is longer than
- * the minimum length.
+ * ResourceSource is present if the length of the descriptor is longer
+ * than the minimum length.
*
* Note: Some resource descriptors will have an additional null, so
* we add 1 to the minimum length.
@@ -469,8 +472,8 @@ AcpiRsGetResourceSource (
* String destination pointer is not specified; Set the String
* pointer to the end of the current ResourceSource structure.
*/
- ResourceSource->StringPtr = ACPI_ADD_PTR (char, ResourceSource,
- sizeof (ACPI_RESOURCE_SOURCE));
+ ResourceSource->StringPtr = ACPI_ADD_PTR (
+ char, ResourceSource, sizeof (ACPI_RESOURCE_SOURCE));
}
/*
@@ -482,13 +485,15 @@ AcpiRsGetResourceSource (
*/
TotalLength = (UINT32) strlen (
ACPI_CAST_PTR (char, &AmlResourceSource[1])) + 1;
+
TotalLength = (UINT32) ACPI_ROUND_UP_TO_NATIVE_WORD (TotalLength);
memset (ResourceSource->StringPtr, 0, TotalLength);
/* Copy the ResourceSource string to the destination */
- ResourceSource->StringLength = AcpiRsStrcpy (ResourceSource->StringPtr,
+ ResourceSource->StringLength = AcpiRsStrcpy (
+ ResourceSource->StringPtr,
ACPI_CAST_PTR (char, &AmlResourceSource[1]));
return ((ACPI_RS_LENGTH) TotalLength);
@@ -556,7 +561,8 @@ AcpiRsSetResourceSource (
* Add the length of the string (+ 1 for null terminator) to the
* final descriptor length
*/
- DescriptorLength += ((ACPI_RSDESC_SIZE) ResourceSource->StringLength + 1);
+ DescriptorLength += ((ACPI_RSDESC_SIZE)
+ ResourceSource->StringLength + 1);
}
/* Return the new total length of the AML descriptor */
@@ -599,8 +605,8 @@ AcpiRsGetPrtMethodData (
/* Execute the method, no parameters */
- Status = AcpiUtEvaluateObject (Node, METHOD_NAME__PRT,
- ACPI_BTYPE_PACKAGE, &ObjDesc);
+ Status = AcpiUtEvaluateObject (
+ Node, METHOD_NAME__PRT, ACPI_BTYPE_PACKAGE, &ObjDesc);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
@@ -653,8 +659,8 @@ AcpiRsGetCrsMethodData (
/* Execute the method, no parameters */
- Status = AcpiUtEvaluateObject (Node, METHOD_NAME__CRS,
- ACPI_BTYPE_BUFFER, &ObjDesc);
+ Status = AcpiUtEvaluateObject (
+ Node, METHOD_NAME__CRS, ACPI_BTYPE_BUFFER, &ObjDesc);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
@@ -708,8 +714,8 @@ AcpiRsGetPrsMethodData (
/* Execute the method, no parameters */
- Status = AcpiUtEvaluateObject (Node, METHOD_NAME__PRS,
- ACPI_BTYPE_BUFFER, &ObjDesc);
+ Status = AcpiUtEvaluateObject (
+ Node, METHOD_NAME__PRS, ACPI_BTYPE_BUFFER, &ObjDesc);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
@@ -763,8 +769,8 @@ AcpiRsGetAeiMethodData (
/* Execute the method, no parameters */
- Status = AcpiUtEvaluateObject (Node, METHOD_NAME__AEI,
- ACPI_BTYPE_BUFFER, &ObjDesc);
+ Status = AcpiUtEvaluateObject (
+ Node, METHOD_NAME__AEI, ACPI_BTYPE_BUFFER, &ObjDesc);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
@@ -820,7 +826,8 @@ AcpiRsGetMethodData (
/* Execute the method, no parameters */
- Status = AcpiUtEvaluateObject (ACPI_CAST_PTR (ACPI_NAMESPACE_NODE, Handle),
+ Status = AcpiUtEvaluateObject (
+ ACPI_CAST_PTR (ACPI_NAMESPACE_NODE, Handle),
Path, ACPI_BTYPE_BUFFER, &ObjDesc);
if (ACPI_FAILURE (Status))
{
diff --git a/src/acpica/source/components/resources/rsxface.c b/src/acpica/source/components/resources/rsxface.c
index 9aea3dc..9580053 100644
--- a/src/acpica/source/components/resources/rsxface.c
+++ b/src/acpica/source/components/resources/rsxface.c
@@ -126,7 +126,7 @@
/* Local macros for 16,32-bit to 64-bit conversion */
#define ACPI_COPY_FIELD(Out, In, Field) ((Out)->Field = (In)->Field)
-#define ACPI_COPY_ADDRESS(Out, In) \
+#define ACPI_COPY_ADDRESS(Out, In) \
ACPI_COPY_FIELD(Out, In, ResourceType); \
ACPI_COPY_FIELD(Out, In, ProducerConsumer); \
ACPI_COPY_FIELD(Out, In, Decode); \
@@ -505,13 +505,15 @@ AcpiResourceToAddress64 (
{
case ACPI_RESOURCE_TYPE_ADDRESS16:
- Address16 = ACPI_CAST_PTR (ACPI_RESOURCE_ADDRESS16, &Resource->Data);
+ Address16 = ACPI_CAST_PTR (
+ ACPI_RESOURCE_ADDRESS16, &Resource->Data);
ACPI_COPY_ADDRESS (Out, Address16);
break;
case ACPI_RESOURCE_TYPE_ADDRESS32:
- Address32 = ACPI_CAST_PTR (ACPI_RESOURCE_ADDRESS32, &Resource->Data);
+ Address32 = ACPI_CAST_PTR (
+ ACPI_RESOURCE_ADDRESS32, &Resource->Data);
ACPI_COPY_ADDRESS (Out, Address32);
break;
@@ -576,8 +578,8 @@ AcpiGetVendorResource (
/* Walk the _CRS or _PRS resource list for this device */
- Status = AcpiWalkResources (DeviceHandle, Name, AcpiRsMatchVendorResource,
- &Info);
+ Status = AcpiWalkResources (
+ DeviceHandle, Name, AcpiRsMatchVendorResource, &Info);
if (ACPI_FAILURE (Status))
{
return (Status);
@@ -696,7 +698,8 @@ AcpiWalkResourceBuffer (
/* Buffer contains the resource list and length */
Resource = ACPI_CAST_PTR (ACPI_RESOURCE, Buffer->Pointer);
- ResourceEnd = ACPI_ADD_PTR (ACPI_RESOURCE, Buffer->Pointer, Buffer->Length);
+ ResourceEnd = ACPI_ADD_PTR (
+ ACPI_RESOURCE, Buffer->Pointer, Buffer->Length);
/* Walk the resource list until the EndTag is found (or buffer end) */
diff --git a/src/acpica/source/components/tables/tbdata.c b/src/acpica/source/components/tables/tbdata.c
index daacf41..8b388f4 100644
--- a/src/acpica/source/components/tables/tbdata.c
+++ b/src/acpica/source/components/tables/tbdata.c
@@ -194,7 +194,7 @@ AcpiTbAcquireTable (
case ACPI_TABLE_ORIGIN_EXTERNAL_VIRTUAL:
Table = ACPI_CAST_PTR (ACPI_TABLE_HEADER,
- ACPI_PHYSADDR_TO_PTR (TableDesc->Address));
+ ACPI_PHYSADDR_TO_PTR (TableDesc->Address));
break;
default:
@@ -301,7 +301,7 @@ AcpiTbAcquireTempTable (
case ACPI_TABLE_ORIGIN_EXTERNAL_VIRTUAL:
TableHeader = ACPI_CAST_PTR (ACPI_TABLE_HEADER,
- ACPI_PHYSADDR_TO_PTR (Address));
+ ACPI_PHYSADDR_TO_PTR (Address));
if (!TableHeader)
{
return (AE_NO_MEMORY);
@@ -375,7 +375,7 @@ AcpiTbValidateTable (
if (!TableDesc->Pointer)
{
Status = AcpiTbAcquireTable (TableDesc, &TableDesc->Pointer,
- &TableDesc->Length, &TableDesc->Flags);
+ &TableDesc->Length, &TableDesc->Flags);
if (!TableDesc->Pointer)
{
Status = AE_NO_MEMORY;
@@ -516,6 +516,7 @@ AcpiTbVerifyTempTable (
AcpiUtValidAcpiName (TableDesc->Signature.Ascii) ?
TableDesc->Signature.Ascii : "????",
ACPI_FORMAT_UINT64 (TableDesc->Address)));
+
goto InvalidateAndExit;
}
}
@@ -793,7 +794,7 @@ AcpiTbAllocateOwnerId (
if (TableIndex < AcpiGbl_RootTableList.CurrentTableCount)
{
Status = AcpiUtAllocateOwnerId (
- &(AcpiGbl_RootTableList.Tables[TableIndex].OwnerId));
+ &(AcpiGbl_RootTableList.Tables[TableIndex].OwnerId));
}
(void) AcpiUtReleaseMutex (ACPI_MTX_TABLES);
diff --git a/src/acpica/source/components/tables/tbfadt.c b/src/acpica/source/components/tables/tbfadt.c
index 4f82733..dc933d6 100644
--- a/src/acpica/source/components/tables/tbfadt.c
+++ b/src/acpica/source/components/tables/tbfadt.c
@@ -398,7 +398,7 @@ AcpiTbSelectAddress (
*
* FUNCTION: AcpiTbParseFadt
*
- * PARAMETERS: TableIndex - Index for the FADT
+ * PARAMETERS: None
*
* RETURN: None
*
@@ -409,7 +409,7 @@ AcpiTbSelectAddress (
void
AcpiTbParseFadt (
- UINT32 TableIndex)
+ void)
{
UINT32 Length;
ACPI_TABLE_HEADER *Table;
@@ -422,10 +422,10 @@ AcpiTbParseFadt (
* Get a local copy of the FADT and convert it to a common format
* Map entire FADT, assumed to be smaller than one page.
*/
- Length = AcpiGbl_RootTableList.Tables[TableIndex].Length;
+ Length = AcpiGbl_RootTableList.Tables[AcpiGbl_FadtIndex].Length;
Table = AcpiOsMapMemory (
- AcpiGbl_RootTableList.Tables[TableIndex].Address, Length);
+ AcpiGbl_RootTableList.Tables[AcpiGbl_FadtIndex].Address, Length);
if (!Table)
{
return;
diff --git a/src/acpica/source/components/tables/tbfind.c b/src/acpica/source/components/tables/tbfind.c
index bf692b8..3a7f705 100644
--- a/src/acpica/source/components/tables/tbfind.c
+++ b/src/acpica/source/components/tables/tbfind.c
@@ -180,7 +180,7 @@ AcpiTbFindTable (
for (i = 0; i < AcpiGbl_RootTableList.CurrentTableCount; ++i)
{
if (memcmp (&(AcpiGbl_RootTableList.Tables[i].Signature),
- Header.Signature, ACPI_NAME_SIZE))
+ Header.Signature, ACPI_NAME_SIZE))
{
/* Not the requested table */
@@ -208,13 +208,13 @@ AcpiTbFindTable (
/* Check for table match on all IDs */
if (!memcmp (AcpiGbl_RootTableList.Tables[i].Pointer->Signature,
- Header.Signature, ACPI_NAME_SIZE) &&
+ Header.Signature, ACPI_NAME_SIZE) &&
(!OemId[0] ||
!memcmp (AcpiGbl_RootTableList.Tables[i].Pointer->OemId,
- Header.OemId, ACPI_OEM_ID_SIZE)) &&
+ Header.OemId, ACPI_OEM_ID_SIZE)) &&
(!OemTableId[0] ||
!memcmp (AcpiGbl_RootTableList.Tables[i].Pointer->OemTableId,
- Header.OemTableId, ACPI_OEM_TABLE_ID_SIZE)))
+ Header.OemTableId, ACPI_OEM_TABLE_ID_SIZE)))
{
*TableIndex = i;
diff --git a/src/acpica/source/components/tables/tbinstal.c b/src/acpica/source/components/tables/tbinstal.c
index 2d7bb94..9c5b9c1 100644
--- a/src/acpica/source/components/tables/tbinstal.c
+++ b/src/acpica/source/components/tables/tbinstal.c
@@ -155,7 +155,7 @@ AcpiTbCompareTables (
Status = AcpiTbAcquireTable (&AcpiGbl_RootTableList.Tables[TableIndex],
- &Table, &TableLength, &TableFlags);
+ &Table, &TableLength, &TableFlags);
if (ACPI_FAILURE (Status))
{
return (FALSE);
@@ -278,7 +278,7 @@ AcpiTbInstallFixedTable (
/* Fill a table descriptor for validation */
Status = AcpiTbAcquireTempTable (&NewTableDesc, Address,
- ACPI_TABLE_ORIGIN_INTERNAL_PHYSICAL);
+ ACPI_TABLE_ORIGIN_INTERNAL_PHYSICAL);
if (ACPI_FAILURE (Status))
{
ACPI_ERROR ((AE_INFO, "Could not acquire table length at %8.8X%8.8X",
@@ -350,7 +350,8 @@ AcpiTbInstallStandardTable (
Status = AcpiTbAcquireTempTable (&NewTableDesc, Address, Flags);
if (ACPI_FAILURE (Status))
{
- ACPI_ERROR ((AE_INFO, "Could not acquire table length at %8.8X%8.8X",
+ ACPI_ERROR ((AE_INFO,
+ "Could not acquire table length at %8.8X%8.8X",
ACPI_FORMAT_UINT64 (Address)));
return_ACPI_STATUS (Status);
}
@@ -363,7 +364,8 @@ AcpiTbInstallStandardTable (
AcpiGbl_DisableSsdtTableInstall &&
ACPI_COMPARE_NAME (&NewTableDesc.Signature, ACPI_SIG_SSDT))
{
- ACPI_INFO ((AE_INFO, "Ignoring installation of %4.4s at %8.8X%8.8X",
+ ACPI_INFO ((AE_INFO,
+ "Ignoring installation of %4.4s at %8.8X%8.8X",
NewTableDesc.Signature.Ascii, ACPI_FORMAT_UINT64 (Address)));
goto ReleaseAndExit;
}
@@ -431,7 +433,8 @@ AcpiTbInstallStandardTable (
* need to be unregistered when they are unloaded, and slots in the
* root table list should be reused when empty.
*/
- if (AcpiGbl_RootTableList.Tables[i].Flags & ACPI_TABLE_IS_LOADED)
+ if (AcpiGbl_RootTableList.Tables[i].Flags &
+ ACPI_TABLE_IS_LOADED)
{
/* Table is still loaded, this is an error */
diff --git a/src/acpica/source/components/tables/tbprint.c b/src/acpica/source/components/tables/tbprint.c
index e958041..ff221d2 100644
--- a/src/acpica/source/components/tables/tbprint.c
+++ b/src/acpica/source/components/tables/tbprint.c
@@ -160,6 +160,7 @@ AcpiTbFixString (
{
*String = '?';
}
+
String++;
Length--;
}
@@ -228,8 +229,8 @@ AcpiTbPrintTableHeader (
{
/* RSDP has no common fields */
- memcpy (LocalHeader.OemId,
- ACPI_CAST_PTR (ACPI_TABLE_RSDP, Header)->OemId, ACPI_OEM_ID_SIZE);
+ memcpy (LocalHeader.OemId, ACPI_CAST_PTR (ACPI_TABLE_RSDP,
+ Header)->OemId, ACPI_OEM_ID_SIZE);
AcpiTbFixString (LocalHeader.OemId, ACPI_OEM_ID_SIZE);
ACPI_INFO ((AE_INFO, "RSDP 0x%8.8X%8.8X %06X (v%.2d %-6.6s)",
diff --git a/src/acpica/source/components/tables/tbutils.c b/src/acpica/source/components/tables/tbutils.c
index 0570425..bb74c0a 100644
--- a/src/acpica/source/components/tables/tbutils.c
+++ b/src/acpica/source/components/tables/tbutils.c
@@ -158,16 +158,16 @@ AcpiTbInitializeFacs (
return (AE_OK);
}
else if (AcpiGbl_FADT.XFacs &&
- (!AcpiGbl_FADT.Facs || !AcpiGbl_Use32BitFacsAddresses))
+ (!AcpiGbl_FADT.Facs || !AcpiGbl_Use32BitFacsAddresses))
{
(void) AcpiGetTableByIndex (AcpiGbl_XFacsIndex,
- ACPI_CAST_INDIRECT_PTR (ACPI_TABLE_HEADER, &Facs));
+ ACPI_CAST_INDIRECT_PTR (ACPI_TABLE_HEADER, &Facs));
AcpiGbl_FACS = Facs;
}
else if (AcpiGbl_FADT.Facs)
{
(void) AcpiGetTableByIndex (AcpiGbl_FacsIndex,
- ACPI_CAST_INDIRECT_PTR (ACPI_TABLE_HEADER, &Facs));
+ ACPI_CAST_INDIRECT_PTR (ACPI_TABLE_HEADER, &Facs));
AcpiGbl_FACS = Facs;
}
@@ -180,33 +180,6 @@ AcpiTbInitializeFacs (
/*******************************************************************************
*
- * FUNCTION: AcpiTbTablesLoaded
- *
- * PARAMETERS: None
- *
- * RETURN: TRUE if required ACPI tables are loaded
- *
- * DESCRIPTION: Determine if the minimum required ACPI tables are present
- * (FADT, FACS, DSDT)
- *
- ******************************************************************************/
-
-BOOLEAN
-AcpiTbTablesLoaded (
- void)
-{
-
- if (AcpiGbl_RootTableList.CurrentTableCount >= 4)
- {
- return (TRUE);
- }
-
- return (FALSE);
-}
-
-
-/*******************************************************************************
- *
* FUNCTION: AcpiTbCheckDsdtHeader
*
* PARAMETERS: None
@@ -232,6 +205,7 @@ AcpiTbCheckDsdtHeader (
ACPI_BIOS_ERROR ((AE_INFO,
"The DSDT has been corrupted or replaced - "
"old, new headers below"));
+
AcpiTbPrintTableHeader (0, &AcpiGbl_OriginalDsdtHeader);
AcpiTbPrintTableHeader (0, AcpiGbl_DSDT);
@@ -280,8 +254,8 @@ AcpiTbCopyDsdt (
AcpiTbInitTableDescriptor (
&AcpiGbl_RootTableList.Tables[AcpiGbl_DsdtIndex],
- ACPI_PTR_TO_PHYSADDR (NewTable), ACPI_TABLE_ORIGIN_INTERNAL_VIRTUAL,
- NewTable);
+ ACPI_PTR_TO_PHYSADDR (NewTable),
+ ACPI_TABLE_ORIGIN_INTERNAL_VIRTUAL, NewTable);
ACPI_INFO ((AE_INFO,
"Forced DSDT copy: length 0x%05X copied locally, original unmapped",
@@ -326,7 +300,8 @@ AcpiTbGetRootTableEntry (
* 32-bit platform, RSDT: Return 32-bit table entry
* 64-bit platform, RSDT: Expand 32-bit to 64-bit and return
*/
- return ((ACPI_PHYSICAL_ADDRESS) (*ACPI_CAST_PTR (UINT32, TableEntry)));
+ return ((ACPI_PHYSICAL_ADDRESS) (*ACPI_CAST_PTR (
+ UINT32, TableEntry)));
}
else
{
@@ -492,10 +467,12 @@ AcpiTbParseRootTable (
ACPI_TABLE_ORIGIN_INTERNAL_PHYSICAL, FALSE, TRUE, &TableIndex);
if (ACPI_SUCCESS (Status) &&
- ACPI_COMPARE_NAME (&AcpiGbl_RootTableList.Tables[TableIndex].Signature,
+ ACPI_COMPARE_NAME (
+ &AcpiGbl_RootTableList.Tables[TableIndex].Signature,
ACPI_SIG_FADT))
{
- AcpiTbParseFadt (TableIndex);
+ AcpiGbl_FadtIndex = TableIndex;
+ AcpiTbParseFadt ();
}
NextTable:
@@ -504,7 +481,6 @@ NextTable:
}
AcpiOsUnmapMemory (Table, Length);
-
return_ACPI_STATUS (AE_OK);
}
diff --git a/src/acpica/source/components/tables/tbxface.c b/src/acpica/source/components/tables/tbxface.c
index 25e1405..83de853 100644
--- a/src/acpica/source/components/tables/tbxface.c
+++ b/src/acpica/source/components/tables/tbxface.c
@@ -318,8 +318,8 @@ AcpiGetTableHeader (
for (i = 0, j = 0; i < AcpiGbl_RootTableList.CurrentTableCount; i++)
{
- if (!ACPI_COMPARE_NAME (&(AcpiGbl_RootTableList.Tables[i].Signature),
- Signature))
+ if (!ACPI_COMPARE_NAME (
+ &(AcpiGbl_RootTableList.Tables[i].Signature), Signature))
{
continue;
}
@@ -336,15 +336,14 @@ AcpiGetTableHeader (
ACPI_TABLE_ORIGIN_INTERNAL_PHYSICAL)
{
Header = AcpiOsMapMemory (
- AcpiGbl_RootTableList.Tables[i].Address,
- sizeof (ACPI_TABLE_HEADER));
+ AcpiGbl_RootTableList.Tables[i].Address,
+ sizeof (ACPI_TABLE_HEADER));
if (!Header)
{
return (AE_NO_MEMORY);
}
- memcpy (OutTableHeader, Header,
- sizeof (ACPI_TABLE_HEADER));
+ memcpy (OutTableHeader, Header, sizeof (ACPI_TABLE_HEADER));
AcpiOsUnmapMemory (Header, sizeof (ACPI_TABLE_HEADER));
}
else
@@ -405,8 +404,8 @@ AcpiGetTable (
for (i = 0, j = 0; i < AcpiGbl_RootTableList.CurrentTableCount; i++)
{
- if (!ACPI_COMPARE_NAME (&(AcpiGbl_RootTableList.Tables[i].Signature),
- Signature))
+ if (!ACPI_COMPARE_NAME (
+ &(AcpiGbl_RootTableList.Tables[i].Signature), Signature))
{
continue;
}
@@ -477,7 +476,8 @@ AcpiGetTableByIndex (
{
/* Table is not mapped, map it */
- Status = AcpiTbValidateTable (&AcpiGbl_RootTableList.Tables[TableIndex]);
+ Status = AcpiTbValidateTable (
+ &AcpiGbl_RootTableList.Tables[TableIndex]);
if (ACPI_FAILURE (Status))
{
(void) AcpiUtReleaseMutex (ACPI_MTX_TABLES);
diff --git a/src/acpica/source/components/tables/tbxfload.c b/src/acpica/source/components/tables/tbxfload.c
index 1d51c91..2290e16 100644
--- a/src/acpica/source/components/tables/tbxfload.c
+++ b/src/acpica/source/components/tables/tbxfload.c
@@ -282,6 +282,7 @@ AcpiTbLoadNamespace (
{
ACPI_EXCEPTION ((AE_INFO, Status, "(%4.4s:%8.8s) while loading table",
Table->Signature.Ascii, Table->Pointer->OemTableId));
+
TablesFailed++;
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INIT,
@@ -299,7 +300,7 @@ AcpiTbLoadNamespace (
if (!TablesFailed)
{
ACPI_INFO ((AE_INFO,
- "%u ACPI AML tables successfully acquired and loaded",
+ "%u ACPI AML tables successfully acquired and loaded\n",
TablesLoaded));
}
else
@@ -415,8 +416,8 @@ AcpiLoadTable (
(void) AcpiUtAcquireMutex (ACPI_MTX_TABLES);
Status = AcpiTbInstallStandardTable (ACPI_PTR_TO_PHYSADDR (Table),
- ACPI_TABLE_ORIGIN_EXTERNAL_VIRTUAL, TRUE, FALSE,
- &TableIndex);
+ ACPI_TABLE_ORIGIN_EXTERNAL_VIRTUAL, TRUE, FALSE,
+ &TableIndex);
(void) AcpiUtReleaseMutex (ACPI_MTX_TABLES);
if (ACPI_FAILURE (Status))
@@ -428,7 +429,8 @@ AcpiLoadTable (
* Note: Now table is "INSTALLED", it must be validated before
* using.
*/
- Status = AcpiTbValidateTable (&AcpiGbl_RootTableList.Tables[TableIndex]);
+ Status = AcpiTbValidateTable (
+ &AcpiGbl_RootTableList.Tables[TableIndex]);
if (ACPI_FAILURE (Status))
{
goto UnlockAndExit;
@@ -441,7 +443,7 @@ AcpiLoadTable (
if (AcpiGbl_TableHandler)
{
(void) AcpiGbl_TableHandler (ACPI_TABLE_EVENT_LOAD, Table,
- AcpiGbl_TableHandlerContext);
+ AcpiGbl_TableHandlerContext);
}
UnlockAndExit:
@@ -524,8 +526,8 @@ AcpiUnloadParentTable (
* that can create namespace objects.
*/
if (ACPI_COMPARE_NAME (
- AcpiGbl_RootTableList.Tables[i].Signature.Ascii,
- ACPI_SIG_DSDT))
+ AcpiGbl_RootTableList.Tables[i].Signature.Ascii,
+ ACPI_SIG_DSDT))
{
Status = AE_TYPE;
break;
@@ -544,8 +546,8 @@ AcpiUnloadParentTable (
if (AcpiGbl_TableHandler)
{
(void) AcpiGbl_TableHandler (ACPI_TABLE_EVENT_UNLOAD,
- AcpiGbl_RootTableList.Tables[i].Pointer,
- AcpiGbl_TableHandlerContext);
+ AcpiGbl_RootTableList.Tables[i].Pointer,
+ AcpiGbl_TableHandlerContext);
}
/*
diff --git a/src/acpica/source/components/tables/tbxfroot.c b/src/acpica/source/components/tables/tbxfroot.c
index 45d7d54..582ff67 100644
--- a/src/acpica/source/components/tables/tbxfroot.c
+++ b/src/acpica/source/components/tables/tbxfroot.c
@@ -243,8 +243,8 @@ AcpiFindRootPointer (
/* 1a) Get the location of the Extended BIOS Data Area (EBDA) */
TablePtr = AcpiOsMapMemory (
- (ACPI_PHYSICAL_ADDRESS) ACPI_EBDA_PTR_LOCATION,
- ACPI_EBDA_PTR_LENGTH);
+ (ACPI_PHYSICAL_ADDRESS) ACPI_EBDA_PTR_LOCATION,
+ ACPI_EBDA_PTR_LENGTH);
if (!TablePtr)
{
ACPI_ERROR ((AE_INFO,
@@ -270,8 +270,8 @@ AcpiFindRootPointer (
* minimum of 1K length)
*/
TablePtr = AcpiOsMapMemory (
- (ACPI_PHYSICAL_ADDRESS) PhysicalAddress,
- ACPI_EBDA_WINDOW_SIZE);
+ (ACPI_PHYSICAL_ADDRESS) PhysicalAddress,
+ ACPI_EBDA_WINDOW_SIZE);
if (!TablePtr)
{
ACPI_ERROR ((AE_INFO,
@@ -281,14 +281,16 @@ AcpiFindRootPointer (
return_ACPI_STATUS (AE_NO_MEMORY);
}
- MemRover = AcpiTbScanMemoryForRsdp (TablePtr, ACPI_EBDA_WINDOW_SIZE);
+ MemRover = AcpiTbScanMemoryForRsdp (
+ TablePtr, ACPI_EBDA_WINDOW_SIZE);
AcpiOsUnmapMemory (TablePtr, ACPI_EBDA_WINDOW_SIZE);
if (MemRover)
{
/* Return the physical address */
- PhysicalAddress += (UINT32) ACPI_PTR_DIFF (MemRover, TablePtr);
+ PhysicalAddress +=
+ (UINT32) ACPI_PTR_DIFF (MemRover, TablePtr);
*TableAddress = (ACPI_PHYSICAL_ADDRESS) PhysicalAddress;
return_ACPI_STATUS (AE_OK);
@@ -299,8 +301,8 @@ AcpiFindRootPointer (
* 2) Search upper memory: 16-byte boundaries in E0000h-FFFFFh
*/
TablePtr = AcpiOsMapMemory (
- (ACPI_PHYSICAL_ADDRESS) ACPI_HI_RSDP_WINDOW_BASE,
- ACPI_HI_RSDP_WINDOW_SIZE);
+ (ACPI_PHYSICAL_ADDRESS) ACPI_HI_RSDP_WINDOW_BASE,
+ ACPI_HI_RSDP_WINDOW_SIZE);
if (!TablePtr)
{
@@ -311,7 +313,8 @@ AcpiFindRootPointer (
return_ACPI_STATUS (AE_NO_MEMORY);
}
- MemRover = AcpiTbScanMemoryForRsdp (TablePtr, ACPI_HI_RSDP_WINDOW_SIZE);
+ MemRover = AcpiTbScanMemoryForRsdp (
+ TablePtr, ACPI_HI_RSDP_WINDOW_SIZE);
AcpiOsUnmapMemory (TablePtr, ACPI_HI_RSDP_WINDOW_SIZE);
if (MemRover)
@@ -369,7 +372,8 @@ AcpiTbScanMemoryForRsdp (
{
/* The RSDP signature and checksum must both be correct */
- Status = AcpiTbValidateRsdp (ACPI_CAST_PTR (ACPI_TABLE_RSDP, MemRover));
+ Status = AcpiTbValidateRsdp (
+ ACPI_CAST_PTR (ACPI_TABLE_RSDP, MemRover));
if (ACPI_SUCCESS (Status))
{
/* Sig and checksum valid, we have found a real RSDP */
diff --git a/src/acpica/source/components/utilities/utaddress.c b/src/acpica/source/components/utilities/utaddress.c
index 9d65019..18f39bd 100644
--- a/src/acpica/source/components/utilities/utaddress.c
+++ b/src/acpica/source/components/utilities/utaddress.c
@@ -335,7 +335,7 @@ AcpiUtCheckAddressRange (
OverlapCount++;
if (Warn) /* Optional warning message */
{
- Pathname = AcpiNsGetExternalPathname (RangeInfo->RegionNode);
+ Pathname = AcpiNsGetNormalizedPathname (RangeInfo->RegionNode, TRUE);
ACPI_WARNING ((AE_INFO,
"%s range 0x%8.8X%8.8X-0x%8.8X%8.8X conflicts with OpRegion 0x%8.8X%8.8X-0x%8.8X%8.8X (%s)",
diff --git a/src/acpica/source/components/utilities/utalloc.c b/src/acpica/source/components/utilities/utalloc.c
index 62c3e28..22ebf3e 100644
--- a/src/acpica/source/components/utilities/utalloc.c
+++ b/src/acpica/source/components/utilities/utalloc.c
@@ -182,35 +182,35 @@ AcpiUtCreateCaches (
/* Object Caches, for frequently used objects */
Status = AcpiOsCreateCache ("Acpi-Namespace", sizeof (ACPI_NAMESPACE_NODE),
- ACPI_MAX_NAMESPACE_CACHE_DEPTH, &AcpiGbl_NamespaceCache);
+ ACPI_MAX_NAMESPACE_CACHE_DEPTH, &AcpiGbl_NamespaceCache);
if (ACPI_FAILURE (Status))
{
return (Status);
}
Status = AcpiOsCreateCache ("Acpi-State", sizeof (ACPI_GENERIC_STATE),
- ACPI_MAX_STATE_CACHE_DEPTH, &AcpiGbl_StateCache);
+ ACPI_MAX_STATE_CACHE_DEPTH, &AcpiGbl_StateCache);
if (ACPI_FAILURE (Status))
{
return (Status);
}
Status = AcpiOsCreateCache ("Acpi-Parse", sizeof (ACPI_PARSE_OBJ_COMMON),
- ACPI_MAX_PARSE_CACHE_DEPTH, &AcpiGbl_PsNodeCache);
+ ACPI_MAX_PARSE_CACHE_DEPTH, &AcpiGbl_PsNodeCache);
if (ACPI_FAILURE (Status))
{
return (Status);
}
Status = AcpiOsCreateCache ("Acpi-ParseExt", sizeof (ACPI_PARSE_OBJ_NAMED),
- ACPI_MAX_EXTPARSE_CACHE_DEPTH, &AcpiGbl_PsNodeExtCache);
+ ACPI_MAX_EXTPARSE_CACHE_DEPTH, &AcpiGbl_PsNodeExtCache);
if (ACPI_FAILURE (Status))
{
return (Status);
}
Status = AcpiOsCreateCache ("Acpi-Operand", sizeof (ACPI_OPERAND_OBJECT),
- ACPI_MAX_OBJECT_CACHE_DEPTH, &AcpiGbl_OperandCache);
+ ACPI_MAX_OBJECT_CACHE_DEPTH, &AcpiGbl_OperandCache);
if (ACPI_FAILURE (Status))
{
return (Status);
@@ -222,14 +222,14 @@ AcpiUtCreateCaches (
/* Memory allocation lists */
Status = AcpiUtCreateList ("Acpi-Global", 0,
- &AcpiGbl_GlobalList);
+ &AcpiGbl_GlobalList);
if (ACPI_FAILURE (Status))
{
return (Status);
}
Status = AcpiUtCreateList ("Acpi-Namespace", sizeof (ACPI_NAMESPACE_NODE),
- &AcpiGbl_NsNodeList);
+ &AcpiGbl_NsNodeList);
if (ACPI_FAILURE (Status))
{
return (Status);
@@ -259,6 +259,7 @@ AcpiUtDeleteCaches (
#ifdef ACPI_DBG_TRACK_ALLOCATIONS
char Buffer[7];
+
if (AcpiGbl_DisplayFinalMemStats)
{
strcpy (Buffer, "MEMORY");
diff --git a/src/acpica/source/components/utilities/utcache.c b/src/acpica/source/components/utilities/utcache.c
index 5cf5250..b0cf6b0 100644
--- a/src/acpica/source/components/utilities/utcache.c
+++ b/src/acpica/source/components/utilities/utcache.c
@@ -165,9 +165,9 @@ AcpiOsCreateCache (
/* Populate the cache object and return it */
memset (Cache, 0, sizeof (ACPI_MEMORY_LIST));
- Cache->ListName = CacheName;
+ Cache->ListName = CacheName;
Cache->ObjectSize = ObjectSize;
- Cache->MaxDepth = MaxDepth;
+ Cache->MaxDepth = MaxDepth;
*ReturnCache = Cache;
return (AE_OK);
diff --git a/src/acpica/source/components/utilities/utcopy.c b/src/acpica/source/components/utilities/utcopy.c
index bc77787..5ba4a22 100644
--- a/src/acpica/source/components/utilities/utcopy.c
+++ b/src/acpica/source/components/utilities/utcopy.c
@@ -235,7 +235,7 @@ AcpiUtCopyIsimpleToEsimple (
ExternalObject->String.Pointer = (char *) DataSpace;
ExternalObject->String.Length = InternalObject->String.Length;
*BufferSpaceUsed = ACPI_ROUND_UP_TO_NATIVE_WORD (
- (ACPI_SIZE) InternalObject->String.Length + 1);
+ (ACPI_SIZE) InternalObject->String.Length + 1);
memcpy ((void *) DataSpace,
(void *) InternalObject->String.Pointer,
@@ -247,7 +247,7 @@ AcpiUtCopyIsimpleToEsimple (
ExternalObject->Buffer.Pointer = DataSpace;
ExternalObject->Buffer.Length = InternalObject->Buffer.Length;
*BufferSpaceUsed = ACPI_ROUND_UP_TO_NATIVE_WORD (
- InternalObject->String.Length);
+ InternalObject->String.Length);
memcpy ((void *) DataSpace,
(void *) InternalObject->Buffer.Pointer,
@@ -347,9 +347,9 @@ AcpiUtCopyIelementToEelement (
ACPI_FUNCTION_ENTRY ();
- ThisIndex = State->Pkg.Index;
- TargetObject = (ACPI_OBJECT *)
- &((ACPI_OBJECT *)(State->Pkg.DestObject))->Package.Elements[ThisIndex];
+ ThisIndex = State->Pkg.Index;
+ TargetObject = (ACPI_OBJECT *) &((ACPI_OBJECT *)
+ (State->Pkg.DestObject))->Package.Elements[ThisIndex];
switch (ObjectType)
{
@@ -358,7 +358,7 @@ AcpiUtCopyIelementToEelement (
* This is a simple or null object
*/
Status = AcpiUtCopyIsimpleToEsimple (SourceObject,
- TargetObject, Info->FreeSpace, &ObjectSpace);
+ TargetObject, Info->FreeSpace, &ObjectSpace);
if (ACPI_FAILURE (Status))
{
return (Status);
@@ -369,9 +369,9 @@ AcpiUtCopyIelementToEelement (
/*
* Build the package object
*/
- TargetObject->Type = ACPI_TYPE_PACKAGE;
- TargetObject->Package.Count = SourceObject->Package.Count;
- TargetObject->Package.Elements =
+ TargetObject->Type = ACPI_TYPE_PACKAGE;
+ TargetObject->Package.Count = SourceObject->Package.Count;
+ TargetObject->Package.Elements =
ACPI_CAST_PTR (ACPI_OBJECT, Info->FreeSpace);
/*
@@ -384,8 +384,8 @@ AcpiUtCopyIelementToEelement (
* update the buffer length counter
*/
ObjectSpace = ACPI_ROUND_UP_TO_NATIVE_WORD (
- (ACPI_SIZE) TargetObject->Package.Count *
- sizeof (ACPI_OBJECT));
+ (ACPI_SIZE) TargetObject->Package.Count *
+ sizeof (ACPI_OBJECT));
break;
default:
@@ -393,8 +393,8 @@ AcpiUtCopyIelementToEelement (
return (AE_BAD_PARAMETER);
}
- Info->FreeSpace += ObjectSpace;
- Info->Length += ObjectSpace;
+ Info->FreeSpace += ObjectSpace;
+ Info->Length += ObjectSpace;
return (Status);
}
@@ -440,28 +440,28 @@ AcpiUtCopyIpackageToEpackage (
/*
* Free space begins right after the first package
*/
- Info.Length = ACPI_ROUND_UP_TO_NATIVE_WORD (sizeof (ACPI_OBJECT));
- Info.FreeSpace = Buffer + ACPI_ROUND_UP_TO_NATIVE_WORD (
- sizeof (ACPI_OBJECT));
+ Info.Length = ACPI_ROUND_UP_TO_NATIVE_WORD (sizeof (ACPI_OBJECT));
+ Info.FreeSpace = Buffer +
+ ACPI_ROUND_UP_TO_NATIVE_WORD (sizeof (ACPI_OBJECT));
Info.ObjectSpace = 0;
Info.NumPackages = 1;
- ExternalObject->Type = InternalObject->Common.Type;
- ExternalObject->Package.Count = InternalObject->Package.Count;
- ExternalObject->Package.Elements = ACPI_CAST_PTR (ACPI_OBJECT,
- Info.FreeSpace);
+ ExternalObject->Type = InternalObject->Common.Type;
+ ExternalObject->Package.Count = InternalObject->Package.Count;
+ ExternalObject->Package.Elements =
+ ACPI_CAST_PTR (ACPI_OBJECT, Info.FreeSpace);
/*
* Leave room for an array of ACPI_OBJECTS in the buffer
* and move the free space past it
*/
- Info.Length += (ACPI_SIZE) ExternalObject->Package.Count *
- ACPI_ROUND_UP_TO_NATIVE_WORD (sizeof (ACPI_OBJECT));
+ Info.Length += (ACPI_SIZE) ExternalObject->Package.Count *
+ ACPI_ROUND_UP_TO_NATIVE_WORD (sizeof (ACPI_OBJECT));
Info.FreeSpace += ExternalObject->Package.Count *
- ACPI_ROUND_UP_TO_NATIVE_WORD (sizeof (ACPI_OBJECT));
+ ACPI_ROUND_UP_TO_NATIVE_WORD (sizeof (ACPI_OBJECT));
Status = AcpiUtWalkPackageTree (InternalObject, ExternalObject,
- AcpiUtCopyIelementToEelement, &Info);
+ AcpiUtCopyIelementToEelement, &Info);
*SpaceUsed = Info.Length;
return_ACPI_STATUS (Status);
@@ -500,7 +500,7 @@ AcpiUtCopyIobjectToEobject (
* nested packages)
*/
Status = AcpiUtCopyIpackageToEpackage (InternalObject,
- RetBuffer->Pointer, &RetBuffer->Length);
+ RetBuffer->Pointer, &RetBuffer->Length);
}
else
{
@@ -508,10 +508,10 @@ AcpiUtCopyIobjectToEobject (
* Build a simple object (no nested objects)
*/
Status = AcpiUtCopyIsimpleToEsimple (InternalObject,
- ACPI_CAST_PTR (ACPI_OBJECT, RetBuffer->Pointer),
- ACPI_ADD_PTR (UINT8, RetBuffer->Pointer,
- ACPI_ROUND_UP_TO_NATIVE_WORD (sizeof (ACPI_OBJECT))),
- &RetBuffer->Length);
+ ACPI_CAST_PTR (ACPI_OBJECT, RetBuffer->Pointer),
+ ACPI_ADD_PTR (UINT8, RetBuffer->Pointer,
+ ACPI_ROUND_UP_TO_NATIVE_WORD (sizeof (ACPI_OBJECT))),
+ &RetBuffer->Length);
/*
* build simple does not include the object size in the length
* so we add it in here
@@ -561,7 +561,7 @@ AcpiUtCopyEsimpleToIsimple (
case ACPI_TYPE_LOCAL_REFERENCE:
InternalObject = AcpiUtCreateInternalObject (
- (UINT8) ExternalObject->Type);
+ (UINT8) ExternalObject->Type);
if (!InternalObject)
{
return_ACPI_STATUS (AE_NO_MEMORY);
@@ -601,10 +601,10 @@ AcpiUtCopyEsimpleToIsimple (
}
memcpy (InternalObject->String.Pointer,
- ExternalObject->String.Pointer,
- ExternalObject->String.Length);
+ ExternalObject->String.Pointer,
+ ExternalObject->String.Length);
- InternalObject->String.Length = ExternalObject->String.Length;
+ InternalObject->String.Length = ExternalObject->String.Length;
break;
case ACPI_TYPE_BUFFER:
@@ -617,10 +617,10 @@ AcpiUtCopyEsimpleToIsimple (
}
memcpy (InternalObject->Buffer.Pointer,
- ExternalObject->Buffer.Pointer,
- ExternalObject->Buffer.Length);
+ ExternalObject->Buffer.Pointer,
+ ExternalObject->Buffer.Length);
- InternalObject->Buffer.Length = ExternalObject->Buffer.Length;
+ InternalObject->Buffer.Length = ExternalObject->Buffer.Length;
/* Mark buffer data valid */
@@ -629,7 +629,7 @@ AcpiUtCopyEsimpleToIsimple (
case ACPI_TYPE_INTEGER:
- InternalObject->Integer.Value = ExternalObject->Integer.Value;
+ InternalObject->Integer.Value = ExternalObject->Integer.Value;
break;
case ACPI_TYPE_LOCAL_REFERENCE:
@@ -687,7 +687,8 @@ AcpiUtCopyEpackageToIpackage (
/* Create the package object */
- PackageObject = AcpiUtCreatePackageObject (ExternalObject->Package.Count);
+ PackageObject = AcpiUtCreatePackageObject (
+ ExternalObject->Package.Count);
if (!PackageObject)
{
return_ACPI_STATUS (AE_NO_MEMORY);
@@ -696,14 +697,14 @@ AcpiUtCopyEpackageToIpackage (
PackageElements = PackageObject->Package.Elements;
/*
- * Recursive implementation. Probably ok, since nested external packages
- * as parameters should be very rare.
+ * Recursive implementation. Probably ok, since nested external
+ * packages as parameters should be very rare.
*/
for (i = 0; i < ExternalObject->Package.Count; i++)
{
Status = AcpiUtCopyEobjectToIobject (
- &ExternalObject->Package.Elements[i],
- &PackageElements[i]);
+ &ExternalObject->Package.Elements[i],
+ &PackageElements[i]);
if (ACPI_FAILURE (Status))
{
/* Truncate package and delete it */
@@ -750,14 +751,16 @@ AcpiUtCopyEobjectToIobject (
if (ExternalObject->Type == ACPI_TYPE_PACKAGE)
{
- Status = AcpiUtCopyEpackageToIpackage (ExternalObject, InternalObject);
+ Status = AcpiUtCopyEpackageToIpackage (
+ ExternalObject, InternalObject);
}
else
{
/*
* Build a simple object (no nested objects)
*/
- Status = AcpiUtCopyEsimpleToIsimple (ExternalObject, InternalObject);
+ Status = AcpiUtCopyEsimpleToIsimple (ExternalObject,
+ InternalObject);
}
return_ACPI_STATUS (Status);
@@ -908,7 +911,7 @@ AcpiUtCopySimpleObject (
case ACPI_TYPE_EVENT:
Status = AcpiOsCreateSemaphore (ACPI_NO_UNIT_LIMIT, 0,
- &DestDesc->Event.OsSemaphore);
+ &DestDesc->Event.OsSemaphore);
if (ACPI_FAILURE (Status))
{
return (Status);
@@ -954,9 +957,9 @@ AcpiUtCopyIelementToIelement (
ACPI_FUNCTION_ENTRY ();
- ThisIndex = State->Pkg.Index;
+ ThisIndex = State->Pkg.Index;
ThisTargetPtr = (ACPI_OPERAND_OBJECT **)
- &State->Pkg.DestObject->Package.Elements[ThisIndex];
+ &State->Pkg.DestObject->Package.Elements[ThisIndex];
switch (ObjectType)
{
@@ -970,7 +973,7 @@ AcpiUtCopyIelementToIelement (
* This is a simple object, just copy it
*/
TargetObject = AcpiUtCreateInternalObject (
- SourceObject->Common.Type);
+ SourceObject->Common.Type);
if (!TargetObject)
{
return (AE_NO_MEMORY);
@@ -997,7 +1000,8 @@ AcpiUtCopyIelementToIelement (
* This object is a package - go down another nesting level
* Create and build the package object
*/
- TargetObject = AcpiUtCreatePackageObject (SourceObject->Package.Count);
+ TargetObject = AcpiUtCreatePackageObject (
+ SourceObject->Package.Count);
if (!TargetObject)
{
return (AE_NO_MEMORY);
@@ -1054,16 +1058,16 @@ AcpiUtCopyIpackageToIpackage (
ACPI_FUNCTION_TRACE (UtCopyIpackageToIpackage);
- DestObj->Common.Type = SourceObj->Common.Type;
- DestObj->Common.Flags = SourceObj->Common.Flags;
- DestObj->Package.Count = SourceObj->Package.Count;
+ DestObj->Common.Type = SourceObj->Common.Type;
+ DestObj->Common.Flags = SourceObj->Common.Flags;
+ DestObj->Package.Count = SourceObj->Package.Count;
/*
* Create the object array and walk the source package tree
*/
DestObj->Package.Elements = ACPI_ALLOCATE_ZEROED (
- ((ACPI_SIZE) SourceObj->Package.Count + 1) *
- sizeof (void *));
+ ((ACPI_SIZE) SourceObj->Package.Count + 1) *
+ sizeof (void *));
if (!DestObj->Package.Elements)
{
ACPI_ERROR ((AE_INFO, "Package allocation failure"));
@@ -1075,7 +1079,7 @@ AcpiUtCopyIpackageToIpackage (
* This handles nested packages of arbitrary depth.
*/
Status = AcpiUtWalkPackageTree (SourceObj, DestObj,
- AcpiUtCopyIelementToIelement, WalkState);
+ AcpiUtCopyIelementToIelement, WalkState);
if (ACPI_FAILURE (Status))
{
/* On failure, delete the destination package object */
@@ -1125,8 +1129,8 @@ AcpiUtCopyIobjectToIobject (
if (SourceDesc->Common.Type == ACPI_TYPE_PACKAGE)
{
- Status = AcpiUtCopyIpackageToIpackage (SourceDesc, *DestDesc,
- WalkState);
+ Status = AcpiUtCopyIpackageToIpackage (
+ SourceDesc, *DestDesc, WalkState);
}
else
{
@@ -1137,7 +1141,7 @@ AcpiUtCopyIobjectToIobject (
if (ACPI_FAILURE (Status))
{
- AcpiUtRemoveReference(*DestDesc);
+ AcpiUtRemoveReference (*DestDesc);
}
return_ACPI_STATUS (Status);
diff --git a/src/acpica/source/components/utilities/utdecode.c b/src/acpica/source/components/utilities/utdecode.c
index 99468d5..3d927f5 100644
--- a/src/acpica/source/components/utilities/utdecode.c
+++ b/src/acpica/source/components/utilities/utdecode.c
@@ -191,7 +191,7 @@ const char *AcpiGbl_RegionTypes[ACPI_NUM_PREDEFINED_REGIONS] =
};
-char *
+const char *
AcpiUtGetRegionName (
UINT8 SpaceId)
{
@@ -213,7 +213,7 @@ AcpiUtGetRegionName (
return ("InvalidSpaceId");
}
- return (ACPI_CAST_PTR (char, AcpiGbl_RegionTypes[SpaceId]));
+ return (AcpiGbl_RegionTypes[SpaceId]);
}
@@ -241,7 +241,7 @@ static const char *AcpiGbl_EventTypes[ACPI_NUM_FIXED_EVENTS] =
};
-char *
+const char *
AcpiUtGetEventName (
UINT32 EventId)
{
@@ -251,7 +251,7 @@ AcpiUtGetEventName (
return ("InvalidEventID");
}
- return (ACPI_CAST_PTR (char, AcpiGbl_EventTypes[EventId]));
+ return (AcpiGbl_EventTypes[EventId]);
}
@@ -273,7 +273,8 @@ AcpiUtGetEventName (
*
* The type ACPI_TYPE_ANY (Untyped) is used as a "don't care" when searching;
* when stored in a table it really means that we have thus far seen no
- * evidence to indicate what type is actually going to be stored for this entry.
+ * evidence to indicate what type is actually going to be stored for this
+ & entry.
*/
static const char AcpiGbl_BadType[] = "UNDEFINED";
@@ -315,21 +316,21 @@ static const char *AcpiGbl_NsTypeNames[] =
};
-char *
+const char *
AcpiUtGetTypeName (
ACPI_OBJECT_TYPE Type)
{
if (Type > ACPI_TYPE_INVALID)
{
- return (ACPI_CAST_PTR (char, AcpiGbl_BadType));
+ return (AcpiGbl_BadType);
}
- return (ACPI_CAST_PTR (char, AcpiGbl_NsTypeNames[Type]));
+ return (AcpiGbl_NsTypeNames[Type]);
}
-char *
+const char *
AcpiUtGetObjectTypeName (
ACPI_OPERAND_OBJECT *ObjDesc)
{
@@ -371,7 +372,7 @@ AcpiUtGetObjectTypeName (
*
******************************************************************************/
-char *
+const char *
AcpiUtGetNodeName (
void *Object)
{
@@ -447,7 +448,7 @@ static const char *AcpiGbl_DescTypeNames[] =
};
-char *
+const char *
AcpiUtGetDescriptorName (
void *Object)
{
@@ -462,9 +463,7 @@ AcpiUtGetDescriptorName (
return ("Not a Descriptor");
}
- return (ACPI_CAST_PTR (char,
- AcpiGbl_DescTypeNames[ACPI_GET_DESCRIPTOR_TYPE (Object)]));
-
+ return (AcpiGbl_DescTypeNames[ACPI_GET_DESCRIPTOR_TYPE (Object)]);
}
@@ -541,7 +540,7 @@ AcpiUtGetReferenceName (
/* Names for internal mutex objects, used for debug output */
-static char *AcpiGbl_MutexNames[ACPI_NUM_MUTEX] =
+static const char *AcpiGbl_MutexNames[ACPI_NUM_MUTEX] =
{
"ACPI_MTX_Interpreter",
"ACPI_MTX_Namespace",
@@ -551,7 +550,7 @@ static char *AcpiGbl_MutexNames[ACPI_NUM_MUTEX] =
"ACPI_MTX_Memory",
};
-char *
+const char *
AcpiUtGetMutexName (
UINT32 MutexId)
{
diff --git a/src/acpica/source/components/utilities/utdelete.c b/src/acpica/source/components/utilities/utdelete.c
index 8a55c8e..4fa093c 100644
--- a/src/acpica/source/components/utilities/utdelete.c
+++ b/src/acpica/source/components/utilities/utdelete.c
@@ -292,6 +292,7 @@ AcpiUtDeleteInternalObj (
AcpiUtDeleteObjectDesc (Object->Method.Mutex);
Object->Method.Mutex = NULL;
}
+
if (Object->Method.Node)
{
Object->Method.Node = NULL;
@@ -625,8 +626,8 @@ AcpiUtUpdateObjectReference (
}
/*
- * All sub-objects must have their reference count incremented also.
- * Different object types have different subobjects.
+ * All sub-objects must have their reference count incremented
+ * also. Different object types have different subobjects.
*/
switch (Object->Common.Type)
{
@@ -686,7 +687,7 @@ AcpiUtUpdateObjectReference (
* for later processing (this eliminates recursion.)
*/
Status = AcpiUtCreateUpdateStateAndPush (
- NextObject, Action, &StateList);
+ NextObject, Action, &StateList);
if (ACPI_FAILURE (Status))
{
goto ErrorExit;
@@ -711,7 +712,7 @@ AcpiUtUpdateObjectReference (
NextObject = Object->BankField.BankObj;
Status = AcpiUtCreateUpdateStateAndPush (
- Object->BankField.RegionObj, Action, &StateList);
+ Object->BankField.RegionObj, Action, &StateList);
if (ACPI_FAILURE (Status))
{
goto ErrorExit;
@@ -722,7 +723,7 @@ AcpiUtUpdateObjectReference (
NextObject = Object->IndexField.IndexObj;
Status = AcpiUtCreateUpdateStateAndPush (
- Object->IndexField.DataObj, Action, &StateList);
+ Object->IndexField.DataObj, Action, &StateList);
if (ACPI_FAILURE (Status))
{
goto ErrorExit;
diff --git a/src/acpica/source/components/utilities/uterror.c b/src/acpica/source/components/utilities/uterror.c
index 52b9ae0..cd8b913 100644
--- a/src/acpica/source/components/utilities/uterror.c
+++ b/src/acpica/source/components/utilities/uterror.c
@@ -316,8 +316,8 @@ AcpiUtNamespaceError (
{
/* Convert path to external format */
- Status = AcpiNsExternalizeName (ACPI_UINT32_MAX,
- InternalName, NULL, &Name);
+ Status = AcpiNsExternalizeName (
+ ACPI_UINT32_MAX, InternalName, NULL, &Name);
/* Print target name */
@@ -379,8 +379,8 @@ AcpiUtMethodError (
if (Path)
{
- Status = AcpiNsGetNode (PrefixNode, Path, ACPI_NS_NO_UPSEARCH,
- &Node);
+ Status = AcpiNsGetNode (PrefixNode, Path,
+ ACPI_NS_NO_UPSEARCH, &Node);
if (ACPI_FAILURE (Status))
{
AcpiOsPrintf ("[Could not get node by pathname]");
diff --git a/src/acpica/source/components/utilities/uteval.c b/src/acpica/source/components/utilities/uteval.c
index dd754c0..81c155c 100644
--- a/src/acpica/source/components/utilities/uteval.c
+++ b/src/acpica/source/components/utilities/uteval.c
@@ -303,7 +303,7 @@ AcpiUtEvaluateNumericObject (
Status = AcpiUtEvaluateObject (DeviceNode, ObjectName,
- ACPI_BTYPE_INTEGER, &ObjDesc);
+ ACPI_BTYPE_INTEGER, &ObjDesc);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
@@ -350,7 +350,7 @@ AcpiUtExecute_STA (
Status = AcpiUtEvaluateObject (DeviceNode, METHOD_NAME__STA,
- ACPI_BTYPE_INTEGER, &ObjDesc);
+ ACPI_BTYPE_INTEGER, &ObjDesc);
if (ACPI_FAILURE (Status))
{
if (AE_NOT_FOUND == Status)
@@ -423,8 +423,8 @@ AcpiUtExecutePowerMethods (
* return type is an Integer.
*/
Status = AcpiUtEvaluateObject (DeviceNode,
- ACPI_CAST_PTR (char, MethodNames[i]),
- ACPI_BTYPE_INTEGER, &ObjDesc);
+ ACPI_CAST_PTR (char, MethodNames[i]),
+ ACPI_BTYPE_INTEGER, &ObjDesc);
if (ACPI_SUCCESS (Status))
{
OutValues[i] = (UINT8) ObjDesc->Integer.Value;
diff --git a/src/acpica/source/components/utilities/uthex.c b/src/acpica/source/components/utilities/uthex.c
index c652f6a..3a32003 100644
--- a/src/acpica/source/components/utilities/uthex.c
+++ b/src/acpica/source/components/utilities/uthex.c
@@ -122,7 +122,7 @@
/* Hex to ASCII conversion table */
-static char AcpiGbl_HexToAscii[] =
+static const char AcpiGbl_HexToAscii[] =
{
'0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F'
};
diff --git a/src/acpica/source/components/utilities/utids.c b/src/acpica/source/components/utilities/utids.c
index 3bb12f0..6d9a59f 100644
--- a/src/acpica/source/components/utilities/utids.c
+++ b/src/acpica/source/components/utilities/utids.c
@@ -155,7 +155,7 @@ AcpiUtExecute_HID (
Status = AcpiUtEvaluateObject (DeviceNode, METHOD_NAME__HID,
- ACPI_BTYPE_INTEGER | ACPI_BTYPE_STRING, &ObjDesc);
+ ACPI_BTYPE_INTEGER | ACPI_BTYPE_STRING, &ObjDesc);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
@@ -174,7 +174,8 @@ AcpiUtExecute_HID (
/* Allocate a buffer for the HID */
- Hid = ACPI_ALLOCATE_ZEROED (sizeof (ACPI_PNP_DEVICE_ID) + (ACPI_SIZE) Length);
+ Hid = ACPI_ALLOCATE_ZEROED (
+ sizeof (ACPI_PNP_DEVICE_ID) + (ACPI_SIZE) Length);
if (!Hid)
{
Status = AE_NO_MEMORY;
@@ -211,77 +212,6 @@ Cleanup:
/*******************************************************************************
*
- * FUNCTION: AcpiUtExecute_SUB
- *
- * PARAMETERS: DeviceNode - Node for the device
- * ReturnId - Where the _SUB is returned
- *
- * RETURN: Status
- *
- * DESCRIPTION: Executes the _SUB control method that returns the subsystem
- * ID of the device. The _SUB value is always a string containing
- * either a valid PNP or ACPI ID.
- *
- * NOTE: Internal function, no parameter validation
- *
- ******************************************************************************/
-
-ACPI_STATUS
-AcpiUtExecute_SUB (
- ACPI_NAMESPACE_NODE *DeviceNode,
- ACPI_PNP_DEVICE_ID **ReturnId)
-{
- ACPI_OPERAND_OBJECT *ObjDesc;
- ACPI_PNP_DEVICE_ID *Sub;
- UINT32 Length;
- ACPI_STATUS Status;
-
-
- ACPI_FUNCTION_TRACE (UtExecute_SUB);
-
-
- Status = AcpiUtEvaluateObject (DeviceNode, METHOD_NAME__SUB,
- ACPI_BTYPE_STRING, &ObjDesc);
- if (ACPI_FAILURE (Status))
- {
- return_ACPI_STATUS (Status);
- }
-
- /* Get the size of the String to be returned, includes null terminator */
-
- Length = ObjDesc->String.Length + 1;
-
- /* Allocate a buffer for the SUB */
-
- Sub = ACPI_ALLOCATE_ZEROED (sizeof (ACPI_PNP_DEVICE_ID) + (ACPI_SIZE) Length);
- if (!Sub)
- {
- Status = AE_NO_MEMORY;
- goto Cleanup;
- }
-
- /* Area for the string starts after PNP_DEVICE_ID struct */
-
- Sub->String = ACPI_ADD_PTR (char, Sub, sizeof (ACPI_PNP_DEVICE_ID));
-
- /* Simply copy existing string */
-
- strcpy (Sub->String, ObjDesc->String.Pointer);
- Sub->Length = Length;
- *ReturnId = Sub;
-
-
-Cleanup:
-
- /* On exit, we must delete the return object */
-
- AcpiUtRemoveReference (ObjDesc);
- return_ACPI_STATUS (Status);
-}
-
-
-/*******************************************************************************
- *
* FUNCTION: AcpiUtExecute_UID
*
* PARAMETERS: DeviceNode - Node for the device
@@ -313,7 +243,7 @@ AcpiUtExecute_UID (
Status = AcpiUtEvaluateObject (DeviceNode, METHOD_NAME__UID,
- ACPI_BTYPE_INTEGER | ACPI_BTYPE_STRING, &ObjDesc);
+ ACPI_BTYPE_INTEGER | ACPI_BTYPE_STRING, &ObjDesc);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
@@ -332,7 +262,8 @@ AcpiUtExecute_UID (
/* Allocate a buffer for the UID */
- Uid = ACPI_ALLOCATE_ZEROED (sizeof (ACPI_PNP_DEVICE_ID) + (ACPI_SIZE) Length);
+ Uid = ACPI_ALLOCATE_ZEROED (
+ sizeof (ACPI_PNP_DEVICE_ID) + (ACPI_SIZE) Length);
if (!Uid)
{
Status = AE_NO_MEMORY;
@@ -413,8 +344,8 @@ AcpiUtExecute_CID (
/* Evaluate the _CID method for this device */
Status = AcpiUtEvaluateObject (DeviceNode, METHOD_NAME__CID,
- ACPI_BTYPE_INTEGER | ACPI_BTYPE_STRING | ACPI_BTYPE_PACKAGE,
- &ObjDesc);
+ ACPI_BTYPE_INTEGER | ACPI_BTYPE_STRING | ACPI_BTYPE_PACKAGE,
+ &ObjDesc);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
@@ -491,7 +422,8 @@ AcpiUtExecute_CID (
{
/* Convert the Integer (EISAID) CID to a string */
- AcpiExEisaIdToString (NextIdString, CidObjects[i]->Integer.Value);
+ AcpiExEisaIdToString (
+ NextIdString, CidObjects[i]->Integer.Value);
Length = ACPI_EISAID_STRING_SIZE;
}
else /* ACPI_TYPE_STRING */
@@ -560,7 +492,7 @@ AcpiUtExecute_CLS (
Status = AcpiUtEvaluateObject (DeviceNode, METHOD_NAME__CLS,
- ACPI_BTYPE_PACKAGE, &ObjDesc);
+ ACPI_BTYPE_PACKAGE, &ObjDesc);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
@@ -590,7 +522,8 @@ AcpiUtExecute_CLS (
/* Allocate a buffer for the CLS */
- Cls = ACPI_ALLOCATE_ZEROED (sizeof (ACPI_PNP_DEVICE_ID) + (ACPI_SIZE) Length);
+ Cls = ACPI_ALLOCATE_ZEROED (
+ sizeof (ACPI_PNP_DEVICE_ID) + (ACPI_SIZE) Length);
if (!Cls)
{
Status = AE_NO_MEMORY;
diff --git a/src/acpica/source/components/utilities/utinit.c b/src/acpica/source/components/utilities/utinit.c
index ed090f1..ee14368 100644
--- a/src/acpica/source/components/utilities/utinit.c
+++ b/src/acpica/source/components/utilities/utinit.c
@@ -334,8 +334,6 @@ AcpiUtInitGlobals (
AcpiGbl_DisableMemTracking = FALSE;
#endif
- ACPI_DEBUGGER_EXEC (AcpiGbl_DbTerminateThreads = FALSE);
-
return_ACPI_STATUS (AE_OK);
}
@@ -384,6 +382,20 @@ AcpiUtSubsystemShutdown (
ACPI_FUNCTION_TRACE (UtSubsystemShutdown);
+ /* Just exit if subsystem is already shutdown */
+
+ if (AcpiGbl_Shutdown)
+ {
+ ACPI_ERROR ((AE_INFO, "ACPI Subsystem is already terminated"));
+ return_VOID;
+ }
+
+ /* Subsystem appears active, go ahead and shut it down */
+
+ AcpiGbl_Shutdown = TRUE;
+ AcpiGbl_StartupFlags = 0;
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Shutting down ACPI Subsystem\n"));
+
#ifndef ACPI_ASL_COMPILER
/* Close the AcpiEvent Handling */
diff --git a/src/acpica/source/components/utilities/utmath.c b/src/acpica/source/components/utilities/utmath.c
index dafba6d..b8d0422 100644
--- a/src/acpica/source/components/utilities/utmath.c
+++ b/src/acpica/source/components/utilities/utmath.c
@@ -194,9 +194,10 @@ AcpiUtShortDivide (
* and is generated by the second divide.
*/
ACPI_DIV_64_BY_32 (0, DividendOvl.Part.Hi, Divisor,
- Quotient.Part.Hi, Remainder32);
+ Quotient.Part.Hi, Remainder32);
+
ACPI_DIV_64_BY_32 (Remainder32, DividendOvl.Part.Lo, Divisor,
- Quotient.Part.Lo, Remainder32);
+ Quotient.Part.Lo, Remainder32);
/* Return only what was requested */
@@ -272,9 +273,10 @@ AcpiUtDivide (
* and is generated by the second divide.
*/
ACPI_DIV_64_BY_32 (0, Dividend.Part.Hi, Divisor.Part.Lo,
- Quotient.Part.Hi, Partial1);
+ Quotient.Part.Hi, Partial1);
+
ACPI_DIV_64_BY_32 (Partial1, Dividend.Part.Lo, Divisor.Part.Lo,
- Quotient.Part.Lo, Remainder.Part.Lo);
+ Quotient.Part.Lo, Remainder.Part.Lo);
}
else
@@ -291,25 +293,24 @@ AcpiUtDivide (
do
{
- ACPI_SHIFT_RIGHT_64 (NormalizedDivisor.Part.Hi,
- NormalizedDivisor.Part.Lo);
- ACPI_SHIFT_RIGHT_64 (NormalizedDividend.Part.Hi,
- NormalizedDividend.Part.Lo);
+ ACPI_SHIFT_RIGHT_64 (
+ NormalizedDivisor.Part.Hi, NormalizedDivisor.Part.Lo);
+ ACPI_SHIFT_RIGHT_64 (
+ NormalizedDividend.Part.Hi, NormalizedDividend.Part.Lo);
} while (NormalizedDivisor.Part.Hi != 0);
/* Partial divide */
- ACPI_DIV_64_BY_32 (NormalizedDividend.Part.Hi,
- NormalizedDividend.Part.Lo,
- NormalizedDivisor.Part.Lo,
- Quotient.Part.Lo, Partial1);
+ ACPI_DIV_64_BY_32 (
+ NormalizedDividend.Part.Hi, NormalizedDividend.Part.Lo,
+ NormalizedDivisor.Part.Lo, Quotient.Part.Lo, Partial1);
/*
- * The quotient is always 32 bits, and simply requires adjustment.
- * The 64-bit remainder must be generated.
+ * The quotient is always 32 bits, and simply requires
+ * adjustment. The 64-bit remainder must be generated.
*/
- Partial1 = Quotient.Part.Lo * Divisor.Part.Hi;
+ Partial1 = Quotient.Part.Lo * Divisor.Part.Hi;
Partial2.Full = (UINT64) Quotient.Part.Lo * Divisor.Part.Lo;
Partial3.Full = (UINT64) Partial2.Part.Hi + Partial1;
@@ -335,7 +336,7 @@ AcpiUtDivide (
}
}
- Remainder.Full = Remainder.Full - Dividend.Full;
+ Remainder.Full = Remainder.Full - Dividend.Full;
Remainder.Part.Hi = (UINT32) -((INT32) Remainder.Part.Hi);
Remainder.Part.Lo = (UINT32) -((INT32) Remainder.Part.Lo);
diff --git a/src/acpica/source/components/utilities/utmisc.c b/src/acpica/source/components/utilities/utmisc.c
index ecf22db..4a248d7 100644
--- a/src/acpica/source/components/utilities/utmisc.c
+++ b/src/acpica/source/components/utilities/utmisc.c
@@ -144,10 +144,10 @@ AcpiUtIsPciRootBridge (
* ACPI 3.0+: check for a PCI Express root also.
*/
if (!(strcmp (Id,
- PCI_ROOT_HID_STRING)) ||
+ PCI_ROOT_HID_STRING)) ||
!(strcmp (Id,
- PCI_EXPRESS_ROOT_HID_STRING)))
+ PCI_EXPRESS_ROOT_HID_STRING)))
{
return (TRUE);
}
@@ -257,17 +257,17 @@ AcpiUtSetIntegerWidth (
{
/* 32-bit case */
- AcpiGbl_IntegerBitWidth = 32;
+ AcpiGbl_IntegerBitWidth = 32;
AcpiGbl_IntegerNybbleWidth = 8;
- AcpiGbl_IntegerByteWidth = 4;
+ AcpiGbl_IntegerByteWidth = 4;
}
else
{
/* 64-bit case (ACPI 2.0+) */
- AcpiGbl_IntegerBitWidth = 64;
+ AcpiGbl_IntegerBitWidth = 64;
AcpiGbl_IntegerNybbleWidth = 16;
- AcpiGbl_IntegerByteWidth = 8;
+ AcpiGbl_IntegerByteWidth = 8;
}
}
@@ -358,9 +358,9 @@ AcpiUtWalkPackageTree (
{
/* Get one element of the package */
- ThisIndex = State->Pkg.Index;
+ ThisIndex = State->Pkg.Index;
ThisSourceObj = (ACPI_OPERAND_OBJECT *)
- State->Pkg.SourceObject->Package.Elements[ThisIndex];
+ State->Pkg.SourceObject->Package.Elements[ThisIndex];
/*
* Check for:
@@ -371,7 +371,8 @@ AcpiUtWalkPackageTree (
* case below.
*/
if ((!ThisSourceObj) ||
- (ACPI_GET_DESCRIPTOR_TYPE (ThisSourceObj) != ACPI_DESC_TYPE_OPERAND) ||
+ (ACPI_GET_DESCRIPTOR_TYPE (ThisSourceObj) !=
+ ACPI_DESC_TYPE_OPERAND) ||
(ThisSourceObj->Common.Type != ACPI_TYPE_PACKAGE))
{
Status = WalkCallback (ACPI_COPY_TYPE_SIMPLE, ThisSourceObj,
@@ -382,7 +383,8 @@ AcpiUtWalkPackageTree (
}
State->Pkg.Index++;
- while (State->Pkg.Index >= State->Pkg.SourceObject->Package.Count)
+ while (State->Pkg.Index >=
+ State->Pkg.SourceObject->Package.Count)
{
/*
* We've handled all of the objects at this level, This means
@@ -417,8 +419,8 @@ AcpiUtWalkPackageTree (
{
/* This is a subobject of type package */
- Status = WalkCallback (ACPI_COPY_TYPE_PACKAGE, ThisSourceObj,
- State, Context);
+ Status = WalkCallback (
+ ACPI_COPY_TYPE_PACKAGE, ThisSourceObj, State, Context);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
@@ -429,8 +431,8 @@ AcpiUtWalkPackageTree (
* The callback above returned a new target package object.
*/
AcpiUtPushGenericState (&StateList, State);
- State = AcpiUtCreatePkgState (ThisSourceObj,
- State->Pkg.ThisTargetObj, 0);
+ State = AcpiUtCreatePkgState (
+ ThisSourceObj, State->Pkg.ThisTargetObj, 0);
if (!State)
{
/* Free any stacked Update State objects */
diff --git a/src/acpica/source/components/utilities/utmutex.c b/src/acpica/source/components/utilities/utmutex.c
index 0fa4c36..b07adea 100644
--- a/src/acpica/source/components/utilities/utmutex.c
+++ b/src/acpica/source/components/utilities/utmutex.c
@@ -401,11 +401,12 @@ AcpiUtAcquireMutex (
"Thread %u attempting to acquire Mutex [%s]\n",
(UINT32) ThisThreadId, AcpiUtGetMutexName (MutexId)));
- Status = AcpiOsAcquireMutex (AcpiGbl_MutexInfo[MutexId].Mutex,
- ACPI_WAIT_FOREVER);
+ Status = AcpiOsAcquireMutex (
+ AcpiGbl_MutexInfo[MutexId].Mutex, ACPI_WAIT_FOREVER);
if (ACPI_SUCCESS (Status))
{
- ACPI_DEBUG_PRINT ((ACPI_DB_MUTEX, "Thread %u acquired Mutex [%s]\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_MUTEX,
+ "Thread %u acquired Mutex [%s]\n",
(UINT32) ThisThreadId, AcpiUtGetMutexName (MutexId)));
AcpiGbl_MutexInfo[MutexId].UseCount++;
diff --git a/src/acpica/source/components/utilities/utnonansi.c b/src/acpica/source/components/utilities/utnonansi.c
index 01a4361..b69c494 100644
--- a/src/acpica/source/components/utilities/utnonansi.c
+++ b/src/acpica/source/components/utilities/utnonansi.c
@@ -404,8 +404,8 @@ AcpiUtStrtoul64 (
/* Divide the digit into the correct position */
- (void) AcpiUtShortDivide ((Dividend - (UINT64) ThisDigit),
- Base, &Quotient, NULL);
+ (void) AcpiUtShortDivide (
+ (Dividend - (UINT64) ThisDigit), Base, &Quotient, NULL);
if (ReturnValue > Quotient)
{
diff --git a/src/acpica/source/components/utilities/utobject.c b/src/acpica/source/components/utilities/utobject.c
index fb4efaf..8116b35 100644
--- a/src/acpica/source/components/utilities/utobject.c
+++ b/src/acpica/source/components/utilities/utobject.c
@@ -179,7 +179,8 @@ AcpiUtCreateInternalObjectDbg (
/* Allocate the raw object descriptor */
- Object = AcpiUtAllocateObjectDescDbg (ModuleName, LineNumber, ComponentId);
+ Object = AcpiUtAllocateObjectDescDbg (
+ ModuleName, LineNumber, ComponentId);
if (!Object)
{
return_PTR (NULL);
@@ -193,8 +194,8 @@ AcpiUtCreateInternalObjectDbg (
/* These types require a secondary object */
- SecondObject = AcpiUtAllocateObjectDescDbg (ModuleName,
- LineNumber, ComponentId);
+ SecondObject = AcpiUtAllocateObjectDescDbg (
+ ModuleName, LineNumber, ComponentId);
if (!SecondObject)
{
AcpiUtDeleteObjectDesc (Object);
@@ -265,7 +266,7 @@ AcpiUtCreatePackageObject (
* terminated.
*/
PackageElements = ACPI_ALLOCATE_ZEROED (
- ((ACPI_SIZE) Count + 1) * sizeof (void *));
+ ((ACPI_SIZE) Count + 1) * sizeof (void *));
if (!PackageElements)
{
ACPI_FREE (PackageDesc);
@@ -355,6 +356,7 @@ AcpiUtCreateBufferObject (
{
ACPI_ERROR ((AE_INFO, "Could not allocate size %u",
(UINT32) BufferSize));
+
AcpiUtRemoveReference (BufferDesc);
return_PTR (NULL);
}
@@ -414,6 +416,7 @@ AcpiUtCreateStringObject (
{
ACPI_ERROR ((AE_INFO, "Could not allocate size %u",
(UINT32) StringSize));
+
AcpiUtRemoveReference (StringDesc);
return_PTR (NULL);
}
@@ -470,8 +473,8 @@ AcpiUtValidInternalObject (
default:
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
- "%p is not an ACPI operand obj [%s]\n",
- Object, AcpiUtGetDescriptorName (Object)));
+ "%p is not an ACPI operand obj [%s]\n",
+ Object, AcpiUtGetDescriptorName (Object)));
break;
}
@@ -520,7 +523,7 @@ AcpiUtAllocateObjectDescDbg (
ACPI_SET_DESCRIPTOR_TYPE (Object, ACPI_DESC_TYPE_OPERAND);
ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS, "%p Size %X\n",
- Object, (UINT32) sizeof (ACPI_OPERAND_OBJECT)));
+ Object, (UINT32) sizeof (ACPI_OPERAND_OBJECT)));
return_PTR (Object);
}
@@ -783,12 +786,12 @@ AcpiUtGetPackageObjectSize (
ACPI_FUNCTION_TRACE_PTR (UtGetPackageObjectSize, InternalObject);
- Info.Length = 0;
+ Info.Length = 0;
Info.ObjectSpace = 0;
Info.NumPackages = 1;
- Status = AcpiUtWalkPackageTree (InternalObject, NULL,
- AcpiUtGetElementLength, &Info);
+ Status = AcpiUtWalkPackageTree (
+ InternalObject, NULL, AcpiUtGetElementLength, &Info);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
@@ -799,8 +802,8 @@ AcpiUtGetPackageObjectSize (
* just add the length of the package objects themselves.
* Round up to the next machine word.
*/
- Info.Length += ACPI_ROUND_UP_TO_NATIVE_WORD (sizeof (ACPI_OBJECT)) *
- (ACPI_SIZE) Info.NumPackages;
+ Info.Length += ACPI_ROUND_UP_TO_NATIVE_WORD (
+ sizeof (ACPI_OBJECT)) * (ACPI_SIZE) Info.NumPackages;
/* Return the total package length */
@@ -834,7 +837,8 @@ AcpiUtGetObjectSize (
ACPI_FUNCTION_ENTRY ();
- if ((ACPI_GET_DESCRIPTOR_TYPE (InternalObject) == ACPI_DESC_TYPE_OPERAND) &&
+ if ((ACPI_GET_DESCRIPTOR_TYPE (InternalObject) ==
+ ACPI_DESC_TYPE_OPERAND) &&
(InternalObject->Common.Type == ACPI_TYPE_PACKAGE))
{
Status = AcpiUtGetPackageObjectSize (InternalObject, ObjLength);
diff --git a/src/acpica/source/components/utilities/utosi.c b/src/acpica/source/components/utilities/utosi.c
index b4d8a71..930c45d 100644
--- a/src/acpica/source/components/utilities/utosi.c
+++ b/src/acpica/source/components/utilities/utosi.c
@@ -228,7 +228,9 @@ AcpiUtInitializeInterfaces (
/* Link the static list of supported interfaces */
- for (i = 0; i < (ACPI_ARRAY_LENGTH (AcpiDefaultSupportedInterfaces) - 1); i++)
+ for (i = 0;
+ i < (ACPI_ARRAY_LENGTH (AcpiDefaultSupportedInterfaces) - 1);
+ i++)
{
AcpiDefaultSupportedInterfaces[i].Next =
&AcpiDefaultSupportedInterfaces[(ACPI_SIZE) i + 1];
@@ -372,8 +374,10 @@ AcpiUtRemoveInterface (
{
if (!strcmp (InterfaceName, NextInterface->Name))
{
- /* Found: name is in either the static list or was added at runtime */
-
+ /*
+ * Found: name is in either the static list
+ * or was added at runtime
+ */
if (NextInterface->Flags & ACPI_OSI_DYNAMIC)
{
/* Interface was added dynamically, remove and free it */
@@ -393,8 +397,8 @@ AcpiUtRemoveInterface (
else
{
/*
- * Interface is in static list. If marked invalid, then it
- * does not actually exist. Else, mark it invalid.
+ * Interface is in static list. If marked invalid, then
+ * it does not actually exist. Else, mark it invalid.
*/
if (NextInterface->Flags & ACPI_OSI_INVALID)
{
diff --git a/src/acpica/source/components/utilities/utownerid.c b/src/acpica/source/components/utilities/utownerid.c
index bf391e1..25773a8 100644
--- a/src/acpica/source/components/utilities/utownerid.c
+++ b/src/acpica/source/components/utilities/utownerid.c
@@ -153,7 +153,8 @@ AcpiUtAllocateOwnerId (
if (*OwnerId)
{
- ACPI_ERROR ((AE_INFO, "Owner ID [0x%2.2X] already exists", *OwnerId));
+ ACPI_ERROR ((AE_INFO,
+ "Owner ID [0x%2.2X] already exists", *OwnerId));
return_ACPI_STATUS (AE_ALREADY_EXISTS);
}
@@ -167,8 +168,8 @@ AcpiUtAllocateOwnerId (
/*
* Find a free owner ID, cycle through all possible IDs on repeated
- * allocations. (ACPI_NUM_OWNERID_MASKS + 1) because first index may have
- * to be scanned twice.
+ * allocations. (ACPI_NUM_OWNERID_MASKS + 1) because first index
+ * may have to be scanned twice.
*/
for (i = 0, j = AcpiGbl_LastOwnerIdIndex;
i < (ACPI_NUM_OWNERID_MASKS + 1);
@@ -224,8 +225,8 @@ AcpiUtAllocateOwnerId (
* they are released when a table is unloaded or a method completes
* execution.
*
- * If this error happens, there may be very deep nesting of invoked control
- * methods, or there may be a bug where the IDs are not released.
+ * If this error happens, there may be very deep nesting of invoked
+ * control methods, or there may be a bug where the IDs are not released.
*/
Status = AE_OWNER_ID_LIMIT;
ACPI_ERROR ((AE_INFO,
diff --git a/src/acpica/source/components/utilities/utpredef.c b/src/acpica/source/components/utilities/utpredef.c
index 11471c7..e72fd88 100644
--- a/src/acpica/source/components/utilities/utpredef.c
+++ b/src/acpica/source/components/utilities/utpredef.c
@@ -326,8 +326,10 @@ AcpiUtMatchResourceName (
const ACPI_PREDEFINED_INFO *ThisName;
- /* Quick check for a predefined name, first character must be underscore */
-
+ /*
+ * Quick check for a predefined name, first character must
+ * be underscore
+ */
if (Name[0] != '_')
{
return (NULL);
diff --git a/src/acpica/source/components/utilities/utprint.c b/src/acpica/source/components/utilities/utprint.c
index b3e8fd2..02602dd 100644
--- a/src/acpica/source/components/utilities/utprint.c
+++ b/src/acpica/source/components/utilities/utprint.c
@@ -462,8 +462,8 @@ AcpiUtFormatNumber (
String = AcpiUtBoundStringOutput (String, End, '0');
if (Base == 16)
{
- String = AcpiUtBoundStringOutput (String, End,
- Upper ? 'X' : 'x');
+ String = AcpiUtBoundStringOutput (
+ String, End, Upper ? 'X' : 'x');
}
}
if (!(Type & ACPI_FORMAT_LEFT))
@@ -572,6 +572,7 @@ AcpiUtVsnprintf (
{
break;
}
+
} while (1);
/* Process width */
@@ -609,6 +610,7 @@ AcpiUtVsnprintf (
++Format;
Precision = va_arg (Args, int);
}
+
if (Precision < 0)
{
Precision = 0;
@@ -671,11 +673,13 @@ AcpiUtVsnprintf (
Pos = AcpiUtBoundStringOutput (Pos, End, ' ');
}
}
+
for (i = 0; i < Length; ++i)
{
Pos = AcpiUtBoundStringOutput (Pos, End, *s);
++s;
}
+
while (Length < Width--)
{
Pos = AcpiUtBoundStringOutput (Pos, End, ' ');
@@ -714,8 +718,8 @@ AcpiUtVsnprintf (
}
p = va_arg (Args, void *);
- Pos = AcpiUtFormatNumber (Pos, End,
- ACPI_TO_INTEGER (p), 16, Width, Precision, Type);
+ Pos = AcpiUtFormatNumber (
+ Pos, End, ACPI_TO_INTEGER (p), 16, Width, Precision, Type);
continue;
default:
@@ -766,7 +770,7 @@ AcpiUtVsnprintf (
}
Pos = AcpiUtFormatNumber (Pos, End, Number, Base,
- Width, Precision, Type);
+ Width, Precision, Type);
}
if (Size > 0)
@@ -845,7 +849,7 @@ AcpiUtFileVprintf (
Flags = AcpiOsAcquireLock (AcpiGbl_PrintLock);
Length = AcpiUtVsnprintf (AcpiGbl_PrintBuffer,
- sizeof (AcpiGbl_PrintBuffer), Format, Args);
+ sizeof (AcpiGbl_PrintBuffer), Format, Args);
(void) AcpiOsWriteFile (File, AcpiGbl_PrintBuffer, Length, 1);
AcpiOsReleaseLock (AcpiGbl_PrintLock, Flags);
diff --git a/src/acpica/source/components/utilities/utresrc.c b/src/acpica/source/components/utilities/utresrc.c
index 44a4c66..1657972 100644
--- a/src/acpica/source/components/utilities/utresrc.c
+++ b/src/acpica/source/components/utilities/utresrc.c
@@ -561,8 +561,8 @@ AcpiUtWalkAmlResources (
if (ACPI_FAILURE (Status))
{
/*
- * Exit on failure. Cannot continue because the descriptor length
- * may be bogus also.
+ * Exit on failure. Cannot continue because the descriptor
+ * length may be bogus also.
*/
return_ACPI_STATUS (Status);
}
@@ -575,7 +575,8 @@ AcpiUtWalkAmlResources (
if (UserFunction)
{
- Status = UserFunction (Aml, Length, Offset, ResourceIndex, Context);
+ Status = UserFunction (
+ Aml, Length, Offset, ResourceIndex, Context);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
@@ -697,8 +698,8 @@ AcpiUtValidateResource (
}
/*
- * Check validity of the resource type, via AcpiGbl_ResourceTypes. Zero
- * indicates an invalid resource.
+ * Check validity of the resource type, via AcpiGbl_ResourceTypes.
+ * Zero indicates an invalid resource.
*/
if (!AcpiGbl_ResourceTypes[ResourceIndex])
{
@@ -885,7 +886,7 @@ AcpiUtGetResourceLength (
/* Small Resource type -- bits 2:0 of byte 0 contain the length */
ResourceLength = (UINT16) (ACPI_GET8 (Aml) &
- ACPI_RESOURCE_NAME_SMALL_LENGTH_MASK);
+ ACPI_RESOURCE_NAME_SMALL_LENGTH_MASK);
}
return (ResourceLength);
@@ -950,7 +951,7 @@ AcpiUtGetDescriptorLength (
* the header length (depends on if this is a small or large resource)
*/
return (AcpiUtGetResourceLength (Aml) +
- AcpiUtGetResourceHeaderLength (Aml));
+ AcpiUtGetResourceHeaderLength (Aml));
}
@@ -990,7 +991,7 @@ AcpiUtGetResourceEndTag (
/* Validate the template and get a pointer to the EndTag */
Status = AcpiUtWalkAmlResources (NULL, ObjDesc->Buffer.Pointer,
- ObjDesc->Buffer.Length, NULL, (void **) EndTag);
+ ObjDesc->Buffer.Length, NULL, (void **) EndTag);
return_ACPI_STATUS (Status);
}
diff --git a/src/acpica/source/components/utilities/utstate.c b/src/acpica/source/components/utilities/utstate.c
index 1e64186..6e5d335 100644
--- a/src/acpica/source/components/utilities/utstate.c
+++ b/src/acpica/source/components/utilities/utstate.c
@@ -350,6 +350,7 @@ AcpiUtCreatePkgState (
State->Pkg.DestObject = ExternalObject;
State->Pkg.Index= Index;
State->Pkg.NumPackages = 1;
+
return (State);
}
@@ -389,6 +390,7 @@ AcpiUtCreateControlState (
State->Common.DescriptorType = ACPI_DESC_TYPE_STATE_CONTROL;
State->Common.State = ACPI_CONTROL_CONDITIONAL_EXECUTING;
+
return (State);
}
@@ -419,5 +421,6 @@ AcpiUtDeleteGenericState (
{
(void) AcpiOsReleaseObject (AcpiGbl_StateCache, State);
}
+
return;
}
diff --git a/src/acpica/source/components/utilities/utstring.c b/src/acpica/source/components/utilities/utstring.c
index 3660cbb..529b39f 100644
--- a/src/acpica/source/components/utilities/utstring.c
+++ b/src/acpica/source/components/utilities/utstring.c
@@ -219,6 +219,7 @@ AcpiUtPrintString (
break;
}
}
+
AcpiOsPrintf ("\"");
if (i == MaxLength && String[i])
diff --git a/src/acpica/source/components/utilities/uttrack.c b/src/acpica/source/components/utilities/uttrack.c
index f7f0bce..8906866 100644
--- a/src/acpica/source/components/utilities/uttrack.c
+++ b/src/acpica/source/components/utilities/uttrack.c
@@ -187,7 +187,7 @@ AcpiUtCreateList (
memset (Cache, 0, sizeof (ACPI_MEMORY_LIST));
- Cache->ListName = ListName;
+ Cache->ListName = ListName;
Cache->ObjectSize = ObjectSize;
*ReturnCache = Cache;
@@ -241,8 +241,8 @@ AcpiUtAllocateAndTrack (
return (NULL);
}
- Status = AcpiUtTrackAllocation (Allocation, Size,
- ACPI_MEM_MALLOC, Component, Module, Line);
+ Status = AcpiUtTrackAllocation (
+ Allocation, Size, ACPI_MEM_MALLOC, Component, Module, Line);
if (ACPI_FAILURE (Status))
{
AcpiOsFree (Allocation);
@@ -252,9 +252,12 @@ AcpiUtAllocateAndTrack (
AcpiGbl_GlobalList->TotalAllocated++;
AcpiGbl_GlobalList->TotalSize += (UINT32) Size;
AcpiGbl_GlobalList->CurrentTotalSize += (UINT32) Size;
- if (AcpiGbl_GlobalList->CurrentTotalSize > AcpiGbl_GlobalList->MaxOccupied)
+
+ if (AcpiGbl_GlobalList->CurrentTotalSize >
+ AcpiGbl_GlobalList->MaxOccupied)
{
- AcpiGbl_GlobalList->MaxOccupied = AcpiGbl_GlobalList->CurrentTotalSize;
+ AcpiGbl_GlobalList->MaxOccupied =
+ AcpiGbl_GlobalList->CurrentTotalSize;
}
return ((void *) &Allocation->UserSpace);
@@ -296,7 +299,8 @@ AcpiUtAllocateZeroedAndTrack (
Size = 1;
}
- Allocation = AcpiOsAllocateZeroed (Size + sizeof (ACPI_DEBUG_MEM_HEADER));
+ Allocation = AcpiOsAllocateZeroed (
+ Size + sizeof (ACPI_DEBUG_MEM_HEADER));
if (!Allocation)
{
/* Report allocation error */
@@ -307,7 +311,7 @@ AcpiUtAllocateZeroedAndTrack (
}
Status = AcpiUtTrackAllocation (Allocation, Size,
- ACPI_MEM_CALLOC, Component, Module, Line);
+ ACPI_MEM_CALLOC, Component, Module, Line);
if (ACPI_FAILURE (Status))
{
AcpiOsFree (Allocation);
@@ -317,9 +321,12 @@ AcpiUtAllocateZeroedAndTrack (
AcpiGbl_GlobalList->TotalAllocated++;
AcpiGbl_GlobalList->TotalSize += (UINT32) Size;
AcpiGbl_GlobalList->CurrentTotalSize += (UINT32) Size;
- if (AcpiGbl_GlobalList->CurrentTotalSize > AcpiGbl_GlobalList->MaxOccupied)
+
+ if (AcpiGbl_GlobalList->CurrentTotalSize >
+ AcpiGbl_GlobalList->MaxOccupied)
{
- AcpiGbl_GlobalList->MaxOccupied = AcpiGbl_GlobalList->CurrentTotalSize;
+ AcpiGbl_GlobalList->MaxOccupied =
+ AcpiGbl_GlobalList->CurrentTotalSize;
}
return ((void *) &Allocation->UserSpace);
@@ -364,13 +371,12 @@ AcpiUtFreeAndTrack (
}
DebugBlock = ACPI_CAST_PTR (ACPI_DEBUG_MEM_BLOCK,
- (((char *) Allocation) - sizeof (ACPI_DEBUG_MEM_HEADER)));
+ (((char *) Allocation) - sizeof (ACPI_DEBUG_MEM_HEADER)));
AcpiGbl_GlobalList->TotalFreed++;
AcpiGbl_GlobalList->CurrentTotalSize -= DebugBlock->Size;
- Status = AcpiUtRemoveAllocation (DebugBlock,
- Component, Module, Line);
+ Status = AcpiUtRemoveAllocation (DebugBlock, Component, Module, Line);
if (ACPI_FAILURE (Status))
{
ACPI_EXCEPTION ((AE_INFO, Status, "Could not free memory"));
@@ -512,10 +518,10 @@ AcpiUtTrackAllocation (
/* Fill in the instance data */
- Allocation->Size = (UINT32) Size;
+ Allocation->Size = (UINT32) Size;
Allocation->AllocType = AllocType;
Allocation->Component = Component;
- Allocation->Line = Line;
+ Allocation->Line = Line;
strncpy (Allocation->Module, Module, ACPI_MAX_MODULE_NAME);
Allocation->Module[ACPI_MAX_MODULE_NAME-1] = 0;
@@ -526,7 +532,8 @@ AcpiUtTrackAllocation (
if (MemList->ListHead)
{
- ((ACPI_DEBUG_MEM_BLOCK *)(MemList->ListHead))->Previous = Allocation;
+ ((ACPI_DEBUG_MEM_BLOCK *)(MemList->ListHead))->Previous =
+ Allocation;
}
Allocation->Next = MemList->ListHead;
@@ -659,37 +666,37 @@ AcpiUtDumpAllocationInfo (
/*
ACPI_DEBUG_PRINT (TRACE_ALLOCATIONS | TRACE_TABLES,
- ("%30s: %4d (%3d Kb)\n", "Current allocations",
- MemList->CurrentCount,
- ROUND_UP_TO_1K (MemList->CurrentSize)));
+ ("%30s: %4d (%3d Kb)\n", "Current allocations",
+ MemList->CurrentCount,
+ ROUND_UP_TO_1K (MemList->CurrentSize)));
ACPI_DEBUG_PRINT (TRACE_ALLOCATIONS | TRACE_TABLES,
- ("%30s: %4d (%3d Kb)\n", "Max concurrent allocations",
- MemList->MaxConcurrentCount,
- ROUND_UP_TO_1K (MemList->MaxConcurrentSize)));
+ ("%30s: %4d (%3d Kb)\n", "Max concurrent allocations",
+ MemList->MaxConcurrentCount,
+ ROUND_UP_TO_1K (MemList->MaxConcurrentSize)));
ACPI_DEBUG_PRINT (TRACE_ALLOCATIONS | TRACE_TABLES,
- ("%30s: %4d (%3d Kb)\n", "Total (all) internal objects",
- RunningObjectCount,
- ROUND_UP_TO_1K (RunningObjectSize)));
+ ("%30s: %4d (%3d Kb)\n", "Total (all) internal objects",
+ RunningObjectCount,
+ ROUND_UP_TO_1K (RunningObjectSize)));
ACPI_DEBUG_PRINT (TRACE_ALLOCATIONS | TRACE_TABLES,
- ("%30s: %4d (%3d Kb)\n", "Total (all) allocations",
- RunningAllocCount,
- ROUND_UP_TO_1K (RunningAllocSize)));
+ ("%30s: %4d (%3d Kb)\n", "Total (all) allocations",
+ RunningAllocCount,
+ ROUND_UP_TO_1K (RunningAllocSize)));
ACPI_DEBUG_PRINT (TRACE_ALLOCATIONS | TRACE_TABLES,
- ("%30s: %4d (%3d Kb)\n", "Current Nodes",
- AcpiGbl_CurrentNodeCount,
- ROUND_UP_TO_1K (AcpiGbl_CurrentNodeSize)));
+ ("%30s: %4d (%3d Kb)\n", "Current Nodes",
+ AcpiGbl_CurrentNodeCount,
+ ROUND_UP_TO_1K (AcpiGbl_CurrentNodeSize)));
ACPI_DEBUG_PRINT (TRACE_ALLOCATIONS | TRACE_TABLES,
- ("%30s: %4d (%3d Kb)\n", "Max Nodes",
- AcpiGbl_MaxConcurrentNodeCount,
- ROUND_UP_TO_1K ((AcpiGbl_MaxConcurrentNodeCount *
- sizeof (ACPI_NAMESPACE_NODE)))));
+ ("%30s: %4d (%3d Kb)\n", "Max Nodes",
+ AcpiGbl_MaxConcurrentNodeCount,
+ ROUND_UP_TO_1K ((AcpiGbl_MaxConcurrentNodeCount *
+ sizeof (ACPI_NAMESPACE_NODE)))));
*/
return_VOID;
}
@@ -741,7 +748,8 @@ AcpiUtDumpAllocations (
if ((Element->Component & Component) &&
((Module == NULL) || (0 == strcmp (Module, Element->Module))))
{
- Descriptor = ACPI_CAST_PTR (ACPI_DESCRIPTOR, &Element->UserSpace);
+ Descriptor = ACPI_CAST_PTR (
+ ACPI_DESCRIPTOR, &Element->UserSpace);
if (Element->Size < sizeof (ACPI_COMMON_DESCRIPTOR))
{
@@ -754,7 +762,8 @@ AcpiUtDumpAllocations (
{
/* Ignore allocated objects that are in a cache */
- if (ACPI_GET_DESCRIPTOR_TYPE (Descriptor) != ACPI_DESC_TYPE_CACHED)
+ if (ACPI_GET_DESCRIPTOR_TYPE (Descriptor) !=
+ ACPI_DESC_TYPE_CACHED)
{
AcpiOsPrintf ("%p Length 0x%04X %9.9s-%u [%s] ",
Descriptor, Element->Size, Element->Module,
diff --git a/src/acpica/source/components/utilities/utuuid.c b/src/acpica/source/components/utilities/utuuid.c
index 71fa0bc..7a6f698 100644
--- a/src/acpica/source/components/utilities/utuuid.c
+++ b/src/acpica/source/components/utilities/utuuid.c
@@ -165,11 +165,11 @@ AcpiUtConvertStringToUuid (
for (i = 0; i < UUID_BUFFER_LENGTH; i++)
{
- UuidBuffer[i] =
- (AcpiUtAsciiCharToHex (InString[AcpiGbl_MapToUuidOffset[i]]) << 4);
+ UuidBuffer[i] = (AcpiUtAsciiCharToHex (
+ InString[AcpiGbl_MapToUuidOffset[i]]) << 4);
- UuidBuffer[i] |=
- AcpiUtAsciiCharToHex (InString[AcpiGbl_MapToUuidOffset[i] + 1]);
+ UuidBuffer[i] |= AcpiUtAsciiCharToHex (
+ InString[AcpiGbl_MapToUuidOffset[i] + 1]);
}
}
#endif
diff --git a/src/acpica/source/components/utilities/utxface.c b/src/acpica/source/components/utilities/utxface.c
index a34970e..35fb8a0 100644
--- a/src/acpica/source/components/utilities/utxface.c
+++ b/src/acpica/source/components/utilities/utxface.c
@@ -145,24 +145,6 @@ AcpiTerminate (
ACPI_FUNCTION_TRACE (AcpiTerminate);
- /* Just exit if subsystem is already shutdown */
-
- if (AcpiGbl_Shutdown)
- {
- ACPI_ERROR ((AE_INFO, "ACPI Subsystem is already terminated"));
- return_ACPI_STATUS (AE_OK);
- }
-
- /* Subsystem appears active, go ahead and shut it down */
-
- AcpiGbl_Shutdown = TRUE;
- AcpiGbl_StartupFlags = 0;
- ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Shutting down ACPI Subsystem\n"));
-
- /* Terminate the AML Debugger if present */
-
- ACPI_DEBUGGER_EXEC (AcpiGbl_DbTerminateThreads = TRUE);
-
/* Shutdown and free all resources */
AcpiUtSubsystemShutdown ();
@@ -262,7 +244,6 @@ AcpiGetSystemInfo (
* Populate the return buffer
*/
InfoPtr = (ACPI_SYSTEM_INFO *) OutBuffer->Pointer;
-
InfoPtr->AcpiCaVersion = ACPI_CA_VERSION;
/* System flags (ACPI capabilities) */
@@ -330,11 +311,9 @@ AcpiGetStatistics (
memcpy (Stats->FixedEventCount, AcpiFixedEventCount,
sizeof (AcpiFixedEventCount));
-
/* Other counters */
Stats->MethodCount = AcpiMethodCount;
-
return_ACPI_STATUS (AE_OK);
}
diff --git a/src/acpica/source/components/utilities/utxferror.c b/src/acpica/source/components/utilities/utxferror.c
index b62e5df..bbc0cf6 100644
--- a/src/acpica/source/components/utilities/utxferror.c
+++ b/src/acpica/source/components/utilities/utxferror.c
@@ -205,8 +205,10 @@ AcpiException (
}
else
{
- AcpiOsPrintf (ACPI_MSG_EXCEPTION "%s, ", AcpiFormatException (Status));
+ AcpiOsPrintf (ACPI_MSG_EXCEPTION "%s, ",
+ AcpiFormatException (Status));
}
+
va_start (ArgList, Format);
AcpiOsVprintf (Format, ArgList);
ACPI_MSG_SUFFIX;
diff --git a/src/acpica/source/include/acapps.h b/src/acpica/source/include/acapps.h
index 1c2004d..4fbebbf 100644
--- a/src/acpica/source/include/acapps.h
+++ b/src/acpica/source/include/acapps.h
@@ -116,6 +116,7 @@
#ifndef _ACAPPS
#define _ACAPPS
+#include <stdio.h>
#ifdef _MSC_VER /* disable some level-4 warnings */
#pragma warning(disable:4100) /* warning C4100: unreferenced formal parameter */
@@ -165,10 +166,38 @@
AcpiOsPrintf (" %-18s%s\n", Name, Description);
+/* Check for unexpected exceptions */
+
+#define ACPI_CHECK_STATUS(Name, Status, Expected) \
+ if (Status != Expected) \
+ { \
+ AcpiOsPrintf ("Unexpected %s from %s (%s-%d)\n", \
+ AcpiFormatException (Status), #Name, _AcpiModuleName, __LINE__); \
+ }
+
+/* Check for unexpected non-AE_OK errors */
+
+
+#define ACPI_CHECK_OK(Name, Status) ACPI_CHECK_STATUS (Name, Status, AE_OK);
+
#define FILE_SUFFIX_DISASSEMBLY "dsl"
#define FILE_SUFFIX_BINARY_TABLE ".dat" /* Needs the dot */
+/* acfileio */
+
+ACPI_STATUS
+AcpiAcGetAllTablesFromFile (
+ char *Filename,
+ UINT8 GetOnlyAmlTables,
+ ACPI_NEW_TABLE_DESC **ReturnListHead);
+
+/* Values for GetOnlyAmlTables */
+
+#define ACPI_GET_ONLY_AML_TABLES TRUE
+#define ACPI_GET_ALL_TABLES FALSE
+
+
/*
* getopt
*/
@@ -197,51 +226,6 @@ CmGetFileSize (
ACPI_FILE File);
-#ifndef ACPI_DUMP_APP
-/*
- * adisasm
- */
-ACPI_STATUS
-AdAmlDisassemble (
- BOOLEAN OutToFile,
- char *Filename,
- char *Prefix,
- char **OutFilename);
-
-void
-AdPrintStatistics (
- void);
-
-ACPI_STATUS
-AdFindDsdt(
- UINT8 **DsdtPtr,
- UINT32 *DsdtLength);
-
-void
-AdDumpTables (
- void);
-
-ACPI_STATUS
-AdGetLocalTables (
- void);
-
-ACPI_STATUS
-AdParseTable (
- ACPI_TABLE_HEADER *Table,
- ACPI_OWNER_ID *OwnerId,
- BOOLEAN LoadTable,
- BOOLEAN External);
-
-ACPI_STATUS
-AdDisplayTables (
- char *Filename,
- ACPI_TABLE_HEADER *Table);
-
-ACPI_STATUS
-AdDisplayStatistics (
- void);
-
-
/*
* adwalk
*/
@@ -300,6 +284,5 @@ AdWriteTable (
UINT32 Length,
char *TableName,
char *OemTableId);
-#endif
#endif /* _ACAPPS */
diff --git a/src/acpica/source/include/acdebug.h b/src/acpica/source/include/acdebug.h
index 3b245b0..d208b2e 100644
--- a/src/acpica/source/include/acdebug.h
+++ b/src/acpica/source/include/acdebug.h
@@ -163,11 +163,17 @@ typedef struct acpi_db_execute_walk
/*
* dbxface - external debugger interfaces
*/
+ACPI_DBR_DEPENDENT_RETURN_OK (
ACPI_STATUS
AcpiDbSingleStep (
ACPI_WALK_STATE *WalkState,
ACPI_PARSE_OBJECT *Op,
- UINT32 OpType);
+ UINT32 OpType))
+
+ACPI_DBR_DEPENDENT_RETURN_VOID (
+void
+AcpiDbSignalBreakPoint (
+ ACPI_WALK_STATE *WalkState))
/*
@@ -362,10 +368,11 @@ AcpiDbDecodeAndDisplayObject (
char *Target,
char *OutputType);
+ACPI_DBR_DEPENDENT_RETURN_VOID (
void
AcpiDbDisplayResultObject (
ACPI_OPERAND_OBJECT *ObjDesc,
- ACPI_WALK_STATE *WalkState);
+ ACPI_WALK_STATE *WalkState))
ACPI_STATUS
AcpiDbDisplayAllMethods (
@@ -391,10 +398,11 @@ void
AcpiDbDisplayObjectType (
char *ObjectArg);
+ACPI_DBR_DEPENDENT_RETURN_VOID (
void
AcpiDbDisplayArgumentObject (
ACPI_OPERAND_OBJECT *ObjDesc,
- ACPI_WALK_STATE *WalkState);
+ ACPI_WALK_STATE *WalkState))
/*
@@ -446,10 +454,8 @@ AcpiDbLoadAcpiTable (
char *Filename);
ACPI_STATUS
-AcpiDbGetTableFromFile (
- char *Filename,
- ACPI_TABLE_HEADER **Table,
- BOOLEAN MustBeAmlTable);
+AcpiDbLoadTables (
+ ACPI_NEW_TABLE_DESC *ListHead);
/*
diff --git a/src/acpica/source/include/acdisasm.h b/src/acpica/source/include/acdisasm.h
index d448b9f..2ff2dab 100644
--- a/src/acpica/source/include/acdisasm.h
+++ b/src/acpica/source/include/acdisasm.h
@@ -1119,7 +1119,7 @@ AcpiDmCloseOperator (
/*
- * acdisasm
+ * dmtables
*/
void
AdDisassemblerHeader (
@@ -1129,4 +1129,35 @@ AdDisassemblerHeader (
#define ACPI_IS_AML_TABLE 0
#define ACPI_IS_DATA_TABLE 1
+
+/*
+ * adisasm
+ */
+ACPI_STATUS
+AdAmlDisassemble (
+ BOOLEAN OutToFile,
+ char *Filename,
+ char *Prefix,
+ char **OutFilename);
+
+ACPI_STATUS
+AdGetLocalTables (
+ void);
+
+ACPI_STATUS
+AdParseTable (
+ ACPI_TABLE_HEADER *Table,
+ ACPI_OWNER_ID *OwnerId,
+ BOOLEAN LoadTable,
+ BOOLEAN External);
+
+ACPI_STATUS
+AdDisplayTables (
+ char *Filename,
+ ACPI_TABLE_HEADER *Table);
+
+ACPI_STATUS
+AdDisplayStatistics (
+ void);
+
#endif /* __ACDISASM_H__ */
diff --git a/src/acpica/source/include/acglobal.h b/src/acpica/source/include/acglobal.h
index 2733f39..2fb8062 100644
--- a/src/acpica/source/include/acglobal.h
+++ b/src/acpica/source/include/acglobal.h
@@ -134,6 +134,7 @@ ACPI_GLOBAL (ACPI_TABLE_HEADER, AcpiGbl_OriginalDsdtHeader);
ACPI_INIT_GLOBAL (UINT32, AcpiGbl_DsdtIndex, ACPI_INVALID_TABLE_INDEX);
ACPI_INIT_GLOBAL (UINT32, AcpiGbl_FacsIndex, ACPI_INVALID_TABLE_INDEX);
ACPI_INIT_GLOBAL (UINT32, AcpiGbl_XFacsIndex, ACPI_INVALID_TABLE_INDEX);
+ACPI_INIT_GLOBAL (UINT32, AcpiGbl_FadtIndex, ACPI_INVALID_TABLE_INDEX);
#if (!ACPI_REDUCED_HARDWARE)
ACPI_GLOBAL (ACPI_TABLE_FACS *, AcpiGbl_FACS);
@@ -400,9 +401,9 @@ ACPI_GLOBAL (ACPI_EXTERNAL_FILE *, AcpiGbl_ExternalFileList);
#ifdef ACPI_DEBUGGER
-ACPI_INIT_GLOBAL (BOOLEAN, AcpiGbl_DbTerminateThreads, FALSE);
ACPI_INIT_GLOBAL (BOOLEAN, AcpiGbl_AbortMethod, FALSE);
ACPI_INIT_GLOBAL (BOOLEAN, AcpiGbl_MethodExecuting, FALSE);
+ACPI_INIT_GLOBAL (ACPI_THREAD_ID, AcpiGbl_DbThreadId, ACPI_INVALID_THREAD_ID);
ACPI_GLOBAL (BOOLEAN, AcpiGbl_DbOpt_NoIniMethods);
ACPI_GLOBAL (BOOLEAN, AcpiGbl_DbOpt_NoRegionSupport);
@@ -412,6 +413,8 @@ ACPI_GLOBAL (char *, AcpiGbl_DbFilename);
ACPI_GLOBAL (UINT32, AcpiGbl_DbDebugLevel);
ACPI_GLOBAL (UINT32, AcpiGbl_DbConsoleDebugLevel);
ACPI_GLOBAL (ACPI_NAMESPACE_NODE *, AcpiGbl_DbScopeNode);
+ACPI_GLOBAL (BOOLEAN, AcpiGbl_DbTerminateLoop);
+ACPI_GLOBAL (BOOLEAN, AcpiGbl_DbThreadsTerminated);
ACPI_GLOBAL (char *, AcpiGbl_DbArgs[ACPI_DEBUGGER_MAX_ARGS]);
ACPI_GLOBAL (ACPI_OBJECT_TYPE, AcpiGbl_DbArgTypes[ACPI_DEBUGGER_MAX_ARGS]);
diff --git a/src/acpica/source/include/aclocal.h b/src/acpica/source/include/aclocal.h
index fdeafff..8d1e37b 100644
--- a/src/acpica/source/include/aclocal.h
+++ b/src/acpica/source/include/aclocal.h
@@ -190,6 +190,14 @@ typedef struct acpi_rw_lock
#define ACPI_MUTEX_NOT_ACQUIRED (ACPI_THREAD_ID) -1
+/* This Thread ID means an invalid thread ID */
+
+#ifdef ACPI_OS_INVALID_THREAD_ID
+#define ACPI_INVALID_THREAD_ID ACPI_OS_INVALID_THREAD_ID
+#else
+#define ACPI_INVALID_THREAD_ID ((ACPI_THREAD_ID) 0xFFFFFFFF)
+#endif
+
/* Table for the global mutexes */
typedef struct acpi_mutex_info
@@ -308,6 +316,16 @@ typedef struct acpi_table_list
#define ACPI_ROOT_ALLOW_RESIZE (2)
+/* List to manage incoming ACPI tables */
+
+typedef struct acpi_new_table_desc
+{
+ ACPI_TABLE_HEADER *Table;
+ struct acpi_new_table_desc *Next;
+
+} ACPI_NEW_TABLE_DESC;
+
+
/* Predefined table indexes */
#define ACPI_INVALID_TABLE_INDEX (0xFFFFFFFF)
diff --git a/src/acpica/source/include/acmacros.h b/src/acpica/source/include/acmacros.h
index f8dfffb..ba40732 100644
--- a/src/acpica/source/include/acmacros.h
+++ b/src/acpica/source/include/acmacros.h
@@ -478,18 +478,6 @@
/*
- * Some code only gets executed when the debugger is built in.
- * Note that this is entirely independent of whether the
- * DEBUG_PRINT stuff (set by ACPI_DEBUG_OUTPUT) is on, or not.
- */
-#ifdef ACPI_DEBUGGER
-#define ACPI_DEBUGGER_EXEC(a) a
-#else
-#define ACPI_DEBUGGER_EXEC(a)
-#endif
-
-
-/*
* Macros used for ACPICA utilities only
*/
diff --git a/src/acpica/source/include/acpiosxf.h b/src/acpica/source/include/acpiosxf.h
index 45cec74..4afc7d5 100644
--- a/src/acpica/source/include/acpiosxf.h
+++ b/src/acpica/source/include/acpiosxf.h
@@ -129,7 +129,8 @@ typedef enum
OSL_GLOBAL_LOCK_HANDLER,
OSL_NOTIFY_HANDLER,
OSL_GPE_HANDLER,
- OSL_DEBUGGER_THREAD,
+ OSL_DEBUGGER_MAIN_THREAD,
+ OSL_DEBUGGER_EXEC_THREAD,
OSL_EC_POLL_HANDLER,
OSL_EC_BURST_HANDLER
diff --git a/src/acpica/source/include/acpixf.h b/src/acpica/source/include/acpixf.h
index 55412c8..1bb43ea 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 0x20150930
+#define ACPI_CA_VERSION 0x20151124
#include "acconfig.h"
#include "actypes.h"
@@ -449,6 +449,30 @@ ACPI_GLOBAL (BOOLEAN, AcpiGbl_SystemAwakeAndRunning);
#endif /* ACPI_APPLICATION */
+/*
+ * Debugger prototypes
+ *
+ * All interfaces used by debugger will be configured
+ * out of the ACPICA build unless the ACPI_DEBUGGER
+ * flag is defined.
+ */
+#ifdef ACPI_DEBUGGER
+#define ACPI_DBR_DEPENDENT_RETURN_OK(Prototype) \
+ ACPI_EXTERNAL_RETURN_OK(Prototype)
+
+#define ACPI_DBR_DEPENDENT_RETURN_VOID(Prototype) \
+ ACPI_EXTERNAL_RETURN_VOID(Prototype)
+
+#else
+#define ACPI_DBR_DEPENDENT_RETURN_OK(Prototype) \
+ static ACPI_INLINE Prototype {return(AE_OK);}
+
+#define ACPI_DBR_DEPENDENT_RETURN_VOID(Prototype) \
+ static ACPI_INLINE Prototype {return;}
+
+#endif /* ACPI_DEBUGGER */
+
+
/*****************************************************************************
*
* ACPICA public interface prototypes
@@ -1288,4 +1312,8 @@ void
AcpiTerminateDebugger (
void);
+void
+AcpiSetDebuggerThreadId (
+ ACPI_THREAD_ID ThreadId);
+
#endif /* __ACXFACE_H__ */
diff --git a/src/acpica/source/include/actables.h b/src/acpica/source/include/actables.h
index 10fb56d..3fbeb3b 100644
--- a/src/acpica/source/include/actables.h
+++ b/src/acpica/source/include/actables.h
@@ -187,7 +187,7 @@ AcpiTbSetTableLoadedFlag (
*/
void
AcpiTbParseFadt (
- UINT32 TableIndex);
+ void);
void
AcpiTbCreateLocalFadt (
@@ -279,10 +279,6 @@ ACPI_STATUS
AcpiTbInitializeFacs (
void);
-BOOLEAN
-AcpiTbTablesLoaded (
- void);
-
void
AcpiTbPrintTableHeader(
ACPI_PHYSICAL_ADDRESS Address,
diff --git a/src/acpica/source/include/actypes.h b/src/acpica/source/include/actypes.h
index e9e765d..09a2d82 100644
--- a/src/acpica/source/include/actypes.h
+++ b/src/acpica/source/include/actypes.h
@@ -1304,7 +1304,7 @@ UINT32 (*ACPI_INTERFACE_HANDLER) (
#define ACPI_PCICLS_STRING_SIZE 7 /* Includes null terminator */
-/* Structures used for device/processor HID, UID, CID, and SUB */
+/* Structures used for device/processor HID, UID, CID */
typedef struct acpi_pnp_device_id
{
@@ -1339,7 +1339,6 @@ typedef struct acpi_device_info
UINT64 Address; /* _ADR value */
ACPI_PNP_DEVICE_ID HardwareId; /* _HID value */
ACPI_PNP_DEVICE_ID UniqueId; /* _UID value */
- ACPI_PNP_DEVICE_ID SubsystemId; /* _SUB value */
ACPI_PNP_DEVICE_ID ClassCode; /* _CLS value */
ACPI_PNP_DEVICE_ID_LIST CompatibleIdList; /* _CID list <must be last> */
@@ -1355,13 +1354,12 @@ typedef struct acpi_device_info
#define ACPI_VALID_ADR 0x0002
#define ACPI_VALID_HID 0x0004
#define ACPI_VALID_UID 0x0008
-#define ACPI_VALID_SUB 0x0010
#define ACPI_VALID_CID 0x0020
#define ACPI_VALID_CLS 0x0040
#define ACPI_VALID_SXDS 0x0100
#define ACPI_VALID_SXWS 0x0200
-/* Flags for _STA return value (CurrentStatus above) */
+/* Flags for _STA method */
#define ACPI_STA_DEVICE_PRESENT 0x01
#define ACPI_STA_DEVICE_ENABLED 0x02
diff --git a/src/acpica/source/include/acutils.h b/src/acpica/source/include/acutils.h
index 4fc44ff..c85ab83 100644
--- a/src/acpica/source/include/acutils.h
+++ b/src/acpica/source/include/acutils.h
@@ -278,7 +278,7 @@ AcpiUtInitGlobals (
#if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER)
-char *
+const char *
AcpiUtGetMutexName (
UINT32 MutexId);
@@ -288,15 +288,15 @@ AcpiUtGetNotifyName (
ACPI_OBJECT_TYPE Type);
#endif
-char *
+const char *
AcpiUtGetTypeName (
ACPI_OBJECT_TYPE Type);
-char *
+const char *
AcpiUtGetNodeName (
void *Object);
-char *
+const char *
AcpiUtGetDescriptorName (
void *Object);
@@ -304,15 +304,15 @@ const char *
AcpiUtGetReferenceName (
ACPI_OPERAND_OBJECT *Object);
-char *
+const char *
AcpiUtGetObjectTypeName (
ACPI_OPERAND_OBJECT *ObjDesc);
-char *
+const char *
AcpiUtGetRegionName (
UINT8 SpaceId);
-char *
+const char *
AcpiUtGetEventName (
UINT32 EventId);
@@ -556,17 +556,6 @@ AcpiUtExecutePowerMethods (
/*
- * utfileio - file operations
- */
-#ifdef ACPI_APPLICATION
-ACPI_STATUS
-AcpiUtReadTableFromFile (
- char *Filename,
- ACPI_TABLE_HEADER **Table);
-#endif
-
-
-/*
* utids - device ID support
*/
ACPI_STATUS
@@ -580,11 +569,6 @@ AcpiUtExecute_UID (
ACPI_PNP_DEVICE_ID **ReturnId);
ACPI_STATUS
-AcpiUtExecute_SUB (
- ACPI_NAMESPACE_NODE *DeviceNode,
- ACPI_PNP_DEVICE_ID **ReturnId);
-
-ACPI_STATUS
AcpiUtExecute_CID (
ACPI_NAMESPACE_NODE *DeviceNode,
ACPI_PNP_DEVICE_ID_LIST **ReturnCidList);
diff --git a/src/acpica/source/include/platform/aclinux.h b/src/acpica/source/include/platform/aclinux.h
index 668f237..42f3f0a 100644
--- a/src/acpica/source/include/platform/aclinux.h
+++ b/src/acpica/source/include/platform/aclinux.h
@@ -136,12 +136,16 @@
#define ACPI_USE_SYSTEM_INTTYPES
-/* Compile for reduced hardware mode only with this kernel config */
+/* Kernel specific ACPICA configuration */
#ifdef CONFIG_ACPI_REDUCED_HARDWARE_ONLY
#define ACPI_REDUCED_HARDWARE 1
#endif
+#ifdef CONFIG_ACPI_DEBUGGER
+#define ACPI_DEBUGGER
+#endif
+
#include <linux/string.h>
#include <linux/kernel.h>
#include <linux/ctype.h>
@@ -224,7 +228,6 @@
* OSL interfaces used by utilities
*/
#define ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsRedirectOutput
-#define ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsGetLine
#define ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsGetTableByName
#define ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsGetTableByIndex
#define ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsGetTableByAddress
diff --git a/src/acpica/source/include/platform/aclinuxex.h b/src/acpica/source/include/platform/aclinuxex.h
index 52352ce..c6262de 100644
--- a/src/acpica/source/include/platform/aclinuxex.h
+++ b/src/acpica/source/include/platform/aclinuxex.h
@@ -208,6 +208,15 @@ AcpiOsGetThreadId (
Lock ? AE_OK : AE_NO_MEMORY; \
})
+static inline BOOLEAN
+AcpiOsReadable (
+ void *Pointer,
+ ACPI_SIZE Length)
+{
+ return TRUE;
+}
+
+
/*
* OSL interfaces added by Linux
*/
diff --git a/src/acpica/source/os_specific/service_layers/oslibcfs.c b/src/acpica/source/os_specific/service_layers/oslibcfs.c
index dadc40d..92650e2 100644
--- a/src/acpica/source/os_specific/service_layers/oslibcfs.c
+++ b/src/acpica/source/os_specific/service_layers/oslibcfs.c
@@ -153,6 +153,7 @@ AcpiOsOpenFile (
{
ModesStr[i++] = 'w';
}
+
if (Modes & ACPI_FILE_BINARY)
{
ModesStr[i++] = 'b';
@@ -186,6 +187,7 @@ void
AcpiOsCloseFile (
ACPI_FILE File)
{
+
fclose (File);
}
@@ -311,6 +313,7 @@ AcpiOsSetFileOffset (
{
Ret = fseek (File, Offset, SEEK_SET);
}
+
if (From == ACPI_FILE_END)
{
Ret = fseek (File, Offset, SEEK_END);
diff --git a/src/acpica/source/tools/acpiexec/aecommon.h b/src/acpica/source/tools/acpiexec/aecommon.h
index c0662bf..1aac52b 100644
--- a/src/acpica/source/tools/acpiexec/aecommon.h
+++ b/src/acpica/source/tools/acpiexec/aecommon.h
@@ -136,34 +136,6 @@
#include <string.h>
#include <signal.h>
-extern BOOLEAN AcpiGbl_IgnoreErrors;
-extern UINT8 AcpiGbl_RegionFillValue;
-extern UINT8 AcpiGbl_UseHwReducedFadt;
-extern BOOLEAN AcpiGbl_DisplayRegionAccess;
-extern BOOLEAN AcpiGbl_DoInterfaceTests;
-extern BOOLEAN AcpiGbl_LoadTestTables;
-extern FILE *AcpiGbl_NamespaceInitFile;
-extern ACPI_CONNECTION_INFO AeMyContext;
-
-/* Check for unexpected exceptions */
-
-#define AE_CHECK_STATUS(Name, Status, Expected) \
- if (Status != Expected) \
- { \
- AcpiOsPrintf ("Unexpected %s from %s (%s-%d)\n", \
- AcpiFormatException (Status), #Name, _AcpiModuleName, __LINE__); \
- }
-
-/* Check for unexpected non-AE_OK errors */
-
-#define AE_CHECK_OK(Name, Status) AE_CHECK_STATUS (Name, Status, AE_OK);
-
-typedef struct ae_table_desc
-{
- ACPI_TABLE_HEADER *Table;
- struct ae_table_desc *Next;
-
-} AE_TABLE_DESC;
/*
* Debug Regions
@@ -186,6 +158,16 @@ typedef struct ae_debug_regions
} AE_DEBUG_REGIONS;
+extern BOOLEAN AcpiGbl_IgnoreErrors;
+extern UINT8 AcpiGbl_RegionFillValue;
+extern UINT8 AcpiGbl_UseHwReducedFadt;
+extern BOOLEAN AcpiGbl_DisplayRegionAccess;
+extern BOOLEAN AcpiGbl_DoInterfaceTests;
+extern BOOLEAN AcpiGbl_LoadTestTables;
+extern FILE *AcpiGbl_NamespaceInitFile;
+extern ACPI_CONNECTION_INFO AeMyContext;
+
+
#define TEST_OUTPUT_LEVEL(lvl) if ((lvl) & OutputLevel)
#define OSD_PRINT(lvl,fp) TEST_OUTPUT_LEVEL(lvl) {\
@@ -197,8 +179,7 @@ AeCtrlCHandler (
ACPI_STATUS
AeBuildLocalTables (
- UINT32 TableCount,
- AE_TABLE_DESC *TableList);
+ ACPI_NEW_TABLE_DESC *TableList);
ACPI_STATUS
AeInstallTables (
diff --git a/src/acpica/source/tools/acpiexec/aehandlers.c b/src/acpica/source/tools/acpiexec/aehandlers.c
index 97ea103..9a3f913 100644
--- a/src/acpica/source/tools/acpiexec/aehandlers.c
+++ b/src/acpica/source/tools/acpiexec/aehandlers.c
@@ -435,6 +435,7 @@ AeExceptionHandler (
{
AcpiOsPrintf ("at module level (table load)");
}
+
AcpiOsPrintf (" Opcode [%s] @%X\n", AcpiPsGetOpcodeName (Opcode), AmlOffset);
/*
@@ -530,7 +531,7 @@ AeTableHandler (
/* Enable any GPEs associated with newly-loaded GPE methods */
Status = AcpiUpdateAllGpes ();
- AE_CHECK_OK (AcpiUpdateAllGpes, Status);
+ ACPI_CHECK_OK (AcpiUpdateAllGpes, Status);
printf ("[AcpiExec] Table Event %s, [%4.4s] %p\n",
TableEvents[Event], ((ACPI_TABLE_HEADER *) Table)->Signature, Table);
@@ -600,7 +601,8 @@ AeGlobalEventHandler (
break;
}
- AcpiOsPrintf ("[AcpiExec] Global Event Handler received: Type %s Number %.2X Dev %p\n",
+ AcpiOsPrintf (
+ "[AcpiExec] Global Event Handler received: Type %s Number %.2X Dev %p\n",
TypeName, EventNumber, Device);
}
@@ -771,15 +773,17 @@ AeInstallLateHandlers (
/* Install a user SCI handler */
Status = AeInstallSciHandler ();
- AE_CHECK_OK (AeInstallSciHandler, Status);
+ ACPI_CHECK_OK (AeInstallSciHandler, Status);
/* Install some fixed event handlers */
- Status = AcpiInstallFixedEventHandler (ACPI_EVENT_GLOBAL, AeEventHandler, NULL);
- AE_CHECK_OK (AcpiInstallFixedEventHandler, Status);
+ Status = AcpiInstallFixedEventHandler (
+ ACPI_EVENT_GLOBAL, AeEventHandler, NULL);
+ ACPI_CHECK_OK (AcpiInstallFixedEventHandler, Status);
- Status = AcpiInstallFixedEventHandler (ACPI_EVENT_RTC, AeEventHandler, NULL);
- AE_CHECK_OK (AcpiInstallFixedEventHandler, Status);
+ Status = AcpiInstallFixedEventHandler (
+ ACPI_EVENT_RTC, AeEventHandler, NULL);
+ ACPI_CHECK_OK (AcpiInstallFixedEventHandler, Status);
}
#endif /* !ACPI_REDUCED_HARDWARE */
@@ -889,11 +893,11 @@ AeInstallEarlyHandlers (
Status = AcpiInstallNotifyHandler (Handle, ACPI_ALL_NOTIFY,
AeNotifyHandler1, NULL);
- AE_CHECK_OK (AcpiInstallNotifyHandler, Status);
+ ACPI_CHECK_OK (AcpiInstallNotifyHandler, Status);
Status = AcpiRemoveNotifyHandler (Handle, ACPI_ALL_NOTIFY,
AeNotifyHandler1);
- AE_CHECK_OK (AcpiRemoveNotifyHandler, Status);
+ ACPI_CHECK_OK (AcpiRemoveNotifyHandler, Status);
#if 0
Status = AcpiInstallNotifyHandler (Handle, ACPI_ALL_NOTIFY,
@@ -919,35 +923,34 @@ AeInstallEarlyHandlers (
AeNotifyHandler1, ACPI_CAST_PTR (void, 0x77777777));
Status = AcpiAttachData (Handle, AeAttachedDataHandler, Handle);
- AE_CHECK_OK (AcpiAttachData, Status);
+ ACPI_CHECK_OK (AcpiAttachData, Status);
Status = AcpiDetachData (Handle, AeAttachedDataHandler);
- AE_CHECK_OK (AcpiDetachData, Status);
+ ACPI_CHECK_OK (AcpiDetachData, Status);
/* Test attach data at the root object */
Status = AcpiAttachData (ACPI_ROOT_OBJECT, AeAttachedDataHandler,
AcpiGbl_RootNode);
- AE_CHECK_OK (AcpiAttachData, Status);
+ ACPI_CHECK_OK (AcpiAttachData, Status);
Status = AcpiAttachData (ACPI_ROOT_OBJECT, AeAttachedDataHandler2,
AcpiGbl_RootNode);
- AE_CHECK_OK (AcpiAttachData, Status);
+ ACPI_CHECK_OK (AcpiAttachData, Status);
/* Test support for multiple attaches */
Status = AcpiAttachData (Handle, AeAttachedDataHandler, Handle);
- AE_CHECK_OK (AcpiAttachData, Status);
+ ACPI_CHECK_OK (AcpiAttachData, Status);
Status = AcpiAttachData (Handle, AeAttachedDataHandler2, Handle);
- AE_CHECK_OK (AcpiAttachData, Status);
+ ACPI_CHECK_OK (AcpiAttachData, Status);
}
else
{
printf ("No _SB_ found, %s\n", AcpiFormatException (Status));
}
-
Status = AcpiGetHandle (NULL, "\\_TZ.TZ1", &Handle);
if (ACPI_SUCCESS (Status))
{
diff --git a/src/acpica/source/tools/acpiexec/aeregion.c b/src/acpica/source/tools/acpiexec/aeregion.c
index 55b8e7f..46ddcb8 100644
--- a/src/acpica/source/tools/acpiexec/aeregion.c
+++ b/src/acpica/source/tools/acpiexec/aeregion.c
@@ -237,8 +237,8 @@ AeInstallRegionHandlers (
/* Install handler at the root object */
Status = AcpiInstallAddressSpaceHandler (ACPI_ROOT_OBJECT,
- SpaceIdList[i], AeRegionHandler,
- AeRegionInit, &AeMyContext);
+ SpaceIdList[i], AeRegionHandler,
+ AeRegionInit, &AeMyContext);
if (ACPI_FAILURE (Status))
{
ACPI_EXCEPTION ((AE_INFO, Status,
@@ -266,8 +266,8 @@ AeOverrideRegionHandlers (
/* Install handler at the root object */
Status = AcpiInstallAddressSpaceHandler (ACPI_ROOT_OBJECT,
- DefaultSpaceIdList[i], AeRegionHandler,
- AeRegionInit, &AeMyContext);
+ DefaultSpaceIdList[i], AeRegionHandler,
+ AeRegionInit, &AeMyContext);
if (ACPI_FAILURE (Status))
{
ACPI_EXCEPTION ((AE_INFO, Status,
@@ -445,9 +445,10 @@ AeRegionHandler (
Length = (ACPI_SIZE) RegionObject->Region.Length;
SpaceId = RegionObject->Region.SpaceId;
- ACPI_DEBUG_PRINT ((ACPI_DB_OPREGION, "Operation Region request on %s at 0x%X\n",
- AcpiUtGetRegionName (RegionObject->Region.SpaceId),
- (UINT32) Address));
+ ACPI_DEBUG_PRINT ((ACPI_DB_OPREGION,
+ "Operation Region request on %s at 0x%X\n",
+ AcpiUtGetRegionName (RegionObject->Region.SpaceId),
+ (UINT32) Address));
/*
* Region support can be disabled with the -do option.
@@ -482,16 +483,16 @@ AeRegionHandler (
/* Split the 64-bit request into two 32-bit requests */
Status = AcpiHwReadPort (Address, &Value1, 32);
- AE_CHECK_OK (AcpiHwReadPort, Status);
+ ACPI_CHECK_OK (AcpiHwReadPort, Status);
Status = AcpiHwReadPort (Address+4, &Value2, 32);
- AE_CHECK_OK (AcpiHwReadPort, Status);
+ ACPI_CHECK_OK (AcpiHwReadPort, Status);
*Value = Value1 | ((UINT64) Value2 << 32);
}
else
{
Status = AcpiHwReadPort (Address, &Value1, BitWidth);
- AE_CHECK_OK (AcpiHwReadPort, Status);
+ ACPI_CHECK_OK (AcpiHwReadPort, Status);
*Value = (UINT64) Value1;
}
break;
@@ -503,14 +504,14 @@ AeRegionHandler (
/* Split the 64-bit request into two 32-bit requests */
Status = AcpiHwWritePort (Address, ACPI_LODWORD (*Value), 32);
- AE_CHECK_OK (AcpiHwWritePort, Status);
+ ACPI_CHECK_OK (AcpiHwWritePort, Status);
Status = AcpiHwWritePort (Address+4, ACPI_HIDWORD (*Value), 32);
- AE_CHECK_OK (AcpiHwWritePort, Status);
+ ACPI_CHECK_OK (AcpiHwWritePort, Status);
}
else
{
Status = AcpiHwWritePort (Address, (UINT32) *Value, BitWidth);
- AE_CHECK_OK (AcpiHwWritePort, Status);
+ ACPI_CHECK_OK (AcpiHwWritePort, Status);
}
break;
@@ -891,7 +892,8 @@ AeRegionHandler (
((UINT64)(RegionElement->Address) + RegionElement->Length))
{
ACPI_WARNING ((AE_INFO,
- "Request on [%4.4s] is beyond region limit Req-0x%X+0x%X, Base=0x%X, Len-0x%X",
+ "Request on [%4.4s] is beyond region limit "
+ "Req-0x%X+0x%X, Base=0x%X, Len-0x%X",
(RegionObject->Region.Node)->Name.Ascii, (UINT32) Address,
ByteWidth, (UINT32)(RegionElement->Address),
RegionElement->Length));
@@ -903,7 +905,7 @@ AeRegionHandler (
* Get BufferValue to point to the "address" in the buffer
*/
BufferValue = ((UINT8 *) RegionElement->Buffer +
- ((UINT64) Address - (UINT64) RegionElement->Address));
+ ((UINT64) Address - (UINT64) RegionElement->Address));
DoFunction:
/*
--
2.6.2
More information about the fwts-devel
mailing list