aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README137
-rw-r--r--changes.txt93
-rwxr-xr-xgenerate/release/build.sh13
-rw-r--r--generate/unix/Makefile.common20
-rw-r--r--generate/unix/Makefile.config33
-rw-r--r--generate/unix/Makefile.rules23
-rw-r--r--generate/unix/acpibin/Makefile16
-rw-r--r--generate/unix/acpiexec/Makefile19
-rw-r--r--generate/unix/acpihelp/Makefile16
-rw-r--r--generate/unix/acpinames/Makefile21
-rw-r--r--generate/unix/acpisrc/Makefile16
-rw-r--r--generate/unix/acpixtract/Makefile16
-rw-r--r--generate/unix/iasl/Makefile27
-rw-r--r--source/common/adisasm.c8
-rw-r--r--source/common/ahpredef.c2
-rw-r--r--source/common/dmtable.c8
-rw-r--r--source/common/dmtbdump.c271
-rw-r--r--source/common/dmtbinfo.c92
-rw-r--r--source/compiler/Makefile360
-rw-r--r--source/compiler/aslcompiler.h5
-rw-r--r--source/compiler/aslcompiler.y146
-rw-r--r--source/compiler/aslfold.c129
-rw-r--r--source/compiler/aslmessages.h2
-rw-r--r--source/compiler/asltree.c86
-rw-r--r--source/compiler/aslutils.c55
-rwxr-xr-xsource/compiler/new_table.txt88
-rw-r--r--source/components/debugger/dbcmds.c4
-rw-r--r--source/components/debugger/dbexec.c247
-rw-r--r--source/components/disassembler/dmbuffer.c167
-rw-r--r--source/components/disassembler/dmopcode.c5
-rw-r--r--source/components/dispatcher/dswload.c14
-rw-r--r--source/components/dispatcher/dswload2.c14
-rw-r--r--source/components/events/evgpe.c18
-rw-r--r--source/components/events/evxfgpe.c2
-rw-r--r--source/components/hardware/hwesleep.c25
-rw-r--r--source/components/hardware/hwgpe.c12
-rw-r--r--source/components/hardware/hwsleep.c25
-rw-r--r--source/components/hardware/hwxfsleep.c22
-rw-r--r--source/components/namespace/nsdump.c2
-rw-r--r--source/components/utilities/utosi.c1
-rw-r--r--source/components/utilities/utxface.c406
-rw-r--r--source/components/utilities/utxferror.c4
-rw-r--r--source/components/utilities/utxfinit.c358
-rw-r--r--source/include/acbuffer.h246
-rw-r--r--source/include/acdisasm.h19
-rw-r--r--source/include/achware.h21
-rw-r--r--source/include/aclocal.h23
-rw-r--r--source/include/acmacros.h29
-rw-r--r--source/include/acnames.h3
-rw-r--r--source/include/acpixf.h14
-rw-r--r--source/include/actbl.h62
-rw-r--r--source/include/actbl1.h12
-rw-r--r--source/include/actbl2.h136
-rw-r--r--source/include/actbl3.h13
-rw-r--r--source/include/actypes.h10
-rw-r--r--source/include/platform/acenv.h3
-rw-r--r--source/include/platform/achaiku.h105
-rw-r--r--source/os_specific/service_layers/osunixxf.c10
-rw-r--r--source/os_specific/service_layers/oswinxf.c10
-rw-r--r--source/tools/acpibin/Makefile130
-rw-r--r--source/tools/acpiexec/Makefile288
-rw-r--r--source/tools/acpihelp/Makefile123
-rw-r--r--source/tools/acpinames/Makefile191
-rw-r--r--source/tools/acpisrc/Makefile124
-rw-r--r--source/tools/acpisrc/asmain.c10
-rw-r--r--source/tools/acpisrc/astable.c14
-rw-r--r--source/tools/acpixtract/Makefile116
67 files changed, 2491 insertions, 2249 deletions
diff --git a/README b/README
deleted file mode 100644
index 09557750848a..000000000000
--- a/README
+++ /dev/null
@@ -1,137 +0,0 @@
-Makefiles for tool generation from the unix tarball
----------------------------------------------------
-
-These makefiles are intended to generate the ACPICA utilities in
-a Linux or Unix-like environment, from the ACPICA source code
-as released in the unix tarball.
-
-Windows binary versions of these tools are available at:
-
-http://www.acpica.org/downloads/binary_tools.php
-
-Documentation is available at acpica.org:
-
-http://www.acpica.org/documentation/
-
-The acpica/source/tools directory contains the following utilities.
-Note: These utilities are tested and supported in both 32-bit
-and 64-bit versions.
-
-acpibin
-acpiexec
-acpihelp
-acpinames
-acpisrc
-acpixtract
-iasl
-
-
-Requirements
-------------
-
-make
-gcc compiler (4+)
-bison or yacc
-flex or lex
-
-
-Configuration
--------------
-
-The Makefiles contain this configuration information:
-
-HOST = _LINUX /* Host system, must appear in acenv.h */
-CC = gcc /* C compiler */
-
-
-1) acpibin, an AML file tool
-
-acpibin compares AML files, dumps AML binary files to text files,
-extracts binary AML from text files, and other AML file
-manipulation.
-
-To compile:
-
-cd acpica/source/tools/acpibin
-make
-make install /* install the binary to /usr/bin */
-
-
-2) acpiexec, a user-space AML interpreter
-
-acpiexec allows the loading of ACPI tables and execution of control
-methods from user space. Useful for debugging AML code and testing
-the AML interpreter. Hardware access is simulated.
-
-To compile:
-
-cd acpica/source/tools/acpiexec
-make
-make install /* install the binary to /usr/bin */
-
-
-3) acpihelp, syntax help for ASL operators and reserved names
-
-acpihelp displays the syntax for all of the ASL operators, as well
-as information about the ASL/ACPI reserved names (4-char names that
-start with underscore.)
-
-To compile:
-
-cd acpica/source/tools/acpihelp
-make
-make install /* install the binary to /usr/bin */
-
-
-4) acpinames, load and dump acpi namespace
-
-acpinames loads an ACPI namespace from a binary ACPI table file.
-This is a smaller version of acpiexec that loads an acpi table and
-dumps the resulting namespace. It is primarily intended to demonstrate
-the configurability of ACPICA.
-
-To compile:
-
-cd acpica/source/tools/acpinames
-make
-make install /* install the binary to /usr/bin */
-
-
-5) acpisrc, a source code conversion tool
-
-acpisrc converts the standard form of the acpica source release (included
-here) into a version that meets Linux coding guidelines. This consists
-mainly of performing a series of string replacements and transformations
-to the code. It can also be used to clean the acpica source and generate
-statistics.
-
-To compile:
-
-cd acpica/source/tools/acpisrc
-make
-make install /* install the binary to /usr/bin */
-
-
-6) acpixtract, extract binary ACPI tables from an acpidump
-
-acpixtract is used to extract binary ACPI tables from the ASCII text
-output of an acpidump utility (available on several different hosts.)
-
-To compile:
-
-cd acpica/source/tools/acpixtract
-make
-make install /* install the binary to /usr/bin */
-
-
-7) iasl, an optimizing ASL compiler/disassembler
-
-iasl compiles ASL (ACPI Source Language) into AML (ACPI Machine
-Language). This AML is suitable for inclusion as a DSDT in system
-firmware. It also can disassemble AML, for debugging purposes.
-
-To compile:
-
-cd acpica/source/compiler
-make
-make install /* install the binary to /usr/bin */
diff --git a/changes.txt b/changes.txt
index 605e67835db7..abe6a334c033 100644
--- a/changes.txt
+++ b/changes.txt
@@ -1,4 +1,97 @@
----------------------------------------
+16 August 2012. Summary of changes for version 20120816:
+
+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:
+
+Removed all use of the deprecated _GTS and _BFS predefined methods. The _GTS
+(Going To Sleep) and _BFS (Back From Sleep) methods are essentially
+deprecated and will probably be removed from the ACPI specification. Windows
+does not invoke them, and reportedly never will. The final nail in the coffin
+is that the ACPI specification states that these methods must be run with
+interrupts off, which is not going to happen in a kernel interpreter. Note:
+Linux has removed all use of the methods also. It was discovered that
+invoking these functions caused failures on some machines, probably because
+they were never tested since Windows does not call them. Affects two external
+interfaces, AcpiEnterSleepState and AcpiLeaveSleepStatePrep. Tang Feng.
+ACPICA BZ 969.
+
+Implemented support for complex bit-packed buffers returned from the _PLD
+(Physical Location of Device) predefined method. Adds a new external
+interface, AcpiDecodePldBuffer that parses the buffer into a more usable C
+structure. Note: C Bitfields cannot be used for this type of predefined
+structure since the memory layout of individual bitfields is not defined by
+the C language. In addition, there are endian concerns where a compiler will
+change the bitfield ordering based on the machine type. The new ACPICA
+interface eliminates these issues, and should be called after _PLD is
+executed. ACPICA BZ 954.
+
+Implemented a change to allow a scope change to root (via "Scope (\)") during
+execution of module-level ASL code (code that is executed at table load
+time.) Lin Ming.
+
+Added the Windows8/Server2012 string for the _OSI method. This change adds a
+new _OSI string, "Windows 2012" for both Windows 8 and Windows Server 2012.
+
+Added header support for the new ACPI tables DBG2 (Debug Port Table Type 2)
+and CSRT (Core System Resource Table).
+
+Added struct header support for the _FDE, _GRT, _GTM, and _SRT predefined
+names. This simplifies access to the buffers returned by these predefined
+names. Adds a new file, include/acbuffer.h. ACPICA BZ 956.
+
+GPE support: Removed an extraneous parameter from the various low-level
+internal GPE functions. Tang Feng.
+
+Removed the linux makefiles from the unix packages. The generate/linux
+makefiles are obsolete and have been removed from the unix tarball release
+packages. The replacement makefiles are under generate/unix, and there is a
+top-level makefile under the main acpica directory. ACPICA BZ 967, 912.
+
+Updates for Unix makefiles:
+1) Add -D_FORTIFY_SOURCE=2 for gcc generation. Arjan van de Ven.
+2) Update linker flags (move to end of command line) for AcpiExec utility.
+Guan Chao.
+
+Split ACPICA initialization functions to new file, utxfinit.c. Split from
+utxface.c to improve modularity and reduce file size.
+
+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.5K Code, 25.3K Data, 118.8K Total
+ Debug Version: 173.7K Code, 74.0K Data, 247.7K Total
+ Current Release:
+ Non-Debug Version: 93.8K Code, 25.3K Data, 119.1K Total
+ Debug Version: 175.7K Code, 74.8K Data, 250.5K Total
+
+
+2) iASL Compiler/Disassembler and Tools:
+
+iASL: Fixed a problem with constant folding for fixed-length constant
+expressions. The constant-folding code was not being invoked for constant
+expressions that allow the use of type 3/4/5 opcodes to generate constants
+for expressions such as ByteConstExpr, WordConstExpr, etc. This could result
+in the generation of invalid AML bytecode. ACPICA BZ 970.
+
+iASL: Fixed a generation issue on newer versions of Bison. Newer versions
+apparently automatically emit some of the necessary externals. This change
+handles these versions in order to eliminate generation warnings.
+
+Disassembler: Added support to decode the DBG2 and CSRT ACPI tables.
+
+Disassembler: Add support to decode _PLD buffers. The decoded buffer appears
+within comments in the output file.
+
+Debugger: Fixed a regression with the "Threads" command where
+AE_BAD_PARAMETER was always returned.
+
+----------------------------------------
11 July 2012. Summary of changes for version 20120711:
This release is available at https://www.acpica.org/downloads The ACPI 5.0
diff --git a/generate/release/build.sh b/generate/release/build.sh
index ab87792709fa..dccad343d964 100755
--- a/generate/release/build.sh
+++ b/generate/release/build.sh
@@ -278,19 +278,6 @@ generate_source_package ()
#
# Unix/Linux-specific activities
#
-
- # Copy Linux/UNIX utility generation makefiles
-
- cp generate/linux/Makefile.acpibin $TEMP_DIR/source/tools/acpibin/Makefile
- cp generate/linux/Makefile.acpiexec $TEMP_DIR/source/tools/acpiexec/Makefile
- cp generate/linux/Makefile.acpihelp $TEMP_DIR/source/tools/acpihelp/Makefile
- cp generate/linux/Makefile.acpinames $TEMP_DIR/source/tools/acpinames/Makefile
- cp generate/linux/Makefile.acpisrc $TEMP_DIR/source/tools/acpisrc/Makefile
- cp generate/linux/Makefile.acpixtract $TEMP_DIR/source/tools/acpixtract/Makefile
- cp generate/linux/Makefile.iasl $TEMP_DIR/source/compiler/Makefile
- cp generate/linux/README.acpica-unix $TEMP_DIR/README
-
- #
# For Unix2 case, insert the dual license header into all source files
#
if [ $LICENSE == Dual ]; then
diff --git a/generate/unix/Makefile.common b/generate/unix/Makefile.common
index 2d7ac70511ac..69e9806e9a5f 100644
--- a/generate/unix/Makefile.common
+++ b/generate/unix/Makefile.common
@@ -7,6 +7,7 @@
# string will be treated as a 64-bit OS. Otherwise, the default is 32-bit.
#
HARDWARE_NAME := $(shell uname -m)
+BITS=0
#
# Main rule will only generate versions that are appropriate for the running
@@ -15,16 +16,22 @@ HARDWARE_NAME := $(shell uname -m)
all: ${PROGS}
${PROGS}: FORCE
@cd $(BUILD_DIRECTORY_PATH)/$@; \
- if [ $(findstring 64,$(HARDWARE_NAME)) ]; then \
+ if [ $(BITS) -eq 32 ]; then \
+ echo "Forced 32-bit generation of $@"; \
+ mkdir -p obj32; \
+ make BITS=32; \
+ echo "32-bit version of $@:"; \
+ ls -al ../bin32/$@; \
+ elif [ $(findstring 64,$(HARDWARE_NAME)) ]; then \
mkdir -p obj64; \
make BITS=64; \
echo "64-bit version of $@:"; \
- ls -al obj64/$@; \
+ ls -al ../bin64/$@; \
else \
mkdir -p obj32; \
make BITS=32; \
echo "32-bit version of $@:"; \
- ls -al obj32/$@; \
+ ls -al ../bin32/$@; \
fi;
#
@@ -63,6 +70,7 @@ both: 32 64
clean: FORCE
@for toolname in ${PROGS}; do \
(cd $(BUILD_DIRECTORY_PATH)/$$toolname; \
+ echo "Removing $$toolname"; \
pwd; \
if [ -d "obj32" ] ; then \
make BITS=32 clean; \
@@ -72,6 +80,7 @@ clean: FORCE
make BITS=64 clean; \
rmdir obj64; \
fi; \
+ echo ""; \
); \
done;
@@ -83,12 +92,13 @@ install: FORCE
(cd $(BUILD_DIRECTORY_PATH)/$$toolname; \
pwd; \
if [ $(findstring 64,$(HARDWARE_NAME)) ]; then \
- make BITS=64 install; \
+ make BITS=64 PROG=$$toolname install; \
echo "Installed 64-bit version of $$toolname"; \
else \
- make BITS=32 install; \
+ make BITS=32 PROG=$$toolname install; \
echo "Installed 32-bit version of $$toolname"; \
fi; \
+ echo ""; \
); \
done;
diff --git a/generate/unix/Makefile.config b/generate/unix/Makefile.config
index 3cd224e3a50f..4bcaed3b9b28 100644
--- a/generate/unix/Makefile.config
+++ b/generate/unix/Makefile.config
@@ -28,22 +28,30 @@
# The _GNU_SOURCE symbol is required for many hosts.
#
.SUFFIXES :
-PROGS = acpibin acpiexec acpihelp acpinames acpisrc acpixtract iasl
-HOST = _CYGWIN
-CC = gcc
+PROGS = acpibin acpiexec acpihelp acpinames acpisrc acpixtract iasl
+HOST = _CYGWIN
+CC = gcc
#
# Common defines
#
-OBJDIR = obj$(BITS)
-BINDIR = bin$(BITS)
-BITSFLAG = -m$(BITS)
-COMPILE = $(CC) -c $(CFLAGS) $(CWARNINGFLAGS) -o$@ $<
-COPYPROG = @mkdir -p ../$(BINDIR); \
- rm -f ../$(BINDIR)/$(PROG); \
- cp --remove-destination $(PROG) ../$(BINDIR);
-INSTALLDIR = /usr/bin
-INSTALLPROG = cp --remove-destination $(PROG) $(INSTALLDIR)
+OBJDIR = obj$(BITS)
+BINDIR = bin$(BITS)
+BITSFLAG = -m$(BITS)
+COMPILEOBJ = $(CC) -c $(CFLAGS) $(CWARNINGFLAGS) -o$@ $<
+LINKPROG = $(CC) $(OBJECTS) -o $(PROG) $(LDFLAGS)
+
+COPYPROG = \
+ @mkdir -p ../$(BINDIR); \
+ if [ -e "$(PROG).exe" ] ; then \
+ mv $(PROG).exe $(PROG); \
+ echo "Renamed $(PROG).exe to $(PROG)"; \
+ fi; \
+ cp --remove-destination $(PROG) ../$(BINDIR); \
+ echo "Copied $(PROG) to ../$(BINDIR)";
+
+INSTALLDIR = /usr/bin
+INSTALLPROG = install -D ../$(BINDIR)/$(PROG) $(DESTDIR)$(INSTALLDIR)/$(PROG)
#
# Main ACPICA source directories
@@ -92,6 +100,7 @@ CFLAGS += \
$(BITSFLAG) \
-D$(HOST) \
-D_GNU_SOURCE \
+ -D_FORTIFY_SOURCE=2 \
-I$(ACPICA_INCLUDE)
LDFLAGS += $(BITSFLAG)
diff --git a/generate/unix/Makefile.rules b/generate/unix/Makefile.rules
new file mode 100644
index 000000000000..184630cd5384
--- /dev/null
+++ b/generate/unix/Makefile.rules
@@ -0,0 +1,23 @@
+#
+# Common rules for generation of ACPICA utilities
+#
+# FINAL_PROG - Copies the utility to the local binXX directory (32/64)
+# PROG - Builds the utility (links the object files)
+#
+# Note: $(INTERMEDIATES) and $(MISC) are used for iASL compiler only.
+#
+
+$(FINAL_PROG) : $(PROG)
+ $(COPYPROG)
+
+$(PROG) : $(INTERMEDIATES) $(MISC) $(OBJECTS)
+ $(LINKPROG)
+
+$(OBJDIR)/%.o : %.c $(HEADERS) $(ACPICA_HEADERS)
+ $(COMPILEOBJ)
+
+clean :
+ rm -f $(PROG) $(PROG).exe $(OBJECTS) $(INTERMEDIATES) $(MISC)
+
+install :
+ $(INSTALLPROG)
diff --git a/generate/unix/acpibin/Makefile b/generate/unix/acpibin/Makefile
index e26f209d7c88..0ec293a64053 100644
--- a/generate/unix/acpibin/Makefile
+++ b/generate/unix/acpibin/Makefile
@@ -11,6 +11,7 @@
# compile options, and prevents pollution of the source code.
#
include ../Makefile.config
+FINAL_PROG = ../$(BINDIR)/acpibin
PROG = $(OBJDIR)/acpibin
#
@@ -51,17 +52,6 @@ CFLAGS+= \
-I$(ACPIBIN)
#
-# Rules
+# Common Rules
#
-$(PROG) : $(OBJECTS)
- $(CC) $(LDFLAGS) $(OBJECTS) -o $(PROG)
- $(COPYPROG)
-
-$(OBJDIR)/%.o : %.c $(HEADERS) $(ACPICA_HEADERS)
- $(COMPILE)
-
-clean :
- rm -f $(PROG) $(PROG).exe $(OBJECTS)
-
-install :
- $(INSTALLPROG)
+include ../Makefile.rules
diff --git a/generate/unix/acpiexec/Makefile b/generate/unix/acpiexec/Makefile
index 80ef514d7b3b..17ab8ad71b5f 100644
--- a/generate/unix/acpiexec/Makefile
+++ b/generate/unix/acpiexec/Makefile
@@ -13,6 +13,7 @@
# compile options, and prevents pollution of the source code.
#
include ../Makefile.config
+FINAL_PROG = ../$(BINDIR)/acpiexec
PROG = $(OBJDIR)/acpiexec
#
@@ -191,12 +192,13 @@ OBJECTS = \
$(OBJDIR)/utmisc.o \
$(OBJDIR)/utmutex.o \
$(OBJDIR)/utobject.o \
+ $(OBJDIR)/utosi.o \
$(OBJDIR)/utresrc.o \
$(OBJDIR)/utstate.o \
$(OBJDIR)/uttrack.o \
- $(OBJDIR)/utosi.o \
$(OBJDIR)/utxface.o \
$(OBJDIR)/utxferror.o \
+ $(OBJDIR)/utxfinit.o \
$(OBJDIR)/utxfmutex.o
#
@@ -208,17 +210,6 @@ CFLAGS+= \
LDFLAGS += -lpthread -lrt
#
-# Rules
+# Common Rules
#
-$(PROG) : $(OBJECTS)
- $(CC) $(LDFLAGS) $(OBJECTS) -o $(PROG)
- $(COPYPROG)
-
-$(OBJDIR)/%.o : %.c $(HEADERS) $(ACPICA_HEADERS)
- $(COMPILE)
-
-clean :
- rm -f $(PROG) $(PROG).exe $(OBJECTS)
-
-install :
- $(INSTALLPROG)
+include ../Makefile.rules
diff --git a/generate/unix/acpihelp/Makefile b/generate/unix/acpihelp/Makefile
index 30a690c9d1e9..c44bffefb5fe 100644
--- a/generate/unix/acpihelp/Makefile
+++ b/generate/unix/acpihelp/Makefile
@@ -12,6 +12,7 @@
# compile options, and prevents pollution of the source code.
#
include ../Makefile.config
+FINAL_PROG = ../$(BINDIR)/acpihelp
PROG = $(OBJDIR)/acpihelp
#
@@ -43,17 +44,6 @@ CFLAGS+= \
-I$(ACPIHELP)
#
-# Rules
+# Common Rules
#
-$(PROG) : $(OBJECTS)
- $(CC) $(LDFLAGS) $(OBJECTS) -o $(PROG)
- $(COPYPROG)
-
-$(OBJDIR)/%.o : %.c $(HEADERS) $(ACPICA_HEADERS)
- $(COMPILE)
-
-clean :
- rm -f $(PROG) $(PROG).exe $(OBJECTS)
-
-install :
- $(INSTALLPROG)
+include ../Makefile.rules
diff --git a/generate/unix/acpinames/Makefile b/generate/unix/acpinames/Makefile
index ed3304dbfa66..e60fcbc68d62 100644
--- a/generate/unix/acpinames/Makefile
+++ b/generate/unix/acpinames/Makefile
@@ -13,6 +13,7 @@
# compile options, and prevents pollution of the source code.
#
include ../Makefile.config
+FINAL_PROG = ../$(BINDIR)/acpinames
PROG = $(OBJDIR)/acpinames
#
@@ -96,10 +97,11 @@ OBJECTS = \
$(OBJDIR)/utmisc.o \
$(OBJDIR)/utmutex.o \
$(OBJDIR)/utobject.o \
- $(OBJDIR)/utstate.o \
$(OBJDIR)/utosi.o \
+ $(OBJDIR)/utstate.o \
+ $(OBJDIR)/utxface.o \
$(OBJDIR)/utxferror.o \
- $(OBJDIR)/utxface.o
+ $(OBJDIR)/utxfinit.o
#
# Flags specific to acpinames utility
@@ -109,17 +111,6 @@ CFLAGS+= \
-I$(ACPINAMES)
#
-# Rules
+# Common Rules
#
-$(PROG) : $(OBJECTS)
- $(CC) $(LDFLAGS) $(OBJECTS) -o $(PROG)
- $(COPYPROG)
-
-$(OBJDIR)/%.o : %.c $(HEADERS) $(ACPICA_HEADERS)
- $(COMPILE)
-
-clean :
- rm -f $(PROG) $(PROG).exe $(OBJECTS)
-
-install :
- $(INSTALLPROG)
+include ../Makefile.rules
diff --git a/generate/unix/acpisrc/Makefile b/generate/unix/acpisrc/Makefile
index abc8c2959ff3..9c9c578c419d 100644
--- a/generate/unix/acpisrc/Makefile
+++ b/generate/unix/acpisrc/Makefile
@@ -11,6 +11,7 @@
# compile options, and prevents pollution of the source code.
#
include ../Makefile.config
+FINAL_PROG = ../$(BINDIR)/acpisrc
PROG = $(OBJDIR)/acpisrc
#
@@ -43,17 +44,6 @@ CFLAGS+= \
-I$(ACPISRC)
#
-# Rules
+# Common Rules
#
-$(PROG) : $(OBJECTS)
- $(CC) $(LDFLAGS) $(OBJECTS) -o $(PROG)
- $(COPYPROG)
-
-$(OBJDIR)/%.o : %.c $(HEADERS) $(ACPICA_HEADERS)
- $(COMPILE)
-
-clean :
- rm -f $(PROG) $(PROG).exe $(OBJECTS)
-
-install :
- $(INSTALLPROG)
+include ../Makefile.rules
diff --git a/generate/unix/acpixtract/Makefile b/generate/unix/acpixtract/Makefile
index 9c0b2997e8f1..183aa0d94b5f 100644
--- a/generate/unix/acpixtract/Makefile
+++ b/generate/unix/acpixtract/Makefile
@@ -11,6 +11,7 @@
# compile options, and prevents pollution of the source code.
#
include ../Makefile.config
+FINAL_PROG = ../$(BINDIR)/acpixtract
PROG = $(OBJDIR)/acpixtract
#
@@ -35,17 +36,6 @@ CFLAGS+= \
-DACPI_XTRACT_APP \
#
-# Rules
+# Common Rules
#
-$(PROG) : $(OBJECTS)
- $(CC) $(LDFLAGS) $(OBJECTS) -o $(PROG)
- $(COPYPROG)
-
-$(OBJDIR)/%.o : %.c $(HEADERS) $(ACPICA_HEADERS)
- $(COMPILE)
-
-clean :
- rm -f $(PROG) $(PROG).exe $(OBJECTS)
-
-install :
- $(INSTALLPROG)
+include ../Makefile.rules
diff --git a/generate/unix/iasl/Makefile b/generate/unix/iasl/Makefile
index 0a09aa0db9d8..fe7f98c00c37 100644
--- a/generate/unix/iasl/Makefile
+++ b/generate/unix/iasl/Makefile
@@ -11,6 +11,7 @@
# compile options, and prevents pollution of the source code.
#
include ../Makefile.config
+FINAL_PROG = ../$(BINDIR)/iasl
PROG = $(OBJDIR)/iasl
#
@@ -179,8 +180,8 @@ OBJECTS = \
$(OBJDIR)/utobject.o \
$(OBJDIR)/utresrc.o \
$(OBJDIR)/utstate.o \
- $(OBJDIR)/utxferror.o \
- $(OBJDIR)/utxface.o
+ $(OBJDIR)/utxface.o \
+ $(OBJDIR)/utxferror.o
INTERMEDIATES = \
$(OBJDIR)/aslcompilerlex.c \
@@ -210,11 +211,10 @@ CFLAGS+= \
-I$(OBJDIR)
#
-# Root rule
+# Common Rules
#
-$(PROG) : $(INTERMEDIATES) $(MISC) $(OBJECTS)
- $(CC) $(LDFLAGS) $(OBJECTS) -o $(PROG)
- $(COPYPROG)
+include ../Makefile.rules
+
#
# Parser and Lexer - intermediate C files
@@ -238,8 +238,9 @@ $(OBJDIR)/prparserparse.c $(OBJDIR)/prparserparse.h : $(ASL_COMPILER)/prparser.y
${YACC} ${YFLAGS} -pPrParser -o$@ $?
-# Rename headers produced by bison/yacc
-
+#
+# Rename the headers produced by bison/yacc
+#
$(OBJDIR)/aslcompiler.y.h : $(OBJDIR)/aslcompilerparse.h
@echo Copy intermediate file:
@cp -f -v $(OBJDIR)/aslcompilerparse.h $(OBJDIR)/aslcompiler.y.h
@@ -276,13 +277,3 @@ $(OBJDIR)/prparserlex.o : $(OBJDIR)/prparserlex.c
$(OBJDIR)/prparserparse.o : $(OBJDIR)/prparserparse.c
$(CC) -c $(CFLAGS) -Wall -Werror -o$@ $?
-
-
-$(OBJDIR)/%.o : %.c $(HEADERS) $(ACPICA_HEADERS)
- $(COMPILE)
-
-clean :
- rm -f $(PROG) $(PROG).exe $(OBJECTS) $(INTERMEDIATES) $(MISC)
-
-install :
- $(INSTALLPROG)
diff --git a/source/common/adisasm.c b/source/common/adisasm.c
index cc583767e643..fab36179a81d 100644
--- a/source/common/adisasm.c
+++ b/source/common/adisasm.c
@@ -60,9 +60,13 @@
#define _COMPONENT ACPI_TOOLS
ACPI_MODULE_NAME ("adisasm")
-
+/*
+ * Older versions of Bison won't emit this external in the generated header.
+ * Newer versions do emit the external, so we don't need to do it.
+ */
+#ifndef ASLCOMPILER_ASLCOMPILERPARSE_H
extern int AslCompilerdebug;
-
+#endif
ACPI_STATUS
LsDisplayNamespace (
diff --git a/source/common/ahpredef.c b/source/common/ahpredef.c
index b3f1496e24d9..38a7f9db2e5b 100644
--- a/source/common/ahpredef.c
+++ b/source/common/ahpredef.c
@@ -198,7 +198,7 @@ const AH_PREDEFINED_NAME AslPredefinedInfo[] =
AH_PREDEF ("_PIC", "Interrupt Model", "Inform AML of the interrupt model in use"),
AH_PREDEF ("_PIF", "Power Source Information", "Returns a Power Source information block"),
AH_PREDEF ("_PIN", "Pin List", "Pin list, Resource Descriptor field"),
- AH_PREDEF ("_PLD", "Physical Device Location", "Returns a device's physical location information"),
+ AH_PREDEF ("_PLD", "Physical Location of Device", "Returns a device's physical location information"),
AH_PREDEF ("_PMC", "Power Meter Capabilities", "Returns a list of Power Meter capabilities info"),
AH_PREDEF ("_PMD", "Power Metered Devices", "Returns a list of devices that are measured by the power meter device"),
AH_PREDEF ("_PMM", "Power Meter Measurement", "Returns the current value of the Power Meter"),
diff --git a/source/common/dmtable.c b/source/common/dmtable.c
index eceef4f51bf0..cb97b541d97e 100644
--- a/source/common/dmtable.c
+++ b/source/common/dmtable.c
@@ -277,22 +277,24 @@ static const char *AcpiDmGasAccessWidth[] =
ACPI_DMTABLE_DATA AcpiDmTableData[] =
{
{ACPI_SIG_ASF, NULL, AcpiDmDumpAsf, DtCompileAsf, TemplateAsf, "Alert Standard Format table"},
- {ACPI_SIG_BOOT, AcpiDmTableInfoBoot, NULL, NULL, TemplateBoot, "Simple Boot Flag Table"},
{ACPI_SIG_BERT, AcpiDmTableInfoBert, NULL, NULL, TemplateBert, "Boot Error Record Table"},
{ACPI_SIG_BGRT, AcpiDmTableInfoBgrt, NULL, NULL, TemplateBgrt, "Boot Graphics Resource Table"},
+ {ACPI_SIG_BOOT, AcpiDmTableInfoBoot, NULL, NULL, TemplateBoot, "Simple Boot Flag Table"},
{ACPI_SIG_CPEP, NULL, AcpiDmDumpCpep, DtCompileCpep, TemplateCpep, "Corrected Platform Error Polling table"},
+ {ACPI_SIG_CSRT, NULL, AcpiDmDumpCsrt, NULL, NULL, "Core System Resource Table"},
+ {ACPI_SIG_DBG2, NULL, AcpiDmDumpDbg2, NULL, NULL, "Debug Port table type 2"},
{ACPI_SIG_DBGP, AcpiDmTableInfoDbgp, NULL, NULL, TemplateDbgp, "Debug Port table"},
{ACPI_SIG_DMAR, NULL, AcpiDmDumpDmar, DtCompileDmar, TemplateDmar, "DMA Remapping table"},
{ACPI_SIG_ECDT, AcpiDmTableInfoEcdt, NULL, NULL, TemplateEcdt, "Embedded Controller Boot Resources Table"},
{ACPI_SIG_EINJ, NULL, AcpiDmDumpEinj, DtCompileEinj, TemplateEinj, "Error Injection table"},
{ACPI_SIG_ERST, NULL, AcpiDmDumpErst, DtCompileErst, TemplateErst, "Error Record Serialization Table"},
- {ACPI_SIG_FADT, NULL, AcpiDmDumpFadt, DtCompileFadt, TemplateFadt, "Fixed ACPI Description Table"},
+ {ACPI_SIG_FADT, NULL, AcpiDmDumpFadt, DtCompileFadt, TemplateFadt, "Fixed ACPI Description Table (FADT)"},
{ACPI_SIG_FPDT, NULL, AcpiDmDumpFpdt, DtCompileFpdt, TemplateFpdt, "Firmware Performance Data Table"},
{ACPI_SIG_GTDT, AcpiDmTableInfoGtdt, NULL, NULL, TemplateGtdt, "Generic Timer Description Table"},
{ACPI_SIG_HEST, NULL, AcpiDmDumpHest, DtCompileHest, TemplateHest, "Hardware Error Source Table"},
{ACPI_SIG_HPET, AcpiDmTableInfoHpet, NULL, NULL, TemplateHpet, "High Precision Event Timer table"},
{ACPI_SIG_IVRS, NULL, AcpiDmDumpIvrs, DtCompileIvrs, TemplateIvrs, "I/O Virtualization Reporting Structure"},
- {ACPI_SIG_MADT, NULL, AcpiDmDumpMadt, DtCompileMadt, TemplateMadt, "Multiple APIC Description Table"},
+ {ACPI_SIG_MADT, NULL, AcpiDmDumpMadt, DtCompileMadt, TemplateMadt, "Multiple APIC Description Table (MADT)"},
{ACPI_SIG_MCFG, NULL, AcpiDmDumpMcfg, DtCompileMcfg, TemplateMcfg, "Memory Mapped Configuration table"},
{ACPI_SIG_MCHI, AcpiDmTableInfoMchi, NULL, NULL, TemplateMchi, "Management Controller Host Interface table"},
{ACPI_SIG_MPST, AcpiDmTableInfoMpst, AcpiDmDumpMpst, DtCompileMpst, TemplateMpst, "Memory Power State Table"},
diff --git a/source/common/dmtbdump.c b/source/common/dmtbdump.c
index 5ea0ea34e6ad..102f1fe0c241 100644
--- a/source/common/dmtbdump.c
+++ b/source/common/dmtbdump.c
@@ -52,11 +52,79 @@
ACPI_MODULE_NAME ("dmtbdump")
+/* Local prototypes */
+
static void
AcpiDmValidateFadtLength (
UINT32 Revision,
UINT32 Length);
+static void
+AcpiDmDumpBuffer (
+ void *Table,
+ UINT32 BufferOffset,
+ UINT32 Length,
+ UINT32 AbsoluteOffset,
+ char *Header);
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiDmDumpBuffer
+ *
+ * PARAMETERS: Table - ACPI Table or subtable
+ * BufferOffset - Offset of buffer from Table above
+ * Length - Length of the buffer
+ * AbsoluteOffset - Offset of buffer in the main ACPI table
+ * Header - Name of the buffer field (printed on the
+ * first line only.)
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Format the contents of an arbitrary length data buffer (in the
+ * disassembler output format.)
+ *
+ ******************************************************************************/
+
+static void
+AcpiDmDumpBuffer (
+ void *Table,
+ UINT32 BufferOffset,
+ UINT32 Length,
+ UINT32 AbsoluteOffset,
+ char *Header)
+{
+ UINT8 *Buffer;
+ UINT32 i;
+
+
+ if (!Length)
+ {
+ return;
+ }
+
+ Buffer = ACPI_CAST_PTR (UINT8, Table) + BufferOffset;
+ i = 0;
+
+ while (i < Length)
+ {
+ if (!(i % 16))
+ {
+ AcpiOsPrintf ("\n");
+ AcpiDmLineHeader (AbsoluteOffset,
+ ((Length - i) > 16) ? 16 : (Length - i), Header);
+ Header = NULL;
+ }
+
+ AcpiOsPrintf ("%.02X ", *Buffer);
+ i++;
+ Buffer++;
+ AbsoluteOffset++;
+ }
+
+ AcpiOsPrintf ("\n");
+}
+
/*******************************************************************************
*
@@ -529,6 +597,208 @@ AcpiDmDumpCpep (
/*******************************************************************************
*
+ * FUNCTION: AcpiDmDumpCsrt
+ *
+ * PARAMETERS: Table - A CSRT table
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Format the contents of a CSRT. This table type consists
+ * of an open-ended number of subtables.
+ *
+ ******************************************************************************/
+
+void
+AcpiDmDumpCsrt (
+ ACPI_TABLE_HEADER *Table)
+{
+ ACPI_STATUS Status;
+ ACPI_CSRT_GROUP *SubTable;
+ ACPI_CSRT_DESCRIPTOR *SubSubTable;
+ UINT32 Length = Table->Length;
+ UINT32 Offset = sizeof (ACPI_TABLE_CSRT);
+ UINT32 SubOffset;
+ UINT32 SubSubOffset;
+ UINT32 InfoLength;
+
+
+ /* The main table only contains the ACPI header, thus already handled */
+
+ /* Sub-tables (Resource Groups) */
+
+ SubTable = ACPI_ADD_PTR (ACPI_CSRT_GROUP, Table, Offset);
+ while (Offset < Table->Length)
+ {
+ AcpiOsPrintf ("\n");
+ Status = AcpiDmDumpTable (Length, Offset, SubTable,
+ SubTable->Length, AcpiDmTableInfoCsrt0);
+ if (ACPI_FAILURE (Status))
+ {
+ return;
+ }
+
+ SubOffset = sizeof (ACPI_CSRT_GROUP);
+
+ /* Shared resource group info buffer */
+
+ AcpiDmDumpBuffer (SubTable, SubOffset, SubTable->InfoLength,
+ Offset+SubOffset, "Shared Data");
+ SubOffset += SubTable->InfoLength;
+
+ /* Sub-Sub-tables (Resource Descriptors) */
+
+ SubSubTable = ACPI_ADD_PTR (ACPI_CSRT_DESCRIPTOR, Table,
+ Offset + SubOffset);
+
+ while ((SubOffset < SubTable->Length) &&
+ ((Offset + SubOffset) < Table->Length))
+ {
+ AcpiOsPrintf ("\n");
+ Status = AcpiDmDumpTable (Length, Offset + SubOffset, SubSubTable,
+ SubSubTable->Length, AcpiDmTableInfoCsrt1);
+ if (ACPI_FAILURE (Status))
+ {
+ return;
+ }
+
+ SubSubOffset = sizeof (ACPI_CSRT_DESCRIPTOR);
+
+ /* Resource-specific info buffer */
+
+ InfoLength = SubSubTable->Length - SubSubOffset;
+
+ AcpiDmDumpBuffer (SubSubTable, SubSubOffset, InfoLength,
+ Offset + SubOffset + SubSubOffset, "ResourceInfo");
+ SubSubOffset += InfoLength;
+
+ /* Point to next sub-sub-table */
+
+ SubOffset += SubSubTable->Length;
+ SubSubTable = ACPI_ADD_PTR (ACPI_CSRT_DESCRIPTOR, SubSubTable,
+ SubSubTable->Length);
+ }
+
+ /* Point to next sub-table */
+
+ Offset += SubTable->Length;
+ SubTable = ACPI_ADD_PTR (ACPI_CSRT_GROUP, SubTable,
+ SubTable->Length);
+ }
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiDmDumpDbg2
+ *
+ * PARAMETERS: Table - A DBG2 table
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Format the contents of a DBG2. This table type consists
+ * of an open-ended number of subtables.
+ *
+ ******************************************************************************/
+
+void
+AcpiDmDumpDbg2 (
+ ACPI_TABLE_HEADER *Table)
+{
+ ACPI_STATUS Status;
+ ACPI_DBG2_DEVICE *SubTable;
+ UINT32 Length = Table->Length;
+ UINT32 Offset = sizeof (ACPI_TABLE_DBG2);
+ UINT32 i;
+ UINT32 ArrayOffset;
+ UINT32 AbsoluteOffset;
+ UINT8 *Array;
+
+
+ /* Main table */
+
+ Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoDbg2);
+ if (ACPI_FAILURE (Status))
+ {
+ return;
+ }
+
+ /* Sub-tables */
+
+ SubTable = ACPI_ADD_PTR (ACPI_DBG2_DEVICE, Table, Offset);
+ while (Offset < Table->Length)
+ {
+ AcpiOsPrintf ("\n");
+ Status = AcpiDmDumpTable (Length, Offset, SubTable,
+ SubTable->Length, AcpiDmTableInfoDbg2Device);
+ if (ACPI_FAILURE (Status))
+ {
+ return;
+ }
+
+ /* Dump the BaseAddress array */
+
+ for (i = 0; i < SubTable->RegisterCount; i++)
+ {
+ ArrayOffset = SubTable->BaseAddressOffset +
+ (sizeof (ACPI_GENERIC_ADDRESS) * i);
+ AbsoluteOffset = Offset + ArrayOffset;
+ Array = (UINT8 *) SubTable + ArrayOffset;
+
+ Status = AcpiDmDumpTable (Length, AbsoluteOffset, Array,
+ SubTable->Length, AcpiDmTableInfoDbg2Addr);
+ if (ACPI_FAILURE (Status))
+ {
+ return;
+ }
+ }
+
+ /* Dump the AddressSize array */
+
+ for (i = 0; i < SubTable->RegisterCount; i++)
+ {
+ ArrayOffset = SubTable->AddressSizeOffset +
+ (sizeof (UINT32) * i);
+ AbsoluteOffset = Offset + ArrayOffset;
+ Array = (UINT8 *) SubTable + ArrayOffset;
+
+ Status = AcpiDmDumpTable (Length, AbsoluteOffset, Array,
+ SubTable->Length, AcpiDmTableInfoDbg2Size);
+ if (ACPI_FAILURE (Status))
+ {
+ return;
+ }
+ }
+
+ /* Dump the Namestring (required) */
+
+ AcpiOsPrintf ("\n");
+ ArrayOffset = SubTable->NamepathOffset;
+ AbsoluteOffset = Offset + ArrayOffset;
+ Array = (UINT8 *) SubTable + ArrayOffset;
+
+ Status = AcpiDmDumpTable (Length, AbsoluteOffset, Array,
+ SubTable->Length, AcpiDmTableInfoDbg2Name);
+ if (ACPI_FAILURE (Status))
+ {
+ return;
+ }
+
+ /* Dump the OemData (optional) */
+
+ AcpiDmDumpBuffer (SubTable, SubTable->OemDataOffset, SubTable->OemDataLength,
+ Offset + SubTable->OemDataOffset, "OEM Data");
+
+ /* Point to next sub-table */
+
+ Offset += SubTable->Length;
+ SubTable = ACPI_ADD_PTR (ACPI_DBG2_DEVICE, SubTable,
+ SubTable->Length);
+ }
+}
+
+
+/*******************************************************************************
+ *
* FUNCTION: AcpiDmDumpDmar
*
* PARAMETERS: Table - A DMAR table
@@ -540,6 +810,7 @@ AcpiDmDumpCpep (
*
******************************************************************************/
+
void
AcpiDmDumpDmar (
ACPI_TABLE_HEADER *Table)
diff --git a/source/common/dmtbinfo.c b/source/common/dmtbinfo.c
index 4600a0aa53d3..1cd856a854c9 100644
--- a/source/common/dmtbinfo.c
+++ b/source/common/dmtbinfo.c
@@ -86,6 +86,7 @@
#define ACPI_BGRT_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_BGRT,f)
#define ACPI_BOOT_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_BOOT,f)
#define ACPI_CPEP_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_CPEP,f)
+#define ACPI_DBG2_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_DBG2,f)
#define ACPI_DBGP_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_DBGP,f)
#define ACPI_DMAR_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_DMAR,f)
#define ACPI_DRTM_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_DRTM,f)
@@ -126,6 +127,9 @@
#define ACPI_ASF3_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_ASF_RMCP,f)
#define ACPI_ASF4_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_ASF_ADDRESS,f)
#define ACPI_CPEP0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_CPEP_POLLING,f)
+#define ACPI_CSRT0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_CSRT_GROUP,f)
+#define ACPI_CSRT1_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_CSRT_DESCRIPTOR,f)
+#define ACPI_DBG20_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_DBG2_DEVICE,f)
#define ACPI_DMARS_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_DMAR_DEVICE_SCOPE,f)
#define ACPI_DMAR0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_DMAR_HARDWARE_UNIT,f)
#define ACPI_DMAR1_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_DMAR_RESERVED_MEMORY,f)
@@ -641,6 +645,94 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoCpep0[] =
/*******************************************************************************
*
+ * CSRT - Core System Resource Table
+ *
+ ******************************************************************************/
+
+/* Main table consists only of the standard ACPI table header */
+
+/* Resource Group subtable */
+
+ACPI_DMTABLE_INFO AcpiDmTableInfoCsrt0[] =
+{
+ {ACPI_DMT_UINT32, ACPI_CSRT0_OFFSET (Length), "Length", 0},
+ {ACPI_DMT_UINT32, ACPI_CSRT0_OFFSET (VendorId), "Vendor ID", 0},
+ {ACPI_DMT_UINT32, ACPI_CSRT0_OFFSET (SubvendorId), "Subvendor ID", 0},
+ {ACPI_DMT_UINT16, ACPI_CSRT0_OFFSET (DeviceId), "Device ID", 0},
+ {ACPI_DMT_UINT16, ACPI_CSRT0_OFFSET (SubdeviceId), "Subdevice ID", 0},
+ {ACPI_DMT_UINT16, ACPI_CSRT0_OFFSET (Revision), "Revision", 0},
+ {ACPI_DMT_UINT16, ACPI_CSRT0_OFFSET (Reserved), "Reserved", 0},
+ {ACPI_DMT_UINT32, ACPI_CSRT0_OFFSET (InfoLength), "InfoLength", 0},
+ ACPI_DMT_TERMINATOR
+};
+
+/* Resource Descriptor subtable */
+
+ACPI_DMTABLE_INFO AcpiDmTableInfoCsrt1[] =
+{
+ {ACPI_DMT_UINT32, ACPI_CSRT1_OFFSET (Length), "Length", 0},
+ {ACPI_DMT_UINT16, ACPI_CSRT1_OFFSET (Type), "Type", 0},
+ {ACPI_DMT_UINT16, ACPI_CSRT1_OFFSET (Subtype), "Subtype", 0},
+ {ACPI_DMT_UINT32, ACPI_CSRT1_OFFSET (Uid), "UID", 0},
+ ACPI_DMT_TERMINATOR
+};
+
+
+/*******************************************************************************
+ *
+ * DBG2 - Debug Port Table 2
+ *
+ ******************************************************************************/
+
+ACPI_DMTABLE_INFO AcpiDmTableInfoDbg2[] =
+{
+ {ACPI_DMT_UINT32, ACPI_DBG2_OFFSET (InfoOffset), "Info Offset", 0},
+ {ACPI_DMT_UINT32, ACPI_DBG2_OFFSET (InfoCount), "Info Count", 0},
+ ACPI_DMT_TERMINATOR
+};
+
+/* Debug Device Information Subtable */
+
+ACPI_DMTABLE_INFO AcpiDmTableInfoDbg2Device[] =
+{
+ {ACPI_DMT_UINT8, ACPI_DBG20_OFFSET (Revision), "Revision", 0},
+ {ACPI_DMT_UINT16, ACPI_DBG20_OFFSET (Length), "Length", 0},
+ {ACPI_DMT_UINT8, ACPI_DBG20_OFFSET (RegisterCount), "Register Count", 0},
+ {ACPI_DMT_UINT16, ACPI_DBG20_OFFSET (NamepathLength), "Namepath Length", 0},
+ {ACPI_DMT_UINT16, ACPI_DBG20_OFFSET (NamepathOffset), "Namepath Offset", 0},
+ {ACPI_DMT_UINT16, ACPI_DBG20_OFFSET (OemDataLength), "OEM Data Length", 0},
+ {ACPI_DMT_UINT16, ACPI_DBG20_OFFSET (OemDataOffset), "OEM Data Offset", 0},
+ {ACPI_DMT_UINT16, ACPI_DBG20_OFFSET (PortType), "Port Type", 0},
+ {ACPI_DMT_UINT16, ACPI_DBG20_OFFSET (PortSubtype), "Port Subtype", 0},
+ {ACPI_DMT_UINT16, ACPI_DBG20_OFFSET (Reserved), "Reserved", 0},
+ {ACPI_DMT_UINT16, ACPI_DBG20_OFFSET (BaseAddressOffset), "Base Address Offset", 0},
+ {ACPI_DMT_UINT16, ACPI_DBG20_OFFSET (AddressSizeOffset), "Address Size Offset", 0},
+ ACPI_DMT_TERMINATOR
+};
+
+/* Variable-length data for the subtable */
+
+ACPI_DMTABLE_INFO AcpiDmTableInfoDbg2Addr[] =
+{
+ {ACPI_DMT_GAS, 0, "Base Address Register", 0},
+ ACPI_DMT_TERMINATOR
+};
+
+ACPI_DMTABLE_INFO AcpiDmTableInfoDbg2Size[] =
+{
+ {ACPI_DMT_UINT32, 0, "Address Size", 0},
+ ACPI_DMT_TERMINATOR
+};
+
+ACPI_DMTABLE_INFO AcpiDmTableInfoDbg2Name[] =
+{
+ {ACPI_DMT_STRING, 0, "Namepath", 0},
+ ACPI_DMT_TERMINATOR
+};
+
+
+/*******************************************************************************
+ *
* DBGP - Debug Port
*
******************************************************************************/
diff --git a/source/compiler/Makefile b/source/compiler/Makefile
deleted file mode 100644
index 86e07536d42f..000000000000
--- a/source/compiler/Makefile
+++ /dev/null
@@ -1,360 +0,0 @@
-#
-# iASL compiler/disassembler
-#
-# NOTE: This makefile is intended to be used within the native
-# ACPICA source tree.
-#
-
-#
-# Configuration
-# Notes:
-# gcc should be version 4 or greater, otherwise some of the options
-# used will not be recognized.
-# Global optimization flags (such as -O2, -Os) are not used, since
-# they cause issues on some compilers.
-# The _GNU_SOURCE symbol is required for many hosts.
-#
-PROG = iasl
-
-HOST = _LINUX
-NOMAN = YES
-COMPILE = $(CC) -c $(CFLAGS) $(CWARNINGFLAGS) -o$@ $<
-
-ACPICA_SRC = ../../source
-ACPICA_COMMON = $(ACPICA_SRC)/common
-ACPICA_TOOLS = $(ACPICA_SRC)/tools
-ACPICA_OSL = $(ACPICA_SRC)/os_specific/service_layers
-ACPICA_CORE = $(ACPICA_SRC)/components
-ACPICA_INCLUDE = $(ACPICA_SRC)/include
-ACPICA_DEBUGGER = $(ACPICA_CORE)/debugger
-ACPICA_DISASSEMBLER = $(ACPICA_CORE)/disassembler
-ACPICA_DISPATCHER = $(ACPICA_CORE)/dispatcher
-ACPICA_EVENTS = $(ACPICA_CORE)/events
-ACPICA_EXECUTER = $(ACPICA_CORE)/executer
-ACPICA_HARDWARE = $(ACPICA_CORE)/hardware
-ACPICA_NAMESPACE = $(ACPICA_CORE)/namespace
-ACPICA_PARSER = $(ACPICA_CORE)/parser
-ACPICA_RESOURCES = $(ACPICA_CORE)/resources
-ACPICA_TABLES = $(ACPICA_CORE)/tables
-ACPICA_UTILITIES = $(ACPICA_CORE)/utilities
-ASL_COMPILER = $(ACPICA_SRC)/compiler
-INSTALLDIR = /usr/bin
-INSTALLPROG = cp --remove-destination $(PROG) $(INSTALLDIR)
-
-ACPICA_HEADERS = \
- $(wildcard $(ACPICA_INCLUDE)/*.h) \
- $(wildcard $(ACPICA_INCLUDE)/platform/*.h)
-
-#
-# Search paths for source files
-#
-vpath %.c \
- $(ASL_COMPILER) \
- $(ACPICA_DEBUGGER) \
- $(ACPICA_DISASSEMBLER) \
- $(ACPICA_DISPATCHER) \
- $(ACPICA_EXECUTER) \
- $(ACPICA_NAMESPACE) \
- $(ACPICA_PARSER) \
- $(ACPICA_TABLES) \
- $(ACPICA_UTILITIES) \
- $(ACPICA_COMMON) \
- $(ACPICA_OSL)
-
-HEADERS = \
- $(wildcard $(ASL_COMPILER)/*.h) \
- aslcompiler.y.h \
- dtparser.y.h \
- prparser.y.h
-
-OBJECTS = \
- aslcompilerlex.o \
- aslcompilerparse.o \
- dtparserlex.o \
- dtparserparse.o \
- prparserlex.o \
- prparserparse.o \
- adfile.o \
- adisasm.o \
- adwalk.o \
- ahpredef.o \
- aslanalyze.o \
- aslbtypes.o \
- aslcodegen.o \
- aslcompile.o \
- aslerror.o \
- aslfiles.o \
- aslfold.o \
- asllength.o \
- asllisting.o \
- aslload.o \
- asllookup.o \
- aslmain.o \
- aslmap.o \
- aslopcodes.o \
- asloperands.o \
- aslopt.o \
- aslpredef.o \
- aslresource.o \
- aslrestype1.o \
- aslrestype1i.o \
- aslrestype2.o \
- aslrestype2d.o \
- aslrestype2e.o \
- aslrestype2s.o \
- aslrestype2q.o \
- aslrestype2w.o \
- aslstartup.o \
- aslstubs.o \
- asltransform.o \
- asltree.o \
- aslutils.o \
- asluuid.o \
- aslwalks.o \
- dtcompile.o \
- dtexpress.o \
- dtfield.o \
- dtio.o \
- dtsubtable.o \
- dttable.o \
- dttemplate.o \
- dtutils.o \
- dbfileio.o \
- dmbuffer.o \
- dmextern.o \
- dmnames.o \
- dmobject.o \
- dmopcode.o \
- dmresrc.o \
- dmresrcl.o \
- dmresrcl2.o \
- dmresrcs.o \
- dmrestag.o \
- dmtable.o \
- dmtbdump.o \
- dmtbinfo.o \
- dmutils.o \
- dmwalk.o \
- dsargs.o \
- dscontrol.o \
- dsfield.o \
- dsobject.o \
- dsopcode.o \
- dsutils.o \
- dswexec.o \
- dswload.o \
- dswload2.o \
- dswscope.o \
- dswstate.o \
- exconvrt.o \
- excreate.o \
- exdump.o \
- exmisc.o \
- exmutex.o \
- exnames.o \
- exoparg1.o \
- exoparg2.o \
- exoparg3.o \
- exoparg6.o \
- exprep.o \
- exregion.o \
- exresnte.o \
- exresolv.o \
- exresop.o \
- exstore.o \
- exstoren.o \
- exstorob.o \
- exsystem.o \
- exutils.o \
- getopt.o \
- nsaccess.o \
- nsalloc.o \
- nsdump.o \
- nsnames.o \
- nsobject.o \
- nsparse.o \
- nssearch.o \
- nsutils.o \
- nswalk.o \
- nsxfobj.o \
- osunixxf.o \
- prexpress.o \
- prmacros.o \
- prscan.o \
- prutils.o \
- psargs.o \
- psloop.o \
- psopcode.o \
- psparse.o \
- psscope.o \
- pstree.o \
- psutils.o \
- pswalk.o \
- tbfadt.o \
- tbinstal.o \
- tbutils.o \
- tbxface.o \
- utaddress.o \
- utalloc.o \
- utcache.o \
- utcopy.o \
- utdebug.o \
- utdecode.o \
- utdelete.o \
- utexcep.o \
- utglobal.o \
- utinit.o \
- utlock.o \
- utmath.o \
- utmisc.o \
- utmutex.o \
- utobject.o \
- utresrc.o \
- utstate.o \
- utxferror.o \
- utxface.o
-
-INTERMEDIATES = \
- aslcompilerlex.c \
- aslcompilerparse.c \
- dtparserlex.c \
- dtparserparse.c \
- prparserlex.c \
- prparserparse.c
-
-MISC = \
- aslcompilerparse.h \
- aslcompiler.y.h \
- aslcompilerparse.output \
- dtparserparse.h \
- dtparser.y.h \
- dtparserparse.output \
- prparserparse.h \
- prparser.y.h \
- prparserparse.output
-
-CFLAGS+= \
- -D$(HOST) \
- -D_GNU_SOURCE \
- -DACPI_ASL_COMPILER \
- -I$(ACPICA_INCLUDE) \
- -I$(ASL_COMPILER)
-
-CWARNINGFLAGS = \
- -ansi \
- -Wall \
- -Wbad-function-cast \
- -Wdeclaration-after-statement \
- -Werror \
- -Wformat=2 \
- -Wmissing-declarations \
- -Wmissing-prototypes \
- -Wstrict-aliasing=0 \
- -Wstrict-prototypes \
- -Wswitch-default \
- -Wpointer-arith \
- -Wundef
-
-#
-# gcc 4+ flags
-#
-CWARNINGFLAGS += \
- -Waddress \
- -Waggregate-return \
- -Wchar-subscripts \
- -Wempty-body \
- -Wlogical-op \
- -Wmissing-declarations \
- -Wmissing-field-initializers \
- -Wmissing-parameter-type \
- -Wnested-externs \
- -Wold-style-declaration \
- -Wold-style-definition \
- -Wredundant-decls \
- -Wtype-limits
-
-#
-# Bison/Flex configuration
-#
-YACC= bison
-YFLAGS+= -v -d -y
-
-LEX= flex
-LFLAGS+= -i -s
-
-#
-# Root rule
-#
-$(PROG) : $(INTERMEDIATES) $(MISC) $(OBJECTS)
- $(CC) $(OBJECTS) $(LDFLAGS) -o $(PROG)
-
-#
-# Parser and Lexer - intermediate C files
-#
-aslcompilerlex.c : $(ASL_COMPILER)/aslcompiler.l $(ASL_COMPILER)/aslsupport.l
- ${LEX} ${LFLAGS} -PAslCompiler -o$@ $(ASL_COMPILER)/aslcompiler.l
-
-aslcompilerparse.c aslcompilerparse.h : $(ASL_COMPILER)/aslcompiler.y
- ${YACC} ${YFLAGS} -pAslCompiler -o$@ $?
-
-dtparserlex.c : $(ASL_COMPILER)/dtparser.l
- ${LEX} ${LFLAGS} -PDtParser -o$@ $?
-
-dtparserparse.c dtparserparse.h : $(ASL_COMPILER)/dtparser.y
- ${YACC} ${YFLAGS} -pDtParser -o$@ $?
-
-prparserlex.c : $(ASL_COMPILER)/prparser.l
- ${LEX} ${LFLAGS} -PPrParser -o$@ $?
-
-prparserparse.c prparserparse.h : $(ASL_COMPILER)/prparser.y
- ${YACC} ${YFLAGS} -pPrParser -o$@ $?
-
-
-# Rename headers produced by bison/yacc
-
-aslcompiler.y.h : aslcompilerparse.h
- @echo Copy intermediate file:
- @cp -f -v aslcompilerparse.h aslcompiler.y.h
-
-dtparser.y.h: dtparserparse.h
- @echo Copy intermediate file:
- @cp -f -v dtparserparse.h dtparser.y.h
-
-prparser.y.h: prparserparse.h
- @echo Copy intermediate file:
- @cp -f -v prparserparse.h prparser.y.h
-
-
-#
-# Parsers and Lexers - final object files
-#
-# Cannot use the common compile warning flags since the C files are created
-# by the utilities above and they are not necessarily ANSI C, etc.
-#
-aslcompilerlex.o : aslcompilerlex.c
- $(CC) -c $(CFLAGS) -Wall -Werror -Wstrict-aliasing=0 -o$@ $?
-
-aslcompilerparse.o : aslcompilerparse.c
- $(CC) -c $(CFLAGS) -Wall -Werror -Wstrict-aliasing=0 -o$@ $?
-
-dtparserlex.o : dtparserlex.c
- $(CC) -c $(CFLAGS) -Wall -Werror -Wstrict-aliasing=0 -o$@ $?
-
-dtparserparse.o : dtparserparse.c
- $(CC) -c $(CFLAGS) -Wall -Werror -Wstrict-aliasing=0 -o$@ $?
-
-prparserlex.o : prparserlex.c
- $(CC) -c $(CFLAGS) -Wall -Werror -Wstrict-aliasing=0 -o$@ $?
-
-prparserparse.o : prparserparse.c
- $(CC) -c $(CFLAGS) -Wall -Werror -Wstrict-aliasing=0 -o$@ $?
-
-
-%.o : %.c $(HEADERS) $(ACPICA_HEADERS)
- $(COMPILE)
-
-clean :
- rm -f $(PROG) $(PROG).exe $(OBJECTS) $(INTERMEDIATES) $(MISC)
-
-install :
- $(INSTALLPROG)
diff --git a/source/compiler/aslcompiler.h b/source/compiler/aslcompiler.h
index 937530dfeb89..09b3f6c2f66c 100644
--- a/source/compiler/aslcompiler.h
+++ b/source/compiler/aslcompiler.h
@@ -594,6 +594,11 @@ TrSetNodeFlags (
UINT32 Flags);
ACPI_PARSE_OBJECT *
+TrSetNodeAmlLength (
+ ACPI_PARSE_OBJECT *Op,
+ UINT32 Length);
+
+ACPI_PARSE_OBJECT *
TrLinkPeerNodes (
UINT32 NumPeers,
...);
diff --git a/source/compiler/aslcompiler.y b/source/compiler/aslcompiler.y
index 7df36a841e95..92ae9409cfff 100644
--- a/source/compiler/aslcompiler.y
+++ b/source/compiler/aslcompiler.y
@@ -560,7 +560,7 @@ void * AslLocalAllocate (unsigned int Size);
%type <n> SwitchTerm
%type <n> UnloadTerm
%type <n> WhileTerm
-//%type <n> CaseTermList
+/* %type <n> CaseTermList */
/* Type 2 opcodes */
@@ -2507,30 +2507,38 @@ ConstExprTerm
| PARSEOP___PATH__ {$$ = TrCreateConstantLeafNode (PARSEOP___PATH__);}
;
+/*
+ * The NODE_COMPILE_TIME_CONST flag in the following constant expressions
+ * enables compile-time constant folding to reduce the Type3Opcodes/Type2IntegerOpcodes
+ * to simple integers. It is an error if these types of expressions cannot be
+ * reduced, since the AML grammar for ****ConstExpr requires a simple constant.
+ * Note: The required byte length of the constant is passed through to the
+ * constant folding code in the node AmlLength field.
+ */
ByteConstExpr
- : Type3Opcode {$$ = TrUpdateNode (PARSEOP_BYTECONST, $1);}
- | Type2IntegerOpcode {$$ = TrUpdateNode (PARSEOP_BYTECONST, $1);}
+ : Type3Opcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST); TrSetNodeAmlLength ($1, 1);}
+ | Type2IntegerOpcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST); TrSetNodeAmlLength ($1, 1);}
| ConstExprTerm {$$ = TrUpdateNode (PARSEOP_BYTECONST, $1);}
| ByteConst {}
;
WordConstExpr
- : Type3Opcode {$$ = TrUpdateNode (PARSEOP_WORDCONST, $1);}
- | Type2IntegerOpcode {$$ = TrUpdateNode (PARSEOP_WORDCONST, $1);}
+ : Type3Opcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST); TrSetNodeAmlLength ($1, 2);}
+ | Type2IntegerOpcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST); TrSetNodeAmlLength ($1, 2);}
| ConstExprTerm {$$ = TrUpdateNode (PARSEOP_WORDCONST, $1);}
| WordConst {}
;
DWordConstExpr
- : Type3Opcode {$$ = TrUpdateNode (PARSEOP_DWORDCONST, $1);}
- | Type2IntegerOpcode {$$ = TrUpdateNode (PARSEOP_DWORDCONST, $1);}
+ : Type3Opcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST); TrSetNodeAmlLength ($1, 4);}
+ | Type2IntegerOpcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST); TrSetNodeAmlLength ($1, 4);}
| ConstExprTerm {$$ = TrUpdateNode (PARSEOP_DWORDCONST, $1);}
| DWordConst {}
;
QWordConstExpr
- : Type3Opcode {$$ = TrUpdateNode (PARSEOP_QWORDCONST, $1);}
- | Type2IntegerOpcode {$$ = TrUpdateNode (PARSEOP_QWORDCONST, $1);}
+ : Type3Opcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST); TrSetNodeAmlLength ($1, 8);}
+ | Type2IntegerOpcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST); TrSetNodeAmlLength ($1, 8);}
| ConstExprTerm {$$ = TrUpdateNode (PARSEOP_QWORDCONST, $1);}
| QWordConst {}
;
@@ -2839,10 +2847,10 @@ ExtendedSpaceTerm
FixedDmaTerm
: PARSEOP_FIXEDDMA '(' {$<n>$ = TrCreateLeafNode (PARSEOP_FIXEDDMA);}
- WordConstExpr // 04: DMA RequestLines
- ',' WordConstExpr // 06: DMA Channels
- OptionalXferSize // 07: DMA TransferSize
- OptionalNameString // 08: DescriptorName
+ WordConstExpr /* 04: DMA RequestLines */
+ ',' WordConstExpr /* 06: DMA Channels */
+ OptionalXferSize /* 07: DMA TransferSize */
+ OptionalNameString /* 08: DescriptorName */
')' {$$ = TrLinkChildren ($<n>3,4,$4,$6,$7,$8);}
| PARSEOP_FIXEDDMA '('
error ')' {$$ = AslDoError(); yyclearin;}
@@ -2860,16 +2868,16 @@ FixedIOTerm
GpioIntTerm
: PARSEOP_GPIO_INT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_GPIO_INT);}
- InterruptTypeKeyword // 04: InterruptType
- ',' InterruptLevel // 06: InterruptLevel
- OptionalShareType // 07: SharedType
- ',' PinConfigByte // 09: PinConfig
- OptionalWordConstExpr // 10: DebounceTimeout
- ',' StringData // 12: ResourceSource
- OptionalByteConstExpr // 13: ResourceSourceIndex
- OptionalResourceType // 14: ResourceType
- OptionalNameString // 15: DescriptorName
- OptionalBuffer_Last // 16: VendorData
+ InterruptTypeKeyword /* 04: InterruptType */
+ ',' InterruptLevel /* 06: InterruptLevel */
+ OptionalShareType /* 07: SharedType */
+ ',' PinConfigByte /* 09: PinConfig */
+ OptionalWordConstExpr /* 10: DebounceTimeout */
+ ',' StringData /* 12: ResourceSource */
+ OptionalByteConstExpr /* 13: ResourceSourceIndex */
+ OptionalResourceType /* 14: ResourceType */
+ OptionalNameString /* 15: DescriptorName */
+ OptionalBuffer_Last /* 16: VendorData */
')' '{'
DWordConstExpr '}' {$$ = TrLinkChildren ($<n>3,11,$4,$6,$7,$9,$10,$12,$13,$14,$15,$16,$19);}
| PARSEOP_GPIO_INT '('
@@ -2878,16 +2886,16 @@ GpioIntTerm
GpioIoTerm
: PARSEOP_GPIO_IO '(' {$<n>$ = TrCreateLeafNode (PARSEOP_GPIO_IO);}
- OptionalShareType_First // 04: SharedType
- ',' PinConfigByte // 06: PinConfig
- OptionalWordConstExpr // 07: DebounceTimeout
- OptionalWordConstExpr // 08: DriveStrength
- OptionalIoRestriction // 09: IoRestriction
- ',' StringData // 11: ResourceSource
- OptionalByteConstExpr // 12: ResourceSourceIndex
- OptionalResourceType // 13: ResourceType
- OptionalNameString // 14: DescriptorName
- OptionalBuffer_Last // 15: VendorData
+ OptionalShareType_First /* 04: SharedType */
+ ',' PinConfigByte /* 06: PinConfig */
+ OptionalWordConstExpr /* 07: DebounceTimeout */
+ OptionalWordConstExpr /* 08: DriveStrength */
+ OptionalIoRestriction /* 09: IoRestriction */
+ ',' StringData /* 11: ResourceSource */
+ OptionalByteConstExpr /* 12: ResourceSourceIndex */
+ OptionalResourceType /* 13: ResourceType */
+ OptionalNameString /* 14: DescriptorName */
+ OptionalBuffer_Last /* 15: VendorData */
')' '{'
DWordList '}' {$$ = TrLinkChildren ($<n>3,11,$4,$6,$7,$8,$9,$11,$12,$13,$14,$15,$18);}
| PARSEOP_GPIO_IO '('
@@ -2896,15 +2904,15 @@ GpioIoTerm
I2cSerialBusTerm
: PARSEOP_I2C_SERIALBUS '(' {$<n>$ = TrCreateLeafNode (PARSEOP_I2C_SERIALBUS);}
- WordConstExpr // 04: SlaveAddress
- OptionalSlaveMode // 05: SlaveMode
- ',' DWordConstExpr // 07: ConnectionSpeed
- OptionalAddressingMode // 08: AddressingMode
- ',' StringData // 10: ResourceSource
- OptionalByteConstExpr // 11: ResourceSourceIndex
- OptionalResourceType // 12: ResourceType
- OptionalNameString // 13: DescriptorName
- OptionalBuffer_Last // 14: VendorData
+ WordConstExpr /* 04: SlaveAddress */
+ OptionalSlaveMode /* 05: SlaveMode */
+ ',' DWordConstExpr /* 07: ConnectionSpeed */
+ OptionalAddressingMode /* 08: AddressingMode */
+ ',' StringData /* 10: ResourceSource */
+ OptionalByteConstExpr /* 11: ResourceSourceIndex */
+ OptionalResourceType /* 12: ResourceType */
+ OptionalNameString /* 13: DescriptorName */
+ OptionalBuffer_Last /* 14: VendorData */
')' {$$ = TrLinkChildren ($<n>3,9,$4,$5,$7,$8,$10,$11,$12,$13,$14);}
| PARSEOP_I2C_SERIALBUS '('
error ')' {$$ = AslDoError(); yyclearin;}
@@ -3077,19 +3085,19 @@ RegisterTerm
SpiSerialBusTerm
: PARSEOP_SPI_SERIALBUS '(' {$<n>$ = TrCreateLeafNode (PARSEOP_SPI_SERIALBUS);}
- WordConstExpr // 04: DeviceSelection
- OptionalDevicePolarity // 05: DevicePolarity
- OptionalWireMode // 06: WireMode
- ',' ByteConstExpr // 08: DataBitLength
- OptionalSlaveMode // 09: SlaveMode
- ',' DWordConstExpr // 11: ConnectionSpeed
- ',' ClockPolarityKeyword // 13: ClockPolarity
- ',' ClockPhaseKeyword // 15: ClockPhase
- ',' StringData // 17: ResourceSource
- OptionalByteConstExpr // 18: ResourceSourceIndex
- OptionalResourceType // 19: ResourceType
- OptionalNameString // 20: DescriptorName
- OptionalBuffer_Last // 21: VendorData
+ WordConstExpr /* 04: DeviceSelection */
+ OptionalDevicePolarity /* 05: DevicePolarity */
+ OptionalWireMode /* 06: WireMode */
+ ',' ByteConstExpr /* 08: DataBitLength */
+ OptionalSlaveMode /* 09: SlaveMode */
+ ',' DWordConstExpr /* 11: ConnectionSpeed */
+ ',' ClockPolarityKeyword /* 13: ClockPolarity */
+ ',' ClockPhaseKeyword /* 15: ClockPhase */
+ ',' StringData /* 17: ResourceSource */
+ OptionalByteConstExpr /* 18: ResourceSourceIndex */
+ OptionalResourceType /* 19: ResourceType */
+ OptionalNameString /* 20: DescriptorName */
+ OptionalBuffer_Last /* 21: VendorData */
')' {$$ = TrLinkChildren ($<n>3,13,$4,$5,$6,$8,$9,$11,$13,$15,$17,$18,$19,$20,$21);}
| PARSEOP_SPI_SERIALBUS '('
error ')' {$$ = AslDoError(); yyclearin;}
@@ -3115,20 +3123,20 @@ StartDependentFnTerm
UartSerialBusTerm
: PARSEOP_UART_SERIALBUS '(' {$<n>$ = TrCreateLeafNode (PARSEOP_UART_SERIALBUS);}
- DWordConstExpr // 04: ConnectionSpeed
- OptionalBitsPerByte // 05: BitsPerByte
- OptionalStopBits // 06: StopBits
- ',' ByteConstExpr // 08: LinesInUse
- OptionalEndian // 09: Endianess
- OptionalParityType // 10: Parity
- OptionalFlowControl // 11: FlowControl
- ',' WordConstExpr // 13: Rx BufferSize
- ',' WordConstExpr // 15: Tx BufferSize
- ',' StringData // 17: ResourceSource
- OptionalByteConstExpr // 18: ResourceSourceIndex
- OptionalResourceType // 19: ResourceType
- OptionalNameString // 20: DescriptorName
- OptionalBuffer_Last // 21: VendorData
+ DWordConstExpr /* 04: ConnectionSpeed */
+ OptionalBitsPerByte /* 05: BitsPerByte */
+ OptionalStopBits /* 06: StopBits */
+ ',' ByteConstExpr /* 08: LinesInUse */
+ OptionalEndian /* 09: Endianess */
+ OptionalParityType /* 10: Parity */
+ OptionalFlowControl /* 11: FlowControl */
+ ',' WordConstExpr /* 13: Rx BufferSize */
+ ',' WordConstExpr /* 15: Tx BufferSize */
+ ',' StringData /* 17: ResourceSource */
+ OptionalByteConstExpr /* 18: ResourceSourceIndex */
+ OptionalResourceType /* 19: ResourceType */
+ OptionalNameString /* 20: DescriptorName */
+ OptionalBuffer_Last /* 21: VendorData */
')' {$$ = TrLinkChildren ($<n>3,14,$4,$5,$6,$8,$9,$10,$11,$13,$15,$17,$18,$19,$20,$21);}
| PARSEOP_UART_SERIALBUS '('
error ')' {$$ = AslDoError(); yyclearin;}
diff --git a/source/compiler/aslfold.c b/source/compiler/aslfold.c
index c1fd2717bbd9..6c8cb37b8ec9 100644
--- a/source/compiler/aslfold.c
+++ b/source/compiler/aslfold.c
@@ -73,6 +73,11 @@ OpcAmlCheckForConstant (
UINT32 Level,
void *Context);
+static void
+OpcUpdateIntegerNode (
+ ACPI_PARSE_OBJECT *Op,
+ UINT64 Value);
+
/*******************************************************************************
*
@@ -214,14 +219,14 @@ OpcAmlCheckForConstant (
{
/*
* We are looking at at normal expression to see if it can be
- * reduced. It can't. No error
+ * reduced. It can't. No error
*/
return (AE_TYPE);
}
/*
* This is an expression that MUST reduce to a constant, and it
- * can't be reduced. This is an error
+ * can't be reduced. This is an error
*/
if (Op->Asl.CompileFlags & NODE_IS_TARGET)
{
@@ -319,17 +324,17 @@ OpcAmlConstantWalk (
return AE_NO_MEMORY;
}
- WalkState->NextOp = NULL;
- WalkState->Params = NULL;
- WalkState->CallerReturnDesc = &ObjDesc;
- WalkState->WalkType = WalkType;
+ WalkState->NextOp = NULL;
+ WalkState->Params = NULL;
+ WalkState->WalkType = WalkType;
+ WalkState->CallerReturnDesc = &ObjDesc;
/*
* Examine the entire subtree -- all nodes must be constants
* or type 3/4/5 opcodes
*/
Status = TrWalkParseTree (Op, ASL_WALK_VISIT_DOWNWARD,
- OpcAmlCheckForConstant, NULL, WalkState);
+ OpcAmlCheckForConstant, NULL, WalkState);
/*
* Did we find an entire subtree that contains all constants and type 3/4/5
@@ -369,7 +374,7 @@ OpcAmlConstantWalk (
/* Hand off the subtree to the AML interpreter */
Status = TrWalkParseTree (Op, ASL_WALK_VISIT_TWICE,
- OpcAmlEvaluationWalk1, OpcAmlEvaluationWalk2, WalkState);
+ OpcAmlEvaluationWalk1, OpcAmlEvaluationWalk2, WalkState);
Op->Common.Parent = OriginalParentOp;
/* TBD: we really *should* release the RootOp node */
@@ -382,22 +387,26 @@ OpcAmlConstantWalk (
Status = AcpiDsResultPop (&ObjDesc, WalkState);
}
+
+ /* Check for error from the ACPICA core */
+
+ if (ACPI_FAILURE (Status))
+ {
+ AslCoreSubsystemError (Op, Status,
+ "Failure during constant evaluation", FALSE);
+ }
}
if (ACPI_FAILURE (Status))
{
/* We could not resolve the subtree for some reason */
- AslCoreSubsystemError (Op, Status,
- "Failure during constant evaluation", FALSE);
AslError (ASL_ERROR, ASL_MSG_CONSTANT_EVALUATION, Op,
Op->Asl.ParseOpName);
- /* Set the subtree value to ZERO anyway. Eliminates further errors */
+ /* Set the subtree value to ZERO anyway. Eliminates further errors */
- Op->Asl.ParseOpcode = PARSEOP_INTEGER;
- Op->Common.Value.Integer = 0;
- OpcSetOptimalIntegerSize (Op);
+ OpcUpdateIntegerNode (Op, 0);
}
else
{
@@ -412,21 +421,20 @@ OpcAmlConstantWalk (
{
case ACPI_TYPE_INTEGER:
- Op->Asl.ParseOpcode = PARSEOP_INTEGER;
- Op->Common.Value.Integer = ObjDesc->Integer.Value;
- OpcSetOptimalIntegerSize (Op);
+ OpcUpdateIntegerNode (Op, ObjDesc->Integer.Value);
DbgPrint (ASL_PARSE_OUTPUT,
- "Constant expression reduced to (INTEGER) %8.8X%8.8X\n",
- ACPI_FORMAT_UINT64 (ObjDesc->Integer.Value));
+ "Constant expression reduced to (%s) %8.8X%8.8X\n",
+ Op->Asl.ParseOpName,
+ ACPI_FORMAT_UINT64 (Op->Common.Value.Integer));
break;
case ACPI_TYPE_STRING:
- Op->Asl.ParseOpcode = PARSEOP_STRING_LITERAL;
- Op->Common.AmlOpcode = AML_STRING_OP;
- Op->Asl.AmlLength = ACPI_STRLEN (ObjDesc->String.Pointer) + 1;
+ Op->Asl.ParseOpcode = PARSEOP_STRING_LITERAL;
+ Op->Common.AmlOpcode = AML_STRING_OP;
+ Op->Asl.AmlLength = ACPI_STRLEN (ObjDesc->String.Pointer) + 1;
Op->Common.Value.String = ObjDesc->String.Pointer;
DbgPrint (ASL_PARSE_OUTPUT,
@@ -438,18 +446,18 @@ OpcAmlConstantWalk (
case ACPI_TYPE_BUFFER:
- Op->Asl.ParseOpcode = PARSEOP_BUFFER;
- Op->Common.AmlOpcode = AML_BUFFER_OP;
- Op->Asl.CompileFlags = NODE_AML_PACKAGE;
+ Op->Asl.ParseOpcode = PARSEOP_BUFFER;
+ Op->Common.AmlOpcode = AML_BUFFER_OP;
+ Op->Asl.CompileFlags = NODE_AML_PACKAGE;
UtSetParseOpName (Op);
/* Child node is the buffer length */
RootOp = TrAllocateNode (PARSEOP_INTEGER);
- RootOp->Asl.AmlOpcode = AML_DWORD_OP;
+ RootOp->Asl.AmlOpcode = AML_DWORD_OP;
RootOp->Asl.Value.Integer = ObjDesc->Buffer.Length;
- RootOp->Asl.Parent = Op;
+ RootOp->Asl.Parent = Op;
(void) OpcSetOptimalIntegerSize (RootOp);
@@ -460,10 +468,10 @@ OpcAmlConstantWalk (
/* Peer to the child is the raw buffer data */
RootOp = TrAllocateNode (PARSEOP_RAW_DATA);
- RootOp->Asl.AmlOpcode = AML_RAW_DATA_BUFFER;
- RootOp->Asl.AmlLength = ObjDesc->Buffer.Length;
- RootOp->Asl.Value.String = (char *) ObjDesc->Buffer.Pointer;
- RootOp->Asl.Parent = Op->Asl.Parent;
+ RootOp->Asl.AmlOpcode = AML_RAW_DATA_BUFFER;
+ RootOp->Asl.AmlLength = ObjDesc->Buffer.Length;
+ RootOp->Asl.Value.String = (char *) ObjDesc->Buffer.Pointer;
+ RootOp->Asl.Parent = Op->Asl.Parent;
Op->Asl.Next = RootOp;
Op = RootOp;
@@ -476,7 +484,7 @@ OpcAmlConstantWalk (
default:
printf ("Unsupported return type: %s\n",
- AcpiUtGetObjectTypeName (ObjDesc));
+ AcpiUtGetObjectTypeName (ObjDesc));
break;
}
}
@@ -485,7 +493,62 @@ OpcAmlConstantWalk (
Op->Asl.Child = NULL;
AcpiDsDeleteWalkState (WalkState);
-
return (AE_CTRL_DEPTH);
}
+
+/*******************************************************************************
+ *
+ * FUNCTION: OpcUpdateIntegerNode
+ *
+ * PARAMETERS: Op - Current parse object
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Update node to the correct integer type.
+ *
+ ******************************************************************************/
+
+static void
+OpcUpdateIntegerNode (
+ ACPI_PARSE_OBJECT *Op,
+ UINT64 Value)
+{
+
+ Op->Common.Value.Integer = Value;
+
+ /*
+ * The AmlLength is used by the parser to indicate a constant,
+ * (if non-zero). Length is either (1/2/4/8)
+ */
+ switch (Op->Asl.AmlLength)
+ {
+ case 1:
+ TrUpdateNode (PARSEOP_BYTECONST, Op);
+ Op->Asl.AmlOpcode = AML_RAW_DATA_BYTE;
+ break;
+
+ case 2:
+ TrUpdateNode (PARSEOP_WORDCONST, Op);
+ Op->Asl.AmlOpcode = AML_RAW_DATA_WORD;
+ break;
+
+ case 4:
+ TrUpdateNode (PARSEOP_DWORDCONST, Op);
+ Op->Asl.AmlOpcode = AML_RAW_DATA_DWORD;
+ break;
+
+ case 8:
+ TrUpdateNode (PARSEOP_QWORDCONST, Op);
+ Op->Asl.AmlOpcode = AML_RAW_DATA_QWORD;
+ break;
+
+ case 0:
+ default:
+ OpcSetOptimalIntegerSize (Op);
+ TrUpdateNode (PARSEOP_INTEGER, Op);
+ break;
+ }
+
+ Op->Asl.AmlLength = 0;
+}
diff --git a/source/compiler/aslmessages.h b/source/compiler/aslmessages.h
index 595e5f4c96db..4c4e79aa07ef 100644
--- a/source/compiler/aslmessages.h
+++ b/source/compiler/aslmessages.h
@@ -197,6 +197,7 @@ typedef enum
ASL_MSG_UPPER_CASE,
ASL_MSG_VENDOR_LIST,
ASL_MSG_WRITE,
+ ASL_MSG_RANGE,
/* These messages are used by the Preprocessor only */
@@ -371,6 +372,7 @@ char *AslMessages [] = {
/* ASL_MSG_UPPER_CASE */ "Non-hex letters must be upper case",
/* ASL_MSG_VENDOR_LIST */ "Too many vendor data bytes (7 max)",
/* ASL_MSG_WRITE */ "Could not write file",
+/* ASL_MSG_RANGE */ "Constant out of range",
/* Preprocessor */
diff --git a/source/compiler/asltree.c b/source/compiler/asltree.c
index dc6cb44b374a..12223b64498b 100644
--- a/source/compiler/asltree.c
+++ b/source/compiler/asltree.c
@@ -68,9 +68,9 @@ TrGetNodeFlagName (
*
* PARAMETERS: None
*
- * RETURN: New parse node. Aborts on allocation failure
+ * RETURN: New parse node. Aborts on allocation failure
*
- * DESCRIPTION: Allocate a new parse node for the parse tree. Bypass the local
+ * DESCRIPTION: Allocate a new parse node for the parse tree. Bypass the local
* dynamic memory manager for performance reasons (This has a
* major impact on the speed of the compiler.)
*
@@ -98,7 +98,7 @@ TrGetNextNode (
*
* PARAMETERS: ParseOpcode - Opcode to be assigned to the node
*
- * RETURN: New parse node. Aborts on allocation failure
+ * RETURN: New parse node. Aborts on allocation failure
*
* DESCRIPTION: Allocate and initialize a new parse node for the parse tree
*
@@ -133,7 +133,7 @@ TrAllocateNode (
*
* RETURN: None
*
- * DESCRIPTION: "release" a node. In truth, nothing is done since the node
+ * DESCRIPTION: "release" a node. In truth, nothing is done since the node
* is part of a larger buffer
*
******************************************************************************/
@@ -156,9 +156,9 @@ TrReleaseNode (
*
* RETURN: The updated node
*
- * DESCRIPTION: Change the parse opcode assigned to a node. Usually used to
+ * DESCRIPTION: Change the parse opcode assigned to a node. Usually used to
* change an opcode to DEFAULT_ARG so that the node is ignored
- * during the code generation. Also used to set generic integers
+ * during the code generation. Also used to set generic integers
* to a specific size (8, 16, 32, or 64 bits)
*
******************************************************************************/
@@ -186,19 +186,21 @@ TrUpdateNode (
switch (ParseOpcode)
{
case PARSEOP_BYTECONST:
- Op->Asl.Value.Integer = 0xFF;
+ Op->Asl.Value.Integer = ACPI_UINT8_MAX;
break;
case PARSEOP_WORDCONST:
- Op->Asl.Value.Integer = 0xFFFF;
+ Op->Asl.Value.Integer = ACPI_UINT16_MAX;
break;
case PARSEOP_DWORDCONST:
- Op->Asl.Value.Integer = 0xFFFFFFFF;
+ Op->Asl.Value.Integer = ACPI_UINT32_MAX;
break;
+ /* Don't need to do the QWORD case */
+
default:
- /* Don't care about others, don't need to check QWORD */
+ /* Don't care about others */
break;
}
}
@@ -213,15 +215,18 @@ TrUpdateNode (
switch (ParseOpcode)
{
case PARSEOP_BYTECONST:
- Op = UtCheckIntegerRange (Op, 0x00, ACPI_UINT8_MAX);
+ UtCheckIntegerRange (Op, 0x00, ACPI_UINT8_MAX);
+ Op->Asl.Value.Integer &= ACPI_UINT8_MAX;
break;
case PARSEOP_WORDCONST:
- Op = UtCheckIntegerRange (Op, 0x00, ACPI_UINT16_MAX);
+ UtCheckIntegerRange (Op, 0x00, ACPI_UINT16_MAX);
+ Op->Asl.Value.Integer &= ACPI_UINT16_MAX;
break;
case PARSEOP_DWORDCONST:
- Op = UtCheckIntegerRange (Op, 0x00, ACPI_UINT32_MAX);
+ UtCheckIntegerRange (Op, 0x00, ACPI_UINT32_MAX);
+ Op->Asl.Value.Integer &= ACPI_UINT32_MAX;
break;
default:
@@ -315,7 +320,7 @@ TrGetNodeFlagName (
*
* RETURN: The updated parser op
*
- * DESCRIPTION: Set bits in the node flags word. Will not clear bits, only set
+ * DESCRIPTION: Set bits in the node flags word. Will not clear bits, only set
*
******************************************************************************/
@@ -335,8 +340,41 @@ TrSetNodeFlags (
}
Op->Asl.CompileFlags |= Flags;
+ return (Op);
+}
- return Op;
+
+/*******************************************************************************
+ *
+ * FUNCTION: TrSetNodeAmlLength
+ *
+ * PARAMETERS: Op - An existing parse node
+ * Length - AML Length
+ *
+ * RETURN: The updated parser op
+ *
+ * DESCRIPTION: Set the AML Length in a node. Used by the parser to indicate
+ * the presence of a node that must be reduced to a fixed length
+ * constant.
+ *
+ ******************************************************************************/
+
+ACPI_PARSE_OBJECT *
+TrSetNodeAmlLength (
+ ACPI_PARSE_OBJECT *Op,
+ UINT32 Length)
+{
+
+ DbgPrint (ASL_PARSE_OUTPUT,
+ "\nSetNodeAmlLength: Op %p, %8.8X\n", Op, Length);
+
+ if (!Op)
+ {
+ return NULL;
+ }
+
+ Op->Asl.AmlLength = Length;
+ return (Op);
}
@@ -376,7 +414,7 @@ TrSetEndLineNumber (
*
* PARAMETERS: ParseOpcode - New opcode to be assigned to the node
*
- * RETURN: Pointer to the new node. Aborts on allocation failure
+ * RETURN: Pointer to the new node. Aborts on allocation failure
*
* DESCRIPTION: Create a simple leaf node (no children or peers, and no value
* assigned to the node)
@@ -406,7 +444,7 @@ TrCreateLeafNode (
*
* PARAMETERS: ParseOpcode - The constant opcode
*
- * RETURN: Pointer to the new node. Aborts on allocation failure
+ * RETURN: Pointer to the new node. Aborts on allocation failure
*
* DESCRIPTION: Create a leaf node (no children or peers) for one of the
* special constants - __LINE__, __FILE__, and __DATE__.
@@ -488,7 +526,7 @@ TrCreateConstantLeafNode (
* PARAMETERS: ParseOpcode - New opcode to be assigned to the node
* Value - Value to be assigned to the node
*
- * RETURN: Pointer to the new node. Aborts on allocation failure
+ * RETURN: Pointer to the new node. Aborts on allocation failure
*
* DESCRIPTION: Create a leaf node (no children or peers) with a value
* assigned to it
@@ -553,9 +591,9 @@ TrCreateValuedLeafNode (
* PARAMETERS: ParseOpcode - Opcode to be assigned to the node
* NumChildren - Number of children to follow
* ... - A list of child nodes to link to the new
- * node. NumChildren long.
+ * node. NumChildren long.
*
- * RETURN: Pointer to the new node. Aborts on allocation failure
+ * RETURN: Pointer to the new node. Aborts on allocation failure
*
* DESCRIPTION: Create a new parse node and link together a list of child
* nodes underneath the new node.
@@ -621,7 +659,7 @@ TrCreateNode (
/*
* If child is NULL, this means that an optional argument
- * was omitted. We must create a placeholder with a special
+ * was omitted. We must create a placeholder with a special
* opcode (DEFAULT_ARG) so that the code generator will know
* that it must emit the correct default for this argument
*/
@@ -675,7 +713,7 @@ TrCreateNode (
* PARAMETERS: Op - An existing parse node
* NumChildren - Number of children to follow
* ... - A list of child nodes to link to the new
- * node. NumChildren long.
+ * node. NumChildren long.
*
* RETURN: The updated (linked) node
*
@@ -745,7 +783,7 @@ TrLinkChildren (
/*
* If child is NULL, this means that an optional argument
- * was omitted. We must create a placeholder with a special
+ * was omitted. We must create a placeholder with a special
* opcode (DEFAULT_ARG) so that the code generator will know
* that it must emit the correct default for this argument
*/
@@ -800,7 +838,7 @@ TrLinkChildren (
*
* RETURN: Op1 or the non-null node.
*
- * DESCRIPTION: Link two nodes as peers. Handles cases where one peer is null.
+ * DESCRIPTION: Link two nodes as peers. Handles cases where one peer is null.
*
******************************************************************************/
diff --git a/source/compiler/aslutils.c b/source/compiler/aslutils.c
index 9cc109b66ea8..771ba09e584e 100644
--- a/source/compiler/aslutils.c
+++ b/source/compiler/aslutils.c
@@ -105,34 +105,34 @@ UtAttachNameseg (
*
******************************************************************************/
+#define ACPI_TABLE_HELP_FORMAT "%8u) %s %s\n"
+
void
UtDisplaySupportedTables (
void)
{
ACPI_DMTABLE_DATA *TableData;
- UINT32 i = 6;
+ UINT32 i;
- printf ("\nACPI tables supported by iASL subsystems in "
- "version %8.8X:\n"
- " ASL and Data Table compilers\n"
- " AML and Data Table disassemblers\n"
- " ACPI table template generator\n\n", ACPI_CA_VERSION);
+ printf ("\nACPI tables supported by iASL version %8.8X:\n"
+ " (Compiler, Disassembler, Template Generator)\n\n",
+ ACPI_CA_VERSION);
/* Special tables */
- printf ("%8u) %s %s\n", 1, ACPI_SIG_DSDT, "Differentiated System Description Table");
- printf ("%8u) %s %s\n", 2, ACPI_SIG_SSDT, "Secondary System Description Table");
- printf ("%8u) %s %s\n", 3, ACPI_SIG_FADT, "Fixed ACPI Description Table (FADT)");
- printf ("%8u) %s %s\n", 4, ACPI_SIG_FACS, "Firmware ACPI Control Structure");
- printf ("%8u) %s %s\n", 5, ACPI_RSDP_NAME, "Root System Description Pointer");
+ printf (" Special tables and AML tables:\n");
+ printf (ACPI_TABLE_HELP_FORMAT, 1, ACPI_RSDP_NAME, "Root System Description Pointer");
+ printf (ACPI_TABLE_HELP_FORMAT, 2, ACPI_SIG_FACS, "Firmware ACPI Control Structure");
+ printf (ACPI_TABLE_HELP_FORMAT, 3, ACPI_SIG_DSDT, "Differentiated System Description Table");
+ printf (ACPI_TABLE_HELP_FORMAT, 4, ACPI_SIG_SSDT, "Secondary System Description Table");
/* All data tables with common table header */
- for (TableData = AcpiDmTableData; TableData->Signature; TableData++)
+ printf ("\n Standard ACPI data tables:\n");
+ for (TableData = AcpiDmTableData, i = 5; TableData->Signature; TableData++, i++)
{
- printf ("%8u) %s %s\n", i, TableData->Signature, TableData->Name);
- i++;
+ printf (ACPI_TABLE_HELP_FORMAT, i, TableData->Signature, TableData->Name);
}
}
@@ -591,36 +591,23 @@ UtCheckIntegerRange (
UINT32 LowValue,
UINT32 HighValue)
{
- char *ParseError = NULL;
- char Buffer[64];
-
if (!Op)
{
return NULL;
}
- if (Op->Asl.Value.Integer < LowValue)
- {
- ParseError = "Value below valid range";
- Op->Asl.Value.Integer = LowValue;
- }
-
- if (Op->Asl.Value.Integer > HighValue)
+ if ((Op->Asl.Value.Integer < LowValue) ||
+ (Op->Asl.Value.Integer > HighValue))
{
- ParseError = "Value above valid range";
- Op->Asl.Value.Integer = HighValue;
- }
+ sprintf (MsgBuffer, "0x%X, allowable: 0x%X-0x%X",
+ (UINT32) Op->Asl.Value.Integer, LowValue, HighValue);
- if (ParseError)
- {
- sprintf (Buffer, "%s 0x%X-0x%X", ParseError, LowValue, HighValue);
- AslCompilererror (Buffer);
-
- return NULL;
+ AslError (ASL_ERROR, ASL_MSG_RANGE, Op, MsgBuffer);
+ return (NULL);
}
- return Op;
+ return (Op);
}
diff --git a/source/compiler/new_table.txt b/source/compiler/new_table.txt
new file mode 100755
index 000000000000..1e48d385b6e8
--- /dev/null
+++ b/source/compiler/new_table.txt
@@ -0,0 +1,88 @@
+How to add a new ACPI table to ACPICA and the iASL compiler.
+------------------------------------------------------------
+
+There are four main tasks that are needed to provide support for a
+new ACPI table:
+ 1) Create a full definition of the table and any subtables
+ in the ACPICA headers.
+ 2) Add disassembler support for the new table
+ 3) Add iASL table compiler support for the new table
+ 4) Create a default template for the new table for iASL -T
+ option.
+
+Notes for each of these tasks provided below.
+
+
+1) Header Support
+-----------------
+
+New tables should be added to the appropriate header:
+ actbl2.h: Used for new tables that are not defined in the ACPI spec.
+ actbl3.h: Used for new tables that are defined in the ACPI spec.
+
+Use ACPI_TABLE_HEADER for the common ACPI table header.
+Subtables should be defined separately from the main table.
+Don't add placeholder fields for subtables and other multiple data items.
+ (Don't use xxxxx[1] for a field that can have multiple items.)
+ The disassembler and data table compiler depends on this.
+For tables not defined in the ACPI spec, add a comment to indicate where
+ the table came from.
+Use other table definitions for additional guidance.
+
+
+2) iASL Disassembler Support
+----------------------------
+
+Add definition of the table (and subtables) in common/dmtbinfo.c
+Add table access macro(s) of the form ACPI_xxxx_OFFSET
+Add ACPI_DMT_TERMINATOR at the end of every table/subtable definition
+
+Add externals for the table/subtable definitions in acdisasm.h
+Add an entry for the new table in the AcpiDmTableData in common/dmtable.c
+
+If there are no subtables, add the AcpiDmTableInfoXXXX name to the
+ AcpiDmTableData and it will automatically be disassembled.
+
+If there are subtables, a dump routine must be written:
+Add an AcpiDmDumpXXXX function to dmtbdump.c -- note, code for another
+ similar table can often be ported for the new table.
+Add an external for this function to acdisasm.h
+Add this function to the AcpiDmTableData entry for the new ACPI table
+
+Debug/Test: Either find an existing example of the new ACPI table, or
+ create one using the "generic ACPI table support" included in the
+ iASL data table compiler. Use the -G option to force a
+ generic compile. It is often best to create the table from scratch,
+ since this clearly exposes the dependencies (lengths, offsets, etc.)
+ that the Table Compiler support will need to generate.
+
+
+3) iASL Table Compiler Support
+------------------------------
+
+Simple tables do not require a compile routine. The definition of the
+ table in common/dmtbinfo.c (created in step 2 above) will suffice.
+
+Complex tables with subtables will require a compile routine with a name
+ of the form DtCompileXXXX.
+Add a DtCompileXXXX function to the dttable.c module.
+Add an external for this function in dtcompiler.h
+Add this function to the AcpiDmTableData entry for the new ACPI table
+ in common/dmtable.c
+
+
+4) Template Support (-T iASL option)
+------------------------------------
+
+Create an example of the new ACPI table. This example should create
+ multiple subtables (if supported), and multiple instances of any
+ variable length data.
+
+Compile the example file with the -sc option. This will create a C
+ array that contains the table contents.
+
+Add this array to the dttemplate.h file. Name the array TemplateXXXX.
+Add this array name to the AcpiDmTableData entry for the new ACPI table
+
+Debug/Test: Create the template file. Compile the file. Disassemble the file.
+ Compile the disassembly file.
diff --git a/source/components/debugger/dbcmds.c b/source/components/debugger/dbcmds.c
index 93d4f294dd09..0e9d78d965e4 100644
--- a/source/components/debugger/dbcmds.c
+++ b/source/components/debugger/dbcmds.c
@@ -174,14 +174,14 @@ AcpiDbSleep (
}
AcpiOsPrintf ("**** Going to sleep ****\n");
- Status = AcpiEnterSleepState (SleepState, ACPI_NO_OPTIONAL_METHODS);
+ Status = AcpiEnterSleepState (SleepState);
if (ACPI_FAILURE (Status))
{
goto ErrorExit;
}
AcpiOsPrintf ("**** Prepare to return from sleep ****\n");
- Status = AcpiLeaveSleepStatePrep (SleepState, ACPI_NO_OPTIONAL_METHODS);
+ Status = AcpiLeaveSleepStatePrep (SleepState);
if (ACPI_FAILURE (Status))
{
goto ErrorExit;
diff --git a/source/components/debugger/dbexec.c b/source/components/debugger/dbexec.c
index 4b59f22053a7..86c6579e322a 100644
--- a/source/components/debugger/dbexec.c
+++ b/source/components/debugger/dbexec.c
@@ -104,6 +104,15 @@ AcpiDbDeleteObjects (
ACPI_OBJECT *Objects);
+static UINT8 *
+AcpiDbEncodePldBuffer (
+ ACPI_PLD_INFO *PldInfo);
+
+static void
+AcpiDbDumpPldBuffer (
+ ACPI_OBJECT *ObjDesc);
+
+
/*******************************************************************************
*
* FUNCTION: AcpiDbHexCharToValue
@@ -446,7 +455,6 @@ AcpiDbExecuteMethod (
ACPI_STATUS Status;
ACPI_OBJECT_LIST ParamObjects;
ACPI_OBJECT Params[ACPI_METHOD_NUM_ARGS];
- ACPI_HANDLE Handle;
ACPI_DEVICE_INFO *ObjInfo;
UINT32 i;
@@ -459,17 +467,9 @@ AcpiDbExecuteMethod (
AcpiOsPrintf ("Warning: debug output is not enabled!\n");
}
- /* Get the NS node, determines existence also */
-
- Status = AcpiGetHandle (NULL, Info->Pathname, &Handle);
- if (ACPI_FAILURE (Status))
- {
- return_ACPI_STATUS (Status);
- }
-
/* Get the object info for number of method parameters */
- Status = AcpiGetObjectInfo (Handle, &ObjInfo);
+ Status = AcpiGetObjectInfo (Info->Method, &ObjInfo);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
@@ -720,6 +720,202 @@ AcpiDbExecutionWalk (
/*******************************************************************************
*
+ * FUNCTION: AcpiDbEncodePldBuffer
+ *
+ * PARAMETERS: PldInfo - _PLD buffer struct (Using local struct)
+ *
+ * RETURN: Encode _PLD buffer suitable for return value from _PLD
+ *
+ * DESCRIPTION: Bit-packs a _PLD buffer struct. Used to test the _PLD macros
+ *
+ ******************************************************************************/
+
+static UINT8 *
+AcpiDbEncodePldBuffer (
+ ACPI_PLD_INFO *PldInfo)
+{
+ UINT32 *Buffer;
+ UINT32 Dword;
+
+
+ Buffer = ACPI_ALLOCATE_ZEROED (ACPI_PLD_BUFFER_SIZE);
+ if (!Buffer)
+ {
+ return (NULL);
+ }
+
+ /* First 32 bits */
+
+ Dword = 0;
+ ACPI_PLD_SET_REVISION (&Dword, PldInfo->Revision);
+ ACPI_PLD_SET_IGNORE_COLOR (&Dword, PldInfo->IgnoreColor);
+ ACPI_PLD_SET_COLOR (&Dword, PldInfo->Color);
+ ACPI_MOVE_32_TO_32 (&Buffer[0], &Dword);
+
+ /* Second 32 bits */
+
+ Dword = 0;
+ ACPI_PLD_SET_WIDTH (&Dword, PldInfo->Width);
+ ACPI_PLD_SET_HEIGHT (&Dword, PldInfo->Height);
+ ACPI_MOVE_32_TO_32 (&Buffer[1], &Dword);
+
+ /* Third 32 bits */
+
+ Dword = 0;
+ ACPI_PLD_SET_USER_VISIBLE (&Dword, PldInfo->UserVisible);
+ ACPI_PLD_SET_DOCK (&Dword, PldInfo->Dock);
+ ACPI_PLD_SET_LID (&Dword, PldInfo->Lid);
+ ACPI_PLD_SET_PANEL (&Dword, PldInfo->Panel);
+ ACPI_PLD_SET_VERTICAL (&Dword, PldInfo->VerticalPosition);
+ ACPI_PLD_SET_HORIZONTAL (&Dword, PldInfo->HorizontalPosition);
+ ACPI_PLD_SET_SHAPE (&Dword, PldInfo->Shape);
+ ACPI_PLD_SET_ORIENTATION (&Dword, PldInfo->GroupOrientation);
+ ACPI_PLD_SET_TOKEN (&Dword, PldInfo->GroupToken);
+ ACPI_PLD_SET_POSITION (&Dword, PldInfo->GroupPosition);
+ ACPI_PLD_SET_BAY (&Dword, PldInfo->Bay);
+ ACPI_MOVE_32_TO_32 (&Buffer[2], &Dword);
+
+ /* Fourth 32 bits */
+
+ Dword = 0;
+ ACPI_PLD_SET_EJECTABLE (&Dword, PldInfo->Ejectable);
+ ACPI_PLD_SET_OSPM_EJECT (&Dword, PldInfo->OspmEjectRequired);
+ ACPI_PLD_SET_CABINET (&Dword, PldInfo->CabinetNumber);
+ ACPI_PLD_SET_CARD_CAGE (&Dword, PldInfo->CardCageNumber);
+ ACPI_PLD_SET_REFERENCE (&Dword, PldInfo->Reference);
+ ACPI_PLD_SET_ROTATION (&Dword, PldInfo->Rotation);
+ ACPI_PLD_SET_ORDER (&Dword, PldInfo->Order);
+ ACPI_MOVE_32_TO_32 (&Buffer[3], &Dword);
+
+ if (PldInfo->Revision >= 2)
+ {
+ /* Fifth 32 bits */
+
+ Dword = 0;
+ ACPI_PLD_SET_VERT_OFFSET (&Dword, PldInfo->VerticalOffset);
+ ACPI_PLD_SET_HORIZ_OFFSET (&Dword, PldInfo->HorizontalOffset);
+ ACPI_MOVE_32_TO_32 (&Buffer[4], &Dword);
+ }
+
+ return (ACPI_CAST_PTR (UINT8, Buffer));
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiDbDumpPldBuffer
+ *
+ * PARAMETERS: ObjDesc - Object returned from _PLD method
+ *
+ * RETURN: None.
+ *
+ * DESCRIPTION: Dumps formatted contents of a _PLD return buffer.
+ *
+ ******************************************************************************/
+
+#define ACPI_PLD_OUTPUT "%20s : %-6X\n"
+
+static void
+AcpiDbDumpPldBuffer (
+ ACPI_OBJECT *ObjDesc)
+{
+ ACPI_OBJECT *BufferDesc;
+ ACPI_PLD_INFO *PldInfo;
+ UINT8 *NewBuffer;
+ ACPI_STATUS Status;
+
+
+ /* Object must be of type Package with at least one Buffer element */
+
+ if (ObjDesc->Type != ACPI_TYPE_PACKAGE)
+ {
+ return;
+ }
+
+ BufferDesc = &ObjDesc->Package.Elements[0];
+ if (BufferDesc->Type != ACPI_TYPE_BUFFER)
+ {
+ return;
+ }
+
+ /* Convert _PLD buffer to local _PLD struct */
+
+ Status = AcpiDecodePldBuffer (BufferDesc->Buffer.Pointer,
+ BufferDesc->Buffer.Length, &PldInfo);
+ if (ACPI_FAILURE (Status))
+ {
+ return;
+ }
+
+ /* Encode local _PLD struct back to a _PLD buffer */
+
+ NewBuffer = AcpiDbEncodePldBuffer (PldInfo);
+ if (!NewBuffer)
+ {
+ return;
+ }
+
+ /* The two bit-packed buffers should match */
+
+ if (ACPI_MEMCMP (NewBuffer, BufferDesc->Buffer.Pointer,
+ BufferDesc->Buffer.Length))
+ {
+ AcpiOsPrintf ("Converted _PLD buffer does not compare. New:\n");
+
+ AcpiUtDumpBuffer2 (NewBuffer,
+ BufferDesc->Buffer.Length, DB_BYTE_DISPLAY);
+ }
+
+ /* First 32-bit dword */
+
+ AcpiOsPrintf (ACPI_PLD_OUTPUT, "Revision", PldInfo->Revision);
+ AcpiOsPrintf (ACPI_PLD_OUTPUT, "IgnoreColor", PldInfo->IgnoreColor);
+ AcpiOsPrintf (ACPI_PLD_OUTPUT, "Color", PldInfo->Color);
+
+ /* Second 32-bit dword */
+
+ AcpiOsPrintf (ACPI_PLD_OUTPUT, "Width", PldInfo->Width);
+ AcpiOsPrintf (ACPI_PLD_OUTPUT, "Height", PldInfo->Height);
+
+ /* Third 32-bit dword */
+
+ AcpiOsPrintf (ACPI_PLD_OUTPUT, "UserVisible", PldInfo->UserVisible);
+ AcpiOsPrintf (ACPI_PLD_OUTPUT, "Dock", PldInfo->Dock);
+ AcpiOsPrintf (ACPI_PLD_OUTPUT, "Lid", PldInfo->Lid);
+ AcpiOsPrintf (ACPI_PLD_OUTPUT, "Panel", PldInfo->Panel);
+ AcpiOsPrintf (ACPI_PLD_OUTPUT, "VerticalPosition", PldInfo->VerticalPosition);
+ AcpiOsPrintf (ACPI_PLD_OUTPUT, "HorizontalPosition", PldInfo->HorizontalPosition);
+ AcpiOsPrintf (ACPI_PLD_OUTPUT, "Shape", PldInfo->Shape);
+ AcpiOsPrintf (ACPI_PLD_OUTPUT, "GroupOrientation", PldInfo->GroupOrientation);
+ AcpiOsPrintf (ACPI_PLD_OUTPUT, "GroupToken", PldInfo->GroupToken);
+ AcpiOsPrintf (ACPI_PLD_OUTPUT, "GroupPosition", PldInfo->GroupPosition);
+ AcpiOsPrintf (ACPI_PLD_OUTPUT, "Bay", PldInfo->Bay);
+
+ /* Fourth 32-bit dword */
+
+ AcpiOsPrintf (ACPI_PLD_OUTPUT, "Ejectable", PldInfo->Ejectable);
+ AcpiOsPrintf (ACPI_PLD_OUTPUT, "OspmEjectRequired", PldInfo->OspmEjectRequired);
+ AcpiOsPrintf (ACPI_PLD_OUTPUT, "CabinetNumber", PldInfo->CabinetNumber);
+ AcpiOsPrintf (ACPI_PLD_OUTPUT, "CardCageNumber", PldInfo->CardCageNumber);
+ AcpiOsPrintf (ACPI_PLD_OUTPUT, "Reference", PldInfo->Reference);
+ AcpiOsPrintf (ACPI_PLD_OUTPUT, "Rotation", PldInfo->Rotation);
+ AcpiOsPrintf (ACPI_PLD_OUTPUT, "Order", PldInfo->Order);
+
+ /* Fifth 32-bit dword */
+
+ if (BufferDesc->Buffer.Length > 16)
+ {
+ AcpiOsPrintf (ACPI_PLD_OUTPUT, "VerticalOffset", PldInfo->VerticalOffset);
+ AcpiOsPrintf (ACPI_PLD_OUTPUT, "HorizontalOffset", PldInfo->HorizontalOffset);
+ }
+
+ ACPI_FREE (PldInfo);
+ ACPI_FREE (NewBuffer);
+}
+
+
+/*******************************************************************************
+ *
* FUNCTION: AcpiDbExecute
*
* PARAMETERS: Name - Name of method to execute
@@ -782,6 +978,16 @@ AcpiDbExecute (
ReturnObj.Length = ACPI_ALLOCATE_BUFFER;
AcpiDbExecuteSetup (&AcpiGbl_DbMethodInfo);
+
+ /* Get the NS node, determines existence also */
+
+ Status = AcpiGetHandle (NULL, AcpiGbl_DbMethodInfo.Pathname,
+ &AcpiGbl_DbMethodInfo.Method);
+ if (ACPI_FAILURE (Status))
+ {
+ return;
+ }
+
Status = AcpiDbExecuteMethod (&AcpiGbl_DbMethodInfo, &ReturnObj);
ACPI_FREE (NameString);
}
@@ -823,6 +1029,14 @@ AcpiDbExecute (
AcpiGbl_DbMethodInfo.Pathname, ReturnObj.Pointer,
(UINT32) ReturnObj.Length);
AcpiDbDumpExternalObject (ReturnObj.Pointer, 1);
+
+ /* Dump a _PLD buffer if present */
+
+ if (ACPI_COMPARE_NAME ((ACPI_CAST_PTR (ACPI_NAMESPACE_NODE,
+ AcpiGbl_DbMethodInfo.Method)->Name.Ascii), METHOD_NAME__PLD))
+ {
+ AcpiDbDumpPldBuffer (ReturnObj.Pointer);
+ }
}
else
{
@@ -1067,6 +1281,17 @@ AcpiDbCreateExecutionThreads (
AcpiDbExecuteSetup (&AcpiGbl_DbMethodInfo);
+ /* Get the NS node, determines existence also */
+
+ Status = AcpiGetHandle (NULL, AcpiGbl_DbMethodInfo.Pathname,
+ &AcpiGbl_DbMethodInfo.Method);
+ if (ACPI_FAILURE (Status))
+ {
+ AcpiOsPrintf ("%s Could not get handle for %s\n",
+ AcpiFormatException (Status), AcpiGbl_DbMethodInfo.Pathname);
+ goto CleanupAndExit;
+ }
+
/* Create the threads */
AcpiOsPrintf ("Creating %X threads to execute %X times each\n",
@@ -1090,6 +1315,8 @@ AcpiDbCreateExecutionThreads (
AcpiOsPrintf ("All threads (%X) have completed\n", NumThreads);
AcpiDbSetOutputDestination (ACPI_DB_CONSOLE_OUTPUT);
+CleanupAndExit:
+
/* Cleanup and exit */
(void) AcpiOsDeleteSemaphore (MainThreadGate);
diff --git a/source/components/disassembler/dmbuffer.c b/source/components/disassembler/dmbuffer.c
index 9f49f92e4743..d0a66ef2fdae 100644
--- a/source/components/disassembler/dmbuffer.c
+++ b/source/components/disassembler/dmbuffer.c
@@ -64,6 +64,12 @@ static void
AcpiDmIsEisaIdElement (
ACPI_PARSE_OBJECT *Op);
+static void
+AcpiDmPldBuffer (
+ UINT32 Level,
+ UINT8 *ByteData,
+ UINT32 ByteCount);
+
/*******************************************************************************
*
@@ -180,6 +186,12 @@ AcpiDmByteList (
AcpiDmUnicode (Op);
break;
+ case ACPI_DASM_PLD_METHOD:
+
+ AcpiDmDisasmByteList (Info->Level, ByteData, ByteCount);
+ AcpiDmPldBuffer (Info->Level, ByteData, ByteCount);
+ break;
+
case ACPI_DASM_BUFFER:
default:
@@ -332,6 +344,161 @@ AcpiDmIsStringBuffer (
/*******************************************************************************
*
+ * FUNCTION: AcpiDmIsPldBuffer
+ *
+ * PARAMETERS: Op - Buffer Object to be examined
+ *
+ * RETURN: TRUE if buffer contains a ASCII string, FALSE otherwise
+ *
+ * DESCRIPTION: Determine if a buffer Op contains a _PLD structure
+ *
+ ******************************************************************************/
+
+BOOLEAN
+AcpiDmIsPldBuffer (
+ ACPI_PARSE_OBJECT *Op)
+{
+ ACPI_NAMESPACE_NODE *Node;
+ ACPI_PARSE_OBJECT *ParentOp;
+
+
+ ParentOp = Op->Common.Parent;
+ if (!ParentOp)
+ {
+ return (FALSE);
+ }
+
+ /* Check for form: Name(_PLD, Buffer() {}). Not legal, however */
+
+ if (ParentOp->Common.AmlOpcode == AML_NAME_OP)
+ {
+ Node = ParentOp->Common.Node;
+
+ if (ACPI_COMPARE_NAME (Node->Name.Ascii, METHOD_NAME__PLD))
+ {
+ return (TRUE);
+ }
+
+ return (FALSE);
+ }
+
+ /* Check for proper form: Name(_PLD, Package() {Buffer() {}}) */
+
+ if (ParentOp->Common.AmlOpcode == AML_PACKAGE_OP)
+ {
+ ParentOp = ParentOp->Common.Parent;
+ if (!ParentOp)
+ {
+ return (FALSE);
+ }
+
+ if (ParentOp->Common.AmlOpcode == AML_NAME_OP)
+ {
+ Node = ParentOp->Common.Node;
+
+ if (ACPI_COMPARE_NAME (Node->Name.Ascii, METHOD_NAME__PLD))
+ {
+ return (TRUE);
+ }
+ }
+ }
+
+ return (FALSE);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiDmPldBuffer
+ *
+ * PARAMETERS: Level - Current source code indentation level
+ * ByteData - Pointer to the byte list
+ * ByteCount - Length of the byte list
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Dump and format the contents of a _PLD buffer object
+ *
+ ******************************************************************************/
+
+#define ACPI_PLD_OUTPUT "%*.s/* %18s : %-6.2X */\n", ACPI_MUL_4 (Level), " "
+#define ACPI_PLD_OUTPUT16 "%*.s/* %18s : %-6.4X */\n", ACPI_MUL_4 (Level), " "
+#define ACPI_PLD_OUTPUT24 "%*.s/* %18s : %-6.6X */\n", ACPI_MUL_4 (Level), " "
+
+static void
+AcpiDmPldBuffer (
+ UINT32 Level,
+ UINT8 *ByteData,
+ UINT32 ByteCount)
+{
+ ACPI_PLD_INFO *PldInfo;
+ ACPI_STATUS Status;
+
+
+ /* Check for valid byte count */
+
+ if (ByteCount < ACPI_PLD_REV1_BUFFER_SIZE)
+ {
+ return;
+ }
+
+ /* Convert _PLD buffer to local _PLD struct */
+
+ Status = AcpiDecodePldBuffer (ByteData, ByteCount, &PldInfo);
+ if (ACPI_FAILURE (Status))
+ {
+ return;
+ }
+
+ /* First 32-bit dword */
+
+ AcpiOsPrintf (ACPI_PLD_OUTPUT, "Revision", PldInfo->Revision);
+ AcpiOsPrintf (ACPI_PLD_OUTPUT, "IgnoreColor", PldInfo->IgnoreColor);
+ AcpiOsPrintf (ACPI_PLD_OUTPUT24,"Color", PldInfo->Color);
+
+ /* Second 32-bit dword */
+
+ AcpiOsPrintf (ACPI_PLD_OUTPUT16,"Width", PldInfo->Width);
+ AcpiOsPrintf (ACPI_PLD_OUTPUT16,"Height", PldInfo->Height);
+
+ /* Third 32-bit dword */
+
+ AcpiOsPrintf (ACPI_PLD_OUTPUT, "UserVisible", PldInfo->UserVisible);
+ AcpiOsPrintf (ACPI_PLD_OUTPUT, "Dock", PldInfo->Dock);
+ AcpiOsPrintf (ACPI_PLD_OUTPUT, "Lid", PldInfo->Lid);
+ AcpiOsPrintf (ACPI_PLD_OUTPUT, "Panel", PldInfo->Panel);
+ AcpiOsPrintf (ACPI_PLD_OUTPUT, "VerticalPosition", PldInfo->VerticalPosition);
+ AcpiOsPrintf (ACPI_PLD_OUTPUT, "HorizontalPosition", PldInfo->HorizontalPosition);
+ AcpiOsPrintf (ACPI_PLD_OUTPUT, "Shape", PldInfo->Shape);
+ AcpiOsPrintf (ACPI_PLD_OUTPUT, "GroupOrientation", PldInfo->GroupOrientation);
+ AcpiOsPrintf (ACPI_PLD_OUTPUT, "GroupToken", PldInfo->GroupToken);
+ AcpiOsPrintf (ACPI_PLD_OUTPUT, "GroupPosition", PldInfo->GroupPosition);
+ AcpiOsPrintf (ACPI_PLD_OUTPUT, "Bay", PldInfo->Bay);
+
+ /* Fourth 32-bit dword */
+
+ AcpiOsPrintf (ACPI_PLD_OUTPUT, "Ejectable", PldInfo->Ejectable);
+ AcpiOsPrintf (ACPI_PLD_OUTPUT, "OspmEjectRequired", PldInfo->OspmEjectRequired);
+ AcpiOsPrintf (ACPI_PLD_OUTPUT, "CabinetNumber", PldInfo->CabinetNumber);
+ AcpiOsPrintf (ACPI_PLD_OUTPUT, "CardCageNumber", PldInfo->CardCageNumber);
+ AcpiOsPrintf (ACPI_PLD_OUTPUT, "Reference", PldInfo->Reference);
+ AcpiOsPrintf (ACPI_PLD_OUTPUT, "Rotation", PldInfo->Rotation);
+ AcpiOsPrintf (ACPI_PLD_OUTPUT, "Order", PldInfo->Order);
+
+ /* Fifth 32-bit dword */
+
+ if (ByteCount >= ACPI_PLD_REV1_BUFFER_SIZE)
+ {
+ AcpiOsPrintf (ACPI_PLD_OUTPUT16,"VerticalOffset", PldInfo->VerticalOffset);
+ AcpiOsPrintf (ACPI_PLD_OUTPUT16,"HorizontalOffset", PldInfo->HorizontalOffset);
+ }
+
+ ACPI_FREE (PldInfo);
+}
+
+
+/*******************************************************************************
+ *
* FUNCTION: AcpiDmUnicode
*
* PARAMETERS: Op - Byte List op containing Unicode string
diff --git a/source/components/disassembler/dmopcode.c b/source/components/disassembler/dmopcode.c
index b52bdb28151f..2ce08a33f16f 100644
--- a/source/components/disassembler/dmopcode.c
+++ b/source/components/disassembler/dmopcode.c
@@ -665,6 +665,11 @@ AcpiDmDisassembleOneOp (
Op->Common.DisasmOpcode = ACPI_DASM_STRING;
AcpiOsPrintf ("Buffer");
}
+ else if (AcpiDmIsPldBuffer (Op))
+ {
+ Op->Common.DisasmOpcode = ACPI_DASM_PLD_METHOD;
+ AcpiOsPrintf ("Buffer");
+ }
else
{
Op->Common.DisasmOpcode = ACPI_DASM_BUFFER;
diff --git a/source/components/dispatcher/dswload.c b/source/components/dispatcher/dswload.c
index d40f911f417c..c2431155a1f4 100644
--- a/source/components/dispatcher/dswload.c
+++ b/source/components/dispatcher/dswload.c
@@ -241,6 +241,20 @@ AcpiDsLoad1BeginOp (
WalkState->ScopeInfo->Common.Value = ACPI_TYPE_ANY;
break;
+ case ACPI_TYPE_METHOD:
+
+ /*
+ * Allow scope change to root during execution of module-level
+ * code. Root is typed METHOD during this time.
+ */
+ if ((Node == AcpiGbl_RootNode) &&
+ (WalkState->ParseFlags & ACPI_PARSE_MODULE_LEVEL))
+ {
+ break;
+ }
+
+ /*lint -fallthrough */
+
default:
/* All other types are an error */
diff --git a/source/components/dispatcher/dswload2.c b/source/components/dispatcher/dswload2.c
index 27e317620911..90d85d6501da 100644
--- a/source/components/dispatcher/dswload2.c
+++ b/source/components/dispatcher/dswload2.c
@@ -243,6 +243,20 @@ AcpiDsLoad2BeginOp (
WalkState->ScopeInfo->Common.Value = ACPI_TYPE_ANY;
break;
+ case ACPI_TYPE_METHOD:
+
+ /*
+ * Allow scope change to root during execution of module-level
+ * code. Root is typed METHOD during this time.
+ */
+ if ((Node == AcpiGbl_RootNode) &&
+ (WalkState->ParseFlags & ACPI_PARSE_MODULE_LEVEL))
+ {
+ break;
+ }
+
+ /*lint -fallthrough */
+
default:
/* All other types are an error */
diff --git a/source/components/events/evgpe.c b/source/components/events/evgpe.c
index 623795a83619..7c572b74f15d 100644
--- a/source/components/events/evgpe.c
+++ b/source/components/events/evgpe.c
@@ -92,7 +92,7 @@ AcpiEvUpdateGpeEnableMask (
return_ACPI_STATUS (AE_NOT_EXIST);
}
- RegisterBit = AcpiHwGetGpeRegisterBit (GpeEventInfo, GpeRegisterInfo);
+ RegisterBit = AcpiHwGetGpeRegisterBit (GpeEventInfo);
/* Clear the run bit up front */
@@ -431,6 +431,13 @@ AcpiEvGpeDetect (
if (!(GpeRegisterInfo->EnableForRun |
GpeRegisterInfo->EnableForWake))
{
+ ACPI_DEBUG_PRINT ((ACPI_DB_INTERRUPTS,
+ "Ignore disabled registers for GPE%02X-GPE%02X: "
+ "RunEnable=%02X, WakeEnable=%02X\n",
+ GpeRegisterInfo->BaseGpeNumber,
+ GpeRegisterInfo->BaseGpeNumber + (ACPI_GPE_REGISTER_WIDTH - 1),
+ GpeRegisterInfo->EnableForRun,
+ GpeRegisterInfo->EnableForWake));
continue;
}
@@ -451,8 +458,13 @@ AcpiEvGpeDetect (
}
ACPI_DEBUG_PRINT ((ACPI_DB_INTERRUPTS,
- "Read GPE Register at GPE%02X: Status=%02X, Enable=%02X\n",
- GpeRegisterInfo->BaseGpeNumber, StatusReg, EnableReg));
+ "Read registers for GPE%02X-GPE%02X: Status=%02X, Enable=%02X, "
+ "RunEnable=%02X, WakeEnable=%02X\n",
+ GpeRegisterInfo->BaseGpeNumber,
+ GpeRegisterInfo->BaseGpeNumber + (ACPI_GPE_REGISTER_WIDTH - 1),
+ StatusReg, EnableReg,
+ GpeRegisterInfo->EnableForRun,
+ GpeRegisterInfo->EnableForWake));
/* Check if there is anything active at all in this register */
diff --git a/source/components/events/evxfgpe.c b/source/components/events/evxfgpe.c
index 4194651def8e..1e83d1dacd6d 100644
--- a/source/components/events/evxfgpe.c
+++ b/source/components/events/evxfgpe.c
@@ -480,7 +480,7 @@ AcpiSetGpeWakeMask (
goto UnlockAndExit;
}
- RegisterBit = AcpiHwGetGpeRegisterBit (GpeEventInfo, GpeRegisterInfo);
+ RegisterBit = AcpiHwGetGpeRegisterBit (GpeEventInfo);
/* Perform the action */
diff --git a/source/components/hardware/hwesleep.c b/source/components/hardware/hwesleep.c
index 1587af019cb9..353d5a92974e 100644
--- a/source/components/hardware/hwesleep.c
+++ b/source/components/hardware/hwesleep.c
@@ -99,7 +99,6 @@ AcpiHwExecuteSleepMethod (
* FUNCTION: AcpiHwExtendedSleep
*
* PARAMETERS: SleepState - Which sleep state to enter
- * Flags - ACPI_EXECUTE_GTS to run optional method
*
* RETURN: Status
*
@@ -111,8 +110,7 @@ AcpiHwExecuteSleepMethod (
ACPI_STATUS
AcpiHwExtendedSleep (
- UINT8 SleepState,
- UINT8 Flags)
+ UINT8 SleepState)
{
ACPI_STATUS Status;
UINT8 SleepTypeValue;
@@ -140,13 +138,6 @@ AcpiHwExtendedSleep (
AcpiGbl_SystemAwakeAndRunning = FALSE;
- /* Optionally execute _GTS (Going To Sleep) */
-
- if (Flags & ACPI_EXECUTE_GTS)
- {
- AcpiHwExecuteSleepMethod (METHOD_PATHNAME__GTS, SleepState);
- }
-
/* Flush caches, as per ACPI specification */
ACPI_FLUSH_CPU_CACHE ();
@@ -191,7 +182,6 @@ AcpiHwExtendedSleep (
* FUNCTION: AcpiHwExtendedWakePrep
*
* PARAMETERS: SleepState - Which sleep state we just exited
- * Flags - ACPI_EXECUTE_BFS to run optional method
*
* RETURN: Status
*
@@ -202,8 +192,7 @@ AcpiHwExtendedSleep (
ACPI_STATUS
AcpiHwExtendedWakePrep (
- UINT8 SleepState,
- UINT8 Flags)
+ UINT8 SleepState)
{
ACPI_STATUS Status;
UINT8 SleepTypeValue;
@@ -223,12 +212,6 @@ AcpiHwExtendedWakePrep (
&AcpiGbl_FADT.SleepControl);
}
- /* Optionally execute _BFS (Back From Sleep) */
-
- if (Flags & ACPI_EXECUTE_BFS)
- {
- AcpiHwExecuteSleepMethod (METHOD_PATHNAME__BFS, SleepState);
- }
return_ACPI_STATUS (AE_OK);
}
@@ -238,7 +221,6 @@ AcpiHwExtendedWakePrep (
* FUNCTION: AcpiHwExtendedWake
*
* PARAMETERS: SleepState - Which sleep state we just exited
- * Flags - Reserved, set to zero
*
* RETURN: Status
*
@@ -249,8 +231,7 @@ AcpiHwExtendedWakePrep (
ACPI_STATUS
AcpiHwExtendedWake (
- UINT8 SleepState,
- UINT8 Flags)
+ UINT8 SleepState)
{
ACPI_FUNCTION_TRACE (HwExtendedWake);
diff --git a/source/components/hardware/hwgpe.c b/source/components/hardware/hwgpe.c
index c94f17be260e..11cb36e86b97 100644
--- a/source/components/hardware/hwgpe.c
+++ b/source/components/hardware/hwgpe.c
@@ -65,7 +65,6 @@ AcpiHwEnableWakeupGpeBlock (
* FUNCTION: AcpiHwGetGpeRegisterBit
*
* PARAMETERS: GpeEventInfo - Info block for the GPE
- * GpeRegisterInfo - Info block for the GPE register
*
* RETURN: Register mask with a one in the GPE bit position
*
@@ -76,12 +75,11 @@ AcpiHwEnableWakeupGpeBlock (
UINT32
AcpiHwGetGpeRegisterBit (
- ACPI_GPE_EVENT_INFO *GpeEventInfo,
- ACPI_GPE_REGISTER_INFO *GpeRegisterInfo)
+ ACPI_GPE_EVENT_INFO *GpeEventInfo)
{
return ((UINT32) 1 <<
- (GpeEventInfo->GpeNumber - GpeRegisterInfo->BaseGpeNumber));
+ (GpeEventInfo->GpeNumber - GpeEventInfo->RegisterInfo->BaseGpeNumber));
}
@@ -130,7 +128,7 @@ AcpiHwLowSetGpe (
/* Set or clear just the bit that corresponds to this GPE */
- RegisterBit = AcpiHwGetGpeRegisterBit (GpeEventInfo, GpeRegisterInfo);
+ RegisterBit = AcpiHwGetGpeRegisterBit (GpeEventInfo);
switch (Action)
{
case ACPI_GPE_CONDITIONAL_ENABLE:
@@ -199,7 +197,7 @@ AcpiHwClearGpe (
* Write a one to the appropriate bit in the status register to
* clear this GPE.
*/
- RegisterBit = AcpiHwGetGpeRegisterBit (GpeEventInfo, GpeRegisterInfo);
+ RegisterBit = AcpiHwGetGpeRegisterBit (GpeEventInfo);
Status = AcpiHwWrite (RegisterBit,
&GpeRegisterInfo->StatusAddress);
@@ -247,7 +245,7 @@ AcpiHwGetGpeStatus (
/* Get the register bitmask for this GPE */
- RegisterBit = AcpiHwGetGpeRegisterBit (GpeEventInfo, GpeRegisterInfo);
+ RegisterBit = AcpiHwGetGpeRegisterBit (GpeEventInfo);
/* GPE currently enabled? (enabled for runtime?) */
diff --git a/source/components/hardware/hwsleep.c b/source/components/hardware/hwsleep.c
index 1957fbdf2764..d3817554225a 100644
--- a/source/components/hardware/hwsleep.c
+++ b/source/components/hardware/hwsleep.c
@@ -55,7 +55,6 @@
* FUNCTION: AcpiHwLegacySleep
*
* PARAMETERS: SleepState - Which sleep state to enter
- * Flags - ACPI_EXECUTE_GTS to run optional method
*
* RETURN: Status
*
@@ -66,8 +65,7 @@
ACPI_STATUS
AcpiHwLegacySleep (
- UINT8 SleepState,
- UINT8 Flags)
+ UINT8 SleepState)
{
ACPI_BIT_REGISTER_INFO *SleepTypeRegInfo;
ACPI_BIT_REGISTER_INFO *SleepEnableRegInfo;
@@ -116,13 +114,6 @@ AcpiHwLegacySleep (
return_ACPI_STATUS (Status);
}
- /* Optionally execute _GTS (Going To Sleep) */
-
- if (Flags & ACPI_EXECUTE_GTS)
- {
- AcpiHwExecuteSleepMethod (METHOD_PATHNAME__GTS, SleepState);
- }
-
/* Get current value of PM1A control */
Status = AcpiHwRegisterRead (ACPI_REGISTER_PM1_CONTROL,
@@ -219,7 +210,6 @@ AcpiHwLegacySleep (
* FUNCTION: AcpiHwLegacyWakePrep
*
* PARAMETERS: SleepState - Which sleep state we just exited
- * Flags - ACPI_EXECUTE_BFS to run optional method
*
* RETURN: Status
*
@@ -231,8 +221,7 @@ AcpiHwLegacySleep (
ACPI_STATUS
AcpiHwLegacyWakePrep (
- UINT8 SleepState,
- UINT8 Flags)
+ UINT8 SleepState)
{
ACPI_STATUS Status;
ACPI_BIT_REGISTER_INFO *SleepTypeRegInfo;
@@ -282,12 +271,6 @@ AcpiHwLegacyWakePrep (
}
}
- /* Optionally execute _BFS (Back From Sleep) */
-
- if (Flags & ACPI_EXECUTE_BFS)
- {
- AcpiHwExecuteSleepMethod (METHOD_PATHNAME__BFS, SleepState);
- }
return_ACPI_STATUS (Status);
}
@@ -297,7 +280,6 @@ AcpiHwLegacyWakePrep (
* FUNCTION: AcpiHwLegacyWake
*
* PARAMETERS: SleepState - Which sleep state we just exited
- * Flags - Reserved, set to zero
*
* RETURN: Status
*
@@ -308,8 +290,7 @@ AcpiHwLegacyWakePrep (
ACPI_STATUS
AcpiHwLegacyWake (
- UINT8 SleepState,
- UINT8 Flags)
+ UINT8 SleepState)
{
ACPI_STATUS Status;
diff --git a/source/components/hardware/hwxfsleep.c b/source/components/hardware/hwxfsleep.c
index caa51a8a4a62..c75308443a2e 100644
--- a/source/components/hardware/hwxfsleep.c
+++ b/source/components/hardware/hwxfsleep.c
@@ -52,7 +52,6 @@
static ACPI_STATUS
AcpiHwSleepDispatch (
UINT8 SleepState,
- UINT8 Flags,
UINT32 FunctionId);
/*
@@ -261,7 +260,6 @@ ACPI_EXPORT_SYMBOL (AcpiEnterSleepStateS4bios)
static ACPI_STATUS
AcpiHwSleepDispatch (
UINT8 SleepState,
- UINT8 Flags,
UINT32 FunctionId)
{
ACPI_STATUS Status;
@@ -277,13 +275,13 @@ AcpiHwSleepDispatch (
if (AcpiGbl_ReducedHardware ||
AcpiGbl_FADT.SleepControl.Address)
{
- Status = SleepFunctions->ExtendedFunction (SleepState, Flags);
+ Status = SleepFunctions->ExtendedFunction (SleepState);
}
else
{
/* Legacy sleep */
- Status = SleepFunctions->LegacyFunction (SleepState, Flags);
+ Status = SleepFunctions->LegacyFunction (SleepState);
}
return (Status);
@@ -293,7 +291,7 @@ AcpiHwSleepDispatch (
* For the case where reduced-hardware-only code is being generated,
* we know that only the extended sleep registers are available
*/
- Status = SleepFunctions->ExtendedFunction (SleepState, Flags);
+ Status = SleepFunctions->ExtendedFunction (SleepState);
return (Status);
#endif /* !ACPI_REDUCED_HARDWARE */
@@ -387,7 +385,6 @@ ACPI_EXPORT_SYMBOL (AcpiEnterSleepStatePrep)
* FUNCTION: AcpiEnterSleepState
*
* PARAMETERS: SleepState - Which sleep state to enter
- * Flags - ACPI_EXECUTE_GTS to run optional method
*
* RETURN: Status
*
@@ -398,8 +395,7 @@ ACPI_EXPORT_SYMBOL (AcpiEnterSleepStatePrep)
ACPI_STATUS
AcpiEnterSleepState (
- UINT8 SleepState,
- UINT8 Flags)
+ UINT8 SleepState)
{
ACPI_STATUS Status;
@@ -415,7 +411,7 @@ AcpiEnterSleepState (
return_ACPI_STATUS (AE_AML_OPERAND_VALUE);
}
- Status = AcpiHwSleepDispatch (SleepState, Flags, ACPI_SLEEP_FUNCTION_ID);
+ Status = AcpiHwSleepDispatch (SleepState, ACPI_SLEEP_FUNCTION_ID);
return_ACPI_STATUS (Status);
}
@@ -427,7 +423,6 @@ ACPI_EXPORT_SYMBOL (AcpiEnterSleepState)
* FUNCTION: AcpiLeaveSleepStatePrep
*
* PARAMETERS: SleepState - Which sleep state we are exiting
- * Flags - ACPI_EXECUTE_BFS to run optional method
*
* RETURN: Status
*
@@ -440,8 +435,7 @@ ACPI_EXPORT_SYMBOL (AcpiEnterSleepState)
ACPI_STATUS
AcpiLeaveSleepStatePrep (
- UINT8 SleepState,
- UINT8 Flags)
+ UINT8 SleepState)
{
ACPI_STATUS Status;
@@ -449,7 +443,7 @@ AcpiLeaveSleepStatePrep (
ACPI_FUNCTION_TRACE (AcpiLeaveSleepStatePrep);
- Status = AcpiHwSleepDispatch (SleepState, Flags, ACPI_WAKE_PREP_FUNCTION_ID);
+ Status = AcpiHwSleepDispatch (SleepState, ACPI_WAKE_PREP_FUNCTION_ID);
return_ACPI_STATUS (Status);
}
@@ -479,7 +473,7 @@ AcpiLeaveSleepState (
ACPI_FUNCTION_TRACE (AcpiLeaveSleepState);
- Status = AcpiHwSleepDispatch (SleepState, 0, ACPI_WAKE_FUNCTION_ID);
+ Status = AcpiHwSleepDispatch (SleepState, ACPI_WAKE_FUNCTION_ID);
return_ACPI_STATUS (Status);
}
diff --git a/source/components/namespace/nsdump.c b/source/components/namespace/nsdump.c
index 6b7c50577918..e0635dc7ba22 100644
--- a/source/components/namespace/nsdump.c
+++ b/source/components/namespace/nsdump.c
@@ -294,7 +294,7 @@ AcpiNsDumpOneObject (
{
case ACPI_TYPE_PROCESSOR:
- AcpiOsPrintf ("ID %X Len %.4X Addr %p\n",
+ AcpiOsPrintf ("ID %02X Len %02X Addr %p\n",
ObjDesc->Processor.ProcId, ObjDesc->Processor.Length,
ACPI_CAST_PTR (void, ObjDesc->Processor.Address));
break;
diff --git a/source/components/utilities/utosi.c b/source/components/utilities/utosi.c
index dcce8a99e18a..a1ff84521e95 100644
--- a/source/components/utilities/utosi.c
+++ b/source/components/utilities/utosi.c
@@ -77,6 +77,7 @@ static ACPI_INTERFACE_INFO AcpiDefaultSupportedInterfaces[] =
{"Windows 2006 SP1", NULL, 0, ACPI_OSI_WIN_VISTA_SP1}, /* Windows Vista SP1 - Added 09/2009 */
{"Windows 2006 SP2", NULL, 0, ACPI_OSI_WIN_VISTA_SP2}, /* Windows Vista SP2 - Added 09/2010 */
{"Windows 2009", NULL, 0, ACPI_OSI_WIN_7}, /* Windows 7 and Server 2008 R2 - Added 09/2009 */
+ {"Windows 2012", NULL, 0, ACPI_OSI_WIN_8}, /* Windows 8 and Server 2012 - Added 08/2012 */
/* Feature Group Strings */
diff --git a/source/components/utilities/utxface.c b/source/components/utilities/utxface.c
index 3e858c9b0ffe..38f7195769ab 100644
--- a/source/components/utilities/utxface.c
+++ b/source/components/utilities/utxface.c
@@ -1,6 +1,6 @@
/******************************************************************************
*
- * Module Name: utxface - External interfaces for "global" ACPI functions
+ * Module Name: utxface - External interfaces, miscellaneous utility functions
*
*****************************************************************************/
@@ -46,321 +46,12 @@
#include "acpi.h"
#include "accommon.h"
-#include "acevents.h"
-#include "acnamesp.h"
#include "acdebug.h"
-#include "actables.h"
#define _COMPONENT ACPI_UTILITIES
ACPI_MODULE_NAME ("utxface")
-#ifndef ACPI_ASL_COMPILER
-/*******************************************************************************
- *
- * FUNCTION: AcpiInitializeSubsystem
- *
- * PARAMETERS: None
- *
- * RETURN: Status
- *
- * DESCRIPTION: Initializes all global variables. This is the first function
- * called, so any early initialization belongs here.
- *
- ******************************************************************************/
-
-ACPI_STATUS
-AcpiInitializeSubsystem (
- void)
-{
- ACPI_STATUS Status;
-
-
- ACPI_FUNCTION_TRACE (AcpiInitializeSubsystem);
-
-
- AcpiGbl_StartupFlags = ACPI_SUBSYSTEM_INITIALIZE;
- ACPI_DEBUG_EXEC (AcpiUtInitStackPtrTrace ());
-
- /* Initialize the OS-Dependent layer */
-
- Status = AcpiOsInitialize ();
- if (ACPI_FAILURE (Status))
- {
- ACPI_EXCEPTION ((AE_INFO, Status, "During OSL initialization"));
- return_ACPI_STATUS (Status);
- }
-
- /* Initialize all globals used by the subsystem */
-
- Status = AcpiUtInitGlobals ();
- if (ACPI_FAILURE (Status))
- {
- ACPI_EXCEPTION ((AE_INFO, Status, "During initialization of globals"));
- return_ACPI_STATUS (Status);
- }
-
- /* Create the default mutex objects */
-
- Status = AcpiUtMutexInitialize ();
- if (ACPI_FAILURE (Status))
- {
- ACPI_EXCEPTION ((AE_INFO, Status, "During Global Mutex creation"));
- return_ACPI_STATUS (Status);
- }
-
- /*
- * Initialize the namespace manager and
- * the root of the namespace tree
- */
- Status = AcpiNsRootInitialize ();
- if (ACPI_FAILURE (Status))
- {
- ACPI_EXCEPTION ((AE_INFO, Status, "During Namespace initialization"));
- return_ACPI_STATUS (Status);
- }
-
- /* Initialize the global OSI interfaces list with the static names */
-
- Status = AcpiUtInitializeInterfaces ();
- if (ACPI_FAILURE (Status))
- {
- ACPI_EXCEPTION ((AE_INFO, Status, "During OSI interfaces initialization"));
- return_ACPI_STATUS (Status);
- }
-
- /* If configured, initialize the AML debugger */
-
- ACPI_DEBUGGER_EXEC (Status = AcpiDbInitialize ());
- return_ACPI_STATUS (Status);
-}
-
-ACPI_EXPORT_SYMBOL (AcpiInitializeSubsystem)
-
-
-/*******************************************************************************
- *
- * FUNCTION: AcpiEnableSubsystem
- *
- * PARAMETERS: Flags - Init/enable Options
- *
- * RETURN: Status
- *
- * DESCRIPTION: Completes the subsystem initialization including hardware.
- * Puts system into ACPI mode if it isn't already.
- *
- ******************************************************************************/
-
-ACPI_STATUS
-AcpiEnableSubsystem (
- UINT32 Flags)
-{
- ACPI_STATUS Status = AE_OK;
-
-
- ACPI_FUNCTION_TRACE (AcpiEnableSubsystem);
-
-
-#if (!ACPI_REDUCED_HARDWARE)
-
- /* Enable ACPI mode */
-
- if (!(Flags & ACPI_NO_ACPI_ENABLE))
- {
- ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "[Init] Going into ACPI mode\n"));
-
- AcpiGbl_OriginalMode = AcpiHwGetMode();
-
- Status = AcpiEnable ();
- if (ACPI_FAILURE (Status))
- {
- ACPI_WARNING ((AE_INFO, "AcpiEnable failed"));
- return_ACPI_STATUS (Status);
- }
- }
-
- /*
- * Obtain a permanent mapping for the FACS. This is required for the
- * Global Lock and the Firmware Waking Vector
- */
- Status = AcpiTbInitializeFacs ();
- if (ACPI_FAILURE (Status))
- {
- ACPI_WARNING ((AE_INFO, "Could not map the FACS table"));
- return_ACPI_STATUS (Status);
- }
-
-#endif /* !ACPI_REDUCED_HARDWARE */
-
- /*
- * Install the default OpRegion handlers. These are installed unless
- * other handlers have already been installed via the
- * InstallAddressSpaceHandler interface.
- */
- if (!(Flags & ACPI_NO_ADDRESS_SPACE_INIT))
- {
- ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
- "[Init] Installing default address space handlers\n"));
-
- Status = AcpiEvInstallRegionHandlers ();
- if (ACPI_FAILURE (Status))
- {
- return_ACPI_STATUS (Status);
- }
- }
-
-#if (!ACPI_REDUCED_HARDWARE)
- /*
- * Initialize ACPI Event handling (Fixed and General Purpose)
- *
- * Note1: We must have the hardware and events initialized before we can
- * execute any control methods safely. Any control method can require
- * ACPI hardware support, so the hardware must be fully initialized before
- * any method execution!
- *
- * Note2: Fixed events are initialized and enabled here. GPEs are
- * initialized, but cannot be enabled until after the hardware is
- * completely initialized (SCI and GlobalLock activated) and the various
- * initialization control methods are run (_REG, _STA, _INI) on the
- * entire namespace.
- */
- if (!(Flags & ACPI_NO_EVENT_INIT))
- {
- ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
- "[Init] Initializing ACPI events\n"));
-
- Status = AcpiEvInitializeEvents ();
- if (ACPI_FAILURE (Status))
- {
- return_ACPI_STATUS (Status);
- }
- }
-
- /*
- * Install the SCI handler and Global Lock handler. This completes the
- * hardware initialization.
- */
- if (!(Flags & ACPI_NO_HANDLER_INIT))
- {
- ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
- "[Init] Installing SCI/GL handlers\n"));
-
- Status = AcpiEvInstallXruptHandlers ();
- if (ACPI_FAILURE (Status))
- {
- return_ACPI_STATUS (Status);
- }
- }
-
-#endif /* !ACPI_REDUCED_HARDWARE */
-
- return_ACPI_STATUS (Status);
-}
-
-ACPI_EXPORT_SYMBOL (AcpiEnableSubsystem)
-
-
-/*******************************************************************************
- *
- * FUNCTION: AcpiInitializeObjects
- *
- * PARAMETERS: Flags - Init/enable Options
- *
- * RETURN: Status
- *
- * DESCRIPTION: Completes namespace initialization by initializing device
- * objects and executing AML code for Regions, buffers, etc.
- *
- ******************************************************************************/
-
-ACPI_STATUS
-AcpiInitializeObjects (
- UINT32 Flags)
-{
- ACPI_STATUS Status = AE_OK;
-
-
- ACPI_FUNCTION_TRACE (AcpiInitializeObjects);
-
-
- /*
- * Run all _REG methods
- *
- * Note: Any objects accessed by the _REG methods will be automatically
- * initialized, even if they contain executable AML (see the call to
- * AcpiNsInitializeObjects below).
- */
- if (!(Flags & ACPI_NO_ADDRESS_SPACE_INIT))
- {
- ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
- "[Init] Executing _REG OpRegion methods\n"));
-
- Status = AcpiEvInitializeOpRegions ();
- if (ACPI_FAILURE (Status))
- {
- return_ACPI_STATUS (Status);
- }
- }
-
- /*
- * Execute any module-level code that was detected during the table load
- * phase. Although illegal since ACPI 2.0, there are many machines that
- * contain this type of code. Each block of detected executable AML code
- * outside of any control method is wrapped with a temporary control
- * method object and placed on a global list. The methods on this list
- * are executed below.
- */
- AcpiNsExecModuleCodeList ();
-
- /*
- * Initialize the objects that remain uninitialized. This runs the
- * executable AML that may be part of the declaration of these objects:
- * OperationRegions, BufferFields, Buffers, and Packages.
- */
- if (!(Flags & ACPI_NO_OBJECT_INIT))
- {
- ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
- "[Init] Completing Initialization of ACPI Objects\n"));
-
- Status = AcpiNsInitializeObjects ();
- if (ACPI_FAILURE (Status))
- {
- return_ACPI_STATUS (Status);
- }
- }
-
- /*
- * Initialize all device objects in the namespace. This runs the device
- * _STA and _INI methods.
- */
- if (!(Flags & ACPI_NO_DEVICE_INIT))
- {
- ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
- "[Init] Initializing ACPI Devices\n"));
-
- Status = AcpiNsInitializeDevices ();
- if (ACPI_FAILURE (Status))
- {
- return_ACPI_STATUS (Status);
- }
- }
-
- /*
- * Empty the caches (delete the cached objects) on the assumption that
- * the table load filled them up more than they will be at runtime --
- * thus wasting non-paged memory.
- */
- Status = AcpiPurgeCachedObjects ();
-
- AcpiGbl_StartupFlags |= ACPI_INITIALIZED_OK;
- return_ACPI_STATUS (Status);
-}
-
-ACPI_EXPORT_SYMBOL (AcpiInitializeObjects)
-
-
-#endif
-
/*******************************************************************************
*
* FUNCTION: AcpiTerminate
@@ -835,3 +526,98 @@ AcpiCheckAddressRange (
ACPI_EXPORT_SYMBOL (AcpiCheckAddressRange)
#endif /* !ACPI_ASL_COMPILER */
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiDecodePldBuffer
+ *
+ * PARAMETERS: InBuffer - Buffer returned by _PLD method
+ * Length - Length of the InBuffer
+ * ReturnBuffer - Where the decode buffer is returned
+ *
+ * RETURN: Status and the decoded _PLD buffer. User must deallocate
+ * the buffer via ACPI_FREE.
+ *
+ * DESCRIPTION: Decode the bit-packed buffer returned by the _PLD method into
+ * a local struct that is much more useful to an ACPI driver.
+ *
+ ******************************************************************************/
+
+ACPI_STATUS
+AcpiDecodePldBuffer (
+ UINT8 *InBuffer,
+ ACPI_SIZE Length,
+ ACPI_PLD_INFO **ReturnBuffer)
+{
+ ACPI_PLD_INFO *PldInfo;
+ UINT32 *Buffer = ACPI_CAST_PTR (UINT32, InBuffer);
+ UINT32 Dword;
+
+
+ /* Parameter validation */
+
+ if (!InBuffer || !ReturnBuffer || (Length < 16))
+ {
+ return (AE_BAD_PARAMETER);
+ }
+
+ PldInfo = ACPI_ALLOCATE_ZEROED (sizeof (ACPI_PLD_INFO));
+ if (!PldInfo)
+ {
+ return (AE_NO_MEMORY);
+ }
+
+ /* First 32-bit DWord */
+
+ ACPI_MOVE_32_TO_32 (&Dword, &Buffer[0]);
+ PldInfo->Revision = ACPI_PLD_GET_REVISION (&Dword);
+ PldInfo->IgnoreColor = ACPI_PLD_GET_IGNORE_COLOR (&Dword);
+ PldInfo->Color = ACPI_PLD_GET_COLOR (&Dword);
+
+ /* Second 32-bit DWord */
+
+ ACPI_MOVE_32_TO_32 (&Dword, &Buffer[1]);
+ PldInfo->Width = ACPI_PLD_GET_WIDTH (&Dword);
+ PldInfo->Height = ACPI_PLD_GET_HEIGHT(&Dword);
+
+ /* Third 32-bit DWord */
+
+ ACPI_MOVE_32_TO_32 (&Dword, &Buffer[2]);
+ PldInfo->UserVisible = ACPI_PLD_GET_USER_VISIBLE (&Dword);
+ PldInfo->Dock = ACPI_PLD_GET_DOCK (&Dword);
+ PldInfo->Lid = ACPI_PLD_GET_LID (&Dword);
+ PldInfo->Panel = ACPI_PLD_GET_PANEL (&Dword);
+ PldInfo->VerticalPosition = ACPI_PLD_GET_VERTICAL (&Dword);
+ PldInfo->HorizontalPosition = ACPI_PLD_GET_HORIZONTAL (&Dword);
+ PldInfo->Shape = ACPI_PLD_GET_SHAPE (&Dword);
+ PldInfo->GroupOrientation = ACPI_PLD_GET_ORIENTATION (&Dword);
+ PldInfo->GroupToken = ACPI_PLD_GET_TOKEN (&Dword);
+ PldInfo->GroupPosition = ACPI_PLD_GET_POSITION (&Dword);
+ PldInfo->Bay = ACPI_PLD_GET_BAY (&Dword);
+
+ /* Fourth 32-bit DWord */
+
+ ACPI_MOVE_32_TO_32 (&Dword, &Buffer[3]);
+ PldInfo->Ejectable = ACPI_PLD_GET_EJECTABLE (&Dword);
+ PldInfo->OspmEjectRequired = ACPI_PLD_GET_OSPM_EJECT (&Dword);
+ PldInfo->CabinetNumber = ACPI_PLD_GET_CABINET (&Dword);
+ PldInfo->CardCageNumber = ACPI_PLD_GET_CARD_CAGE (&Dword);
+ PldInfo->Reference = ACPI_PLD_GET_REFERENCE (&Dword);
+ PldInfo->Rotation = ACPI_PLD_GET_ROTATION (&Dword);
+ PldInfo->Order = ACPI_PLD_GET_ORDER (&Dword);
+
+ if (Length >= ACPI_PLD_BUFFER_SIZE)
+ {
+ /* Fifth 32-bit DWord (Revision 2 of _PLD) */
+
+ ACPI_MOVE_32_TO_32 (&Dword, &Buffer[4]);
+ PldInfo->VerticalOffset = ACPI_PLD_GET_VERT_OFFSET (&Dword);
+ PldInfo->HorizontalOffset = ACPI_PLD_GET_HORIZ_OFFSET (&Dword);
+ }
+
+ *ReturnBuffer = PldInfo;
+ return (AE_OK);
+}
+
+ACPI_EXPORT_SYMBOL (AcpiDecodePldBuffer)
diff --git a/source/components/utilities/utxferror.c b/source/components/utilities/utxferror.c
index 715c0f47f0f4..beeb7c7ce961 100644
--- a/source/components/utilities/utxferror.c
+++ b/source/components/utilities/utxferror.c
@@ -87,8 +87,8 @@ 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: "
+#define ACPI_MSG_BIOS_ERROR "ACPI BIOS Bug: Error: "
+#define ACPI_MSG_BIOS_WARNING "ACPI BIOS Bug: Warning: "
/*
* Common message suffix
diff --git a/source/components/utilities/utxfinit.c b/source/components/utilities/utxfinit.c
new file mode 100644
index 000000000000..733aa3b9bbfc
--- /dev/null
+++ b/source/components/utilities/utxfinit.c
@@ -0,0 +1,358 @@
+/******************************************************************************
+ *
+ * Module Name: utxfinit - External interfaces for ACPICA initialization
+ *
+ *****************************************************************************/
+
+/*
+ * 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 __UTXFINIT_C__
+
+#include "acpi.h"
+#include "accommon.h"
+#include "acevents.h"
+#include "acnamesp.h"
+#include "acdebug.h"
+#include "actables.h"
+
+#define _COMPONENT ACPI_UTILITIES
+ ACPI_MODULE_NAME ("utxfinit")
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiInitializeSubsystem
+ *
+ * PARAMETERS: None
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Initializes all global variables. This is the first function
+ * called, so any early initialization belongs here.
+ *
+ ******************************************************************************/
+
+ACPI_STATUS
+AcpiInitializeSubsystem (
+ void)
+{
+ ACPI_STATUS Status;
+
+
+ ACPI_FUNCTION_TRACE (AcpiInitializeSubsystem);
+
+
+ AcpiGbl_StartupFlags = ACPI_SUBSYSTEM_INITIALIZE;
+ ACPI_DEBUG_EXEC (AcpiUtInitStackPtrTrace ());
+
+ /* Initialize the OS-Dependent layer */
+
+ Status = AcpiOsInitialize ();
+ if (ACPI_FAILURE (Status))
+ {
+ ACPI_EXCEPTION ((AE_INFO, Status, "During OSL initialization"));
+ return_ACPI_STATUS (Status);
+ }
+
+ /* Initialize all globals used by the subsystem */
+
+ Status = AcpiUtInitGlobals ();
+ if (ACPI_FAILURE (Status))
+ {
+ ACPI_EXCEPTION ((AE_INFO, Status, "During initialization of globals"));
+ return_ACPI_STATUS (Status);
+ }
+
+ /* Create the default mutex objects */
+
+ Status = AcpiUtMutexInitialize ();
+ if (ACPI_FAILURE (Status))
+ {
+ ACPI_EXCEPTION ((AE_INFO, Status, "During Global Mutex creation"));
+ return_ACPI_STATUS (Status);
+ }
+
+ /*
+ * Initialize the namespace manager and
+ * the root of the namespace tree
+ */
+ Status = AcpiNsRootInitialize ();
+ if (ACPI_FAILURE (Status))
+ {
+ ACPI_EXCEPTION ((AE_INFO, Status, "During Namespace initialization"));
+ return_ACPI_STATUS (Status);
+ }
+
+ /* Initialize the global OSI interfaces list with the static names */
+
+ Status = AcpiUtInitializeInterfaces ();
+ if (ACPI_FAILURE (Status))
+ {
+ ACPI_EXCEPTION ((AE_INFO, Status, "During OSI interfaces initialization"));
+ return_ACPI_STATUS (Status);
+ }
+
+ /* If configured, initialize the AML debugger */
+
+ ACPI_DEBUGGER_EXEC (Status = AcpiDbInitialize ());
+ return_ACPI_STATUS (Status);
+}
+
+ACPI_EXPORT_SYMBOL (AcpiInitializeSubsystem)
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiEnableSubsystem
+ *
+ * PARAMETERS: Flags - Init/enable Options
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Completes the subsystem initialization including hardware.
+ * Puts system into ACPI mode if it isn't already.
+ *
+ ******************************************************************************/
+
+ACPI_STATUS
+AcpiEnableSubsystem (
+ UINT32 Flags)
+{
+ ACPI_STATUS Status = AE_OK;
+
+
+ ACPI_FUNCTION_TRACE (AcpiEnableSubsystem);
+
+
+#if (!ACPI_REDUCED_HARDWARE)
+
+ /* Enable ACPI mode */
+
+ if (!(Flags & ACPI_NO_ACPI_ENABLE))
+ {
+ ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "[Init] Going into ACPI mode\n"));
+
+ AcpiGbl_OriginalMode = AcpiHwGetMode();
+
+ Status = AcpiEnable ();
+ if (ACPI_FAILURE (Status))
+ {
+ ACPI_WARNING ((AE_INFO, "AcpiEnable failed"));
+ return_ACPI_STATUS (Status);
+ }
+ }
+
+ /*
+ * Obtain a permanent mapping for the FACS. This is required for the
+ * Global Lock and the Firmware Waking Vector
+ */
+ Status = AcpiTbInitializeFacs ();
+ if (ACPI_FAILURE (Status))
+ {
+ ACPI_WARNING ((AE_INFO, "Could not map the FACS table"));
+ return_ACPI_STATUS (Status);
+ }
+
+#endif /* !ACPI_REDUCED_HARDWARE */
+
+ /*
+ * Install the default OpRegion handlers. These are installed unless
+ * other handlers have already been installed via the
+ * InstallAddressSpaceHandler interface.
+ */
+ if (!(Flags & ACPI_NO_ADDRESS_SPACE_INIT))
+ {
+ ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
+ "[Init] Installing default address space handlers\n"));
+
+ Status = AcpiEvInstallRegionHandlers ();
+ if (ACPI_FAILURE (Status))
+ {
+ return_ACPI_STATUS (Status);
+ }
+ }
+
+#if (!ACPI_REDUCED_HARDWARE)
+ /*
+ * Initialize ACPI Event handling (Fixed and General Purpose)
+ *
+ * Note1: We must have the hardware and events initialized before we can
+ * execute any control methods safely. Any control method can require
+ * ACPI hardware support, so the hardware must be fully initialized before
+ * any method execution!
+ *
+ * Note2: Fixed events are initialized and enabled here. GPEs are
+ * initialized, but cannot be enabled until after the hardware is
+ * completely initialized (SCI and GlobalLock activated) and the various
+ * initialization control methods are run (_REG, _STA, _INI) on the
+ * entire namespace.
+ */
+ if (!(Flags & ACPI_NO_EVENT_INIT))
+ {
+ ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
+ "[Init] Initializing ACPI events\n"));
+
+ Status = AcpiEvInitializeEvents ();
+ if (ACPI_FAILURE (Status))
+ {
+ return_ACPI_STATUS (Status);
+ }
+ }
+
+ /*
+ * Install the SCI handler and Global Lock handler. This completes the
+ * hardware initialization.
+ */
+ if (!(Flags & ACPI_NO_HANDLER_INIT))
+ {
+ ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
+ "[Init] Installing SCI/GL handlers\n"));
+
+ Status = AcpiEvInstallXruptHandlers ();
+ if (ACPI_FAILURE (Status))
+ {
+ return_ACPI_STATUS (Status);
+ }
+ }
+
+#endif /* !ACPI_REDUCED_HARDWARE */
+
+ return_ACPI_STATUS (Status);
+}
+
+ACPI_EXPORT_SYMBOL (AcpiEnableSubsystem)
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiInitializeObjects
+ *
+ * PARAMETERS: Flags - Init/enable Options
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Completes namespace initialization by initializing device
+ * objects and executing AML code for Regions, buffers, etc.
+ *
+ ******************************************************************************/
+
+ACPI_STATUS
+AcpiInitializeObjects (
+ UINT32 Flags)
+{
+ ACPI_STATUS Status = AE_OK;
+
+
+ ACPI_FUNCTION_TRACE (AcpiInitializeObjects);
+
+
+ /*
+ * Run all _REG methods
+ *
+ * Note: Any objects accessed by the _REG methods will be automatically
+ * initialized, even if they contain executable AML (see the call to
+ * AcpiNsInitializeObjects below).
+ */
+ if (!(Flags & ACPI_NO_ADDRESS_SPACE_INIT))
+ {
+ ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
+ "[Init] Executing _REG OpRegion methods\n"));
+
+ Status = AcpiEvInitializeOpRegions ();
+ if (ACPI_FAILURE (Status))
+ {
+ return_ACPI_STATUS (Status);
+ }
+ }
+
+ /*
+ * Execute any module-level code that was detected during the table load
+ * phase. Although illegal since ACPI 2.0, there are many machines that
+ * contain this type of code. Each block of detected executable AML code
+ * outside of any control method is wrapped with a temporary control
+ * method object and placed on a global list. The methods on this list
+ * are executed below.
+ */
+ AcpiNsExecModuleCodeList ();
+
+ /*
+ * Initialize the objects that remain uninitialized. This runs the
+ * executable AML that may be part of the declaration of these objects:
+ * OperationRegions, BufferFields, Buffers, and Packages.
+ */
+ if (!(Flags & ACPI_NO_OBJECT_INIT))
+ {
+ ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
+ "[Init] Completing Initialization of ACPI Objects\n"));
+
+ Status = AcpiNsInitializeObjects ();
+ if (ACPI_FAILURE (Status))
+ {
+ return_ACPI_STATUS (Status);
+ }
+ }
+
+ /*
+ * Initialize all device objects in the namespace. This runs the device
+ * _STA and _INI methods.
+ */
+ if (!(Flags & ACPI_NO_DEVICE_INIT))
+ {
+ ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
+ "[Init] Initializing ACPI Devices\n"));
+
+ Status = AcpiNsInitializeDevices ();
+ if (ACPI_FAILURE (Status))
+ {
+ return_ACPI_STATUS (Status);
+ }
+ }
+
+ /*
+ * Empty the caches (delete the cached objects) on the assumption that
+ * the table load filled them up more than they will be at runtime --
+ * thus wasting non-paged memory.
+ */
+ Status = AcpiPurgeCachedObjects ();
+
+ AcpiGbl_StartupFlags |= ACPI_INITIALIZED_OK;
+ return_ACPI_STATUS (Status);
+}
+
+ACPI_EXPORT_SYMBOL (AcpiInitializeObjects)
diff --git a/source/include/acbuffer.h b/source/include/acbuffer.h
new file mode 100644
index 000000000000..4b34ccdace1a
--- /dev/null
+++ b/source/include/acbuffer.h
@@ -0,0 +1,246 @@
+/******************************************************************************
+ *
+ * Name: acbuffer.h - Support for buffers returned by ACPI predefined names
+ *
+ *****************************************************************************/
+
+/*
+ * 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.
+ */
+
+#ifndef __ACBUFFER_H__
+#define __ACBUFFER_H__
+
+/*
+ * Contains buffer structures for these predefined names:
+ * _FDE, _GRT, _GTM, _PLD, _SRT
+ */
+
+/*
+ * Note: C bitfields are not used for this reason:
+ *
+ * "Bitfields are great and easy to read, but unfortunately the C language
+ * does not specify the layout of bitfields in memory, which means they are
+ * essentially useless for dealing with packed data in on-disk formats or
+ * binary wire protocols." (Or ACPI tables and buffers.) "If you ask me,
+ * this decision was a design error in C. Ritchie could have picked an order
+ * and stuck with it." Norman Ramsey.
+ * See http://stackoverflow.com/a/1053662/41661
+ */
+
+
+/* _FDE return value */
+
+typedef struct acpi_fde_info
+{
+ UINT32 Floppy0;
+ UINT32 Floppy1;
+ UINT32 Floppy2;
+ UINT32 Floppy3;
+ UINT32 Tape;
+
+} ACPI_FDE_INFO;
+
+/*
+ * _GRT return value
+ * _SRT input value
+ */
+typedef struct acpi_grt_info
+{
+ UINT16 Year;
+ UINT8 Month;
+ UINT8 Day;
+ UINT8 Hour;
+ UINT8 Minute;
+ UINT8 Second;
+ UINT8 Valid;
+ UINT16 Milliseconds;
+ UINT16 Timezone;
+ UINT8 Daylight;
+ UINT8 Reserved[3];
+
+} ACPI_GRT_INFO;
+
+/* _GTM return value */
+
+typedef struct acpi_gtm_info
+{
+ UINT32 PioSpeed0;
+ UINT32 DmaSpeed0;
+ UINT32 PioSpeed1;
+ UINT32 DmaSpeed1;
+ UINT32 Flags;
+
+} ACPI_GTM_INFO;
+
+/*
+ * Formatted _PLD return value. The minimum size is a package containing
+ * one buffer.
+ * Revision 1: Buffer is 16 bytes (128 bits)
+ * Revision 2: Buffer is 20 bytes (160 bits)
+ *
+ * Note: This structure is returned from the AcpiDecodePldBuffer
+ * interface.
+ */
+typedef struct acpi_pld_info
+{
+ UINT8 Revision;
+ UINT8 IgnoreColor;
+ UINT32 Color;
+ UINT16 Width;
+ UINT16 Height;
+ UINT8 UserVisible;
+ UINT8 Dock;
+ UINT8 Lid;
+ UINT8 Panel;
+ UINT8 VerticalPosition;
+ UINT8 HorizontalPosition;
+ UINT8 Shape;
+ UINT8 GroupOrientation;
+ UINT8 GroupToken;
+ UINT8 GroupPosition;
+ UINT8 Bay;
+ UINT8 Ejectable;
+ UINT8 OspmEjectRequired;
+ UINT8 CabinetNumber;
+ UINT8 CardCageNumber;
+ UINT8 Reference;
+ UINT8 Rotation;
+ UINT8 Order;
+ UINT8 Reserved;
+ UINT16 VerticalOffset;
+ UINT16 HorizontalOffset;
+
+} ACPI_PLD_INFO;
+
+
+/*
+ * Macros to:
+ * 1) Convert a _PLD buffer to internal ACPI_PLD_INFO format - ACPI_PLD_GET*
+ * (Used by AcpiDecodePldBuffer)
+ * 2) Construct a _PLD buffer - ACPI_PLD_SET*
+ * (Intended for BIOS use only)
+ */
+#define ACPI_PLD_REV1_BUFFER_SIZE 16 /* For Revision 1 of the buffer (From ACPI spec) */
+#define ACPI_PLD_BUFFER_SIZE 20 /* For Revision 2 of the buffer (From ACPI spec) */
+
+/* First 32-bit dword, bits 0:32 */
+
+#define ACPI_PLD_GET_REVISION(dword) ACPI_GET_BITS (dword, 0, ACPI_7BIT_MASK)
+#define ACPI_PLD_SET_REVISION(dword,value) ACPI_SET_BITS (dword, 0, ACPI_7BIT_MASK, value) /* Offset 0, Len 7 */
+
+#define ACPI_PLD_GET_IGNORE_COLOR(dword) ACPI_GET_BITS (dword, 7, ACPI_1BIT_MASK)
+#define ACPI_PLD_SET_IGNORE_COLOR(dword,value) ACPI_SET_BITS (dword, 7, ACPI_1BIT_MASK, value) /* Offset 7, Len 1 */
+
+#define ACPI_PLD_GET_COLOR(dword) ACPI_GET_BITS (dword, 8, ACPI_24BIT_MASK)
+#define ACPI_PLD_SET_COLOR(dword,value) ACPI_SET_BITS (dword, 8, ACPI_24BIT_MASK, value) /* Offset 8, Len 24 */
+
+/* Second 32-bit dword, bits 33:63 */
+
+#define ACPI_PLD_GET_WIDTH(dword) ACPI_GET_BITS (dword, 0, ACPI_16BIT_MASK)
+#define ACPI_PLD_SET_WIDTH(dword,value) ACPI_SET_BITS (dword, 0, ACPI_16BIT_MASK, value) /* Offset 32+0=32, Len 16 */
+
+#define ACPI_PLD_GET_HEIGHT(dword) ACPI_GET_BITS (dword, 16, ACPI_16BIT_MASK)
+#define ACPI_PLD_SET_HEIGHT(dword,value) ACPI_SET_BITS (dword, 16, ACPI_16BIT_MASK, value) /* Offset 32+16=48, Len 16 */
+
+/* Third 32-bit dword, bits 64:95 */
+
+#define ACPI_PLD_GET_USER_VISIBLE(dword) ACPI_GET_BITS (dword, 0, ACPI_1BIT_MASK)
+#define ACPI_PLD_SET_USER_VISIBLE(dword,value) ACPI_SET_BITS (dword, 0, ACPI_1BIT_MASK, value) /* Offset 64+0=64, Len 1 */
+
+#define ACPI_PLD_GET_DOCK(dword) ACPI_GET_BITS (dword, 1, ACPI_1BIT_MASK)
+#define ACPI_PLD_SET_DOCK(dword,value) ACPI_SET_BITS (dword, 1, ACPI_1BIT_MASK, value) /* Offset 64+1=65, Len 1 */
+
+#define ACPI_PLD_GET_LID(dword) ACPI_GET_BITS (dword, 2, ACPI_1BIT_MASK)
+#define ACPI_PLD_SET_LID(dword,value) ACPI_SET_BITS (dword, 2, ACPI_1BIT_MASK, value) /* Offset 64+2=66, Len 1 */
+
+#define ACPI_PLD_GET_PANEL(dword) ACPI_GET_BITS (dword, 3, ACPI_3BIT_MASK)
+#define ACPI_PLD_SET_PANEL(dword,value) ACPI_SET_BITS (dword, 3, ACPI_3BIT_MASK, value) /* Offset 64+3=67, Len 3 */
+
+#define ACPI_PLD_GET_VERTICAL(dword) ACPI_GET_BITS (dword, 6, ACPI_2BIT_MASK)
+#define ACPI_PLD_SET_VERTICAL(dword,value) ACPI_SET_BITS (dword, 6, ACPI_2BIT_MASK, value) /* Offset 64+6=70, Len 2 */
+
+#define ACPI_PLD_GET_HORIZONTAL(dword) ACPI_GET_BITS (dword, 8, ACPI_2BIT_MASK)
+#define ACPI_PLD_SET_HORIZONTAL(dword,value) ACPI_SET_BITS (dword, 8, ACPI_2BIT_MASK, value) /* Offset 64+8=72, Len 2 */
+
+#define ACPI_PLD_GET_SHAPE(dword) ACPI_GET_BITS (dword, 10, ACPI_4BIT_MASK)
+#define ACPI_PLD_SET_SHAPE(dword,value) ACPI_SET_BITS (dword, 10, ACPI_4BIT_MASK, value) /* Offset 64+10=74, Len 4 */
+
+#define ACPI_PLD_GET_ORIENTATION(dword) ACPI_GET_BITS (dword, 14, ACPI_1BIT_MASK)
+#define ACPI_PLD_SET_ORIENTATION(dword,value) ACPI_SET_BITS (dword, 14, ACPI_1BIT_MASK, value) /* Offset 64+14=78, Len 1 */
+
+#define ACPI_PLD_GET_TOKEN(dword) ACPI_GET_BITS (dword, 15, ACPI_8BIT_MASK)
+#define ACPI_PLD_SET_TOKEN(dword,value) ACPI_SET_BITS (dword, 15, ACPI_8BIT_MASK, value) /* Offset 64+15=79, Len 8 */
+
+#define ACPI_PLD_GET_POSITION(dword) ACPI_GET_BITS (dword, 23, ACPI_8BIT_MASK)
+#define ACPI_PLD_SET_POSITION(dword,value) ACPI_SET_BITS (dword, 23, ACPI_8BIT_MASK, value) /* Offset 64+23=87, Len 8 */
+
+#define ACPI_PLD_GET_BAY(dword) ACPI_GET_BITS (dword, 31, ACPI_1BIT_MASK)
+#define ACPI_PLD_SET_BAY(dword,value) ACPI_SET_BITS (dword, 31, ACPI_1BIT_MASK, value) /* Offset 64+31=95, Len 1 */
+
+/* Fourth 32-bit dword, bits 96:127 */
+
+#define ACPI_PLD_GET_EJECTABLE(dword) ACPI_GET_BITS (dword, 0, ACPI_1BIT_MASK)
+#define ACPI_PLD_SET_EJECTABLE(dword,value) ACPI_SET_BITS (dword, 0, ACPI_1BIT_MASK, value) /* Offset 96+0=96, Len 1 */
+
+#define ACPI_PLD_GET_OSPM_EJECT(dword) ACPI_GET_BITS (dword, 1, ACPI_1BIT_MASK)
+#define ACPI_PLD_SET_OSPM_EJECT(dword,value) ACPI_SET_BITS (dword, 1, ACPI_1BIT_MASK, value) /* Offset 96+1=97, Len 1 */
+
+#define ACPI_PLD_GET_CABINET(dword) ACPI_GET_BITS (dword, 2, ACPI_8BIT_MASK)
+#define ACPI_PLD_SET_CABINET(dword,value) ACPI_SET_BITS (dword, 2, ACPI_8BIT_MASK, value) /* Offset 96+2=98, Len 8 */
+
+#define ACPI_PLD_GET_CARD_CAGE(dword) ACPI_GET_BITS (dword, 10, ACPI_8BIT_MASK)
+#define ACPI_PLD_SET_CARD_CAGE(dword,value) ACPI_SET_BITS (dword, 10, ACPI_8BIT_MASK, value) /* Offset 96+10=106, Len 8 */
+
+#define ACPI_PLD_GET_REFERENCE(dword) ACPI_GET_BITS (dword, 18, ACPI_1BIT_MASK)
+#define ACPI_PLD_SET_REFERENCE(dword,value) ACPI_SET_BITS (dword, 18, ACPI_1BIT_MASK, value) /* Offset 96+18=114, Len 1 */
+
+#define ACPI_PLD_GET_ROTATION(dword) ACPI_GET_BITS (dword, 19, ACPI_4BIT_MASK)
+#define ACPI_PLD_SET_ROTATION(dword,value) ACPI_SET_BITS (dword, 19, ACPI_4BIT_MASK, value) /* Offset 96+19=115, Len 4 */
+
+#define ACPI_PLD_GET_ORDER(dword) ACPI_GET_BITS (dword, 23, ACPI_5BIT_MASK)
+#define ACPI_PLD_SET_ORDER(dword,value) ACPI_SET_BITS (dword, 23, ACPI_5BIT_MASK, value) /* Offset 96+23=119, Len 5 */
+
+/* Fifth 32-bit dword, bits 128:159 (Revision 2 of _PLD only) */
+
+#define ACPI_PLD_GET_VERT_OFFSET(dword) ACPI_GET_BITS (dword, 0, ACPI_16BIT_MASK)
+#define ACPI_PLD_SET_VERT_OFFSET(dword,value) ACPI_SET_BITS (dword, 0, ACPI_16BIT_MASK, value) /* Offset 128+0=128, Len 16 */
+
+#define ACPI_PLD_GET_HORIZ_OFFSET(dword) ACPI_GET_BITS (dword, 16, ACPI_16BIT_MASK)
+#define ACPI_PLD_SET_HORIZ_OFFSET(dword,value) ACPI_SET_BITS (dword, 16, ACPI_16BIT_MASK, value) /* Offset 128+16=144, Len 16 */
+
+
+#endif /* ACBUFFER_H */
diff --git a/source/include/acdisasm.h b/source/include/acdisasm.h
index e5c5c11f0cbc..bb66fbbf2a21 100644
--- a/source/include/acdisasm.h
+++ b/source/include/acdisasm.h
@@ -235,6 +235,13 @@ extern ACPI_DMTABLE_INFO AcpiDmTableInfoBert[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoBgrt[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoCpep[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoCpep0[];
+extern ACPI_DMTABLE_INFO AcpiDmTableInfoCsrt0[];
+extern ACPI_DMTABLE_INFO AcpiDmTableInfoCsrt1[];
+extern ACPI_DMTABLE_INFO AcpiDmTableInfoDbg2[];
+extern ACPI_DMTABLE_INFO AcpiDmTableInfoDbg2Device[];
+extern ACPI_DMTABLE_INFO AcpiDmTableInfoDbg2Addr[];
+extern ACPI_DMTABLE_INFO AcpiDmTableInfoDbg2Size[];
+extern ACPI_DMTABLE_INFO AcpiDmTableInfoDbg2Name[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoDbgp[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoDmar[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoDmarHdr[];
@@ -396,6 +403,14 @@ AcpiDmDumpCpep (
ACPI_TABLE_HEADER *Table);
void
+AcpiDmDumpCsrt (
+ ACPI_TABLE_HEADER *Table);
+
+void
+AcpiDmDumpDbg2 (
+ ACPI_TABLE_HEADER *Table);
+
+void
AcpiDmDumpDmar (
ACPI_TABLE_HEADER *Table);
@@ -613,6 +628,10 @@ BOOLEAN
AcpiDmIsStringBuffer (
ACPI_PARSE_OBJECT *Op);
+BOOLEAN
+AcpiDmIsPldBuffer (
+ ACPI_PARSE_OBJECT *Op);
+
/*
* dmextern
diff --git a/source/include/achware.h b/source/include/achware.h
index f607d1702ac3..6dc11913eaf8 100644
--- a/source/include/achware.h
+++ b/source/include/achware.h
@@ -114,18 +114,15 @@ AcpiHwClearAcpiStatus (
*/
ACPI_STATUS
AcpiHwLegacySleep (
- UINT8 SleepState,
- UINT8 Flags);
+ UINT8 SleepState);
ACPI_STATUS
AcpiHwLegacyWakePrep (
- UINT8 SleepState,
- UINT8 Flags);
+ UINT8 SleepState);
ACPI_STATUS
AcpiHwLegacyWake (
- UINT8 SleepState,
- UINT8 Flags);
+ UINT8 SleepState);
/*
@@ -138,18 +135,15 @@ AcpiHwExecuteSleepMethod (
ACPI_STATUS
AcpiHwExtendedSleep (
- UINT8 SleepState,
- UINT8 Flags);
+ UINT8 SleepState);
ACPI_STATUS
AcpiHwExtendedWakePrep (
- UINT8 SleepState,
- UINT8 Flags);
+ UINT8 SleepState);
ACPI_STATUS
AcpiHwExtendedWake (
- UINT8 SleepState,
- UINT8 Flags);
+ UINT8 SleepState);
/*
@@ -173,8 +167,7 @@ AcpiHwWritePort (
*/
UINT32
AcpiHwGetGpeRegisterBit (
- ACPI_GPE_EVENT_INFO *GpeEventInfo,
- ACPI_GPE_REGISTER_INFO *GpeRegisterInfo);
+ ACPI_GPE_EVENT_INFO *GpeEventInfo);
ACPI_STATUS
AcpiHwLowSetGpe (
diff --git a/source/include/aclocal.h b/source/include/aclocal.h
index 0f79fa2a00b2..8a3514772f9c 100644
--- a/source/include/aclocal.h
+++ b/source/include/aclocal.h
@@ -857,15 +857,18 @@ typedef union acpi_parse_value
char AmlOpName[16]) /* Op name (debug only) */
-#define ACPI_DASM_BUFFER 0x00
-#define ACPI_DASM_RESOURCE 0x01
-#define ACPI_DASM_STRING 0x02
-#define ACPI_DASM_UNICODE 0x03
-#define ACPI_DASM_EISAID 0x04
-#define ACPI_DASM_MATCHOP 0x05
-#define ACPI_DASM_LNOT_PREFIX 0x06
-#define ACPI_DASM_LNOT_SUFFIX 0x07
-#define ACPI_DASM_IGNORE 0x08
+/* Flags for DisasmFlags field above */
+
+#define ACPI_DASM_BUFFER 0x00 /* Buffer is a simple data buffer */
+#define ACPI_DASM_RESOURCE 0x01 /* Buffer is a Resource Descriptor */
+#define ACPI_DASM_STRING 0x02 /* Buffer is a ASCII string */
+#define ACPI_DASM_UNICODE 0x03 /* Buffer is a Unicode string */
+#define ACPI_DASM_PLD_METHOD 0x04 /* Buffer is a _PLD method bit-packed buffer */
+#define ACPI_DASM_EISAID 0x05 /* Integer is an EISAID */
+#define ACPI_DASM_MATCHOP 0x06 /* Parent opcode is a Match() operator */
+#define ACPI_DASM_LNOT_PREFIX 0x07 /* Start of a LNotEqual (etc.) pair of opcodes */
+#define ACPI_DASM_LNOT_SUFFIX 0x08 /* End of a LNotEqual (etc.) pair of opcodes */
+#define ACPI_DASM_IGNORE 0x09 /* Not used at this time */
/*
* Generic operation (for example: If, While, Store)
@@ -1105,6 +1108,7 @@ typedef struct acpi_bit_register_info
#define ACPI_OSI_WIN_VISTA_SP1 0x09
#define ACPI_OSI_WIN_VISTA_SP2 0x0A
#define ACPI_OSI_WIN_7 0x0B
+#define ACPI_OSI_WIN_8 0x0C
#define ACPI_ALWAYS_ILLEGAL 0x00
@@ -1237,6 +1241,7 @@ typedef struct acpi_external_file
typedef struct acpi_db_method_info
{
+ ACPI_HANDLE Method;
ACPI_HANDLE MainThreadGate;
ACPI_HANDLE ThreadCompleteGate;
ACPI_HANDLE InfoGate;
diff --git a/source/include/acmacros.h b/source/include/acmacros.h
index 591bb6bf1a58..92cd7a25e800 100644
--- a/source/include/acmacros.h
+++ b/source/include/acmacros.h
@@ -268,10 +268,33 @@
/* Bitfields within ACPI registers */
-#define ACPI_REGISTER_PREPARE_BITS(Val, Pos, Mask) ((Val << Pos) & Mask)
-#define ACPI_REGISTER_INSERT_VALUE(Reg, Pos, Mask, Val) Reg = (Reg & (~(Mask))) | ACPI_REGISTER_PREPARE_BITS(Val, Pos, Mask)
+#define ACPI_REGISTER_PREPARE_BITS(Val, Pos, Mask) \
+ ((Val << Pos) & Mask)
-#define ACPI_INSERT_BITS(Target, Mask, Source) Target = ((Target & (~(Mask))) | (Source & Mask))
+#define ACPI_REGISTER_INSERT_VALUE(Reg, Pos, Mask, Val) \
+ Reg = (Reg & (~(Mask))) | ACPI_REGISTER_PREPARE_BITS(Val, Pos, Mask)
+
+#define ACPI_INSERT_BITS(Target, Mask, Source) \
+ Target = ((Target & (~(Mask))) | (Source & Mask))
+
+/* Generic bitfield macros and masks */
+
+#define ACPI_GET_BITS(SourcePtr, Position, Mask) \
+ ((*SourcePtr >> Position) & Mask)
+
+#define ACPI_SET_BITS(TargetPtr, Position, Mask, Value) \
+ (*TargetPtr |= ((Value & Mask) << Position))
+
+#define ACPI_1BIT_MASK 0x00000001
+#define ACPI_2BIT_MASK 0x00000003
+#define ACPI_3BIT_MASK 0x00000007
+#define ACPI_4BIT_MASK 0x0000000F
+#define ACPI_5BIT_MASK 0x0000001F
+#define ACPI_6BIT_MASK 0x0000003F
+#define ACPI_7BIT_MASK 0x0000007F
+#define ACPI_8BIT_MASK 0x000000FF
+#define ACPI_16BIT_MASK 0x0000FFFF
+#define ACPI_24BIT_MASK 0x00FFFFFF
/*
* An object of type ACPI_NAMESPACE_NODE can appear in some contexts
diff --git a/source/include/acnames.h b/source/include/acnames.h
index 4c5fab696f15..e56f3cdf93d9 100644
--- a/source/include/acnames.h
+++ b/source/include/acnames.h
@@ -62,11 +62,10 @@
#define METHOD_NAME__AEI "_AEI"
#define METHOD_NAME__PRW "_PRW"
#define METHOD_NAME__SRS "_SRS"
+#define METHOD_NAME__PLD "_PLD"
/* Method names - these methods must appear at the namespace root */
-#define METHOD_PATHNAME__BFS "\\_BFS"
-#define METHOD_PATHNAME__GTS "\\_GTS"
#define METHOD_PATHNAME__PTS "\\_PTS"
#define METHOD_PATHNAME__SST "\\_SI._SST"
#define METHOD_PATHNAME__WAK "\\_WAK"
diff --git a/source/include/acpixf.h b/source/include/acpixf.h
index 9c5aa4f6dd5b..cdec63a337bd 100644
--- a/source/include/acpixf.h
+++ b/source/include/acpixf.h
@@ -48,11 +48,12 @@
/* Current ACPICA subsystem version in YYYYMMDD format */
-#define ACPI_CA_VERSION 0x20120711
+#define ACPI_CA_VERSION 0x20120816
#include "acconfig.h"
#include "actypes.h"
#include "actbl.h"
+#include "acbuffer.h"
/*
* Globals that are publically available
@@ -183,6 +184,11 @@ AcpiCheckAddressRange (
ACPI_SIZE Length,
BOOLEAN Warn);
+ACPI_STATUS
+AcpiDecodePldBuffer (
+ UINT8 *InBuffer,
+ ACPI_SIZE Length,
+ ACPI_PLD_INFO **ReturnBuffer);
/*
* ACPI Memory management
@@ -686,8 +692,7 @@ AcpiEnterSleepStatePrep (
ACPI_STATUS
AcpiEnterSleepState (
- UINT8 SleepState,
- UINT8 Flags);
+ UINT8 SleepState);
ACPI_HW_DEPENDENT_RETURN_STATUS (
ACPI_STATUS
@@ -696,8 +701,7 @@ AcpiEnterSleepStateS4bios (
ACPI_STATUS
AcpiLeaveSleepStatePrep (
- UINT8 SleepState,
- UINT8 Flags);
+ UINT8 SleepState);
ACPI_STATUS
AcpiLeaveSleepState (
diff --git a/source/include/actbl.h b/source/include/actbl.h
index 7da7378d140c..4389d307afde 100644
--- a/source/include/actbl.h
+++ b/source/include/actbl.h
@@ -82,9 +82,15 @@
#pragma pack(1)
/*
- * Note about bitfields: The UINT8 type is used for bitfields in ACPI tables.
- * This is the only type that is even remotely portable. Anything else is not
- * portable, so do not use any other bitfield types.
+ * Note: C bitfields are not used for this reason:
+ *
+ * "Bitfields are great and easy to read, but unfortunately the C language
+ * does not specify the layout of bitfields in memory, which means they are
+ * essentially useless for dealing with packed data in on-disk formats or
+ * binary wire protocols." (Or ACPI tables and buffers.) "If you ask me,
+ * this decision was a design error in C. Ritchie could have picked an order
+ * and stuck with it." Norman Ramsey.
+ * See http://stackoverflow.com/a/1053662/41661
*/
@@ -99,7 +105,7 @@ typedef struct acpi_table_header
{
char Signature[ACPI_NAME_SIZE]; /* ASCII table signature */
UINT32 Length; /* Length of table in bytes, including this header */
- UINT8 Revision; /* ACPI Specification minor version # */
+ UINT8 Revision; /* ACPI Specification minor version number */
UINT8 Checksum; /* To make sum of entire table == 0 */
char OemId[ACPI_OEM_ID_SIZE]; /* ASCII OEM identification */
char OemTableId[ACPI_OEM_TABLE_ID_SIZE]; /* ASCII OEM table identification */
@@ -115,7 +121,7 @@ typedef struct acpi_table_header
* GAS - Generic Address Structure (ACPI 2.0+)
*
* Note: Since this structure is used in the ACPI tables, it is byte aligned.
- * If misaliged access is not supported by the hardware, accesses to the
+ * If misaligned access is not supported by the hardware, accesses to the
* 64-bit Address field must be performed with care.
*
******************************************************************************/
@@ -253,18 +259,18 @@ typedef struct acpi_table_fadt
UINT8 PreferredProfile; /* Conveys preferred power management profile to OSPM. */
UINT16 SciInterrupt; /* System vector of SCI interrupt */
UINT32 SmiCommand; /* 32-bit Port address of SMI command port */
- UINT8 AcpiEnable; /* Value to write to smi_cmd to enable ACPI */
- UINT8 AcpiDisable; /* Value to write to smi_cmd to disable ACPI */
- UINT8 S4BiosRequest; /* Value to write to SMI CMD to enter S4BIOS state */
+ UINT8 AcpiEnable; /* Value to write to SMI_CMD to enable ACPI */
+ UINT8 AcpiDisable; /* Value to write to SMI_CMD to disable ACPI */
+ UINT8 S4BiosRequest; /* Value to write to SMI_CMD to enter S4BIOS state */
UINT8 PstateControl; /* Processor performance state control*/
- UINT32 Pm1aEventBlock; /* 32-bit Port address of Power Mgt 1a Event Reg Blk */
- UINT32 Pm1bEventBlock; /* 32-bit Port address of Power Mgt 1b Event Reg Blk */
- UINT32 Pm1aControlBlock; /* 32-bit Port address of Power Mgt 1a Control Reg Blk */
- UINT32 Pm1bControlBlock; /* 32-bit Port address of Power Mgt 1b Control Reg Blk */
- UINT32 Pm2ControlBlock; /* 32-bit Port address of Power Mgt 2 Control Reg Blk */
- UINT32 PmTimerBlock; /* 32-bit Port address of Power Mgt Timer Ctrl Reg Blk */
- UINT32 Gpe0Block; /* 32-bit Port address of General Purpose Event 0 Reg Blk */
- UINT32 Gpe1Block; /* 32-bit Port address of General Purpose Event 1 Reg Blk */
+ UINT32 Pm1aEventBlock; /* 32-bit port address of Power Mgt 1a Event Reg Blk */
+ UINT32 Pm1bEventBlock; /* 32-bit port address of Power Mgt 1b Event Reg Blk */
+ UINT32 Pm1aControlBlock; /* 32-bit port address of Power Mgt 1a Control Reg Blk */
+ UINT32 Pm1bControlBlock; /* 32-bit port address of Power Mgt 1b Control Reg Blk */
+ UINT32 Pm2ControlBlock; /* 32-bit port address of Power Mgt 2 Control Reg Blk */
+ UINT32 PmTimerBlock; /* 32-bit port address of Power Mgt Timer Ctrl Reg Blk */
+ UINT32 Gpe0Block; /* 32-bit port address of General Purpose Event 0 Reg Blk */
+ UINT32 Gpe1Block; /* 32-bit port address of General Purpose Event 1 Reg Blk */
UINT8 Pm1EventLength; /* Byte Length of ports at Pm1xEventBlock */
UINT8 Pm1ControlLength; /* Byte Length of ports at Pm1xControlBlock */
UINT8 Pm2ControlLength; /* Byte Length of ports at Pm2ControlBlock */
@@ -272,12 +278,12 @@ typedef struct acpi_table_fadt
UINT8 Gpe0BlockLength; /* Byte Length of ports at Gpe0Block */
UINT8 Gpe1BlockLength; /* Byte Length of ports at Gpe1Block */
UINT8 Gpe1Base; /* Offset in GPE number space where GPE1 events start */
- UINT8 CstControl; /* Support for the _CST object and C States change notification */
+ UINT8 CstControl; /* Support for the _CST object and C-States change notification */
UINT16 C2Latency; /* Worst case HW latency to enter/exit C2 state */
UINT16 C3Latency; /* Worst case HW latency to enter/exit C3 state */
- UINT16 FlushSize; /* Processor's memory cache line width, in bytes */
+ UINT16 FlushSize; /* Processor memory cache line width, in bytes */
UINT16 FlushStride; /* Number of flush strides that need to be read */
- UINT8 DutyOffset; /* Processor duty cycle index in processor's P_CNT reg */
+ UINT8 DutyOffset; /* Processor duty cycle index in processor P_CNT reg */
UINT8 DutyWidth; /* Processor duty cycle value bit width in P_CNT register */
UINT8 DayAlarm; /* Index to day-of-month alarm in RTC CMOS RAM */
UINT8 MonthAlarm; /* Index to month-of-year alarm in RTC CMOS RAM */
@@ -298,13 +304,13 @@ typedef struct acpi_table_fadt
ACPI_GENERIC_ADDRESS XPmTimerBlock; /* 64-bit Extended Power Mgt Timer Ctrl Reg Blk address */
ACPI_GENERIC_ADDRESS XGpe0Block; /* 64-bit Extended General Purpose Event 0 Reg Blk address */
ACPI_GENERIC_ADDRESS XGpe1Block; /* 64-bit Extended General Purpose Event 1 Reg Blk address */
- ACPI_GENERIC_ADDRESS SleepControl; /* 64-bit Sleep Control register */
- ACPI_GENERIC_ADDRESS SleepStatus; /* 64-bit Sleep Status register */
+ ACPI_GENERIC_ADDRESS SleepControl; /* 64-bit Sleep Control register (ACPI 5.0) */
+ ACPI_GENERIC_ADDRESS SleepStatus; /* 64-bit Sleep Status register (ACPI 5.0) */
} ACPI_TABLE_FADT;
-/* Masks for FADT Boot Architecture Flags (BootFlags) */
+/* Masks for FADT Boot Architecture Flags (BootFlags) [Vx]=Introduced in this FADT revision */
#define ACPI_FADT_LEGACY_DEVICES (1) /* 00: [V2] System has LPC or ISA bus devices */
#define ACPI_FADT_8042 (1<<1) /* 01: [V3] System has an 8042 controller on port 60/64 */
@@ -315,13 +321,13 @@ typedef struct acpi_table_fadt
/* Masks for FADT flags */
-#define ACPI_FADT_WBINVD (1) /* 00: [V1] The wbinvd instruction works properly */
-#define ACPI_FADT_WBINVD_FLUSH (1<<1) /* 01: [V1] wbinvd flushes but does not invalidate caches */
+#define ACPI_FADT_WBINVD (1) /* 00: [V1] The WBINVD instruction works properly */
+#define ACPI_FADT_WBINVD_FLUSH (1<<1) /* 01: [V1] WBINVD flushes but does not invalidate caches */
#define ACPI_FADT_C1_SUPPORTED (1<<2) /* 02: [V1] All processors support C1 state */
#define ACPI_FADT_C2_MP_SUPPORTED (1<<3) /* 03: [V1] C2 state works on MP system */
#define ACPI_FADT_POWER_BUTTON (1<<4) /* 04: [V1] Power button is handled as a control method device */
#define ACPI_FADT_SLEEP_BUTTON (1<<5) /* 05: [V1] Sleep button is handled as a control method device */
-#define ACPI_FADT_FIXED_RTC (1<<6) /* 06: [V1] RTC wakeup status not in fixed register space */
+#define ACPI_FADT_FIXED_RTC (1<<6) /* 06: [V1] RTC wakeup status is not in fixed register space */
#define ACPI_FADT_S4_RTC_WAKE (1<<7) /* 07: [V1] RTC alarm can wake system from S4 */
#define ACPI_FADT_32BIT_TIMER (1<<8) /* 08: [V1] ACPI timer width is 32-bit (0=24-bit) */
#define ACPI_FADT_DOCKING_SUPPORTED (1<<9) /* 09: [V1] Docking supported */
@@ -339,9 +345,9 @@ typedef struct acpi_table_fadt
#define ACPI_FADT_LOW_POWER_S0 (1<<21) /* 21: [V5] S0 power savings are equal or better than S3 (ACPI 5.0) */
-/* Values for PreferredProfile (Prefered Power Management Profiles) */
+/* Values for PreferredProfile (Preferred Power Management Profiles) */
-enum AcpiPreferedPmProfiles
+enum AcpiPreferredPmProfiles
{
PM_UNSPECIFIED = 0,
PM_DESKTOP = 1,
@@ -384,7 +390,7 @@ typedef struct acpi_table_desc
{
ACPI_PHYSICAL_ADDRESS Address;
ACPI_TABLE_HEADER *Pointer;
- UINT32 Length; /* Length fixed at 32 bits */
+ UINT32 Length; /* Length fixed at 32 bits (fixed in table header) */
ACPI_NAME_UNION Signature;
ACPI_OWNER_ID OwnerId;
UINT8 Flags;
diff --git a/source/include/actbl1.h b/source/include/actbl1.h
index c24178f9c409..c95d0c944e3d 100644
--- a/source/include/actbl1.h
+++ b/source/include/actbl1.h
@@ -82,9 +82,15 @@
#pragma pack(1)
/*
- * Note about bitfields: The UINT8 type is used for bitfields in ACPI tables.
- * This is the only type that is even remotely portable. Anything else is not
- * portable, so do not use any other bitfield types.
+ * Note: C bitfields are not used for this reason:
+ *
+ * "Bitfields are great and easy to read, but unfortunately the C language
+ * does not specify the layout of bitfields in memory, which means they are
+ * essentially useless for dealing with packed data in on-disk formats or
+ * binary wire protocols." (Or ACPI tables and buffers.) "If you ask me,
+ * this decision was a design error in C. Ritchie could have picked an order
+ * and stuck with it." Norman Ramsey.
+ * See http://stackoverflow.com/a/1053662/41661
*/
diff --git a/source/include/actbl2.h b/source/include/actbl2.h
index 70c6a09a3c3f..44f7de321b58 100644
--- a/source/include/actbl2.h
+++ b/source/include/actbl2.h
@@ -65,6 +65,8 @@
*/
#define ACPI_SIG_ASF "ASF!" /* Alert Standard Format table */
#define ACPI_SIG_BOOT "BOOT" /* Simple Boot Flag Table */
+#define ACPI_SIG_CSRT "CSRT" /* Core System Resource Table */
+#define ACPI_SIG_DBG2 "DBG2" /* Debug Port table type 2 */
#define ACPI_SIG_DBGP "DBGP" /* Debug Port table */
#define ACPI_SIG_DMAR "DMAR" /* DMA Remapping table */
#define ACPI_SIG_HPET "HPET" /* High Precision Event Timer table */
@@ -98,9 +100,15 @@
#pragma pack(1)
/*
- * Note about bitfields: The UINT8 type is used for bitfields in ACPI tables.
- * This is the only type that is even remotely portable. Anything else is not
- * portable, so do not use any other bitfield types.
+ * Note: C bitfields are not used for this reason:
+ *
+ * "Bitfields are great and easy to read, but unfortunately the C language
+ * does not specify the layout of bitfields in memory, which means they are
+ * essentially useless for dealing with packed data in on-disk formats or
+ * binary wire protocols." (Or ACPI tables and buffers.) "If you ask me,
+ * this decision was a design error in C. Ritchie could have picked an order
+ * and stuck with it." Norman Ramsey.
+ * See http://stackoverflow.com/a/1053662/41661
*/
@@ -264,6 +272,128 @@ typedef struct acpi_table_boot
/*******************************************************************************
*
+ * CSRT - Core System Resource Table
+ * Version 0
+ *
+ * Conforms to the "Core System Resource Table (CSRT)", November 14, 2011
+ *
+ ******************************************************************************/
+
+typedef struct acpi_table_csrt
+{
+ ACPI_TABLE_HEADER Header; /* Common ACPI table header */
+
+} ACPI_TABLE_CSRT;
+
+/* Resource Group subtable */
+
+typedef struct acpi_csrt_group
+{
+ UINT32 Length;
+ UINT32 VendorId;
+ UINT32 SubvendorId;
+ UINT16 DeviceId;
+ UINT16 SubdeviceId;
+ UINT16 Revision;
+ UINT16 Reserved;
+ UINT32 InfoLength;
+
+ /* Shared data (length = InfoLength) immediately follows */
+
+} ACPI_CSRT_GROUP;
+
+/* Resource Descriptor subtable */
+
+typedef struct acpi_csrt_descriptor
+{
+ UINT32 Length;
+ UINT16 Type;
+ UINT16 Subtype;
+ UINT32 Uid;
+
+ /* Resource-specific information immediately follows */
+
+} ACPI_CSRT_DESCRIPTOR;
+
+
+/* Resource Types */
+
+#define ACPI_CSRT_TYPE_INTERRUPT 0x0001
+#define ACPI_CSRT_TYPE_TIMER 0x0002
+#define ACPI_CSRT_TYPE_DMA 0x0003
+
+/* Resource Subtypes */
+
+#define ACPI_CSRT_XRUPT_LINE 0x0000
+#define ACPI_CSRT_XRUPT_CONTROLLER 0x0001
+#define ACPI_CSRT_TIMER 0x0000
+#define ACPI_CSRT_DMA_CHANNEL 0x0000
+#define ACPI_CSRT_DMA_CONTROLLER 0x0001
+
+
+/*******************************************************************************
+ *
+ * DBG2 - Debug Port Table 2
+ * Version 0 (Both main table and subtables)
+ *
+ * Conforms to "Microsoft Debug Port Table 2 (DBG2)", May 22 2012.
+ *
+ ******************************************************************************/
+
+typedef struct acpi_table_dbg2
+{
+ ACPI_TABLE_HEADER Header; /* Common ACPI table header */
+ UINT32 InfoOffset;
+ UINT32 InfoCount;
+
+} ACPI_TABLE_DBG2;
+
+
+/* Debug Device Information Subtable */
+
+typedef struct acpi_dbg2_device
+{
+ UINT8 Revision;
+ UINT16 Length;
+ UINT8 RegisterCount; /* Number of BaseAddress registers */
+ UINT16 NamepathLength;
+ UINT16 NamepathOffset;
+ UINT16 OemDataLength;
+ UINT16 OemDataOffset;
+ UINT16 PortType;
+ UINT16 PortSubtype;
+ UINT16 Reserved;
+ UINT16 BaseAddressOffset;
+ UINT16 AddressSizeOffset;
+ /*
+ * Data that follows:
+ * BaseAddress (required) - Each in 12-byte Generic Address Structure format.
+ * AddressSize (required) - Array of UINT32 sizes corresponding to each BaseAddress register.
+ * Namepath (required) - Null terminated string. Single dot if not supported.
+ * OemData (optional) - Length is OemDataLength.
+ */
+} ACPI_DBG2_DEVICE;
+
+/* Types for PortType field above */
+
+#define ACPI_DBG2_SERIAL_PORT 0x8000
+#define ACPI_DBG2_1394_PORT 0x8001
+#define ACPI_DBG2_USB_PORT 0x8002
+#define ACPI_DBG2_NET_PORT 0x8003
+
+/* Subtypes for PortSubtype field above */
+
+#define ACPI_DBG2_16550_COMPATIBLE 0x0000
+#define ACPI_DBG2_16550_SUBSET 0x0001
+
+#define ACPI_DBG2_1394_STANDARD 0x0000
+
+#define ACPI_DBG2_USB_XHCI 0x0000
+#define ACPI_DBG2_USB_EHCI 0x0001
+
+
+/*******************************************************************************
+ *
* DBGP - Debug Port table
* Version 1
*
diff --git a/source/include/actbl3.h b/source/include/actbl3.h
index c5dd4184dd51..ce0b1581bfe4 100644
--- a/source/include/actbl3.h
+++ b/source/include/actbl3.h
@@ -77,7 +77,6 @@
/* Reserved table signatures */
#define ACPI_SIG_CSRT "CSRT" /* Core System Resources Table */
-#define ACPI_SIG_DBG2 "DBG2" /* Debug Port table 2 */
#define ACPI_SIG_MATR "MATR" /* Memory Address Translation Table */
#define ACPI_SIG_MSDM "MSDM" /* Microsoft Data Management Table */
#define ACPI_SIG_WPBT "WPBT" /* Windows Platform Binary Table */
@@ -89,9 +88,15 @@
#pragma pack(1)
/*
- * Note about bitfields: The UINT8 type is used for bitfields in ACPI tables.
- * This is the only type that is even remotely portable. Anything else is not
- * portable, so do not use any other bitfield types.
+ * Note: C bitfields are not used for this reason:
+ *
+ * "Bitfields are great and easy to read, but unfortunately the C language
+ * does not specify the layout of bitfields in memory, which means they are
+ * essentially useless for dealing with packed data in on-disk formats or
+ * binary wire protocols." (Or ACPI tables and buffers.) "If you ask me,
+ * this decision was a design error in C. Ritchie could have picked an order
+ * and stuck with it." Norman Ramsey.
+ * See http://stackoverflow.com/a/1053662/41661
*/
diff --git a/source/include/actypes.h b/source/include/actypes.h
index 53ebc91b0863..eef510acd484 100644
--- a/source/include/actypes.h
+++ b/source/include/actypes.h
@@ -520,13 +520,6 @@ typedef UINT64 ACPI_INTEGER;
#define ACPI_SLEEP_TYPE_INVALID 0xFF
/*
- * Sleep/Wake flags
- */
-#define ACPI_NO_OPTIONAL_METHODS 0x00 /* Do not execute any optional methods */
-#define ACPI_EXECUTE_GTS 0x01 /* For enter sleep interface */
-#define ACPI_EXECUTE_BFS 0x02 /* For leave sleep prep interface */
-
-/*
* Standard notify values
*/
#define ACPI_NOTIFY_BUS_CHECK (UINT8) 0x00
@@ -809,8 +802,7 @@ typedef UINT8 ACPI_ADR_SPACE_TYPE;
/* Sleep function dispatch */
typedef ACPI_STATUS (*ACPI_SLEEP_FUNCTION) (
- UINT8 SleepState,
- UINT8 Flags);
+ UINT8 SleepState);
typedef struct acpi_sleep_functions
{
diff --git a/source/include/platform/acenv.h b/source/include/platform/acenv.h
index db270626c7f2..8dfc143f8976 100644
--- a/source/include/platform/acenv.h
+++ b/source/include/platform/acenv.h
@@ -180,6 +180,9 @@
#elif defined(_AED_EFI)
#include "acefi.h"
+#elif defined(__HAIKU__)
+#include "achaiku.h"
+
#else
/* Unknown environment */
diff --git a/source/include/platform/achaiku.h b/source/include/platform/achaiku.h
new file mode 100644
index 000000000000..754723d7836d
--- /dev/null
+++ b/source/include/platform/achaiku.h
@@ -0,0 +1,105 @@
+/******************************************************************************
+ *
+ * Name: achaiku.h - OS specific defines, etc. for Haiku (www.haiku-os.org)
+ *
+ *****************************************************************************/
+
+/*
+ * 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.
+ */
+
+#ifndef __ACHAIKU_H__
+#define __ACHAIKU_H__
+
+#include "acgcc.h"
+#include <KernelExport.h>
+
+struct mutex;
+
+
+/* Host-dependent types and defines for user- and kernel-space ACPICA */
+
+#define ACPI_USE_SYSTEM_CLIBRARY
+#define ACPI_USE_STANDARD_HEADERS
+
+#define ACPI_MUTEX_TYPE ACPI_OSL_MUTEX
+#define ACPI_MUTEX struct mutex *
+
+#define ACPI_USE_NATIVE_DIVIDE
+
+// #define ACPI_THREAD_ID thread_id
+#define ACPI_SEMAPHORE sem_id
+#define ACPI_SPINLOCK spinlock *
+#define ACPI_CPU_FLAGS cpu_status
+
+#define COMPILER_DEPENDENT_INT64 int64
+#define COMPILER_DEPENDENT_UINT64 uint64
+
+
+#ifdef B_HAIKU_64_BIT
+#define ACPI_MACHINE_WIDTH 64
+#else
+#define ACPI_MACHINE_WIDTH 32
+#endif
+
+
+#ifdef _KERNEL_MODE
+/* Host-dependent types and defines for in-kernel ACPICA */
+
+/* ACPICA cache implementation is adequate. */
+#define ACPI_USE_LOCAL_CACHE
+
+#define ACPI_FLUSH_CPU_CACHE() __asm __volatile("wbinvd");
+
+/* Based on FreeBSD's due to lack of documentation */
+extern int AcpiOsAcquireGlobalLock(uint32 *lock);
+extern int AcpiOsReleaseGlobalLock(uint32 *lock);
+
+#define ACPI_ACQUIRE_GLOBAL_LOCK(GLptr, Acq) do { \
+ (Acq) = AcpiOsAcquireGlobalLock(&((GLptr)->GlobalLock)); \
+} while (0)
+
+#define ACPI_RELEASE_GLOBAL_LOCK(GLptr, Acq) do { \
+ (Acq) = AcpiOsReleaseGlobalLock(&((GLptr)->GlobalLock)); \
+} while (0)
+
+#else /* _KERNEL_MODE */
+/* Host-dependent types and defines for user-space ACPICA */
+
+#error "We only support kernel mode ACPI atm."
+
+#endif /* _KERNEL_MODE */
+#endif /* __ACHAIKU_H__ */
diff --git a/source/os_specific/service_layers/osunixxf.c b/source/os_specific/service_layers/osunixxf.c
index 4f9d1d0724d5..9a92c142f776 100644
--- a/source/os_specific/service_layers/osunixxf.c
+++ b/source/os_specific/service_layers/osunixxf.c
@@ -353,7 +353,7 @@ AcpiOsGetLine (
UINT32 BufferLength,
UINT32 *BytesRead)
{
- UINT8 Temp;
+ int Temp;
UINT32 i;
@@ -364,13 +364,17 @@ AcpiOsGetLine (
return (AE_BUFFER_OVERFLOW);
}
- scanf ("%1c", &Temp);
+ if ((Temp = getchar ()) == EOF)
+ {
+ return (AE_ERROR);
+ }
+
if (!Temp || Temp == '\n')
{
break;
}
- Buffer [i] = Temp;
+ Buffer [i] = (char) Temp;
}
/* Null terminate the buffer */
diff --git a/source/os_specific/service_layers/oswinxf.c b/source/os_specific/service_layers/oswinxf.c
index 91a37e03c26c..68629a272efd 100644
--- a/source/os_specific/service_layers/oswinxf.c
+++ b/source/os_specific/service_layers/oswinxf.c
@@ -520,7 +520,7 @@ AcpiOsGetLine (
UINT32 BufferLength,
UINT32 *BytesRead)
{
- char Temp;
+ int Temp;
UINT32 i;
@@ -531,13 +531,17 @@ AcpiOsGetLine (
return (AE_BUFFER_OVERFLOW);
}
- scanf ("%1c", &Temp);
+ if ((Temp = getchar ()) == EOF)
+ {
+ return (AE_ERROR);
+ }
+
if (!Temp || Temp == '\n')
{
break;
}
- Buffer [i] = Temp;
+ Buffer [i] = (char) Temp;
}
/* Null terminate the buffer */
diff --git a/source/tools/acpibin/Makefile b/source/tools/acpibin/Makefile
deleted file mode 100644
index 7d95f61aac29..000000000000
--- a/source/tools/acpibin/Makefile
+++ /dev/null
@@ -1,130 +0,0 @@
-#
-# acpibin - Binary ACPI table utility
-#
-# NOTE: This makefile is intended to be used within the native
-# ACPICA source tree.
-#
-
-#
-# Configuration
-# Notes:
-# gcc should be version 4 or greater, otherwise some of the options
-# used will not be recognized.
-# Global optimization flags (such as -O2, -Os) are not used, since
-# they cause issues on some compilers.
-# The _GNU_SOURCE symbol is required for many hosts.
-#
-PROG = acpibin
-
-HOST = _LINUX
-NOMAN = YES
-COMPILE = $(CC) -c $(CFLAGS) $(CWARNINGFLAGS) -o$@ $<
-
-ACPICA_SRC = ../../../source
-ACPICA_COMMON = $(ACPICA_SRC)/common
-ACPICA_TOOLS = $(ACPICA_SRC)/tools
-ACPICA_OSL = $(ACPICA_SRC)/os_specific/service_layers
-ACPICA_CORE = $(ACPICA_SRC)/components
-ACPICA_INCLUDE = $(ACPICA_SRC)/include
-ACPICA_DEBUGGER = $(ACPICA_CORE)/debugger
-ACPICA_DISASSEMBLER = $(ACPICA_CORE)/disassembler
-ACPICA_DISPATCHER = $(ACPICA_CORE)/dispatcher
-ACPICA_EVENTS = $(ACPICA_CORE)/events
-ACPICA_EXECUTER = $(ACPICA_CORE)/executer
-ACPICA_HARDWARE = $(ACPICA_CORE)/hardware
-ACPICA_NAMESPACE = $(ACPICA_CORE)/namespace
-ACPICA_PARSER = $(ACPICA_CORE)/parser
-ACPICA_RESOURCES = $(ACPICA_CORE)/resources
-ACPICA_TABLES = $(ACPICA_CORE)/tables
-ACPICA_UTILITIES = $(ACPICA_CORE)/utilities
-ACPIBIN = $(ACPICA_TOOLS)/acpibin
-INSTALLDIR = /usr/bin
-INSTALLPROG = cp --remove-destination $(PROG) $(INSTALLDIR)
-
-ACPICA_HEADERS = \
- $(wildcard $(ACPICA_INCLUDE)/*.h) \
- $(wildcard $(ACPICA_INCLUDE)/platform/*.h)
-
-#
-# Search paths for source files
-#
-vpath %.c \
- $(ACPIBIN) \
- $(ACPICA_UTILITIES) \
- $(ACPICA_COMMON) \
- $(ACPICA_OSL)
-
-HEADERS = \
- $(wildcard $(ACPIBIN)/*.h)
-
-OBJECTS = \
- abcompare.o \
- abmain.o \
- utalloc.o \
- utcache.o \
- utdebug.o \
- utdecode.o \
- utexcep.o \
- utglobal.o \
- utlock.o \
- utmath.o \
- utmisc.o \
- utmutex.o \
- utstate.o \
- utxferror.o \
- osunixxf.o \
- getopt.o
-
-CFLAGS+= \
- -D$(HOST) \
- -D_GNU_SOURCE \
- -DACPI_BIN_APP \
- -I$(ACPICA_INCLUDE)
-
-CWARNINGFLAGS = \
- -ansi \
- -Wall \
- -Wbad-function-cast \
- -Wdeclaration-after-statement \
- -Werror \
- -Wformat=2 \
- -Wmissing-declarations \
- -Wmissing-prototypes \
- -Wstrict-aliasing=0 \
- -Wstrict-prototypes \
- -Wswitch-default \
- -Wpointer-arith \
- -Wundef
-
-#
-# gcc 4+ flags
-#
-CWARNINGFLAGS += \
- -Waddress \
- -Waggregate-return \
- -Wchar-subscripts \
- -Wempty-body \
- -Wlogical-op \
- -Wmissing-declarations \
- -Wmissing-field-initializers \
- -Wmissing-parameter-type \
- -Wnested-externs \
- -Wold-style-declaration \
- -Wold-style-definition \
- -Wredundant-decls \
- -Wtype-limits
-
-#
-# Rules
-#
-$(PROG) : $(OBJECTS)
- $(CC) $(LDFLAGS) $(OBJECTS) -o $(PROG)
-
-%.o : %.c $(HEADERS) $(ACPICA_HEADERS)
- $(COMPILE)
-
-clean :
- rm -f $(PROG) $(PROG).exe $(OBJECTS)
-
-install :
- $(INSTALLPROG)
diff --git a/source/tools/acpiexec/Makefile b/source/tools/acpiexec/Makefile
deleted file mode 100644
index 4d379f5642bb..000000000000
--- a/source/tools/acpiexec/Makefile
+++ /dev/null
@@ -1,288 +0,0 @@
-#
-# acpiexec: ACPI execution simulator. Runs ACPICA code in user
-# space. Loads ACPI tables, displays the namespace, and allows
-# execution of control methods.
-#
-# NOTE: This makefile is intended to be used within the native
-# ACPICA source tree.
-#
-
-#
-# Configuration
-# Notes:
-# gcc should be version 4 or greater, otherwise some of the options
-# used will not be recognized.
-# Global optimization flags (such as -O2, -Os) are not used, since
-# they cause issues on some compilers.
-# The _GNU_SOURCE symbol is required for many hosts.
-#
-PROG = acpiexec
-
-HOST = _LINUX
-NOMAN = YES
-COMPILE = $(CC) -c $(CFLAGS) $(CWARNINGFLAGS) -o$@ $<
-LDFLAGS += -lpthread -lrt
-
-ACPICA_SRC = ../../../source
-ACPICA_COMMON = $(ACPICA_SRC)/common
-ACPICA_TOOLS = $(ACPICA_SRC)/tools
-ACPICA_OSL = $(ACPICA_SRC)/os_specific/service_layers
-ACPICA_CORE = $(ACPICA_SRC)/components
-ACPICA_INCLUDE = $(ACPICA_SRC)/include
-ACPICA_DEBUGGER = $(ACPICA_CORE)/debugger
-ACPICA_DISASSEMBLER = $(ACPICA_CORE)/disassembler
-ACPICA_DISPATCHER = $(ACPICA_CORE)/dispatcher
-ACPICA_EVENTS = $(ACPICA_CORE)/events
-ACPICA_EXECUTER = $(ACPICA_CORE)/executer
-ACPICA_HARDWARE = $(ACPICA_CORE)/hardware
-ACPICA_NAMESPACE = $(ACPICA_CORE)/namespace
-ACPICA_PARSER = $(ACPICA_CORE)/parser
-ACPICA_RESOURCES = $(ACPICA_CORE)/resources
-ACPICA_TABLES = $(ACPICA_CORE)/tables
-ACPICA_UTILITIES = $(ACPICA_CORE)/utilities
-ACPIEXEC = $(ACPICA_TOOLS)/acpiexec
-INSTALLDIR = /usr/bin
-INSTALLPROG = cp --remove-destination $(PROG) $(INSTALLDIR)
-
-ACPICA_HEADERS = \
- $(wildcard $(ACPICA_INCLUDE)/*.h) \
- $(wildcard $(ACPICA_INCLUDE)/platform/*.h)
-
-#
-# Search paths for source files
-#
-vpath %.c \
- $(ACPIEXEC) \
- $(ACPICA_DEBUGGER) \
- $(ACPICA_DISASSEMBLER) \
- $(ACPICA_DISPATCHER) \
- $(ACPICA_EVENTS) \
- $(ACPICA_EXECUTER) \
- $(ACPICA_HARDWARE) \
- $(ACPICA_NAMESPACE) \
- $(ACPICA_PARSER) \
- $(ACPICA_RESOURCES) \
- $(ACPICA_TABLES) \
- $(ACPICA_UTILITIES) \
- $(ACPICA_COMMON) \
- $(ACPICA_OSL)
-
-HEADERS = \
- $(wildcard $(ACPIEXEC)/*.h)
-
-OBJECTS = \
- aeexec.o \
- aehandlers.o \
- aemain.o \
- aetables.o \
- dbcmds.o \
- dbdisply.o \
- dbexec.o \
- dbfileio.o \
- dbhistry.o \
- dbinput.o \
- dbmethod.o \
- dbnames.o \
- dbstats.o \
- dbutils.o \
- dbxface.o \
- dmbuffer.o \
- dmnames.o \
- dmobject.o \
- dmopcode.o \
- dmresrc.o \
- dmresrcl.o \
- dmresrcl2.o \
- dmresrcs.o \
- dmutils.o \
- dmwalk.o \
- dsargs.o \
- dscontrol.o \
- dsfield.o \
- dsinit.o \
- dsmethod.o \
- dsmthdat.o \
- dsobject.o \
- dsopcode.o \
- dsutils.o \
- dswexec.o \
- dswload.o \
- dswload2.o \
- dswscope.o \
- dswstate.o \
- evevent.o \
- evglock.o \
- evgpe.o \
- evgpeblk.o \
- evgpeinit.o \
- evgpeutil.o \
- evmisc.o \
- evregion.o \
- evrgnini.o \
- evsci.o \
- evxface.o \
- evxfevnt.o \
- evxfgpe.o \
- evxfregn.o \
- exconfig.o \
- exconvrt.o \
- excreate.o \
- exdebug.o \
- exdump.o \
- exfield.o \
- exfldio.o \
- exmisc.o \
- exmutex.o \
- exnames.o \
- exoparg1.o \
- exoparg2.o \
- exoparg3.o \
- exoparg6.o \
- exprep.o \
- exregion.o \
- exresnte.o \
- exresolv.o \
- exresop.o \
- exstore.o \
- exstoren.o \
- exstorob.o \
- exsystem.o \
- exutils.o \
- getopt.o \
- hwacpi.o \
- hwesleep.o \
- hwgpe.o \
- hwpci.o \
- hwregs.o \
- hwsleep.o \
- hwvalid.o \
- hwxface.o \
- hwxfsleep.o \
- nsaccess.o \
- nsalloc.o \
- nsdump.o \
- nsdumpdv.o \
- nseval.o \
- nsinit.o \
- nsload.o \
- nsnames.o \
- nsobject.o \
- nsparse.o \
- nspredef.o \
- nsrepair.o \
- nsrepair2.o \
- nssearch.o \
- nsutils.o \
- nswalk.o \
- nsxfeval.o \
- nsxfname.o \
- nsxfobj.o \
- osunixxf.o \
- psargs.o \
- psloop.o \
- psopcode.o \
- psparse.o \
- psscope.o \
- pstree.o \
- psutils.o \
- pswalk.o \
- psxface.o \
- rsaddr.o \
- rscalc.o \
- rscreate.o \
- rsdump.o \
- rsinfo.o \
- rsio.o \
- rsirq.o \
- rslist.o \
- rsmemory.o \
- rsserial.o \
- rsmisc.o \
- rsutils.o \
- rsxface.o \
- tbfadt.o \
- tbfind.o \
- tbinstal.o \
- tbutils.o \
- tbxface.o \
- tbxfload.o \
- tbxfroot.o \
- utaddress.o \
- utalloc.o \
- utcache.o \
- utcopy.o \
- utdebug.o \
- utdecode.o \
- utdelete.o \
- uteval.o \
- utexcep.o \
- utglobal.o \
- utids.o \
- utinit.o \
- utlock.o \
- utmath.o \
- utmisc.o \
- utmutex.o \
- utobject.o \
- utresrc.o \
- utstate.o \
- uttrack.o \
- utosi.o \
- utxferror.o \
- utxface.o \
- utxfmutex.o
-
-CFLAGS+= \
- -D$(HOST) \
- -D_GNU_SOURCE \
- -DACPI_EXEC_APP \
- -I$(ACPICA_INCLUDE)
-
-CWARNINGFLAGS = \
- -ansi \
- -Wall \
- -Wbad-function-cast \
- -Wdeclaration-after-statement \
- -Werror \
- -Wformat=2 \
- -Wmissing-declarations \
- -Wmissing-prototypes \
- -Wstrict-aliasing=0 \
- -Wstrict-prototypes \
- -Wswitch-default \
- -Wpointer-arith \
- -Wundef
-
-#
-# gcc 4+ flags
-#
-CWARNINGFLAGS += \
- -Waddress \
- -Waggregate-return \
- -Wchar-subscripts \
- -Wempty-body \
- -Wlogical-op \
- -Wmissing-declarations \
- -Wmissing-field-initializers \
- -Wmissing-parameter-type \
- -Wnested-externs \
- -Wold-style-declaration \
- -Wold-style-definition \
- -Wredundant-decls \
- -Wtype-limits
-
-#
-# Rules
-#
-$(PROG) : $(OBJECTS)
- $(CC) $(LDFLAGS) $(OBJECTS) -o $(PROG)
- $(COPYPROG)
-
-%.o : %.c $(HEADERS) $(ACPICA_HEADERS)
- $(COMPILE)
-
-clean :
- rm -f $(PROG) $(PROG).exe $(OBJECTS)
-
-install :
- $(INSTALLPROG)
diff --git a/source/tools/acpihelp/Makefile b/source/tools/acpihelp/Makefile
deleted file mode 100644
index d0bcb3e834e7..000000000000
--- a/source/tools/acpihelp/Makefile
+++ /dev/null
@@ -1,123 +0,0 @@
-#
-# acpihelp - ACPI Help utility. Displays ASL operator syntax and
-# information about ACPI predefined names.
-#
-# NOTE: This makefile is intended to be used within the native
-# ACPICA source tree.
-#
-
-#
-# Configuration
-# Notes:
-# gcc should be version 4 or greater, otherwise some of the options
-# used will not be recognized.
-# Global optimization flags (such as -O2, -Os) are not used, since
-# they cause issues on some compilers.
-# The _GNU_SOURCE symbol is required for many hosts.
-#
-PROG = acpihelp
-
-HOST = _LINUX
-NOMAN = YES
-COMPILE = $(CC) -c $(CFLAGS) $(CWARNINGFLAGS) -o$@ $<
-
-ACPICA_SRC = ../../../source
-ACPICA_COMMON = $(ACPICA_SRC)/common
-ACPICA_TOOLS = $(ACPICA_SRC)/tools
-ACPICA_OSL = $(ACPICA_SRC)/os_specific/service_layers
-ACPICA_CORE = $(ACPICA_SRC)/components
-ACPICA_INCLUDE = $(ACPICA_SRC)/include
-ACPICA_DEBUGGER = $(ACPICA_CORE)/debugger
-ACPICA_DISASSEMBLER = $(ACPICA_CORE)/disassembler
-ACPICA_DISPATCHER = $(ACPICA_CORE)/dispatcher
-ACPICA_EVENTS = $(ACPICA_CORE)/events
-ACPICA_EXECUTER = $(ACPICA_CORE)/executer
-ACPICA_HARDWARE = $(ACPICA_CORE)/hardware
-ACPICA_NAMESPACE = $(ACPICA_CORE)/namespace
-ACPICA_PARSER = $(ACPICA_CORE)/parser
-ACPICA_RESOURCES = $(ACPICA_CORE)/resources
-ACPICA_TABLES = $(ACPICA_CORE)/tables
-ACPICA_UTILITIES = $(ACPICA_CORE)/utilities
-ACPIHELP = $(ACPICA_TOOLS)/acpihelp
-INSTALLDIR = /usr/bin
-INSTALLPROG = cp --remove-destination $(PROG) $(INSTALLDIR)
-
-ACPICA_HEADERS = \
- $(wildcard $(ACPICA_INCLUDE)/*.h) \
- $(wildcard $(ACPICA_INCLUDE)/platform/*.h)
-
-#
-# Search paths for source files
-#
-vpath %.c \
- $(ACPIHELP) \
- $(ACPICA_COMMON) \
- $(ACPICA_UTILITIES)
-
-HEADERS = \
- $(wildcard $(ACPIHELP)/*.h)
-
-OBJECTS = \
- ahamlops.o \
- ahaslkey.o \
- ahaslops.o \
- ahdecode.o \
- ahpredef.o \
- ahmain.o \
- getopt.o \
- utexcep.o
-
-CFLAGS+= \
- -D$(HOST) \
- -D_GNU_SOURCE \
- -DACPI_HELP_APP \
- -I$(ACPICA_INCLUDE)
-
-CWARNINGFLAGS = \
- -ansi \
- -Wall \
- -Wbad-function-cast \
- -Wdeclaration-after-statement \
- -Werror \
- -Wformat=2 \
- -Wmissing-declarations \
- -Wmissing-prototypes \
- -Wstrict-aliasing=0 \
- -Wstrict-prototypes \
- -Wswitch-default \
- -Wpointer-arith \
- -Wundef
-
-#
-# gcc 4+ flags
-#
-CWARNINGFLAGS += \
- -Waddress \
- -Waggregate-return \
- -Wchar-subscripts \
- -Wempty-body \
- -Wlogical-op \
- -Wmissing-declarations \
- -Wmissing-field-initializers \
- -Wmissing-parameter-type \
- -Wnested-externs \
- -Wold-style-declaration \
- -Wold-style-definition \
- -Wredundant-decls \
- -Wtype-limits
-
-#
-# Rules
-#
-$(PROG) : $(OBJECTS)
- $(CC) $(LDFLAGS) $(OBJECTS) -o $(PROG)
- $(COPYPROG)
-
-%.o : %.c $(HEADERS) $(ACPICA_HEADERS)
- $(COMPILE)
-
-clean :
- rm -f $(PROG) $(PROG).exe $(OBJECTS)
-
-install :
- $(INSTALLPROG)
diff --git a/source/tools/acpinames/Makefile b/source/tools/acpinames/Makefile
deleted file mode 100644
index 3a8c42db02c2..000000000000
--- a/source/tools/acpinames/Makefile
+++ /dev/null
@@ -1,191 +0,0 @@
-#
-# acpinames - Load ACPI table and dump namespace. This is a subset
-# of the AcpiExec functionality, it is intended to demonstrate
-# the configurability of ACPICA.
-#
-# NOTE: This makefile is intended to be used in the Linux environment,
-# with the Linux directory structure. It will not work directly
-# on the native ACPICA source tree.
-#
-
-#
-# Configuration
-# Notes:
-# gcc should be version 4 or greater, otherwise some of the options
-# used will not be recognized.
-# Global optimization flags (such as -O2, -Os) are not used, since
-# they cause issues on some compilers.
-# The _GNU_SOURCE symbol is required for many hosts.
-#
-PROG = acpinames
-
-HOST = _LINUX
-NOMAN = YES
-COMPILE = $(CC) -c $(CFLAGS) $(CWARNINGFLAGS) -o$@ $<
-
-ACPICA_SRC = ../../../source
-ACPICA_COMMON = $(ACPICA_SRC)/common
-ACPICA_TOOLS = $(ACPICA_SRC)/tools
-ACPICA_OSL = $(ACPICA_SRC)/os_specific/service_layers
-ACPICA_CORE = $(ACPICA_SRC)/components
-ACPICA_INCLUDE = $(ACPICA_SRC)/include
-ACPICA_DEBUGGER = $(ACPICA_CORE)/debugger
-ACPICA_DISASSEMBLER = $(ACPICA_CORE)/disassembler
-ACPICA_DISPATCHER = $(ACPICA_CORE)/dispatcher
-ACPICA_EVENTS = $(ACPICA_CORE)/events
-ACPICA_EXECUTER = $(ACPICA_CORE)/executer
-ACPICA_HARDWARE = $(ACPICA_CORE)/hardware
-ACPICA_NAMESPACE = $(ACPICA_CORE)/namespace
-ACPICA_PARSER = $(ACPICA_CORE)/parser
-ACPICA_RESOURCES = $(ACPICA_CORE)/resources
-ACPICA_TABLES = $(ACPICA_CORE)/tables
-ACPICA_UTILITIES = $(ACPICA_CORE)/utilities
-ACPINAMES = $(ACPICA_TOOLS)/acpinames
-INSTALLDIR = /usr/bin
-INSTALLPROG = cp --remove-destination $(PROG) $(INSTALLDIR)
-
-ACPICA_HEADERS = \
- $(wildcard $(ACPICA_INCLUDE)/*.h) \
- $(wildcard $(ACPICA_INCLUDE)/platform/*.h)
-
-#
-# Search paths for source files
-#
-vpath %.c \
- $(ACPINAMES) \
- $(ACPICA_DEBUGGER) \
- $(ACPICA_DISPATCHER) \
- $(ACPICA_EXECUTER) \
- $(ACPICA_NAMESPACE) \
- $(ACPICA_PARSER) \
- $(ACPICA_TABLES) \
- $(ACPICA_UTILITIES) \
- $(ACPICA_COMMON) \
- $(ACPICA_OSL)
-
-HEADERS = \
- $(wildcard $(ACPINAMES)/*.h)
-
-OBJECTS = \
- anmain.o \
- anstubs.o \
- antables.o \
- dbfileio.o \
- dsfield.o \
- dsmthdat.o \
- dsobject.o \
- dsutils.o \
- dswload.o \
- dswload2.o \
- dswscope.o \
- dswstate.o \
- excreate.o \
- exnames.o \
- exresnte.o \
- exresolv.o \
- exutils.o \
- getopt.o \
- nsaccess.o \
- nsalloc.o \
- nsdump.o \
- nsinit.o \
- nsload.o \
- nsnames.o \
- nsobject.o \
- nsparse.o \
- nssearch.o \
- nsutils.o \
- nswalk.o \
- nsxfeval.o \
- nsxfname.o \
- nsxfobj.o \
- osunixxf.o \
- psargs.o \
- psloop.o \
- psopcode.o \
- psparse.o \
- psscope.o \
- pstree.o \
- psutils.o \
- pswalk.o \
- psxface.o \
- tbfadt.o \
- tbfind.o \
- tbinstal.o \
- tbutils.o \
- tbxface.o \
- tbxfload.o \
- tbxfroot.o \
- utaddress.o \
- utalloc.o \
- utcache.o \
- utdebug.o \
- utdecode.o \
- utdelete.o \
- utexcep.o \
- utglobal.o \
- utlock.o \
- utmath.o \
- utmisc.o \
- utmutex.o \
- utobject.o \
- utstate.o \
- utosi.o \
- utxferror.o \
- utxface.o
-
-CFLAGS+= \
- -D$(HOST) \
- -D_GNU_SOURCE \
- -DACPI_NAMES_APP \
- -I$(ACPICA_INCLUDE) \
- -I$(ACPINAMES)
-
-CWARNINGFLAGS = \
- -ansi \
- -Wall \
- -Wbad-function-cast \
- -Wdeclaration-after-statement \
- -Werror \
- -Wformat=2 \
- -Wmissing-declarations \
- -Wmissing-prototypes \
- -Wstrict-aliasing=0 \
- -Wstrict-prototypes \
- -Wswitch-default \
- -Wpointer-arith \
- -Wundef
-
-#
-# gcc 4+ flags
-#
-CWARNINGFLAGS += \
- -Waddress \
- -Waggregate-return \
- -Wchar-subscripts \
- -Wempty-body \
- -Wlogical-op \
- -Wmissing-declarations \
- -Wmissing-field-initializers \
- -Wmissing-parameter-type \
- -Wnested-externs \
- -Wold-style-declaration \
- -Wold-style-definition \
- -Wredundant-decls \
- -Wtype-limits
-
-#
-# Rules
-#
-$(PROG) : $(OBJECTS)
- $(CC) $(LDFLAGS) $(OBJECTS) -o $(PROG)
- $(COPYPROG)
-
-%.o : %.c $(HEADERS) $(ACPICA_HEADERS)
- $(COMPILE)
-
-clean :
- rm -f $(PROG) $(PROG).exe $(OBJECTS)
-
-install :
- $(INSTALLPROG)
diff --git a/source/tools/acpisrc/Makefile b/source/tools/acpisrc/Makefile
deleted file mode 100644
index 58a8654e350c..000000000000
--- a/source/tools/acpisrc/Makefile
+++ /dev/null
@@ -1,124 +0,0 @@
-#
-# acpisrc - ACPICA source code conversion utility
-#
-# NOTE: This makefile is intended to be used in the Linux environment,
-# with the Linux directory structure. It will not work directly
-# on the native ACPICA source tree.
-#
-
-#
-# Configuration
-# Notes:
-# gcc should be version 4 or greater, otherwise some of the options
-# used will not be recognized.
-# Global optimization flags (such as -O2, -Os) are not used, since
-# they cause issues on some compilers.
-# The _GNU_SOURCE symbol is required for many hosts.
-#
-PROG = acpisrc
-
-HOST = _LINUX
-NOMAN = YES
-COMPILE = $(CC) -c $(CFLAGS) $(CWARNINGFLAGS) -o$@ $<
-
-ACPICA_SRC = ../../../source
-ACPICA_COMMON = $(ACPICA_SRC)/common
-ACPICA_TOOLS = $(ACPICA_SRC)/tools
-ACPICA_OSL = $(ACPICA_SRC)/os_specific/service_layers
-ACPICA_CORE = $(ACPICA_SRC)/components
-ACPICA_INCLUDE = $(ACPICA_SRC)/include
-ACPICA_DEBUGGER = $(ACPICA_CORE)/debugger
-ACPICA_DISASSEMBLER = $(ACPICA_CORE)/disassembler
-ACPICA_DISPATCHER = $(ACPICA_CORE)/dispatcher
-ACPICA_EVENTS = $(ACPICA_CORE)/events
-ACPICA_EXECUTER = $(ACPICA_CORE)/executer
-ACPICA_HARDWARE = $(ACPICA_CORE)/hardware
-ACPICA_NAMESPACE = $(ACPICA_CORE)/namespace
-ACPICA_PARSER = $(ACPICA_CORE)/parser
-ACPICA_RESOURCES = $(ACPICA_CORE)/resources
-ACPICA_TABLES = $(ACPICA_CORE)/tables
-ACPICA_UTILITIES = $(ACPICA_CORE)/utilities
-ACPISRC = $(ACPICA_TOOLS)/acpisrc
-INSTALLDIR = /usr/bin
-INSTALLPROG = cp --remove-destination $(PROG) $(INSTALLDIR)
-
-ACPICA_HEADERS = \
- $(wildcard $(ACPICA_INCLUDE)/*.h) \
- $(wildcard $(ACPICA_INCLUDE)/platform/*.h)
-
-#
-# Search path for source files and individual source files
-#
-vpath %.c \
- $(ACPISRC) \
- $(ACPICA_COMMON) \
- $(ACPICA_OSL)
-
-HEADERS = \
- $(wildcard $(ACPISRC)/*.h)
-
-OBJECTS = \
- ascase.o \
- asconvrt.o \
- asfile.o \
- asmain.o \
- asremove.o \
- astable.o \
- asutils.o \
- osunixdir.o \
- getopt.o
-
-CFLAGS+= \
- -D$(HOST) \
- -D_GNU_SOURCE \
- -DACPI_SRC_APP \
- -I$(ACPISRC) \
- -I$(ACPICA_INCLUDE)
-
-CWARNINGFLAGS = \
- -ansi \
- -Wall \
- -Wbad-function-cast \
- -Wdeclaration-after-statement \
- -Werror \
- -Wformat=2 \
- -Wmissing-declarations \
- -Wmissing-prototypes \
- -Wstrict-aliasing=0 \
- -Wstrict-prototypes \
- -Wswitch-default \
- -Wpointer-arith \
- -Wundef
-
-#
-# gcc 4+ flags
-#
-CWARNINGFLAGS += \
- -Waddress \
- -Waggregate-return \
- -Wchar-subscripts \
- -Wempty-body \
- -Wlogical-op \
- -Wmissing-declarations \
- -Wmissing-field-initializers \
- -Wmissing-parameter-type \
- -Wnested-externs \
- -Wold-style-declaration \
- -Wold-style-definition \
- -Wredundant-decls \
- -Wtype-limits
-
-#
-# Rules
-#
-$(PROG) : $(OBJECTS)
- $(CC) $(LDFLAGS) $(OBJECTS) -o $(PROG)
-
-%.o : %.c $(HEADERS) $(ACPICA_HEADERS)
- $(COMPILE)
-
-clean :
- rm -f $(PROG) $(PROG).exe $(OBJECTS)
-
-install :
- $(INSTALLPROG)
diff --git a/source/tools/acpisrc/asmain.c b/source/tools/acpisrc/asmain.c
index b1f3402de9cd..e36855b5d872 100644
--- a/source/tools/acpisrc/asmain.c
+++ b/source/tools/acpisrc/asmain.c
@@ -147,7 +147,7 @@ AsExaminePaths (
UINT32 *SourceFileType)
{
int Status;
- char Response;
+ int Response;
Status = stat (Source, &Gbl_StatBuf);
@@ -177,11 +177,11 @@ AsExaminePaths (
if (!AsStricmp (Source, Target))
{
printf ("Target path is the same as the source path, overwrite?\n");
- scanf ("%c", &Response);
+ Response = getchar ();
/* Check response */
- if ((char) Response != 'y')
+ if (Response != 'y')
{
return -1;
}
@@ -194,11 +194,11 @@ AsExaminePaths (
if (!Status)
{
printf ("Target path already exists, overwrite?\n");
- scanf ("%c", &Response);
+ Response = getchar ();
/* Check response */
- if ((char) Response != 'y')
+ if (Response != 'y')
{
return -1;
}
diff --git a/source/tools/acpisrc/astable.c b/source/tools/acpisrc/astable.c
index b7defe7959b4..1d782f48357d 100644
--- a/source/tools/acpisrc/astable.c
+++ b/source/tools/acpisrc/astable.c
@@ -411,6 +411,15 @@ ACPI_TYPED_IDENTIFIER_TABLE AcpiIdentifiers[] = {
{"ACPI_WALK_STATE", SRC_TYPE_STRUCT},
{"ACPI_WHEA_HEADER", SRC_TYPE_STRUCT},
+ /* Buffers related to predefined ACPI names (_PLD, etc.) */
+
+ {"ACPI_FDE_INFO", SRC_TYPE_STRUCT},
+ {"ACPI_GRT_INFO", SRC_TYPE_STRUCT},
+ {"ACPI_GTM_INFO", SRC_TYPE_STRUCT},
+ {"ACPI_PLD_INFO", SRC_TYPE_STRUCT},
+
+ /* Resources */
+
{"ACPI_RS_LENGTH", SRC_TYPE_SIMPLE},
{"ACPI_RSDESC_SIZE", SRC_TYPE_SIMPLE},
@@ -474,6 +483,8 @@ ACPI_TYPED_IDENTIFIER_TABLE AcpiIdentifiers[] = {
{"ACPI_TABLE_BGRT", SRC_TYPE_STRUCT},
{"ACPI_TABLE_BOOT", SRC_TYPE_STRUCT},
{"ACPI_TABLE_CPEP", SRC_TYPE_STRUCT},
+ {"ACPI_TABLE_CSRT", SRC_TYPE_STRUCT},
+ {"ACPI_TABLE_DBG2", SRC_TYPE_STRUCT},
{"ACPI_TABLE_DBGP", SRC_TYPE_STRUCT},
{"ACPI_TABLE_DMAR", SRC_TYPE_STRUCT},
{"ACPI_TABLE_DRTM", SRC_TYPE_STRUCT},
@@ -521,6 +532,9 @@ ACPI_TYPED_IDENTIFIER_TABLE AcpiIdentifiers[] = {
{"ACPI_ASF_RMCP", SRC_TYPE_STRUCT},
{"ACPI_BERT_REGION", SRC_TYPE_STRUCT},
{"ACPI_CPEP_POLLING", SRC_TYPE_STRUCT},
+ {"ACPI_CSRT_GROUP", SRC_TYPE_STRUCT},
+ {"ACPI_CSRT_DESCRIPTOR", SRC_TYPE_STRUCT},
+ {"ACPI_DBG2_DEVICE", SRC_TYPE_STRUCT},
{"ACPI_DMAR_HEADER", SRC_TYPE_STRUCT},
{"ACPI_DMAR_DEVICE_SCOPE", SRC_TYPE_STRUCT},
{"ACPI_DMAR_ATSR", SRC_TYPE_STRUCT},
diff --git a/source/tools/acpixtract/Makefile b/source/tools/acpixtract/Makefile
deleted file mode 100644
index d5db832a7394..000000000000
--- a/source/tools/acpixtract/Makefile
+++ /dev/null
@@ -1,116 +0,0 @@
-#
-# acpixtract - extract binary ACPI tables from acpidump text output
-#
-# NOTE: This makefile is intended to be used within the native
-# ACPICA source tree.
-#
-
-#
-# Configuration
-# Notes:
-# gcc should be version 4 or greater, otherwise some of the options
-# used will not be recognized.
-# Global optimization flags (such as -O2, -Os) are not used, since
-# they cause issues on some compilers.
-# The _GNU_SOURCE symbol is required for many hosts.
-#
-PROG = acpixtract
-
-HOST = _LINUX
-NOMAN = YES
-COMPILE = $(CC) -c $(CFLAGS) $(CWARNINGFLAGS) -o$@ $<
-
-ACPICA_SRC = ../../../source
-ACPICA_COMMON = $(ACPICA_SRC)/common
-ACPICA_TOOLS = $(ACPICA_SRC)/tools
-ACPICA_OSL = $(ACPICA_SRC)/os_specific/service_layers
-ACPICA_CORE = $(ACPICA_SRC)/components
-ACPICA_INCLUDE = $(ACPICA_SRC)/include
-ACPICA_DEBUGGER = $(ACPICA_CORE)/debugger
-ACPICA_DISASSEMBLER = $(ACPICA_CORE)/disassembler
-ACPICA_DISPATCHER = $(ACPICA_CORE)/dispatcher
-ACPICA_EVENTS = $(ACPICA_CORE)/events
-ACPICA_EXECUTER = $(ACPICA_CORE)/executer
-ACPICA_HARDWARE = $(ACPICA_CORE)/hardware
-ACPICA_NAMESPACE = $(ACPICA_CORE)/namespace
-ACPICA_PARSER = $(ACPICA_CORE)/parser
-ACPICA_RESOURCES = $(ACPICA_CORE)/resources
-ACPICA_TABLES = $(ACPICA_CORE)/tables
-ACPICA_UTILITIES = $(ACPICA_CORE)/utilities
-ACPIXTRACT = $(ACPICA_TOOLS)/acpixtract
-INSTALLDIR = /usr/bin
-INSTALLPROG = cp --remove-destination $(PROG) $(INSTALLDIR)
-
-ACPICA_HEADERS = \
- $(wildcard $(ACPICA_INCLUDE)/*.h) \
- $(wildcard $(ACPICA_INCLUDE)/platform/*.h)
-
-#
-# Search paths for source files
-#
-vpath %.c \
- $(ACPIXTRACT) \
- $(ACPICA_COMMON)
-
-HEADERS = \
- $(wildcard $(ACPIXTRACT)/*.h)
-
-OBJECTS = \
- acpixtract.o \
- axmain.o \
- getopt.o
-
-CFLAGS+= \
- -D$(HOST) \
- -D_GNU_SOURCE \
- -DACPI_XTRACT_APP \
- -I$(ACPICA_INCLUDE)
-
-CWARNINGFLAGS = \
- -ansi \
- -Wall \
- -Wbad-function-cast \
- -Wdeclaration-after-statement \
- -Werror \
- -Wformat=2 \
- -Wmissing-declarations \
- -Wmissing-prototypes \
- -Wstrict-aliasing=0 \
- -Wstrict-prototypes \
- -Wswitch-default \
- -Wpointer-arith \
- -Wundef
-
-#
-# gcc 4+ flags
-#
-CWARNINGFLAGS += \
- -Waddress \
- -Waggregate-return \
- -Wchar-subscripts \
- -Wempty-body \
- -Wlogical-op \
- -Wmissing-declarations \
- -Wmissing-field-initializers \
- -Wmissing-parameter-type \
- -Wnested-externs \
- -Wold-style-declaration \
- -Wold-style-definition \
- -Wredundant-decls \
- -Wtype-limits
-
-#
-# Rules
-#
-$(PROG) : $(OBJECTS)
- $(CC) $(LDFLAGS) $(OBJECTS) -o $(PROG)
- $(COPYPROG)
-
-%.o : %.c $(HEADERS) $(ACPICA_HEADERS)
- $(COMPILE)
-
-clean :
- rm -f $(PROG) $(PROG).exe $(OBJECTS)
-
-install :
- $(INSTALLPROG)