aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJung-uk Kim <jkim@FreeBSD.org>2012-07-11 16:51:47 +0000
committerJung-uk Kim <jkim@FreeBSD.org>2012-07-11 16:51:47 +0000
commit8724452f676e45bfd39cfb47234f7def5551f067 (patch)
treeadad4747b5f7a0166c805c0a7a6bdd4c884aa24b
parentafea6800ce201481ac6ebace2b4266b3b1b15d6e (diff)
downloadsrc-vendor/acpica/20120711.tar.gz
src-vendor/acpica/20120711.zip
Import ACPICA 20120711.vendor/acpica/20120711
-rw-r--r--Makefile16
-rw-r--r--changes.txt78
-rwxr-xr-xgenerate/release/build.sh1
-rw-r--r--generate/unix/Makefile110
-rw-r--r--generate/unix/Makefile.common100
-rw-r--r--generate/unix/acpibin/Makefile1
-rw-r--r--generate/unix/acpiexec/Makefile2
-rw-r--r--generate/unix/acpihelp/Makefile6
-rw-r--r--generate/unix/acpinames/Makefile2
-rw-r--r--generate/unix/iasl/Makefile1
-rw-r--r--source/compiler/Makefile1
-rw-r--r--source/compiler/aslmain.c9
-rw-r--r--source/components/debugger/dbcmds.c101
-rw-r--r--source/components/debugger/dbinput.c4
-rw-r--r--source/components/events/evxfgpe.c14
-rw-r--r--source/components/executer/exprep.c4
-rw-r--r--source/components/executer/exresolv.c2
-rw-r--r--source/components/executer/exstore.c6
-rw-r--r--source/components/executer/exutils.c2
-rw-r--r--source/components/hardware/hwsleep.c25
-rw-r--r--source/components/hardware/hwxfsleep.c8
-rw-r--r--source/components/namespace/nspredef.c2
-rw-r--r--source/components/parser/psxface.c4
-rw-r--r--source/components/resources/rscreate.c6
-rw-r--r--source/components/resources/rsutils.c2
-rw-r--r--source/components/tables/tbfadt.c31
-rw-r--r--source/components/tables/tbinstal.c5
-rw-r--r--source/components/tables/tbutils.c17
-rw-r--r--source/components/tables/tbxface.c159
-rw-r--r--source/components/tables/tbxfload.c406
-rw-r--r--source/components/tables/tbxfroot.c2
-rw-r--r--source/components/utilities/utdecode.c62
-rw-r--r--source/components/utilities/utexcep.c174
-rw-r--r--source/components/utilities/utglobal.c5
-rw-r--r--source/components/utilities/utmisc.c80
-rw-r--r--source/components/utilities/utobject.c6
-rw-r--r--source/components/utilities/utresrc.c4
-rw-r--r--source/components/utilities/utxferror.c81
-rw-r--r--source/include/acdebug.h3
-rw-r--r--source/include/acexcep.h5
-rw-r--r--source/include/acglobal.h9
-rw-r--r--source/include/acmacros.h4
-rw-r--r--source/include/acobject.h4
-rw-r--r--source/include/acoutput.h4
-rw-r--r--source/include/acpixf.h36
-rw-r--r--source/include/actbl1.h2
-rw-r--r--source/include/platform/acenv.h2
-rw-r--r--source/tools/acpibin/Makefile1
-rw-r--r--source/tools/acpiexec/Makefile2
-rw-r--r--source/tools/acpiexec/aecommon.h1
-rw-r--r--source/tools/acpiexec/aeexec.c52
-rw-r--r--source/tools/acpiexec/aemain.c6
-rw-r--r--source/tools/acpiexec/aetables.h72
-rw-r--r--source/tools/acpihelp/Makefile6
-rw-r--r--source/tools/acpihelp/acpihelp.h5
-rw-r--r--source/tools/acpihelp/ahdecode.c148
-rw-r--r--source/tools/acpihelp/ahmain.c20
-rw-r--r--source/tools/acpinames/Makefile2
-rw-r--r--source/tools/acpisrc/asfile.c2
-rw-r--r--source/tools/acpisrc/astable.c1
60 files changed, 1345 insertions, 581 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 000000000000..5ee33d734244
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,16 @@
+#
+# Common make for acpica tools and utilities
+#
+
+#
+# Note: This makefile is intended to be used from within the native
+# ACPICA directory structure, from under top level acpica directory.
+# It specifically places all the object files for each tool in separate
+# generate/unix subdirectories, not within the various ACPICA source
+# code directories. This prevents collisions between different
+# compilations of the same source file with different compile options.
+#
+BUILD_DIRECTORY_PATH = "generate/unix"
+
+include generate/unix/Makefile.config
+include generate/unix/Makefile.common
diff --git a/changes.txt b/changes.txt
index 21239371ccd8..605e67835db7 100644
--- a/changes.txt
+++ b/changes.txt
@@ -1,4 +1,82 @@
----------------------------------------
+11 July 2012. Summary of changes for version 20120711:
+
+This release is available at https://www.acpica.org/downloads The ACPI 5.0
+specification is available at www.acpi.info
+
+1) ACPICA Kernel-resident Subsystem:
+
+Fixed a possible fault in the return package object repair code. Fixes a
+problem that can occur when a lone package object is wrapped with an outer
+package object in order to force conformance to the ACPI specification. Can
+affect these predefined names: _ALR, _MLS, _PSS, _TRT, _TSS, _PRT, _HPX, _DLM,
+_CSD, _PSD, _TSD.
+
+Removed code to disable/enable bus master arbitration (ARB_DIS bit in the
+PM2_CNT register) in the ACPICA sleep/wake interfaces. Management of the
+ARB_DIS bit must be implemented in the host-dependent C3 processor power state
+support. Note, ARB_DIS is obsolete and only applies to older chipsets, both
+Intel and other vendors. (for Intel: ICH4-M and earlier)
+
+This change removes the code to disable/enable bus master arbitration during
+suspend/resume. Use of the ARB_DIS bit in the optional PM2_CNT register causes
+resume problems on some machines. The change has been in use for over seven
+years within Linux.
+
+Implemented two new external interfaces to support host-directed dynamic ACPI
+table load and unload. They are intended to simplify the host implementation
+of hot-plug support:
+ AcpiLoadTable: Load an SSDT from a buffer into the namespace.
+ AcpiUnloadParentTable: Unload an SSDT via a named object owned by the table.
+See the ACPICA reference for additional details. Adds one new file,
+components/tables/tbxfload.c
+
+Implemented and deployed two new interfaces for errors and warnings that are
+known to be caused by BIOS/firmware issues:
+ AcpiBiosError: Prints "ACPI Firmware Error" message.
+ AcpiBiosWarning: Prints "ACPI Firmware Warning" message.
+Deployed these new interfaces in the ACPICA Table Manager code for ACPI table
+and FADT errors. Additional deployment to be completed as appropriate in the
+future. The associated conditional macros are ACPI_BIOS_ERROR and
+ACPI_BIOS_WARNING. See the ACPICA reference for additional details. ACPICA BZ
+843.
+
+Implicit notify support: ensure that no memory allocation occurs within a
+critical region. This fix moves a memory allocation outside of the time that a
+spinlock is held. Fixes issues on systems that do not allow this behavior.
+Jung-uk Kim.
+
+Split exception code utilities and tables into a new file, utilities/utexcep.c
+
+Example Code and Data Size: These are the sizes for the OS-independent
+acpica.lib produced by the Microsoft Visual C++ 9.0 32-bit compiler. The debug
+version of the code includes the debug output trace mechanism and has a much
+larger code and data size.
+
+ Previous Release:
+ Non-Debug Version: 93.1K Code, 25.1K Data, 118.2K Total
+ Debug Version: 172.9K Code, 73.6K Data, 246.5K Total
+ Current Release:
+ Non-Debug Version: 93.5K Code, 25.3K Data, 118.8K Total
+ Debug Version: 173.7K Code, 74.0K Data, 247.7K Total
+
+
+2) iASL Compiler/Disassembler and Tools:
+
+iASL: Fixed a parser problem for hosts where EOF is defined as -1 instead of
+0. Jung-uk Kim.
+
+Debugger: Enhanced the "tables" command to emit additional information about
+the current set of ACPI tables, including the owner ID and flags decode.
+
+Debugger: Reimplemented the "unload" command to use the new
+AcpiUnloadParentTable external interface. This command was disable previously
+due to need for an unload interface.
+
+AcpiHelp: Added a new option to decode ACPICA exception codes. The -e option
+will decode 16-bit hex status codes (ACPI_STATUS) to name strings.
+
+----------------------------------------
20 June 2012. Summary of changes for version 20120620:
This release is available at https://www.acpica.org/downloads
diff --git a/generate/release/build.sh b/generate/release/build.sh
index e405a307b708..ab87792709fa 100755
--- a/generate/release/build.sh
+++ b/generate/release/build.sh
@@ -254,6 +254,7 @@ generate_source_package ()
#
# Copy generic UNIX makefiles
#
+ cp Makefile $TEMP_DIR
cp generate/unix/readme.txt $TEMP_DIR/generate/unix/readme.txt
cp generate/unix/Makefile* $TEMP_DIR/generate/unix
cp generate/unix/acpibin/Makefile $TEMP_DIR/generate/unix/acpibin
diff --git a/generate/unix/Makefile b/generate/unix/Makefile
index 071b17da1959..5b187d7d0ac8 100644
--- a/generate/unix/Makefile
+++ b/generate/unix/Makefile
@@ -4,107 +4,13 @@
#
# Note: This makefile is intended to be used from within the native
-# ACPICA directory structure, from under generate/unix. It specifically
-# places all object files in a generate/unix subdirectory, not within
-# the various ACPICA source directories. This prevents collisions
-# between different compilations of the same source file with different
-# compile options, and prevents pollution of the source code.
+# ACPICA directory structure, from under the generate/unix directory.
+# It specifically places all the object files for each tool in separate
+# generate/unix subdirectories, not within the various ACPICA source
+# code directories. This prevents collisions between different
+# compilations of the same source file with different compile options.
#
-include Makefile.config
-
-#
-# Get the OS machine architecture. Anything with a "64" in the returned
-# string will be treated as a 64-bit OS. Otherwise, the default is 32-bit.
-#
-HARDWARE_NAME := $(shell uname -m)
-
-#
-# Main rule will only generate versions that are appropriate for the running
-# OS, either 64-bit or 32-bit.
-#
-all: ${PROGS}
-${PROGS}: FORCE
- @cd $@; \
- if [ $(findstring 64,$(HARDWARE_NAME)) ]; then \
- mkdir -p obj64; \
- make BITS=64; \
- echo "64-bit version of $@:"; \
- ls -al obj64/$@; \
- else \
- mkdir -p obj32; \
- make BITS=32; \
- echo "32-bit version of $@:"; \
- ls -al obj32/$@; \
- fi;
-
-#
-# Make 32-bit and 64-bit versions of all the tools
-#
-both: 32 64
-
-#
-# Make only 32-bit versions of all the tools
-#
-32: FORCE
- @for toolname in ${PROGS}; do \
- (cd $$toolname; \
- pwd; \
- mkdir -p obj32; \
- make BITS=32; \
- echo "32-bit version of $$toolname:"; \
- ls -al obj32/$$toolname \
- ); \
- done;
-
-#
-# Make only 64-bit versions of all the tools
-#
-64: FORCE
- @for toolname in ${PROGS}; do \
- (cd $$toolname; \
- pwd; \
- mkdir -p obj64; \
- make BITS=64; \
- echo "64-bit version of $$toolname:"; \
- ls -al obj64/$$toolname \
- ); \
- done;
-
-clean: FORCE
- @for toolname in ${PROGS}; do \
- (cd $$toolname; \
- pwd; \
- if [ -d "obj32" ] ; then \
- make BITS=32 clean; \
- rmdir obj32; \
- fi; \
- if [ -d "obj64" ] ; then \
- make BITS=64 clean; \
- rmdir obj64; \
- fi; \
- ); \
- done;
-
-#
-# Install all tools, either 32-bit or 64-bit as appropriate for the host OS
-#
-install: FORCE
- @for toolname in ${PROGS}; do \
- (cd $$toolname; \
- pwd; \
- if [ $(findstring 64,$(HARDWARE_NAME)) ]; then \
- make BITS=64 install; \
- echo "Installed 64-bit version of $$toolname"; \
- else \
- make BITS=32 install; \
- echo "Installed 32-bit version of $$toolname"; \
- fi; \
- ); \
- done;
-
-machine: FORCE
- @echo "Machine architecture: $(HARDWARE_NAME), $(XBITS)";
- @echo "Findstring: $(findstring 64, $(HARDWARE_NAME))";
-
-FORCE:
+BUILD_DIRECTORY_PATH = "."
+include Makefile.config
+include Makefile.common
diff --git a/generate/unix/Makefile.common b/generate/unix/Makefile.common
new file mode 100644
index 000000000000..2d7ac70511ac
--- /dev/null
+++ b/generate/unix/Makefile.common
@@ -0,0 +1,100 @@
+#
+# Common make for acpica tools and utilities
+#
+
+#
+# Get the OS machine architecture. Anything with a "64" in the returned
+# string will be treated as a 64-bit OS. Otherwise, the default is 32-bit.
+#
+HARDWARE_NAME := $(shell uname -m)
+
+#
+# Main rule will only generate versions that are appropriate for the running
+# OS, either 64-bit or 32-bit.
+#
+all: ${PROGS}
+${PROGS}: FORCE
+ @cd $(BUILD_DIRECTORY_PATH)/$@; \
+ if [ $(findstring 64,$(HARDWARE_NAME)) ]; then \
+ mkdir -p obj64; \
+ make BITS=64; \
+ echo "64-bit version of $@:"; \
+ ls -al obj64/$@; \
+ else \
+ mkdir -p obj32; \
+ make BITS=32; \
+ echo "32-bit version of $@:"; \
+ ls -al obj32/$@; \
+ fi;
+
+#
+# Make 32-bit and 64-bit versions of all the tools
+#
+both: 32 64
+
+#
+# Make only 32-bit versions of all the tools
+#
+32: FORCE
+ @for toolname in ${PROGS}; do \
+ (cd $(BUILD_DIRECTORY_PATH)/$$toolname; \
+ pwd; \
+ mkdir -p obj32; \
+ make BITS=32; \
+ echo "32-bit version of $$toolname:"; \
+ ls -al obj32/$$toolname \
+ ); \
+ done;
+
+#
+# Make only 64-bit versions of all the tools
+#
+64: FORCE
+ @for toolname in ${PROGS}; do \
+ (cd $(BUILD_DIRECTORY_PATH)/$$toolname; \
+ pwd; \
+ mkdir -p obj64; \
+ make BITS=64; \
+ echo "64-bit version of $$toolname:"; \
+ ls -al obj64/$$toolname \
+ ); \
+ done;
+
+clean: FORCE
+ @for toolname in ${PROGS}; do \
+ (cd $(BUILD_DIRECTORY_PATH)/$$toolname; \
+ pwd; \
+ if [ -d "obj32" ] ; then \
+ make BITS=32 clean; \
+ rmdir obj32; \
+ fi; \
+ if [ -d "obj64" ] ; then \
+ make BITS=64 clean; \
+ rmdir obj64; \
+ fi; \
+ ); \
+ done;
+
+#
+# Install all tools, either 32-bit or 64-bit as appropriate for the host OS
+#
+install: FORCE
+ @for toolname in ${PROGS}; do \
+ (cd $(BUILD_DIRECTORY_PATH)/$$toolname; \
+ pwd; \
+ if [ $(findstring 64,$(HARDWARE_NAME)) ]; then \
+ make BITS=64 install; \
+ echo "Installed 64-bit version of $$toolname"; \
+ else \
+ make BITS=32 install; \
+ echo "Installed 32-bit version of $$toolname"; \
+ fi; \
+ ); \
+ done;
+
+machine: FORCE
+ @echo "Machine architecture: $(HARDWARE_NAME), $(XBITS)";
+ @echo "Findstring: $(findstring 64, $(HARDWARE_NAME))";
+
+FORCE:
+
diff --git a/generate/unix/acpibin/Makefile b/generate/unix/acpibin/Makefile
index d1113c1aa55d..e26f209d7c88 100644
--- a/generate/unix/acpibin/Makefile
+++ b/generate/unix/acpibin/Makefile
@@ -32,6 +32,7 @@ OBJECTS = \
$(OBJDIR)/utcache.o \
$(OBJDIR)/utdebug.o \
$(OBJDIR)/utdecode.o \
+ $(OBJDIR)/utexcep.o \
$(OBJDIR)/utglobal.o \
$(OBJDIR)/utlock.o \
$(OBJDIR)/utmath.o \
diff --git a/generate/unix/acpiexec/Makefile b/generate/unix/acpiexec/Makefile
index f8e844e3c661..80ef514d7b3b 100644
--- a/generate/unix/acpiexec/Makefile
+++ b/generate/unix/acpiexec/Makefile
@@ -172,6 +172,7 @@ OBJECTS = \
$(OBJDIR)/tbinstal.o \
$(OBJDIR)/tbutils.o \
$(OBJDIR)/tbxface.o \
+ $(OBJDIR)/tbxfload.o \
$(OBJDIR)/tbxfroot.o \
$(OBJDIR)/utaddress.o \
$(OBJDIR)/utalloc.o \
@@ -181,6 +182,7 @@ OBJECTS = \
$(OBJDIR)/utdecode.o \
$(OBJDIR)/utdelete.o \
$(OBJDIR)/uteval.o \
+ $(OBJDIR)/utexcep.o \
$(OBJDIR)/utglobal.o \
$(OBJDIR)/utids.o \
$(OBJDIR)/utinit.o \
diff --git a/generate/unix/acpihelp/Makefile b/generate/unix/acpihelp/Makefile
index aee76ed17aea..30a690c9d1e9 100644
--- a/generate/unix/acpihelp/Makefile
+++ b/generate/unix/acpihelp/Makefile
@@ -19,7 +19,8 @@ PROG = $(OBJDIR)/acpihelp
#
vpath %.c \
$(ACPIHELP) \
- $(ACPICA_COMMON)
+ $(ACPICA_COMMON) \
+ $(ACPICA_UTILITIES)
HEADERS = \
$(wildcard $(ACPIHELP)/*.h)
@@ -31,7 +32,8 @@ OBJECTS = \
$(OBJDIR)/ahdecode.o \
$(OBJDIR)/ahpredef.o \
$(OBJDIR)/ahmain.o \
- $(OBJDIR)/getopt.o
+ $(OBJDIR)/getopt.o \
+ $(OBJDIR)/utexcep.o
#
# Flags specific to acpihelp
diff --git a/generate/unix/acpinames/Makefile b/generate/unix/acpinames/Makefile
index 84b5a150a38a..ed3304dbfa66 100644
--- a/generate/unix/acpinames/Makefile
+++ b/generate/unix/acpinames/Makefile
@@ -81,6 +81,7 @@ OBJECTS = \
$(OBJDIR)/tbinstal.o \
$(OBJDIR)/tbutils.o \
$(OBJDIR)/tbxface.o \
+ $(OBJDIR)/tbxfload.o \
$(OBJDIR)/tbxfroot.o \
$(OBJDIR)/utaddress.o \
$(OBJDIR)/utalloc.o \
@@ -88,6 +89,7 @@ OBJECTS = \
$(OBJDIR)/utdebug.o \
$(OBJDIR)/utdecode.o \
$(OBJDIR)/utdelete.o \
+ $(OBJDIR)/utexcep.o \
$(OBJDIR)/utglobal.o \
$(OBJDIR)/utlock.o \
$(OBJDIR)/utmath.o \
diff --git a/generate/unix/iasl/Makefile b/generate/unix/iasl/Makefile
index 53ba00141a95..0a09aa0db9d8 100644
--- a/generate/unix/iasl/Makefile
+++ b/generate/unix/iasl/Makefile
@@ -169,6 +169,7 @@ OBJECTS = \
$(OBJDIR)/utdebug.o \
$(OBJDIR)/utdecode.o \
$(OBJDIR)/utdelete.o \
+ $(OBJDIR)/utexcep.o \
$(OBJDIR)/utglobal.o \
$(OBJDIR)/utinit.o \
$(OBJDIR)/utlock.o \
diff --git a/source/compiler/Makefile b/source/compiler/Makefile
index 9f704d2dbd3c..86e07536d42f 100644
--- a/source/compiler/Makefile
+++ b/source/compiler/Makefile
@@ -201,6 +201,7 @@ OBJECTS = \
utdebug.o \
utdecode.o \
utdelete.o \
+ utexcep.o \
utglobal.o \
utinit.o \
utlock.o \
diff --git a/source/compiler/aslmain.c b/source/compiler/aslmain.c
index 0e3e34d2bd95..568f395becf8 100644
--- a/source/compiler/aslmain.c
+++ b/source/compiler/aslmain.c
@@ -96,7 +96,7 @@ AslDoResponseFile (
#define ASL_TOKEN_SEPARATORS " \t\n"
-#define ASL_SUPPORTED_OPTIONS "@:2b|c|d^D:e:fgh^i|I:l^mno|p:P^r:s|t|T:G^v|w|x:z"
+#define ASL_SUPPORTED_OPTIONS "@:2b|c|d^D:e:fgh^i|I:l^mno|p:P^r:s|t|T:G^v^w|x:z"
/*******************************************************************************
@@ -119,6 +119,7 @@ Options (
printf ("\nGlobal:\n");
ACPI_OPTION ("-@ <file>", "Specify command file");
ACPI_OPTION ("-I <dir>", "Specify additional include directory");
+ ACPI_OPTION ("-v", "Display compiler version");
printf ("\nPreprocessor:\n");
ACPI_OPTION ("-D <symbol>", "Define symbol for preprocessor use");
@@ -751,9 +752,13 @@ AslDoOptions (
break;
- case 'v': /* Verbosity settings */
+ case 'v': /* Version and verbosity settings */
switch (AcpiGbl_Optarg[0])
{
+ case '^':
+ printf (ACPI_COMMON_SIGNON (ASL_COMPILER_NAME));
+ exit (0);
+
case 'a':
/* Disable All error/warning messages */
diff --git a/source/components/debugger/dbcmds.c b/source/components/debugger/dbcmds.c
index 459cd916ee5d..93d4f294dd09 100644
--- a/source/components/debugger/dbcmds.c
+++ b/source/components/debugger/dbcmds.c
@@ -254,12 +254,53 @@ AcpiDbDisplayTableInfo (
ACPI_STATUS Status;
+ /* Header */
+
+ AcpiOsPrintf ("Idx ID Status Type Sig Address Len Header\n");
+
/* Walk the entire root table list */
for (i = 0; i < AcpiGbl_RootTableList.CurrentTableCount; i++)
{
TableDesc = &AcpiGbl_RootTableList.Tables[i];
- AcpiOsPrintf ("%u ", i);
+
+ /* Index and Table ID */
+
+ AcpiOsPrintf ("%3u %.2u ", i, TableDesc->OwnerId);
+
+ /* Decode the table flags */
+
+ if (!(TableDesc->Flags & ACPI_TABLE_IS_LOADED))
+ {
+ AcpiOsPrintf ("NotLoaded ");
+ }
+ else
+ {
+ AcpiOsPrintf (" Loaded ");
+ }
+
+ switch (TableDesc->Flags & ACPI_TABLE_ORIGIN_MASK)
+ {
+ case ACPI_TABLE_ORIGIN_UNKNOWN:
+ AcpiOsPrintf ("Unknown ");
+ break;
+
+ case ACPI_TABLE_ORIGIN_MAPPED:
+ AcpiOsPrintf ("Mapped ");
+ break;
+
+ case ACPI_TABLE_ORIGIN_ALLOCATED:
+ AcpiOsPrintf ("Allocated ");
+ break;
+
+ case ACPI_TABLE_ORIGIN_OVERRIDE:
+ AcpiOsPrintf ("Override ");
+ break;
+
+ default:
+ AcpiOsPrintf ("INVALID ");
+ break;
+ }
/* Make sure that the table is mapped */
@@ -290,55 +331,45 @@ AcpiDbDisplayTableInfo (
*
* FUNCTION: AcpiDbUnloadAcpiTable
*
- * PARAMETERS: TableArg - Name of the table to be unloaded
- * InstanceArg - Which instance of the table to unload (if
- * there are multiple tables of the same type)
+ * PARAMETERS: ObjectName - Namespace pathname for an object that
+ * is owned by the table to be unloaded
*
- * RETURN: Nonde
+ * RETURN: None
*
- * DESCRIPTION: Unload an ACPI table.
- * Instance is not implemented
+ * DESCRIPTION: Unload an ACPI table, via any namespace node that is owned
+ * by the table.
*
******************************************************************************/
void
AcpiDbUnloadAcpiTable (
- char *TableArg,
- char *InstanceArg)
+ char *ObjectName)
{
-/* TBD: Need to reimplement for new data structures */
-
-#if 0
- UINT32 i;
+ ACPI_NAMESPACE_NODE *Node;
ACPI_STATUS Status;
- /* Search all tables for the target type */
+ /* Translate name to an Named object */
- for (i = 0; i < (ACPI_TABLE_ID_MAX+1); i++)
+ Node = AcpiDbConvertToNode (ObjectName);
+ if (!Node)
{
- if (!ACPI_STRNCMP (TableArg, AcpiGbl_TableData[i].Signature,
- AcpiGbl_TableData[i].SigLength))
- {
- /* Found the table, unload it */
-
- Status = AcpiUnloadTable (i);
- if (ACPI_SUCCESS (Status))
- {
- AcpiOsPrintf ("[%s] unloaded and uninstalled\n", TableArg);
- }
- else
- {
- AcpiOsPrintf ("%s, while unloading [%s]\n",
- AcpiFormatException (Status), TableArg);
- }
-
- return;
- }
+ AcpiOsPrintf ("Could not find [%s] in namespace\n",
+ ObjectName);
+ return;
}
- AcpiOsPrintf ("Unknown table type [%s]\n", TableArg);
-#endif
+ Status = AcpiUnloadParentTable (ACPI_CAST_PTR (ACPI_HANDLE, Node));
+ if (ACPI_SUCCESS (Status))
+ {
+ AcpiOsPrintf ("Parent of [%s] (%p) unloaded and uninstalled\n",
+ ObjectName, Node);
+ }
+ else
+ {
+ AcpiOsPrintf ("%s, while unloading parent table of [%s]\n",
+ AcpiFormatException (Status), ObjectName);
+ }
}
diff --git a/source/components/debugger/dbinput.c b/source/components/debugger/dbinput.c
index 0ae313934b40..42452ac8749f 100644
--- a/source/components/debugger/dbinput.c
+++ b/source/components/debugger/dbinput.c
@@ -250,7 +250,7 @@ AcpiDbDisplayHelp (
AcpiOsPrintf (" Stack Display CPU stack usage\n");
AcpiOsPrintf (" Tables Info about current ACPI table(s)\n");
AcpiOsPrintf (" Tables Display info about loaded ACPI tables\n");
- AcpiOsPrintf (" Unload <TableSig> [Instance] Unload an ACPI table\n");
+ AcpiOsPrintf (" Unload <Namepath> Unload an ACPI table via namespace object\n");
AcpiOsPrintf (" ! <CommandNumber> Execute command from history buffer\n");
AcpiOsPrintf (" !! Execute last command again\n");
@@ -894,7 +894,7 @@ AcpiDbCommandDispatch (
break;
case CMD_UNLOAD:
- AcpiDbUnloadAcpiTable (AcpiGbl_DbArgs[1], AcpiGbl_DbArgs[2]);
+ AcpiDbUnloadAcpiTable (AcpiGbl_DbArgs[1]);
break;
case CMD_EXIT:
diff --git a/source/components/events/evxfgpe.c b/source/components/events/evxfgpe.c
index 750c46028fce..4194651def8e 100644
--- a/source/components/events/evxfgpe.c
+++ b/source/components/events/evxfgpe.c
@@ -83,7 +83,7 @@ AcpiUpdateAllGpes (
ACPI_STATUS Status;
- ACPI_FUNCTION_TRACE (AcpiUpdateGpes);
+ ACPI_FUNCTION_TRACE (AcpiUpdateAllGpes);
Status = AcpiUtAcquireMutex (ACPI_MTX_EVENTS);
@@ -298,7 +298,8 @@ AcpiSetupGpeForWake (
ACPI_STATUS Status;
ACPI_GPE_EVENT_INFO *GpeEventInfo;
ACPI_NAMESPACE_NODE *DeviceNode;
- ACPI_GPE_NOTIFY_INFO *NewNotify, *Notify;
+ ACPI_GPE_NOTIFY_INFO *Notify;
+ ACPI_GPE_NOTIFY_INFO *NewNotify;
ACPI_CPU_FLAGS Flags;
@@ -334,6 +335,11 @@ AcpiSetupGpeForWake (
return_ACPI_STATUS (AE_BAD_PARAMETER);
}
+ /*
+ * Allocate a new notify object up front, in case it is needed.
+ * Memory allocation while holding a spinlock is a big no-no
+ * on some hosts.
+ */
NewNotify = ACPI_ALLOCATE_ZEROED (sizeof (ACPI_GPE_NOTIFY_INFO));
if (!NewNotify)
{
@@ -401,8 +407,12 @@ AcpiSetupGpeForWake (
GpeEventInfo->Flags |= ACPI_GPE_CAN_WAKE;
Status = AE_OK;
+
UnlockAndExit:
AcpiOsReleaseLock (AcpiGbl_GpeLock, Flags);
+
+ /* Delete the notify object if it was not used above */
+
if (NewNotify)
{
ACPI_FREE (NewNotify);
diff --git a/source/components/executer/exprep.c b/source/components/executer/exprep.c
index 9ec78275bd6f..6b8f69130ccd 100644
--- a/source/components/executer/exprep.c
+++ b/source/components/executer/exprep.c
@@ -418,8 +418,8 @@ AcpiExPrepCommonFieldObject (
*
* RETURN: Status
*
- * DESCRIPTION: Construct an ACPI_OPERAND_OBJECT of type DefField and
- * connect it to the parent Node.
+ * DESCRIPTION: Construct an object of type ACPI_OPERAND_OBJECT with a
+ * subtype of DefField and connect it to the parent Node.
*
******************************************************************************/
diff --git a/source/components/executer/exresolv.c b/source/components/executer/exresolv.c
index e92fb2468e77..72286b0e8587 100644
--- a/source/components/executer/exresolv.c
+++ b/source/components/executer/exresolv.c
@@ -165,7 +165,7 @@ AcpiExResolveObjectToValue (
StackDesc = *StackPtr;
- /* This is an ACPI_OPERAND_OBJECT */
+ /* This is an object of type ACPI_OPERAND_OBJECT */
switch (StackDesc->Common.Type)
{
diff --git a/source/components/executer/exstore.c b/source/components/executer/exstore.c
index 656b64947862..3a88811950b0 100644
--- a/source/components/executer/exstore.c
+++ b/source/components/executer/exstore.c
@@ -68,15 +68,15 @@ AcpiExStoreObjectToIndex (
* FUNCTION: AcpiExStore
*
* PARAMETERS: *SourceDesc - Value to be stored
- * *DestDesc - Where to store it. Must be an NS node
- * or an ACPI_OPERAND_OBJECT of type
+ * *DestDesc - Where to store it. Must be an NS node
+ * or ACPI_OPERAND_OBJECT of type
* Reference;
* WalkState - Current walk state
*
* RETURN: Status
*
* DESCRIPTION: Store the value described by SourceDesc into the location
- * described by DestDesc. Called by various interpreter
+ * described by DestDesc. Called by various interpreter
* functions to store the result of an operation into
* the destination operand -- not just simply the actual "Store"
* ASL operator.
diff --git a/source/components/executer/exutils.c b/source/components/executer/exutils.c
index b5eca064a20b..faf34fca1cff 100644
--- a/source/components/executer/exutils.c
+++ b/source/components/executer/exutils.c
@@ -121,7 +121,7 @@ AcpiExEnterInterpreter (
*
* DESCRIPTION: Reacquire the interpreter execution region from within the
* interpreter code. Failure to enter the interpreter region is a
- * fatal system error. Used in conjuction with
+ * fatal system error. Used in conjunction with
* RelinquishInterpreter
*
******************************************************************************/
diff --git a/source/components/hardware/hwsleep.c b/source/components/hardware/hwsleep.c
index 1953ff846e80..1957fbdf2764 100644
--- a/source/components/hardware/hwsleep.c
+++ b/source/components/hardware/hwsleep.c
@@ -99,20 +99,6 @@ AcpiHwLegacySleep (
return_ACPI_STATUS (Status);
}
- if (SleepState != ACPI_STATE_S5)
- {
- /*
- * Disable BM arbitration. This feature is contained within an
- * optional register (PM2 Control), so ignore a BAD_ADDRESS
- * exception.
- */
- Status = AcpiWriteBitRegister (ACPI_BITREG_ARB_DISABLE, 1);
- if (ACPI_FAILURE (Status) && (Status != AE_BAD_ADDRESS))
- {
- return_ACPI_STATUS (Status);
- }
- }
-
/*
* 1) Disable/Clear all GPEs
* 2) Enable all wakeup GPEs
@@ -380,17 +366,6 @@ AcpiHwLegacyWake (
AcpiGbl_FixedEventInfo[ACPI_EVENT_POWER_BUTTON].StatusRegisterId,
ACPI_CLEAR_STATUS);
- /*
- * Enable BM arbitration. This feature is contained within an
- * optional register (PM2 Control), so ignore a BAD_ADDRESS
- * exception.
- */
- Status = AcpiWriteBitRegister (ACPI_BITREG_ARB_DISABLE, 0);
- if (ACPI_FAILURE (Status) && (Status != AE_BAD_ADDRESS))
- {
- return_ACPI_STATUS (Status);
- }
-
AcpiHwExecuteSleepMethod (METHOD_PATHNAME__SST, ACPI_SST_WORKING);
return_ACPI_STATUS (Status);
}
diff --git a/source/components/hardware/hwxfsleep.c b/source/components/hardware/hwxfsleep.c
index b7cbbc813e65..caa51a8a4a62 100644
--- a/source/components/hardware/hwxfsleep.c
+++ b/source/components/hardware/hwxfsleep.c
@@ -101,6 +101,14 @@ AcpiSetFirmwareWakingVector (
ACPI_FUNCTION_TRACE (AcpiSetFirmwareWakingVector);
+ /*
+ * According to the ACPI specification 2.0c and later, the 64-bit
+ * waking vector should be cleared and the 32-bit waking vector should
+ * be used, unless we want the wake-up code to be called by the BIOS in
+ * Protected Mode. Some systems (for example HP dv5-1004nr) are known
+ * to fail to resume if the 64-bit vector is used.
+ */
+
/* Set the 32-bit vector */
AcpiGbl_FACS->FirmwareWakingVector = PhysicalAddress;
diff --git a/source/components/namespace/nspredef.c b/source/components/namespace/nspredef.c
index 3a61aa3666e8..cb3a99103313 100644
--- a/source/components/namespace/nspredef.c
+++ b/source/components/namespace/nspredef.c
@@ -681,7 +681,7 @@ AcpiNsCheckPackage (
{
/* Create the new outer package and populate it */
- Status = AcpiNsWrapWithPackage (Data, *Elements, ReturnObjectPtr);
+ Status = AcpiNsWrapWithPackage (Data, ReturnObject, ReturnObjectPtr);
if (ACPI_FAILURE (Status))
{
return (Status);
diff --git a/source/components/parser/psxface.c b/source/components/parser/psxface.c
index 2a012c2915c9..a9ceb6d26d17 100644
--- a/source/components/parser/psxface.c
+++ b/source/components/parser/psxface.c
@@ -348,8 +348,8 @@ AcpiPsExecuteMethod (
}
/*
- * Start method evaluation with an implicit return of zero. This is done
- * for Windows compatibility.
+ * Start method evaluation with an implicit return of zero.
+ * This is done for Windows compatibility.
*/
if (AcpiGbl_EnableInterpreterSlack)
{
diff --git a/source/components/resources/rscreate.c b/source/components/resources/rscreate.c
index f06ea0cb4dc2..dcfe7e436174 100644
--- a/source/components/resources/rscreate.c
+++ b/source/components/resources/rscreate.c
@@ -209,8 +209,8 @@ AcpiRsCreateResourceList (
*
* FUNCTION: AcpiRsCreatePciRoutingTable
*
- * PARAMETERS: PackageObject - Pointer to an ACPI_OPERAND_OBJECT
- * package
+ * PARAMETERS: PackageObject - Pointer to a package containing one
+ * of more ACPI_OPERAND_OBJECTs
* OutputBuffer - Pointer to the user's buffer
*
* RETURN: Status AE_OK if okay, else a valid ACPI_STATUS code.
@@ -218,7 +218,7 @@ AcpiRsCreateResourceList (
* AE_BUFFER_OVERFLOW and OutputBuffer->Length will point
* to the size buffer needed.
*
- * DESCRIPTION: Takes the ACPI_OPERAND_OBJECT package and creates a
+ * DESCRIPTION: Takes the ACPI_OPERAND_OBJECT package and creates a
* linked list of PCI interrupt descriptions
*
* NOTE: It is the caller's responsibility to ensure that the start of the
diff --git a/source/components/resources/rsutils.c b/source/components/resources/rsutils.c
index 062678651ec1..273638f3f4fc 100644
--- a/source/components/resources/rsutils.c
+++ b/source/components/resources/rsutils.c
@@ -181,7 +181,7 @@ AcpiRsMoveData (
/*
* 16-, 32-, and 64-bit cases must use the move macros that perform
- * endian conversion and/or accomodate hardware that cannot perform
+ * endian conversion and/or accommodate hardware that cannot perform
* misaligned memory transfers
*/
case ACPI_RSC_MOVE16:
diff --git a/source/components/tables/tbfadt.c b/source/components/tables/tbfadt.c
index 46925114ebe4..0bc6f28ece2b 100644
--- a/source/components/tables/tbfadt.c
+++ b/source/components/tables/tbfadt.c
@@ -192,7 +192,7 @@ static ACPI_FADT_PM_INFO FadtPmInfoTable[] =
*
* PARAMETERS: GenericAddress - GAS struct to be initialized
* SpaceId - ACPI Space ID for this register
- * ByteWidth - Width of this register, in bytes
+ * ByteWidth - Width of this register
* Address - Address of the register
*
* RETURN: None
@@ -338,7 +338,7 @@ AcpiTbCreateLocalFadt (
*/
if (Length > sizeof (ACPI_TABLE_FADT))
{
- ACPI_WARNING ((AE_INFO,
+ ACPI_BIOS_WARNING ((AE_INFO,
"FADT (revision %u) is longer than ACPI 5.0 version, "
"truncating length %u to %u",
Table->Revision, Length, (UINT32) sizeof (ACPI_TABLE_FADT)));
@@ -486,8 +486,9 @@ AcpiTbConvertFadt (
if (Address64->Address && Address32 &&
(Address64->Address != (UINT64) Address32))
{
- ACPI_ERROR ((AE_INFO,
- "32/64X address mismatch in %s: 0x%8.8X/0x%8.8X%8.8X, using 32",
+ ACPI_BIOS_ERROR ((AE_INFO,
+ "32/64X address mismatch in FADT/%s: "
+ "0x%8.8X/0x%8.8X%8.8X, using 32",
FadtInfoTable[i].Name, Address32,
ACPI_FORMAT_UINT64 (Address64->Address)));
}
@@ -546,7 +547,7 @@ AcpiTbValidateFadt (
if (AcpiGbl_FADT.Facs &&
(AcpiGbl_FADT.XFacs != (UINT64) AcpiGbl_FADT.Facs))
{
- ACPI_WARNING ((AE_INFO,
+ ACPI_BIOS_WARNING ((AE_INFO,
"32/64X FACS address mismatch in FADT - "
"0x%8.8X/0x%8.8X%8.8X, using 32",
AcpiGbl_FADT.Facs, ACPI_FORMAT_UINT64 (AcpiGbl_FADT.XFacs)));
@@ -557,7 +558,7 @@ AcpiTbValidateFadt (
if (AcpiGbl_FADT.Dsdt &&
(AcpiGbl_FADT.XDsdt != (UINT64) AcpiGbl_FADT.Dsdt))
{
- ACPI_WARNING ((AE_INFO,
+ ACPI_BIOS_WARNING ((AE_INFO,
"32/64X DSDT address mismatch in FADT - "
"0x%8.8X/0x%8.8X%8.8X, using 32",
AcpiGbl_FADT.Dsdt, ACPI_FORMAT_UINT64 (AcpiGbl_FADT.XDsdt)));
@@ -593,8 +594,8 @@ AcpiTbValidateFadt (
if (Address64->Address &&
(Address64->BitWidth != ACPI_MUL_8 (Length)))
{
- ACPI_WARNING ((AE_INFO,
- "32/64X length mismatch in %s: %u/%u",
+ ACPI_BIOS_WARNING ((AE_INFO,
+ "32/64X length mismatch in FADT/%s: %u/%u",
Name, ACPI_MUL_8 (Length), Address64->BitWidth));
}
@@ -606,9 +607,9 @@ AcpiTbValidateFadt (
*/
if (!Address64->Address || !Length)
{
- ACPI_ERROR ((AE_INFO,
- "Required field %s has zero address and/or length:"
- " 0x%8.8X%8.8X/0x%X",
+ ACPI_BIOS_ERROR ((AE_INFO,
+ "Required FADT field %s has zero address and/or length: "
+ "0x%8.8X%8.8X/0x%X",
Name, ACPI_FORMAT_UINT64 (Address64->Address), Length));
}
}
@@ -622,8 +623,8 @@ AcpiTbValidateFadt (
if ((Address64->Address && !Length) ||
(!Address64->Address && Length))
{
- ACPI_WARNING ((AE_INFO,
- "Optional field %s has zero address or length: "
+ ACPI_BIOS_WARNING ((AE_INFO,
+ "Optional FADT field %s has zero address or length: "
"0x%8.8X%8.8X/0x%X",
Name, ACPI_FORMAT_UINT64 (Address64->Address), Length));
}
@@ -674,8 +675,8 @@ AcpiTbSetupFadtRegisters (
(FadtInfoTable[i].DefaultLength > 0) &&
(FadtInfoTable[i].DefaultLength != Target64->BitWidth))
{
- ACPI_WARNING ((AE_INFO,
- "Invalid length for %s: %u, using default %u",
+ ACPI_BIOS_WARNING ((AE_INFO,
+ "Invalid length for FADT/%s: %u, using default %u",
FadtInfoTable[i].Name, Target64->BitWidth,
FadtInfoTable[i].DefaultLength));
diff --git a/source/components/tables/tbinstal.c b/source/components/tables/tbinstal.c
index f100ab43f721..648ee75a8963 100644
--- a/source/components/tables/tbinstal.c
+++ b/source/components/tables/tbinstal.c
@@ -157,8 +157,9 @@ AcpiTbAddTable (
(!ACPI_COMPARE_NAME (TableDesc->Pointer->Signature, ACPI_SIG_SSDT)) &&
(ACPI_STRNCMP (TableDesc->Pointer->Signature, "OEM", 3)))
{
- ACPI_ERROR ((AE_INFO,
- "Table has invalid signature [%4.4s] (0x%8.8X), must be SSDT or OEMx",
+ ACPI_BIOS_ERROR ((AE_INFO,
+ "Table has invalid signature [%4.4s] (0x%8.8X), "
+ "must be SSDT or OEMx",
AcpiUtValidAcpiName (*(UINT32 *) TableDesc->Pointer->Signature) ?
TableDesc->Pointer->Signature : "????",
*(UINT32 *) TableDesc->Pointer->Signature));
diff --git a/source/components/tables/tbutils.c b/source/components/tables/tbutils.c
index e8b5705e96e7..c0a94562adc3 100644
--- a/source/components/tables/tbutils.c
+++ b/source/components/tables/tbutils.c
@@ -287,8 +287,9 @@ AcpiTbVerifyChecksum (
if (Checksum)
{
- ACPI_WARNING ((AE_INFO,
- "Incorrect checksum in table [%4.4s] - 0x%2.2X, should be 0x%2.2X",
+ ACPI_BIOS_WARNING ((AE_INFO,
+ "Incorrect checksum in table [%4.4s] - 0x%2.2X, "
+ "should be 0x%2.2X",
Table->Signature, Table->Checksum,
(UINT8) (Table->Checksum - Checksum)));
@@ -356,8 +357,9 @@ AcpiTbCheckDsdtHeader (
if (AcpiGbl_OriginalDsdtHeader.Length != AcpiGbl_DSDT->Length ||
AcpiGbl_OriginalDsdtHeader.Checksum != AcpiGbl_DSDT->Checksum)
{
- ACPI_ERROR ((AE_INFO,
- "The DSDT has been corrupted or replaced - old, new headers below"));
+ ACPI_BIOS_ERROR ((AE_INFO,
+ "The DSDT has been corrupted or replaced - "
+ "old, new headers below"));
AcpiTbPrintTableHeader (0, &AcpiGbl_OriginalDsdtHeader);
AcpiTbPrintTableHeader (0, AcpiGbl_DSDT);
@@ -465,7 +467,7 @@ AcpiTbInstallTable (
if (Signature &&
!ACPI_COMPARE_NAME (Table->Signature, Signature))
{
- ACPI_ERROR ((AE_INFO,
+ ACPI_BIOS_ERROR ((AE_INFO,
"Invalid signature 0x%X for ACPI table, expected [%s]",
*ACPI_CAST_PTR (UINT32, Table->Signature), Signature));
goto UnmapAndExit;
@@ -584,7 +586,7 @@ AcpiTbGetRootTableEntry (
{
/* Will truncate 64-bit address to 32 bits, issue warning */
- ACPI_WARNING ((AE_INFO,
+ ACPI_BIOS_WARNING ((AE_INFO,
"64-bit Physical Address in XSDT is too large (0x%8.8X%8.8X),"
" truncating",
ACPI_FORMAT_UINT64 (Address64)));
@@ -686,7 +688,8 @@ AcpiTbParseRootTable (
if (Length < sizeof (ACPI_TABLE_HEADER))
{
- ACPI_ERROR ((AE_INFO, "Invalid length 0x%X in RSDT/XSDT", Length));
+ ACPI_BIOS_ERROR ((AE_INFO,
+ "Invalid table length 0x%X in RSDT/XSDT", Length));
return_ACPI_STATUS (AE_INVALID_TABLE_LENGTH);
}
diff --git a/source/components/tables/tbxface.c b/source/components/tables/tbxface.c
index 58dae6935d62..fcc44f30c619 100644
--- a/source/components/tables/tbxface.c
+++ b/source/components/tables/tbxface.c
@@ -1,7 +1,6 @@
/******************************************************************************
*
- * Module Name: tbxface - Public interfaces to the ACPI subsystem
- * ACPI table oriented interfaces
+ * Module Name: tbxface - ACPI table oriented external interfaces
*
*****************************************************************************/
@@ -46,18 +45,11 @@
#include "acpi.h"
#include "accommon.h"
-#include "acnamesp.h"
#include "actables.h"
#define _COMPONENT ACPI_TABLES
ACPI_MODULE_NAME ("tbxface")
-/* Local prototypes */
-
-static ACPI_STATUS
-AcpiTbLoadNamespace (
- void);
-
/*******************************************************************************
*
@@ -458,155 +450,6 @@ ACPI_EXPORT_SYMBOL (AcpiGetTableByIndex)
/*******************************************************************************
*
- * FUNCTION: AcpiTbLoadNamespace
- *
- * PARAMETERS: None
- *
- * RETURN: Status
- *
- * DESCRIPTION: Load the namespace from the DSDT and all SSDTs/PSDTs found in
- * the RSDT/XSDT.
- *
- ******************************************************************************/
-
-static ACPI_STATUS
-AcpiTbLoadNamespace (
- void)
-{
- ACPI_STATUS Status;
- UINT32 i;
- ACPI_TABLE_HEADER *NewDsdt;
-
-
- ACPI_FUNCTION_TRACE (TbLoadNamespace);
-
-
- (void) AcpiUtAcquireMutex (ACPI_MTX_TABLES);
-
- /*
- * Load the namespace. The DSDT is required, but any SSDT and
- * PSDT tables are optional. Verify the DSDT.
- */
- if (!AcpiGbl_RootTableList.CurrentTableCount ||
- !ACPI_COMPARE_NAME (
- &(AcpiGbl_RootTableList.Tables[ACPI_TABLE_INDEX_DSDT].Signature),
- ACPI_SIG_DSDT) ||
- ACPI_FAILURE (AcpiTbVerifyTable (
- &AcpiGbl_RootTableList.Tables[ACPI_TABLE_INDEX_DSDT])))
- {
- Status = AE_NO_ACPI_TABLES;
- goto UnlockAndExit;
- }
-
- /*
- * Save the DSDT pointer for simple access. This is the mapped memory
- * address. We must take care here because the address of the .Tables
- * array can change dynamically as tables are loaded at run-time. Note:
- * .Pointer field is not validated until after call to AcpiTbVerifyTable.
- */
- AcpiGbl_DSDT = AcpiGbl_RootTableList.Tables[ACPI_TABLE_INDEX_DSDT].Pointer;
-
- /*
- * Optionally copy the entire DSDT to local memory (instead of simply
- * mapping it.) There are some BIOSs that corrupt or replace the original
- * DSDT, creating the need for this option. Default is FALSE, do not copy
- * the DSDT.
- */
- if (AcpiGbl_CopyDsdtLocally)
- {
- NewDsdt = AcpiTbCopyDsdt (ACPI_TABLE_INDEX_DSDT);
- if (NewDsdt)
- {
- AcpiGbl_DSDT = NewDsdt;
- }
- }
-
- /*
- * Save the original DSDT header for detection of table corruption
- * and/or replacement of the DSDT from outside the OS.
- */
- ACPI_MEMCPY (&AcpiGbl_OriginalDsdtHeader, AcpiGbl_DSDT,
- sizeof (ACPI_TABLE_HEADER));
-
- (void) AcpiUtReleaseMutex (ACPI_MTX_TABLES);
-
- /* Load and parse tables */
-
- Status = AcpiNsLoadTable (ACPI_TABLE_INDEX_DSDT, AcpiGbl_RootNode);
- if (ACPI_FAILURE (Status))
- {
- return_ACPI_STATUS (Status);
- }
-
- /* Load any SSDT or PSDT tables. Note: Loop leaves tables locked */
-
- (void) AcpiUtAcquireMutex (ACPI_MTX_TABLES);
- for (i = 0; i < AcpiGbl_RootTableList.CurrentTableCount; ++i)
- {
- if ((!ACPI_COMPARE_NAME (&(AcpiGbl_RootTableList.Tables[i].Signature),
- ACPI_SIG_SSDT) &&
- !ACPI_COMPARE_NAME (&(AcpiGbl_RootTableList.Tables[i].Signature),
- ACPI_SIG_PSDT)) ||
- ACPI_FAILURE (AcpiTbVerifyTable (
- &AcpiGbl_RootTableList.Tables[i])))
- {
- continue;
- }
-
- /* Ignore errors while loading tables, get as many as possible */
-
- (void) AcpiUtReleaseMutex (ACPI_MTX_TABLES);
- (void) AcpiNsLoadTable (i, AcpiGbl_RootNode);
- (void) AcpiUtAcquireMutex (ACPI_MTX_TABLES);
- }
-
- ACPI_DEBUG_PRINT ((ACPI_DB_INIT, "ACPI Tables successfully acquired\n"));
-
-UnlockAndExit:
- (void) AcpiUtReleaseMutex (ACPI_MTX_TABLES);
- return_ACPI_STATUS (Status);
-}
-
-
-/*******************************************************************************
- *
- * FUNCTION: AcpiLoadTables
- *
- * PARAMETERS: None
- *
- * RETURN: Status
- *
- * DESCRIPTION: Load the ACPI tables from the RSDT/XSDT
- *
- ******************************************************************************/
-
-ACPI_STATUS
-AcpiLoadTables (
- void)
-{
- ACPI_STATUS Status;
-
-
- ACPI_FUNCTION_TRACE (AcpiLoadTables);
-
-
- /* Load the namespace from the tables */
-
- Status = AcpiTbLoadNamespace ();
- if (ACPI_FAILURE (Status))
- {
- ACPI_EXCEPTION ((AE_INFO, Status,
- "While loading namespace from ACPI tables"));
- }
-
- return_ACPI_STATUS (Status);
-}
-
-ACPI_EXPORT_SYMBOL (AcpiLoadTables)
-
-
-/*******************************************************************************
- *
* FUNCTION: AcpiInstallTableHandler
*
* PARAMETERS: Handler - Table event handler
diff --git a/source/components/tables/tbxfload.c b/source/components/tables/tbxfload.c
new file mode 100644
index 000000000000..2883babc0e07
--- /dev/null
+++ b/source/components/tables/tbxfload.c
@@ -0,0 +1,406 @@
+/******************************************************************************
+ *
+ * Module Name: tbxfload - Table load/unload external interfaces
+ *
+ *****************************************************************************/
+
+/*
+ * Copyright (C) 2000 - 2012, Intel Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions, and the following disclaimer,
+ * without modification.
+ * 2. Redistributions in binary form must reproduce at minimum a disclaimer
+ * substantially similar to the "NO WARRANTY" disclaimer below
+ * ("Disclaimer") and any redistribution must be conditioned upon
+ * including a substantially similar Disclaimer requirement for further
+ * binary redistribution.
+ * 3. Neither the names of the above-listed copyright holders nor the names
+ * of any contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * Alternatively, this software may be distributed under the terms of the
+ * GNU General Public License ("GPL") version 2 as published by the Free
+ * Software Foundation.
+ *
+ * NO WARRANTY
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGES.
+ */
+
+#define __TBXFLOAD_C__
+
+#include "acpi.h"
+#include "accommon.h"
+#include "acnamesp.h"
+#include "actables.h"
+
+#define _COMPONENT ACPI_TABLES
+ ACPI_MODULE_NAME ("tbxfload")
+
+/* Local prototypes */
+
+static ACPI_STATUS
+AcpiTbLoadNamespace (
+ void);
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiLoadTables
+ *
+ * PARAMETERS: None
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Load the ACPI tables from the RSDT/XSDT
+ *
+ ******************************************************************************/
+
+ACPI_STATUS
+AcpiLoadTables (
+ void)
+{
+ ACPI_STATUS Status;
+
+
+ ACPI_FUNCTION_TRACE (AcpiLoadTables);
+
+
+ /* Load the namespace from the tables */
+
+ Status = AcpiTbLoadNamespace ();
+ if (ACPI_FAILURE (Status))
+ {
+ ACPI_EXCEPTION ((AE_INFO, Status,
+ "While loading namespace from ACPI tables"));
+ }
+
+ return_ACPI_STATUS (Status);
+}
+
+ACPI_EXPORT_SYMBOL (AcpiLoadTables)
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiTbLoadNamespace
+ *
+ * PARAMETERS: None
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Load the namespace from the DSDT and all SSDTs/PSDTs found in
+ * the RSDT/XSDT.
+ *
+ ******************************************************************************/
+
+static ACPI_STATUS
+AcpiTbLoadNamespace (
+ void)
+{
+ ACPI_STATUS Status;
+ UINT32 i;
+ ACPI_TABLE_HEADER *NewDsdt;
+
+
+ ACPI_FUNCTION_TRACE (TbLoadNamespace);
+
+
+ (void) AcpiUtAcquireMutex (ACPI_MTX_TABLES);
+
+ /*
+ * Load the namespace. The DSDT is required, but any SSDT and
+ * PSDT tables are optional. Verify the DSDT.
+ */
+ if (!AcpiGbl_RootTableList.CurrentTableCount ||
+ !ACPI_COMPARE_NAME (
+ &(AcpiGbl_RootTableList.Tables[ACPI_TABLE_INDEX_DSDT].Signature),
+ ACPI_SIG_DSDT) ||
+ ACPI_FAILURE (AcpiTbVerifyTable (
+ &AcpiGbl_RootTableList.Tables[ACPI_TABLE_INDEX_DSDT])))
+ {
+ Status = AE_NO_ACPI_TABLES;
+ goto UnlockAndExit;
+ }
+
+ /*
+ * Save the DSDT pointer for simple access. This is the mapped memory
+ * address. We must take care here because the address of the .Tables
+ * array can change dynamically as tables are loaded at run-time. Note:
+ * .Pointer field is not validated until after call to AcpiTbVerifyTable.
+ */
+ AcpiGbl_DSDT = AcpiGbl_RootTableList.Tables[ACPI_TABLE_INDEX_DSDT].Pointer;
+
+ /*
+ * Optionally copy the entire DSDT to local memory (instead of simply
+ * mapping it.) There are some BIOSs that corrupt or replace the original
+ * DSDT, creating the need for this option. Default is FALSE, do not copy
+ * the DSDT.
+ */
+ if (AcpiGbl_CopyDsdtLocally)
+ {
+ NewDsdt = AcpiTbCopyDsdt (ACPI_TABLE_INDEX_DSDT);
+ if (NewDsdt)
+ {
+ AcpiGbl_DSDT = NewDsdt;
+ }
+ }
+
+ /*
+ * Save the original DSDT header for detection of table corruption
+ * and/or replacement of the DSDT from outside the OS.
+ */
+ ACPI_MEMCPY (&AcpiGbl_OriginalDsdtHeader, AcpiGbl_DSDT,
+ sizeof (ACPI_TABLE_HEADER));
+
+ (void) AcpiUtReleaseMutex (ACPI_MTX_TABLES);
+
+ /* Load and parse tables */
+
+ Status = AcpiNsLoadTable (ACPI_TABLE_INDEX_DSDT, AcpiGbl_RootNode);
+ if (ACPI_FAILURE (Status))
+ {
+ return_ACPI_STATUS (Status);
+ }
+
+ /* Load any SSDT or PSDT tables. Note: Loop leaves tables locked */
+
+ (void) AcpiUtAcquireMutex (ACPI_MTX_TABLES);
+ for (i = 0; i < AcpiGbl_RootTableList.CurrentTableCount; ++i)
+ {
+ if ((!ACPI_COMPARE_NAME (&(AcpiGbl_RootTableList.Tables[i].Signature),
+ ACPI_SIG_SSDT) &&
+ !ACPI_COMPARE_NAME (&(AcpiGbl_RootTableList.Tables[i].Signature),
+ ACPI_SIG_PSDT)) ||
+ ACPI_FAILURE (AcpiTbVerifyTable (
+ &AcpiGbl_RootTableList.Tables[i])))
+ {
+ continue;
+ }
+
+ /* Ignore errors while loading tables, get as many as possible */
+
+ (void) AcpiUtReleaseMutex (ACPI_MTX_TABLES);
+ (void) AcpiNsLoadTable (i, AcpiGbl_RootNode);
+ (void) AcpiUtAcquireMutex (ACPI_MTX_TABLES);
+ }
+
+ ACPI_DEBUG_PRINT ((ACPI_DB_INIT, "ACPI Tables successfully acquired\n"));
+
+UnlockAndExit:
+ (void) AcpiUtReleaseMutex (ACPI_MTX_TABLES);
+ return_ACPI_STATUS (Status);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiLoadTable
+ *
+ * PARAMETERS: Table - Pointer to a buffer containing the ACPI
+ * table to be loaded.
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Dynamically load an ACPI table from the caller's buffer. Must
+ * be a valid ACPI table with a valid ACPI table header.
+ * Note1: Mainly intended to support hotplug addition of SSDTs.
+ * Note2: Does not copy the incoming table. User is reponsible
+ * to ensure that the table is not deleted or unmapped.
+ *
+ ******************************************************************************/
+
+ACPI_STATUS
+AcpiLoadTable (
+ ACPI_TABLE_HEADER *Table)
+{
+ ACPI_STATUS Status;
+ ACPI_TABLE_DESC TableDesc;
+ UINT32 TableIndex;
+
+
+ ACPI_FUNCTION_TRACE (AcpiLoadTable);
+
+
+ /* Parameter validation */
+
+ if (!Table)
+ {
+ return_ACPI_STATUS (AE_BAD_PARAMETER);
+ }
+
+ /* Init local table descriptor */
+
+ ACPI_MEMSET (&TableDesc, 0, sizeof (ACPI_TABLE_DESC));
+ TableDesc.Address = ACPI_PTR_TO_PHYSADDR (Table);
+ TableDesc.Pointer = Table;
+ TableDesc.Length = Table->Length;
+ TableDesc.Flags = ACPI_TABLE_ORIGIN_UNKNOWN;
+
+ /* Must acquire the interpreter lock during this operation */
+
+ Status = AcpiUtAcquireMutex (ACPI_MTX_INTERPRETER);
+ if (ACPI_FAILURE (Status))
+ {
+ return_ACPI_STATUS (Status);
+ }
+
+ /* Install the table and load it into the namespace */
+
+ ACPI_INFO ((AE_INFO, "Host-directed Dynamic ACPI Table Load:"));
+ Status = AcpiTbAddTable (&TableDesc, &TableIndex);
+ if (ACPI_FAILURE (Status))
+ {
+ goto UnlockAndExit;
+ }
+
+ Status = AcpiNsLoadTable (TableIndex, AcpiGbl_RootNode);
+
+ /* Invoke table handler if present */
+
+ if (AcpiGbl_TableHandler)
+ {
+ (void) AcpiGbl_TableHandler (ACPI_TABLE_EVENT_LOAD, Table,
+ AcpiGbl_TableHandlerContext);
+ }
+
+UnlockAndExit:
+ (void) AcpiUtReleaseMutex (ACPI_MTX_INTERPRETER);
+ return_ACPI_STATUS (Status);
+}
+
+ACPI_EXPORT_SYMBOL (AcpiLoadTable)
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiUnloadParentTable
+ *
+ * PARAMETERS: Object - Handle to any namespace object owned by
+ * the table to be unloaded
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Via any namespace object within an SSDT or OEMx table, unloads
+ * the table and deletes all namespace objects associated with
+ * that table. Unloading of the DSDT is not allowed.
+ * Note: Mainly intended to support hotplug removal of SSDTs.
+ *
+ ******************************************************************************/
+
+ACPI_STATUS
+AcpiUnloadParentTable (
+ ACPI_HANDLE Object)
+{
+ ACPI_NAMESPACE_NODE *Node = ACPI_CAST_PTR (ACPI_NAMESPACE_NODE, Object);
+ ACPI_STATUS Status = AE_NOT_EXIST;
+ ACPI_OWNER_ID OwnerId;
+ UINT32 i;
+
+
+ ACPI_FUNCTION_TRACE (AcpiUnloadParentTable);
+
+
+ /* Parameter validation */
+
+ if (!Object)
+ {
+ return_ACPI_STATUS (AE_BAD_PARAMETER);
+ }
+
+ /*
+ * The node OwnerId is currently the same as the parent table ID.
+ * However, this could change in the future.
+ */
+ OwnerId = Node->OwnerId;
+ if (!OwnerId)
+ {
+ /* OwnerId==0 means DSDT is the owner. DSDT cannot be unloaded */
+
+ return_ACPI_STATUS (AE_TYPE);
+ }
+
+ /* Must acquire the interpreter lock during this operation */
+
+ Status = AcpiUtAcquireMutex (ACPI_MTX_INTERPRETER);
+ if (ACPI_FAILURE (Status))
+ {
+ return_ACPI_STATUS (Status);
+ }
+
+ /* Find the table in the global table list */
+
+ for (i = 0; i < AcpiGbl_RootTableList.CurrentTableCount; i++)
+ {
+ if (OwnerId != AcpiGbl_RootTableList.Tables[i].OwnerId)
+ {
+ continue;
+ }
+
+ /*
+ * Allow unload of SSDT and OEMx tables only. Do not allow unload
+ * of the DSDT. No other types of tables should get here, since
+ * only these types can contain AML and thus are the only types
+ * that can create namespace objects.
+ */
+ if (ACPI_COMPARE_NAME (
+ AcpiGbl_RootTableList.Tables[i].Signature.Ascii,
+ ACPI_SIG_DSDT))
+ {
+ Status = AE_TYPE;
+ break;
+ }
+
+ /* Ensure the table is actually loaded */
+
+ if (!AcpiTbIsTableLoaded (i))
+ {
+ Status = AE_NOT_EXIST;
+ break;
+ }
+
+ /* Invoke table handler if present */
+
+ if (AcpiGbl_TableHandler)
+ {
+ (void) AcpiGbl_TableHandler (ACPI_TABLE_EVENT_UNLOAD,
+ AcpiGbl_RootTableList.Tables[i].Pointer,
+ AcpiGbl_TableHandlerContext);
+ }
+
+ /*
+ * Delete all namespace objects owned by this table. Note that
+ * these objects can appear anywhere in the namespace by virtue
+ * of the AML "Scope" operator. Thus, we need to track ownership
+ * by an ID, not simply a position within the hierarchy.
+ */
+ Status = AcpiTbDeleteNamespaceByOwner (i);
+ if (ACPI_FAILURE (Status))
+ {
+ break;
+ }
+
+ Status = AcpiTbReleaseOwnerId (i);
+ AcpiTbSetTableLoadedFlag (i, FALSE);
+ break;
+ }
+
+ (void) AcpiUtReleaseMutex (ACPI_MTX_INTERPRETER);
+ return_ACPI_STATUS (Status);
+}
+
+ACPI_EXPORT_SYMBOL (AcpiUnloadParentTable)
diff --git a/source/components/tables/tbxfroot.c b/source/components/tables/tbxfroot.c
index 17e52ef7f4ec..604f4d072e10 100644
--- a/source/components/tables/tbxfroot.c
+++ b/source/components/tables/tbxfroot.c
@@ -234,7 +234,7 @@ AcpiFindRootPointer (
/* A valid RSDP was not found */
- ACPI_ERROR ((AE_INFO, "A valid RSDP was not found"));
+ ACPI_BIOS_ERROR ((AE_INFO, "A valid RSDP was not found"));
return_ACPI_STATUS (AE_NOT_FOUND);
}
diff --git a/source/components/utilities/utdecode.c b/source/components/utilities/utdecode.c
index 718d73db4e3b..afb6e6c9cc7d 100644
--- a/source/components/utilities/utdecode.c
+++ b/source/components/utilities/utdecode.c
@@ -51,47 +51,6 @@
ACPI_MODULE_NAME ("utdecode")
-/*******************************************************************************
- *
- * FUNCTION: AcpiFormatException
- *
- * PARAMETERS: Status - The ACPI_STATUS code to be formatted
- *
- * RETURN: A string containing the exception text. A valid pointer is
- * always returned.
- *
- * DESCRIPTION: This function translates an ACPI exception into an ASCII string
- * It is here instead of utxface.c so it is always present.
- *
- ******************************************************************************/
-
-const char *
-AcpiFormatException (
- ACPI_STATUS Status)
-{
- const char *Exception = NULL;
-
-
- ACPI_FUNCTION_ENTRY ();
-
-
- Exception = AcpiUtValidateException (Status);
- if (!Exception)
- {
- /* Exception code was not recognized */
-
- ACPI_ERROR ((AE_INFO,
- "Unknown exception code: 0x%8.8X", Status));
-
- Exception = "UNKNOWN_STATUS_CODE";
- }
-
- return (ACPI_CAST_PTR (const char, Exception));
-}
-
-ACPI_EXPORT_SYMBOL (AcpiFormatException)
-
-
/*
* Properties of the ACPI Object Types, both internal and external.
* The table is indexed by values of ACPI_OBJECT_TYPE
@@ -180,16 +139,17 @@ AcpiUtHexToAsciiChar (
const char *AcpiGbl_RegionTypes[ACPI_NUM_PREDEFINED_REGIONS] =
{
- "SystemMemory",
- "SystemIO",
- "PCI_Config",
- "EmbeddedControl",
- "SMBus",
- "SystemCMOS",
- "PCIBARTarget",
- "IPMI",
- "GeneralPurposeIo",
- "GenericSerialBus"
+ "SystemMemory", /* 0x00 */
+ "SystemIO", /* 0x01 */
+ "PCI_Config", /* 0x02 */
+ "EmbeddedControl", /* 0x03 */
+ "SMBus", /* 0x04 */
+ "SystemCMOS", /* 0x05 */
+ "PCIBARTarget", /* 0x06 */
+ "IPMI", /* 0x07 */
+ "GeneralPurposeIo", /* 0x08 */
+ "GenericSerialBus", /* 0x09 */
+ "PCC" /* 0x0A */
};
diff --git a/source/components/utilities/utexcep.c b/source/components/utilities/utexcep.c
new file mode 100644
index 000000000000..5d4e9edff5d5
--- /dev/null
+++ b/source/components/utilities/utexcep.c
@@ -0,0 +1,174 @@
+/*******************************************************************************
+ *
+ * Module Name: utexcep - Exception code support
+ *
+ ******************************************************************************/
+
+/*
+ * Copyright (C) 2000 - 2012, Intel Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions, and the following disclaimer,
+ * without modification.
+ * 2. Redistributions in binary form must reproduce at minimum a disclaimer
+ * substantially similar to the "NO WARRANTY" disclaimer below
+ * ("Disclaimer") and any redistribution must be conditioned upon
+ * including a substantially similar Disclaimer requirement for further
+ * binary redistribution.
+ * 3. Neither the names of the above-listed copyright holders nor the names
+ * of any contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * Alternatively, this software may be distributed under the terms of the
+ * GNU General Public License ("GPL") version 2 as published by the Free
+ * Software Foundation.
+ *
+ * NO WARRANTY
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGES.
+ */
+
+
+#define __UTEXCEP_C__
+
+#define ACPI_DEFINE_EXCEPTION_TABLE
+#include "acpi.h"
+#include "accommon.h"
+
+
+#define _COMPONENT ACPI_UTILITIES
+ ACPI_MODULE_NAME ("utexcep")
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiFormatException
+ *
+ * PARAMETERS: Status - The ACPI_STATUS code to be formatted
+ *
+ * RETURN: A string containing the exception text. A valid pointer is
+ * always returned.
+ *
+ * DESCRIPTION: This function translates an ACPI exception into an ASCII
+ * string. Returns "unknown status" string for invalid codes.
+ *
+ ******************************************************************************/
+
+const char *
+AcpiFormatException (
+ ACPI_STATUS Status)
+{
+ const char *Exception = NULL;
+
+
+ ACPI_FUNCTION_ENTRY ();
+
+
+ Exception = AcpiUtValidateException (Status);
+ if (!Exception)
+ {
+ /* Exception code was not recognized */
+
+ ACPI_ERROR ((AE_INFO,
+ "Unknown exception code: 0x%8.8X", Status));
+
+ Exception = "UNKNOWN_STATUS_CODE";
+ }
+
+ return (ACPI_CAST_PTR (const char, Exception));
+}
+
+ACPI_EXPORT_SYMBOL (AcpiFormatException)
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiUtValidateException
+ *
+ * PARAMETERS: Status - The ACPI_STATUS code to be formatted
+ *
+ * RETURN: A string containing the exception text. NULL if exception is
+ * not valid.
+ *
+ * DESCRIPTION: This function validates and translates an ACPI exception into
+ * an ASCII string.
+ *
+ ******************************************************************************/
+
+const char *
+AcpiUtValidateException (
+ ACPI_STATUS Status)
+{
+ UINT32 SubStatus;
+ const char *Exception = NULL;
+
+
+ ACPI_FUNCTION_ENTRY ();
+
+
+ /*
+ * Status is composed of two parts, a "type" and an actual code
+ */
+ SubStatus = (Status & ~AE_CODE_MASK);
+
+ switch (Status & AE_CODE_MASK)
+ {
+ case AE_CODE_ENVIRONMENTAL:
+
+ if (SubStatus <= AE_CODE_ENV_MAX)
+ {
+ Exception = AcpiGbl_ExceptionNames_Env [SubStatus];
+ }
+ break;
+
+ case AE_CODE_PROGRAMMER:
+
+ if (SubStatus <= AE_CODE_PGM_MAX)
+ {
+ Exception = AcpiGbl_ExceptionNames_Pgm [SubStatus];
+ }
+ break;
+
+ case AE_CODE_ACPI_TABLES:
+
+ if (SubStatus <= AE_CODE_TBL_MAX)
+ {
+ Exception = AcpiGbl_ExceptionNames_Tbl [SubStatus];
+ }
+ break;
+
+ case AE_CODE_AML:
+
+ if (SubStatus <= AE_CODE_AML_MAX)
+ {
+ Exception = AcpiGbl_ExceptionNames_Aml [SubStatus];
+ }
+ break;
+
+ case AE_CODE_CONTROL:
+
+ if (SubStatus <= AE_CODE_CTRL_MAX)
+ {
+ Exception = AcpiGbl_ExceptionNames_Ctrl [SubStatus];
+ }
+ break;
+
+ default:
+ break;
+ }
+
+ return (ACPI_CAST_PTR (const char, Exception));
+}
diff --git a/source/components/utilities/utglobal.c b/source/components/utilities/utglobal.c
index f913e3222858..8bb2230f391c 100644
--- a/source/components/utilities/utglobal.c
+++ b/source/components/utilities/utglobal.c
@@ -211,8 +211,9 @@ ACPI_FIXED_EVENT_INFO AcpiGbl_FixedEventInfo[ACPI_NUM_FIXED_EVENTS] =
*
* RETURN: Status
*
- * DESCRIPTION: Init ACPICA globals. All globals that require specific
- * initialization should be initialized here!
+ * DESCRIPTION: Initialize ACPICA globals. All globals that require specific
+ * initialization should be initialized here. This allows for
+ * a warm restart.
*
******************************************************************************/
diff --git a/source/components/utilities/utmisc.c b/source/components/utilities/utmisc.c
index 72662b95dd01..a92121ffa733 100644
--- a/source/components/utilities/utmisc.c
+++ b/source/components/utilities/utmisc.c
@@ -92,86 +92,6 @@ UtConvertBackslashes (
/*******************************************************************************
*
- * FUNCTION: AcpiUtValidateException
- *
- * PARAMETERS: Status - The ACPI_STATUS code to be formatted
- *
- * RETURN: A string containing the exception text. NULL if exception is
- * not valid.
- *
- * DESCRIPTION: This function validates and translates an ACPI exception into
- * an ASCII string.
- *
- ******************************************************************************/
-
-const char *
-AcpiUtValidateException (
- ACPI_STATUS Status)
-{
- UINT32 SubStatus;
- const char *Exception = NULL;
-
-
- ACPI_FUNCTION_ENTRY ();
-
-
- /*
- * Status is composed of two parts, a "type" and an actual code
- */
- SubStatus = (Status & ~AE_CODE_MASK);
-
- switch (Status & AE_CODE_MASK)
- {
- case AE_CODE_ENVIRONMENTAL:
-
- if (SubStatus <= AE_CODE_ENV_MAX)
- {
- Exception = AcpiGbl_ExceptionNames_Env [SubStatus];
- }
- break;
-
- case AE_CODE_PROGRAMMER:
-
- if (SubStatus <= AE_CODE_PGM_MAX)
- {
- Exception = AcpiGbl_ExceptionNames_Pgm [SubStatus];
- }
- break;
-
- case AE_CODE_ACPI_TABLES:
-
- if (SubStatus <= AE_CODE_TBL_MAX)
- {
- Exception = AcpiGbl_ExceptionNames_Tbl [SubStatus];
- }
- break;
-
- case AE_CODE_AML:
-
- if (SubStatus <= AE_CODE_AML_MAX)
- {
- Exception = AcpiGbl_ExceptionNames_Aml [SubStatus];
- }
- break;
-
- case AE_CODE_CONTROL:
-
- if (SubStatus <= AE_CODE_CTRL_MAX)
- {
- Exception = AcpiGbl_ExceptionNames_Ctrl [SubStatus];
- }
- break;
-
- default:
- break;
- }
-
- return (ACPI_CAST_PTR (const char, Exception));
-}
-
-
-/*******************************************************************************
- *
* FUNCTION: AcpiUtIsPciRootBridge
*
* PARAMETERS: Id - The HID/CID in string format
diff --git a/source/components/utilities/utobject.c b/source/components/utilities/utobject.c
index fea140946c2c..03fa9dc1cf0e 100644
--- a/source/components/utilities/utobject.c
+++ b/source/components/utilities/utobject.c
@@ -366,7 +366,7 @@ AcpiUtCreateStringObject (
*
* RETURN: TRUE if object is valid, FALSE otherwise
*
- * DESCRIPTION: Validate a pointer to be an ACPI_OPERAND_OBJECT
+ * DESCRIPTION: Validate a pointer to be of type ACPI_OPERAND_OBJECT
*
******************************************************************************/
@@ -392,7 +392,7 @@ AcpiUtValidInternalObject (
{
case ACPI_DESC_TYPE_OPERAND:
- /* The object appears to be a valid ACPI_OPERAND_OBJECT */
+ /* The object appears to be a valid ACPI_OPERAND_OBJECT */
return (TRUE);
@@ -473,7 +473,7 @@ AcpiUtDeleteObjectDesc (
ACPI_FUNCTION_TRACE_PTR (UtDeleteObjectDesc, Object);
- /* Object must be an ACPI_OPERAND_OBJECT */
+ /* Object must be of type ACPI_OPERAND_OBJECT */
if (ACPI_GET_DESCRIPTOR_TYPE (Object) != ACPI_DESC_TYPE_OPERAND)
{
diff --git a/source/components/utilities/utresrc.c b/source/components/utilities/utresrc.c
index c2c135b7d233..9855af5708a3 100644
--- a/source/components/utilities/utresrc.c
+++ b/source/components/utilities/utresrc.c
@@ -1,6 +1,6 @@
/*******************************************************************************
*
- * Module Name: utresrc - Resource managment utilities
+ * Module Name: utresrc - Resource management utilities
*
******************************************************************************/
@@ -57,7 +57,7 @@
/*
* Strings used to decode resource descriptors.
- * Used by both the disasssembler and the debugger resource dump routines
+ * Used by both the disassembler and the debugger resource dump routines
*/
const char *AcpiGbl_BmDecode[] =
{
diff --git a/source/components/utilities/utxferror.c b/source/components/utilities/utxferror.c
index 8ffb27489497..715c0f47f0f4 100644
--- a/source/components/utilities/utxferror.c
+++ b/source/components/utilities/utxferror.c
@@ -87,6 +87,9 @@ extern FILE *AcpiGbl_OutputFile;
#define ACPI_MSG_WARNING "ACPI Warning: "
#define ACPI_MSG_INFO "ACPI: "
+#define ACPI_MSG_BIOS_ERROR "ACPI Firmware Error: "
+#define ACPI_MSG_BIOS_WARNING "ACPI Firmware Warning: "
+
/*
* Common message suffix
*/
@@ -252,6 +255,84 @@ AcpiInfo (
ACPI_EXPORT_SYMBOL (AcpiInfo)
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiBiosError
+ *
+ * PARAMETERS: ModuleName - Caller's module name (for error output)
+ * LineNumber - Caller's line number (for error output)
+ * Format - Printf format string + additional args
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Print "ACPI Firmware Error" message with module/line/version
+ * info
+ *
+ ******************************************************************************/
+
+void ACPI_INTERNAL_VAR_XFACE
+AcpiBiosError (
+ const char *ModuleName,
+ UINT32 LineNumber,
+ const char *Format,
+ ...)
+{
+ va_list ArgList;
+
+
+ ACPI_MSG_REDIRECT_BEGIN;
+ AcpiOsPrintf (ACPI_MSG_BIOS_ERROR);
+
+ va_start (ArgList, Format);
+ AcpiOsVprintf (Format, ArgList);
+ ACPI_MSG_SUFFIX;
+ va_end (ArgList);
+
+ ACPI_MSG_REDIRECT_END;
+}
+
+ACPI_EXPORT_SYMBOL (AcpiBiosError)
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiBiosWarning
+ *
+ * PARAMETERS: ModuleName - Caller's module name (for error output)
+ * LineNumber - Caller's line number (for error output)
+ * Format - Printf format string + additional args
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Print "ACPI Firmware Warning" message with module/line/version
+ * info
+ *
+ ******************************************************************************/
+
+void ACPI_INTERNAL_VAR_XFACE
+AcpiBiosWarning (
+ const char *ModuleName,
+ UINT32 LineNumber,
+ const char *Format,
+ ...)
+{
+ va_list ArgList;
+
+
+ ACPI_MSG_REDIRECT_BEGIN;
+ AcpiOsPrintf (ACPI_MSG_BIOS_WARNING);
+
+ va_start (ArgList, Format);
+ AcpiOsVprintf (Format, ArgList);
+ ACPI_MSG_SUFFIX;
+ va_end (ArgList);
+
+ ACPI_MSG_REDIRECT_END;
+}
+
+ACPI_EXPORT_SYMBOL (AcpiBiosWarning)
+
+
/*
* The remainder of this module contains internal error functions that may
* be configured out.
diff --git a/source/include/acdebug.h b/source/include/acdebug.h
index f89cf378fa0d..5c91c87dafaa 100644
--- a/source/include/acdebug.h
+++ b/source/include/acdebug.h
@@ -112,8 +112,7 @@ AcpiDbDisplayTemplate (
void
AcpiDbUnloadAcpiTable (
- char *TableArg,
- char *InstanceArg);
+ char *Name);
void
AcpiDbSendNotify (
diff --git a/source/include/acexcep.h b/source/include/acexcep.h
index 10f5a113da8e..856a359845ce 100644
--- a/source/include/acexcep.h
+++ b/source/include/acexcep.h
@@ -53,6 +53,7 @@
#define AE_CODE_ACPI_TABLES 0x2000
#define AE_CODE_AML 0x3000
#define AE_CODE_CONTROL 0x4000
+#define AE_CODE_MAX 0x4000
#define AE_CODE_MASK 0xF000
@@ -188,7 +189,7 @@
/* Exception strings for AcpiFormatException */
-#ifdef DEFINE_ACPI_GLOBALS
+#ifdef ACPI_DEFINE_EXCEPTION_TABLE
/*
* String versions of the exception codes above
@@ -307,6 +308,6 @@ char const *AcpiGbl_ExceptionNames_Ctrl[] =
"AE_CTRL_PARSE_PENDING"
};
-#endif /* ACPI GLOBALS */
+#endif /* EXCEPTION_TABLE */
#endif /* __ACEXCEP_H__ */
diff --git a/source/include/acglobal.h b/source/include/acglobal.h
index 5535c1dc5176..1fc2bc6bae41 100644
--- a/source/include/acglobal.h
+++ b/source/include/acglobal.h
@@ -287,17 +287,8 @@ ACPI_EXTERN UINT8 AcpiGbl_OsiData;
ACPI_EXTERN ACPI_INTERFACE_INFO *AcpiGbl_SupportedInterfaces;
ACPI_EXTERN ACPI_ADDRESS_RANGE *AcpiGbl_AddressRangeList[ACPI_ADDRESS_RANGE_MAX];
-
#ifndef DEFINE_ACPI_GLOBALS
-/* Exception codes */
-
-extern char const *AcpiGbl_ExceptionNames_Env[];
-extern char const *AcpiGbl_ExceptionNames_Pgm[];
-extern char const *AcpiGbl_ExceptionNames_Tbl[];
-extern char const *AcpiGbl_ExceptionNames_Aml[];
-extern char const *AcpiGbl_ExceptionNames_Ctrl[];
-
/* Other miscellaneous */
extern BOOLEAN AcpiGbl_Shutdown;
diff --git a/source/include/acmacros.h b/source/include/acmacros.h
index cdb9cb109e06..591bb6bf1a58 100644
--- a/source/include/acmacros.h
+++ b/source/include/acmacros.h
@@ -274,8 +274,8 @@
#define ACPI_INSERT_BITS(Target, Mask, Source) Target = ((Target & (~(Mask))) | (Source & Mask))
/*
- * An ACPI_NAMESPACE_NODE can appear in some contexts
- * where a pointer to an ACPI_OPERAND_OBJECT can also
+ * An object of type ACPI_NAMESPACE_NODE can appear in some contexts
+ * where a pointer to an object of type ACPI_OPERAND_OBJECT can also
* appear. This macro is used to distinguish them.
*
* The "Descriptor" field is the first field in both structures.
diff --git a/source/include/acobject.h b/source/include/acobject.h
index e0f4a5259863..daf1afffb832 100644
--- a/source/include/acobject.h
+++ b/source/include/acobject.h
@@ -123,8 +123,8 @@ typedef struct acpi_object_integer
/*
- * Note: The String and Buffer object must be identical through the Pointer
- * and Length elements. There is code that depends on this.
+ * Note: The String and Buffer object must be identical through the
+ * pointer and length elements. There is code that depends on this.
*
* Fields common to both Strings and Buffers
*/
diff --git a/source/include/acoutput.h b/source/include/acoutput.h
index a1d89d408cc3..193d0acc4c81 100644
--- a/source/include/acoutput.h
+++ b/source/include/acoutput.h
@@ -217,6 +217,8 @@
#define ACPI_WARNING(plist) AcpiWarning plist
#define ACPI_EXCEPTION(plist) AcpiException plist
#define ACPI_ERROR(plist) AcpiError plist
+#define ACPI_BIOS_WARNING(plist) AcpiBiosWarning plist
+#define ACPI_BIOS_ERROR(plist) AcpiBiosError plist
#define ACPI_DEBUG_OBJECT(obj,l,i) AcpiExDoDebugObject(obj,l,i)
#else
@@ -227,6 +229,8 @@
#define ACPI_WARNING(plist)
#define ACPI_EXCEPTION(plist)
#define ACPI_ERROR(plist)
+#define ACPI_BIOS_WARNING(plist)
+#define ACPI_BIOS_ERROR(plist)
#define ACPI_DEBUG_OBJECT(obj,l,i)
#endif /* ACPI_NO_ERROR_MESSAGES */
diff --git a/source/include/acpixf.h b/source/include/acpixf.h
index 9ec5f97c4893..9c5aa4f6dd5b 100644
--- a/source/include/acpixf.h
+++ b/source/include/acpixf.h
@@ -48,7 +48,7 @@
/* Current ACPICA subsystem version in YYYYMMDD format */
-#define ACPI_CA_VERSION 0x20120620
+#define ACPI_CA_VERSION 0x20120711
#include "acconfig.h"
#include "actypes.h"
@@ -201,6 +201,22 @@ AcpiFree (
/*
+ * ACPI table load/unload interfaces
+ */
+ACPI_STATUS
+AcpiLoadTable (
+ ACPI_TABLE_HEADER *Table);
+
+ACPI_STATUS
+AcpiUnloadParentTable (
+ ACPI_HANDLE Object);
+
+ACPI_STATUS
+AcpiLoadTables (
+ void);
+
+
+/*
* ACPI table manipulation interfaces
*/
ACPI_STATUS
@@ -212,10 +228,6 @@ AcpiFindRootPointer (
ACPI_SIZE *RsdpAddress);
ACPI_STATUS
-AcpiLoadTables (
- void);
-
-ACPI_STATUS
AcpiGetTableHeader (
ACPI_STRING Signature,
UINT32 Instance,
@@ -757,6 +769,20 @@ AcpiInfo (
const char *Format,
...) ACPI_PRINTF_LIKE(3);
+void ACPI_INTERNAL_VAR_XFACE
+AcpiBiosError (
+ const char *ModuleName,
+ UINT32 LineNumber,
+ const char *Format,
+ ...) ACPI_PRINTF_LIKE(3);
+
+void ACPI_INTERNAL_VAR_XFACE
+AcpiBiosWarning (
+ const char *ModuleName,
+ UINT32 LineNumber,
+ const char *Format,
+ ...) ACPI_PRINTF_LIKE(3);
+
/*
* Debug output
diff --git a/source/include/actbl1.h b/source/include/actbl1.h
index 824135d3dd2d..c24178f9c409 100644
--- a/source/include/actbl1.h
+++ b/source/include/actbl1.h
@@ -130,7 +130,7 @@ typedef struct acpi_table_bert
{
ACPI_TABLE_HEADER Header; /* Common ACPI table header */
UINT32 RegionLength; /* Length of the boot error region */
- UINT64 Address; /* Physical addresss of the error region */
+ UINT64 Address; /* Physical address of the error region */
} ACPI_TABLE_BERT;
diff --git a/source/include/platform/acenv.h b/source/include/platform/acenv.h
index 19ca03baacc6..db270626c7f2 100644
--- a/source/include/platform/acenv.h
+++ b/source/include/platform/acenv.h
@@ -108,9 +108,9 @@
#endif
#ifdef ACPI_HELP_APP
-#define ACPI_DEBUG_OUTPUT
#define ACPI_APPLICATION
#define ACPI_SINGLE_THREADED
+#define ACPI_NO_ERROR_MESSAGES
#endif
/* Linkable ACPICA library */
diff --git a/source/tools/acpibin/Makefile b/source/tools/acpibin/Makefile
index f15141bb2d78..7d95f61aac29 100644
--- a/source/tools/acpibin/Makefile
+++ b/source/tools/acpibin/Makefile
@@ -64,6 +64,7 @@ OBJECTS = \
utcache.o \
utdebug.o \
utdecode.o \
+ utexcep.o \
utglobal.o \
utlock.o \
utmath.o \
diff --git a/source/tools/acpiexec/Makefile b/source/tools/acpiexec/Makefile
index 65a1d84411d6..4d379f5642bb 100644
--- a/source/tools/acpiexec/Makefile
+++ b/source/tools/acpiexec/Makefile
@@ -205,6 +205,7 @@ OBJECTS = \
tbinstal.o \
tbutils.o \
tbxface.o \
+ tbxfload.o \
tbxfroot.o \
utaddress.o \
utalloc.o \
@@ -214,6 +215,7 @@ OBJECTS = \
utdecode.o \
utdelete.o \
uteval.o \
+ utexcep.o \
utglobal.o \
utids.o \
utinit.o \
diff --git a/source/tools/acpiexec/aecommon.h b/source/tools/acpiexec/aecommon.h
index 0f1b4c1e7569..66995e7ecd0e 100644
--- a/source/tools/acpiexec/aecommon.h
+++ b/source/tools/acpiexec/aecommon.h
@@ -68,6 +68,7 @@ extern BOOLEAN AcpiGbl_IgnoreErrors;
extern UINT8 AcpiGbl_RegionFillValue;
extern UINT8 AcpiGbl_UseHwReducedFadt;
extern BOOLEAN AcpiGbl_DisplayRegionAccess;
+extern BOOLEAN AcpiGbl_DoInterfaceTests;
/* Check for unexpected exceptions */
diff --git a/source/tools/acpiexec/aeexec.c b/source/tools/acpiexec/aeexec.c
index d991b9c41f60..6bc138138c87 100644
--- a/source/tools/acpiexec/aeexec.c
+++ b/source/tools/acpiexec/aeexec.c
@@ -90,7 +90,9 @@ AfInstallGpeBlock (
void);
#endif /* !ACPI_REDUCED_HARDWARE */
+extern unsigned char Ssdt2Code[];
extern unsigned char Ssdt3Code[];
+extern unsigned char Ssdt4Code[];
/******************************************************************************
@@ -527,15 +529,63 @@ AeMiscellaneousTests (
char Buffer[32];
ACPI_STATUS Status;
ACPI_STATISTICS Stats;
+ ACPI_HANDLE Handle;
#if (!ACPI_REDUCED_HARDWARE)
- ACPI_HANDLE Handle;
ACPI_VENDOR_UUID Uuid = {0, {ACPI_INIT_UUID (0,0,0,0,0,0,0,0,0,0,0)}};
UINT32 LockHandle1;
UINT32 LockHandle2;
#endif /* !ACPI_REDUCED_HARDWARE */
+ if (AcpiGbl_DoInterfaceTests)
+ {
+ /*
+ * Tests for AcpiLoadTable and AcpiUnloadParentTable
+ */
+
+ /* Attempt unload of DSDT, should fail */
+
+ Status = AcpiGetHandle (NULL, "\\_SB_", &Handle);
+ AE_CHECK_OK (AcpiGetHandle, Status);
+
+ Status = AcpiUnloadParentTable (Handle);
+ AE_CHECK_STATUS (AcpiUnloadParentTable, Status, AE_TYPE);
+
+ /* Load and unload SSDT4 */
+
+ Status = AcpiLoadTable ((ACPI_TABLE_HEADER *) Ssdt4Code);
+ AE_CHECK_OK (AcpiLoadTable, Status);
+
+ Status = AcpiGetHandle (NULL, "\\_T96", &Handle);
+ AE_CHECK_OK (AcpiGetHandle, Status);
+
+ Status = AcpiUnloadParentTable (Handle);
+ AE_CHECK_OK (AcpiUnloadParentTable, Status);
+
+ /* Re-load SSDT4 */
+
+ Status = AcpiLoadTable ((ACPI_TABLE_HEADER *) Ssdt4Code);
+ AE_CHECK_OK (AcpiLoadTable, Status);
+
+ /* Unload and re-load SSDT2 (SSDT2 is in the XSDT) */
+
+ Status = AcpiGetHandle (NULL, "\\_T99", &Handle);
+ AE_CHECK_OK (AcpiGetHandle, Status);
+
+ Status = AcpiUnloadParentTable (Handle);
+ AE_CHECK_OK (AcpiUnloadParentTable, Status);
+
+ Status = AcpiLoadTable ((ACPI_TABLE_HEADER *) Ssdt2Code);
+ AE_CHECK_OK (AcpiLoadTable, Status);
+
+ /* Load OEM9 table (causes table override) */
+
+ Status = AcpiLoadTable ((ACPI_TABLE_HEADER *) Ssdt3Code);
+ AE_CHECK_OK (AcpiLoadTable, Status);
+ }
+
+
AeHardwareInterfaces ();
AeGenericRegisters ();
AeSetupConfiguration (Ssdt3Code);
diff --git a/source/tools/acpiexec/aemain.c b/source/tools/acpiexec/aemain.c
index d0e980b5a1fb..11d91a69f2a2 100644
--- a/source/tools/acpiexec/aemain.c
+++ b/source/tools/acpiexec/aemain.c
@@ -56,6 +56,7 @@ BOOLEAN AcpiGbl_IgnoreErrors = FALSE;
BOOLEAN AcpiGbl_DbOpt_NoRegionSupport = FALSE;
BOOLEAN AcpiGbl_DebugTimeout = FALSE;
UINT8 AcpiGbl_UseHwReducedFadt = FALSE;
+BOOLEAN AcpiGbl_DoInterfaceTests = FALSE;
static UINT8 AcpiGbl_BatchMode = 0;
static char BatchBuffer[128];
@@ -99,6 +100,7 @@ usage (void)
printf ("\n");
ACPI_OPTION ("-ef", "Enable display of final memory statistics");
+ ACPI_OPTION ("-ei", "Enable additional tests for ACPICA interfaces");
ACPI_OPTION ("-em", "Enable Interpreter Serialized Mode");
ACPI_OPTION ("-es", "Enable Interpreter Slack Mode");
ACPI_OPTION ("-et", "Enable debug semaphore timeout");
@@ -465,6 +467,10 @@ main (
#endif
break;
+ case 'i':
+ AcpiGbl_DoInterfaceTests = TRUE;
+ break;
+
case 'm':
AcpiGbl_AllMethodsSerialized = TRUE;
printf ("Enabling AML Interpreter serialized mode\n");
diff --git a/source/tools/acpiexec/aetables.h b/source/tools/acpiexec/aetables.h
index 16b3e896d699..e6d11226aa85 100644
--- a/source/tools/acpiexec/aetables.h
+++ b/source/tools/acpiexec/aetables.h
@@ -71,24 +71,30 @@ static unsigned char LocalDsdtCode[] =
/* Several example SSDTs */
+/* SSDT1 is used by ASLTS; if changed here, must also be changed in dtregions.asl */
+
static unsigned char Ssdt1Code[] = /* Has method _T98 */
{
- 0x53,0x53,0x44,0x54,0x30,0x00,0x00,0x00, /* 00000000 "SSDT0..." */
- 0x01,0xB8,0x49,0x6E,0x74,0x65,0x6C,0x00, /* 00000008 "..Intel." */
- 0x4D,0x61,0x6E,0x79,0x00,0x00,0x00,0x00, /* 00000010 "Many...." */
+ 0x53,0x53,0x44,0x54,0x3E,0x00,0x00,0x00, /* 00000000 "SSDT>..." */
+ 0x02,0x08,0x49,0x6E,0x74,0x65,0x6C,0x00, /* 00000008 "..Intel." */
+ 0x73,0x73,0x64,0x74,0x31,0x00,0x00,0x00, /* 00000010 "ssdt1..." */
0x01,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */
- 0x24,0x04,0x03,0x20,0x14,0x0B,0x5F,0x54, /* 00000020 "$.. .._T" */
- 0x39,0x38,0x00,0x70,0x0A,0x04,0x60,0xA4, /* 00000028 "98.p..`." */
+ 0x20,0x06,0x12,0x20,0x14,0x19,0x5F,0x54, /* 00000020 " .. .._T" */
+ 0x39,0x38,0x01,0x70,0x0D,0x53,0x53,0x44, /* 00000028 "98.p.SSD" */
+ 0x54,0x31,0x20,0x2D,0x20,0x5F,0x54,0x39, /* 00000030 "T1 - _T9" */
+ 0x38,0x00,0x5B,0x31,0xA4,0x00 /* 00000038 "8.[1.." */
};
-static unsigned char Ssdt2Code[] = /* Has method _T99 */
+unsigned char Ssdt2Code[] = /* Has method _T99 */
{
- 0x53,0x53,0x44,0x54,0x30,0x00,0x00,0x00, /* 00000000 "SSDT0..." */
- 0x01,0xB7,0x49,0x6E,0x74,0x65,0x6C,0x00, /* 00000008 "..Intel." */
- 0x4D,0x61,0x6E,0x79,0x00,0x00,0x00,0x00, /* 00000010 "Many...." */
- 0x01,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */
- 0x24,0x04,0x03,0x20,0x14,0x0B,0x5F,0x54, /* 00000020 "$.. .._T" */
- 0x39,0x39,0x00,0x70,0x0A,0x04,0x60,0xA4, /* 00000028 "99.p..`." */
+ 0x53,0x53,0x44,0x54,0x3E,0x00,0x00,0x00, /* 00000000 "SSDT>..." */
+ 0x02,0xFE,0x49,0x6E,0x74,0x65,0x6C,0x00, /* 00000008 "..Intel." */
+ 0x73,0x73,0x64,0x74,0x32,0x00,0x00,0x00, /* 00000010 "ssdt2..." */
+ 0x02,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */
+ 0x20,0x06,0x12,0x20,0x14,0x19,0x5F,0x54, /* 00000020 " .. .._T" */
+ 0x39,0x39,0x06,0x70,0x0D,0x53,0x53,0x44, /* 00000028 "99.p.SSD" */
+ 0x54,0x32,0x20,0x2D,0x20,0x5F,0x54,0x39, /* 00000030 "T2 - _T9" */
+ 0x39,0x00,0x5B,0x31,0xA4,0x00 /* 00000038 "9.[1.." */
};
unsigned char Ssdt3Code[] = /* OEM9: Has method _T97 */
@@ -101,6 +107,16 @@ unsigned char Ssdt3Code[] = /* OEM9: Has method _T97 */
0x39,0x37,0x00,0x70,0x0A,0x04,0x60,0xA4, /* 00000028 "97.p..`." */
};
+unsigned char Ssdt4Code[] = /* Has method _T96 */
+{
+ 0x53,0x53,0x44,0x54,0x2D,0x00,0x00,0x00, /* 00000000 "SSDT-..." */
+ 0x02,0x2B,0x49,0x6E,0x74,0x65,0x6C,0x00, /* 00000008 ".+Intel." */
+ 0x73,0x73,0x64,0x74,0x34,0x00,0x00,0x00, /* 00000010 "ssdt4..." */
+ 0x04,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */
+ 0x20,0x06,0x12,0x20,0x14,0x08,0x5F,0x54, /* 00000020 " .. .._T" */
+ 0x39,0x36,0x05,0xA4,0x00 /* 00000028 "96..." */
+};
+
/* "Hardware-Reduced" ACPI 5.0 FADT (No FACS, no ACPI hardware) */
unsigned char HwReducedFadtCode[] =
@@ -335,6 +351,38 @@ DefinitionBlock ("", "DSDT", 2, "Intel", "Many", 0x00000001)
}
}
+/* SSDT1 */
+
+DefinitionBlock ("ssdt1.aml", "SSDT", 2, "Intel", "ssdt1", 0x00000001)
+{
+ Method (_T98, 1, NotSerialized)
+ {
+ Store ("SSDT1 - _T98", Debug)
+ Return (Zero)
+ }
+}
+
+/* SSDT2 */
+
+DefinitionBlock ("ssdt2.aml", "SSDT", 2, "Intel", "ssdt2", 0x00000002)
+{
+ Method (_T99, 6, NotSerialized)
+ {
+ Store ("SSDT2 - _T99", Debug)
+ Return (Zero)
+ }
+}
+
+/* SSDT4 */
+
+DefinitionBlock ("ssdt4.aml", "SSDT", 2, "Intel", "ssdt4", 0x00000004)
+{
+ Method (_T96, 5, NotSerialized)
+ {
+ Return (Zero)
+ }
+}
+
/* Example ECDT */
[000h 0000 4] Signature : "ECDT" /* Embedded Controller Boot Resources Table */
diff --git a/source/tools/acpihelp/Makefile b/source/tools/acpihelp/Makefile
index 481f9c2fa35f..d0bcb3e834e7 100644
--- a/source/tools/acpihelp/Makefile
+++ b/source/tools/acpihelp/Makefile
@@ -51,7 +51,8 @@ ACPICA_HEADERS = \
#
vpath %.c \
$(ACPIHELP) \
- $(ACPICA_COMMON)
+ $(ACPICA_COMMON) \
+ $(ACPICA_UTILITIES)
HEADERS = \
$(wildcard $(ACPIHELP)/*.h)
@@ -63,7 +64,8 @@ OBJECTS = \
ahdecode.o \
ahpredef.o \
ahmain.o \
- getopt.o
+ getopt.o \
+ utexcep.o
CFLAGS+= \
-D$(HOST) \
diff --git a/source/tools/acpihelp/acpihelp.h b/source/tools/acpihelp/acpihelp.h
index d1ac41d38bdd..58917c4cc982 100644
--- a/source/tools/acpihelp/acpihelp.h
+++ b/source/tools/acpihelp/acpihelp.h
@@ -69,6 +69,7 @@
#define AH_DECODE_AML 4
#define AH_DECODE_AML_OPCODE 5
#define AH_DISPLAY_DEVICE_IDS 6
+#define AH_DECODE_EXCEPTION 7
#define AH_MAX_ASL_LINE_LENGTH 70
#define AH_MAX_AML_LINE_LENGTH 100
@@ -129,6 +130,10 @@ AhDecodeAmlOpcode (
char *Name);
void
+AhDecodeException (
+ char *Name);
+
+void
AhFindPredefinedNames (
char *Name);
diff --git a/source/tools/acpihelp/ahdecode.c b/source/tools/acpihelp/ahdecode.c
index a61eccfe0beb..8aff56a72f33 100644
--- a/source/tools/acpihelp/ahdecode.c
+++ b/source/tools/acpihelp/ahdecode.c
@@ -46,6 +46,45 @@
#define ACPI_CREATE_PREDEFINED_TABLE
#include "acpredef.h"
+
+/* Device IDs defined in the ACPI specification */
+
+static const AH_DEVICE_ID AhDeviceIds[] =
+{
+ {"PNP0A05", "Generic Container Device"},
+ {"PNP0A06", "Generic Container Device"},
+ {"PNP0C08", "ACPI core hardware"},
+ {"PNP0C09", "Embedded Controller Device"},
+ {"PNP0C0A", "Control Method Battery"},
+ {"PNP0C0B", "Fan"},
+ {"PNP0C0C", "Power Button Device"},
+ {"PNP0C0D", "Lid Device"},
+ {"PNP0C0E", "Sleep Button Device"},
+ {"PNP0C0F", "PCI Interrupt Link Device"},
+ {"PNP0C80", "Memory Device"},
+
+ {"ACPI0001", "SMBus 1.0 Host Controller"},
+ {"ACPI0002", "Smart Battery Subsystem"},
+ {"ACPI0003", "Power Source Device"},
+ {"ACPI0004", "Module Device"},
+ {"ACPI0005", "SMBus 2.0 Host Controller"},
+ {"ACPI0006", "GPE Block Device"},
+ {"ACPI0007", "Processor Device"},
+ {"ACPI0008", "Ambient Light Sensor Device"},
+ {"ACPI0009", "I/O xAPIC Device"},
+ {"ACPI000A", "I/O APIC Device"},
+ {"ACPI000B", "I/O SAPIC Device"},
+ {"ACPI000C", "Processor Aggregator Device"},
+ {"ACPI000D", "Power Meter Device"},
+ {"ACPI000E", "Time/Alarm Device"},
+ {"ACPI000F", "User Presence Detection Device"},
+
+ {NULL, NULL}
+};
+
+#define AH_DISPLAY_EXCEPTION(Status, Name) \
+ printf ("%.4X: %s\n", Status, Name)
+
#define BUFFER_LENGTH 128
#define LINE_BUFFER_LENGTH 512
@@ -806,39 +845,6 @@ AhPrintOneField (
*
******************************************************************************/
-static const AH_DEVICE_ID AhDeviceIds[] =
-{
- {"PNP0A05", "Generic Container Device"},
- {"PNP0A06", "Generic Container Device"},
- {"PNP0C08", "ACPI core hardware"},
- {"PNP0C09", "Embedded Controller Device"},
- {"PNP0C0A", "Control Method Battery"},
- {"PNP0C0B", "Fan"},
- {"PNP0C0C", "Power Button Device"},
- {"PNP0C0D", "Lid Device"},
- {"PNP0C0E", "Sleep Button Device"},
- {"PNP0C0F", "PCI Interrupt Link Device"},
- {"PNP0C80", "Memory Device"},
-
- {"ACPI0001", "SMBus 1.0 Host Controller"},
- {"ACPI0002", "Smart Battery Subsystem"},
- {"ACPI0003", "Power Source Device"},
- {"ACPI0004", "Module Device"},
- {"ACPI0005", "SMBus 2.0 Host Controller"},
- {"ACPI0006", "GPE Block Device"},
- {"ACPI0007", "Processor Device"},
- {"ACPI0008", "Ambient Light Sensor Device"},
- {"ACPI0009", "I/O xAPIC Device"},
- {"ACPI000A", "I/O APIC Device"},
- {"ACPI000B", "I/O SAPIC Device"},
- {"ACPI000C", "Processor Aggregator Device"},
- {"ACPI000D", "Power Meter Device"},
- {"ACPI000E", "Time/Alarm Device"},
- {"ACPI000F", "User Presence Detection Device"},
-
- {NULL, NULL}
-};
-
void
AhDisplayDeviceIds (
void)
@@ -853,3 +859,79 @@ AhDisplayDeviceIds (
DeviceId++;
}
}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AhDecodeException
+ *
+ * PARAMETERS: HexString - ACPI status string from command line, in
+ * hex. If null, display all exceptions.
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Decode and display an ACPI_STATUS exception code.
+ *
+ ******************************************************************************/
+
+void
+AhDecodeException (
+ char *HexString)
+{
+ const char *ExceptionName;
+ UINT32 Status;
+ UINT32 i;
+
+
+ /*
+ * A null input string means to decode and display all known
+ * exception codes.
+ */
+ if (!HexString)
+ {
+ printf ("All defined ACPI exception codes:\n\n");
+ AH_DISPLAY_EXCEPTION (0, "AE_OK");
+
+ /* Display codes in each block of exception types */
+
+ for (i = 1; (i & AE_CODE_MASK) <= AE_CODE_MAX; i += 0x1000)
+ {
+ Status = i;
+ do
+ {
+ ExceptionName = AcpiUtValidateException ((ACPI_STATUS) Status);
+ if (ExceptionName)
+ {
+ AH_DISPLAY_EXCEPTION (Status, ExceptionName);
+ }
+ Status++;
+
+ } while (ExceptionName);
+ }
+ return;
+ }
+
+ /* Decode a single user-supplied exception code */
+
+ Status = ACPI_STRTOUL (HexString, NULL, 16);
+ if (!Status)
+ {
+ printf ("%s: Invalid hexadecimal exception code\n", HexString);
+ return;
+ }
+
+ if (Status > ACPI_UINT16_MAX)
+ {
+ AH_DISPLAY_EXCEPTION (Status, "Invalid exception code (more than 16 bits)");
+ return;
+ }
+
+ ExceptionName = AcpiUtValidateException ((ACPI_STATUS) Status);
+ if (!ExceptionName)
+ {
+ AH_DISPLAY_EXCEPTION (Status, "Unknown exception code");
+ return;
+ }
+
+ AH_DISPLAY_EXCEPTION (Status, ExceptionName);
+}
diff --git a/source/tools/acpihelp/ahmain.c b/source/tools/acpihelp/ahmain.c
index e45a0b61a4e5..8a6787ec181a 100644
--- a/source/tools/acpihelp/ahmain.c
+++ b/source/tools/acpihelp/ahmain.c
@@ -66,12 +66,18 @@ AhDisplayUsage (
ACPI_USAGE_HEADER ("acpihelp <options> [NamePrefix | HexValue]");
ACPI_OPTION ("-h", "Display help");
- ACPI_OPTION ("-i", "Display known ACPI Device IDs (_HID)");
+
+ printf ("\nACPI Names and Symbols:\n");
ACPI_OPTION ("-k [NamePrefix]", "Find/Display ASL non-operator keyword(s)");
ACPI_OPTION ("-m [NamePrefix]", "Find/Display AML opcode name(s)");
- ACPI_OPTION ("-o [HexValue]", "Decode hex AML opcode");
ACPI_OPTION ("-p [NamePrefix]", "Find/Display ASL predefined method name(s)");
ACPI_OPTION ("-s [NamePrefix]", "Find/Display ASL operator name(s)");
+
+ printf ("\nACPI Values:\n");
+ ACPI_OPTION ("-e [HexValue]", "Decode ACPICA exception code");
+ ACPI_OPTION ("-i", "Display known ACPI Device IDs (_HID)");
+ ACPI_OPTION ("-o [HexValue]", "Decode hex AML opcode");
+
printf ("\nNamePrefix/HexValue not specified means \"Display All\"\n");
printf ("\nDefault search with NamePrefix and no options:\n");
printf (" Find ASL operator names - if NamePrefix does not start with underscore\n");
@@ -108,8 +114,12 @@ main (
/* Command line options */
- while ((j = AcpiGetopt (argc, argv, "hikmops")) != EOF) switch (j)
+ while ((j = AcpiGetopt (argc, argv, "ehikmops")) != EOF) switch (j)
{
+ case 'e':
+ DecodeType = AH_DECODE_EXCEPTION;
+ break;
+
case 'i':
DecodeType = AH_DISPLAY_DEVICE_IDS;
break;
@@ -170,6 +180,10 @@ main (
AhDisplayDeviceIds ();
break;
+ case AH_DECODE_EXCEPTION:
+ AhDecodeException (Name);
+ break;
+
default:
if (!Name)
{
diff --git a/source/tools/acpinames/Makefile b/source/tools/acpinames/Makefile
index bdd2d260c494..3a8c42db02c2 100644
--- a/source/tools/acpinames/Makefile
+++ b/source/tools/acpinames/Makefile
@@ -114,6 +114,7 @@ OBJECTS = \
tbinstal.o \
tbutils.o \
tbxface.o \
+ tbxfload.o \
tbxfroot.o \
utaddress.o \
utalloc.o \
@@ -121,6 +122,7 @@ OBJECTS = \
utdebug.o \
utdecode.o \
utdelete.o \
+ utexcep.o \
utglobal.o \
utlock.o \
utmath.o \
diff --git a/source/tools/acpisrc/asfile.c b/source/tools/acpisrc/asfile.c
index 4e79cf35885c..d3257385ff9a 100644
--- a/source/tools/acpisrc/asfile.c
+++ b/source/tools/acpisrc/asfile.c
@@ -716,7 +716,7 @@ AsGetFile (
/*
* Create a buffer for the entire file
- * Add plenty extra buffer to accomodate string replacements
+ * Add plenty extra buffer to accommodate string replacements
*/
Size = Gbl_StatBuf.st_size;
Gbl_TotalSize += Size;
diff --git a/source/tools/acpisrc/astable.c b/source/tools/acpisrc/astable.c
index 400f56236170..b7defe7959b4 100644
--- a/source/tools/acpisrc/astable.c
+++ b/source/tools/acpisrc/astable.c
@@ -178,6 +178,7 @@ ACPI_STRING_TABLE LinuxDataTypes[] = {
ACPI_TYPED_IDENTIFIER_TABLE AcpiIdentifiers[] = {
+ {"ACPI_ADDRESS_RANGE", SRC_TYPE_STRUCT},
{"ACPI_ADR_SPACE_HANDLER", SRC_TYPE_SIMPLE},
{"ACPI_ADR_SPACE_SETUP", SRC_TYPE_SIMPLE},
{"ACPI_ADR_SPACE_TYPE", SRC_TYPE_SIMPLE},