update acpica
git-svn-id: svn://kolibrios.org@2216 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
parent
39a79feb29
commit
8ec96e9db0
|
@ -68,6 +68,7 @@ static ACPI_HANDLE pci_root_handle;
|
|||
#define acpi_remap( addr ) MapIoMem((void*)(addr),4096, 0x01)
|
||||
|
||||
char* strdup(const char *str);
|
||||
int sprintf(char *buf, const char *fmt, ...);
|
||||
|
||||
void print_pci_irqs();
|
||||
|
||||
|
@ -334,7 +335,8 @@ get_current_resources(struct acpi_device *device, int busnum,
|
|||
if (!info.res)
|
||||
goto res_alloc_fail;
|
||||
|
||||
vsprintf(buf,"PCI Bus %04x:%02x", domain, busnum);
|
||||
sprintf(buf,"PCI Bus %04x:%02x", domain, busnum);
|
||||
|
||||
info.name = strdup(buf);
|
||||
|
||||
if (!info.name)
|
||||
|
@ -587,12 +589,6 @@ u32_t drvEntry(int action, char *cmdline)
|
|||
return 0;
|
||||
}
|
||||
|
||||
status = AcpiReallocateRootTable();
|
||||
if (ACPI_FAILURE(status)) {
|
||||
dbgprintf("Unable to reallocate ACPI tables\n");
|
||||
goto err;
|
||||
}
|
||||
|
||||
status = AcpiInitializeSubsystem();
|
||||
if (status != AE_OK) {
|
||||
dbgprintf("AcpiInitializeSubsystem failed (%s)\n",
|
||||
|
@ -600,7 +596,7 @@ u32_t drvEntry(int action, char *cmdline)
|
|||
goto err;
|
||||
}
|
||||
|
||||
status = AcpiInitializeTables(NULL, 0, TRUE);
|
||||
status = AcpiInitializeTables (NULL, 16, FALSE);
|
||||
if (status != AE_OK) {
|
||||
dbgprintf("AcpiInitializeTables failed (%s)\n",
|
||||
AcpiFormatException(status));
|
||||
|
|
|
@ -7,7 +7,7 @@ INCLUDES = -I./include -I$(DRV_DIR)/include -I$(DRV_DIR)/include/linux
|
|||
|
||||
DEFINES = -DACPI_LIBRARY -D_SINGLE_THREADED -D__KERNEL__ -DCONFIG_X86_32
|
||||
|
||||
CFLAGS= -Wall -c -O2 -fomit-frame-pointer -fno-builtin-printf -Wstrict-prototypes
|
||||
CFLAGS= -Wall -c -O2 -fomit-frame-pointer -fno-builtin-printf -Wstrict-prototypes
|
||||
|
||||
NAME= ACPICA
|
||||
|
||||
|
@ -31,6 +31,7 @@ ACPICA_SRCS= \
|
|||
disassembler/dmutils.c \
|
||||
disassembler/dmwalk.c \
|
||||
events/evevent.c \
|
||||
events/evglock.c \
|
||||
events/evgpe.c \
|
||||
events/evgpeblk.c \
|
||||
events/evgpeinit.c \
|
||||
|
@ -44,10 +45,13 @@ ACPICA_SRCS= \
|
|||
events/evxfregn.c \
|
||||
hardware/hwacpi.c \
|
||||
hardware/hwgpe.c \
|
||||
hardware/hwpci.c \
|
||||
hardware/hwregs.c \
|
||||
hardware/hwsleep.c \
|
||||
hardware/hwvalid.c \
|
||||
hardware/hwxface.c \
|
||||
dispatcher/dsargs.c \
|
||||
dispatcher/dscontrol.c \
|
||||
dispatcher/dsfield.c \
|
||||
dispatcher/dsinit.c \
|
||||
dispatcher/dsmethod.c \
|
||||
|
@ -57,6 +61,7 @@ ACPICA_SRCS= \
|
|||
dispatcher/dsutils.c \
|
||||
dispatcher/dswexec.c \
|
||||
dispatcher/dswload.c \
|
||||
dispatcher/dswload2.c \
|
||||
dispatcher/dswscope.c \
|
||||
dispatcher/dswstate.c \
|
||||
executer/exconfig.c \
|
||||
|
@ -148,6 +153,9 @@ ACPICA_SRCS= \
|
|||
utilities/utstate.c \
|
||||
utilities/uttrack.c \
|
||||
utilities/utxface.c \
|
||||
utilities/utxferror.c \
|
||||
utilities/utdecode.c \
|
||||
utilities/utosi.c \
|
||||
osunixxf.c
|
||||
|
||||
ACPICA_OBJS = $(patsubst %.c,%.o, $(ACPICA_SRCS))
|
||||
|
|
|
@ -1,58 +1,50 @@
|
|||
acpica-unix
|
||||
-----------
|
||||
Makefiles for tool generation from the unix tarball
|
||||
---------------------------------------------------
|
||||
|
||||
This source release includes:
|
||||
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 as 32-bit versions
|
||||
only.
|
||||
|
||||
acpibin
|
||||
acpiexec
|
||||
acpihelp
|
||||
acpinames
|
||||
acpisrc
|
||||
acpixtract
|
||||
iasl
|
||||
|
||||
|
||||
1) a cross-OS AML interpreter
|
||||
Requirements
|
||||
------------
|
||||
|
||||
This is intended to allow commercial and open source operating systems
|
||||
to be enabled for ACPI. OS specific code is still needed, but the
|
||||
AML interpreter should greatly improve the development speed of ACPI
|
||||
support.
|
||||
|
||||
The AML interpreter source should be integrated into the kernel's
|
||||
build process. We recommend establishing an automated method for
|
||||
this, so later versions can also be incorporated easily. Please see
|
||||
the documentation on the website for API and other implementation
|
||||
information.
|
||||
|
||||
|
||||
2) iasl, an ASL compiler/decompiler
|
||||
|
||||
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 compiler
|
||||
make
|
||||
|
||||
It has been compiled on Linux, but should easily port to other Unix
|
||||
environments.
|
||||
|
||||
Run 'iasl -h' for more information, or download the binary version for
|
||||
documentation in PDF format.
|
||||
gcc compiler (4+)
|
||||
bison or yacc
|
||||
flex or lex
|
||||
|
||||
|
||||
3) acpisrc, a source code conversion tool
|
||||
Configuration
|
||||
-------------
|
||||
|
||||
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.
|
||||
The Makefiles contain this configuration information:
|
||||
|
||||
To compile:
|
||||
|
||||
cd tools/acpisrc
|
||||
make
|
||||
|
||||
It has been compiled on Linux, but should easily port to other Unix
|
||||
environments.
|
||||
HOST = _LINUX /* Host system, must appear in acenv.h */
|
||||
CC = gcc /* C compiler */
|
||||
|
||||
|
||||
4) acpibin, an AML file tool
|
||||
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
|
||||
|
@ -60,20 +52,86 @@ manipulation.
|
|||
|
||||
To compile:
|
||||
|
||||
cd tools/acpibin
|
||||
cd acpica/source/tools/acpibin
|
||||
make
|
||||
make install /* install the binary to /usr/bin */
|
||||
|
||||
|
||||
5) acpiexec, a user-space AML interpreter
|
||||
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.
|
||||
methods from user space. Useful for debugging AML code and testing
|
||||
the AML interpreter. Hardware access is simulated.
|
||||
|
||||
To compile:
|
||||
|
||||
cd tools/acpiexec
|
||||
cd acpica/source/tools/acpiexec
|
||||
make
|
||||
make install /* install the binary to /usr/bin */
|
||||
|
||||
|
||||
Thanks -- The ACPI CA Team
|
||||
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 */
|
||||
|
|
|
@ -1,8 +1,756 @@
|
|||
----------------------------------------
|
||||
23 June 2011. Summary of changes for version 20110623:
|
||||
|
||||
1) ACPI CA Core Subsystem:
|
||||
|
||||
Updated the predefined name repair mechanism to not attempt repair of a _TSS
|
||||
return object if a _PSS object is present. We can only sort the _TSS return
|
||||
package if there is no _PSS within the same scope. This is because if _PSS is
|
||||
present, the ACPI specification dictates that the _TSS Power Dissipation field
|
||||
is to be ignored, and therefore some BIOSs leave garbage values in the _TSS
|
||||
Power field(s). In this case, it is best to just return the _TSS package as-
|
||||
is. Reported by, and fixed with assistance from Fenghua Yu.
|
||||
|
||||
Added an option to globally disable the control method return value validation
|
||||
and repair. This runtime option can be used to disable return value repair if
|
||||
this is causing a problem on a particular machine. Also added an option to
|
||||
AcpiExec (-dr) to set this disable flag.
|
||||
|
||||
All makefiles and project files: Major changes to improve generation of ACPICA
|
||||
tools. ACPICA BZ 912:
|
||||
Reduce default optimization levels to improve compatibility
|
||||
For Linux, add strict-aliasing=0 for gcc 4
|
||||
Cleanup and simplify use of command line defines
|
||||
Cleanup multithread library support
|
||||
Improve usage messages
|
||||
|
||||
Linux-specific header: update handling of THREAD_ID and pthread. For the 32-
|
||||
bit case, improve casting to eliminate possible warnings, especially with the
|
||||
acpica tools.
|
||||
|
||||
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 (VC 9.0):
|
||||
Non-Debug Version: 90.1K Code, 23.9K Data, 114.0K Total
|
||||
Debug Version: 165.6K Code, 68.4K Data, 234.0K Total
|
||||
Current Release (VC 9.0):
|
||||
Non-Debug Version: 90.2K Code, 23.9K Data, 114.1K Total
|
||||
Debug Version: 165.6K Code, 68.4K Data, 234.0K Total
|
||||
|
||||
2) iASL Compiler/Disassembler and Tools:
|
||||
|
||||
With this release, a new utility named "acpihelp" has been added to the ACPICA
|
||||
package. This utility summarizes the ACPI specification chapters for the ASL
|
||||
and AML languages. It generates under Linux/Unix as well as Windows, and
|
||||
provides the following functionality:
|
||||
Find/display ASL operator(s) -- with description and syntax.
|
||||
Find/display ASL keyword(s) -- with exact spelling and descriptions.
|
||||
Find/display ACPI predefined name(s) -- with description, number
|
||||
of arguments, and the return value data type.
|
||||
Find/display AML opcode name(s) -- with opcode, arguments, and grammar.
|
||||
Decode/display AML opcode -- with opcode name, arguments, and grammar.
|
||||
|
||||
Service Layers: Make multi-thread support configurable. Conditionally compile
|
||||
the multi-thread support so that threading libraries will not be linked if not
|
||||
necessary. The only tool that requires multi-thread support is AcpiExec.
|
||||
|
||||
iASL: Update yyerrror/AslCompilerError for "const" errors. Newer versions of
|
||||
Bison appear to want the interface to yyerror to be a const char * (or at
|
||||
least this is a problem when generating iASL on some systems.) ACPICA BZ 923
|
||||
Pierre Lejeune.
|
||||
|
||||
Tools: Fix for systems where O_BINARY is not defined. Only used for Windows
|
||||
versions of the tools.
|
||||
|
||||
----------------------------------------
|
||||
27 May 2011. Summary of changes for version 20110527:
|
||||
|
||||
1) ACPI CA Core Subsystem:
|
||||
|
||||
ASL Load() operator: Reinstate most restrictions on the incoming ACPI table
|
||||
signature. Now, only allow SSDT, OEMx, and a null signature. History:
|
||||
1) Originally, we checked the table signature for "SSDT" or "PSDT".
|
||||
(PSDT is now obsolete.)
|
||||
2) We added support for OEMx tables, signature "OEM" plus a fourth
|
||||
"don't care" character.
|
||||
3) Valid tables were encountered with a null signature, so we just
|
||||
gave up on validating the signature, (05/2008).
|
||||
4) We encountered non-AML tables such as the MADT, which caused
|
||||
interpreter errors and kernel faults. So now, we once again allow
|
||||
only SSDT, OEMx, and now, also a null signature. (05/2011).
|
||||
|
||||
Added the missing _TDL predefined name to the global name list in order to
|
||||
enable validation. Affects both the core ACPICA code and the iASL compiler.
|
||||
|
||||
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 (VC 9.0):
|
||||
Non-Debug Version: 90.0K Code, 23.8K Data, 113.8K Total
|
||||
Debug Version: 164.5K Code, 68.0K Data, 232.5K Total
|
||||
Current Release (VC 9.0):
|
||||
Non-Debug Version: 90.1K Code, 23.9K Data, 114.0K Total
|
||||
Debug Version: 165.6K Code, 68.4K Data, 234.0K Total
|
||||
|
||||
2) iASL Compiler/Disassembler and Tools:
|
||||
|
||||
Debugger/AcpiExec: Implemented support for "complex" method arguments on the
|
||||
debugger command line. This adds support beyond simple integers -- including
|
||||
Strings, Buffers, and Packages. Includes support for nested packages.
|
||||
Increased the default command line buffer size to accommodate these arguments.
|
||||
See the ACPICA reference for details and syntax. ACPICA BZ 917.
|
||||
|
||||
Debugger/AcpiExec: Implemented support for "default" method arguments for the
|
||||
Execute/Debug command. Now, the debugger will always invoke a control method
|
||||
with the required number of arguments -- even if the command line specifies
|
||||
none or insufficient arguments. It uses default integer values for any missing
|
||||
arguments. Also fixes a bug where only six method arguments maximum were
|
||||
supported instead of the required seven.
|
||||
|
||||
Debugger/AcpiExec: Add a maximum buffer length parameter to AcpiOsGetLine and
|
||||
also return status in order to prevent buffer overruns. See the ACPICA
|
||||
reference for details and syntax. ACPICA BZ 921
|
||||
|
||||
iASL: Cleaned up support for Berkeley yacc. A general cleanup of code and
|
||||
makefiles to simplify support for the two different but similar parser
|
||||
generators, bison and yacc.
|
||||
|
||||
Updated the generic unix makefile for gcc 4. The default gcc version is now
|
||||
expected to be 4 or greater, since options specific to gcc 4 are used.
|
||||
|
||||
----------------------------------------
|
||||
13 April 2011. Summary of changes for version 20110413:
|
||||
|
||||
1) ACPI CA Core Subsystem:
|
||||
|
||||
Implemented support to execute a so-called "orphan" _REG method under the EC
|
||||
device. This change will force the execution of a _REG method underneath the
|
||||
EC
|
||||
device even if there is no corresponding operation region of type
|
||||
EmbeddedControl. Fixes a problem seen on some machines and apparently is
|
||||
compatible with Windows behavior. ACPICA BZ 875.
|
||||
|
||||
Added more predefined methods that are eligible for automatic NULL package
|
||||
element removal. This change adds another group of predefined names to the
|
||||
list
|
||||
of names that can be repaired by having NULL package elements dynamically
|
||||
removed. This group are those methods that return a single variable-length
|
||||
package containing simple data types such as integers, buffers, strings. This
|
||||
includes: _ALx, _BCL, _CID,_ DOD, _EDL, _FIX, _PCL, _PLD, _PMD, _PRx, _PSL,
|
||||
_Sx,
|
||||
and _TZD. ACPICA BZ 914.
|
||||
|
||||
Split and segregated all internal global lock functions to a new file,
|
||||
evglock.c.
|
||||
|
||||
Updated internal address SpaceID for DataTable regions. Moved this internal
|
||||
space
|
||||
id in preparation for ACPI 5.0 changes that will include some new space IDs.
|
||||
This
|
||||
change should not affect user/host code.
|
||||
|
||||
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 (VC 9.0):
|
||||
Non-Debug Version: 89.8K Code, 23.8K Data, 113.6K Total
|
||||
Debug Version: 164.2K Code, 67.9K Data, 232.1K Total
|
||||
Current Release (VC 9.0):
|
||||
Non-Debug Version: 90.0K Code, 23.8K Data, 113.8K Total
|
||||
Debug Version: 164.5K Code, 68.0K Data, 232.5K Total
|
||||
|
||||
2) iASL Compiler/Disassembler and Tools:
|
||||
|
||||
iASL/DTC: Major update for new grammar features. Allow generic data types in
|
||||
custom ACPI tables. Field names are now optional. Any line can be split to
|
||||
multiple lines using the continuation char (\). Large buffers now use line-
|
||||
continuation character(s) and no colon on the continuation lines. See the
|
||||
grammar
|
||||
update in the iASL compiler reference. ACPI BZ 910,911. Lin Ming, Bob Moore.
|
||||
|
||||
iASL: Mark ASL "Return()" and the simple "Return" as "Null" return statements.
|
||||
Since the parser stuffs a "zero" as the return value for these statements (due
|
||||
to
|
||||
the underlying AML grammar), they were seen as "return with value" by the iASL
|
||||
semantic checking. They are now seen correctly as "null" return statements.
|
||||
|
||||
iASL: Check if a_REG declaration has a corresponding Operation Region. Adds a
|
||||
check for each _REG to ensure that there is in fact a corresponding operation
|
||||
region declaration in the same scope. If not, the _REG method is not very
|
||||
useful
|
||||
since it probably won't be executed. ACPICA BZ 915.
|
||||
|
||||
iASL/DTC: Finish support for expression evaluation. Added a new expression
|
||||
parser
|
||||
that implements c-style operator precedence and parenthesization. ACPICA
|
||||
bugzilla
|
||||
908.
|
||||
|
||||
Disassembler/DTC: Remove support for () and <> style comments in data tables.
|
||||
Now
|
||||
that DTC has full expression support, we don't want to have comment strings
|
||||
that
|
||||
start with a parentheses or a less-than symbol. Now, only the standard /* and
|
||||
//
|
||||
comments are supported, as well as the bracket [] comments.
|
||||
|
||||
AcpiXtract: Fix for RSDP and dynamic SSDT extraction. These tables have
|
||||
"unusual"
|
||||
headers in the acpidump file. Update the header validation to support these
|
||||
tables. Problem introduced in previous AcpiXtract version in the change to
|
||||
support "wrong checksum" error messages emitted by acpidump utility.
|
||||
|
||||
iASL: Add a * option to generate all template files (as a synonym for ALL) as
|
||||
in
|
||||
"iasl -T *" or "iasl -T ALL".
|
||||
|
||||
iASL/DTC: Do not abort compiler on fatal errors. We do not want to completely
|
||||
abort the compiler on "fatal" errors, simply should abort the current compile.
|
||||
This allows multiple compiles with a single (possibly wildcard) compiler
|
||||
invocation.
|
||||
|
||||
----------------------------------------
|
||||
16 March 2011. Summary of changes for version 20110316:
|
||||
|
||||
1) ACPI CA Core Subsystem:
|
||||
|
||||
Fixed a problem caused by a _PRW method appearing at the namespace root scope
|
||||
during the setup of wake GPEs. A fault could occur if a _PRW directly under
|
||||
the
|
||||
root object was passed to the AcpiSetupGpeForWake interface. Lin Ming.
|
||||
|
||||
Implemented support for "spurious" Global Lock interrupts. On some systems, a
|
||||
global lock interrupt can occur without the pending flag being set. Upon a GL
|
||||
interrupt, we now ensure that a thread is actually waiting for the lock before
|
||||
signaling GL availability. Rafael Wysocki, Bob Moore.
|
||||
|
||||
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 (VC 9.0):
|
||||
Non-Debug Version: 89.7K Code, 23.7K Data, 113.4K Total
|
||||
Debug Version: 163.9K Code, 67.5K Data, 231.4K Total
|
||||
Current Release (VC 9.0):
|
||||
Non-Debug Version: 89.8K Code, 23.8K Data, 113.6K Total
|
||||
Debug Version: 164.2K Code, 67.9K Data, 232.1K Total
|
||||
|
||||
2) iASL Compiler/Disassembler and Tools:
|
||||
|
||||
Implemented full support for the "SLIC" ACPI table. Includes support in the
|
||||
header files, disassembler, table compiler, and template generator. Bob Moore,
|
||||
Lin Ming.
|
||||
|
||||
AcpiXtract: Correctly handle embedded comments and messages from AcpiDump.
|
||||
Apparently some or all versions of acpidump will occasionally emit a comment
|
||||
like
|
||||
"Wrong checksum", etc., into the dump file. This was causing problems for
|
||||
AcpiXtract. ACPICA BZ 905.
|
||||
|
||||
iASL: Fix the Linux makefile by removing an inadvertent double file inclusion.
|
||||
ACPICA BZ 913.
|
||||
|
||||
AcpiExec: Update installation of operation region handlers. Install one
|
||||
handler
|
||||
for a user-defined address space. This is used by the ASL test suite (ASLTS).
|
||||
|
||||
----------------------------------------
|
||||
11 February 2011. Summary of changes for version 20110211:
|
||||
|
||||
1) ACPI CA Core Subsystem:
|
||||
|
||||
Added a mechanism to defer _REG methods for some early-installed handlers.
|
||||
Most user handlers should be installed before call to AcpiEnableSubsystem.
|
||||
However, Event handlers and region handlers should be installed after
|
||||
AcpiInitializeObjects. Override handlers for the "default" regions should be
|
||||
installed early, however. This change executes all _REG methods for the
|
||||
default regions (Memory/IO/PCI/DataTable) simultaneously to prevent any
|
||||
chicken/egg issues between them. ACPICA BZ 848.
|
||||
|
||||
Implemented an optimization for GPE detection. This optimization will simply
|
||||
ignore GPE registers that contain no enabled GPEs -- there is no need to
|
||||
read the register since this information is available internally. This
|
||||
becomes more important on machines with a large GPE space. ACPICA bugzilla
|
||||
884. Lin Ming. Suggestion from Joe Liu.
|
||||
|
||||
Removed all use of the highly unreliable FADT revision field. The revision
|
||||
number in the FADT has been found to be completely unreliable and cannot be
|
||||
trusted. Only the actual table length can be used to infer the version. This
|
||||
change updates the ACPICA core and the disassembler so that both no longer
|
||||
even look at the FADT version and instead depend solely upon the FADT
|
||||
length.
|
||||
|
||||
Fix an unresolved name issue for the no-debug and no-error-message source
|
||||
generation cases. The _AcpiModuleName was left undefined in these cases, but
|
||||
it is actually needed as a parameter to some interfaces. Define
|
||||
_AcpiModuleName as a null string in these cases. ACPICA Bugzilla 888.
|
||||
|
||||
Split several large files (makefiles and project files updated)
|
||||
utglobal.c -> utdecode.c
|
||||
dbcomds.c -> dbmethod.c dbnames.c
|
||||
dsopcode.c -> dsargs.c dscontrol.c
|
||||
dsload.c -> dsload2.c
|
||||
aslanalyze.c -> aslbtypes.c aslwalks.c
|
||||
|
||||
Example Code and Data Size: These are the sizes for the OS-independent
|
||||
acpica.lib produced by the Microsoft Visual C++ 9.0 32-bit compiler. The
|
||||
debug version of the code includes the debug output trace mechanism and has
|
||||
a much larger code and data size.
|
||||
|
||||
Previous Release (VC 9.0):
|
||||
Non-Debug Version: 89.7K Code, 23.7K Data, 113.4K Total
|
||||
Debug Version: 163.9K Code, 67.5K Data, 231.4K Total
|
||||
Current Release (VC 9.0):
|
||||
Non-Debug Version: 89.7K Code, 23.7K Data, 113.4K Total
|
||||
Debug Version: 163.9K Code, 67.5K Data, 231.4K Total
|
||||
|
||||
2) iASL Compiler/Disassembler and Tools:
|
||||
|
||||
iASL: Implemented the predefined macros __LINE__, __FILE__, and __DATE__.
|
||||
These are useful C-style macros with the standard definitions. ACPICA
|
||||
bugzilla 898.
|
||||
|
||||
iASL/DTC: Added support for integer expressions and labels. Support for full
|
||||
expressions for all integer fields in all ACPI tables. Support for labels in
|
||||
"generic" portions of tables such as UEFI. See the iASL reference manual.
|
||||
|
||||
Debugger: Added a command to display the status of global handlers. The
|
||||
"handlers" command will display op region, fixed event, and miscellaneous
|
||||
global handlers. installation status -- and for op regions, whether default
|
||||
or user-installed handler will be used.
|
||||
|
||||
iASL: Warn if reserved method incorrectly returns a value. Many predefined
|
||||
names are defined such that they do not return a value. If implemented as a
|
||||
method, issue a warning if such a name explicitly returns a value. ACPICA
|
||||
Bugzilla 855.
|
||||
|
||||
iASL: Added detection of GPE method name conflicts. Detects a conflict where
|
||||
there are two GPE methods of the form _Lxy and _Exy in the same scope. (For
|
||||
example, _L1D and _E1D in the same scope.) ACPICA bugzilla 848.
|
||||
|
||||
iASL/DTC: Fixed a couple input scanner issues with comments and line
|
||||
numbers. Comment remover could get confused and miss a comment ending. Fixed
|
||||
a problem with line counter maintenance.
|
||||
|
||||
iASL/DTC: Reduced the severity of some errors from fatal to error. There is
|
||||
no need to abort on simple errors within a field definition.
|
||||
|
||||
Debugger: Simplified the output of the help command. All help output now in
|
||||
a single screen, instead of help subcommands. ACPICA Bugzilla 897.
|
||||
|
||||
----------------------------------------
|
||||
12 January 2011. Summary of changes for version 20110112:
|
||||
|
||||
1) ACPI CA Core Subsystem:
|
||||
|
||||
Fixed a race condition between method execution and namespace walks that can
|
||||
possibly cause a fault. The problem was apparently introduced in version
|
||||
20100528 as a result of a performance optimization that reduces the number of
|
||||
namespace walks upon method exit by using the delete_namespace_subtree
|
||||
function instead of the delete_namespace_by_owner function used previously.
|
||||
Bug is a missing namespace lock in the delete_namespace_subtree function.
|
||||
dana.myers@oracle.com
|
||||
|
||||
Fixed several issues and a possible fault with the automatic "serialized"
|
||||
method support. History: This support changes a method to "serialized" on the
|
||||
fly if the method generates an AE_ALREADY_EXISTS error, indicating the
|
||||
possibility that it cannot handle reentrancy. This fix repairs a couple of
|
||||
issues seen in the field, especially on machines with many cores:
|
||||
|
||||
1) Delete method children only upon the exit of the last thread,
|
||||
so as to not delete objects out from under other running threads
|
||||
(and possibly causing a fault.)
|
||||
2) Set the "serialized" bit for the method only upon the exit of the
|
||||
Last thread, so as to not cause deadlock when running threads
|
||||
attempt to exit.
|
||||
3) Cleanup the use of the AML "MethodFlags" and internal method flags
|
||||
so that there is no longer any confusion between the two.
|
||||
|
||||
Lin Ming, Bob Moore. Reported by dana.myers@oracle.com.
|
||||
|
||||
Debugger: Now lock the namespace for duration of a namespace dump. Prevents
|
||||
issues if the namespace is changing dynamically underneath the debugger.
|
||||
Especially affects temporary namespace nodes, since the debugger displays
|
||||
these also.
|
||||
|
||||
Updated the ordering of include files. The ACPICA headers should appear
|
||||
before any compiler-specific headers (stdio.h, etc.) so that acenv.h can set
|
||||
any necessary compiler-specific defines, etc. Affects the ACPI-related tools
|
||||
and utilities.
|
||||
|
||||
Updated all ACPICA copyrights and signons to 2011. Added the 2011 copyright
|
||||
to all module headers and signons, including the Linux header. This affects
|
||||
virtually every file in the ACPICA core subsystem, iASL compiler, and all
|
||||
utilities.
|
||||
|
||||
Added project files for MS Visual Studio 2008 (VC++ 9.0). The original
|
||||
project files for VC++ 6.0 are now obsolete. New project files can be found
|
||||
under acpica/generate/msvc9. See acpica/generate/msvc9/readme.txt for
|
||||
details.
|
||||
|
||||
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 (VC 6.0):
|
||||
Non-Debug Version: 89.8K Code, 18.9K Data, 108.7K Total
|
||||
Debug Version: 166.6K Code, 52.1K Data, 218.7K Total
|
||||
Current Release (VC 9.0):
|
||||
Non-Debug Version: 89.7K Code, 23.7K Data, 113.4K Total
|
||||
Debug Version: 163.9K Code, 67.5K Data, 231.4K Total
|
||||
|
||||
2) iASL Compiler/Disassembler and Tools:
|
||||
|
||||
iASL: Added generic data types to the Data Table compiler. Add "generic" data
|
||||
types such as UINT32, String, Unicode, etc., to simplify the generation of
|
||||
platform-defined tables such as UEFI. Lin Ming.
|
||||
|
||||
iASL: Added listing support for the Data Table Compiler. Adds listing support
|
||||
(-l) to display actual binary output for each line of input code.
|
||||
|
||||
----------------------------------------
|
||||
09 December 2010. Summary of changes for version 20101209:
|
||||
|
||||
1) ACPI CA Core Subsystem:
|
||||
|
||||
Completed the major overhaul of the GPE support code that was begun in July
|
||||
2010. Major features include: removal of _PRW execution in ACPICA (host
|
||||
executes _PRWs anyway), cleanup of "wake" GPE interfaces and processing,
|
||||
changes to existing interfaces, simplification of GPE handler operation, and
|
||||
a handful of new interfaces:
|
||||
|
||||
AcpiUpdateAllGpes
|
||||
AcpiFinishGpe
|
||||
AcpiSetupGpeForWake
|
||||
AcpiSetGpeWakeMask
|
||||
One new file, evxfgpe.c to consolidate all external GPE interfaces.
|
||||
|
||||
See the ACPICA Programmer Reference for full details and programming
|
||||
information. See the new section 4.4 "General Purpose Event (GPE) Support"
|
||||
for a full overview, and section 8.7 "ACPI General Purpose Event Management"
|
||||
for programming details. ACPICA BZ 858,870,877. Matthew Garrett, Lin Ming,
|
||||
Bob Moore, Rafael Wysocki.
|
||||
|
||||
Implemented a new GPE feature for Windows compatibility, the "Implicit Wake
|
||||
GPE Notify". This feature will automatically issue a Notify(2) on a device
|
||||
when a Wake GPE is received if there is no corresponding GPE method or
|
||||
handler. ACPICA BZ 870.
|
||||
|
||||
Fixed a problem with the Scope() operator during table parse and load phase.
|
||||
During load phase (table load or method execution), the scope operator should
|
||||
not enter the target into the namespace. Instead, it should open a new scope
|
||||
at the target location. Linux BZ 19462, ACPICA BZ 882.
|
||||
|
||||
Example Code and Data Size: These are the sizes for the OS-independent
|
||||
acpica.lib produced by the Microsoft Visual C++ 6.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: 89.8K Code, 18.9K Data, 108.7K Total
|
||||
Debug Version: 166.6K Code, 52.1K Data, 218.7K Total
|
||||
Current Release:
|
||||
Non-Debug Version: 89.9K Code, 19.0K Data, 108.9K Total
|
||||
Debug Version: 166.3K Code, 52.1K Data, 218.4K Total
|
||||
|
||||
2) iASL Compiler/Disassembler and Tools:
|
||||
|
||||
iASL: Relax the alphanumeric restriction on _CID strings. These strings are
|
||||
"bus-specific" per the ACPI specification, and therefore any characters are
|
||||
acceptable. The only checks that can be performed are for a null string and
|
||||
perhaps for a leading asterisk. ACPICA BZ 886.
|
||||
|
||||
iASL: Fixed a problem where a syntax error that caused a premature EOF
|
||||
condition on the source file emitted a very confusing error message. The
|
||||
premature EOF is now detected correctly. ACPICA BZ 891.
|
||||
|
||||
Disassembler: Decode the AccessSize within a Generic Address Structure (byte
|
||||
access, word access, etc.) Note, this field does not allow arbitrary bit
|
||||
access, the size is encoded as 1=byte, 2=word, 3=dword, and 4=qword.
|
||||
|
||||
New: AcpiNames utility - Example namespace dump utility. Shows an example of
|
||||
ACPICA configuration for a minimal namespace dump utility. Uses table and
|
||||
namespace managers, but no AML interpreter. Does not add any functionality
|
||||
over AcpiExec, it is a subset of AcpiExec. The purpose is to show how to
|
||||
partition and configure ACPICA. ACPICA BZ 883.
|
||||
|
||||
AML Debugger: Increased the debugger buffer size for method return objects.
|
||||
Was 4K, increased to 16K. Also enhanced error messages for debugger method
|
||||
execution, including the buffer overflow case.
|
||||
|
||||
----------------------------------------
|
||||
13 October 2010. Summary of changes for version 20101013:
|
||||
|
||||
1) ACPI CA Core Subsystem:
|
||||
|
||||
Added support to clear the PCIEXP_WAKE event. When clearing ACPI events, now
|
||||
clear the PCIEXP_WAKE_STS bit in the ACPI PM1 Status Register, via
|
||||
HwClearAcpiStatus. Original change from Colin King. ACPICA BZ 880.
|
||||
|
||||
Changed the type of the predefined namespace object _TZ from ThermalZone to
|
||||
Device. This was found to be confusing to the host software that processes
|
||||
the various thermal zones, since _TZ is not really a ThermalZone. However, a
|
||||
Notify() can still be performed on it. ACPICA BZ 876. Suggestion from Rui
|
||||
Zhang.
|
||||
|
||||
Added Windows Vista SP2 to the list of supported _OSI strings. The actual
|
||||
string is "Windows 2006 SP2".
|
||||
|
||||
Eliminated duplicate code in AcpiUtExecute* functions. Now that the nsrepair
|
||||
code automatically repairs _HID-related strings, this type of code is no
|
||||
longer needed in Execute_HID, Execute_CID, and Execute_UID. ACPICA BZ 878.
|
||||
|
||||
Example Code and Data Size: These are the sizes for the OS-independent
|
||||
acpica.lib produced by the Microsoft Visual C++ 6.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: 89.9K Code, 19.0K Data, 108.9K Total
|
||||
Debug Version: 166.3K Code, 52.1K Data, 218.4K Total
|
||||
Current Release:
|
||||
Non-Debug Version: 89.9K Code, 19.0K Data, 108.9K Total
|
||||
Debug Version: 166.3K Code, 52.1K Data, 218.4K Total
|
||||
|
||||
2) iASL Compiler/Disassembler and Tools:
|
||||
|
||||
iASL: Implemented additional compile-time validation for _HID strings. The
|
||||
non-hex prefix (such as "PNP" or "ACPI") must be uppercase, and the length of
|
||||
the string must be exactly seven or eight characters. For both _HID and _CID
|
||||
strings, all characters must be alphanumeric. ACPICA BZ 874.
|
||||
|
||||
iASL: Allow certain "null" resource descriptors. Some BIOS code creates
|
||||
descriptors that are mostly or all zeros, with the expectation that they will
|
||||
be filled in at runtime. iASL now allows this as long as there is a "resource
|
||||
tag" (name) associated with the descriptor, which gives the ASL a handle
|
||||
needed to modify the descriptor. ACPICA BZ 873.
|
||||
|
||||
Added single-thread support to the generic Unix application OSL. Primarily
|
||||
for iASL support, this change removes the use of semaphores in the single-
|
||||
threaded ACPICA tools/applications - increasing performance. The
|
||||
_MULTI_THREADED option was replaced by the (reverse) ACPI_SINGLE_THREADED
|
||||
option. ACPICA BZ 879.
|
||||
|
||||
AcpiExec: several fixes for the 64-bit version. Adds XSDT support and support
|
||||
for 64-bit DSDT/FACS addresses in the FADT. Lin Ming.
|
||||
|
||||
iASL: Moved all compiler messages to a new file, aslmessages.h.
|
||||
|
||||
----------------------------------------
|
||||
15 September 2010. Summary of changes for version 20100915:
|
||||
|
||||
1) ACPI CA Core Subsystem:
|
||||
|
||||
Removed the AcpiOsDerivePciId OSL interface. The various host implementations
|
||||
of this function were not OS-dependent and are now obsolete and can be
|
||||
removed from all host OSLs. This function has been replaced by
|
||||
AcpiHwDerivePciId, which is now part of the ACPICA core code.
|
||||
AcpiHwDerivePciId has been implemented without recursion. Adds one new
|
||||
module, hwpci.c. ACPICA BZ 857.
|
||||
|
||||
Implemented a dynamic repair for _HID and _CID strings. The following
|
||||
problems are now repaired at runtime: 1) Remove a leading asterisk in the
|
||||
string, and 2) the entire string is uppercased. Both repairs are in
|
||||
accordance with the ACPI specification and will simplify host driver code.
|
||||
ACPICA BZ 871.
|
||||
|
||||
The ACPI_THREAD_ID type is no longer configurable, internally it is now
|
||||
always UINT64. This simplifies the ACPICA code, especially any printf output.
|
||||
UINT64 is the only common data type for all thread_id types across all
|
||||
operating systems. It is now up to the host OSL to cast the native thread_id
|
||||
type to UINT64 before returning the value to ACPICA (via AcpiOsGetThreadId).
|
||||
Lin Ming, Bob Moore.
|
||||
|
||||
Added the ACPI_INLINE type to enhance the ACPICA configuration. The "inline"
|
||||
keyword is not standard across compilers, and this type allows inline to be
|
||||
configured on a per-compiler basis. Lin Ming.
|
||||
|
||||
Made the system global AcpiGbl_SystemAwakeAndRunning publically available.
|
||||
Added an extern for this boolean in acpixf.h. Some hosts utilize this value
|
||||
during suspend/restore operations. ACPICA BZ 869.
|
||||
|
||||
All code that implements error/warning messages with the "ACPI:" prefix has
|
||||
been moved to a new module, utxferror.c.
|
||||
|
||||
The UINT64_OVERLAY was moved to utmath.c, which is the only module where it
|
||||
is used. ACPICA BZ 829. Lin Ming, Bob Moore.
|
||||
|
||||
Example Code and Data Size: These are the sizes for the OS-independent
|
||||
acpica.lib produced by the Microsoft Visual C++ 6.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: 89.1K Code, 19.0K Data, 108.1K Total
|
||||
Debug Version: 165.1K Code, 51.9K Data, 217.0K Total
|
||||
Current Release:
|
||||
Non-Debug Version: 89.9K Code, 19.0K Data, 108.9K Total
|
||||
Debug Version: 166.3K Code, 52.1K Data, 218.4K Total
|
||||
|
||||
2) iASL Compiler/Disassembler and Tools:
|
||||
|
||||
iASL/Disassembler: Write ACPI errors to stderr instead of the output file.
|
||||
This keeps the output files free of random error messages that may originate
|
||||
from within the namespace/interpreter code. Used this opportunity to merge
|
||||
all ACPI:-style messages into a single new module, utxferror.c. ACPICA BZ
|
||||
866. Lin Ming, Bob Moore.
|
||||
|
||||
Tools: update some printfs for ansi warnings on size_t. Handle width change
|
||||
of size_t on 32-bit versus 64-bit generations. Lin Ming.
|
||||
|
||||
----------------------------------------
|
||||
06 August 2010. Summary of changes for version 20100806:
|
||||
|
||||
1) ACPI CA Core Subsystem:
|
||||
|
||||
Designed and implemented a new host interface to the _OSI support code. This
|
||||
will allow the host to dynamically add or remove multiple _OSI strings, as
|
||||
well as install an optional handler that is called for each _OSI invocation.
|
||||
Also added a new AML debugger command, 'osi' to display and modify the global
|
||||
_OSI string table, and test support in the AcpiExec utility. See the ACPICA
|
||||
reference manual for full details. Lin Ming, Bob Moore. ACPICA BZ 836.
|
||||
New Functions:
|
||||
AcpiInstallInterface - Add an _OSI string.
|
||||
AcpiRemoveInterface - Delete an _OSI string.
|
||||
AcpiInstallInterfaceHandler - Install optional _OSI handler.
|
||||
Obsolete Functions:
|
||||
AcpiOsValidateInterface - no longer used.
|
||||
New Files:
|
||||
source/components/utilities/utosi.c
|
||||
|
||||
Re-introduced the support to enable multi-byte transfers for Embedded
|
||||
Controller (EC) operation regions. A reported problem was found to be a bug
|
||||
in the host OS, not in the multi-byte support. Previously, the maximum data
|
||||
size passed to the EC operation region handler was a single byte. There are
|
||||
often EC Fields larger than one byte that need to be transferred, and it is
|
||||
useful for the EC driver to lock these as a single transaction. This change
|
||||
enables single transfers larger than 8 bits. This effectively changes the
|
||||
access to the EC space from ByteAcc to AnyAcc, and will probably require
|
||||
changes to the host OS Embedded Controller driver to enable 16/32/64/256-bit
|
||||
transfers in addition to 8-bit transfers. Alexey Starikovskiy, Lin Ming.
|
||||
|
||||
Fixed a problem with the prototype for AcpiOsReadPciConfiguration. The
|
||||
prototype in acpiosxf.h had the output value pointer as a (void *).
|
||||
It should be a (UINT64 *). This may affect some host OSL code.
|
||||
|
||||
Fixed a couple problems with the recently modified Linux makefiles for iASL
|
||||
and AcpiExec. These new makefiles place the generated object files in the
|
||||
local directory so that there can be no collisions between the files that are
|
||||
shared between them that are compiled with different options.
|
||||
|
||||
Example Code and Data Size: These are the sizes for the OS-independent
|
||||
acpica.lib produced by the Microsoft Visual C++ 6.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: 88.3K Code, 18.8K Data, 107.1K Total
|
||||
Debug Version: 164.0K Code, 51.5K Data, 215.5K Total
|
||||
Current Release:
|
||||
Non-Debug Version: 89.1K Code, 19.0K Data, 108.1K Total
|
||||
Debug Version: 165.1K Code, 51.9K Data, 217.0K Total
|
||||
|
||||
2) iASL Compiler/Disassembler and Tools:
|
||||
|
||||
iASL/Disassembler: Added a new option (-da, "disassemble all") to load the
|
||||
namespace from and disassemble an entire group of AML files. Useful for
|
||||
loading all of the AML tables for a given machine (DSDT, SSDT1...SSDTn) and
|
||||
disassembling with one simple command. ACPICA BZ 865. Lin Ming.
|
||||
|
||||
iASL: Allow multiple invocations of -e option. This change allows multiple
|
||||
uses of -e on the command line: "-e ssdt1.dat -e ssdt2.dat". ACPICA BZ 834.
|
||||
Lin Ming.
|
||||
|
||||
----------------------------------------
|
||||
02 July 2010. Summary of changes for version 20100702:
|
||||
|
||||
1) ACPI CA Core Subsystem:
|
||||
|
||||
Implemented several updates to the recently added GPE reference count
|
||||
support. The model for "wake" GPEs is changing to give the host OS complete
|
||||
control of these GPEs. Eventually, the ACPICA core will not execute any _PRW
|
||||
methods, since the host already must execute them. Also, additional changes
|
||||
were made to help ensure that the reference counts are kept in proper
|
||||
synchronization with reality. Rafael J. Wysocki.
|
||||
|
||||
1) Ensure that GPEs are not enabled twice during initialization.
|
||||
2) Ensure that GPE enable masks stay in sync with the reference count.
|
||||
3) Do not inadvertently enable GPEs when writing GPE registers.
|
||||
4) Remove the internal wake reference counter and add new AcpiGpeWakeup
|
||||
interface. This interface will set or clear individual GPEs for wakeup.
|
||||
5) Remove GpeType argument from AcpiEnable and AcpiDisable. These interfaces
|
||||
are now used for "runtime" GPEs only.
|
||||
|
||||
Changed the behavior of the GPE install/remove handler interfaces. The GPE is
|
||||
no longer disabled during this process, as it was found to cause problems on
|
||||
some machines. Rafael J. Wysocki.
|
||||
|
||||
Reverted a change introduced in version 20100528 to enable Embedded
|
||||
Controller multi-byte transfers. This change was found to cause problems with
|
||||
Index Fields and possibly Bank Fields. It will be reintroduced when these
|
||||
problems have been resolved.
|
||||
|
||||
Fixed a problem with references to Alias objects within Package Objects. A
|
||||
reference to an Alias within the definition of a Package was not always
|
||||
resolved properly. Aliases to objects like Processors, Thermal zones, etc.
|
||||
were resolved to the actual object instead of a reference to the object as it
|
||||
should be. Package objects are only allowed to contain integer, string,
|
||||
buffer, package, and reference objects. Redhat bugzilla 608648.
|
||||
|
||||
Example Code and Data Size: These are the sizes for the OS-independent
|
||||
acpica.lib produced by the Microsoft Visual C++ 6.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: 88.3K Code, 18.8K Data, 107.1K Total
|
||||
Debug Version: 164.1K Code, 51.5K Data, 215.6K Total
|
||||
Current Release:
|
||||
Non-Debug Version: 88.3K Code, 18.8K Data, 107.1K Total
|
||||
Debug Version: 164.0K Code, 51.5K Data, 215.5K Total
|
||||
|
||||
2) iASL Compiler/Disassembler and Tools:
|
||||
|
||||
iASL: Implemented a new compiler subsystem to allow definition and
|
||||
compilation of the non-AML ACPI tables such as FADT, MADT, SRAT, etc. These
|
||||
are called "ACPI Data Tables", and the new compiler is the "Data Table
|
||||
Compiler". This compiler is intended to simplify the existing error-prone
|
||||
process of creating these tables for the BIOS, as well as allowing the
|
||||
disassembly, modification, recompilation, and override of existing ACPI data
|
||||
tables. See the iASL User Guide for detailed information.
|
||||
|
||||
iASL: Implemented a new Template Generator option in support of the new Data
|
||||
Table Compiler. This option will create examples of all known ACPI tables
|
||||
that can be used as the basis for table development. See the iASL
|
||||
documentation and the -T option.
|
||||
|
||||
Disassembler and headers: Added support for the WDDT ACPI table (Watchdog
|
||||
Descriptor Table).
|
||||
|
||||
Updated the Linux makefiles for iASL and AcpiExec to place the generated
|
||||
object files in the local directory so that there can be no collisions
|
||||
between the shared files between them that are generated with different
|
||||
options.
|
||||
|
||||
Added support for Mac OS X in the Unix OSL used for iASL and AcpiExec. Use
|
||||
the #define __APPLE__ to enable this support.
|
||||
|
||||
----------------------------------------
|
||||
28 May 2010. Summary of changes for version 20100528:
|
||||
|
||||
This release is available at www.acpica.org/downloads
|
||||
|
||||
Note: The ACPI 4.0a specification was released on April 5, 2010 and is
|
||||
available at www.acpi.info. This is primarily an errata release.
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
|
@ -126,13 +126,13 @@
|
|||
|
||||
/* Local prototypes */
|
||||
|
||||
INT32
|
||||
static INT32
|
||||
AdWriteBuffer (
|
||||
char *Filename,
|
||||
char *Buffer,
|
||||
UINT32 Length);
|
||||
|
||||
char FilenameBuf[20];
|
||||
static char FilenameBuf[20];
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
|
@ -190,7 +190,7 @@ AdGenerateFilename (
|
|||
*
|
||||
******************************************************************************/
|
||||
|
||||
INT32
|
||||
static INT32
|
||||
AdWriteBuffer (
|
||||
char *Filename,
|
||||
char *Buffer,
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
|
@ -134,7 +134,6 @@
|
|||
|
||||
|
||||
extern int AslCompilerdebug;
|
||||
extern char *Gbl_ExternalFilename;
|
||||
|
||||
|
||||
ACPI_STATUS
|
||||
|
@ -148,22 +147,18 @@ LsSetupNsList (
|
|||
|
||||
/* Local prototypes */
|
||||
|
||||
void
|
||||
static void
|
||||
AdCreateTableHeader (
|
||||
char *Filename,
|
||||
ACPI_TABLE_HEADER *Table);
|
||||
|
||||
void
|
||||
AdDisassemblerHeader (
|
||||
char *Filename);
|
||||
|
||||
ACPI_STATUS
|
||||
static ACPI_STATUS
|
||||
AdDeferredParse (
|
||||
ACPI_PARSE_OBJECT *Op,
|
||||
UINT8 *Aml,
|
||||
UINT32 AmlLength);
|
||||
|
||||
ACPI_STATUS
|
||||
static ACPI_STATUS
|
||||
AdParseDeferredOps (
|
||||
ACPI_PARSE_OBJECT *Root);
|
||||
|
||||
|
@ -317,6 +312,7 @@ AdAmlDisassemble (
|
|||
ACPI_STATUS Status;
|
||||
char *DisasmFilename = NULL;
|
||||
char *ExternalFilename;
|
||||
ACPI_EXTERNAL_FILE *ExternalFileList = AcpiGbl_ExternalFileList;
|
||||
FILE *File = NULL;
|
||||
ACPI_TABLE_HEADER *Table = NULL;
|
||||
ACPI_TABLE_HEADER *ExternalTable;
|
||||
|
@ -339,12 +335,18 @@ AdAmlDisassemble (
|
|||
* External filenames separated by commas
|
||||
* Example: iasl -e file1,file2,file3 -d xxx.aml
|
||||
*/
|
||||
if (Gbl_ExternalFilename)
|
||||
while (ExternalFileList)
|
||||
{
|
||||
ExternalFilename = strtok (Gbl_ExternalFilename, ",");
|
||||
|
||||
while (ExternalFilename)
|
||||
ExternalFilename = ExternalFileList->Path;
|
||||
if (!ACPI_STRCMP (ExternalFilename, Filename))
|
||||
{
|
||||
/* Next external file */
|
||||
|
||||
ExternalFileList = ExternalFileList->Next;
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
Status = AcpiDbGetTableFromFile (ExternalFilename, &ExternalTable);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
|
@ -372,13 +374,15 @@ AdAmlDisassemble (
|
|||
AcpiPsDeleteParseTree (AcpiGbl_ParseOpRoot);
|
||||
}
|
||||
|
||||
/* Next external file name */
|
||||
/* Next external file */
|
||||
|
||||
ExternalFilename = strtok (NULL, ",");
|
||||
ExternalFileList = ExternalFileList->Next;
|
||||
}
|
||||
|
||||
/* Clear external list generated by Scope in external tables */
|
||||
|
||||
if (AcpiGbl_ExternalFileList)
|
||||
{
|
||||
AcpiDmClearExternalList ();
|
||||
}
|
||||
}
|
||||
|
@ -608,10 +612,10 @@ AdDisassemblerHeader (
|
|||
|
||||
/* Header and input table info */
|
||||
|
||||
AcpiOsPrintf ("/*\n * Intel ACPI Component Architecture\n");
|
||||
AcpiOsPrintf (" * AML Disassembler version %8.8X\n", ACPI_CA_VERSION);
|
||||
AcpiOsPrintf ("/*\n");
|
||||
AcpiOsPrintf (ACPI_COMMON_HEADER ("AML Disassembler", " * "));
|
||||
|
||||
AcpiOsPrintf (" *\n * Disassembly of %s, %s", Filename, ctime (&Timer));
|
||||
AcpiOsPrintf (" * Disassembly of %s, %s", Filename, ctime (&Timer));
|
||||
AcpiOsPrintf (" *\n");
|
||||
}
|
||||
|
||||
|
@ -630,7 +634,7 @@ AdDisassemblerHeader (
|
|||
*
|
||||
*****************************************************************************/
|
||||
|
||||
void
|
||||
static void
|
||||
AdCreateTableHeader (
|
||||
char *Filename,
|
||||
ACPI_TABLE_HEADER *Table)
|
||||
|
@ -644,7 +648,7 @@ AdCreateTableHeader (
|
|||
*/
|
||||
AdDisassemblerHeader (Filename);
|
||||
|
||||
AcpiOsPrintf (" *\n * Original Table Header:\n");
|
||||
AcpiOsPrintf (" * Original Table Header:\n");
|
||||
AcpiOsPrintf (" * Signature \"%4.4s\"\n", Table->Signature);
|
||||
AcpiOsPrintf (" * Length 0x%8.8X (%u)\n", Table->Length, Table->Length);
|
||||
|
||||
|
@ -663,7 +667,7 @@ AdCreateTableHeader (
|
|||
|
||||
if (ACPI_COMPARE_NAME (Table->Signature, ACPI_SIG_DSDT))
|
||||
{
|
||||
AcpiOsPrintf (" **** ACPI 1.0, no 64-bit math support");
|
||||
AcpiOsPrintf (" **** 32-bit table (V1), no 64-bit math support");
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -689,7 +693,7 @@ AdCreateTableHeader (
|
|||
AcpiOsPrintf (" * OEM Revision 0x%8.8X (%u)\n", Table->OemRevision, Table->OemRevision);
|
||||
AcpiOsPrintf (" * Compiler ID \"%.4s\"\n", Table->AslCompilerId);
|
||||
AcpiOsPrintf (" * Compiler Version 0x%8.8X (%u)\n", Table->AslCompilerRevision, Table->AslCompilerRevision);
|
||||
AcpiOsPrintf (" */\n");
|
||||
AcpiOsPrintf (" */\n\n");
|
||||
|
||||
/* Create AML output filename based on input filename */
|
||||
|
||||
|
@ -777,7 +781,7 @@ AdDisplayTables (
|
|||
*
|
||||
*****************************************************************************/
|
||||
|
||||
ACPI_STATUS
|
||||
static ACPI_STATUS
|
||||
AdDeferredParse (
|
||||
ACPI_PARSE_OBJECT *Op,
|
||||
UINT8 *Aml,
|
||||
|
@ -900,7 +904,7 @@ AdDeferredParse (
|
|||
*
|
||||
*****************************************************************************/
|
||||
|
||||
ACPI_STATUS
|
||||
static ACPI_STATUS
|
||||
AdParseDeferredOps (
|
||||
ACPI_PARSE_OBJECT *Root)
|
||||
{
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
|
@ -792,6 +792,7 @@ AcpiDmXrefDescendingOp (
|
|||
ACPI_PARSE_OBJECT *NextOp;
|
||||
ACPI_NAMESPACE_NODE *Node;
|
||||
ACPI_OPERAND_OBJECT *Object;
|
||||
UINT32 ParamCount = 0;
|
||||
|
||||
|
||||
WalkState = Info->WalkState;
|
||||
|
@ -880,18 +881,13 @@ AcpiDmXrefDescendingOp (
|
|||
if (Object)
|
||||
{
|
||||
ObjectType2 = Object->Common.Type;
|
||||
}
|
||||
|
||||
if (ObjectType2 == ACPI_TYPE_METHOD)
|
||||
{
|
||||
AcpiDmAddToExternalList (Op, Path, ACPI_TYPE_METHOD,
|
||||
Object->Method.ParamCount);
|
||||
ParamCount = Object->Method.ParamCount;
|
||||
}
|
||||
else
|
||||
{
|
||||
AcpiDmAddToExternalList (Op, Path, (UINT8) ObjectType2, 0);
|
||||
}
|
||||
|
||||
AcpiDmAddToExternalList (Op, Path, (UINT8) ObjectType2, ParamCount);
|
||||
Op->Common.Node = Node;
|
||||
}
|
||||
else
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
|
@ -310,6 +310,95 @@ Cleanup:
|
|||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiDmAddToExternalFileList
|
||||
*
|
||||
* PARAMETERS: PathList - Single path or list separated by comma
|
||||
*
|
||||
* RETURN: None
|
||||
*
|
||||
* DESCRIPTION: Add external files to global list
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiDmAddToExternalFileList (
|
||||
char *PathList)
|
||||
{
|
||||
ACPI_EXTERNAL_FILE *ExternalFile;
|
||||
char *Path;
|
||||
char *TmpPath;
|
||||
|
||||
|
||||
if (!PathList)
|
||||
{
|
||||
return (AE_OK);
|
||||
}
|
||||
|
||||
Path = strtok (PathList, ",");
|
||||
|
||||
while (Path)
|
||||
{
|
||||
TmpPath = ACPI_ALLOCATE_ZEROED (ACPI_STRLEN (Path) + 1);
|
||||
if (!TmpPath)
|
||||
{
|
||||
return (AE_NO_MEMORY);
|
||||
}
|
||||
|
||||
ACPI_STRCPY (TmpPath, Path);
|
||||
|
||||
ExternalFile = ACPI_ALLOCATE_ZEROED (sizeof (ACPI_EXTERNAL_FILE));
|
||||
if (!ExternalFile)
|
||||
{
|
||||
ACPI_FREE (TmpPath);
|
||||
return (AE_NO_MEMORY);
|
||||
}
|
||||
|
||||
ExternalFile->Path = TmpPath;
|
||||
|
||||
if (AcpiGbl_ExternalFileList)
|
||||
{
|
||||
ExternalFile->Next = AcpiGbl_ExternalFileList;
|
||||
}
|
||||
|
||||
AcpiGbl_ExternalFileList = ExternalFile;
|
||||
Path = strtok (NULL, ",");
|
||||
}
|
||||
|
||||
return (AE_OK);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiDmClearExternalFileList
|
||||
*
|
||||
* PARAMETERS: None
|
||||
*
|
||||
* RETURN: None
|
||||
*
|
||||
* DESCRIPTION: Clear the external file list
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
void
|
||||
AcpiDmClearExternalFileList (
|
||||
void)
|
||||
{
|
||||
ACPI_EXTERNAL_FILE *NextExternal;
|
||||
|
||||
|
||||
while (AcpiGbl_ExternalFileList)
|
||||
{
|
||||
NextExternal = AcpiGbl_ExternalFileList->Next;
|
||||
ACPI_FREE (AcpiGbl_ExternalFileList->Path);
|
||||
ACPI_FREE (AcpiGbl_ExternalFileList);
|
||||
AcpiGbl_ExternalFileList = NextExternal;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiDmAddToExternalList
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
|
@ -704,8 +704,8 @@ AcpiDmUpdateResourceName (
|
|||
|
||||
Name[0] = '_';
|
||||
Name[1] = AcpiGbl_Prefix[AcpiGbl_NextPrefix];
|
||||
Name[2] = AcpiUtHexToAsciiChar (AcpiGbl_NextResourceId, 4);
|
||||
Name[3] = AcpiUtHexToAsciiChar (AcpiGbl_NextResourceId, 0);
|
||||
Name[2] = AcpiUtHexToAsciiChar ((UINT64) AcpiGbl_NextResourceId, 4);
|
||||
Name[3] = AcpiUtHexToAsciiChar ((UINT64) AcpiGbl_NextResourceId, 0);
|
||||
|
||||
/* Update globals for next name */
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
|
@ -117,6 +117,7 @@
|
|||
#include "accommon.h"
|
||||
#include "acdisasm.h"
|
||||
#include "actables.h"
|
||||
#include "aslcompiler.h"
|
||||
#include "dtcompiler.h"
|
||||
|
||||
/* This module used for application-level code only */
|
||||
|
@ -132,10 +133,13 @@ AcpiDmCheckAscii (
|
|||
char *RepairedName,
|
||||
UINT32 Count);
|
||||
|
||||
UINT8
|
||||
AcpiTbGenerateChecksum (
|
||||
ACPI_TABLE_HEADER *Table);
|
||||
|
||||
/* Common format strings for commented values */
|
||||
|
||||
#define UINT8_FORMAT "%2.2X [%s]\n"
|
||||
#define UINT16_FORMAT "%4.4X [%s]\n"
|
||||
#define UINT32_FORMAT "%8.8X [%s]\n"
|
||||
#define STRING_FORMAT "[%s]\n"
|
||||
|
||||
/* These tables map a subtable type to a description string */
|
||||
|
||||
|
@ -158,6 +162,74 @@ static const char *AcpiDmDmarSubnames[] =
|
|||
"Unknown SubTable Type" /* Reserved */
|
||||
};
|
||||
|
||||
static const char *AcpiDmEinjActions[] =
|
||||
{
|
||||
"Begin Operation",
|
||||
"Get Trigger Table",
|
||||
"Set Error Type",
|
||||
"Get Error Type",
|
||||
"End Operation",
|
||||
"Execute Operation",
|
||||
"Check Busy Status",
|
||||
"Get Command Status",
|
||||
"Unknown Action"
|
||||
};
|
||||
|
||||
static const char *AcpiDmEinjInstructions[] =
|
||||
{
|
||||
"Read Register",
|
||||
"Read Register Value",
|
||||
"Write Register",
|
||||
"Write Register Value",
|
||||
"Noop",
|
||||
"Unknown Instruction"
|
||||
};
|
||||
|
||||
static const char *AcpiDmErstActions[] =
|
||||
{
|
||||
"Begin Write Operation",
|
||||
"Begin Read Operation",
|
||||
"Begin Clear Operation",
|
||||
"End Operation",
|
||||
"Set Record Offset",
|
||||
"Execute Operation",
|
||||
"Check Busy Status",
|
||||
"Get Command Status",
|
||||
"Get Record Identifier",
|
||||
"Set Record Identifier",
|
||||
"Get Record Count",
|
||||
"Begin Dummy Write",
|
||||
"Unused/Unknown Action",
|
||||
"Get Error Address Range",
|
||||
"Get Error Address Length",
|
||||
"Get Error Attributes",
|
||||
"Unknown Action"
|
||||
};
|
||||
|
||||
static const char *AcpiDmErstInstructions[] =
|
||||
{
|
||||
"Read Register",
|
||||
"Read Register Value",
|
||||
"Write Register",
|
||||
"Write Register Value",
|
||||
"Noop",
|
||||
"Load Var1",
|
||||
"Load Var2",
|
||||
"Store Var1",
|
||||
"Add",
|
||||
"Subtract",
|
||||
"Add Value",
|
||||
"Subtract Value",
|
||||
"Stall",
|
||||
"Stall While True",
|
||||
"Skip Next If True",
|
||||
"GoTo",
|
||||
"Set Source Address",
|
||||
"Set Destination Address",
|
||||
"Move Data",
|
||||
"Unknown Instruction"
|
||||
};
|
||||
|
||||
static const char *AcpiDmHestSubnames[] =
|
||||
{
|
||||
"IA-32 Machine Check Exception",
|
||||
|
@ -199,6 +271,13 @@ static const char *AcpiDmMadtSubnames[] =
|
|||
"Unknown SubTable Type" /* Reserved */
|
||||
};
|
||||
|
||||
static const char *AcpiDmSlicSubnames[] =
|
||||
{
|
||||
"Public Key Structure",
|
||||
"Windows Marker Structure",
|
||||
"Unknown SubTable Type" /* Reserved */
|
||||
};
|
||||
|
||||
static const char *AcpiDmSratSubnames[] =
|
||||
{
|
||||
"Processor Local APIC/SAPIC Affinity",
|
||||
|
@ -230,60 +309,76 @@ static const char *AcpiDmFadtProfiles[] =
|
|||
"Unknown Profile Type"
|
||||
};
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* ACPI Table Data, indexed by signature.
|
||||
*
|
||||
* Each entry contains: Signature, Table Info, Handler, Description
|
||||
*
|
||||
* Simple tables have only a TableInfo structure, complex tables have a handler.
|
||||
* This table must be NULL terminated. RSDP and FACS are special-cased
|
||||
* elsewhere.
|
||||
*
|
||||
******************************************************************************/
|
||||
#define ACPI_GAS_WIDTH_RESERVED 5
|
||||
|
||||
static ACPI_DMTABLE_DATA AcpiDmTableData[] =
|
||||
static const char *AcpiDmGasAccessWidth[] =
|
||||
{
|
||||
{ACPI_SIG_ASF, NULL, AcpiDmDumpAsf, DtCompileAsf, "Alert Standard Format table"},
|
||||
{ACPI_SIG_BOOT, AcpiDmTableInfoBoot, NULL, NULL, "Simple Boot Flag Table"},
|
||||
{ACPI_SIG_BERT, AcpiDmTableInfoBert, NULL, NULL, "Boot Error Record Table"},
|
||||
{ACPI_SIG_CPEP, NULL, AcpiDmDumpCpep, DtCompileCpep, "Corrected Platform Error Polling table"},
|
||||
{ACPI_SIG_DBGP, AcpiDmTableInfoDbgp, NULL, NULL, "Debug Port table"},
|
||||
{ACPI_SIG_DMAR, NULL, AcpiDmDumpDmar, DtCompileDmar, "DMA Remapping table"},
|
||||
{ACPI_SIG_ECDT, AcpiDmTableInfoEcdt, NULL, NULL, "Embedded Controller Boot Resources Table"},
|
||||
{ACPI_SIG_EINJ, NULL, AcpiDmDumpEinj, DtCompileEinj, "Error Injection table"},
|
||||
{ACPI_SIG_ERST, NULL, AcpiDmDumpErst, DtCompileErst, "Error Record Serialization Table"},
|
||||
{ACPI_SIG_FADT, NULL, AcpiDmDumpFadt, DtCompileFadt, "Fixed ACPI Description Table"},
|
||||
{ACPI_SIG_HEST, NULL, AcpiDmDumpHest, DtCompileHest, "Hardware Error Source Table"},
|
||||
{ACPI_SIG_HPET, AcpiDmTableInfoHpet, NULL, NULL, "High Precision Event Timer table"},
|
||||
{ACPI_SIG_IVRS, NULL, AcpiDmDumpIvrs, DtCompileIvrs, "I/O Virtualization Reporting Structure"},
|
||||
{ACPI_SIG_MADT, NULL, AcpiDmDumpMadt, DtCompileMadt, "Multiple APIC Description Table"},
|
||||
{ACPI_SIG_MCFG, NULL, AcpiDmDumpMcfg, DtCompileMcfg, "Memory Mapped Configuration table"},
|
||||
{ACPI_SIG_MCHI, AcpiDmTableInfoMchi, NULL, NULL, "Management Controller Host Interface table"},
|
||||
{ACPI_SIG_MSCT, NULL, AcpiDmDumpMsct, DtCompileMsct, "Maximum System Characteristics Table"},
|
||||
{ACPI_SIG_RSDT, NULL, AcpiDmDumpRsdt, DtCompileRsdt, "Root System Description Table"},
|
||||
{ACPI_SIG_SBST, AcpiDmTableInfoSbst, NULL, NULL, "Smart Battery Specification Table"},
|
||||
{ACPI_SIG_SLIC, AcpiDmTableInfoSlic, NULL, NULL, "Software Licensing Description Table"},
|
||||
{ACPI_SIG_SLIT, NULL, AcpiDmDumpSlit, DtCompileSlit, "System Locality Information Table"},
|
||||
{ACPI_SIG_SPCR, AcpiDmTableInfoSpcr, NULL, NULL, "Serial Port Console Redirection table"},
|
||||
{ACPI_SIG_SPMI, AcpiDmTableInfoSpmi, NULL, NULL, "Server Platform Management Interface table"},
|
||||
{ACPI_SIG_SRAT, NULL, AcpiDmDumpSrat, DtCompileSrat, "System Resource Affinity Table"},
|
||||
{ACPI_SIG_TCPA, AcpiDmTableInfoTcpa, NULL, NULL, "Trusted Computing Platform Alliance table"},
|
||||
{ACPI_SIG_UEFI, AcpiDmTableInfoUefi, NULL, NULL, "UEFI Boot Optimization Table"},
|
||||
{ACPI_SIG_WAET, AcpiDmTableInfoWaet, NULL, NULL, "Windows ACPI Emulated Devices Table"},
|
||||
{ACPI_SIG_WDAT, NULL, AcpiDmDumpWdat, DtCompileWdat, "Watchdog Action Table"},
|
||||
{ACPI_SIG_WDRT, AcpiDmTableInfoWdrt, NULL, NULL, "Watchdog Resource Table"},
|
||||
{ACPI_SIG_XSDT, NULL, AcpiDmDumpXsdt, DtCompileXsdt, "Extended System Description Table"},
|
||||
{NULL, NULL, NULL, NULL, NULL}
|
||||
"Undefined/Legacy",
|
||||
"Byte Access:8",
|
||||
"Word Access:16",
|
||||
"DWord Access:32",
|
||||
"QWord Access:64",
|
||||
"Unknown Width Encoding"
|
||||
};
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiTbGenerateChecksum
|
||||
* ACPI Table Data, indexed by signature.
|
||||
*
|
||||
* PARAMETERS: Table - Pointer to a valid ACPI table (with a
|
||||
* standard ACPI header)
|
||||
* Each entry contains: Signature, Table Info, Handler, DtHandler,
|
||||
* Template, Description
|
||||
*
|
||||
* Simple tables have only a TableInfo structure, complex tables have a
|
||||
* handler. This table must be NULL terminated. RSDP and FACS are
|
||||
* special-cased elsewhere.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
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_CPEP, NULL, AcpiDmDumpCpep, DtCompileCpep, TemplateCpep, "Corrected Platform Error Polling table"},
|
||||
{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_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_MCFG, NULL, AcpiDmDumpMcfg, DtCompileMcfg, TemplateMcfg, "Memory Mapped Configuration table"},
|
||||
{ACPI_SIG_MCHI, AcpiDmTableInfoMchi, NULL, NULL, TemplateMchi, "Management Controller Host Interface table"},
|
||||
{ACPI_SIG_MSCT, NULL, AcpiDmDumpMsct, DtCompileMsct, TemplateMsct, "Maximum System Characteristics Table"},
|
||||
{ACPI_SIG_RSDT, NULL, AcpiDmDumpRsdt, DtCompileRsdt, TemplateRsdt, "Root System Description Table"},
|
||||
{ACPI_SIG_SBST, AcpiDmTableInfoSbst, NULL, NULL, TemplateSbst, "Smart Battery Specification Table"},
|
||||
{ACPI_SIG_SLIC, NULL, AcpiDmDumpSlic, DtCompileSlic, TemplateSlic, "Software Licensing Description Table"},
|
||||
{ACPI_SIG_SLIT, NULL, AcpiDmDumpSlit, DtCompileSlit, TemplateSlit, "System Locality Information Table"},
|
||||
{ACPI_SIG_SPCR, AcpiDmTableInfoSpcr, NULL, NULL, TemplateSpcr, "Serial Port Console Redirection table"},
|
||||
{ACPI_SIG_SPMI, AcpiDmTableInfoSpmi, NULL, NULL, TemplateSpmi, "Server Platform Management Interface table"},
|
||||
{ACPI_SIG_SRAT, NULL, AcpiDmDumpSrat, DtCompileSrat, TemplateSrat, "System Resource Affinity Table"},
|
||||
{ACPI_SIG_TCPA, AcpiDmTableInfoTcpa, NULL, NULL, TemplateTcpa, "Trusted Computing Platform Alliance table"},
|
||||
{ACPI_SIG_UEFI, AcpiDmTableInfoUefi, NULL, DtCompileUefi, TemplateUefi, "UEFI Boot Optimization Table"},
|
||||
{ACPI_SIG_WAET, AcpiDmTableInfoWaet, NULL, NULL, TemplateWaet, "Windows ACPI Emulated Devices Table"},
|
||||
{ACPI_SIG_WDAT, NULL, AcpiDmDumpWdat, DtCompileWdat, TemplateWdat, "Watchdog Action Table"},
|
||||
{ACPI_SIG_WDDT, AcpiDmTableInfoWddt, NULL, NULL, TemplateWddt, "Watchdog Description Table"},
|
||||
{ACPI_SIG_WDRT, AcpiDmTableInfoWdrt, NULL, NULL, TemplateWdrt, "Watchdog Resource Table"},
|
||||
{ACPI_SIG_XSDT, NULL, AcpiDmDumpXsdt, DtCompileXsdt, TemplateXsdt, "Extended System Description Table"},
|
||||
{NULL, NULL, NULL, NULL, NULL, NULL}
|
||||
};
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiDmGenerateChecksum
|
||||
*
|
||||
* PARAMETERS: Table - Pointer to table to be checksummed
|
||||
* Length - Length of the table
|
||||
* OriginalChecksum - Value of the checksum field
|
||||
*
|
||||
* RETURN: 8 bit checksum of buffer
|
||||
*
|
||||
|
@ -292,19 +387,21 @@ static ACPI_DMTABLE_DATA AcpiDmTableData[] =
|
|||
******************************************************************************/
|
||||
|
||||
UINT8
|
||||
AcpiTbGenerateChecksum (
|
||||
ACPI_TABLE_HEADER *Table)
|
||||
AcpiDmGenerateChecksum (
|
||||
void *Table,
|
||||
UINT32 Length,
|
||||
UINT8 OriginalChecksum)
|
||||
{
|
||||
UINT8 Checksum;
|
||||
|
||||
|
||||
/* Sum the entire table as-is */
|
||||
|
||||
Checksum = AcpiTbChecksum ((UINT8 *) Table, Table->Length);
|
||||
Checksum = AcpiTbChecksum ((UINT8 *) Table, Length);
|
||||
|
||||
/* Subtract off the existing checksum value in the table */
|
||||
|
||||
Checksum = (UINT8) (Checksum - Table->Checksum);
|
||||
Checksum = (UINT8) (Checksum - OriginalChecksum);
|
||||
|
||||
/* Compute the final checksum */
|
||||
|
||||
|
@ -429,10 +526,14 @@ AcpiDmDumpDataTable (
|
|||
}
|
||||
}
|
||||
|
||||
/* Always dump the raw table data */
|
||||
if (!Gbl_DoTemplates || Gbl_VerboseTemplates)
|
||||
{
|
||||
/* Dump the raw table data */
|
||||
|
||||
AcpiOsPrintf ("\nRaw Table Data\n\n");
|
||||
AcpiOsPrintf ("\n%s: Length %d (0x%X)\n\n",
|
||||
ACPI_RAW_TABLE_DATA_HEADER, Length, Length);
|
||||
AcpiUtDumpBuffer2 (ACPI_CAST_PTR (UINT8, Table), Length, DB_BYTE_DISPLAY);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -460,15 +561,49 @@ AcpiDmLineHeader (
|
|||
char *Name)
|
||||
{
|
||||
|
||||
/* Allow a null name for fields that span multiple lines (large buffers) */
|
||||
|
||||
if (!Name)
|
||||
{
|
||||
Name = "";
|
||||
}
|
||||
|
||||
if (Gbl_DoTemplates && !Gbl_VerboseTemplates) /* Terse template */
|
||||
{
|
||||
if (ByteLength)
|
||||
{
|
||||
AcpiOsPrintf ("[%3.3Xh %4.4d% 3d] %28s : ",
|
||||
AcpiOsPrintf ("[%.4d] %34s : ", ByteLength, Name);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (*Name)
|
||||
{
|
||||
AcpiOsPrintf ("%41s : ", Name);
|
||||
}
|
||||
else
|
||||
{
|
||||
AcpiOsPrintf ("%41s ", Name);
|
||||
}
|
||||
}
|
||||
}
|
||||
else /* Normal disassembler or verbose template */
|
||||
{
|
||||
if (ByteLength)
|
||||
{
|
||||
AcpiOsPrintf ("[%3.3Xh %4.4d% 4d] %28s : ",
|
||||
Offset, Offset, ByteLength, Name);
|
||||
}
|
||||
else
|
||||
{
|
||||
AcpiOsPrintf ("%43s : ",
|
||||
Name);
|
||||
if (*Name)
|
||||
{
|
||||
AcpiOsPrintf ("%44s : ", Name);
|
||||
}
|
||||
else
|
||||
{
|
||||
AcpiOsPrintf ("%44s ", Name);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -480,16 +615,32 @@ AcpiDmLineHeader2 (
|
|||
UINT32 Value)
|
||||
{
|
||||
|
||||
if (Gbl_DoTemplates && !Gbl_VerboseTemplates) /* Terse template */
|
||||
{
|
||||
if (ByteLength)
|
||||
{
|
||||
AcpiOsPrintf ("[%.4d] %30s %3d : ",
|
||||
ByteLength, Name, Value);
|
||||
}
|
||||
else
|
||||
{
|
||||
AcpiOsPrintf ("%36s % 3d : ",
|
||||
Name, Value);
|
||||
}
|
||||
}
|
||||
else /* Normal disassembler or verbose template */
|
||||
{
|
||||
if (ByteLength)
|
||||
{
|
||||
AcpiOsPrintf ("[%3.3Xh %4.4d% 3d] %24s % 3d : ",
|
||||
AcpiOsPrintf ("[%3.3Xh %4.4d %3d] %24s %3d : ",
|
||||
Offset, Offset, ByteLength, Name, Value);
|
||||
}
|
||||
else
|
||||
{
|
||||
AcpiOsPrintf ("[%3.3Xh %4.4d ] %24s % 3d : ",
|
||||
AcpiOsPrintf ("[%3.3Xh %4.4d ] %24s %3d : ",
|
||||
Offset, Offset, Name, Value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -508,6 +659,8 @@ AcpiDmLineHeader2 (
|
|||
*
|
||||
* DESCRIPTION: Display ACPI table contents by walking the Info table.
|
||||
*
|
||||
* Note: This function must remain in sync with DtGetFieldLength.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
ACPI_STATUS
|
||||
|
@ -562,12 +715,17 @@ AcpiDmDumpTable (
|
|||
case ACPI_DMT_UINT8:
|
||||
case ACPI_DMT_CHKSUM:
|
||||
case ACPI_DMT_SPACEID:
|
||||
case ACPI_DMT_ACCWIDTH:
|
||||
case ACPI_DMT_IVRS:
|
||||
case ACPI_DMT_MADT:
|
||||
case ACPI_DMT_SRAT:
|
||||
case ACPI_DMT_ASF:
|
||||
case ACPI_DMT_HESTNTYP:
|
||||
case ACPI_DMT_FADTPM:
|
||||
case ACPI_DMT_EINJACT:
|
||||
case ACPI_DMT_EINJINST:
|
||||
case ACPI_DMT_ERSTACT:
|
||||
case ACPI_DMT_ERSTINST:
|
||||
ByteLength = 1;
|
||||
break;
|
||||
case ACPI_DMT_UINT16:
|
||||
|
@ -581,12 +739,14 @@ AcpiDmDumpTable (
|
|||
case ACPI_DMT_UINT32:
|
||||
case ACPI_DMT_NAME4:
|
||||
case ACPI_DMT_SIG:
|
||||
case ACPI_DMT_SLIC:
|
||||
ByteLength = 4;
|
||||
break;
|
||||
case ACPI_DMT_NAME6:
|
||||
ByteLength = 6;
|
||||
break;
|
||||
case ACPI_DMT_UINT56:
|
||||
case ACPI_DMT_BUF7:
|
||||
ByteLength = 7;
|
||||
break;
|
||||
case ACPI_DMT_UINT64:
|
||||
|
@ -594,8 +754,12 @@ AcpiDmDumpTable (
|
|||
ByteLength = 8;
|
||||
break;
|
||||
case ACPI_DMT_BUF16:
|
||||
case ACPI_DMT_UUID:
|
||||
ByteLength = 16;
|
||||
break;
|
||||
case ACPI_DMT_BUF128:
|
||||
ByteLength = 128;
|
||||
break;
|
||||
case ACPI_DMT_STRING:
|
||||
ByteLength = ACPI_STRLEN (ACPI_CAST_PTR (char, Target)) + 1;
|
||||
break;
|
||||
|
@ -696,17 +860,43 @@ AcpiDmDumpTable (
|
|||
ACPI_FORMAT_UINT64 (ACPI_GET64 (Target)));
|
||||
break;
|
||||
|
||||
case ACPI_DMT_BUF7:
|
||||
case ACPI_DMT_BUF16:
|
||||
case ACPI_DMT_BUF128:
|
||||
|
||||
/* Buffer of length 16 */
|
||||
|
||||
for (Temp8 = 0; Temp8 < 16; Temp8++)
|
||||
/*
|
||||
* Buffer: Size depends on the opcode and was set above.
|
||||
* Each hex byte is separated with a space.
|
||||
* Multiple lines are separated by line continuation char.
|
||||
*/
|
||||
for (Temp16 = 0; Temp16 < ByteLength; Temp16++)
|
||||
{
|
||||
AcpiOsPrintf ("%2.2X,", Target[Temp8]);
|
||||
AcpiOsPrintf ("%2.2X", Target[Temp16]);
|
||||
if ((UINT32) (Temp16 + 1) < ByteLength)
|
||||
{
|
||||
if ((Temp16 > 0) && (!((Temp16+1) % 16)))
|
||||
{
|
||||
AcpiOsPrintf (" \\\n"); /* Line continuation */
|
||||
AcpiDmLineHeader (0, 0, NULL);
|
||||
}
|
||||
else
|
||||
{
|
||||
AcpiOsPrintf (" ");
|
||||
}
|
||||
}
|
||||
}
|
||||
AcpiOsPrintf ("\n");
|
||||
break;
|
||||
|
||||
case ACPI_DMT_UUID:
|
||||
|
||||
/* Convert 16-byte UUID buffer to 36-byte formatted UUID string */
|
||||
|
||||
(void) AuConvertUuidToString ((char *) Target, MsgBuffer);
|
||||
|
||||
AcpiOsPrintf ("%s\n", MsgBuffer);
|
||||
break;
|
||||
|
||||
case ACPI_DMT_STRING:
|
||||
|
||||
AcpiOsPrintf ("\"%s\"\n", ACPI_CAST_PTR (char, Target));
|
||||
|
@ -721,9 +911,12 @@ AcpiDmDumpTable (
|
|||
TableData = AcpiDmGetTableData (ACPI_CAST_PTR (char, Target));
|
||||
if (TableData)
|
||||
{
|
||||
AcpiOsPrintf ("/* %s */", TableData->Name);
|
||||
AcpiOsPrintf (STRING_FORMAT, TableData->Name);
|
||||
}
|
||||
else
|
||||
{
|
||||
AcpiOsPrintf ("\n");
|
||||
}
|
||||
break;
|
||||
|
||||
case ACPI_DMT_NAME4:
|
||||
|
@ -751,7 +944,9 @@ AcpiDmDumpTable (
|
|||
/* Checksum, display and validate */
|
||||
|
||||
AcpiOsPrintf ("%2.2X", *Target);
|
||||
Temp8 = AcpiTbGenerateChecksum (Table);
|
||||
Temp8 = AcpiDmGenerateChecksum (Table,
|
||||
ACPI_CAST_PTR (ACPI_TABLE_HEADER, Table)->Length,
|
||||
ACPI_CAST_PTR (ACPI_TABLE_HEADER, Table)->Checksum);
|
||||
if (Temp8 != ACPI_CAST_PTR (ACPI_TABLE_HEADER, Table)->Checksum)
|
||||
{
|
||||
AcpiOsPrintf (
|
||||
|
@ -764,14 +959,27 @@ AcpiDmDumpTable (
|
|||
|
||||
/* Address Space ID */
|
||||
|
||||
AcpiOsPrintf ("%2.2X (%s)\n", *Target, AcpiUtGetRegionName (*Target));
|
||||
AcpiOsPrintf (UINT8_FORMAT, *Target, AcpiUtGetRegionName (*Target));
|
||||
break;
|
||||
|
||||
case ACPI_DMT_ACCWIDTH:
|
||||
|
||||
/* Encoded Access Width */
|
||||
|
||||
Temp8 = *Target;
|
||||
if (Temp8 > ACPI_GAS_WIDTH_RESERVED)
|
||||
{
|
||||
Temp8 = ACPI_GAS_WIDTH_RESERVED;
|
||||
}
|
||||
|
||||
AcpiOsPrintf (UINT8_FORMAT, Temp8, AcpiDmGasAccessWidth[Temp8]);
|
||||
break;
|
||||
|
||||
case ACPI_DMT_GAS:
|
||||
|
||||
/* Generic Address Structure */
|
||||
|
||||
AcpiOsPrintf ("<Generic Address Structure>\n");
|
||||
AcpiOsPrintf (STRING_FORMAT, "Generic Address Structure");
|
||||
AcpiDmDumpTable (TableLength, CurrentOffset, Target,
|
||||
sizeof (ACPI_GENERIC_ADDRESS), AcpiDmTableInfoGas);
|
||||
AcpiOsPrintf ("\n");
|
||||
|
@ -788,7 +996,7 @@ AcpiDmDumpTable (
|
|||
Temp16 = ACPI_ASF_TYPE_RESERVED;
|
||||
}
|
||||
|
||||
AcpiOsPrintf ("%2.2X <%s>\n", *Target, AcpiDmAsfSubnames[Temp16]);
|
||||
AcpiOsPrintf (UINT8_FORMAT, *Target, AcpiDmAsfSubnames[Temp16]);
|
||||
break;
|
||||
|
||||
case ACPI_DMT_DMAR:
|
||||
|
@ -801,7 +1009,59 @@ AcpiDmDumpTable (
|
|||
Temp16 = ACPI_DMAR_TYPE_RESERVED;
|
||||
}
|
||||
|
||||
AcpiOsPrintf ("%4.4X <%s>\n", ACPI_GET16 (Target), AcpiDmDmarSubnames[Temp16]);
|
||||
AcpiOsPrintf (UINT16_FORMAT, ACPI_GET16 (Target), AcpiDmDmarSubnames[Temp16]);
|
||||
break;
|
||||
|
||||
case ACPI_DMT_EINJACT:
|
||||
|
||||
/* EINJ Action types */
|
||||
|
||||
Temp8 = *Target;
|
||||
if (Temp8 > ACPI_EINJ_ACTION_RESERVED)
|
||||
{
|
||||
Temp8 = ACPI_EINJ_ACTION_RESERVED;
|
||||
}
|
||||
|
||||
AcpiOsPrintf (UINT8_FORMAT, *Target, AcpiDmEinjActions[Temp8]);
|
||||
break;
|
||||
|
||||
case ACPI_DMT_EINJINST:
|
||||
|
||||
/* EINJ Instruction types */
|
||||
|
||||
Temp8 = *Target;
|
||||
if (Temp8 > ACPI_EINJ_INSTRUCTION_RESERVED)
|
||||
{
|
||||
Temp8 = ACPI_EINJ_INSTRUCTION_RESERVED;
|
||||
}
|
||||
|
||||
AcpiOsPrintf (UINT8_FORMAT, *Target, AcpiDmEinjInstructions[Temp8]);
|
||||
break;
|
||||
|
||||
case ACPI_DMT_ERSTACT:
|
||||
|
||||
/* ERST Action types */
|
||||
|
||||
Temp8 = *Target;
|
||||
if (Temp8 > ACPI_ERST_ACTION_RESERVED)
|
||||
{
|
||||
Temp8 = ACPI_ERST_ACTION_RESERVED;
|
||||
}
|
||||
|
||||
AcpiOsPrintf (UINT8_FORMAT, *Target, AcpiDmErstActions[Temp8]);
|
||||
break;
|
||||
|
||||
case ACPI_DMT_ERSTINST:
|
||||
|
||||
/* ERST Instruction types */
|
||||
|
||||
Temp8 = *Target;
|
||||
if (Temp8 > ACPI_ERST_INSTRUCTION_RESERVED)
|
||||
{
|
||||
Temp8 = ACPI_ERST_INSTRUCTION_RESERVED;
|
||||
}
|
||||
|
||||
AcpiOsPrintf (UINT8_FORMAT, *Target, AcpiDmErstInstructions[Temp8]);
|
||||
break;
|
||||
|
||||
case ACPI_DMT_HEST:
|
||||
|
@ -814,12 +1074,12 @@ AcpiDmDumpTable (
|
|||
Temp16 = ACPI_HEST_TYPE_RESERVED;
|
||||
}
|
||||
|
||||
AcpiOsPrintf ("%4.4X (%s)\n", ACPI_GET16 (Target), AcpiDmHestSubnames[Temp16]);
|
||||
AcpiOsPrintf (UINT16_FORMAT, ACPI_GET16 (Target), AcpiDmHestSubnames[Temp16]);
|
||||
break;
|
||||
|
||||
case ACPI_DMT_HESTNTFY:
|
||||
|
||||
AcpiOsPrintf ("<Hardware Error Notification Structure>\n");
|
||||
AcpiOsPrintf (STRING_FORMAT, "Hardware Error Notification Structure");
|
||||
AcpiDmDumpTable (TableLength, CurrentOffset, Target,
|
||||
sizeof (ACPI_HEST_NOTIFY), AcpiDmTableInfoHestNotify);
|
||||
AcpiOsPrintf ("\n");
|
||||
|
@ -836,10 +1096,9 @@ AcpiDmDumpTable (
|
|||
Temp8 = ACPI_HEST_NOTIFY_RESERVED;
|
||||
}
|
||||
|
||||
AcpiOsPrintf ("%2.2X (%s)\n", *Target, AcpiDmHestNotifySubnames[Temp8]);
|
||||
AcpiOsPrintf (UINT8_FORMAT, *Target, AcpiDmHestNotifySubnames[Temp8]);
|
||||
break;
|
||||
|
||||
|
||||
case ACPI_DMT_MADT:
|
||||
|
||||
/* MADT subtable types */
|
||||
|
@ -850,7 +1109,20 @@ AcpiDmDumpTable (
|
|||
Temp8 = ACPI_MADT_TYPE_RESERVED;
|
||||
}
|
||||
|
||||
AcpiOsPrintf ("%2.2X <%s>\n", *Target, AcpiDmMadtSubnames[Temp8]);
|
||||
AcpiOsPrintf (UINT8_FORMAT, *Target, AcpiDmMadtSubnames[Temp8]);
|
||||
break;
|
||||
|
||||
case ACPI_DMT_SLIC:
|
||||
|
||||
/* SLIC subtable types */
|
||||
|
||||
Temp8 = *Target;
|
||||
if (Temp8 > ACPI_SLIC_TYPE_RESERVED)
|
||||
{
|
||||
Temp8 = ACPI_SLIC_TYPE_RESERVED;
|
||||
}
|
||||
|
||||
AcpiOsPrintf (UINT32_FORMAT, *Target, AcpiDmSlicSubnames[Temp8]);
|
||||
break;
|
||||
|
||||
case ACPI_DMT_SRAT:
|
||||
|
@ -863,7 +1135,7 @@ AcpiDmDumpTable (
|
|||
Temp8 = ACPI_SRAT_TYPE_RESERVED;
|
||||
}
|
||||
|
||||
AcpiOsPrintf ("%2.2X <%s>\n", *Target, AcpiDmSratSubnames[Temp8]);
|
||||
AcpiOsPrintf (UINT8_FORMAT, *Target, AcpiDmSratSubnames[Temp8]);
|
||||
break;
|
||||
|
||||
case ACPI_DMT_FADTPM:
|
||||
|
@ -876,7 +1148,7 @@ AcpiDmDumpTable (
|
|||
Temp8 = ACPI_FADT_PM_RESERVED;
|
||||
}
|
||||
|
||||
AcpiOsPrintf ("%2.2X (%s)\n", *Target, AcpiDmFadtProfiles[Temp8]);
|
||||
AcpiOsPrintf (UINT8_FORMAT, *Target, AcpiDmFadtProfiles[Temp8]);
|
||||
break;
|
||||
|
||||
case ACPI_DMT_IVRS:
|
||||
|
@ -901,7 +1173,7 @@ AcpiDmDumpTable (
|
|||
break;
|
||||
}
|
||||
|
||||
AcpiOsPrintf ("%2.2X <%s>\n", *Target, Name);
|
||||
AcpiOsPrintf (UINT8_FORMAT, *Target, Name);
|
||||
break;
|
||||
|
||||
case ACPI_DMT_EXIT:
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
|
@ -124,13 +124,20 @@
|
|||
ACPI_MODULE_NAME ("dmtbdump")
|
||||
|
||||
|
||||
static void
|
||||
AcpiDmValidateFadtLength (
|
||||
UINT32 Revision,
|
||||
UINT32 Length);
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiDmDumpRsdp
|
||||
*
|
||||
* PARAMETERS: Table - A RSDP
|
||||
*
|
||||
* RETURN: Length of the table (there is no length field, use revision)
|
||||
* RETURN: Length of the table (there is not always a length field,
|
||||
* use revision or length if available (ACPI 2.0+))
|
||||
*
|
||||
* DESCRIPTION: Format the contents of a RSDP
|
||||
*
|
||||
|
@ -140,19 +147,42 @@ UINT32
|
|||
AcpiDmDumpRsdp (
|
||||
ACPI_TABLE_HEADER *Table)
|
||||
{
|
||||
UINT32 Length = ACPI_RSDP_REV0_SIZE;
|
||||
ACPI_TABLE_RSDP *Rsdp = ACPI_CAST_PTR (ACPI_TABLE_RSDP, Table);
|
||||
UINT32 Length = sizeof (ACPI_RSDP_COMMON);
|
||||
UINT8 Checksum;
|
||||
|
||||
|
||||
/* Dump the common ACPI 1.0 portion */
|
||||
|
||||
AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoRsdp1);
|
||||
|
||||
/* ACPI 2.0+ contains more data and has a Length field */
|
||||
/* Validate the first checksum */
|
||||
|
||||
if (ACPI_CAST_PTR (ACPI_TABLE_RSDP, Table)->Revision > 0)
|
||||
Checksum = AcpiDmGenerateChecksum (Rsdp, sizeof (ACPI_RSDP_COMMON),
|
||||
Rsdp->Checksum);
|
||||
if (Checksum != Rsdp->Checksum)
|
||||
{
|
||||
Length = ACPI_CAST_PTR (ACPI_TABLE_RSDP, Table)->Length;
|
||||
AcpiOsPrintf ("/* Incorrect Checksum above, should be 0x%2.2X */\n",
|
||||
Checksum);
|
||||
}
|
||||
|
||||
/* The RSDP for ACPI 2.0+ contains more data and has a Length field */
|
||||
|
||||
if (Rsdp->Revision > 0)
|
||||
{
|
||||
Length = Rsdp->Length;
|
||||
AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoRsdp2);
|
||||
|
||||
/* Validate the extended checksum over entire RSDP */
|
||||
|
||||
Checksum = AcpiDmGenerateChecksum (Rsdp, sizeof (ACPI_TABLE_RSDP),
|
||||
Rsdp->ExtendedChecksum);
|
||||
if (Checksum != Rsdp->ExtendedChecksum)
|
||||
{
|
||||
AcpiOsPrintf (
|
||||
"/* Incorrect Extended Checksum above, should be 0x%2.2X */\n",
|
||||
Checksum);
|
||||
}
|
||||
}
|
||||
|
||||
return (Length);
|
||||
|
@ -249,6 +279,10 @@ AcpiDmDumpXsdt (
|
|||
*
|
||||
* DESCRIPTION: Format the contents of a FADT
|
||||
*
|
||||
* NOTE: We cannot depend on the FADT version to indicate the actual
|
||||
* contents of the FADT because of BIOS bugs. The table length
|
||||
* is the only reliable indicator.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
void
|
||||
|
@ -256,20 +290,21 @@ AcpiDmDumpFadt (
|
|||
ACPI_TABLE_HEADER *Table)
|
||||
{
|
||||
|
||||
/* Common ACPI 1.0 portion of FADT */
|
||||
/* Always dump the minimum FADT revision 1 fields (ACPI 1.0) */
|
||||
|
||||
AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoFadt1);
|
||||
|
||||
/* Check for ACPI 1.0B MS extensions (FADT revision 2) */
|
||||
/* Check for FADT revision 2 fields (ACPI 1.0B MS extensions) */
|
||||
|
||||
if (Table->Revision == 2)
|
||||
if ((Table->Length > ACPI_FADT_V1_SIZE) &&
|
||||
(Table->Length <= ACPI_FADT_V2_SIZE))
|
||||
{
|
||||
AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoFadt2);
|
||||
}
|
||||
|
||||
/* Check for ACPI 2.0+ extended data (FADT revision 3+) */
|
||||
/* Check for FADT revision 3 fields and up (ACPI 2.0+ extended data) */
|
||||
|
||||
else if (Table->Length >= sizeof (ACPI_TABLE_FADT))
|
||||
else if (Table->Length > ACPI_FADT_V2_SIZE)
|
||||
{
|
||||
AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoFadt3);
|
||||
}
|
||||
|
@ -277,6 +312,68 @@ AcpiDmDumpFadt (
|
|||
/* Validate various fields in the FADT, including length */
|
||||
|
||||
AcpiTbCreateLocalFadt (Table, Table->Length);
|
||||
|
||||
/* Validate FADT length against the revision */
|
||||
|
||||
AcpiDmValidateFadtLength (Table->Revision, Table->Length);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiDmValidateFadtLength
|
||||
*
|
||||
* PARAMETERS: Revision - FADT revision (Header->Revision)
|
||||
* Length - FADT length (Header->Length
|
||||
*
|
||||
* RETURN: None
|
||||
*
|
||||
* DESCRIPTION: Check the FADT revision against the expected table length for
|
||||
* that revision. Issue a warning if the length is not what was
|
||||
* expected. This seems to be such a common BIOS bug that the
|
||||
* FADT revision has been rendered virtually meaningless.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
static void
|
||||
AcpiDmValidateFadtLength (
|
||||
UINT32 Revision,
|
||||
UINT32 Length)
|
||||
{
|
||||
UINT32 ExpectedLength;
|
||||
|
||||
|
||||
switch (Revision)
|
||||
{
|
||||
case 0:
|
||||
AcpiOsPrintf ("// ACPI Warning: Invalid FADT revision: 0\n");
|
||||
return;
|
||||
|
||||
case 1:
|
||||
ExpectedLength = ACPI_FADT_V1_SIZE;
|
||||
break;
|
||||
|
||||
case 2:
|
||||
ExpectedLength = ACPI_FADT_V2_SIZE;
|
||||
break;
|
||||
|
||||
case 3:
|
||||
case 4:
|
||||
ExpectedLength = ACPI_FADT_V3_SIZE;
|
||||
break;
|
||||
|
||||
default:
|
||||
return;
|
||||
}
|
||||
|
||||
if (Length == ExpectedLength)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
AcpiOsPrintf (
|
||||
"\n// ACPI Warning: FADT revision %X does not match length: found %X expected %X\n",
|
||||
Revision, Length, ExpectedLength);
|
||||
}
|
||||
|
||||
|
||||
|
@ -595,7 +692,7 @@ AcpiDmDumpDmar (
|
|||
while (PathOffset < ScopeTable->Length)
|
||||
{
|
||||
AcpiDmLineHeader ((PathOffset + ScopeOffset + Offset), 2, "PCI Path");
|
||||
AcpiOsPrintf ("[%2.2X, %2.2X]\n", PciPath[0], PciPath[1]);
|
||||
AcpiOsPrintf ("%2.2X,%2.2X\n", PciPath[0], PciPath[1]);
|
||||
|
||||
/* Point to next PCI Path entry */
|
||||
|
||||
|
@ -709,7 +806,7 @@ AcpiDmDumpErst (
|
|||
{
|
||||
AcpiOsPrintf ("\n");
|
||||
Status = AcpiDmDumpTable (Length, Offset, SubTable,
|
||||
sizeof (ACPI_WHEA_HEADER), AcpiDmTableInfoEinj0);
|
||||
sizeof (ACPI_WHEA_HEADER), AcpiDmTableInfoErst0);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return;
|
||||
|
@ -1248,6 +1345,81 @@ AcpiDmDumpMsct (
|
|||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiDmDumpSlic
|
||||
*
|
||||
* PARAMETERS: Table - A SLIC table
|
||||
*
|
||||
* RETURN: None
|
||||
*
|
||||
* DESCRIPTION: Format the contents of a SLIC
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
void
|
||||
AcpiDmDumpSlic (
|
||||
ACPI_TABLE_HEADER *Table)
|
||||
{
|
||||
ACPI_STATUS Status;
|
||||
UINT32 Offset = sizeof (ACPI_TABLE_SLIC);
|
||||
ACPI_SLIC_HEADER *SubTable;
|
||||
ACPI_DMTABLE_INFO *InfoTable;
|
||||
|
||||
|
||||
/* There is no main SLIC table, only subtables */
|
||||
|
||||
SubTable = ACPI_ADD_PTR (ACPI_SLIC_HEADER, Table, Offset);
|
||||
while (Offset < Table->Length)
|
||||
{
|
||||
/* Common sub-table header */
|
||||
|
||||
AcpiOsPrintf ("\n");
|
||||
Status = AcpiDmDumpTable (Table->Length, Offset, SubTable,
|
||||
SubTable->Length, AcpiDmTableInfoSlicHdr);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
switch (SubTable->Type)
|
||||
{
|
||||
case ACPI_SLIC_TYPE_PUBLIC_KEY:
|
||||
InfoTable = AcpiDmTableInfoSlic0;
|
||||
break;
|
||||
case ACPI_SLIC_TYPE_WINDOWS_MARKER:
|
||||
InfoTable = AcpiDmTableInfoSlic1;
|
||||
break;
|
||||
default:
|
||||
AcpiOsPrintf ("\n**** Unknown SLIC sub-table type 0x%X\n", SubTable->Type);
|
||||
|
||||
/* Attempt to continue */
|
||||
|
||||
if (!SubTable->Length)
|
||||
{
|
||||
AcpiOsPrintf ("Invalid zero length subtable\n");
|
||||
return;
|
||||
}
|
||||
goto NextSubTable;
|
||||
}
|
||||
|
||||
AcpiOsPrintf ("\n");
|
||||
Status = AcpiDmDumpTable (Table->Length, Offset, SubTable,
|
||||
SubTable->Length, InfoTable);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
NextSubTable:
|
||||
/* Point to next sub-table */
|
||||
|
||||
Offset += SubTable->Length;
|
||||
SubTable = ACPI_ADD_PTR (ACPI_SLIC_HEADER, SubTable, SubTable->Length);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiDmDumpSlit
|
||||
|
@ -1301,15 +1473,20 @@ AcpiDmDumpSlit (
|
|||
return;
|
||||
}
|
||||
|
||||
AcpiOsPrintf ("%2.2X ", Row[j]);
|
||||
AcpiOsPrintf ("%2.2X", Row[j]);
|
||||
Offset++;
|
||||
|
||||
/* Display up to 16 bytes per output row */
|
||||
|
||||
if (j && (((j+1) % 16) == 0) && ((j+1) < Localities))
|
||||
if ((j+1) < Localities)
|
||||
{
|
||||
AcpiOsPrintf ("\n");
|
||||
AcpiDmLineHeader (Offset, 0, "");
|
||||
AcpiOsPrintf (" ");
|
||||
|
||||
if (j && (((j+1) % 16) == 0))
|
||||
{
|
||||
AcpiOsPrintf ("\\\n"); /* With line continuation char */
|
||||
AcpiDmLineHeader (Offset, 0, NULL);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
|
@ -122,6 +122,31 @@
|
|||
#define _COMPONENT ACPI_CA_DISASSEMBLER
|
||||
ACPI_MODULE_NAME ("dmtbinfo")
|
||||
|
||||
/*
|
||||
* How to add a new table:
|
||||
*
|
||||
* - Add the C table definition to the actbl1.h or actbl2.h header.
|
||||
* - Add ACPI_xxxx_OFFSET macro(s) for the table (and subtables) to list below.
|
||||
* - Define the table in this file (for the disassembler). If any
|
||||
* new data types are required (ACPI_DMT_*), see below.
|
||||
* - Add an external declaration for the new table definition (AcpiDmTableInfo*)
|
||||
* in acdisam.h
|
||||
* - Add new table definition to the dispatch table in dmtable.c (AcpiDmTableData)
|
||||
* If a simple table (with no subtables), no disassembly code is needed.
|
||||
* Otherwise, create the AcpiDmDump* function for to disassemble the table
|
||||
* and add it to the dmtbdump.c file.
|
||||
* - Add an external declaration for the new AcpiDmDump* function in acdisasm.h
|
||||
* - Add the new AcpiDmDump* function to the dispatch table in dmtable.c
|
||||
* - Create a template for the new table
|
||||
* - Add data table compiler support
|
||||
*
|
||||
* How to add a new data type (ACPI_DMT_*):
|
||||
*
|
||||
* - Add new type at the end of the ACPI_DMT list in acdisasm.h
|
||||
* - Add length and implementation cases in dmtable.c (disassembler)
|
||||
* - Add type and length cases in dtutils.c (DT compiler)
|
||||
*/
|
||||
|
||||
/*
|
||||
* Macros used to generate offsets to specific table fields
|
||||
*/
|
||||
|
@ -153,6 +178,7 @@
|
|||
#define ACPI_UEFI_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_UEFI,f)
|
||||
#define ACPI_WAET_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_WAET,f)
|
||||
#define ACPI_WDAT_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_WDAT,f)
|
||||
#define ACPI_WDDT_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_WDDT,f)
|
||||
#define ACPI_WDRT_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_WDRT,f)
|
||||
|
||||
/* Subtables */
|
||||
|
@ -171,6 +197,7 @@
|
|||
#define ACPI_DMAR2_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_DMAR_ATSR,f)
|
||||
#define ACPI_DMAR3_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_DMAR_RHSA,f)
|
||||
#define ACPI_EINJ0_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_WHEA_HEADER,f)
|
||||
#define ACPI_ERST0_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_WHEA_HEADER,f)
|
||||
#define ACPI_HEST0_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_HEST_IA_MACHINE_CHECK,f)
|
||||
#define ACPI_HEST1_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_HEST_IA_CORRECTED,f)
|
||||
#define ACPI_HEST2_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_HEST_IA_NMI,f)
|
||||
|
@ -201,6 +228,9 @@
|
|||
#define ACPI_MADTH_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_SUBTABLE_HEADER,f)
|
||||
#define ACPI_MCFG0_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_MCFG_ALLOCATION,f)
|
||||
#define ACPI_MSCT0_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_MSCT_PROXIMITY,f)
|
||||
#define ACPI_SLICH_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_SLIC_HEADER,f)
|
||||
#define ACPI_SLIC0_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_SLIC_KEY,f)
|
||||
#define ACPI_SLIC1_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_SLIC_MARKER,f)
|
||||
#define ACPI_SRATH_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_SUBTABLE_HEADER,f)
|
||||
#define ACPI_SRAT0_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_SRAT_CPU_AFFINITY,f)
|
||||
#define ACPI_SRAT1_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_SRAT_MEM_AFFINITY,f)
|
||||
|
@ -229,6 +259,12 @@
|
|||
#define ACPI_MADT8_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_MADT_INTERRUPT_SOURCE,f,o)
|
||||
#define ACPI_MADT9_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_MADT_LOCAL_X2APIC,f,o)
|
||||
#define ACPI_MADT10_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_MADT_LOCAL_X2APIC_NMI,f,o)
|
||||
#define ACPI_WDDT_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_TABLE_WDDT,f,o)
|
||||
#define ACPI_EINJ0_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_WHEA_HEADER,f,o)
|
||||
#define ACPI_ERST0_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_WHEA_HEADER,f,o)
|
||||
#define ACPI_HEST0_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_HEST_IA_MACHINE_CHECK,f,o)
|
||||
#define ACPI_HEST1_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_HEST_IA_CORRECTED,f,o)
|
||||
#define ACPI_HEST6_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_HEST_AER_ROOT,f,o)
|
||||
|
||||
/*
|
||||
* Required terminator for all tables below
|
||||
|
@ -274,7 +310,7 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoGas[] =
|
|||
{ACPI_DMT_SPACEID, ACPI_GAS_OFFSET (SpaceId), "Space ID", 0},
|
||||
{ACPI_DMT_UINT8, ACPI_GAS_OFFSET (BitWidth), "Bit Width", 0},
|
||||
{ACPI_DMT_UINT8, ACPI_GAS_OFFSET (BitOffset), "Bit Offset", 0},
|
||||
{ACPI_DMT_UINT8, ACPI_GAS_OFFSET (AccessWidth), "Access Width", 0},
|
||||
{ACPI_DMT_ACCWIDTH, ACPI_GAS_OFFSET (AccessWidth), "Encoded Access Width", 0},
|
||||
{ACPI_DMT_UINT64, ACPI_GAS_OFFSET (Address), "Address", 0},
|
||||
ACPI_DMT_TERMINATOR
|
||||
};
|
||||
|
@ -541,7 +577,7 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoAsf2a[] =
|
|||
|
||||
ACPI_DMTABLE_INFO AcpiDmTableInfoAsf3[] =
|
||||
{
|
||||
{ACPI_DMT_UINT56, ACPI_ASF3_OFFSET (Capabilities[0]), "Capabilities", 0},
|
||||
{ACPI_DMT_BUF7, ACPI_ASF3_OFFSET (Capabilities[0]), "Capabilities", 0},
|
||||
{ACPI_DMT_UINT8, ACPI_ASF3_OFFSET (CompletionCode), "Completion Code", 0},
|
||||
{ACPI_DMT_UINT32, ACPI_ASF3_OFFSET (EnterpriseId), "Enterprise ID", 0},
|
||||
{ACPI_DMT_UINT8, ACPI_ASF3_OFFSET (Command), "Command", 0},
|
||||
|
@ -731,7 +767,7 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoEcdt[] =
|
|||
|
||||
ACPI_DMTABLE_INFO AcpiDmTableInfoEinj[] =
|
||||
{
|
||||
{ACPI_DMT_UINT32, ACPI_EINJ_OFFSET (HeaderLength), "Injection Header Length", DT_LENGTH},
|
||||
{ACPI_DMT_UINT32, ACPI_EINJ_OFFSET (HeaderLength), "Injection Header Length", 0},
|
||||
{ACPI_DMT_UINT8, ACPI_EINJ_OFFSET (Flags), "Flags", 0},
|
||||
{ACPI_DMT_UINT24, ACPI_EINJ_OFFSET (Reserved[0]), "Reserved", 0},
|
||||
{ACPI_DMT_UINT32, ACPI_EINJ_OFFSET (Entries), "Injection Entry Count", 0},
|
||||
|
@ -740,9 +776,11 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoEinj[] =
|
|||
|
||||
ACPI_DMTABLE_INFO AcpiDmTableInfoEinj0[] =
|
||||
{
|
||||
{ACPI_DMT_UINT8, ACPI_EINJ0_OFFSET (Action), "Action", 0},
|
||||
{ACPI_DMT_UINT8, ACPI_EINJ0_OFFSET (Instruction), "Instruction", 0},
|
||||
{ACPI_DMT_UINT8, ACPI_EINJ0_OFFSET (Flags), "Flags", 0},
|
||||
{ACPI_DMT_EINJACT, ACPI_EINJ0_OFFSET (Action), "Action", 0},
|
||||
{ACPI_DMT_EINJINST, ACPI_EINJ0_OFFSET (Instruction), "Instruction", 0},
|
||||
{ACPI_DMT_UINT8, ACPI_EINJ0_OFFSET (Flags), "Flags (decoded below)", DT_FLAG},
|
||||
{ACPI_DMT_FLAG0, ACPI_EINJ0_FLAG_OFFSET (Flags,0), "Preserve Register Bits", 0},
|
||||
|
||||
{ACPI_DMT_UINT8, ACPI_EINJ0_OFFSET (Reserved), "Reserved", 0},
|
||||
{ACPI_DMT_GAS, ACPI_EINJ0_OFFSET (RegisterRegion), "Register Region", 0},
|
||||
{ACPI_DMT_UINT64, ACPI_EINJ0_OFFSET (Value), "Value", 0},
|
||||
|
@ -759,12 +797,26 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoEinj0[] =
|
|||
|
||||
ACPI_DMTABLE_INFO AcpiDmTableInfoErst[] =
|
||||
{
|
||||
{ACPI_DMT_UINT32, ACPI_ERST_OFFSET (HeaderLength), "Serialization Header Length", DT_LENGTH},
|
||||
{ACPI_DMT_UINT32, ACPI_ERST_OFFSET (HeaderLength), "Serialization Header Length", 0},
|
||||
{ACPI_DMT_UINT32, ACPI_ERST_OFFSET (Reserved), "Reserved", 0},
|
||||
{ACPI_DMT_UINT32, ACPI_ERST_OFFSET (Entries), "Instruction Entry Count", 0},
|
||||
ACPI_DMT_TERMINATOR
|
||||
};
|
||||
|
||||
ACPI_DMTABLE_INFO AcpiDmTableInfoErst0[] =
|
||||
{
|
||||
{ACPI_DMT_ERSTACT, ACPI_ERST0_OFFSET (Action), "Action", 0},
|
||||
{ACPI_DMT_ERSTINST, ACPI_ERST0_OFFSET (Instruction), "Instruction", 0},
|
||||
{ACPI_DMT_UINT8, ACPI_ERST0_OFFSET (Flags), "Flags (decoded below)", DT_FLAG},
|
||||
{ACPI_DMT_FLAG0, ACPI_ERST0_FLAG_OFFSET (Flags,0), "Preserve Register Bits", 0},
|
||||
|
||||
{ACPI_DMT_UINT8, ACPI_ERST0_OFFSET (Reserved), "Reserved", 0},
|
||||
{ACPI_DMT_GAS, ACPI_ERST0_OFFSET (RegisterRegion), "Register Region", 0},
|
||||
{ACPI_DMT_UINT64, ACPI_ERST0_OFFSET (Value), "Value", 0},
|
||||
{ACPI_DMT_UINT64, ACPI_ERST0_OFFSET (Mask), "Mask", 0},
|
||||
ACPI_DMT_TERMINATOR
|
||||
};
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
|
@ -786,7 +838,8 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoHest[] =
|
|||
|
||||
#define ACPI_DM_HEST_AER \
|
||||
{ACPI_DMT_UINT16, ACPI_HEST6_OFFSET (Aer.Reserved1), "Reserved", 0}, \
|
||||
{ACPI_DMT_UINT8, ACPI_HEST6_OFFSET (Aer.Flags), "Flags", 0}, \
|
||||
{ACPI_DMT_UINT8, ACPI_HEST6_OFFSET (Aer.Flags), "Flags (decoded below)", DT_FLAG}, \
|
||||
{ACPI_DMT_FLAG0, ACPI_HEST6_FLAG_OFFSET (Aer.Flags,0), "Firmware First", 0}, \
|
||||
{ACPI_DMT_UINT8, ACPI_HEST6_OFFSET (Aer.Enabled), "Enabled", 0}, \
|
||||
{ACPI_DMT_UINT32, ACPI_HEST6_OFFSET (Aer.RecordsToPreallocate), "Records To Preallocate", 0}, \
|
||||
{ACPI_DMT_UINT32, ACPI_HEST6_OFFSET (Aer.MaxSectionsPerRecord), "Max Sections Per Record", 0}, \
|
||||
|
@ -808,15 +861,17 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoHest[] =
|
|||
ACPI_DMTABLE_INFO AcpiDmTableInfoHest0[] =
|
||||
{
|
||||
ACPI_DM_HEST_HEADER,
|
||||
{ACPI_DMT_UINT16, ACPI_HEST0_OFFSET (Reserved1), "Reserved", 0},
|
||||
{ACPI_DMT_UINT8, ACPI_HEST0_OFFSET (Flags), "Flags", 0},
|
||||
{ACPI_DMT_UINT16, ACPI_HEST0_OFFSET (Reserved1), "Reserved1", 0},
|
||||
{ACPI_DMT_UINT8, ACPI_HEST0_OFFSET (Flags), "Flags (decoded below)", DT_FLAG},
|
||||
{ACPI_DMT_FLAG0, ACPI_HEST0_FLAG_OFFSET (Flags,0), "Firmware First", 0},
|
||||
|
||||
{ACPI_DMT_UINT8, ACPI_HEST0_OFFSET (Enabled), "Enabled", 0},
|
||||
{ACPI_DMT_UINT32, ACPI_HEST0_OFFSET (RecordsToPreallocate), "Records To Preallocate", 0},
|
||||
{ACPI_DMT_UINT32, ACPI_HEST0_OFFSET (MaxSectionsPerRecord), "Max Sections Per Record", 0},
|
||||
{ACPI_DMT_UINT64, ACPI_HEST0_OFFSET (GlobalCapabilityData), "Global Capability Data", 0},
|
||||
{ACPI_DMT_UINT64, ACPI_HEST0_OFFSET (GlobalControlData), "Global Control Data", 0},
|
||||
{ACPI_DMT_UINT8, ACPI_HEST0_OFFSET (NumHardwareBanks), "Num Hardware Banks", 0},
|
||||
{ACPI_DMT_UINT56, ACPI_HEST0_OFFSET (Reserved3[0]), "Reserved", 0},
|
||||
{ACPI_DMT_UINT56, ACPI_HEST0_OFFSET (Reserved3[0]), "Reserved2", 0},
|
||||
ACPI_DMT_TERMINATOR
|
||||
};
|
||||
|
||||
|
@ -825,14 +880,16 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoHest0[] =
|
|||
ACPI_DMTABLE_INFO AcpiDmTableInfoHest1[] =
|
||||
{
|
||||
ACPI_DM_HEST_HEADER,
|
||||
{ACPI_DMT_UINT16, ACPI_HEST1_OFFSET (Reserved1), "Reserved", 0},
|
||||
{ACPI_DMT_UINT8, ACPI_HEST1_OFFSET (Flags), "Flags", 0},
|
||||
{ACPI_DMT_UINT16, ACPI_HEST1_OFFSET (Reserved1), "Reserved1", 0},
|
||||
{ACPI_DMT_UINT8, ACPI_HEST1_OFFSET (Flags), "Flags (decoded below)", DT_FLAG},
|
||||
{ACPI_DMT_FLAG0, ACPI_HEST1_FLAG_OFFSET (Flags,0), "Firmware First", 0},
|
||||
|
||||
{ACPI_DMT_UINT8, ACPI_HEST1_OFFSET (Enabled), "Enabled", 0},
|
||||
{ACPI_DMT_UINT32, ACPI_HEST1_OFFSET (RecordsToPreallocate), "Records To Preallocate", 0},
|
||||
{ACPI_DMT_UINT32, ACPI_HEST1_OFFSET (MaxSectionsPerRecord), "Max Sections Per Record", 0},
|
||||
{ACPI_DMT_HESTNTFY, ACPI_HEST1_OFFSET (Notify), "Notify", 0},
|
||||
{ACPI_DMT_UINT8, ACPI_HEST1_OFFSET (NumHardwareBanks), "Num Hardware Banks", 0},
|
||||
{ACPI_DMT_UINT24, ACPI_HEST1_OFFSET (Reserved2[0]), "Reserved", 0},
|
||||
{ACPI_DMT_UINT24, ACPI_HEST1_OFFSET (Reserved2[0]), "Reserved2", 0},
|
||||
ACPI_DMT_TERMINATOR
|
||||
};
|
||||
|
||||
|
@ -848,7 +905,6 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoHest2[] =
|
|||
ACPI_DMT_TERMINATOR
|
||||
};
|
||||
|
||||
|
||||
/* 6: PCI Express Root Port AER */
|
||||
|
||||
ACPI_DMTABLE_INFO AcpiDmTableInfoHest6[] =
|
||||
|
@ -1300,13 +1356,42 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoSbst[] =
|
|||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* SLIC - Software Licensing Description Table. NOT FULLY IMPLEMENTED, do not
|
||||
* have the table definition.
|
||||
* SLIC - Software Licensing Description Table. There is no common table, just
|
||||
* the standard ACPI header and then subtables.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
ACPI_DMTABLE_INFO AcpiDmTableInfoSlic[] =
|
||||
/* Common Subtable header (one per Subtable) */
|
||||
|
||||
ACPI_DMTABLE_INFO AcpiDmTableInfoSlicHdr[] =
|
||||
{
|
||||
{ACPI_DMT_SLIC, ACPI_SLICH_OFFSET (Type), "Subtable Type", 0},
|
||||
{ACPI_DMT_UINT32, ACPI_SLICH_OFFSET (Length), "Length", DT_LENGTH},
|
||||
ACPI_DMT_TERMINATOR
|
||||
};
|
||||
|
||||
ACPI_DMTABLE_INFO AcpiDmTableInfoSlic0[] =
|
||||
{
|
||||
{ACPI_DMT_UINT8, ACPI_SLIC0_OFFSET (KeyType), "Key Type", 0},
|
||||
{ACPI_DMT_UINT8, ACPI_SLIC0_OFFSET (Version), "Version", 0},
|
||||
{ACPI_DMT_UINT16, ACPI_SLIC0_OFFSET (Reserved), "Reserved", 0},
|
||||
{ACPI_DMT_UINT32, ACPI_SLIC0_OFFSET (Algorithm), "Algorithm", 0},
|
||||
{ACPI_DMT_NAME4, ACPI_SLIC0_OFFSET (Magic), "Magic", 0},
|
||||
{ACPI_DMT_UINT32, ACPI_SLIC0_OFFSET (BitLength), "BitLength", 0},
|
||||
{ACPI_DMT_UINT32, ACPI_SLIC0_OFFSET (Exponent), "Exponent", 0},
|
||||
{ACPI_DMT_BUF128, ACPI_SLIC0_OFFSET (Modulus[0]), "Modulus", 0},
|
||||
ACPI_DMT_TERMINATOR
|
||||
};
|
||||
|
||||
ACPI_DMTABLE_INFO AcpiDmTableInfoSlic1[] =
|
||||
{
|
||||
{ACPI_DMT_UINT32, ACPI_SLIC1_OFFSET (Version), "Version", 0},
|
||||
{ACPI_DMT_NAME6, ACPI_SLIC1_OFFSET (OemId[0]), "Oem ID", 0},
|
||||
{ACPI_DMT_NAME8, ACPI_SLIC1_OFFSET (OemTableId[0]), "Oem Table ID", 0},
|
||||
{ACPI_DMT_NAME8, ACPI_SLIC1_OFFSET (WindowsFlag[0]), "Windows Flag", 0},
|
||||
{ACPI_DMT_UINT32, ACPI_SLIC1_OFFSET (SlicVersion), "SLIC Version", 0},
|
||||
{ACPI_DMT_BUF16, ACPI_SLIC1_OFFSET (Reserved[0]), "Reserved", 0},
|
||||
{ACPI_DMT_BUF128, ACPI_SLIC1_OFFSET (Signature[0]), "Signature", 0},
|
||||
ACPI_DMT_TERMINATOR
|
||||
};
|
||||
|
||||
|
@ -1425,15 +1510,15 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoSrat0[] =
|
|||
ACPI_DMTABLE_INFO AcpiDmTableInfoSrat1[] =
|
||||
{
|
||||
{ACPI_DMT_UINT32, ACPI_SRAT1_OFFSET (ProximityDomain), "Proximity Domain", 0},
|
||||
{ACPI_DMT_UINT16, ACPI_SRAT1_OFFSET (Reserved), "Reserved", 0},
|
||||
{ACPI_DMT_UINT16, ACPI_SRAT1_OFFSET (Reserved), "Reserved1", 0},
|
||||
{ACPI_DMT_UINT64, ACPI_SRAT1_OFFSET (BaseAddress), "Base Address", 0},
|
||||
{ACPI_DMT_UINT64, ACPI_SRAT1_OFFSET (Length), "Address Length", 0},
|
||||
{ACPI_DMT_UINT32, ACPI_SRAT1_OFFSET (Reserved1), "Reserved", 0},
|
||||
{ACPI_DMT_UINT32, ACPI_SRAT1_OFFSET (Reserved1), "Reserved2", 0},
|
||||
{ACPI_DMT_UINT32, ACPI_SRAT1_OFFSET (Flags), "Flags (decoded below)", DT_FLAG},
|
||||
{ACPI_DMT_FLAG0, ACPI_SRAT1_FLAG_OFFSET (Flags,0), "Enabled", 0},
|
||||
{ACPI_DMT_FLAG1, ACPI_SRAT1_FLAG_OFFSET (Flags,0), "Hot Pluggable", 0},
|
||||
{ACPI_DMT_FLAG2, ACPI_SRAT1_FLAG_OFFSET (Flags,0), "Non-Volatile", 0},
|
||||
{ACPI_DMT_UINT64, ACPI_SRAT1_OFFSET (Reserved2), "Reserved", 0},
|
||||
{ACPI_DMT_UINT64, ACPI_SRAT1_OFFSET (Reserved2), "Reserved3", 0},
|
||||
ACPI_DMT_TERMINATOR
|
||||
};
|
||||
|
||||
|
@ -1441,13 +1526,13 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoSrat1[] =
|
|||
|
||||
ACPI_DMTABLE_INFO AcpiDmTableInfoSrat2[] =
|
||||
{
|
||||
{ACPI_DMT_UINT16, ACPI_SRAT2_OFFSET (Reserved), "Reserved", 0},
|
||||
{ACPI_DMT_UINT16, ACPI_SRAT2_OFFSET (Reserved), "Reserved1", 0},
|
||||
{ACPI_DMT_UINT32, ACPI_SRAT2_OFFSET (ProximityDomain), "Proximity Domain", 0},
|
||||
{ACPI_DMT_UINT32, ACPI_SRAT2_OFFSET (ApicId), "Apic ID", 0},
|
||||
{ACPI_DMT_UINT32, ACPI_SRAT2_OFFSET (Flags), "Flags (decoded below)", DT_FLAG},
|
||||
{ACPI_DMT_FLAG0, ACPI_SRAT2_FLAG_OFFSET (Flags,0), "Enabled", 0},
|
||||
{ACPI_DMT_UINT32, ACPI_SRAT2_OFFSET (ClockDomain), "Clock Domain", 0},
|
||||
{ACPI_DMT_UINT32, ACPI_SRAT2_OFFSET (Reserved2), "Reserved", 0},
|
||||
{ACPI_DMT_UINT32, ACPI_SRAT2_OFFSET (Reserved2), "Reserved2", 0},
|
||||
ACPI_DMT_TERMINATOR
|
||||
};
|
||||
|
||||
|
@ -1475,7 +1560,7 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoTcpa[] =
|
|||
|
||||
ACPI_DMTABLE_INFO AcpiDmTableInfoUefi[] =
|
||||
{
|
||||
{ACPI_DMT_BUF16, ACPI_UEFI_OFFSET (Identifier[0]), "UUID Identifier", 0},
|
||||
{ACPI_DMT_UUID, ACPI_UEFI_OFFSET (Identifier[0]), "UUID Identifier", 0},
|
||||
{ACPI_DMT_UINT16, ACPI_UEFI_OFFSET (DataOffset), "Data Offset", 0},
|
||||
ACPI_DMT_TERMINATOR
|
||||
};
|
||||
|
@ -1535,6 +1620,46 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoWdat0[] =
|
|||
};
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* WDDT - Watchdog Description Table
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
ACPI_DMTABLE_INFO AcpiDmTableInfoWddt[] =
|
||||
{
|
||||
{ACPI_DMT_UINT16, ACPI_WDDT_OFFSET (SpecVersion), "Specification Version", 0},
|
||||
{ACPI_DMT_UINT16, ACPI_WDDT_OFFSET (TableVersion), "Table Version", 0},
|
||||
{ACPI_DMT_UINT16, ACPI_WDDT_OFFSET (PciVendorId), "PCI Vendor ID", 0},
|
||||
{ACPI_DMT_GAS, ACPI_WDDT_OFFSET (Address), "Timer Register", 0},
|
||||
{ACPI_DMT_UINT16, ACPI_WDDT_OFFSET (MaxCount), "Max Count", 0},
|
||||
{ACPI_DMT_UINT16, ACPI_WDDT_OFFSET (MinCount), "Min Count", 0},
|
||||
{ACPI_DMT_UINT16, ACPI_WDDT_OFFSET (Period), "Period", 0},
|
||||
{ACPI_DMT_UINT16, ACPI_WDDT_OFFSET (Status), "Status (decoded below)", 0},
|
||||
|
||||
/* Status Flags byte 0 */
|
||||
|
||||
{ACPI_DMT_FLAG0, ACPI_WDDT_FLAG_OFFSET (Status,0), "Available", 0},
|
||||
{ACPI_DMT_FLAG1, ACPI_WDDT_FLAG_OFFSET (Status,0), "Active", 0},
|
||||
{ACPI_DMT_FLAG2, ACPI_WDDT_FLAG_OFFSET (Status,0), "OS Owns", 0},
|
||||
|
||||
/* Status Flags byte 1 */
|
||||
|
||||
{ACPI_DMT_FLAG3, ACPI_WDDT_FLAG_OFFSET (Status,1), "User Reset", 0},
|
||||
{ACPI_DMT_FLAG4, ACPI_WDDT_FLAG_OFFSET (Status,1), "Timeout Reset", 0},
|
||||
{ACPI_DMT_FLAG5, ACPI_WDDT_FLAG_OFFSET (Status,1), "Power Fail Reset", 0},
|
||||
{ACPI_DMT_FLAG6, ACPI_WDDT_FLAG_OFFSET (Status,1), "Unknown Reset", 0},
|
||||
|
||||
{ACPI_DMT_UINT16, ACPI_WDDT_OFFSET (Capability), "Capability (decoded below)", 0},
|
||||
|
||||
/* Capability Flags byte 0 */
|
||||
|
||||
{ACPI_DMT_FLAG0, ACPI_WDDT_FLAG_OFFSET (Capability,0), "Auto Reset", 0},
|
||||
{ACPI_DMT_FLAG1, ACPI_WDDT_FLAG_OFFSET (Capability,0), "Timeout Alert", 0},
|
||||
ACPI_DMT_TERMINATOR
|
||||
};
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* WDRT - Watchdog Resource Table
|
||||
|
@ -1556,3 +1681,42 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoWdrt[] =
|
|||
ACPI_DMT_TERMINATOR
|
||||
};
|
||||
|
||||
/*
|
||||
* Generic types (used in UEFI)
|
||||
*
|
||||
* Examples:
|
||||
*
|
||||
* Buffer : cc 04 ff bb
|
||||
* UINT8 : 11
|
||||
* UINT16 : 1122
|
||||
* UINT24 : 112233
|
||||
* UINT32 : 11223344
|
||||
* UINT56 : 11223344556677
|
||||
* UINT64 : 1122334455667788
|
||||
*
|
||||
* String : "This is string"
|
||||
* Unicode : "This string encoded to Unicode"
|
||||
*
|
||||
* GUID : 11223344-5566-7788-99aa-bbccddeeff00
|
||||
* DevicePath : "\PciRoot(0)\Pci(0x1f,1)\Usb(0,0)"
|
||||
*/
|
||||
|
||||
#define ACPI_DM_GENERIC_ENTRY(FieldType, FieldName)\
|
||||
{{FieldType, 0, FieldName, 0}, ACPI_DMT_TERMINATOR}
|
||||
|
||||
ACPI_DMTABLE_INFO AcpiDmTableInfoGeneric[][2] =
|
||||
{
|
||||
ACPI_DM_GENERIC_ENTRY (ACPI_DMT_UINT8, "UINT8"),
|
||||
ACPI_DM_GENERIC_ENTRY (ACPI_DMT_UINT16, "UINT16"),
|
||||
ACPI_DM_GENERIC_ENTRY (ACPI_DMT_UINT24, "UINT24"),
|
||||
ACPI_DM_GENERIC_ENTRY (ACPI_DMT_UINT32, "UINT32"),
|
||||
ACPI_DM_GENERIC_ENTRY (ACPI_DMT_UINT56, "UINT56"),
|
||||
ACPI_DM_GENERIC_ENTRY (ACPI_DMT_UINT64, "UINT64"),
|
||||
ACPI_DM_GENERIC_ENTRY (ACPI_DMT_STRING, "String"),
|
||||
ACPI_DM_GENERIC_ENTRY (ACPI_DMT_UNICODE, "Unicode"),
|
||||
ACPI_DM_GENERIC_ENTRY (ACPI_DMT_BUFFER, "Buffer"),
|
||||
ACPI_DM_GENERIC_ENTRY (ACPI_DMT_UUID, "GUID"),
|
||||
ACPI_DM_GENERIC_ENTRY (ACPI_DMT_STRING, "DevicePath"),
|
||||
ACPI_DM_GENERIC_ENTRY (ACPI_DMT_LABEL, "Label"),
|
||||
{ACPI_DMT_TERMINATOR}
|
||||
};
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
|
@ -114,19 +114,18 @@
|
|||
*
|
||||
*****************************************************************************/
|
||||
|
||||
#include "acpi.h"
|
||||
#include "accommon.h"
|
||||
#include "acapps.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include "acpi.h"
|
||||
#include "accommon.h"
|
||||
#include "acapps.h"
|
||||
|
||||
#define ERR(szz,czz) if(AcpiGbl_Opterr){fprintf(stderr,"%s%s%c\n",argv[0],szz,czz);}
|
||||
|
||||
|
||||
int AcpiGbl_Opterr = 1;
|
||||
int AcpiGbl_Optind = 1;
|
||||
int AcpiGbl_Optopt;
|
||||
char *AcpiGbl_Optarg;
|
||||
|
||||
|
||||
|
@ -171,9 +170,7 @@ AcpiGetopt(
|
|||
|
||||
/* Get the option */
|
||||
|
||||
CurrentChar =
|
||||
AcpiGbl_Optopt =
|
||||
argv[AcpiGbl_Optind][CurrentCharPtr];
|
||||
CurrentChar = argv[AcpiGbl_Optind][CurrentCharPtr];
|
||||
|
||||
/* Make sure that the option is legal */
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,597 @@
|
|||
/******************************************************************************
|
||||
*
|
||||
* Module Name: aslbtypes - Support for bitfield types
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
*
|
||||
* 2.1. This is your license from Intel Corp. under its intellectual property
|
||||
* rights. You may have additional license terms from the party that provided
|
||||
* you this software, covering your right to use that party's intellectual
|
||||
* property rights.
|
||||
*
|
||||
* 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
|
||||
* copy of the source code appearing in this file ("Covered Code") an
|
||||
* irrevocable, perpetual, worldwide license under Intel's copyrights in the
|
||||
* base code distributed originally by Intel ("Original Intel Code") to copy,
|
||||
* make derivatives, distribute, use and display any portion of the Covered
|
||||
* Code in any form, with the right to sublicense such rights; and
|
||||
*
|
||||
* 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
|
||||
* license (with the right to sublicense), under only those claims of Intel
|
||||
* patents that are infringed by the Original Intel Code, to make, use, sell,
|
||||
* offer to sell, and import the Covered Code and derivative works thereof
|
||||
* solely to the minimum extent necessary to exercise the above copyright
|
||||
* license, and in no event shall the patent license extend to any additions
|
||||
* to or modifications of the Original Intel Code. No other license or right
|
||||
* is granted directly or by implication, estoppel or otherwise;
|
||||
*
|
||||
* The above copyright and patent license is granted only if the following
|
||||
* conditions are met:
|
||||
*
|
||||
* 3. Conditions
|
||||
*
|
||||
* 3.1. Redistribution of Source with Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification with rights to further distribute source must include
|
||||
* the above Copyright Notice, the above License, this list of Conditions,
|
||||
* and the following Disclaimer and Export Compliance provision. In addition,
|
||||
* Licensee must cause all Covered Code to which Licensee contributes to
|
||||
* contain a file documenting the changes Licensee made to create that Covered
|
||||
* Code and the date of any change. Licensee must include in that file the
|
||||
* documentation of any changes made by any predecessor Licensee. Licensee
|
||||
* must include a prominent statement that the modification is derived,
|
||||
* directly or indirectly, from Original Intel Code.
|
||||
*
|
||||
* 3.2. Redistribution of Source with no Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification without rights to further distribute source must
|
||||
* include the following Disclaimer and Export Compliance provision in the
|
||||
* documentation and/or other materials provided with distribution. In
|
||||
* addition, Licensee may not authorize further sublicense of source of any
|
||||
* portion of the Covered Code, and must include terms to the effect that the
|
||||
* license from Licensee to its licensee is limited to the intellectual
|
||||
* property embodied in the software Licensee provides to its licensee, and
|
||||
* not to intellectual property embodied in modifications its licensee may
|
||||
* make.
|
||||
*
|
||||
* 3.3. Redistribution of Executable. Redistribution in executable form of any
|
||||
* substantial portion of the Covered Code or modification must reproduce the
|
||||
* above Copyright Notice, and the following Disclaimer and Export Compliance
|
||||
* provision in the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* 3.4. Intel retains all right, title, and interest in and to the Original
|
||||
* Intel Code.
|
||||
*
|
||||
* 3.5. Neither the name Intel nor any other trademark owned or controlled by
|
||||
* Intel shall be used in advertising or otherwise to promote the sale, use or
|
||||
* other dealings in products derived from or relating to the Covered Code
|
||||
* without prior written authorization from Intel.
|
||||
*
|
||||
* 4. Disclaimer and Export Compliance
|
||||
*
|
||||
* 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
|
||||
* HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
|
||||
* IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
|
||||
* INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
|
||||
* UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
|
||||
* PARTICULAR PURPOSE.
|
||||
*
|
||||
* 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
|
||||
* OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
|
||||
* COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
|
||||
* SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
|
||||
* CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
|
||||
* HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
|
||||
* SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
|
||||
* LIMITED REMEDY.
|
||||
*
|
||||
* 4.3. Licensee shall not export, either directly or indirectly, any of this
|
||||
* software or system incorporating such software without first obtaining any
|
||||
* required license or other approval from the U. S. Department of Commerce or
|
||||
* any other agency or department of the United States Government. In the
|
||||
* event Licensee exports any such software from the United States or
|
||||
* re-exports any such software from a foreign destination, Licensee shall
|
||||
* ensure that the distribution and export/re-export of the software is in
|
||||
* compliance with all laws, regulations, orders, or other restrictions of the
|
||||
* U.S. Export Administration Regulations. Licensee agrees that neither it nor
|
||||
* any of its subsidiaries will export/re-export any technical data, process,
|
||||
* software, or service, directly or indirectly, to any country for which the
|
||||
* United States government or any agency thereof requires an export license,
|
||||
* other governmental approval, or letter of assurance, without first obtaining
|
||||
* such license, approval or letter.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
|
||||
#include "aslcompiler.h"
|
||||
#include "aslcompiler.y.h"
|
||||
#include "amlcode.h"
|
||||
|
||||
|
||||
#define _COMPONENT ACPI_COMPILER
|
||||
ACPI_MODULE_NAME ("aslbtypes")
|
||||
|
||||
/* Local prototypes */
|
||||
|
||||
static UINT32
|
||||
AnMapEtypeToBtype (
|
||||
UINT32 Etype);
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AnMapArgTypeToBtype
|
||||
*
|
||||
* PARAMETERS: ArgType - The ARGI required type(s) for this
|
||||
* argument, from the opcode info table
|
||||
*
|
||||
* RETURN: The corresponding Bit-encoded types
|
||||
*
|
||||
* DESCRIPTION: Convert an encoded ARGI required argument type code into a
|
||||
* bitfield type code. Implements the implicit source conversion
|
||||
* rules.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
UINT32
|
||||
AnMapArgTypeToBtype (
|
||||
UINT32 ArgType)
|
||||
{
|
||||
|
||||
switch (ArgType)
|
||||
{
|
||||
|
||||
/* Simple types */
|
||||
|
||||
case ARGI_ANYTYPE:
|
||||
return (ACPI_BTYPE_OBJECTS_AND_REFS);
|
||||
|
||||
case ARGI_PACKAGE:
|
||||
return (ACPI_BTYPE_PACKAGE);
|
||||
|
||||
case ARGI_EVENT:
|
||||
return (ACPI_BTYPE_EVENT);
|
||||
|
||||
case ARGI_MUTEX:
|
||||
return (ACPI_BTYPE_MUTEX);
|
||||
|
||||
case ARGI_DDBHANDLE:
|
||||
/*
|
||||
* DDBHandleObject := SuperName
|
||||
* ACPI_BTYPE_REFERENCE: Index reference as parameter of Load/Unload
|
||||
*/
|
||||
return (ACPI_BTYPE_DDB_HANDLE | ACPI_BTYPE_REFERENCE);
|
||||
|
||||
/* Interchangeable types */
|
||||
/*
|
||||
* Source conversion rules:
|
||||
* Integer, String, and Buffer are all interchangeable
|
||||
*/
|
||||
case ARGI_INTEGER:
|
||||
case ARGI_STRING:
|
||||
case ARGI_BUFFER:
|
||||
case ARGI_BUFFER_OR_STRING:
|
||||
case ARGI_COMPUTEDATA:
|
||||
return (ACPI_BTYPE_COMPUTE_DATA);
|
||||
|
||||
/* References */
|
||||
|
||||
case ARGI_INTEGER_REF:
|
||||
return (ACPI_BTYPE_INTEGER);
|
||||
|
||||
case ARGI_OBJECT_REF:
|
||||
return (ACPI_BTYPE_ALL_OBJECTS);
|
||||
|
||||
case ARGI_DEVICE_REF:
|
||||
return (ACPI_BTYPE_DEVICE_OBJECTS);
|
||||
|
||||
case ARGI_REFERENCE:
|
||||
return (ACPI_BTYPE_REFERENCE);
|
||||
|
||||
case ARGI_TARGETREF:
|
||||
case ARGI_FIXED_TARGET:
|
||||
case ARGI_SIMPLE_TARGET:
|
||||
return (ACPI_BTYPE_OBJECTS_AND_REFS);
|
||||
|
||||
/* Complex types */
|
||||
|
||||
case ARGI_DATAOBJECT:
|
||||
|
||||
/*
|
||||
* Buffer, string, package or reference to a Op -
|
||||
* Used only by SizeOf operator
|
||||
*/
|
||||
return (ACPI_BTYPE_STRING | ACPI_BTYPE_BUFFER |
|
||||
ACPI_BTYPE_PACKAGE | ACPI_BTYPE_REFERENCE);
|
||||
|
||||
case ARGI_COMPLEXOBJ:
|
||||
|
||||
/* Buffer, String, or package */
|
||||
|
||||
return (ACPI_BTYPE_STRING | ACPI_BTYPE_BUFFER | ACPI_BTYPE_PACKAGE);
|
||||
|
||||
case ARGI_REF_OR_STRING:
|
||||
return (ACPI_BTYPE_STRING | ACPI_BTYPE_REFERENCE);
|
||||
|
||||
case ARGI_REGION_OR_BUFFER:
|
||||
|
||||
/* Used by Load() only. Allow buffers in addition to regions/fields */
|
||||
|
||||
return (ACPI_BTYPE_REGION | ACPI_BTYPE_BUFFER | ACPI_BTYPE_FIELD_UNIT);
|
||||
|
||||
case ARGI_DATAREFOBJ:
|
||||
return (ACPI_BTYPE_INTEGER |ACPI_BTYPE_STRING | ACPI_BTYPE_BUFFER |
|
||||
ACPI_BTYPE_PACKAGE | ACPI_BTYPE_REFERENCE | ACPI_BTYPE_DDB_HANDLE);
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return (ACPI_BTYPE_OBJECTS_AND_REFS);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AnMapEtypeToBtype
|
||||
*
|
||||
* PARAMETERS: Etype - Encoded ACPI Type
|
||||
*
|
||||
* RETURN: Btype corresponding to the Etype
|
||||
*
|
||||
* DESCRIPTION: Convert an encoded ACPI type to a bitfield type applying the
|
||||
* operand conversion rules. In other words, returns the type(s)
|
||||
* this Etype is implicitly converted to during interpretation.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
static UINT32
|
||||
AnMapEtypeToBtype (
|
||||
UINT32 Etype)
|
||||
{
|
||||
|
||||
|
||||
if (Etype == ACPI_TYPE_ANY)
|
||||
{
|
||||
return (ACPI_BTYPE_OBJECTS_AND_REFS);
|
||||
}
|
||||
|
||||
/* Try the standard ACPI data types */
|
||||
|
||||
if (Etype <= ACPI_TYPE_EXTERNAL_MAX)
|
||||
{
|
||||
/*
|
||||
* This switch statement implements the allowed operand conversion
|
||||
* rules as per the "ASL Data Types" section of the ACPI
|
||||
* specification.
|
||||
*/
|
||||
switch (Etype)
|
||||
{
|
||||
case ACPI_TYPE_INTEGER:
|
||||
return (ACPI_BTYPE_COMPUTE_DATA | ACPI_BTYPE_DDB_HANDLE);
|
||||
|
||||
case ACPI_TYPE_STRING:
|
||||
case ACPI_TYPE_BUFFER:
|
||||
return (ACPI_BTYPE_COMPUTE_DATA);
|
||||
|
||||
case ACPI_TYPE_PACKAGE:
|
||||
return (ACPI_BTYPE_PACKAGE);
|
||||
|
||||
case ACPI_TYPE_FIELD_UNIT:
|
||||
return (ACPI_BTYPE_COMPUTE_DATA | ACPI_BTYPE_FIELD_UNIT);
|
||||
|
||||
case ACPI_TYPE_BUFFER_FIELD:
|
||||
return (ACPI_BTYPE_COMPUTE_DATA | ACPI_BTYPE_BUFFER_FIELD);
|
||||
|
||||
case ACPI_TYPE_DDB_HANDLE:
|
||||
return (ACPI_BTYPE_INTEGER | ACPI_BTYPE_DDB_HANDLE);
|
||||
|
||||
case ACPI_BTYPE_DEBUG_OBJECT:
|
||||
|
||||
/* Cannot be used as a source operand */
|
||||
|
||||
return (0);
|
||||
|
||||
default:
|
||||
return (1 << (Etype - 1));
|
||||
}
|
||||
}
|
||||
|
||||
/* Try the internal data types */
|
||||
|
||||
switch (Etype)
|
||||
{
|
||||
case ACPI_TYPE_LOCAL_REGION_FIELD:
|
||||
case ACPI_TYPE_LOCAL_BANK_FIELD:
|
||||
case ACPI_TYPE_LOCAL_INDEX_FIELD:
|
||||
|
||||
/* Named fields can be either Integer/Buffer/String */
|
||||
|
||||
return (ACPI_BTYPE_COMPUTE_DATA | ACPI_BTYPE_FIELD_UNIT);
|
||||
|
||||
case ACPI_TYPE_LOCAL_ALIAS:
|
||||
|
||||
return (ACPI_BTYPE_INTEGER);
|
||||
|
||||
|
||||
case ACPI_TYPE_LOCAL_RESOURCE:
|
||||
case ACPI_TYPE_LOCAL_RESOURCE_FIELD:
|
||||
|
||||
return (ACPI_BTYPE_REFERENCE);
|
||||
|
||||
default:
|
||||
printf ("Unhandled encoded type: %X\n", Etype);
|
||||
return (0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AnFormatBtype
|
||||
*
|
||||
* PARAMETERS: Btype - Bitfield of ACPI types
|
||||
* Buffer - Where to put the ascii string
|
||||
*
|
||||
* RETURN: None.
|
||||
*
|
||||
* DESCRIPTION: Convert a Btype to a string of ACPI types
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
void
|
||||
AnFormatBtype (
|
||||
char *Buffer,
|
||||
UINT32 Btype)
|
||||
{
|
||||
UINT32 Type;
|
||||
BOOLEAN First = TRUE;
|
||||
|
||||
|
||||
*Buffer = 0;
|
||||
|
||||
if (Btype == 0)
|
||||
{
|
||||
strcat (Buffer, "NoReturnValue");
|
||||
return;
|
||||
}
|
||||
|
||||
for (Type = 1; Type <= ACPI_TYPE_EXTERNAL_MAX; Type++)
|
||||
{
|
||||
if (Btype & 0x00000001)
|
||||
{
|
||||
if (!First)
|
||||
{
|
||||
strcat (Buffer, "|");
|
||||
}
|
||||
First = FALSE;
|
||||
strcat (Buffer, AcpiUtGetTypeName (Type));
|
||||
}
|
||||
Btype >>= 1;
|
||||
}
|
||||
|
||||
if (Btype & 0x00000001)
|
||||
{
|
||||
if (!First)
|
||||
{
|
||||
strcat (Buffer, "|");
|
||||
}
|
||||
First = FALSE;
|
||||
strcat (Buffer, "Reference");
|
||||
}
|
||||
|
||||
Btype >>= 1;
|
||||
if (Btype & 0x00000001)
|
||||
{
|
||||
if (!First)
|
||||
{
|
||||
strcat (Buffer, "|");
|
||||
}
|
||||
First = FALSE;
|
||||
strcat (Buffer, "Resource");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AnGetBtype
|
||||
*
|
||||
* PARAMETERS: Op - Parse node whose type will be returned.
|
||||
*
|
||||
* RETURN: The Btype associated with the Op.
|
||||
*
|
||||
* DESCRIPTION: Get the (bitfield) ACPI type associated with the parse node.
|
||||
* Handles the case where the node is a name or method call and
|
||||
* the actual type must be obtained from the namespace node.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
UINT32
|
||||
AnGetBtype (
|
||||
ACPI_PARSE_OBJECT *Op)
|
||||
{
|
||||
ACPI_NAMESPACE_NODE *Node;
|
||||
ACPI_PARSE_OBJECT *ReferencedNode;
|
||||
UINT32 ThisNodeBtype = 0;
|
||||
|
||||
|
||||
if ((Op->Asl.ParseOpcode == PARSEOP_NAMESEG) ||
|
||||
(Op->Asl.ParseOpcode == PARSEOP_NAMESTRING) ||
|
||||
(Op->Asl.ParseOpcode == PARSEOP_METHODCALL))
|
||||
{
|
||||
Node = Op->Asl.Node;
|
||||
if (!Node)
|
||||
{
|
||||
DbgPrint (ASL_DEBUG_OUTPUT,
|
||||
"No attached Nsnode: [%s] at line %u name [%s], ignoring typecheck\n",
|
||||
Op->Asl.ParseOpName, Op->Asl.LineNumber,
|
||||
Op->Asl.ExternalName);
|
||||
return (ACPI_UINT32_MAX);
|
||||
}
|
||||
|
||||
ThisNodeBtype = AnMapEtypeToBtype (Node->Type);
|
||||
if (!ThisNodeBtype)
|
||||
{
|
||||
AslError (ASL_ERROR, ASL_MSG_COMPILER_INTERNAL, Op,
|
||||
"could not map type");
|
||||
}
|
||||
|
||||
/*
|
||||
* Since it was a named reference, enable the
|
||||
* reference bit also
|
||||
*/
|
||||
ThisNodeBtype |= ACPI_BTYPE_REFERENCE;
|
||||
|
||||
if (Op->Asl.ParseOpcode == PARSEOP_METHODCALL)
|
||||
{
|
||||
ReferencedNode = Node->Op;
|
||||
if (!ReferencedNode)
|
||||
{
|
||||
/* Check for an internal method */
|
||||
|
||||
if (AnIsInternalMethod (Op))
|
||||
{
|
||||
return (AnGetInternalMethodReturnType (Op));
|
||||
}
|
||||
|
||||
AslError (ASL_ERROR, ASL_MSG_COMPILER_INTERNAL, Op,
|
||||
"null Op pointer");
|
||||
return (ACPI_UINT32_MAX);
|
||||
}
|
||||
|
||||
if (ReferencedNode->Asl.CompileFlags & NODE_METHOD_TYPED)
|
||||
{
|
||||
ThisNodeBtype = ReferencedNode->Asl.AcpiBtype;
|
||||
}
|
||||
else
|
||||
{
|
||||
return (ACPI_UINT32_MAX -1);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ThisNodeBtype = Op->Asl.AcpiBtype;
|
||||
}
|
||||
|
||||
return (ThisNodeBtype);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AnMapObjTypeToBtype
|
||||
*
|
||||
* PARAMETERS: Op - A parse node
|
||||
*
|
||||
* RETURN: A Btype
|
||||
*
|
||||
* DESCRIPTION: Map object to the associated "Btype"
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
UINT32
|
||||
AnMapObjTypeToBtype (
|
||||
ACPI_PARSE_OBJECT *Op)
|
||||
{
|
||||
|
||||
switch (Op->Asl.ParseOpcode)
|
||||
{
|
||||
case PARSEOP_OBJECTTYPE_BFF: /* "BuffFieldObj" */
|
||||
return (ACPI_BTYPE_BUFFER_FIELD);
|
||||
|
||||
case PARSEOP_OBJECTTYPE_BUF: /* "BuffObj" */
|
||||
return (ACPI_BTYPE_BUFFER);
|
||||
|
||||
case PARSEOP_OBJECTTYPE_DDB: /* "DDBHandleObj" */
|
||||
return (ACPI_BTYPE_DDB_HANDLE);
|
||||
|
||||
case PARSEOP_OBJECTTYPE_DEV: /* "DeviceObj" */
|
||||
return (ACPI_BTYPE_DEVICE);
|
||||
|
||||
case PARSEOP_OBJECTTYPE_EVT: /* "EventObj" */
|
||||
return (ACPI_BTYPE_EVENT);
|
||||
|
||||
case PARSEOP_OBJECTTYPE_FLD: /* "FieldUnitObj" */
|
||||
return (ACPI_BTYPE_FIELD_UNIT);
|
||||
|
||||
case PARSEOP_OBJECTTYPE_INT: /* "IntObj" */
|
||||
return (ACPI_BTYPE_INTEGER);
|
||||
|
||||
case PARSEOP_OBJECTTYPE_MTH: /* "MethodObj" */
|
||||
return (ACPI_BTYPE_METHOD);
|
||||
|
||||
case PARSEOP_OBJECTTYPE_MTX: /* "MutexObj" */
|
||||
return (ACPI_BTYPE_MUTEX);
|
||||
|
||||
case PARSEOP_OBJECTTYPE_OPR: /* "OpRegionObj" */
|
||||
return (ACPI_BTYPE_REGION);
|
||||
|
||||
case PARSEOP_OBJECTTYPE_PKG: /* "PkgObj" */
|
||||
return (ACPI_BTYPE_PACKAGE);
|
||||
|
||||
case PARSEOP_OBJECTTYPE_POW: /* "PowerResObj" */
|
||||
return (ACPI_BTYPE_POWER);
|
||||
|
||||
case PARSEOP_OBJECTTYPE_STR: /* "StrObj" */
|
||||
return (ACPI_BTYPE_STRING);
|
||||
|
||||
case PARSEOP_OBJECTTYPE_THZ: /* "ThermalZoneObj" */
|
||||
return (ACPI_BTYPE_THERMAL);
|
||||
|
||||
case PARSEOP_OBJECTTYPE_UNK: /* "UnknownObj" */
|
||||
return (ACPI_BTYPE_OBJECTS_AND_REFS);
|
||||
|
||||
default:
|
||||
return (0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#ifdef ACPI_OBSOLETE_FUNCTIONS
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AnMapBtypeToEtype
|
||||
*
|
||||
* PARAMETERS: Btype - Bitfield of ACPI types
|
||||
*
|
||||
* RETURN: The Etype corresponding the the Btype
|
||||
*
|
||||
* DESCRIPTION: Convert a bitfield type to an encoded type
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
UINT32
|
||||
AnMapBtypeToEtype (
|
||||
UINT32 Btype)
|
||||
{
|
||||
UINT32 i;
|
||||
UINT32 Etype;
|
||||
|
||||
|
||||
if (Btype == 0)
|
||||
{
|
||||
return (0);
|
||||
}
|
||||
|
||||
Etype = 1;
|
||||
for (i = 1; i < Btype; i *= 2)
|
||||
{
|
||||
Etype++;
|
||||
}
|
||||
|
||||
return (Etype);
|
||||
}
|
||||
#endif
|
|
@ -9,7 +9,7 @@
|
|||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
|
@ -513,11 +513,11 @@ CgWriteTableHeader (
|
|||
|
||||
/* Compiler ID */
|
||||
|
||||
strncpy (TableHeader.AslCompilerId, CompilerCreatorId, 4);
|
||||
strncpy (TableHeader.AslCompilerId, ASL_CREATOR_ID, 4);
|
||||
|
||||
/* Compiler version */
|
||||
|
||||
TableHeader.AslCompilerRevision = CompilerCreatorRevision;
|
||||
TableHeader.AslCompilerRevision = ASL_REVISION;
|
||||
|
||||
/* Table length. Checksum zero for now, will rewrite later */
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
|
@ -114,9 +114,11 @@
|
|||
*
|
||||
*****************************************************************************/
|
||||
|
||||
#include "aslcompiler.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <time.h>
|
||||
#include "aslcompiler.h"
|
||||
#include <acapps.h>
|
||||
|
||||
#define _COMPONENT ACPI_COMPILER
|
||||
ACPI_MODULE_NAME ("aslcompile")
|
||||
|
@ -127,12 +129,12 @@ static void
|
|||
CmFlushSourceCode (
|
||||
void);
|
||||
|
||||
void
|
||||
static void
|
||||
FlConsumeAnsiComment (
|
||||
ASL_FILE_INFO *FileInfo,
|
||||
ASL_FILE_STATUS *Status);
|
||||
|
||||
void
|
||||
static void
|
||||
FlConsumeNewComment (
|
||||
ASL_FILE_INFO *FileInfo,
|
||||
ASL_FILE_STATUS *Status);
|
||||
|
@ -155,6 +157,7 @@ AslCompilerSignon (
|
|||
UINT32 FileId)
|
||||
{
|
||||
char *Prefix = "";
|
||||
char *UtilityName;
|
||||
|
||||
|
||||
/* Set line prefix depending on the destination file type */
|
||||
|
@ -192,36 +195,21 @@ AslCompilerSignon (
|
|||
break;
|
||||
}
|
||||
|
||||
/*
|
||||
* Compiler signon with copyright
|
||||
*/
|
||||
FlPrintFile (FileId,
|
||||
"%s\n%s%s\n%s",
|
||||
Prefix,
|
||||
Prefix, IntelAcpiCA,
|
||||
Prefix);
|
||||
|
||||
/* Running compiler or disassembler? */
|
||||
|
||||
if (Gbl_DisasmFlag)
|
||||
{
|
||||
FlPrintFile (FileId,
|
||||
"%s", DisassemblerId);
|
||||
UtilityName = AML_DISASSEMBLER_NAME;
|
||||
}
|
||||
else
|
||||
{
|
||||
FlPrintFile (FileId,
|
||||
"%s", CompilerId);
|
||||
UtilityName = ASL_COMPILER_NAME;
|
||||
}
|
||||
|
||||
/* Version, build date, copyright, compliance */
|
||||
/* Compiler signon with copyright */
|
||||
|
||||
FlPrintFile (FileId,
|
||||
" version %X [%s]\n%s%s\n%s%s\n%s\n",
|
||||
(UINT32) ACPI_CA_VERSION, __DATE__,
|
||||
Prefix, CompilerCopyright,
|
||||
Prefix, CompilerCompliance,
|
||||
Prefix);
|
||||
FlPrintFile (FileId, "%s\n", Prefix);
|
||||
FlPrintFile (FileId, ACPI_COMMON_HEADER (UtilityName, Prefix));
|
||||
}
|
||||
|
||||
|
||||
|
@ -345,7 +333,7 @@ CmFlushSourceCode (
|
|||
*
|
||||
******************************************************************************/
|
||||
|
||||
void
|
||||
static void
|
||||
FlConsumeAnsiComment (
|
||||
ASL_FILE_INFO *FileInfo,
|
||||
ASL_FILE_STATUS *Status)
|
||||
|
@ -389,7 +377,7 @@ FlConsumeAnsiComment (
|
|||
}
|
||||
|
||||
|
||||
void
|
||||
static void
|
||||
FlConsumeNewComment (
|
||||
ASL_FILE_INFO *FileInfo,
|
||||
ASL_FILE_STATUS *Status)
|
||||
|
@ -684,27 +672,25 @@ CmDoCompile (
|
|||
|
||||
Event = UtBeginEvent ("Determine object types returned by methods");
|
||||
DbgPrint (ASL_DEBUG_OUTPUT, "\nSemantic analysis - Method typing\n\n");
|
||||
TrWalkParseTree (RootNode, ASL_WALK_VISIT_TWICE,
|
||||
AnMethodTypingWalkBegin,
|
||||
AnMethodTypingWalkEnd, NULL);
|
||||
TrWalkParseTree (RootNode, ASL_WALK_VISIT_UPWARD,
|
||||
NULL, AnMethodTypingWalkEnd, NULL);
|
||||
UtEndEvent (Event);
|
||||
|
||||
/* Semantic error checking part three - operand type checking */
|
||||
|
||||
Event = UtBeginEvent ("Analyze AML operand types");
|
||||
DbgPrint (ASL_DEBUG_OUTPUT, "\nSemantic analysis - Operand type checking\n\n");
|
||||
TrWalkParseTree (RootNode, ASL_WALK_VISIT_TWICE,
|
||||
AnOperandTypecheckWalkBegin,
|
||||
AnOperandTypecheckWalkEnd, &AnalysisWalkInfo);
|
||||
TrWalkParseTree (RootNode, ASL_WALK_VISIT_UPWARD,
|
||||
NULL, AnOperandTypecheckWalkEnd, &AnalysisWalkInfo);
|
||||
UtEndEvent (Event);
|
||||
|
||||
/* Semantic error checking part four - other miscellaneous checks */
|
||||
|
||||
Event = UtBeginEvent ("Miscellaneous analysis");
|
||||
DbgPrint (ASL_DEBUG_OUTPUT, "\nSemantic analysis - miscellaneous\n\n");
|
||||
TrWalkParseTree (RootNode, ASL_WALK_VISIT_TWICE,
|
||||
TrWalkParseTree (RootNode, ASL_WALK_VISIT_DOWNWARD,
|
||||
AnOtherSemanticAnalysisWalkBegin,
|
||||
AnOtherSemanticAnalysisWalkEnd, &AnalysisWalkInfo);
|
||||
NULL, &AnalysisWalkInfo);
|
||||
UtEndEvent (Event);
|
||||
|
||||
/* Calculate all AML package lengths */
|
||||
|
@ -903,10 +889,19 @@ CmCleanupAndExit (
|
|||
|
||||
/*
|
||||
* Delete intermediate ("combined") source file (if -ls flag not set)
|
||||
* This file is created during normal ASL/AML compiles. It is not
|
||||
* created by the data table compiler.
|
||||
*
|
||||
* If the -ls flag is set, then the .SRC file should not be deleted.
|
||||
* In this case, Gbl_SourceOutputFlag is set to TRUE.
|
||||
*
|
||||
* Note: Handles are cleared by FlCloseFile above, so we look at the
|
||||
* filename instead, to determine if the .SRC file was actually
|
||||
* created.
|
||||
*
|
||||
* TBD: SourceOutput should be .TMP, then rename if we want to keep it?
|
||||
*/
|
||||
if (!Gbl_SourceOutputFlag)
|
||||
if (!Gbl_SourceOutputFlag && Gbl_Files[ASL_FILE_SOURCE_OUTPUT].Filename)
|
||||
{
|
||||
if (remove (Gbl_Files[ASL_FILE_SOURCE_OUTPUT].Filename))
|
||||
{
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
|
@ -118,6 +118,10 @@
|
|||
#ifndef __ASLCOMPILER_H
|
||||
#define __ASLCOMPILER_H
|
||||
|
||||
#include "acpi.h"
|
||||
#include "accommon.h"
|
||||
#include "amlresrc.h"
|
||||
#include "acdebug.h"
|
||||
|
||||
/* Microsoft-specific */
|
||||
|
||||
|
@ -137,16 +141,11 @@
|
|||
#include <errno.h>
|
||||
#include <ctype.h>
|
||||
|
||||
|
||||
#include "acpi.h"
|
||||
#include "accommon.h"
|
||||
#include "amlresrc.h"
|
||||
#include "acdebug.h"
|
||||
|
||||
/* Compiler headers */
|
||||
|
||||
#include "asldefine.h"
|
||||
#include "asltypes.h"
|
||||
#include "aslmessages.h"
|
||||
#include "aslglobal.h"
|
||||
|
||||
|
||||
|
@ -189,11 +188,20 @@ AslPushInputFileStack (
|
|||
char *Filename);
|
||||
|
||||
/*
|
||||
* aslstartup - called from main
|
||||
* aslstartup - entered from main()
|
||||
*/
|
||||
void
|
||||
AslInitializeGlobals (
|
||||
void);
|
||||
|
||||
typedef
|
||||
ACPI_STATUS (*ASL_PATHNAME_CALLBACK) (
|
||||
char *);
|
||||
|
||||
ACPI_STATUS
|
||||
AslDoOnePathname (
|
||||
char *Pathname);
|
||||
char *Pathname,
|
||||
ASL_PATHNAME_CALLBACK Callback);
|
||||
|
||||
ACPI_STATUS
|
||||
AslDoOneFile (
|
||||
|
@ -228,7 +236,7 @@ FlCheckForAscii (
|
|||
|
||||
|
||||
/*
|
||||
* aslanalyze - semantic analysis
|
||||
* aslwalks - semantic analysis and parse tree walks
|
||||
*/
|
||||
ACPI_STATUS
|
||||
AnOtherSemanticAnalysisWalkBegin (
|
||||
|
@ -242,12 +250,6 @@ AnOtherSemanticAnalysisWalkEnd (
|
|||
UINT32 Level,
|
||||
void *Context);
|
||||
|
||||
ACPI_STATUS
|
||||
AnOperandTypecheckWalkBegin (
|
||||
ACPI_PARSE_OBJECT *Op,
|
||||
UINT32 Level,
|
||||
void *Context);
|
||||
|
||||
ACPI_STATUS
|
||||
AnOperandTypecheckWalkEnd (
|
||||
ACPI_PARSE_OBJECT *Op,
|
||||
|
@ -266,12 +268,6 @@ AnMethodAnalysisWalkEnd (
|
|||
UINT32 Level,
|
||||
void *Context);
|
||||
|
||||
ACPI_STATUS
|
||||
AnMethodTypingWalkBegin (
|
||||
ACPI_PARSE_OBJECT *Op,
|
||||
UINT32 Level,
|
||||
void *Context);
|
||||
|
||||
ACPI_STATUS
|
||||
AnMethodTypingWalkEnd (
|
||||
ACPI_PARSE_OBJECT *Op,
|
||||
|
@ -279,6 +275,73 @@ AnMethodTypingWalkEnd (
|
|||
void *Context);
|
||||
|
||||
|
||||
/*
|
||||
* aslbtypes - bitfield data types
|
||||
*/
|
||||
UINT32
|
||||
AnMapObjTypeToBtype (
|
||||
ACPI_PARSE_OBJECT *Op);
|
||||
|
||||
UINT32
|
||||
AnMapArgTypeToBtype (
|
||||
UINT32 ArgType);
|
||||
|
||||
UINT32
|
||||
AnGetBtype (
|
||||
ACPI_PARSE_OBJECT *Op);
|
||||
|
||||
void
|
||||
AnFormatBtype (
|
||||
char *Buffer,
|
||||
UINT32 Btype);
|
||||
|
||||
|
||||
/*
|
||||
* aslanalyze - Support functions for parse tree walks
|
||||
*/
|
||||
void
|
||||
AnCheckId (
|
||||
ACPI_PARSE_OBJECT *Op,
|
||||
ACPI_NAME Type);
|
||||
|
||||
/* Values for Type argument above */
|
||||
|
||||
#define ASL_TYPE_HID 0
|
||||
#define ASL_TYPE_CID 1
|
||||
|
||||
BOOLEAN
|
||||
AnIsInternalMethod (
|
||||
ACPI_PARSE_OBJECT *Op);
|
||||
|
||||
UINT32
|
||||
AnGetInternalMethodReturnType (
|
||||
ACPI_PARSE_OBJECT *Op);
|
||||
|
||||
BOOLEAN
|
||||
AnLastStatementIsReturn (
|
||||
ACPI_PARSE_OBJECT *Op);
|
||||
|
||||
void
|
||||
AnCheckMethodReturnValue (
|
||||
ACPI_PARSE_OBJECT *Op,
|
||||
const ACPI_OPCODE_INFO *OpInfo,
|
||||
ACPI_PARSE_OBJECT *ArgOp,
|
||||
UINT32 RequiredBtypes,
|
||||
UINT32 ThisNodeBtype);
|
||||
|
||||
BOOLEAN
|
||||
AnIsResultUsed (
|
||||
ACPI_PARSE_OBJECT *Op);
|
||||
|
||||
void
|
||||
ApCheckForGpeNameConflict (
|
||||
ACPI_PARSE_OBJECT *Op);
|
||||
|
||||
void
|
||||
ApCheckRegMethod (
|
||||
ACPI_PARSE_OBJECT *Op);
|
||||
|
||||
|
||||
/*
|
||||
* aslerror - error handling/reporting
|
||||
*/
|
||||
|
@ -298,7 +361,7 @@ AslCoreSubsystemError (
|
|||
|
||||
int
|
||||
AslCompilererror(
|
||||
char *s);
|
||||
const char *s);
|
||||
|
||||
void
|
||||
AslCommonError (
|
||||
|
@ -470,7 +533,7 @@ AslMapNamedOpcodeToDataType (
|
|||
/*
|
||||
* aslpredef - ACPI predefined names support
|
||||
*/
|
||||
void
|
||||
BOOLEAN
|
||||
ApCheckForPredefinedMethod (
|
||||
ACPI_PARSE_OBJECT *Op,
|
||||
ASL_METHOD_INFO *MethodInfo);
|
||||
|
@ -551,6 +614,10 @@ TrCreateValuedLeafNode (
|
|||
UINT32 ParseOpcode,
|
||||
UINT64 Value);
|
||||
|
||||
ACPI_PARSE_OBJECT *
|
||||
TrCreateConstantLeafNode (
|
||||
UINT32 ParseOpcode);
|
||||
|
||||
ACPI_PARSE_OBJECT *
|
||||
TrLinkChildren (
|
||||
ACPI_PARSE_OBJECT *Op,
|
||||
|
@ -677,6 +744,10 @@ ACPI_STATUS
|
|||
LsDisplayNamespace (
|
||||
void);
|
||||
|
||||
void
|
||||
LsSetupNsList (
|
||||
void *Handle);
|
||||
|
||||
|
||||
/*
|
||||
* aslutils - common compiler utilites
|
||||
|
@ -693,6 +764,10 @@ DbgPrint (
|
|||
#define ASL_PARSE_OUTPUT 1
|
||||
#define ASL_TREE_OUTPUT 2
|
||||
|
||||
void
|
||||
UtDisplaySupportedTables (
|
||||
void);
|
||||
|
||||
void
|
||||
UtDisplayConstantOpcodes (
|
||||
void);
|
||||
|
@ -764,6 +839,29 @@ UINT64
|
|||
UtDoConstant (
|
||||
char *String);
|
||||
|
||||
ACPI_STATUS
|
||||
UtStrtoul64 (
|
||||
char *String,
|
||||
UINT32 Base,
|
||||
UINT64 *RetInteger);
|
||||
|
||||
|
||||
/*
|
||||
* asluuid - UUID support
|
||||
*/
|
||||
ACPI_STATUS
|
||||
AuValidateUuid (
|
||||
char *InString);
|
||||
|
||||
ACPI_STATUS
|
||||
AuConvertStringToUuid (
|
||||
char *InString,
|
||||
char *UuIdBuffer);
|
||||
|
||||
ACPI_STATUS
|
||||
AuConvertUuidToString (
|
||||
char *UuIdBuffer,
|
||||
char *OutString);
|
||||
|
||||
/*
|
||||
* aslresource - Resource template generation utilities
|
||||
|
@ -778,7 +876,8 @@ RsSmallAddressCheck (
|
|||
ACPI_PARSE_OBJECT *MinOp,
|
||||
ACPI_PARSE_OBJECT *MaxOp,
|
||||
ACPI_PARSE_OBJECT *LengthOp,
|
||||
ACPI_PARSE_OBJECT *AlignOp);
|
||||
ACPI_PARSE_OBJECT *AlignOp,
|
||||
ACPI_PARSE_OBJECT *Op);
|
||||
|
||||
void
|
||||
RsLargeAddressCheck (
|
||||
|
@ -790,7 +889,8 @@ RsLargeAddressCheck (
|
|||
ACPI_PARSE_OBJECT *MinOp,
|
||||
ACPI_PARSE_OBJECT *MaxOp,
|
||||
ACPI_PARSE_OBJECT *LengthOp,
|
||||
ACPI_PARSE_OBJECT *GranOp);
|
||||
ACPI_PARSE_OBJECT *GranOp,
|
||||
ACPI_PARSE_OBJECT *Op);
|
||||
|
||||
UINT16
|
||||
RsGetStringDataLength (
|
||||
|
@ -1024,5 +1124,9 @@ ACPI_STATUS
|
|||
DtDoCompile(
|
||||
void);
|
||||
|
||||
ACPI_STATUS
|
||||
DtCreateTemplates (
|
||||
char *Signature);
|
||||
|
||||
#endif /* __ASLCOMPILER_H */
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
|
@ -115,11 +115,11 @@
|
|||
*
|
||||
*****************************************************************************/
|
||||
|
||||
#include "aslcompiler.h"
|
||||
#include "aslcompiler.y.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include "aslcompiler.h"
|
||||
#include "aslcompiler.y.h"
|
||||
YYSTYPE AslCompilerlval;
|
||||
|
||||
/*
|
||||
|
@ -464,6 +464,9 @@ NamePathTail [.]{NameSeg}
|
|||
"AddressRangeNVS" { count (0); return (PARSEOP_ADDRESSTYPE_NVS); }
|
||||
"AddressRangeACPI" { count (0); return (PARSEOP_ADDRESSTYPE_ACPI); }
|
||||
|
||||
"__DATE__" { count (0); return (PARSEOP___DATE__); }
|
||||
"__FILE__" { count (0); return (PARSEOP___FILE__); }
|
||||
"__LINE__" { count (0); return (PARSEOP___LINE__); }
|
||||
|
||||
"{" { count (0); return('{'); }
|
||||
"}" { count (0); return('}'); }
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
|
@ -115,14 +115,6 @@
|
|||
*
|
||||
*****************************************************************************/
|
||||
|
||||
#define YYDEBUG 1
|
||||
#define YYERROR_VERBOSE 1
|
||||
|
||||
/*
|
||||
* State stack - compiler will fault if it overflows. (Default was 200)
|
||||
*/
|
||||
#define YYINITDEPTH 600
|
||||
|
||||
#include "aslcompiler.h"
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
@ -146,45 +138,40 @@
|
|||
* ResourceMacroList, and FieldUnitList
|
||||
*/
|
||||
|
||||
void * AslLocalAllocate (unsigned int Size);
|
||||
|
||||
/* Bison/yacc configuration */
|
||||
|
||||
/*
|
||||
* Next statement is important - this makes everything public so that
|
||||
* we can access some of the parser tables from other modules
|
||||
*/
|
||||
#define static
|
||||
#undef alloca
|
||||
#define alloca AslLocalAllocate
|
||||
#define YYERROR_VERBOSE 1
|
||||
#define alloca AslLocalAllocate
|
||||
#define yytname AslCompilername
|
||||
|
||||
void *
|
||||
AslLocalAllocate (unsigned int Size);
|
||||
#define YYINITDEPTH 600 /* State stack depth */
|
||||
#define YYDEBUG 1 /* Enable debug output */
|
||||
#define YYERROR_VERBOSE 1 /* Verbose error messages */
|
||||
|
||||
/*
|
||||
* The windows version of bison defines this incorrectly as "32768" (Not negative).
|
||||
* Using a custom (edited binary) version of bison that defines YYFLAG as YYFBAD
|
||||
* instead (#define YYFBAD 32768), so we can define it correctly here.
|
||||
* We use a custom (edited binary) version of bison that defines YYFLAG as YYFBAD
|
||||
* instead (#define YYFBAD 32768), so we can define it correctly here.
|
||||
*
|
||||
* The problem is that if YYFLAG is positive, the extended syntax error messages
|
||||
* are disabled.
|
||||
*/
|
||||
|
||||
#define YYFLAG -32768
|
||||
|
||||
|
||||
%}
|
||||
|
||||
|
||||
/*
|
||||
* Declare the type of values in the grammar
|
||||
*/
|
||||
|
||||
%union {
|
||||
UINT64 i;
|
||||
char *s;
|
||||
ACPI_PARSE_OBJECT *n;
|
||||
}
|
||||
|
||||
|
||||
/*! [Begin] no source code translation */
|
||||
|
||||
/*
|
||||
|
@ -193,14 +180,12 @@ AslLocalAllocate (unsigned int Size);
|
|||
*/
|
||||
%expect 60
|
||||
|
||||
|
||||
/*
|
||||
* Token types: These are returned by the lexer
|
||||
*
|
||||
* NOTE: This list MUST match the AslKeywordMapping table found
|
||||
* in aslmap.c EXACTLY! Double check any changes!
|
||||
*/
|
||||
|
||||
%token <i> PARSEOP_ACCESSAS
|
||||
%token <i> PARSEOP_ACCESSATTRIB_BLOCK
|
||||
%token <i> PARSEOP_ACCESSATTRIB_BLOCK_CALL
|
||||
|
@ -464,6 +449,13 @@ AslLocalAllocate (unsigned int Size);
|
|||
%token <i> PARSEOP_XOR
|
||||
%token <i> PARSEOP_ZERO
|
||||
|
||||
/*
|
||||
* Special functions. These should probably stay at the end of this
|
||||
* table.
|
||||
*/
|
||||
%token <i> PARSEOP___DATE__
|
||||
%token <i> PARSEOP___FILE__
|
||||
%token <i> PARSEOP___LINE__
|
||||
|
||||
/*
|
||||
* Production names
|
||||
|
@ -767,7 +759,6 @@ AslLocalAllocate (unsigned int Size);
|
|||
%type <n> OptionalReference
|
||||
%type <n> OptionalAccessSize
|
||||
|
||||
|
||||
%type <n> TermArgItem
|
||||
%type <n> NameStringItem
|
||||
|
||||
|
@ -794,6 +785,21 @@ ASLCode
|
|||
| error {YYABORT; $$ = NULL;}
|
||||
;
|
||||
|
||||
/*
|
||||
* Note concerning support for "module-level code".
|
||||
*
|
||||
* ACPI 1.0 allowed Type1 and Type2 executable opcodes outside of control
|
||||
* methods (the so-called module-level code.) This support was explicitly
|
||||
* removed in ACPI 2.0, but this type of code continues to be created by
|
||||
* BIOS vendors. In order to support the disassembly and recompilation of
|
||||
* such code (and the porting of ASL code to iASL), iASL supports this
|
||||
* code in violation of the current ACPI specification.
|
||||
*
|
||||
* The grammar change to support module-level code is to revert the
|
||||
* {ObjectList} portion of the DefinitionBlockTerm in ACPI 2.0 to the
|
||||
* original use of {TermList} instead (see below.) This allows the use
|
||||
* of Type1 and Type2 opcodes at module level.
|
||||
*/
|
||||
DefinitionBlockTerm
|
||||
: PARSEOP_DEFINITIONBLOCK '(' {$<n>$ = TrCreateLeafNode (PARSEOP_DEFINITIONBLOCK);}
|
||||
String ','
|
||||
|
@ -1535,7 +1541,7 @@ ReturnTerm
|
|||
: PARSEOP_RETURN '(' {$<n>$ = TrCreateLeafNode (PARSEOP_RETURN);}
|
||||
OptionalReturnArg
|
||||
')' {$$ = TrLinkChildren ($<n>3,1,$4);}
|
||||
| PARSEOP_RETURN {$$ = TrLinkChildren (TrCreateLeafNode (PARSEOP_RETURN),1,TrCreateLeafNode (PARSEOP_ZERO));}
|
||||
| PARSEOP_RETURN {$$ = TrLinkChildren (TrCreateLeafNode (PARSEOP_RETURN),1,TrSetNodeFlags (TrCreateLeafNode (PARSEOP_ZERO), NODE_IS_NULL_RETURN));}
|
||||
| PARSEOP_RETURN '('
|
||||
error ')' {$$ = AslDoError(); yyclearin;}
|
||||
;
|
||||
|
@ -2389,6 +2395,9 @@ ConstExprTerm
|
|||
: PARSEOP_ZERO {$$ = TrCreateValuedLeafNode (PARSEOP_ZERO, 0);}
|
||||
| PARSEOP_ONE {$$ = TrCreateValuedLeafNode (PARSEOP_ONE, 1);}
|
||||
| PARSEOP_ONES {$$ = TrCreateValuedLeafNode (PARSEOP_ONES, ACPI_UINT64_MAX);}
|
||||
| PARSEOP___DATE__ {$$ = TrCreateConstantLeafNode (PARSEOP___DATE__);}
|
||||
| PARSEOP___FILE__ {$$ = TrCreateConstantLeafNode (PARSEOP___FILE__);}
|
||||
| PARSEOP___LINE__ {$$ = TrCreateConstantLeafNode (PARSEOP___LINE__);}
|
||||
;
|
||||
|
||||
/* OptionalCount must appear before ByteList or an incorrect reduction will result */
|
||||
|
@ -3109,7 +3118,7 @@ OptionalTermArg
|
|||
;
|
||||
|
||||
OptionalReturnArg
|
||||
: {$$ = TrCreateLeafNode (PARSEOP_ZERO);} /* Placeholder is a ZeroOp object */
|
||||
: {$$ = TrSetNodeFlags (TrCreateLeafNode (PARSEOP_ZERO), NODE_IS_NULL_RETURN);} /* Placeholder is a ZeroOp object */
|
||||
| TermArg {$$ = $1;}
|
||||
;
|
||||
|
||||
|
@ -3142,7 +3151,6 @@ NameStringItem
|
|||
| ',' error {$$ = AslDoError (); yyclearin;}
|
||||
;
|
||||
|
||||
|
||||
%%
|
||||
|
||||
|
||||
|
@ -3187,3 +3195,32 @@ AslDoError (void)
|
|||
return (TrCreateLeafNode (PARSEOP_ERRORNODE));
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: UtGetOpName
|
||||
*
|
||||
* PARAMETERS: ParseOpcode - Parser keyword ID
|
||||
*
|
||||
* RETURN: Pointer to the opcode name
|
||||
*
|
||||
* DESCRIPTION: Get the ascii name of the parse opcode
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
char *
|
||||
UtGetOpName (
|
||||
UINT32 ParseOpcode)
|
||||
{
|
||||
#ifdef ASL_YYTNAME_START
|
||||
/*
|
||||
* First entries (ASL_YYTNAME_START) in yytname are special reserved names.
|
||||
* Ignore first 8 characters of the name
|
||||
*/
|
||||
return ((char *) yytname
|
||||
[(ParseOpcode - ASL_FIRST_PARSE_OPCODE) + ASL_YYTNAME_START] + 8);
|
||||
#else
|
||||
return ("[Unknown parser generator]");
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
|
@ -122,15 +122,13 @@
|
|||
/*
|
||||
* Compiler versions and names
|
||||
*/
|
||||
#define CompilerCreatorRevision ACPI_CA_VERSION
|
||||
#define ASL_REVISION ACPI_CA_VERSION
|
||||
#define ASL_COMPILER_NAME "ASL Optimizing Compiler"
|
||||
#define AML_DISASSEMBLER_NAME "AML Disassembler"
|
||||
#define ASL_INVOCATION_NAME "iasl"
|
||||
#define ASL_CREATOR_ID "INTL"
|
||||
|
||||
#define IntelAcpiCA "Intel ACPI Component Architecture"
|
||||
#define CompilerId "ASL Optimizing Compiler"
|
||||
#define DisassemblerId "AML Disassembler"
|
||||
#define CompilerCopyright "Copyright (c) 2000 - 2010 Intel Corporation"
|
||||
#define CompilerCompliance "Supports ACPI Specification Revision 4.0a"
|
||||
#define CompilerName "iasl"
|
||||
#define CompilerCreatorId "INTL"
|
||||
#define ASL_COMPLIANCE "Supports ACPI Specification Revision 4.0a"
|
||||
|
||||
|
||||
/* Configuration constants */
|
||||
|
@ -140,11 +138,22 @@
|
|||
#define ASL_STRING_CACHE_SIZE 32768
|
||||
|
||||
#define ASL_FIRST_PARSE_OPCODE PARSEOP_ACCESSAS
|
||||
#define ASL_YYTNAME_START 3
|
||||
|
||||
#define ASL_PARSE_OPCODE_BASE PARSEOP_ACCESSAS /* First Lex type */
|
||||
|
||||
|
||||
/*
|
||||
* Per-parser-generator configuration. These values are used to cheat and
|
||||
* directly access the bison/yacc token name table (yyname or yytname).
|
||||
* Note: These values are the index in yyname for the first lex token
|
||||
* (PARSEOP_ACCCESSAS).
|
||||
*/
|
||||
#if defined (YYBISON)
|
||||
#define ASL_YYTNAME_START 3 /* Bison */
|
||||
#elif defined (YYBYACC)
|
||||
#define ASL_YYTNAME_START 257 /* Berkeley yacc */
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Macros
|
||||
*/
|
||||
|
@ -171,6 +180,7 @@
|
|||
|
||||
/* filename suffixes for output files */
|
||||
|
||||
#define FILE_SUFFIX_PREPROCESSOR "i"
|
||||
#define FILE_SUFFIX_AML_CODE "aml"
|
||||
#define FILE_SUFFIX_LISTING "lst"
|
||||
#define FILE_SUFFIX_HEX_DUMP "hex"
|
||||
|
@ -182,6 +192,7 @@
|
|||
#define FILE_SUFFIX_DISASSEMBLY "dsl"
|
||||
#define FILE_SUFFIX_ASM_INCLUDE "inc"
|
||||
#define FILE_SUFFIX_C_INCLUDE "h"
|
||||
#define FILE_SUFFIX_ASL_CODE "asl"
|
||||
|
||||
|
||||
/* Types for input files */
|
||||
|
@ -196,6 +207,7 @@
|
|||
#define ASL_EXTERNAL_METHOD 255
|
||||
#define ASL_ABORT TRUE
|
||||
#define ASL_NO_ABORT FALSE
|
||||
#define ASL_EOF ACPI_UINT32_MAX
|
||||
|
||||
|
||||
/* Support for reserved method names */
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
|
@ -241,6 +241,8 @@ AePrintException (
|
|||
UINT32 ErrorColumn;
|
||||
FILE *OutputFile;
|
||||
FILE *SourceFile;
|
||||
long FileSize;
|
||||
BOOLEAN PrematureEOF = FALSE;
|
||||
|
||||
|
||||
if (Gbl_NoErrors)
|
||||
|
@ -280,7 +282,27 @@ AePrintException (
|
|||
/* Get the file handles */
|
||||
|
||||
OutputFile = Gbl_Files[FileId].Handle;
|
||||
|
||||
/* Use the merged header/source file if present, otherwise use input file */
|
||||
|
||||
SourceFile = Gbl_Files[ASL_FILE_SOURCE_OUTPUT].Handle;
|
||||
if (!SourceFile)
|
||||
{
|
||||
SourceFile = Gbl_Files[ASL_FILE_INPUT].Handle;
|
||||
}
|
||||
|
||||
if (SourceFile)
|
||||
{
|
||||
/* Determine if the error occurred at source file EOF */
|
||||
|
||||
fseek (SourceFile, 0, SEEK_END);
|
||||
FileSize = ftell (SourceFile);
|
||||
|
||||
if ((long) Enode->LogicalByteOffset >= FileSize)
|
||||
{
|
||||
PrematureEOF = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
if (Header)
|
||||
{
|
||||
|
@ -297,36 +319,45 @@ AePrintException (
|
|||
|
||||
if (Enode->LineNumber)
|
||||
{
|
||||
fprintf (OutputFile, "%6u: ", Enode->LineNumber);
|
||||
fprintf (OutputFile, " %6u: ", Enode->LineNumber);
|
||||
|
||||
/*
|
||||
* Seek to the offset in the combined source file, read the source
|
||||
* line, and write it to the output.
|
||||
* If not at EOF, get the corresponding source code line and
|
||||
* display it. Don't attempt this if we have a premature EOF
|
||||
* condition.
|
||||
*/
|
||||
Actual = fseek (SourceFile, (long) Enode->LogicalByteOffset,
|
||||
(int) SEEK_SET);
|
||||
if (Actual)
|
||||
if (!PrematureEOF)
|
||||
{
|
||||
fprintf (OutputFile,
|
||||
"[*** iASL: Seek error on source code temp file %s ***]",
|
||||
Gbl_Files[ASL_FILE_SOURCE_OUTPUT].Filename);
|
||||
}
|
||||
else
|
||||
{
|
||||
RActual = fread (&SourceByte, 1, 1, SourceFile);
|
||||
if (!RActual)
|
||||
/*
|
||||
* Seek to the offset in the combined source file, read
|
||||
* the source line, and write it to the output.
|
||||
*/
|
||||
Actual = fseek (SourceFile, (long) Enode->LogicalByteOffset,
|
||||
(int) SEEK_SET);
|
||||
if (Actual)
|
||||
{
|
||||
fprintf (OutputFile,
|
||||
"[*** iASL: Read error on source code temp file %s ***]",
|
||||
"[*** iASL: Seek error on source code temp file %s ***]",
|
||||
Gbl_Files[ASL_FILE_SOURCE_OUTPUT].Filename);
|
||||
}
|
||||
|
||||
else while (RActual && SourceByte && (SourceByte != '\n'))
|
||||
else
|
||||
{
|
||||
fwrite (&SourceByte, 1, 1, OutputFile);
|
||||
RActual = fread (&SourceByte, 1, 1, SourceFile);
|
||||
if (!RActual)
|
||||
{
|
||||
fprintf (OutputFile,
|
||||
"[*** iASL: Read error on source code temp file %s ***]",
|
||||
Gbl_Files[ASL_FILE_SOURCE_OUTPUT].Filename);
|
||||
}
|
||||
|
||||
else while (RActual && SourceByte && (SourceByte != '\n'))
|
||||
{
|
||||
fwrite (&SourceByte, 1, 1, OutputFile);
|
||||
RActual = fread (&SourceByte, 1, 1, SourceFile);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fprintf (OutputFile, "\n");
|
||||
}
|
||||
}
|
||||
|
@ -351,7 +382,7 @@ AePrintException (
|
|||
{
|
||||
/* Decode the message ID */
|
||||
|
||||
fprintf (OutputFile, "%s %4.4d -",
|
||||
fprintf (OutputFile, "%s %4.4d - ",
|
||||
AslErrorLevel[Enode->Level],
|
||||
Enode->MessageId + ((Enode->Level+1) * 1000));
|
||||
|
||||
|
@ -369,7 +400,7 @@ AePrintException (
|
|||
ExtraMessage = NULL;
|
||||
}
|
||||
|
||||
if (Gbl_VerboseErrors)
|
||||
if (Gbl_VerboseErrors && !PrematureEOF)
|
||||
{
|
||||
SourceColumn = Enode->Column + Enode->FilenameLength + 6 + 2;
|
||||
ErrorColumn = ASL_ERROR_LEVEL_LENGTH + 5 + 2 + 1;
|
||||
|
@ -399,6 +430,11 @@ AePrintException (
|
|||
fprintf (OutputFile, " (%s)", ExtraMessage);
|
||||
}
|
||||
|
||||
if (PrematureEOF)
|
||||
{
|
||||
fprintf (OutputFile, " and premature End-Of-File");
|
||||
}
|
||||
|
||||
fprintf (OutputFile, "\n");
|
||||
if (Gbl_VerboseErrors)
|
||||
{
|
||||
|
@ -656,13 +692,13 @@ AslCoreSubsystemError (
|
|||
|
||||
int
|
||||
AslCompilererror (
|
||||
char *CompilerMessage)
|
||||
const char *CompilerMessage)
|
||||
{
|
||||
|
||||
AslCommonError (ASL_ERROR, ASL_MSG_SYNTAX, Gbl_CurrentLineNumber,
|
||||
Gbl_LogicalLineNumber, Gbl_CurrentLineOffset,
|
||||
Gbl_CurrentColumn, Gbl_Files[ASL_FILE_INPUT].Filename,
|
||||
CompilerMessage);
|
||||
Gbl_LogicalLineNumber, Gbl_CurrentLineOffset,
|
||||
Gbl_CurrentColumn, Gbl_Files[ASL_FILE_INPUT].Filename,
|
||||
ACPI_CAST_PTR (char, CompilerMessage));
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
|
@ -122,7 +122,7 @@
|
|||
|
||||
/* Local prototypes */
|
||||
|
||||
FILE *
|
||||
static FILE *
|
||||
FlOpenIncludeWithPrefix (
|
||||
char *PrefixDir,
|
||||
char *Filename);
|
||||
|
@ -546,7 +546,7 @@ FlAddIncludeDirectory (
|
|||
*
|
||||
******************************************************************************/
|
||||
|
||||
FILE *
|
||||
static FILE *
|
||||
FlOpenIncludeWithPrefix (
|
||||
char *PrefixDir,
|
||||
char *Filename)
|
||||
|
@ -768,22 +768,49 @@ FlOpenMiscOutputFiles (
|
|||
char *Filename;
|
||||
|
||||
|
||||
/* Create/Open a combined source output file */
|
||||
/* Create/Open a hex output file if asked */
|
||||
|
||||
Filename = FlGenerateFilename (FilenamePrefix, FILE_SUFFIX_SOURCE);
|
||||
if (!Filename)
|
||||
if (Gbl_HexOutputFlag)
|
||||
{
|
||||
AslCommonError (ASL_ERROR, ASL_MSG_LISTING_FILENAME,
|
||||
0, 0, 0, 0, NULL, NULL);
|
||||
return (AE_ERROR);
|
||||
Filename = FlGenerateFilename (FilenamePrefix, FILE_SUFFIX_HEX_DUMP);
|
||||
if (!Filename)
|
||||
{
|
||||
AslCommonError (ASL_ERROR, ASL_MSG_LISTING_FILENAME,
|
||||
0, 0, 0, 0, NULL, NULL);
|
||||
return (AE_ERROR);
|
||||
}
|
||||
|
||||
/* Open the hex file, text mode */
|
||||
|
||||
FlOpenFile (ASL_FILE_HEX_OUTPUT, Filename, "w+");
|
||||
|
||||
AslCompilerSignon (ASL_FILE_HEX_OUTPUT);
|
||||
AslCompilerFileHeader (ASL_FILE_HEX_OUTPUT);
|
||||
}
|
||||
|
||||
/*
|
||||
* Open the source output file, binary mode (so that LF does not get
|
||||
* expanded to CR/LF on some systems, messing up our seek
|
||||
* calculations.)
|
||||
*/
|
||||
FlOpenFile (ASL_FILE_SOURCE_OUTPUT, Filename, "w+b");
|
||||
/* Create/Open a debug output file if asked */
|
||||
|
||||
if (Gbl_DebugFlag)
|
||||
{
|
||||
Filename = FlGenerateFilename (FilenamePrefix, FILE_SUFFIX_DEBUG);
|
||||
if (!Filename)
|
||||
{
|
||||
AslCommonError (ASL_ERROR, ASL_MSG_DEBUG_FILENAME,
|
||||
0, 0, 0, 0, NULL, NULL);
|
||||
return (AE_ERROR);
|
||||
}
|
||||
|
||||
/* Open the debug file as STDERR, text mode */
|
||||
|
||||
/* TBD: hide this behind a FlReopenFile function */
|
||||
|
||||
Gbl_Files[ASL_FILE_DEBUG_OUTPUT].Filename = Filename;
|
||||
Gbl_Files[ASL_FILE_DEBUG_OUTPUT].Handle =
|
||||
freopen (Filename, "w+t", stderr);
|
||||
|
||||
AslCompilerSignon (ASL_FILE_DEBUG_OUTPUT);
|
||||
AslCompilerFileHeader (ASL_FILE_DEBUG_OUTPUT);
|
||||
}
|
||||
|
||||
/* Create/Open a listing output file if asked */
|
||||
|
||||
|
@ -805,6 +832,28 @@ FlOpenMiscOutputFiles (
|
|||
AslCompilerFileHeader (ASL_FILE_LISTING_OUTPUT);
|
||||
}
|
||||
|
||||
if (Gbl_FileType == ASL_INPUT_TYPE_ASCII_DATA)
|
||||
{
|
||||
return (AE_OK);
|
||||
}
|
||||
|
||||
/* Create/Open a combined source output file */
|
||||
|
||||
Filename = FlGenerateFilename (FilenamePrefix, FILE_SUFFIX_SOURCE);
|
||||
if (!Filename)
|
||||
{
|
||||
AslCommonError (ASL_ERROR, ASL_MSG_LISTING_FILENAME,
|
||||
0, 0, 0, 0, NULL, NULL);
|
||||
return (AE_ERROR);
|
||||
}
|
||||
|
||||
/*
|
||||
* Open the source output file, binary mode (so that LF does not get
|
||||
* expanded to CR/LF on some systems, messing up our seek
|
||||
* calculations.)
|
||||
*/
|
||||
FlOpenFile (ASL_FILE_SOURCE_OUTPUT, Filename, "w+b");
|
||||
|
||||
/* Create/Open a assembly code source output file if asked */
|
||||
|
||||
if (Gbl_AsmOutputFlag)
|
||||
|
@ -887,26 +936,6 @@ FlOpenMiscOutputFiles (
|
|||
AslCompilerFileHeader (ASL_FILE_C_INCLUDE_OUTPUT);
|
||||
}
|
||||
|
||||
/* Create/Open a hex output file if asked */
|
||||
|
||||
if (Gbl_HexOutputFlag)
|
||||
{
|
||||
Filename = FlGenerateFilename (FilenamePrefix, FILE_SUFFIX_HEX_DUMP);
|
||||
if (!Filename)
|
||||
{
|
||||
AslCommonError (ASL_ERROR, ASL_MSG_LISTING_FILENAME,
|
||||
0, 0, 0, 0, NULL, NULL);
|
||||
return (AE_ERROR);
|
||||
}
|
||||
|
||||
/* Open the hex file, text mode */
|
||||
|
||||
FlOpenFile (ASL_FILE_HEX_OUTPUT, Filename, "w+");
|
||||
|
||||
AslCompilerSignon (ASL_FILE_HEX_OUTPUT);
|
||||
AslCompilerFileHeader (ASL_FILE_HEX_OUTPUT);
|
||||
}
|
||||
|
||||
/* Create a namespace output file if asked */
|
||||
|
||||
if (Gbl_NsOutputFlag)
|
||||
|
@ -927,30 +956,6 @@ FlOpenMiscOutputFiles (
|
|||
AslCompilerFileHeader (ASL_FILE_NAMESPACE_OUTPUT);
|
||||
}
|
||||
|
||||
/* Create/Open a debug output file if asked */
|
||||
|
||||
if (Gbl_DebugFlag)
|
||||
{
|
||||
Filename = FlGenerateFilename (FilenamePrefix, FILE_SUFFIX_DEBUG);
|
||||
if (!Filename)
|
||||
{
|
||||
AslCommonError (ASL_ERROR, ASL_MSG_DEBUG_FILENAME,
|
||||
0, 0, 0, 0, NULL, NULL);
|
||||
return (AE_ERROR);
|
||||
}
|
||||
|
||||
/* Open the debug file as STDERR, text mode */
|
||||
|
||||
/* TBD: hide this behind a FlReopenFile function */
|
||||
|
||||
Gbl_Files[ASL_FILE_DEBUG_OUTPUT].Filename = Filename;
|
||||
Gbl_Files[ASL_FILE_DEBUG_OUTPUT].Handle =
|
||||
freopen (Filename, "w+t", stderr);
|
||||
|
||||
AslCompilerSignon (ASL_FILE_DEBUG_OUTPUT);
|
||||
AslCompilerFileHeader (ASL_FILE_DEBUG_OUTPUT);
|
||||
}
|
||||
|
||||
return (AE_OK);
|
||||
}
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
|
@ -141,9 +141,9 @@
|
|||
extern int yydebug;
|
||||
extern FILE *AslCompilerin;
|
||||
extern int AslCompilerdebug;
|
||||
extern int DtParserdebug;
|
||||
extern const ASL_MAPPING_ENTRY AslKeywordMapping[];
|
||||
extern char *AslCompilertext;
|
||||
extern char HexLookup[];
|
||||
|
||||
#define ASL_LINE_BUFFER_SIZE 1024
|
||||
#define ASL_MSG_BUFFER_SIZE 4096
|
||||
|
@ -171,6 +171,7 @@ ASL_EXTERN ASL_ERROR_MSG ASL_INIT_GLOBAL (*Gbl_NextError,NULL);
|
|||
|
||||
ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_DoCompile, TRUE);
|
||||
ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_DoSignon, TRUE);
|
||||
ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_DisassembleAll, FALSE);
|
||||
|
||||
ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_Acpi2, FALSE);
|
||||
ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_UseDefaultAmlFilename, TRUE);
|
||||
|
@ -197,7 +198,8 @@ ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_DisplayRemarks, TRUE);
|
|||
ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_DisplayOptimizations, FALSE);
|
||||
ASL_EXTERN UINT8 ASL_INIT_GLOBAL (Gbl_WarningLevel, ASL_WARNING);
|
||||
ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_UseOriginalCompilerId, FALSE);
|
||||
ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_DataTableCompilerAvailable, FALSE);
|
||||
ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_VerboseTemplates, FALSE);
|
||||
ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_DoTemplates, FALSE);
|
||||
|
||||
|
||||
#define HEX_OUTPUT_NONE 0
|
||||
|
@ -213,7 +215,6 @@ ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_HexOutputFlag, HEX_OUTP
|
|||
ASL_EXTERN ASL_FILE_INFO Gbl_Files [ASL_NUM_FILES];
|
||||
|
||||
ASL_EXTERN char *Gbl_DirectoryPath;
|
||||
ASL_EXTERN char ASL_INIT_GLOBAL (*Gbl_ExternalFilename, NULL);
|
||||
ASL_EXTERN char ASL_INIT_GLOBAL (*Gbl_IncludeFilename, NULL);
|
||||
ASL_EXTERN char ASL_INIT_GLOBAL (*Gbl_OutputFilenamePrefix, NULL);
|
||||
ASL_EXTERN ASL_INCLUDE_DIR ASL_INIT_GLOBAL (*Gbl_IncludeDirList, NULL);
|
||||
|
@ -252,7 +253,7 @@ ASL_EXTERN char ASL_INIT_GLOBAL (*Gbl_StringCacheLast, NULL)
|
|||
ASL_EXTERN ACPI_PARSE_OBJECT *Gbl_FirstLevelInsertionNode;
|
||||
ASL_EXTERN UINT8 ASL_INIT_GLOBAL (Gbl_FileType, 0);
|
||||
ASL_EXTERN char ASL_INIT_GLOBAL (*Gbl_Signature, NULL);
|
||||
|
||||
ASL_EXTERN char *Gbl_TemplateSignature;
|
||||
|
||||
ASL_EXTERN UINT32 ASL_INIT_GLOBAL (Gbl_CurrentHexColumn, 0);
|
||||
ASL_EXTERN UINT32 ASL_INIT_GLOBAL (Gbl_CurrentAmlOffset, 0);
|
||||
|
@ -269,6 +270,7 @@ ASL_EXTERN FILE *AcpiGbl_DebugFile; /* Placeholder for oswin
|
|||
|
||||
ASL_EXTERN ASL_ANALYSIS_WALK_INFO AnalysisWalkInfo;
|
||||
ASL_EXTERN ACPI_TABLE_HEADER TableHeader;
|
||||
extern char AslHexLookup[];
|
||||
|
||||
/* Event timing */
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
|
@ -202,7 +202,7 @@ static void
|
|||
LsDoHexOutputAsl (
|
||||
void);
|
||||
|
||||
ACPI_STATUS
|
||||
static ACPI_STATUS
|
||||
LsTreeWriteWalk (
|
||||
ACPI_PARSE_OBJECT *Op,
|
||||
UINT32 Level,
|
||||
|
@ -222,7 +222,7 @@ LsTreeWriteWalk (
|
|||
*
|
||||
******************************************************************************/
|
||||
|
||||
ACPI_STATUS
|
||||
static ACPI_STATUS
|
||||
LsTreeWriteWalk (
|
||||
ACPI_PARSE_OBJECT *Op,
|
||||
UINT32 Level,
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
|
@ -180,11 +180,7 @@ LsDoOnePathname (
|
|||
void *Context,
|
||||
void **ReturnValue);
|
||||
|
||||
void
|
||||
LsSetupNsList (
|
||||
void *Handle);
|
||||
|
||||
ACPI_PARSE_OBJECT *
|
||||
static ACPI_PARSE_OBJECT *
|
||||
LkGetNameOp (
|
||||
ACPI_PARSE_OBJECT *Op);
|
||||
|
||||
|
@ -623,7 +619,7 @@ LkObjectExists (
|
|||
*
|
||||
******************************************************************************/
|
||||
|
||||
ACPI_PARSE_OBJECT *
|
||||
static ACPI_PARSE_OBJECT *
|
||||
LkGetNameOp (
|
||||
ACPI_PARSE_OBJECT *Op)
|
||||
{
|
||||
|
@ -1327,8 +1323,8 @@ LkNamespaceLocateBegin (
|
|||
SpaceIdOp = OwningOp->Asl.Child->Asl.Next;
|
||||
switch ((UINT32) SpaceIdOp->Asl.Value.Integer)
|
||||
{
|
||||
case REGION_EC:
|
||||
case REGION_CMOS:
|
||||
case ACPI_ADR_SPACE_EC:
|
||||
case ACPI_ADR_SPACE_CMOS:
|
||||
|
||||
if ((UINT8) Op->Asl.Parent->Asl.Value.Integer != AML_FIELD_ACCESS_BYTE)
|
||||
{
|
||||
|
@ -1336,8 +1332,8 @@ LkNamespaceLocateBegin (
|
|||
}
|
||||
break;
|
||||
|
||||
case REGION_SMBUS:
|
||||
case REGION_IPMI:
|
||||
case ACPI_ADR_SPACE_SMBUS:
|
||||
case ACPI_ADR_SPACE_IPMI:
|
||||
|
||||
if ((UINT8) Op->Asl.Parent->Asl.Value.Integer != AML_FIELD_ACCESS_BUFFER)
|
||||
{
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
|
@ -119,6 +119,7 @@
|
|||
|
||||
#include "aslcompiler.h"
|
||||
#include "acapps.h"
|
||||
#include "acdisasm.h"
|
||||
|
||||
#ifdef _DEBUG
|
||||
#include <crtdbg.h>
|
||||
|
@ -167,7 +168,7 @@ AslDoResponseFile (
|
|||
|
||||
|
||||
#define ASL_TOKEN_SEPARATORS " \t\n"
|
||||
#define ASL_SUPPORTED_OPTIONS "@:2b:c:d^e:fgh^i^I:l^no:p:r:s:t:v:w:x:yz"
|
||||
#define ASL_SUPPORTED_OPTIONS "@:2b:c:d^e:fgh^i^I:l^no:p:r:s:t:T:v:w:x:z"
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
|
@ -213,13 +214,18 @@ Options (
|
|||
printf (" -cr Disable Resource Descriptor error checking\n");
|
||||
printf (" -r<Revision> Override table header Revision (1-255)\n");
|
||||
|
||||
printf ("\nListings:\n");
|
||||
printf ("\nASL Listing Files:\n");
|
||||
printf (" -l Create mixed listing file (ASL source and AML) (*.lst)\n");
|
||||
printf (" -ln Create namespace file (*.nsp)\n");
|
||||
printf (" -ls Create combined source file (expanded includes) (*.src)\n");
|
||||
|
||||
printf ("\nACPI Data Tables:\n");
|
||||
printf (" -T <Sig>|ALL|* Create table template file(s) for <Sig>\n");
|
||||
printf (" -vt Create verbose templates (full disassembly)\n");
|
||||
|
||||
printf ("\nAML Disassembler:\n");
|
||||
printf (" -d [file] Disassemble or decode binary ACPI table to file (*.dsl)\n");
|
||||
printf (" -da [f1,f2] Disassemble multiple tables from single namespace\n");
|
||||
printf (" -dc [file] Disassemble AML and immediately compile it\n");
|
||||
printf (" (Obtain DSDT from current system if no input file)\n");
|
||||
printf (" -e [f1,f2] Include ACPI table(s) for external symbol resolution\n");
|
||||
|
@ -230,6 +236,7 @@ Options (
|
|||
printf (" -h Additional help and compiler debug options\n");
|
||||
printf (" -hc Display operators allowed in constant expressions\n");
|
||||
printf (" -hr Display ACPI reserved method names\n");
|
||||
printf (" -ht Display currently supported ACPI table names\n");
|
||||
}
|
||||
|
||||
|
||||
|
@ -268,7 +275,6 @@ HelpMessage (
|
|||
printf (" -n Parse only, no output generation\n");
|
||||
printf (" -ot Display compile times\n");
|
||||
printf (" -x<level> Set debug level for trace output\n");
|
||||
printf (" -y Temporary: Enable data table compiler\n");
|
||||
printf (" -z Do not insert new compiler ID for DataTables\n");
|
||||
}
|
||||
|
||||
|
@ -290,7 +296,8 @@ Usage (
|
|||
void)
|
||||
{
|
||||
|
||||
printf ("Usage: %s [Options] [Files]\n\n", CompilerName);
|
||||
printf ("%s\n", ASL_COMPLIANCE);
|
||||
printf ("Usage: %s [Options] [Files]\n\n", ASL_INVOCATION_NAME);
|
||||
Options ();
|
||||
}
|
||||
|
||||
|
@ -456,6 +463,7 @@ AslDoOptions (
|
|||
BOOLEAN IsResponseFile)
|
||||
{
|
||||
int j;
|
||||
ACPI_STATUS Status;
|
||||
|
||||
|
||||
/* Get the command line options */
|
||||
|
@ -489,10 +497,12 @@ AslDoOptions (
|
|||
{
|
||||
case 'b':
|
||||
AslCompilerdebug = 1; /* same as yydebug */
|
||||
DtParserdebug = 1;
|
||||
break;
|
||||
|
||||
case 'p':
|
||||
AslCompilerdebug = 1; /* same as yydebug */
|
||||
DtParserdebug = 1;
|
||||
break;
|
||||
|
||||
case 't':
|
||||
|
@ -530,6 +540,11 @@ AslDoOptions (
|
|||
Gbl_DoCompile = FALSE;
|
||||
break;
|
||||
|
||||
case 'a':
|
||||
Gbl_DoCompile = FALSE;
|
||||
Gbl_DisassembleAll = TRUE;
|
||||
break;
|
||||
|
||||
case 'c':
|
||||
break;
|
||||
|
||||
|
@ -543,7 +558,12 @@ AslDoOptions (
|
|||
|
||||
|
||||
case 'e':
|
||||
Gbl_ExternalFilename = AcpiGbl_Optarg;
|
||||
Status = AcpiDmAddToExternalFileList (AcpiGbl_Optarg);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
printf ("Could not add %s to external list\n", AcpiGbl_Optarg);
|
||||
return (-1);
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
|
@ -582,11 +602,14 @@ AslDoOptions (
|
|||
ApDisplayReservedNames ();
|
||||
exit (0);
|
||||
|
||||
case 't':
|
||||
UtDisplaySupportedTables ();
|
||||
exit (0);
|
||||
|
||||
default:
|
||||
printf ("Unknown option: -h%s\n", AcpiGbl_Optarg);
|
||||
return (-1);
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
case 'I': /* Add an include file search directory */
|
||||
|
@ -769,6 +792,12 @@ AslDoOptions (
|
|||
break;
|
||||
|
||||
|
||||
case 'T':
|
||||
Gbl_DoTemplates = TRUE;
|
||||
Gbl_TemplateSignature = AcpiGbl_Optarg;
|
||||
break;
|
||||
|
||||
|
||||
case 'v':
|
||||
|
||||
switch (AcpiGbl_Optarg[0])
|
||||
|
@ -797,6 +826,10 @@ AslDoOptions (
|
|||
Gbl_DoSignon = FALSE;
|
||||
break;
|
||||
|
||||
case 't':
|
||||
Gbl_VerboseTemplates = TRUE;
|
||||
break;
|
||||
|
||||
default:
|
||||
printf ("Unknown option: -v%s\n", AcpiGbl_Optarg);
|
||||
return (-1);
|
||||
|
@ -833,12 +866,6 @@ AslDoOptions (
|
|||
break;
|
||||
|
||||
|
||||
case 'y':
|
||||
|
||||
Gbl_DataTableCompilerAvailable = TRUE;
|
||||
break;
|
||||
|
||||
|
||||
case 'z':
|
||||
|
||||
Gbl_UseOriginalCompilerId = TRUE;
|
||||
|
@ -872,13 +899,14 @@ AslCommandLine (
|
|||
char **argv)
|
||||
{
|
||||
int BadCommandLine = 0;
|
||||
ACPI_STATUS Status;
|
||||
|
||||
|
||||
/* Minimum command line contains at least the command and an input file */
|
||||
|
||||
if (argc < 2)
|
||||
{
|
||||
AslCompilerSignon (ASL_FILE_STDOUT);
|
||||
printf (ACPI_COMMON_SIGNON (ASL_COMPILER_NAME));
|
||||
Usage ();
|
||||
exit (1);
|
||||
}
|
||||
|
@ -887,6 +915,16 @@ AslCommandLine (
|
|||
|
||||
BadCommandLine = AslDoOptions (argc, argv, FALSE);
|
||||
|
||||
if (Gbl_DoTemplates)
|
||||
{
|
||||
Status = DtCreateTemplates (Gbl_TemplateSignature);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
exit (-1);
|
||||
}
|
||||
exit (1);
|
||||
}
|
||||
|
||||
/* Next parameter must be the input filename */
|
||||
|
||||
if (!argv[AcpiGbl_Optind] &&
|
||||
|
@ -899,7 +937,7 @@ AslCommandLine (
|
|||
|
||||
if (Gbl_DoSignon)
|
||||
{
|
||||
AslCompilerSignon (ASL_FILE_STDOUT);
|
||||
printf (ACPI_COMMON_SIGNON (ASL_COMPILER_NAME));
|
||||
}
|
||||
|
||||
/* Abort if anything went wrong on the command line */
|
||||
|
@ -934,9 +972,12 @@ main (
|
|||
char **argv)
|
||||
{
|
||||
ACPI_STATUS Status;
|
||||
int Index;
|
||||
int Index1;
|
||||
int Index2;
|
||||
|
||||
|
||||
AcpiGbl_ExternalFileList = NULL;
|
||||
|
||||
#ifdef _DEBUG
|
||||
_CrtSetDbgFlag (_CRTDBG_CHECK_ALWAYS_DF | _CRTDBG_LEAK_CHECK_DF |
|
||||
_CrtSetDbgFlag(_CRTDBG_REPORT_FLAG));
|
||||
|
@ -945,7 +986,7 @@ main (
|
|||
/* Init and command line */
|
||||
|
||||
AslInitialize ();
|
||||
Index = AslCommandLine (argc, argv);
|
||||
Index1 = Index2 = AslCommandLine (argc, argv);
|
||||
|
||||
/* Options that have no additional parameters or pathnames */
|
||||
|
||||
|
@ -959,17 +1000,36 @@ main (
|
|||
return (0);
|
||||
}
|
||||
|
||||
if (Gbl_DisassembleAll)
|
||||
{
|
||||
while (argv[Index1])
|
||||
{
|
||||
Status = AslDoOnePathname (argv[Index1], AcpiDmAddToExternalFileList);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return (-1);
|
||||
}
|
||||
|
||||
Index1++;
|
||||
}
|
||||
}
|
||||
|
||||
/* Process each pathname/filename in the list, with possible wildcards */
|
||||
|
||||
while (argv[Index])
|
||||
while (argv[Index2])
|
||||
{
|
||||
Status = AslDoOnePathname (argv[Index]);
|
||||
Status = AslDoOnePathname (argv[Index2], AslDoOneFile);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return (-1);
|
||||
}
|
||||
|
||||
Index++;
|
||||
Index2++;
|
||||
}
|
||||
|
||||
if (AcpiGbl_ExternalFileList)
|
||||
{
|
||||
AcpiDmClearExternalFileList();
|
||||
}
|
||||
|
||||
return (0);
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
|
@ -213,7 +213,7 @@ const ASL_MAPPING_ENTRY AslKeywordMapping [] =
|
|||
/* ACCESSTYPE_WORD */ OP_TABLE_ENTRY (AML_BYTE_OP, AML_FIELD_ACCESS_WORD, 0, 0),
|
||||
/* ACQUIRE */ OP_TABLE_ENTRY (AML_ACQUIRE_OP, 0, 0, ACPI_BTYPE_INTEGER),
|
||||
/* ADD */ OP_TABLE_ENTRY (AML_ADD_OP, 0, 0, ACPI_BTYPE_INTEGER),
|
||||
/* ADDRESSSPACE_FFIXEDHW */ OP_TABLE_ENTRY (AML_BYTE_OP, REGION_FIXED_HW, 0, 0),
|
||||
/* ADDRESSSPACE_FFIXEDHW */ OP_TABLE_ENTRY (AML_BYTE_OP, ACPI_ADR_SPACE_FIXED_HARDWARE, 0, 0),
|
||||
/* ADDRESSTYPE_ACPI */ OP_TABLE_ENTRY (AML_BYTE_OP, 2, 0, 0),
|
||||
/* ADDRESSTYPE_MEMORY */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0),
|
||||
/* ADDRESSTYPE_NVS */ OP_TABLE_ENTRY (AML_BYTE_OP, 3, 0, 0),
|
||||
|
@ -393,14 +393,14 @@ const ASL_MAPPING_ENTRY AslKeywordMapping [] =
|
|||
/* READWRITETYPE_BOTH */ OP_TABLE_ENTRY (AML_BYTE_OP, 1, 0, 0),
|
||||
/* READWRITETYPE_READONLY */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0),
|
||||
/* REFOF */ OP_TABLE_ENTRY (AML_REF_OF_OP, 0, 0, ACPI_BTYPE_REFERENCE),
|
||||
/* REGIONSPACE_CMOS */ OP_TABLE_ENTRY (AML_RAW_DATA_BYTE, REGION_CMOS, 0, 0),
|
||||
/* REGIONSPACE_EC */ OP_TABLE_ENTRY (AML_RAW_DATA_BYTE, REGION_EC, 0, 0),
|
||||
/* REGIONSPACE_IO */ OP_TABLE_ENTRY (AML_RAW_DATA_BYTE, REGION_IO, 0, 0),
|
||||
/* REGIONSPACE_IPMI */ OP_TABLE_ENTRY (AML_RAW_DATA_BYTE, REGION_IPMI, 0, 0),
|
||||
/* REGIONSPACE_MEM */ OP_TABLE_ENTRY (AML_RAW_DATA_BYTE, REGION_MEMORY, 0, 0),
|
||||
/* REGIONSPACE_PCI */ OP_TABLE_ENTRY (AML_RAW_DATA_BYTE, REGION_PCI_CONFIG, 0, 0),
|
||||
/* REGIONSPACE_PCIBAR */ OP_TABLE_ENTRY (AML_RAW_DATA_BYTE, REGION_PCI_BAR, 0, 0),
|
||||
/* REGIONSPACE_SMBUS */ OP_TABLE_ENTRY (AML_RAW_DATA_BYTE, REGION_SMBUS, 0, 0),
|
||||
/* REGIONSPACE_CMOS */ OP_TABLE_ENTRY (AML_RAW_DATA_BYTE, ACPI_ADR_SPACE_CMOS, 0, 0),
|
||||
/* REGIONSPACE_EC */ OP_TABLE_ENTRY (AML_RAW_DATA_BYTE, ACPI_ADR_SPACE_EC, 0, 0),
|
||||
/* REGIONSPACE_IO */ OP_TABLE_ENTRY (AML_RAW_DATA_BYTE, ACPI_ADR_SPACE_SYSTEM_IO, 0, 0),
|
||||
/* REGIONSPACE_IPMI */ OP_TABLE_ENTRY (AML_RAW_DATA_BYTE, ACPI_ADR_SPACE_IPMI, 0, 0),
|
||||
/* REGIONSPACE_MEM */ OP_TABLE_ENTRY (AML_RAW_DATA_BYTE, ACPI_ADR_SPACE_SYSTEM_MEMORY, 0, 0),
|
||||
/* REGIONSPACE_PCI */ OP_TABLE_ENTRY (AML_RAW_DATA_BYTE, ACPI_ADR_SPACE_PCI_CONFIG, 0, 0),
|
||||
/* REGIONSPACE_PCIBAR */ OP_TABLE_ENTRY (AML_RAW_DATA_BYTE, ACPI_ADR_SPACE_PCI_BAR_TARGET, 0, 0),
|
||||
/* REGIONSPACE_SMBUS */ OP_TABLE_ENTRY (AML_RAW_DATA_BYTE, ACPI_ADR_SPACE_SMBUS, 0, 0),
|
||||
/* REGISTER */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0),
|
||||
/* RELEASE */ OP_TABLE_ENTRY (AML_RELEASE_OP, 0, 0, 0),
|
||||
/* RESERVED_BYTES */ OP_TABLE_ENTRY (AML_INT_RESERVEDFIELD_OP, 0, 0, 0),
|
||||
|
|
|
@ -0,0 +1,452 @@
|
|||
|
||||
/******************************************************************************
|
||||
*
|
||||
* Module Name: aslmessages.h - Compiler error/warning messages
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
*
|
||||
* 2.1. This is your license from Intel Corp. under its intellectual property
|
||||
* rights. You may have additional license terms from the party that provided
|
||||
* you this software, covering your right to use that party's intellectual
|
||||
* property rights.
|
||||
*
|
||||
* 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
|
||||
* copy of the source code appearing in this file ("Covered Code") an
|
||||
* irrevocable, perpetual, worldwide license under Intel's copyrights in the
|
||||
* base code distributed originally by Intel ("Original Intel Code") to copy,
|
||||
* make derivatives, distribute, use and display any portion of the Covered
|
||||
* Code in any form, with the right to sublicense such rights; and
|
||||
*
|
||||
* 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
|
||||
* license (with the right to sublicense), under only those claims of Intel
|
||||
* patents that are infringed by the Original Intel Code, to make, use, sell,
|
||||
* offer to sell, and import the Covered Code and derivative works thereof
|
||||
* solely to the minimum extent necessary to exercise the above copyright
|
||||
* license, and in no event shall the patent license extend to any additions
|
||||
* to or modifications of the Original Intel Code. No other license or right
|
||||
* is granted directly or by implication, estoppel or otherwise;
|
||||
*
|
||||
* The above copyright and patent license is granted only if the following
|
||||
* conditions are met:
|
||||
*
|
||||
* 3. Conditions
|
||||
*
|
||||
* 3.1. Redistribution of Source with Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification with rights to further distribute source must include
|
||||
* the above Copyright Notice, the above License, this list of Conditions,
|
||||
* and the following Disclaimer and Export Compliance provision. In addition,
|
||||
* Licensee must cause all Covered Code to which Licensee contributes to
|
||||
* contain a file documenting the changes Licensee made to create that Covered
|
||||
* Code and the date of any change. Licensee must include in that file the
|
||||
* documentation of any changes made by any predecessor Licensee. Licensee
|
||||
* must include a prominent statement that the modification is derived,
|
||||
* directly or indirectly, from Original Intel Code.
|
||||
*
|
||||
* 3.2. Redistribution of Source with no Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification without rights to further distribute source must
|
||||
* include the following Disclaimer and Export Compliance provision in the
|
||||
* documentation and/or other materials provided with distribution. In
|
||||
* addition, Licensee may not authorize further sublicense of source of any
|
||||
* portion of the Covered Code, and must include terms to the effect that the
|
||||
* license from Licensee to its licensee is limited to the intellectual
|
||||
* property embodied in the software Licensee provides to its licensee, and
|
||||
* not to intellectual property embodied in modifications its licensee may
|
||||
* make.
|
||||
*
|
||||
* 3.3. Redistribution of Executable. Redistribution in executable form of any
|
||||
* substantial portion of the Covered Code or modification must reproduce the
|
||||
* above Copyright Notice, and the following Disclaimer and Export Compliance
|
||||
* provision in the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* 3.4. Intel retains all right, title, and interest in and to the Original
|
||||
* Intel Code.
|
||||
*
|
||||
* 3.5. Neither the name Intel nor any other trademark owned or controlled by
|
||||
* Intel shall be used in advertising or otherwise to promote the sale, use or
|
||||
* other dealings in products derived from or relating to the Covered Code
|
||||
* without prior written authorization from Intel.
|
||||
*
|
||||
* 4. Disclaimer and Export Compliance
|
||||
*
|
||||
* 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
|
||||
* HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
|
||||
* IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
|
||||
* INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
|
||||
* UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
|
||||
* PARTICULAR PURPOSE.
|
||||
*
|
||||
* 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
|
||||
* OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
|
||||
* COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
|
||||
* SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
|
||||
* CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
|
||||
* HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
|
||||
* SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
|
||||
* LIMITED REMEDY.
|
||||
*
|
||||
* 4.3. Licensee shall not export, either directly or indirectly, any of this
|
||||
* software or system incorporating such software without first obtaining any
|
||||
* required license or other approval from the U. S. Department of Commerce or
|
||||
* any other agency or department of the United States Government. In the
|
||||
* event Licensee exports any such software from the United States or
|
||||
* re-exports any such software from a foreign destination, Licensee shall
|
||||
* ensure that the distribution and export/re-export of the software is in
|
||||
* compliance with all laws, regulations, orders, or other restrictions of the
|
||||
* U.S. Export Administration Regulations. Licensee agrees that neither it nor
|
||||
* any of its subsidiaries will export/re-export any technical data, process,
|
||||
* software, or service, directly or indirectly, to any country for which the
|
||||
* United States government or any agency thereof requires an export license,
|
||||
* other governmental approval, or letter of assurance, without first obtaining
|
||||
* such license, approval or letter.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
|
||||
#ifndef __ASLMESSAGES_H
|
||||
#define __ASLMESSAGES_H
|
||||
|
||||
|
||||
#define ASL_WARNING 0
|
||||
#define ASL_WARNING2 1
|
||||
#define ASL_WARNING3 2
|
||||
#define ASL_ERROR 3
|
||||
#define ASL_REMARK 4
|
||||
#define ASL_OPTIMIZATION 5
|
||||
#define ASL_NUM_REPORT_LEVELS 6
|
||||
|
||||
|
||||
/* Values for all compiler messages */
|
||||
|
||||
typedef enum
|
||||
{
|
||||
ASL_MSG_RESERVED = 0,
|
||||
ASL_MSG_ALPHANUMERIC_STRING,
|
||||
ASL_MSG_AML_NOT_IMPLEMENTED,
|
||||
ASL_MSG_ARG_COUNT_HI,
|
||||
ASL_MSG_ARG_COUNT_LO,
|
||||
ASL_MSG_ARG_INIT,
|
||||
ASL_MSG_BACKWARDS_OFFSET,
|
||||
ASL_MSG_BITS_TO_BYTES,
|
||||
ASL_MSG_BUFFER_LENGTH,
|
||||
ASL_MSG_BYTES_TO_BITS,
|
||||
ASL_MSG_CLOSE,
|
||||
ASL_MSG_COMPILER_INTERNAL,
|
||||
ASL_MSG_CONSTANT_EVALUATION,
|
||||
ASL_MSG_CONSTANT_FOLDED,
|
||||
ASL_MSG_CORE_EXCEPTION,
|
||||
ASL_MSG_DEBUG_FILE_OPEN,
|
||||
ASL_MSG_DEBUG_FILENAME,
|
||||
ASL_MSG_DEPENDENT_NESTING,
|
||||
ASL_MSG_DMA_CHANNEL,
|
||||
ASL_MSG_DMA_LIST,
|
||||
ASL_MSG_DUPLICATE_CASE,
|
||||
ASL_MSG_DUPLICATE_ITEM,
|
||||
ASL_MSG_EARLY_EOF,
|
||||
ASL_MSG_ENCODING_LENGTH,
|
||||
ASL_MSG_EX_INTERRUPT_LIST,
|
||||
ASL_MSG_EX_INTERRUPT_LIST_MIN,
|
||||
ASL_MSG_EX_INTERRUPT_NUMBER,
|
||||
ASL_MSG_FIELD_ACCESS_WIDTH,
|
||||
ASL_MSG_FIELD_UNIT_ACCESS_WIDTH,
|
||||
ASL_MSG_FIELD_UNIT_OFFSET,
|
||||
ASL_MSG_INCLUDE_FILE_OPEN,
|
||||
ASL_MSG_INPUT_FILE_OPEN,
|
||||
ASL_MSG_INTEGER_LENGTH,
|
||||
ASL_MSG_INTEGER_OPTIMIZATION,
|
||||
ASL_MSG_INTERRUPT_LIST,
|
||||
ASL_MSG_INTERRUPT_NUMBER,
|
||||
ASL_MSG_INVALID_CONSTANT_OP,
|
||||
ASL_MSG_INVALID_EISAID,
|
||||
ASL_MSG_INVALID_ESCAPE,
|
||||
ASL_MSG_INVALID_OPERAND,
|
||||
ASL_MSG_INVALID_PERFORMANCE,
|
||||
ASL_MSG_INVALID_PRIORITY,
|
||||
ASL_MSG_INVALID_STRING,
|
||||
ASL_MSG_INVALID_TARGET,
|
||||
ASL_MSG_INVALID_TIME,
|
||||
ASL_MSG_INVALID_TYPE,
|
||||
ASL_MSG_INVALID_UUID,
|
||||
ASL_MSG_LIST_LENGTH_LONG,
|
||||
ASL_MSG_LIST_LENGTH_SHORT,
|
||||
ASL_MSG_LISTING_FILE_OPEN,
|
||||
ASL_MSG_LISTING_FILENAME,
|
||||
ASL_MSG_LOCAL_INIT,
|
||||
ASL_MSG_LONG_LINE,
|
||||
ASL_MSG_MEMORY_ALLOCATION,
|
||||
ASL_MSG_MISSING_ENDDEPENDENT,
|
||||
ASL_MSG_MISSING_STARTDEPENDENT,
|
||||
ASL_MSG_MULTIPLE_TYPES,
|
||||
ASL_MSG_NAME_EXISTS,
|
||||
ASL_MSG_NAME_OPTIMIZATION,
|
||||
ASL_MSG_NESTED_COMMENT,
|
||||
ASL_MSG_NO_CASES,
|
||||
ASL_MSG_NO_RETVAL,
|
||||
ASL_MSG_NO_WHILE,
|
||||
ASL_MSG_NON_ASCII,
|
||||
ASL_MSG_NOT_EXIST,
|
||||
ASL_MSG_NOT_FOUND,
|
||||
ASL_MSG_NOT_METHOD,
|
||||
ASL_MSG_NOT_PARAMETER,
|
||||
ASL_MSG_NOT_REACHABLE,
|
||||
ASL_MSG_OPEN,
|
||||
ASL_MSG_OUTPUT_FILE_OPEN,
|
||||
ASL_MSG_OUTPUT_FILENAME,
|
||||
ASL_MSG_PACKAGE_LENGTH,
|
||||
ASL_MSG_READ,
|
||||
ASL_MSG_RECURSION,
|
||||
ASL_MSG_REGION_BUFFER_ACCESS,
|
||||
ASL_MSG_REGION_BYTE_ACCESS,
|
||||
ASL_MSG_RESERVED_ARG_COUNT_HI,
|
||||
ASL_MSG_RESERVED_ARG_COUNT_LO,
|
||||
ASL_MSG_RESERVED_METHOD,
|
||||
ASL_MSG_RESERVED_OPERAND_TYPE,
|
||||
ASL_MSG_RESERVED_RETURN_VALUE,
|
||||
ASL_MSG_RESERVED_USE,
|
||||
ASL_MSG_RESERVED_WORD,
|
||||
ASL_MSG_RESOURCE_FIELD,
|
||||
ASL_MSG_RESOURCE_INDEX,
|
||||
ASL_MSG_RESOURCE_LIST,
|
||||
ASL_MSG_RESOURCE_SOURCE,
|
||||
ASL_MSG_RETURN_TYPES,
|
||||
ASL_MSG_SCOPE_FWD_REF,
|
||||
ASL_MSG_SCOPE_TYPE,
|
||||
ASL_MSG_SEEK,
|
||||
ASL_MSG_SINGLE_NAME_OPTIMIZATION,
|
||||
ASL_MSG_SOME_NO_RETVAL,
|
||||
ASL_MSG_SWITCH_TYPE,
|
||||
ASL_MSG_SYNC_LEVEL,
|
||||
ASL_MSG_SYNTAX,
|
||||
ASL_MSG_TABLE_SIGNATURE,
|
||||
ASL_MSG_TOO_MANY_TEMPS,
|
||||
ASL_MSG_UNKNOWN_RESERVED_NAME,
|
||||
ASL_MSG_UNREACHABLE_CODE,
|
||||
ASL_MSG_UNSUPPORTED,
|
||||
ASL_MSG_VENDOR_LIST,
|
||||
ASL_MSG_WRITE,
|
||||
ASL_MSG_MULTIPLE_DEFAULT,
|
||||
ASL_MSG_TIMEOUT,
|
||||
ASL_MSG_RESULT_NOT_USED,
|
||||
ASL_MSG_NOT_REFERENCED,
|
||||
ASL_MSG_NON_ZERO,
|
||||
ASL_MSG_STRING_LENGTH,
|
||||
ASL_MSG_SERIALIZED,
|
||||
ASL_MSG_COMPILER_RESERVED,
|
||||
ASL_MSG_NAMED_OBJECT_IN_WHILE,
|
||||
ASL_MSG_LOCAL_OUTSIDE_METHOD,
|
||||
ASL_MSG_ALIGNMENT,
|
||||
ASL_MSG_ISA_ADDRESS,
|
||||
ASL_MSG_INVALID_MIN_MAX,
|
||||
ASL_MSG_INVALID_LENGTH,
|
||||
ASL_MSG_INVALID_LENGTH_FIXED,
|
||||
ASL_MSG_INVALID_GRANULARITY,
|
||||
ASL_MSG_INVALID_GRAN_FIXED,
|
||||
ASL_MSG_INVALID_ACCESS_SIZE,
|
||||
ASL_MSG_INVALID_ADDR_FLAGS,
|
||||
ASL_MSG_NULL_DESCRIPTOR,
|
||||
ASL_MSG_UPPER_CASE,
|
||||
ASL_MSG_HID_LENGTH,
|
||||
ASL_MSG_NULL_STRING,
|
||||
ASL_MSG_LEADING_ASTERISK,
|
||||
ASL_MSG_RESERVED_NO_RETURN_VAL,
|
||||
ASL_MSG_GPE_NAME_CONFLICT,
|
||||
ASL_MSG_NO_REGION,
|
||||
|
||||
ASL_MSG_INVALID_FIELD_NAME,
|
||||
ASL_MSG_INTEGER_SIZE,
|
||||
ASL_MSG_INVALID_HEX_INTEGER,
|
||||
ASL_MSG_BUFFER_ELEMENT,
|
||||
ASL_MSG_RESERVED_VALUE,
|
||||
ASL_MSG_FLAG_VALUE,
|
||||
ASL_MSG_ZERO_VALUE,
|
||||
ASL_MSG_UNKNOWN_TABLE,
|
||||
ASL_MSG_UNKNOWN_SUBTABLE,
|
||||
ASL_MSG_OEM_TABLE,
|
||||
ASL_MSG_UNKNOWN_LABEL,
|
||||
ASL_MSG_INVALID_EXPRESSION,
|
||||
ASL_MSG_DIVIDE_BY_ZERO
|
||||
|
||||
} ASL_MESSAGE_IDS;
|
||||
|
||||
|
||||
#ifdef ASL_EXCEPTIONS
|
||||
|
||||
/* Actual message strings for each compiler message */
|
||||
|
||||
char *AslMessages [] = {
|
||||
/* The zeroth message is reserved */ "",
|
||||
/* ASL_MSG_ALPHANUMERIC_STRING */ "String must be entirely alphanumeric",
|
||||
/* ASL_MSG_AML_NOT_IMPLEMENTED */ "Opcode is not implemented in compiler AML code generator",
|
||||
/* ASL_MSG_ARG_COUNT_HI */ "Too many arguments",
|
||||
/* ASL_MSG_ARG_COUNT_LO */ "Too few arguments",
|
||||
/* ASL_MSG_ARG_INIT */ "Method argument is not initialized",
|
||||
/* ASL_MSG_BACKWARDS_OFFSET */ "Invalid backwards offset",
|
||||
/* ASL_MSG_BITS_TO_BYTES */ "Field offset is in bits, but a byte offset is required",
|
||||
/* ASL_MSG_BUFFER_LENGTH */ "Effective AML buffer length is zero",
|
||||
/* ASL_MSG_BYTES_TO_BITS */ "Field offset is in bytes, but a bit offset is required",
|
||||
/* ASL_MSG_CLOSE */ "Could not close file",
|
||||
/* ASL_MSG_COMPILER_INTERNAL */ "Internal compiler error",
|
||||
/* ASL_MSG_CONSTANT_EVALUATION */ "Could not evaluate constant expression",
|
||||
/* ASL_MSG_CONSTANT_FOLDED */ "Constant expression evaluated and reduced",
|
||||
/* ASL_MSG_CORE_EXCEPTION */ "From ACPI CA Subsystem",
|
||||
/* ASL_MSG_DEBUG_FILE_OPEN */ "Could not open debug file",
|
||||
/* ASL_MSG_DEBUG_FILENAME */ "Could not create debug filename",
|
||||
/* ASL_MSG_DEPENDENT_NESTING */ "Dependent function macros cannot be nested",\
|
||||
/* ASL_MSG_DMA_CHANNEL */ "Invalid DMA channel (must be 0-7)",
|
||||
/* ASL_MSG_DMA_LIST */ "Too many DMA channels (8 max)",
|
||||
/* ASL_MSG_DUPLICATE_CASE */ "Case value already specified",
|
||||
/* ASL_MSG_DUPLICATE_ITEM */ "Duplicate value in list",
|
||||
/* ASL_MSG_EARLY_EOF */ "Premature end-of-file reached",
|
||||
/* ASL_MSG_ENCODING_LENGTH */ "Package length too long to encode",
|
||||
/* ASL_MSG_EX_INTERRUPT_LIST */ "Too many interrupts (255 max)",
|
||||
/* ASL_MSG_EX_INTERRUPT_LIST_MIN */ "Too few interrupts (1 minimum required)",
|
||||
/* ASL_MSG_EX_INTERRUPT_NUMBER */ "Invalid interrupt number (must be 32 bits)",
|
||||
/* ASL_MSG_FIELD_ACCESS_WIDTH */ "Access width is greater than region size",
|
||||
/* ASL_MSG_FIELD_UNIT_ACCESS_WIDTH */ "Access width of Field Unit extends beyond region limit",
|
||||
/* ASL_MSG_FIELD_UNIT_OFFSET */ "Field Unit extends beyond region limit",
|
||||
/* ASL_MSG_INCLUDE_FILE_OPEN */ "Could not open include file",
|
||||
/* ASL_MSG_INPUT_FILE_OPEN */ "Could not open input file",
|
||||
/* ASL_MSG_INTEGER_LENGTH */ "64-bit integer in 32-bit table, truncating",
|
||||
/* ASL_MSG_INTEGER_OPTIMIZATION */ "Integer optimized to single-byte AML opcode",
|
||||
/* ASL_MSG_INTERRUPT_LIST */ "Too many interrupts (16 max)",
|
||||
/* ASL_MSG_INTERRUPT_NUMBER */ "Invalid interrupt number (must be 0-15)",
|
||||
/* ASL_MSG_INVALID_CONSTANT_OP */ "Invalid operator in constant expression (not type 3/4/5)",
|
||||
/* ASL_MSG_INVALID_EISAID */ "EISAID string must be of the form \"UUUXXXX\" (3 uppercase, 4 hex digits)",
|
||||
/* ASL_MSG_INVALID_ESCAPE */ "Invalid or unknown escape sequence",
|
||||
/* ASL_MSG_INVALID_OPERAND */ "Invalid operand",
|
||||
/* ASL_MSG_INVALID_PERFORMANCE */ "Invalid performance/robustness value",
|
||||
/* ASL_MSG_INVALID_PRIORITY */ "Invalid priority value",
|
||||
/* ASL_MSG_INVALID_STRING */ "Invalid Hex/Octal Escape - Non-ASCII or NULL",
|
||||
/* ASL_MSG_INVALID_TARGET */ "Target operand not allowed in constant expression",
|
||||
/* ASL_MSG_INVALID_TIME */ "Time parameter too long (255 max)",
|
||||
/* ASL_MSG_INVALID_TYPE */ "Invalid type",
|
||||
/* ASL_MSG_INVALID_UUID */ "UUID string must be of the form \"aabbccdd-eeff-gghh-iijj-kkllmmnnoopp\"",
|
||||
/* ASL_MSG_LIST_LENGTH_LONG */ "Initializer list longer than declared package length",
|
||||
/* ASL_MSG_LIST_LENGTH_SHORT */ "Initializer list shorter than declared package length",
|
||||
/* ASL_MSG_LISTING_FILE_OPEN */ "Could not open listing file",
|
||||
/* ASL_MSG_LISTING_FILENAME */ "Could not create listing filename",
|
||||
/* ASL_MSG_LOCAL_INIT */ "Method local variable is not initialized",
|
||||
/* ASL_MSG_LONG_LINE */ "Splitting long input line",
|
||||
/* ASL_MSG_MEMORY_ALLOCATION */ "Memory allocation failure",
|
||||
/* ASL_MSG_MISSING_ENDDEPENDENT */ "Missing EndDependentFn() macro in dependent resource list",
|
||||
/* ASL_MSG_MISSING_STARTDEPENDENT */ "Missing StartDependentFn() macro in dependent resource list",
|
||||
/* ASL_MSG_MULTIPLE_TYPES */ "Multiple types",
|
||||
/* ASL_MSG_NAME_EXISTS */ "Name already exists in scope",
|
||||
/* ASL_MSG_NAME_OPTIMIZATION */ "NamePath optimized",
|
||||
/* ASL_MSG_NESTED_COMMENT */ "Nested comment found",
|
||||
/* ASL_MSG_NO_CASES */ "No Case statements under Switch",
|
||||
/* ASL_MSG_NO_RETVAL */ "Called method returns no value",
|
||||
/* ASL_MSG_NO_WHILE */ "No enclosing While statement",
|
||||
/* ASL_MSG_NON_ASCII */ "Invalid characters found in file",
|
||||
/* ASL_MSG_NOT_EXIST */ "Object does not exist",
|
||||
/* ASL_MSG_NOT_FOUND */ "Object not found or not accessible from scope",
|
||||
/* ASL_MSG_NOT_METHOD */ "Not a control method, cannot invoke",
|
||||
/* ASL_MSG_NOT_PARAMETER */ "Not a parameter, used as local only",
|
||||
/* ASL_MSG_NOT_REACHABLE */ "Object is not accessible from this scope",
|
||||
/* ASL_MSG_OPEN */ "Could not open file",
|
||||
/* ASL_MSG_OUTPUT_FILE_OPEN */ "Could not open output AML file",
|
||||
/* ASL_MSG_OUTPUT_FILENAME */ "Could not create output filename",
|
||||
/* ASL_MSG_PACKAGE_LENGTH */ "Effective AML package length is zero",
|
||||
/* ASL_MSG_READ */ "Could not read file",
|
||||
/* ASL_MSG_RECURSION */ "Recursive method call",
|
||||
/* ASL_MSG_REGION_BUFFER_ACCESS */ "Host Operation Region requires BufferAcc access",
|
||||
/* ASL_MSG_REGION_BYTE_ACCESS */ "Host Operation Region requires ByteAcc access",
|
||||
/* ASL_MSG_RESERVED_ARG_COUNT_HI */ "Reserved method has too many arguments",
|
||||
/* ASL_MSG_RESERVED_ARG_COUNT_LO */ "Reserved method has too few arguments",
|
||||
/* ASL_MSG_RESERVED_METHOD */ "Reserved name must be a control method",
|
||||
/* ASL_MSG_RESERVED_OPERAND_TYPE */ "Invalid object type for reserved name",
|
||||
/* ASL_MSG_RESERVED_RETURN_VALUE */ "Reserved method must return a value",
|
||||
/* ASL_MSG_RESERVED_USE */ "Invalid use of reserved name",
|
||||
/* ASL_MSG_RESERVED_WORD */ "Use of reserved name",
|
||||
/* ASL_MSG_RESOURCE_FIELD */ "Resource field name cannot be used as a target",
|
||||
/* ASL_MSG_RESOURCE_INDEX */ "Missing ResourceSourceIndex (required)",
|
||||
/* ASL_MSG_RESOURCE_LIST */ "Too many resource items (internal error)",
|
||||
/* ASL_MSG_RESOURCE_SOURCE */ "Missing ResourceSource string (required)",
|
||||
/* ASL_MSG_RETURN_TYPES */ "Not all control paths return a value",
|
||||
/* ASL_MSG_SCOPE_FWD_REF */ "Forward references from Scope operator not allowed",
|
||||
/* ASL_MSG_SCOPE_TYPE */ "Existing object has invalid type for Scope operator",
|
||||
/* ASL_MSG_SEEK */ "Could not seek file",
|
||||
/* ASL_MSG_SINGLE_NAME_OPTIMIZATION */ "NamePath optimized to NameSeg (uses run-time search path)",
|
||||
/* ASL_MSG_SOME_NO_RETVAL */ "Called method may not always return a value",
|
||||
/* ASL_MSG_SWITCH_TYPE */ "Switch expression is not a static Integer/Buffer/String data type, defaulting to Integer",
|
||||
/* ASL_MSG_SYNC_LEVEL */ "SyncLevel must be in the range 0-15",
|
||||
/* ASL_MSG_SYNTAX */ "",
|
||||
/* ASL_MSG_TABLE_SIGNATURE */ "Invalid Table Signature",
|
||||
/* ASL_MSG_TOO_MANY_TEMPS */ "Method requires too many temporary variables (_T_x)",
|
||||
/* ASL_MSG_UNKNOWN_RESERVED_NAME */ "Unknown reserved name",
|
||||
/* ASL_MSG_UNREACHABLE_CODE */ "Statement is unreachable",
|
||||
/* ASL_MSG_UNSUPPORTED */ "Unsupported feature",
|
||||
/* ASL_MSG_VENDOR_LIST */ "Too many vendor data bytes (7 max)",
|
||||
/* ASL_MSG_WRITE */ "Could not write file",
|
||||
/* ASL_MSG_MULTIPLE_DEFAULT */ "More than one Default statement within Switch construct",
|
||||
/* ASL_MSG_TIMEOUT */ "Result is not used, possible operator timeout will be missed",
|
||||
/* ASL_MSG_RESULT_NOT_USED */ "Result is not used, operator has no effect",
|
||||
/* ASL_MSG_NOT_REFERENCED */ "Namespace object is not referenced",
|
||||
/* ASL_MSG_NON_ZERO */ "Operand evaluates to zero",
|
||||
/* ASL_MSG_STRING_LENGTH */ "String literal too long",
|
||||
/* ASL_MSG_SERIALIZED */ "Control Method marked Serialized",
|
||||
/* ASL_MSG_COMPILER_RESERVED */ "Use of compiler reserved name",
|
||||
/* ASL_MSG_NAMED_OBJECT_IN_WHILE */ "Creating a named object in a While loop",
|
||||
/* ASL_MSG_LOCAL_OUTSIDE_METHOD */ "Local or Arg used outside a control method",
|
||||
/* ASL_MSG_ALIGNMENT */ "Must be a multiple of alignment/granularity value",
|
||||
/* ASL_MSG_ISA_ADDRESS */ "Maximum 10-bit ISA address (0x3FF)",
|
||||
/* ASL_MSG_INVALID_MIN_MAX */ "Address Min is greater than Address Max",
|
||||
/* ASL_MSG_INVALID_LENGTH */ "Length is larger than Min/Max window",
|
||||
/* ASL_MSG_INVALID_LENGTH_FIXED */ "Length is not equal to fixed Min/Max window",
|
||||
/* ASL_MSG_INVALID_GRANULARITY */ "Granularity must be zero or a power of two minus one",
|
||||
/* ASL_MSG_INVALID_GRAN_FIXED */ "Granularity must be zero for fixed Min/Max",
|
||||
/* ASL_MSG_INVALID_ACCESS_SIZE */ "Invalid AccessSize (Maximum is 4 - QWord access)",
|
||||
/* ASL_MSG_INVALID_ADDR_FLAGS */ "Invalid combination of Length and Min/Max fixed flags",
|
||||
/* ASL_MSG_NULL_DESCRIPTOR */ "Min/Max/Length/Gran are all zero, but no resource tag",
|
||||
/* ASL_MSG_UPPER_CASE */ "Non-hex letters must be upper case",
|
||||
/* ASL_MSG_HID_LENGTH */ "_HID string must be exactly 7 or 8 characters",
|
||||
/* ASL_MSG_NULL_STRING */ "Invalid zero-length (null) string",
|
||||
/* ASL_MSG_LEADING_ASTERISK */ "Invalid leading asterisk",
|
||||
/* ASL_MSG_RESERVED_NO_RETURN_VAL */ "Reserved method should not return a value",
|
||||
/* ASL_MSG_GPE_NAME_CONFLICT */ "Name conflicts with a previous GPE method",
|
||||
/* ASL_MSG_NO_REGION */ "_REG has no corresponding Operation Region",
|
||||
|
||||
/* These messages are used by the data table compiler only */
|
||||
|
||||
/* ASL_MSG_INVALID_FIELD_NAME */ "Invalid Field Name",
|
||||
/* ASL_MSG_INTEGER_SIZE */ "Integer too large for target",
|
||||
/* ASL_MSG_INVALID_HEX_INTEGER */ "Invalid hex integer constant",
|
||||
/* ASL_MSG_BUFFER_ELEMENT */ "Invalid element in buffer initializer list",
|
||||
/* ASL_MSG_RESERVED_VALUE */ "Reserved field must be zero",
|
||||
/* ASL_MSG_FLAG_VALUE */ "Flag value is too large",
|
||||
/* ASL_MSG_ZERO_VALUE */ "Value must be non-zero",
|
||||
/* ASL_MSG_UNKNOWN_TABLE */ "Unknown ACPI table signature",
|
||||
/* ASL_MSG_UNKNOWN_SUBTABLE */ "Unknown subtable type",
|
||||
/* ASL_MSG_OEM_TABLE */ "OEM table - unknown contents",
|
||||
/* ASL_MSG_UNKNOWN_LABEL */ "Label is undefined",
|
||||
/* ASL_MSG_INVALID_EXPRESSION */ "Invalid expression",
|
||||
/* ASL_MSG_DIVIDE_BY_ZERO */ "Expression contains divide-by-zero"
|
||||
};
|
||||
|
||||
|
||||
char *AslErrorLevel [ASL_NUM_REPORT_LEVELS] = {
|
||||
"Warning ",
|
||||
"Warning ",
|
||||
"Warning ",
|
||||
"Error ",
|
||||
"Remark ",
|
||||
"Optimize"
|
||||
};
|
||||
|
||||
#define ASL_ERROR_LEVEL_LENGTH 8 /* Length of strings above */
|
||||
|
||||
#endif /* ASL_EXCEPTIONS */
|
||||
|
||||
#endif /* __ASLMESSAGES_H */
|
|
@ -9,7 +9,7 @@
|
|||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
|
@ -123,13 +123,6 @@
|
|||
ACPI_MODULE_NAME ("aslopcodes")
|
||||
|
||||
|
||||
/* UUID support */
|
||||
|
||||
static UINT8 OpcMapToUUID[16] =
|
||||
{
|
||||
6,4,2,0,11,9,16,14,19,21,24,26,28,30,32,34
|
||||
};
|
||||
|
||||
/* Local prototypes */
|
||||
|
||||
static void
|
||||
|
@ -592,9 +585,9 @@ OpcDoEisaId (
|
|||
/* Create ID big-endian first (bits are contiguous) */
|
||||
|
||||
BigEndianId =
|
||||
(UINT32) (InString[0] - 0x40) << 26 |
|
||||
(UINT32) (InString[1] - 0x40) << 21 |
|
||||
(UINT32) (InString[2] - 0x40) << 16 |
|
||||
(UINT32) ((UINT8) (InString[0] - 0x40)) << 26 |
|
||||
(UINT32) ((UINT8) (InString[1] - 0x40)) << 21 |
|
||||
(UINT32) ((UINT8) (InString[2] - 0x40)) << 16 |
|
||||
|
||||
(UtHexCharToValue (InString[3])) << 12 |
|
||||
(UtHexCharToValue (InString[4])) << 8 |
|
||||
|
@ -641,49 +634,20 @@ OpcDoUuId (
|
|||
char *InString;
|
||||
char *Buffer;
|
||||
ACPI_STATUS Status = AE_OK;
|
||||
UINT32 i;
|
||||
ACPI_PARSE_OBJECT *NewOp;
|
||||
|
||||
|
||||
InString = (char *) Op->Asl.Value.String;
|
||||
|
||||
if (ACPI_STRLEN (InString) != 36)
|
||||
{
|
||||
Status = AE_BAD_PARAMETER;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Check all 36 characters for correct format */
|
||||
|
||||
for (i = 0; i < 36; i++)
|
||||
{
|
||||
if ((i == 8) || (i == 13) || (i == 18) || (i == 23))
|
||||
{
|
||||
if (InString[i] != '-')
|
||||
{
|
||||
Status = AE_BAD_PARAMETER;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!isxdigit ((int) InString[i]))
|
||||
{
|
||||
Status = AE_BAD_PARAMETER;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Buffer = UtLocalCalloc (16);
|
||||
|
||||
Status = AuValidateUuid (InString);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
AslError (ASL_ERROR, ASL_MSG_INVALID_UUID, Op, Op->Asl.Value.String);
|
||||
}
|
||||
else for (i = 0; i < 16; i++)
|
||||
else
|
||||
{
|
||||
Buffer[i] = (char) (UtHexCharToValue (InString[OpcMapToUUID[i]]) << 4);
|
||||
Buffer[i] |= (char) UtHexCharToValue (InString[OpcMapToUUID[i] + 1]);
|
||||
(void) AuConvertStringToUuid (InString, Buffer);
|
||||
}
|
||||
|
||||
/* Change Op to a Buffer */
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
|
@ -117,8 +117,6 @@
|
|||
|
||||
#include "aslcompiler.h"
|
||||
#include "aslcompiler.y.h"
|
||||
#include "amlcode.h"
|
||||
#include "acparser.h"
|
||||
#include "acpredef.h"
|
||||
|
||||
|
||||
|
@ -128,6 +126,11 @@
|
|||
|
||||
/* Local prototypes */
|
||||
|
||||
static void
|
||||
ApCheckForUnexpectedReturnValue (
|
||||
ACPI_PARSE_OBJECT *Op,
|
||||
ASL_METHOD_INFO *MethodInfo);
|
||||
|
||||
static UINT32
|
||||
ApCheckForSpecialName (
|
||||
ACPI_PARSE_OBJECT *Op,
|
||||
|
@ -219,7 +222,7 @@ static const ACPI_PREDEFINED_INFO ScopeNames[] = {
|
|||
*
|
||||
******************************************************************************/
|
||||
|
||||
void
|
||||
BOOLEAN
|
||||
ApCheckForPredefinedMethod (
|
||||
ACPI_PARSE_OBJECT *Op,
|
||||
ASL_METHOD_INFO *MethodInfo)
|
||||
|
@ -240,7 +243,7 @@ ApCheckForPredefinedMethod (
|
|||
case ACPI_COMPILER_RESERVED_NAME: /* A _Txx that was not emitted by compiler */
|
||||
|
||||
/* Just return, nothing to do */
|
||||
break;
|
||||
return (FALSE);
|
||||
|
||||
|
||||
case ACPI_EVENT_RESERVED_NAME: /* _Lxx/_Exx/_Wxx/_Qxx methods */
|
||||
|
@ -307,6 +310,55 @@ ApCheckForPredefinedMethod (
|
|||
}
|
||||
break;
|
||||
}
|
||||
|
||||
return (TRUE);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: ApCheckForUnexpectedReturnValue
|
||||
*
|
||||
* PARAMETERS: Op - A parse node of type "RETURN".
|
||||
* MethodInfo - Saved info about this method
|
||||
*
|
||||
* RETURN: None
|
||||
*
|
||||
* DESCRIPTION: Check for an unexpected return value from a predefined method.
|
||||
* Invoked for predefined methods that are defined to not return
|
||||
* any value. If there is a return value, issue a remark, since
|
||||
* the ASL writer may be confused as to the method definition
|
||||
* and/or functionality.
|
||||
*
|
||||
* Note: We ignore all return values of "Zero", since this is what a standalone
|
||||
* Return() statement will always generate -- so we ignore it here --
|
||||
* i.e., there is no difference between Return() and Return(Zero).
|
||||
* Also, a null Return() will be disassembled to return(Zero) -- so, we
|
||||
* don't want to generate extraneous remarks/warnings for a disassembled
|
||||
* ASL file.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
static void
|
||||
ApCheckForUnexpectedReturnValue (
|
||||
ACPI_PARSE_OBJECT *Op,
|
||||
ASL_METHOD_INFO *MethodInfo)
|
||||
{
|
||||
ACPI_PARSE_OBJECT *ReturnValueOp;
|
||||
|
||||
|
||||
/* Ignore Return() and Return(Zero) (they are the same) */
|
||||
|
||||
ReturnValueOp = Op->Asl.Child;
|
||||
if (ReturnValueOp->Asl.ParseOpcode == PARSEOP_ZERO)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
/* We have a valid return value, but the reserved name did not expect it */
|
||||
|
||||
AslError (ASL_WARNING, ASL_MSG_RESERVED_NO_RETURN_VAL,
|
||||
Op, MethodInfo->Op->Asl.ExternalName);
|
||||
}
|
||||
|
||||
|
||||
|
@ -323,7 +375,9 @@ ApCheckForPredefinedMethod (
|
|||
* value. Only "static" types can be validated - a simple return
|
||||
* of an integer/string/buffer/package or a named reference to
|
||||
* a static object. Values such as a Localx or Argx or a control
|
||||
* method invocation are not checked.
|
||||
* method invocation are not checked. Issue a warning if there is
|
||||
* a valid return value, but the reserved method defines no
|
||||
* return value.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
|
@ -343,20 +397,27 @@ ApCheckPredefinedReturnValue (
|
|||
|
||||
switch (Index)
|
||||
{
|
||||
case ACPI_EVENT_RESERVED_NAME: /* _Lxx/_Exx/_Wxx/_Qxx methods */
|
||||
|
||||
/* No return value expected, warn if there is one */
|
||||
|
||||
ApCheckForUnexpectedReturnValue (Op, MethodInfo);
|
||||
return;
|
||||
|
||||
case ACPI_NOT_RESERVED_NAME: /* No underscore or _Txx or _xxx name not matched */
|
||||
case ACPI_PREDEFINED_NAME: /* Resource Name or reserved scope name */
|
||||
case ACPI_COMPILER_RESERVED_NAME: /* A _Txx that was not emitted by compiler */
|
||||
case ACPI_EVENT_RESERVED_NAME: /* _Lxx/_Exx/_Wxx/_Qxx methods */
|
||||
|
||||
/* Just return, nothing to do */
|
||||
return;
|
||||
|
||||
default: /* A standard predefined ACPI name */
|
||||
|
||||
/* Exit if no return value expected */
|
||||
|
||||
if (!PredefinedNames[Index].Info.ExpectedBtypes)
|
||||
{
|
||||
/* No return value expected, warn if there is one */
|
||||
|
||||
ApCheckForUnexpectedReturnValue (Op, MethodInfo);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
|
@ -139,6 +139,7 @@
|
|||
* NULL, means "zero value for alignment is
|
||||
* OK, and means 64K alignment" (for
|
||||
* Memory24 descriptor)
|
||||
* Op - Parent Op for entire construct
|
||||
*
|
||||
* RETURN: None. Adds error messages to error log if necessary
|
||||
*
|
||||
|
@ -158,7 +159,8 @@ RsSmallAddressCheck (
|
|||
ACPI_PARSE_OBJECT *MinOp,
|
||||
ACPI_PARSE_OBJECT *MaxOp,
|
||||
ACPI_PARSE_OBJECT *LengthOp,
|
||||
ACPI_PARSE_OBJECT *AlignOp)
|
||||
ACPI_PARSE_OBJECT *AlignOp,
|
||||
ACPI_PARSE_OBJECT *Op)
|
||||
{
|
||||
|
||||
if (Gbl_NoResourceChecking)
|
||||
|
@ -166,6 +168,34 @@ RsSmallAddressCheck (
|
|||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
* Check for a so-called "null descriptor". These are descriptors that are
|
||||
* created with most fields set to zero. The intent is that the descriptor
|
||||
* will be updated/completed at runtime via a BufferField.
|
||||
*
|
||||
* If the descriptor does NOT have a resource tag, it cannot be referenced
|
||||
* by a BufferField and we will flag this as an error. Conversely, if
|
||||
* the descriptor has a resource tag, we will assume that a BufferField
|
||||
* will be used to dynamically update it, so no error.
|
||||
*
|
||||
* A possible enhancement to this check would be to verify that in fact
|
||||
* a BufferField is created using the resource tag, and perhaps even
|
||||
* verify that a Store is performed to the BufferField.
|
||||
*
|
||||
* Note: for these descriptors, Alignment is allowed to be zero
|
||||
*/
|
||||
if (!Minimum && !Maximum && !Length)
|
||||
{
|
||||
if (!Op->Asl.ExternalName)
|
||||
{
|
||||
/* No resource tag. Descriptor is fixed and is also illegal */
|
||||
|
||||
AslError (ASL_ERROR, ASL_MSG_NULL_DESCRIPTOR, Op, NULL);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/* Special case for Memory24, values are compressed */
|
||||
|
||||
if (Type == ACPI_RESOURCE_NAME_MEMORY24)
|
||||
|
@ -230,6 +260,7 @@ RsSmallAddressCheck (
|
|||
* MaxOp - Original Op for Address Max
|
||||
* LengthOp - Original Op for address range
|
||||
* GranOp - Original Op for address granularity
|
||||
* Op - Parent Op for entire construct
|
||||
*
|
||||
* RETURN: None. Adds error messages to error log if necessary
|
||||
*
|
||||
|
@ -259,7 +290,8 @@ RsLargeAddressCheck (
|
|||
ACPI_PARSE_OBJECT *MinOp,
|
||||
ACPI_PARSE_OBJECT *MaxOp,
|
||||
ACPI_PARSE_OBJECT *LengthOp,
|
||||
ACPI_PARSE_OBJECT *GranOp)
|
||||
ACPI_PARSE_OBJECT *GranOp,
|
||||
ACPI_PARSE_OBJECT *Op)
|
||||
{
|
||||
|
||||
if (Gbl_NoResourceChecking)
|
||||
|
@ -267,6 +299,32 @@ RsLargeAddressCheck (
|
|||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
* Check for a so-called "null descriptor". These are descriptors that are
|
||||
* created with most fields set to zero. The intent is that the descriptor
|
||||
* will be updated/completed at runtime via a BufferField.
|
||||
*
|
||||
* If the descriptor does NOT have a resource tag, it cannot be referenced
|
||||
* by a BufferField and we will flag this as an error. Conversely, if
|
||||
* the descriptor has a resource tag, we will assume that a BufferField
|
||||
* will be used to dynamically update it, so no error.
|
||||
*
|
||||
* A possible enhancement to this check would be to verify that in fact
|
||||
* a BufferField is created using the resource tag, and perhaps even
|
||||
* verify that a Store is performed to the BufferField.
|
||||
*/
|
||||
if (!Minimum && !Maximum && !Length && !Granularity)
|
||||
{
|
||||
if (!Op->Asl.ExternalName)
|
||||
{
|
||||
/* No resource tag. Descriptor is fixed and is also illegal */
|
||||
|
||||
AslError (ASL_ERROR, ASL_MSG_NULL_DESCRIPTOR, Op, NULL);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/* Basic checks on Min/Max/Length */
|
||||
|
||||
if (Minimum > Maximum)
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
|
@ -224,7 +224,6 @@ RsDoMemory24Descriptor (
|
|||
ACPI_PARSE_OBJECT *MinOp = NULL;
|
||||
ACPI_PARSE_OBJECT *MaxOp = NULL;
|
||||
ACPI_PARSE_OBJECT *LengthOp = NULL;
|
||||
ACPI_PARSE_OBJECT *AlignOp = NULL;
|
||||
ASL_RESOURCE_NODE *Rnode;
|
||||
UINT32 i;
|
||||
|
||||
|
@ -270,7 +269,6 @@ RsDoMemory24Descriptor (
|
|||
Descriptor->Memory24.Alignment = (UINT16) InitializerOp->Asl.Value.Integer;
|
||||
RsCreateByteField (InitializerOp, ACPI_RESTAG_ALIGNMENT,
|
||||
CurrentByteOffset + ASL_RESDESC_OFFSET (Memory24.Alignment));
|
||||
AlignOp = InitializerOp;
|
||||
break;
|
||||
|
||||
case 4: /* Length */
|
||||
|
@ -302,7 +300,7 @@ RsDoMemory24Descriptor (
|
|||
Descriptor->Memory24.Maximum,
|
||||
Descriptor->Memory24.AddressLength,
|
||||
Descriptor->Memory24.Alignment,
|
||||
MinOp, MaxOp, LengthOp, NULL);
|
||||
MinOp, MaxOp, LengthOp, NULL, Op);
|
||||
|
||||
return (Rnode);
|
||||
}
|
||||
|
@ -410,7 +408,7 @@ RsDoMemory32Descriptor (
|
|||
Descriptor->Memory32.Maximum,
|
||||
Descriptor->Memory32.AddressLength,
|
||||
Descriptor->Memory32.Alignment,
|
||||
MinOp, MaxOp, LengthOp, AlignOp);
|
||||
MinOp, MaxOp, LengthOp, AlignOp, Op);
|
||||
|
||||
return (Rnode);
|
||||
}
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
|
@ -439,7 +439,7 @@ RsDoIoDescriptor (
|
|||
Descriptor->Io.Maximum,
|
||||
Descriptor->Io.AddressLength,
|
||||
Descriptor->Io.Alignment,
|
||||
MinOp, MaxOp, LengthOp, AlignOp);
|
||||
MinOp, MaxOp, LengthOp, AlignOp, Op);
|
||||
|
||||
return (Rnode);
|
||||
}
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
|
@ -347,12 +347,12 @@ RsDoDwordIoDescriptor (
|
|||
/* Validate the Min/Max/Len/Gran values */
|
||||
|
||||
RsLargeAddressCheck (
|
||||
Descriptor->Address32.Minimum,
|
||||
Descriptor->Address32.Maximum,
|
||||
Descriptor->Address32.AddressLength,
|
||||
Descriptor->Address32.Granularity,
|
||||
(UINT64) Descriptor->Address32.Minimum,
|
||||
(UINT64) Descriptor->Address32.Maximum,
|
||||
(UINT64) Descriptor->Address32.AddressLength,
|
||||
(UINT64) Descriptor->Address32.Granularity,
|
||||
Descriptor->Address32.Flags,
|
||||
MinOp, MaxOp, LengthOp, GranOp);
|
||||
MinOp, MaxOp, LengthOp, GranOp, Op);
|
||||
|
||||
Rnode->BufferLength = sizeof (AML_RESOURCE_ADDRESS32) +
|
||||
OptionIndex + StringLength;
|
||||
|
@ -583,12 +583,12 @@ RsDoDwordMemoryDescriptor (
|
|||
/* Validate the Min/Max/Len/Gran values */
|
||||
|
||||
RsLargeAddressCheck (
|
||||
Descriptor->Address32.Minimum,
|
||||
Descriptor->Address32.Maximum,
|
||||
Descriptor->Address32.AddressLength,
|
||||
Descriptor->Address32.Granularity,
|
||||
(UINT64) Descriptor->Address32.Minimum,
|
||||
(UINT64) Descriptor->Address32.Maximum,
|
||||
(UINT64) Descriptor->Address32.AddressLength,
|
||||
(UINT64) Descriptor->Address32.Granularity,
|
||||
Descriptor->Address32.Flags,
|
||||
MinOp, MaxOp, LengthOp, GranOp);
|
||||
MinOp, MaxOp, LengthOp, GranOp, Op);
|
||||
|
||||
Rnode->BufferLength = sizeof (AML_RESOURCE_ADDRESS32) +
|
||||
OptionIndex + StringLength;
|
||||
|
@ -801,12 +801,12 @@ RsDoDwordSpaceDescriptor (
|
|||
/* Validate the Min/Max/Len/Gran values */
|
||||
|
||||
RsLargeAddressCheck (
|
||||
Descriptor->Address32.Minimum,
|
||||
Descriptor->Address32.Maximum,
|
||||
Descriptor->Address32.AddressLength,
|
||||
Descriptor->Address32.Granularity,
|
||||
(UINT64) Descriptor->Address32.Minimum,
|
||||
(UINT64) Descriptor->Address32.Maximum,
|
||||
(UINT64) Descriptor->Address32.AddressLength,
|
||||
(UINT64) Descriptor->Address32.Granularity,
|
||||
Descriptor->Address32.Flags,
|
||||
MinOp, MaxOp, LengthOp, GranOp);
|
||||
MinOp, MaxOp, LengthOp, GranOp, Op);
|
||||
|
||||
Rnode->BufferLength = sizeof (AML_RESOURCE_ADDRESS32) +
|
||||
OptionIndex + StringLength;
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
|
@ -116,7 +116,6 @@
|
|||
|
||||
|
||||
#include "aslcompiler.h"
|
||||
#include "aslcompiler.y.h"
|
||||
|
||||
#define _COMPONENT ACPI_COMPILER
|
||||
ACPI_MODULE_NAME ("aslrestype2e")
|
||||
|
@ -295,7 +294,7 @@ RsDoExtendedIoDescriptor (
|
|||
Descriptor->ExtAddress64.AddressLength,
|
||||
Descriptor->ExtAddress64.Granularity,
|
||||
Descriptor->ExtAddress64.Flags,
|
||||
MinOp, MaxOp, LengthOp, GranOp);
|
||||
MinOp, MaxOp, LengthOp, GranOp, Op);
|
||||
|
||||
Rnode->BufferLength = sizeof (AML_RESOURCE_EXTENDED_ADDRESS64) + StringLength;
|
||||
return (Rnode);
|
||||
|
@ -476,7 +475,7 @@ RsDoExtendedMemoryDescriptor (
|
|||
Descriptor->ExtAddress64.AddressLength,
|
||||
Descriptor->ExtAddress64.Granularity,
|
||||
Descriptor->ExtAddress64.Flags,
|
||||
MinOp, MaxOp, LengthOp, GranOp);
|
||||
MinOp, MaxOp, LengthOp, GranOp, Op);
|
||||
|
||||
Rnode->BufferLength = sizeof (AML_RESOURCE_EXTENDED_ADDRESS64) + StringLength;
|
||||
return (Rnode);
|
||||
|
@ -639,7 +638,7 @@ RsDoExtendedSpaceDescriptor (
|
|||
Descriptor->ExtAddress64.AddressLength,
|
||||
Descriptor->ExtAddress64.Granularity,
|
||||
Descriptor->ExtAddress64.Flags,
|
||||
MinOp, MaxOp, LengthOp, GranOp);
|
||||
MinOp, MaxOp, LengthOp, GranOp, Op);
|
||||
|
||||
Rnode->BufferLength = sizeof (AML_RESOURCE_EXTENDED_ADDRESS64) + StringLength;
|
||||
return (Rnode);
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
|
@ -343,7 +343,7 @@ RsDoQwordIoDescriptor (
|
|||
Descriptor->Address64.AddressLength,
|
||||
Descriptor->Address64.Granularity,
|
||||
Descriptor->Address64.Flags,
|
||||
MinOp, MaxOp, LengthOp, GranOp);
|
||||
MinOp, MaxOp, LengthOp, GranOp, Op);
|
||||
|
||||
Rnode->BufferLength = sizeof (AML_RESOURCE_ADDRESS64) +
|
||||
OptionIndex + StringLength;
|
||||
|
@ -573,7 +573,7 @@ RsDoQwordMemoryDescriptor (
|
|||
Descriptor->Address64.AddressLength,
|
||||
Descriptor->Address64.Granularity,
|
||||
Descriptor->Address64.Flags,
|
||||
MinOp, MaxOp, LengthOp, GranOp);
|
||||
MinOp, MaxOp, LengthOp, GranOp, Op);
|
||||
|
||||
Rnode->BufferLength = sizeof (AML_RESOURCE_ADDRESS64) +
|
||||
OptionIndex + StringLength;
|
||||
|
@ -785,7 +785,7 @@ RsDoQwordSpaceDescriptor (
|
|||
Descriptor->Address64.AddressLength,
|
||||
Descriptor->Address64.Granularity,
|
||||
Descriptor->Address64.Flags,
|
||||
MinOp, MaxOp, LengthOp, GranOp);
|
||||
MinOp, MaxOp, LengthOp, GranOp, Op);
|
||||
|
||||
Rnode->BufferLength = sizeof (AML_RESOURCE_ADDRESS64) +
|
||||
OptionIndex + StringLength;
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
|
@ -338,12 +338,12 @@ RsDoWordIoDescriptor (
|
|||
/* Validate the Min/Max/Len/Gran values */
|
||||
|
||||
RsLargeAddressCheck (
|
||||
Descriptor->Address16.Minimum,
|
||||
Descriptor->Address16.Maximum,
|
||||
Descriptor->Address16.AddressLength,
|
||||
Descriptor->Address16.Granularity,
|
||||
(UINT64) Descriptor->Address16.Minimum,
|
||||
(UINT64) Descriptor->Address16.Maximum,
|
||||
(UINT64) Descriptor->Address16.AddressLength,
|
||||
(UINT64) Descriptor->Address16.Granularity,
|
||||
Descriptor->Address16.Flags,
|
||||
MinOp, MaxOp, LengthOp, GranOp);
|
||||
MinOp, MaxOp, LengthOp, GranOp, Op);
|
||||
|
||||
Rnode->BufferLength = sizeof (AML_RESOURCE_ADDRESS16) +
|
||||
OptionIndex + StringLength;
|
||||
|
@ -544,12 +544,12 @@ RsDoWordBusNumberDescriptor (
|
|||
/* Validate the Min/Max/Len/Gran values */
|
||||
|
||||
RsLargeAddressCheck (
|
||||
Descriptor->Address16.Minimum,
|
||||
Descriptor->Address16.Maximum,
|
||||
Descriptor->Address16.AddressLength,
|
||||
Descriptor->Address16.Granularity,
|
||||
(UINT64) Descriptor->Address16.Minimum,
|
||||
(UINT64) Descriptor->Address16.Maximum,
|
||||
(UINT64) Descriptor->Address16.AddressLength,
|
||||
(UINT64) Descriptor->Address16.Granularity,
|
||||
Descriptor->Address16.Flags,
|
||||
MinOp, MaxOp, LengthOp, GranOp);
|
||||
MinOp, MaxOp, LengthOp, GranOp, Op);
|
||||
|
||||
Rnode->BufferLength = sizeof (AML_RESOURCE_ADDRESS16) +
|
||||
OptionIndex + StringLength;
|
||||
|
@ -761,12 +761,12 @@ RsDoWordSpaceDescriptor (
|
|||
/* Validate the Min/Max/Len/Gran values */
|
||||
|
||||
RsLargeAddressCheck (
|
||||
Descriptor->Address16.Minimum,
|
||||
Descriptor->Address16.Maximum,
|
||||
Descriptor->Address16.AddressLength,
|
||||
Descriptor->Address16.Granularity,
|
||||
(UINT64) Descriptor->Address16.Minimum,
|
||||
(UINT64) Descriptor->Address16.Maximum,
|
||||
(UINT64) Descriptor->Address16.AddressLength,
|
||||
(UINT64) Descriptor->Address16.Granularity,
|
||||
Descriptor->Address16.Flags,
|
||||
MinOp, MaxOp, LengthOp, GranOp);
|
||||
MinOp, MaxOp, LengthOp, GranOp, Op);
|
||||
|
||||
Rnode->BufferLength = sizeof (AML_RESOURCE_ADDRESS16) +
|
||||
OptionIndex + StringLength;
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
|
@ -124,23 +124,18 @@
|
|||
|
||||
|
||||
#define ASL_MAX_FILES 256
|
||||
char *FileList[ASL_MAX_FILES];
|
||||
int FileCount;
|
||||
BOOLEAN AslToFile = TRUE;
|
||||
static char *FileList[ASL_MAX_FILES];
|
||||
static BOOLEAN AslToFile = TRUE;
|
||||
|
||||
|
||||
/* Local prototypes */
|
||||
|
||||
static void
|
||||
AslInitializeGlobals (
|
||||
void);
|
||||
|
||||
static char **
|
||||
AsDoWildcard (
|
||||
char *DirectoryPathname,
|
||||
char *FileSpecifier);
|
||||
|
||||
UINT8
|
||||
static UINT8
|
||||
AslDetectSourceFileType (
|
||||
ASL_FILE_INFO *Info);
|
||||
|
||||
|
@ -158,7 +153,7 @@ AslDetectSourceFileType (
|
|||
*
|
||||
******************************************************************************/
|
||||
|
||||
static void
|
||||
void
|
||||
AslInitializeGlobals (
|
||||
void)
|
||||
{
|
||||
|
@ -187,6 +182,9 @@ AslInitializeGlobals (
|
|||
|
||||
Gbl_Files[ASL_FILE_AML_OUTPUT].Filename = NULL;
|
||||
Gbl_Files[ASL_FILE_AML_OUTPUT].Handle = NULL;
|
||||
|
||||
Gbl_Files[ASL_FILE_SOURCE_OUTPUT].Filename = NULL;
|
||||
Gbl_Files[ASL_FILE_SOURCE_OUTPUT].Handle = NULL;
|
||||
}
|
||||
|
||||
|
||||
|
@ -211,6 +209,7 @@ AsDoWildcard (
|
|||
#ifdef WIN32
|
||||
void *DirInfo;
|
||||
char *Filename;
|
||||
int FileCount;
|
||||
|
||||
|
||||
FileCount = 0;
|
||||
|
@ -278,7 +277,7 @@ AsDoWildcard (
|
|||
*
|
||||
******************************************************************************/
|
||||
|
||||
UINT8
|
||||
static UINT8
|
||||
AslDetectSourceFileType (
|
||||
ASL_FILE_INFO *Info)
|
||||
{
|
||||
|
@ -398,7 +397,7 @@ AslDoOneFile (
|
|||
/* Shutdown compiler and ACPICA subsystem */
|
||||
|
||||
AeClearErrorLog ();
|
||||
AcpiTerminate ();
|
||||
(void) AcpiTerminate ();
|
||||
|
||||
/*
|
||||
* Gbl_Files[ASL_FILE_INPUT].Filename was replaced with the
|
||||
|
@ -464,17 +463,6 @@ AslDoOneFile (
|
|||
*/
|
||||
case ASL_INPUT_TYPE_ASCII_DATA:
|
||||
|
||||
/*
|
||||
* Require use of command-line option to enable the data table
|
||||
* compiler -- for now, until development of the compiler is
|
||||
* complete.
|
||||
*/
|
||||
if (!Gbl_DataTableCompilerAvailable)
|
||||
{
|
||||
printf ("Data Table Compiler is not available yet\n");
|
||||
return (AE_SUPPORT);
|
||||
}
|
||||
|
||||
Status = DtDoCompile ();
|
||||
|
||||
if (Gbl_Signature)
|
||||
|
@ -490,7 +478,6 @@ AslDoOneFile (
|
|||
*/
|
||||
case ASL_INPUT_TYPE_ASCII_ASL:
|
||||
|
||||
|
||||
/* ACPICA subsystem initialization */
|
||||
|
||||
Status = AdInitialize ();
|
||||
|
@ -500,7 +487,7 @@ AslDoOneFile (
|
|||
}
|
||||
|
||||
Status = CmDoCompile ();
|
||||
AcpiTerminate ();
|
||||
(void) AcpiTerminate ();
|
||||
|
||||
/*
|
||||
* Return non-zero exit code if there have been errors, unless the
|
||||
|
@ -542,10 +529,11 @@ AslDoOneFile (
|
|||
|
||||
ACPI_STATUS
|
||||
AslDoOnePathname (
|
||||
char *Pathname)
|
||||
char *Pathname,
|
||||
ASL_PATHNAME_CALLBACK PathCallback)
|
||||
{
|
||||
ACPI_STATUS Status = AE_OK;
|
||||
char **FileList;
|
||||
char **WildcardList;
|
||||
char *Filename;
|
||||
char *FullPathname;
|
||||
|
||||
|
@ -560,16 +548,16 @@ AslDoOnePathname (
|
|||
|
||||
/* Expand possible wildcard into a file list (Windows/DOS only) */
|
||||
|
||||
FileList = AsDoWildcard (Gbl_DirectoryPath, Filename);
|
||||
while (*FileList)
|
||||
WildcardList = AsDoWildcard (Gbl_DirectoryPath, Filename);
|
||||
while (*WildcardList)
|
||||
{
|
||||
FullPathname = ACPI_ALLOCATE (
|
||||
strlen (Gbl_DirectoryPath) + strlen (*FileList) + 1);
|
||||
strlen (Gbl_DirectoryPath) + strlen (*WildcardList) + 1);
|
||||
|
||||
/* Construct a full path to the file */
|
||||
|
||||
strcpy (FullPathname, Gbl_DirectoryPath);
|
||||
strcat (FullPathname, *FileList);
|
||||
strcat (FullPathname, *WildcardList);
|
||||
|
||||
/*
|
||||
* If -p not specified, we will use the input filename as the
|
||||
|
@ -582,12 +570,12 @@ AslDoOnePathname (
|
|||
|
||||
/* Save status from all compiles */
|
||||
|
||||
Status |= AslDoOneFile (FullPathname);
|
||||
Status |= (*PathCallback) (FullPathname);
|
||||
|
||||
ACPI_FREE (FullPathname);
|
||||
ACPI_FREE (*FileList);
|
||||
*FileList = NULL;
|
||||
FileList++;
|
||||
ACPI_FREE (*WildcardList);
|
||||
*WildcardList = NULL;
|
||||
WildcardList++;
|
||||
}
|
||||
|
||||
ACPI_FREE (Gbl_DirectoryPath);
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
|
@ -304,3 +304,20 @@ AcpiTbFindTable (
|
|||
return (AE_SUPPORT);
|
||||
}
|
||||
|
||||
/* OSL interfaces */
|
||||
|
||||
ACPI_THREAD_ID
|
||||
AcpiOsGetThreadId (
|
||||
void)
|
||||
{
|
||||
return (0xFFFF);
|
||||
}
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiOsExecute (
|
||||
ACPI_EXECUTE_TYPE Type,
|
||||
ACPI_OSD_EXEC_CALLBACK Function,
|
||||
void *Context)
|
||||
{
|
||||
return (AE_SUPPORT);
|
||||
}
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
|
@ -117,6 +117,7 @@
|
|||
|
||||
#include "aslcompiler.h"
|
||||
#include "aslcompiler.y.h"
|
||||
#include <time.h>
|
||||
|
||||
#define _COMPONENT ACPI_COMPILER
|
||||
ACPI_MODULE_NAME ("asltree")
|
||||
|
@ -473,6 +474,75 @@ TrCreateLeafNode (
|
|||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: TrCreateConstantLeafNode
|
||||
*
|
||||
* PARAMETERS: ParseOpcode - The constant opcode
|
||||
*
|
||||
* 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__.
|
||||
*
|
||||
* Note: An implemenation of __FUNC__ cannot happen here because we don't
|
||||
* have a full parse tree at this time and cannot find the parent control
|
||||
* method. If it is ever needed, __FUNC__ must be implemented later, after
|
||||
* the parse tree has been fully constructed.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
ACPI_PARSE_OBJECT *
|
||||
TrCreateConstantLeafNode (
|
||||
UINT32 ParseOpcode)
|
||||
{
|
||||
ACPI_PARSE_OBJECT *Op = NULL;
|
||||
time_t CurrentTime;
|
||||
char *StaticTimeString;
|
||||
char *TimeString;
|
||||
|
||||
|
||||
switch (ParseOpcode)
|
||||
{
|
||||
case PARSEOP___LINE__:
|
||||
Op = TrAllocateNode (PARSEOP_INTEGER);
|
||||
Op->Asl.Value.Integer = Op->Asl.LineNumber;
|
||||
break;
|
||||
|
||||
case PARSEOP___FILE__:
|
||||
Op = TrAllocateNode (PARSEOP_STRING_LITERAL);
|
||||
|
||||
/* Op.Asl.Filename contains the full pathname to the file */
|
||||
|
||||
Op->Asl.Value.String = Op->Asl.Filename;
|
||||
break;
|
||||
|
||||
case PARSEOP___DATE__:
|
||||
Op = TrAllocateNode (PARSEOP_STRING_LITERAL);
|
||||
|
||||
/* Get a copy of the current time */
|
||||
|
||||
CurrentTime = time (NULL);
|
||||
StaticTimeString = ctime (&CurrentTime);
|
||||
TimeString = UtLocalCalloc (strlen (StaticTimeString) + 1);
|
||||
strcpy (TimeString, StaticTimeString);
|
||||
|
||||
TimeString[strlen(TimeString) -1] = 0; /* Remove trailing newline */
|
||||
Op->Asl.Value.String = TimeString;
|
||||
break;
|
||||
|
||||
default: /* This would be an internal error */
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
DbgPrint (ASL_PARSE_OUTPUT,
|
||||
"\nCreateConstantLeafNode Ln/Col %u/%u NewNode %p Op %s Value %8.8X%8.8X ",
|
||||
Op->Asl.LineNumber, Op->Asl.Column, Op, UtGetOpName (ParseOpcode),
|
||||
ACPI_FORMAT_UINT64 (Op->Asl.Value.Integer));
|
||||
return (Op);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: TrCreateValuedLeafNode
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
|
@ -148,6 +148,7 @@
|
|||
#define NODE_COMPILER_EMITTED 0x00020000
|
||||
#define NODE_IS_DUPLICATE 0x00040000
|
||||
#define NODE_IS_RESOURCE_DATA 0x00080000
|
||||
#define NODE_IS_NULL_RETURN 0x00100000
|
||||
|
||||
/* Keeps information about individual control methods */
|
||||
|
||||
|
@ -302,307 +303,4 @@ typedef struct asl_event_info
|
|||
} ASL_EVENT_INFO;
|
||||
|
||||
|
||||
#define ASL_WARNING 0
|
||||
#define ASL_WARNING2 1
|
||||
#define ASL_WARNING3 2
|
||||
#define ASL_ERROR 3
|
||||
#define ASL_REMARK 4
|
||||
#define ASL_OPTIMIZATION 5
|
||||
#define ASL_NUM_REPORT_LEVELS 6
|
||||
|
||||
|
||||
typedef enum
|
||||
{
|
||||
ASL_MSG_RESERVED = 0,
|
||||
ASL_MSG_ALPHANUMERIC_STRING,
|
||||
ASL_MSG_AML_NOT_IMPLEMENTED,
|
||||
ASL_MSG_ARG_COUNT_HI,
|
||||
ASL_MSG_ARG_COUNT_LO,
|
||||
ASL_MSG_ARG_INIT,
|
||||
ASL_MSG_BACKWARDS_OFFSET,
|
||||
ASL_MSG_BITS_TO_BYTES,
|
||||
ASL_MSG_BUFFER_LENGTH,
|
||||
ASL_MSG_BYTES_TO_BITS,
|
||||
ASL_MSG_CLOSE,
|
||||
ASL_MSG_COMPILER_INTERNAL,
|
||||
ASL_MSG_CONSTANT_EVALUATION,
|
||||
ASL_MSG_CONSTANT_FOLDED,
|
||||
ASL_MSG_CORE_EXCEPTION,
|
||||
ASL_MSG_DEBUG_FILE_OPEN,
|
||||
ASL_MSG_DEBUG_FILENAME,
|
||||
ASL_MSG_DEPENDENT_NESTING,
|
||||
ASL_MSG_DMA_CHANNEL,
|
||||
ASL_MSG_DMA_LIST,
|
||||
ASL_MSG_DUPLICATE_CASE,
|
||||
ASL_MSG_DUPLICATE_ITEM,
|
||||
ASL_MSG_EARLY_EOF,
|
||||
ASL_MSG_ENCODING_LENGTH,
|
||||
ASL_MSG_EX_INTERRUPT_LIST,
|
||||
ASL_MSG_EX_INTERRUPT_LIST_MIN,
|
||||
ASL_MSG_EX_INTERRUPT_NUMBER,
|
||||
ASL_MSG_FIELD_ACCESS_WIDTH,
|
||||
ASL_MSG_FIELD_UNIT_ACCESS_WIDTH,
|
||||
ASL_MSG_FIELD_UNIT_OFFSET,
|
||||
ASL_MSG_INCLUDE_FILE_OPEN,
|
||||
ASL_MSG_INPUT_FILE_OPEN,
|
||||
ASL_MSG_INTEGER_LENGTH,
|
||||
ASL_MSG_INTEGER_OPTIMIZATION,
|
||||
ASL_MSG_INTERRUPT_LIST,
|
||||
ASL_MSG_INTERRUPT_NUMBER,
|
||||
ASL_MSG_INVALID_CONSTANT_OP,
|
||||
ASL_MSG_INVALID_EISAID,
|
||||
ASL_MSG_INVALID_ESCAPE,
|
||||
ASL_MSG_INVALID_OPERAND,
|
||||
ASL_MSG_INVALID_PERFORMANCE,
|
||||
ASL_MSG_INVALID_PRIORITY,
|
||||
ASL_MSG_INVALID_STRING,
|
||||
ASL_MSG_INVALID_TARGET,
|
||||
ASL_MSG_INVALID_TIME,
|
||||
ASL_MSG_INVALID_TYPE,
|
||||
ASL_MSG_INVALID_UUID,
|
||||
ASL_MSG_LIST_LENGTH_LONG,
|
||||
ASL_MSG_LIST_LENGTH_SHORT,
|
||||
ASL_MSG_LISTING_FILE_OPEN,
|
||||
ASL_MSG_LISTING_FILENAME,
|
||||
ASL_MSG_LOCAL_INIT,
|
||||
ASL_MSG_LONG_LINE,
|
||||
ASL_MSG_MEMORY_ALLOCATION,
|
||||
ASL_MSG_MISSING_ENDDEPENDENT,
|
||||
ASL_MSG_MISSING_STARTDEPENDENT,
|
||||
ASL_MSG_MULTIPLE_TYPES,
|
||||
ASL_MSG_NAME_EXISTS,
|
||||
ASL_MSG_NAME_OPTIMIZATION,
|
||||
ASL_MSG_NESTED_COMMENT,
|
||||
ASL_MSG_NO_CASES,
|
||||
ASL_MSG_NO_RETVAL,
|
||||
ASL_MSG_NO_WHILE,
|
||||
ASL_MSG_NON_ASCII,
|
||||
ASL_MSG_NOT_EXIST,
|
||||
ASL_MSG_NOT_FOUND,
|
||||
ASL_MSG_NOT_METHOD,
|
||||
ASL_MSG_NOT_PARAMETER,
|
||||
ASL_MSG_NOT_REACHABLE,
|
||||
ASL_MSG_OPEN,
|
||||
ASL_MSG_OUTPUT_FILE_OPEN,
|
||||
ASL_MSG_OUTPUT_FILENAME,
|
||||
ASL_MSG_PACKAGE_LENGTH,
|
||||
ASL_MSG_READ,
|
||||
ASL_MSG_RECURSION,
|
||||
ASL_MSG_REGION_BUFFER_ACCESS,
|
||||
ASL_MSG_REGION_BYTE_ACCESS,
|
||||
ASL_MSG_RESERVED_ARG_COUNT_HI,
|
||||
ASL_MSG_RESERVED_ARG_COUNT_LO,
|
||||
ASL_MSG_RESERVED_METHOD,
|
||||
ASL_MSG_RESERVED_OPERAND_TYPE,
|
||||
ASL_MSG_RESERVED_RETURN_VALUE,
|
||||
ASL_MSG_RESERVED_USE,
|
||||
ASL_MSG_RESERVED_WORD,
|
||||
ASL_MSG_RESOURCE_FIELD,
|
||||
ASL_MSG_RESOURCE_INDEX,
|
||||
ASL_MSG_RESOURCE_LIST,
|
||||
ASL_MSG_RESOURCE_SOURCE,
|
||||
ASL_MSG_RETURN_TYPES,
|
||||
ASL_MSG_SCOPE_FWD_REF,
|
||||
ASL_MSG_SCOPE_TYPE,
|
||||
ASL_MSG_SEEK,
|
||||
ASL_MSG_SINGLE_NAME_OPTIMIZATION,
|
||||
ASL_MSG_SOME_NO_RETVAL,
|
||||
ASL_MSG_SWITCH_TYPE,
|
||||
ASL_MSG_SYNC_LEVEL,
|
||||
ASL_MSG_SYNTAX,
|
||||
ASL_MSG_TABLE_SIGNATURE,
|
||||
ASL_MSG_TOO_MANY_TEMPS,
|
||||
ASL_MSG_UNKNOWN_RESERVED_NAME,
|
||||
ASL_MSG_UNREACHABLE_CODE,
|
||||
ASL_MSG_UNSUPPORTED,
|
||||
ASL_MSG_VENDOR_LIST,
|
||||
ASL_MSG_WRITE,
|
||||
ASL_MSG_MULTIPLE_DEFAULT,
|
||||
ASL_MSG_TIMEOUT,
|
||||
ASL_MSG_RESULT_NOT_USED,
|
||||
ASL_MSG_NOT_REFERENCED,
|
||||
ASL_MSG_NON_ZERO,
|
||||
ASL_MSG_STRING_LENGTH,
|
||||
ASL_MSG_SERIALIZED,
|
||||
ASL_MSG_COMPILER_RESERVED,
|
||||
ASL_MSG_NAMED_OBJECT_IN_WHILE,
|
||||
ASL_MSG_LOCAL_OUTSIDE_METHOD,
|
||||
ASL_MSG_ALIGNMENT,
|
||||
ASL_MSG_ISA_ADDRESS,
|
||||
ASL_MSG_INVALID_MIN_MAX,
|
||||
ASL_MSG_INVALID_LENGTH,
|
||||
ASL_MSG_INVALID_LENGTH_FIXED,
|
||||
ASL_MSG_INVALID_GRANULARITY,
|
||||
ASL_MSG_INVALID_GRAN_FIXED,
|
||||
ASL_MSG_INVALID_ACCESS_SIZE,
|
||||
ASL_MSG_INVALID_ADDR_FLAGS,
|
||||
ASL_MSG_INVALID_FIELD_NAME,
|
||||
ASL_MSG_INTEGER_SIZE,
|
||||
ASL_MSG_INVALID_HEX_INTEGER,
|
||||
ASL_MSG_BUFFER_ELEMENT,
|
||||
ASL_MSG_RESERVED_VALUE,
|
||||
ASL_MSG_FLAG_VALUE,
|
||||
ASL_MSG_ZERO_VALUE,
|
||||
ASL_MSG_UNKNOWN_TABLE,
|
||||
ASL_MSG_UNKNOWN_SUBTABLE,
|
||||
ASL_MSG_OEM_TABLE
|
||||
|
||||
} ASL_MESSAGE_IDS;
|
||||
|
||||
#ifdef ASL_EXCEPTIONS
|
||||
|
||||
char *AslMessages [] = {
|
||||
/* The zeroth message is reserved */ "",
|
||||
/* ASL_MSG_ALPHANUMERIC_STRING */ "String must be entirely alphanumeric",
|
||||
/* ASL_MSG_AML_NOT_IMPLEMENTED */ "Opcode is not implemented in compiler AML code generator",
|
||||
/* ASL_MSG_ARG_COUNT_HI */ "Too many arguments",
|
||||
/* ASL_MSG_ARG_COUNT_LO */ "Too few arguments",
|
||||
/* ASL_MSG_ARG_INIT */ "Method argument is not initialized",
|
||||
/* ASL_MSG_BACKWARDS_OFFSET */ "Invalid backwards offset",
|
||||
/* ASL_MSG_BITS_TO_BYTES */ "Field offset is in bits, but a byte offset is required",
|
||||
/* ASL_MSG_BUFFER_LENGTH */ "Effective AML buffer length is zero",
|
||||
/* ASL_MSG_BYTES_TO_BITS */ "Field offset is in bytes, but a bit offset is required",
|
||||
/* ASL_MSG_CLOSE */ "Could not close file",
|
||||
/* ASL_MSG_COMPILER_INTERNAL */ "Internal compiler error",
|
||||
/* ASL_MSG_CONSTANT_EVALUATION */ "Could not evaluate constant expression",
|
||||
/* ASL_MSG_CONSTANT_FOLDED */ "Constant expression evaluated and reduced",
|
||||
/* ASL_MSG_CORE_EXCEPTION */ "From ACPI CA Subsystem",
|
||||
/* ASL_MSG_DEBUG_FILE_OPEN */ "Could not open debug file",
|
||||
/* ASL_MSG_DEBUG_FILENAME */ "Could not create debug filename",
|
||||
/* ASL_MSG_DEPENDENT_NESTING */ "Dependent function macros cannot be nested",\
|
||||
/* ASL_MSG_DMA_CHANNEL */ "Invalid DMA channel (must be 0-7)",
|
||||
/* ASL_MSG_DMA_LIST */ "Too many DMA channels (8 max)",
|
||||
/* ASL_MSG_DUPLICATE_CASE */ "Case value already specified",
|
||||
/* ASL_MSG_DUPLICATE_ITEM */ "Duplicate value in list",
|
||||
/* ASL_MSG_EARLY_EOF */ "Premature end-of-file reached",
|
||||
/* ASL_MSG_ENCODING_LENGTH */ "Package length too long to encode",
|
||||
/* ASL_MSG_EX_INTERRUPT_LIST */ "Too many interrupts (255 max)",
|
||||
/* ASL_MSG_EX_INTERRUPT_LIST_MIN */ "Too few interrupts (1 minimum required)",
|
||||
/* ASL_MSG_EX_INTERRUPT_NUMBER */ "Invalid interrupt number (must be 32 bits)",
|
||||
/* ASL_MSG_FIELD_ACCESS_WIDTH */ "Access width is greater than region size",
|
||||
/* ASL_MSG_FIELD_UNIT_ACCESS_WIDTH */ "Access width of Field Unit extends beyond region limit",
|
||||
/* ASL_MSG_FIELD_UNIT_OFFSET */ "Field Unit extends beyond region limit",
|
||||
/* ASL_MSG_INCLUDE_FILE_OPEN */ "Could not open include file",
|
||||
/* ASL_MSG_INPUT_FILE_OPEN */ "Could not open input file",
|
||||
/* ASL_MSG_INTEGER_LENGTH */ "64-bit integer in 32-bit table, truncating",
|
||||
/* ASL_MSG_INTEGER_OPTIMIZATION */ "Integer optimized to single-byte AML opcode",
|
||||
/* ASL_MSG_INTERRUPT_LIST */ "Too many interrupts (16 max)",
|
||||
/* ASL_MSG_INTERRUPT_NUMBER */ "Invalid interrupt number (must be 0-15)",
|
||||
/* ASL_MSG_INVALID_CONSTANT_OP */ "Invalid operator in constant expression (not type 3/4/5)",
|
||||
/* ASL_MSG_INVALID_EISAID */ "EISAID string must be of the form \"UUUXXXX\" (3 uppercase, 4 hex digits)",
|
||||
/* ASL_MSG_INVALID_ESCAPE */ "Invalid or unknown escape sequence",
|
||||
/* ASL_MSG_INVALID_OPERAND */ "Invalid operand",
|
||||
/* ASL_MSG_INVALID_PERFORMANCE */ "Invalid performance/robustness value",
|
||||
/* ASL_MSG_INVALID_PRIORITY */ "Invalid priority value",
|
||||
/* ASL_MSG_INVALID_STRING */ "Invalid Hex/Octal Escape - Non-ASCII or NULL",
|
||||
/* ASL_MSG_INVALID_TARGET */ "Target operand not allowed in constant expression",
|
||||
/* ASL_MSG_INVALID_TIME */ "Time parameter too long (255 max)",
|
||||
/* ASL_MSG_INVALID_TYPE */ "Invalid type",
|
||||
/* ASL_MSG_INVALID_UUID */ "UUID string must be of the form \"aabbccdd-eeff-gghh-iijj-kkllmmnnoopp\"",
|
||||
/* ASL_MSG_LIST_LENGTH_LONG */ "Initializer list longer than declared package length",
|
||||
/* ASL_MSG_LIST_LENGTH_SHORT */ "Initializer list shorter than declared package length",
|
||||
/* ASL_MSG_LISTING_FILE_OPEN */ "Could not open listing file",
|
||||
/* ASL_MSG_LISTING_FILENAME */ "Could not create listing filename",
|
||||
/* ASL_MSG_LOCAL_INIT */ "Method local variable is not initialized",
|
||||
/* ASL_MSG_LONG_LINE */ "Splitting long input line",
|
||||
/* ASL_MSG_MEMORY_ALLOCATION */ "Memory allocation failure",
|
||||
/* ASL_MSG_MISSING_ENDDEPENDENT */ "Missing EndDependentFn() macro in dependent resource list",
|
||||
/* ASL_MSG_MISSING_STARTDEPENDENT */ "Missing StartDependentFn() macro in dependent resource list",
|
||||
/* ASL_MSG_MULTIPLE_TYPES */ "Multiple types",
|
||||
/* ASL_MSG_NAME_EXISTS */ "Name already exists in scope",
|
||||
/* ASL_MSG_NAME_OPTIMIZATION */ "NamePath optimized",
|
||||
/* ASL_MSG_NESTED_COMMENT */ "Nested comment found",
|
||||
/* ASL_MSG_NO_CASES */ "No Case statements under Switch",
|
||||
/* ASL_MSG_NO_RETVAL */ "Called method returns no value",
|
||||
/* ASL_MSG_NO_WHILE */ "No enclosing While statement",
|
||||
/* ASL_MSG_NON_ASCII */ "Invalid characters found in file",
|
||||
/* ASL_MSG_NOT_EXIST */ "Object does not exist",
|
||||
/* ASL_MSG_NOT_FOUND */ "Object not found or not accessible from scope",
|
||||
/* ASL_MSG_NOT_METHOD */ "Not a control method, cannot invoke",
|
||||
/* ASL_MSG_NOT_PARAMETER */ "Not a parameter, used as local only",
|
||||
/* ASL_MSG_NOT_REACHABLE */ "Object is not accessible from this scope",
|
||||
/* ASL_MSG_OPEN */ "Could not open file",
|
||||
/* ASL_MSG_OUTPUT_FILE_OPEN */ "Could not open output AML file",
|
||||
/* ASL_MSG_OUTPUT_FILENAME */ "Could not create output filename",
|
||||
/* ASL_MSG_PACKAGE_LENGTH */ "Effective AML package length is zero",
|
||||
/* ASL_MSG_READ */ "Could not read file",
|
||||
/* ASL_MSG_RECURSION */ "Recursive method call",
|
||||
/* ASL_MSG_REGION_BUFFER_ACCESS */ "Host Operation Region requires BufferAcc access",
|
||||
/* ASL_MSG_REGION_BYTE_ACCESS */ "Host Operation Region requires ByteAcc access",
|
||||
/* ASL_MSG_RESERVED_ARG_COUNT_HI */ "Reserved method has too many arguments",
|
||||
/* ASL_MSG_RESERVED_ARG_COUNT_LO */ "Reserved method has too few arguments",
|
||||
/* ASL_MSG_RESERVED_METHOD */ "Reserved name must be a control method",
|
||||
/* ASL_MSG_RESERVED_OPERAND_TYPE */ "Invalid object type for reserved name",
|
||||
/* ASL_MSG_RESERVED_RETURN_VALUE */ "Reserved method must return a value",
|
||||
/* ASL_MSG_RESERVED_USE */ "Invalid use of reserved name",
|
||||
/* ASL_MSG_RESERVED_WORD */ "Use of reserved name",
|
||||
/* ASL_MSG_RESOURCE_FIELD */ "Resource field name cannot be used as a target",
|
||||
/* ASL_MSG_RESOURCE_INDEX */ "Missing ResourceSourceIndex (required)",
|
||||
/* ASL_MSG_RESOURCE_LIST */ "Too many resource items (internal error)",
|
||||
/* ASL_MSG_RESOURCE_SOURCE */ "Missing ResourceSource string (required)",
|
||||
/* ASL_MSG_RETURN_TYPES */ "Not all control paths return a value",
|
||||
/* ASL_MSG_SCOPE_FWD_REF */ "Forward references from Scope operator not allowed",
|
||||
/* ASL_MSG_SCOPE_TYPE */ "Existing object has invalid type for Scope operator",
|
||||
/* ASL_MSG_SEEK */ "Could not seek file",
|
||||
/* ASL_MSG_SINGLE_NAME_OPTIMIZATION */ "NamePath optimized to NameSeg (uses run-time search path)",
|
||||
/* ASL_MSG_SOME_NO_RETVAL */ "Called method may not always return a value",
|
||||
/* ASL_MSG_SWITCH_TYPE */ "Switch expression is not a static Integer/Buffer/String data type, defaulting to Integer",
|
||||
/* ASL_MSG_SYNC_LEVEL */ "SyncLevel must be in the range 0-15",
|
||||
/* ASL_MSG_SYNTAX */ "",
|
||||
/* ASL_MSG_TABLE_SIGNATURE */ "Invalid Table Signature",
|
||||
/* ASL_MSG_TOO_MANY_TEMPS */ "Method requires too many temporary variables (_T_x)",
|
||||
/* ASL_MSG_UNKNOWN_RESERVED_NAME */ "Unknown reserved name",
|
||||
/* ASL_MSG_UNREACHABLE_CODE */ "Statement is unreachable",
|
||||
/* ASL_MSG_UNSUPPORTED */ "Unsupported feature",
|
||||
/* ASL_MSG_VENDOR_LIST */ "Too many vendor data bytes (7 max)",
|
||||
/* ASL_MSG_WRITE */ "Could not write file",
|
||||
/* ASL_MSG_MULTIPLE_DEFAULT */ "More than one Default statement within Switch construct",
|
||||
/* ASL_MSG_TIMEOUT */ "Possible operator timeout is ignored",
|
||||
/* ASL_MSG_RESULT_NOT_USED */ "Result is not used, operator has no effect",
|
||||
/* ASL_MSG_NOT_REFERENCED */ "Namespace object is not referenced",
|
||||
/* ASL_MSG_NON_ZERO */ "Operand evaluates to zero",
|
||||
/* ASL_MSG_STRING_LENGTH */ "String literal too long",
|
||||
/* ASL_MSG_SERIALIZED */ "Control Method marked Serialized",
|
||||
/* ASL_MSG_COMPILER_RESERVED */ "Use of compiler reserved name",
|
||||
/* ASL_MSG_NAMED_OBJECT_IN_WHILE */ "Creating a named object in a While loop",
|
||||
/* ASL_MSG_LOCAL_OUTSIDE_METHOD */ "Local or Arg used outside a control method",
|
||||
/* ASL_MSG_ALIGNMENT */ "Must be a multiple of alignment/granularity value",
|
||||
/* ASL_MSG_ISA_ADDRESS */ "Maximum 10-bit ISA address (0x3FF)",
|
||||
/* ASL_MSG_INVALID_MIN_MAX */ "Address Min is greater than Address Max",
|
||||
/* ASL_MSG_INVALID_LENGTH */ "Length is larger than Min/Max window",
|
||||
/* ASL_MSG_INVALID_LENGTH_FIXED */ "Length is not equal to fixed Min/Max window",
|
||||
/* ASL_MSG_INVALID_GRANULARITY */ "Granularity must be zero or a power of two minus one",
|
||||
/* ASL_MSG_INVALID_GRAN_FIXED */ "Granularity must be zero for fixed Min/Max",
|
||||
/* ASL_MSG_INVALID_ACCESS_SIZE */ "Invalid AccessSize (Maximum is 4 - QWord access)",
|
||||
/* ASL_MSG_INVALID_ADDR_FLAGS */ "Invalid combination of Length and Min/Max fixed flags",
|
||||
|
||||
/* These messages are used by the data table compiler only */
|
||||
|
||||
/* ASL_MSG_INVALID_FIELD_NAME */ "Invalid Field Name",
|
||||
/* ASL_MSG_INTEGER_SIZE */ "Integer too large for target",
|
||||
/* ASL_MSG_INVALID_HEX_INTEGER */ "Invalid hex integer constant",
|
||||
/* ASL_MSG_BUFFER_ELEMENT */ "Invalid element in buffer initializer list",
|
||||
/* ASL_MSG_RESERVED_VALUE */ "Reserved field must be zero",
|
||||
/* ASL_MSG_FLAG_VALUE */ "Flag value is too large",
|
||||
/* ASL_MSG_ZERO_VALUE */ "Value must be non-zero",
|
||||
/* ASL_MSG_UNKNOWN_TABLE */ "Unknown ACPI table signature",
|
||||
/* ASL_MSG_UNKNOWN_SUBTABLE */ "Unknown subtable type",
|
||||
/* ASL_MSG_OEM_TABLE */ "OEM table - unknown contents"
|
||||
|
||||
};
|
||||
|
||||
|
||||
char *AslErrorLevel [ASL_NUM_REPORT_LEVELS] = {
|
||||
"Warning ",
|
||||
"Warning ",
|
||||
"Warning ",
|
||||
"Error ",
|
||||
"Remark ",
|
||||
"Optimize"
|
||||
};
|
||||
|
||||
#define ASL_ERROR_LEVEL_LENGTH 8 /* Length of strings above */
|
||||
|
||||
#endif /* ASL_EXCEPTIONS */
|
||||
|
||||
#endif /* __ASLTYPES_H */
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
|
@ -117,20 +117,15 @@
|
|||
|
||||
#include "aslcompiler.h"
|
||||
#include "aslcompiler.y.h"
|
||||
#include "acdisasm.h"
|
||||
#include "acnamesp.h"
|
||||
#include "amlcode.h"
|
||||
#include <acapps.h>
|
||||
|
||||
#define _COMPONENT ACPI_COMPILER
|
||||
ACPI_MODULE_NAME ("aslutils")
|
||||
|
||||
#ifdef _USE_BERKELEY_YACC
|
||||
extern const char * const AslCompilername[];
|
||||
static const char * const *yytname = &AslCompilername[254];
|
||||
#else
|
||||
extern const char * const yytname[];
|
||||
#endif
|
||||
|
||||
char HexLookup[] =
|
||||
char AslHexLookup[] =
|
||||
{
|
||||
'0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F'
|
||||
};
|
||||
|
@ -138,12 +133,6 @@ char HexLookup[] =
|
|||
|
||||
/* Local prototypes */
|
||||
|
||||
static ACPI_STATUS
|
||||
UtStrtoul64 (
|
||||
char *String,
|
||||
UINT32 Base,
|
||||
UINT64 *RetInteger);
|
||||
|
||||
static void
|
||||
UtPadNameWithUnderscores (
|
||||
char *NameSeg,
|
||||
|
@ -155,6 +144,50 @@ UtAttachNameseg (
|
|||
char *Name);
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: UtDisplaySupportedTables
|
||||
*
|
||||
* PARAMETERS: None
|
||||
*
|
||||
* RETURN: None
|
||||
*
|
||||
* DESCRIPTION: Print all supported ACPI table names.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
void
|
||||
UtDisplaySupportedTables (
|
||||
void)
|
||||
{
|
||||
ACPI_DMTABLE_DATA *TableData;
|
||||
UINT32 i = 6;
|
||||
|
||||
|
||||
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);
|
||||
|
||||
/* 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");
|
||||
|
||||
/* All data tables with common table header */
|
||||
|
||||
for (TableData = AcpiDmTableData; TableData->Signature; TableData++)
|
||||
{
|
||||
printf ("%8u) %s %s\n", i, TableData->Signature, TableData->Name);
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiPsDisplayConstantOpcodes
|
||||
|
@ -340,8 +373,8 @@ UtConvertByteToHex (
|
|||
Buffer[0] = '0';
|
||||
Buffer[1] = 'x';
|
||||
|
||||
Buffer[2] = (UINT8) HexLookup[(RawByte >> 4) & 0xF];
|
||||
Buffer[3] = (UINT8) HexLookup[RawByte & 0xF];
|
||||
Buffer[2] = (UINT8) AslHexLookup[(RawByte >> 4) & 0xF];
|
||||
Buffer[3] = (UINT8) AslHexLookup[RawByte & 0xF];
|
||||
}
|
||||
|
||||
|
||||
|
@ -366,8 +399,8 @@ UtConvertByteToAsmHex (
|
|||
{
|
||||
|
||||
Buffer[0] = '0';
|
||||
Buffer[1] = (UINT8) HexLookup[(RawByte >> 4) & 0xF];
|
||||
Buffer[2] = (UINT8) HexLookup[RawByte & 0xF];
|
||||
Buffer[1] = (UINT8) AslHexLookup[(RawByte >> 4) & 0xF];
|
||||
Buffer[2] = (UINT8) AslHexLookup[RawByte & 0xF];
|
||||
Buffer[3] = 'h';
|
||||
}
|
||||
|
||||
|
@ -474,32 +507,6 @@ UtSetParseOpName (
|
|||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: UtGetOpName
|
||||
*
|
||||
* PARAMETERS: ParseOpcode - Parser keyword ID
|
||||
*
|
||||
* RETURN: Pointer to the opcode name
|
||||
*
|
||||
* DESCRIPTION: Get the ascii name of the parse opcode
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
char *
|
||||
UtGetOpName (
|
||||
UINT32 ParseOpcode)
|
||||
{
|
||||
|
||||
/*
|
||||
* First entries (ASL_YYTNAME_START) in yytname are special reserved names.
|
||||
* Ignore first 8 characters of the name
|
||||
*/
|
||||
return ((char *) yytname
|
||||
[(ParseOpcode - ASL_FIRST_PARSE_OPCODE) + ASL_YYTNAME_START] + 8);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: UtDisplaySummary
|
||||
|
@ -521,8 +528,8 @@ UtDisplaySummary (
|
|||
{
|
||||
/* Compiler name and version number */
|
||||
|
||||
FlPrintFile (FileId, "%s version %X [%s]\n",
|
||||
CompilerId, (UINT32) ACPI_CA_VERSION, __DATE__);
|
||||
FlPrintFile (FileId, "%s version %X%s [%s]\n",
|
||||
ASL_COMPILER_NAME, (UINT32) ACPI_CA_VERSION, ACPI_WIDTH, __DATE__);
|
||||
}
|
||||
|
||||
if (Gbl_FileType == ASL_INPUT_TYPE_ASCII_DATA)
|
||||
|
@ -910,7 +917,7 @@ UtDoConstant (
|
|||
*
|
||||
******************************************************************************/
|
||||
|
||||
static ACPI_STATUS
|
||||
ACPI_STATUS
|
||||
UtStrtoul64 (
|
||||
char *String,
|
||||
UINT32 Base,
|
||||
|
|
|
@ -0,0 +1,288 @@
|
|||
/******************************************************************************
|
||||
*
|
||||
* Module Name: asluuid-- compiler UUID support
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
*
|
||||
* 2.1. This is your license from Intel Corp. under its intellectual property
|
||||
* rights. You may have additional license terms from the party that provided
|
||||
* you this software, covering your right to use that party's intellectual
|
||||
* property rights.
|
||||
*
|
||||
* 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
|
||||
* copy of the source code appearing in this file ("Covered Code") an
|
||||
* irrevocable, perpetual, worldwide license under Intel's copyrights in the
|
||||
* base code distributed originally by Intel ("Original Intel Code") to copy,
|
||||
* make derivatives, distribute, use and display any portion of the Covered
|
||||
* Code in any form, with the right to sublicense such rights; and
|
||||
*
|
||||
* 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
|
||||
* license (with the right to sublicense), under only those claims of Intel
|
||||
* patents that are infringed by the Original Intel Code, to make, use, sell,
|
||||
* offer to sell, and import the Covered Code and derivative works thereof
|
||||
* solely to the minimum extent necessary to exercise the above copyright
|
||||
* license, and in no event shall the patent license extend to any additions
|
||||
* to or modifications of the Original Intel Code. No other license or right
|
||||
* is granted directly or by implication, estoppel or otherwise;
|
||||
*
|
||||
* The above copyright and patent license is granted only if the following
|
||||
* conditions are met:
|
||||
*
|
||||
* 3. Conditions
|
||||
*
|
||||
* 3.1. Redistribution of Source with Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification with rights to further distribute source must include
|
||||
* the above Copyright Notice, the above License, this list of Conditions,
|
||||
* and the following Disclaimer and Export Compliance provision. In addition,
|
||||
* Licensee must cause all Covered Code to which Licensee contributes to
|
||||
* contain a file documenting the changes Licensee made to create that Covered
|
||||
* Code and the date of any change. Licensee must include in that file the
|
||||
* documentation of any changes made by any predecessor Licensee. Licensee
|
||||
* must include a prominent statement that the modification is derived,
|
||||
* directly or indirectly, from Original Intel Code.
|
||||
*
|
||||
* 3.2. Redistribution of Source with no Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification without rights to further distribute source must
|
||||
* include the following Disclaimer and Export Compliance provision in the
|
||||
* documentation and/or other materials provided with distribution. In
|
||||
* addition, Licensee may not authorize further sublicense of source of any
|
||||
* portion of the Covered Code, and must include terms to the effect that the
|
||||
* license from Licensee to its licensee is limited to the intellectual
|
||||
* property embodied in the software Licensee provides to its licensee, and
|
||||
* not to intellectual property embodied in modifications its licensee may
|
||||
* make.
|
||||
*
|
||||
* 3.3. Redistribution of Executable. Redistribution in executable form of any
|
||||
* substantial portion of the Covered Code or modification must reproduce the
|
||||
* above Copyright Notice, and the following Disclaimer and Export Compliance
|
||||
* provision in the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* 3.4. Intel retains all right, title, and interest in and to the Original
|
||||
* Intel Code.
|
||||
*
|
||||
* 3.5. Neither the name Intel nor any other trademark owned or controlled by
|
||||
* Intel shall be used in advertising or otherwise to promote the sale, use or
|
||||
* other dealings in products derived from or relating to the Covered Code
|
||||
* without prior written authorization from Intel.
|
||||
*
|
||||
* 4. Disclaimer and Export Compliance
|
||||
*
|
||||
* 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
|
||||
* HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
|
||||
* IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
|
||||
* INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
|
||||
* UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
|
||||
* PARTICULAR PURPOSE.
|
||||
*
|
||||
* 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
|
||||
* OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
|
||||
* COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
|
||||
* SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
|
||||
* CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
|
||||
* HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
|
||||
* SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
|
||||
* LIMITED REMEDY.
|
||||
*
|
||||
* 4.3. Licensee shall not export, either directly or indirectly, any of this
|
||||
* software or system incorporating such software without first obtaining any
|
||||
* required license or other approval from the U. S. Department of Commerce or
|
||||
* any other agency or department of the United States Government. In the
|
||||
* event Licensee exports any such software from the United States or
|
||||
* re-exports any such software from a foreign destination, Licensee shall
|
||||
* ensure that the distribution and export/re-export of the software is in
|
||||
* compliance with all laws, regulations, orders, or other restrictions of the
|
||||
* U.S. Export Administration Regulations. Licensee agrees that neither it nor
|
||||
* any of its subsidiaries will export/re-export any technical data, process,
|
||||
* software, or service, directly or indirectly, to any country for which the
|
||||
* United States government or any agency thereof requires an export license,
|
||||
* other governmental approval, or letter of assurance, without first obtaining
|
||||
* such license, approval or letter.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
|
||||
#include "aslcompiler.h"
|
||||
|
||||
#define _COMPONENT ACPI_COMPILER
|
||||
ACPI_MODULE_NAME ("asluuid")
|
||||
|
||||
|
||||
/*
|
||||
* UUID support functions.
|
||||
*
|
||||
* This table is used to convert an input UUID ascii string to a 16 byte
|
||||
* buffer and the reverse. The table maps a UUID buffer index 0-15 to
|
||||
* the index within the 36-byte UUID string where the associated 2-byte
|
||||
* hex value can be found.
|
||||
*
|
||||
* 36-byte UUID strings are of the form:
|
||||
* aabbccdd-eeff-gghh-iijj-kkllmmnnoopp
|
||||
* Where aa-pp are one byte hex numbers, made up of two hex digits
|
||||
*
|
||||
* Note: This table is basically the inverse of the string-to-offset table
|
||||
* found in the ACPI spec in the description of the ToUUID macro.
|
||||
*/
|
||||
static UINT8 Gbl_MapToUuidOffset[16] =
|
||||
{
|
||||
6,4,2,0,11,9,16,14,19,21,24,26,28,30,32,34
|
||||
};
|
||||
|
||||
#define UUID_BUFFER_LENGTH 16
|
||||
#define UUID_STRING_LENGTH 36
|
||||
|
||||
/* Positions for required hyphens (dashes) in UUID strings */
|
||||
|
||||
#define UUID_HYPHEN1_OFFSET 8
|
||||
#define UUID_HYPHEN2_OFFSET 13
|
||||
#define UUID_HYPHEN3_OFFSET 18
|
||||
#define UUID_HYPHEN4_OFFSET 23
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AuValiduateUuid
|
||||
*
|
||||
* PARAMETERS: InString - 36-byte formatted UUID string
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Check all 36 characters for correct format
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
ACPI_STATUS
|
||||
AuValidateUuid (
|
||||
char *InString)
|
||||
{
|
||||
UINT32 i;
|
||||
|
||||
|
||||
if (!InString || (ACPI_STRLEN (InString) != UUID_STRING_LENGTH))
|
||||
{
|
||||
return (AE_BAD_PARAMETER);
|
||||
}
|
||||
|
||||
/* Check all 36 characters for correct format */
|
||||
|
||||
for (i = 0; i < UUID_STRING_LENGTH; i++)
|
||||
{
|
||||
/* Must have 4 hyphens (dashes) in these positions: */
|
||||
|
||||
if ((i == UUID_HYPHEN1_OFFSET) ||
|
||||
(i == UUID_HYPHEN2_OFFSET) ||
|
||||
(i == UUID_HYPHEN3_OFFSET) ||
|
||||
(i == UUID_HYPHEN4_OFFSET))
|
||||
{
|
||||
if (InString[i] != '-')
|
||||
{
|
||||
return (AE_BAD_PARAMETER);
|
||||
}
|
||||
}
|
||||
|
||||
/* All other positions must contain hex digits */
|
||||
|
||||
else
|
||||
{
|
||||
if (!isxdigit ((int) InString[i]))
|
||||
{
|
||||
return (AE_BAD_PARAMETER);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return (AE_OK);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AuConvertStringToUuid
|
||||
*
|
||||
* PARAMETERS: InString - 36-byte formatted UUID string
|
||||
* UuidBuffer - 16-byte UUID buffer
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Convert 36-byte formatted UUID string to 16-byte UUID buffer
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
ACPI_STATUS
|
||||
AuConvertStringToUuid (
|
||||
char *InString,
|
||||
char *UuidBuffer)
|
||||
{
|
||||
UINT32 i;
|
||||
|
||||
|
||||
if (!InString || !UuidBuffer)
|
||||
{
|
||||
return (AE_BAD_PARAMETER);
|
||||
}
|
||||
|
||||
for (i = 0; i < UUID_BUFFER_LENGTH; i++)
|
||||
{
|
||||
UuidBuffer[i] = (char) (UtHexCharToValue (InString[Gbl_MapToUuidOffset[i]]) << 4);
|
||||
UuidBuffer[i] |= (char) UtHexCharToValue (InString[Gbl_MapToUuidOffset[i] + 1]);
|
||||
}
|
||||
|
||||
return (AE_OK);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AuConvertUuidToString
|
||||
*
|
||||
* PARAMETERS: UuidBuffer - 16-byte UUID buffer
|
||||
* OutString - 36-byte formatted UUID string
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Convert 16-byte UUID buffer to 36-byte formatted UUID string
|
||||
* OutString must be 37 bytes to include null terminator.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
ACPI_STATUS
|
||||
AuConvertUuidToString (
|
||||
char *UuidBuffer,
|
||||
char *OutString)
|
||||
{
|
||||
UINT32 i;
|
||||
|
||||
|
||||
if (!UuidBuffer || !OutString)
|
||||
{
|
||||
return (AE_BAD_PARAMETER);
|
||||
}
|
||||
|
||||
for (i = 0; i < UUID_BUFFER_LENGTH; i++)
|
||||
{
|
||||
OutString[Gbl_MapToUuidOffset[i]] = (UINT8) AslHexLookup[(UuidBuffer[i] >> 4) & 0xF];
|
||||
OutString[Gbl_MapToUuidOffset[i] + 1] = (UINT8) AslHexLookup[UuidBuffer[i] & 0xF];
|
||||
}
|
||||
|
||||
/* Insert required hyphens (dashes) */
|
||||
|
||||
OutString[UUID_HYPHEN1_OFFSET] =
|
||||
OutString[UUID_HYPHEN2_OFFSET] =
|
||||
OutString[UUID_HYPHEN3_OFFSET] =
|
||||
OutString[UUID_HYPHEN4_OFFSET] = '-';
|
||||
|
||||
OutString[UUID_STRING_LENGTH] = 0; /* Null terminate */
|
||||
return (AE_OK);
|
||||
}
|
File diff suppressed because it is too large
Load Diff
|
@ -8,7 +8,7 @@
|
|||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
|
@ -127,7 +127,7 @@ static char VersionString[9];
|
|||
|
||||
/* Local prototypes */
|
||||
|
||||
static void
|
||||
static ACPI_STATUS
|
||||
DtInitialize (
|
||||
void);
|
||||
|
||||
|
@ -166,7 +166,12 @@ DtDoCompile (
|
|||
|
||||
/* Initialize globals */
|
||||
|
||||
DtInitialize ();
|
||||
Status = DtInitialize ();
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
printf ("Error during compiler initialization, 0x%X\n", Status);
|
||||
return (Status);
|
||||
}
|
||||
|
||||
/*
|
||||
* Scan the input file (file is already open) and
|
||||
|
@ -183,8 +188,10 @@ DtDoCompile (
|
|||
/* TBD: temporary error message. Msgs should come from function above */
|
||||
|
||||
DtError (ASL_ERROR, ASL_MSG_SYNTAX, NULL,
|
||||
"Could not parse input file");
|
||||
return (AE_ERROR);
|
||||
"Input file does not appear to be an ASL or data table source file");
|
||||
|
||||
Status = AE_ERROR;
|
||||
goto CleanupAndExit;
|
||||
}
|
||||
|
||||
Event = UtBeginEvent ("Compile parse tree");
|
||||
|
@ -203,6 +210,7 @@ DtDoCompile (
|
|||
|
||||
DtError (ASL_ERROR, ASL_MSG_SYNTAX, NULL,
|
||||
"Could not compile input file");
|
||||
|
||||
goto CleanupAndExit;
|
||||
}
|
||||
|
||||
|
@ -219,6 +227,7 @@ DtDoCompile (
|
|||
|
||||
DtOutputBinary (Gbl_RootTable);
|
||||
LsDoHexOutput ();
|
||||
DtWriteTableToListing ();
|
||||
|
||||
CleanupAndExit:
|
||||
|
||||
|
@ -233,23 +242,38 @@ CleanupAndExit:
|
|||
*
|
||||
* PARAMETERS: None
|
||||
*
|
||||
* RETURN: None
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Initialize data table compiler globals. Enables multiple
|
||||
* compiles per invocation.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
static void
|
||||
static ACPI_STATUS
|
||||
DtInitialize (
|
||||
void)
|
||||
{
|
||||
ACPI_STATUS Status;
|
||||
|
||||
|
||||
Status = AcpiOsInitialize ();
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return (Status);
|
||||
}
|
||||
|
||||
Status = AcpiUtInitGlobals ();
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return (Status);
|
||||
}
|
||||
|
||||
Gbl_FieldList = NULL;
|
||||
Gbl_RootTable = NULL;
|
||||
Gbl_SubtableStack = NULL;
|
||||
|
||||
sprintf (VersionString, "%X", (UINT32) ACPI_CA_VERSION);
|
||||
return (AE_OK);
|
||||
}
|
||||
|
||||
|
||||
|
@ -291,7 +315,7 @@ DtInsertCompilerIds (
|
|||
Next = Next->Next;
|
||||
}
|
||||
|
||||
Next->Value = CompilerCreatorId;
|
||||
Next->Value = ASL_CREATOR_ID;
|
||||
Next->Flags = DT_FIELD_NOT_ALLOCATED;
|
||||
|
||||
Next = Next->Next;
|
||||
|
@ -325,10 +349,12 @@ DtCompileDataTable (
|
|||
|
||||
/* Verify that we at least have a table signature and save it */
|
||||
|
||||
Signature = DtGetFieldValue (*FieldList, "Signature");
|
||||
Signature = DtGetFieldValue (*FieldList);
|
||||
if (!Signature)
|
||||
{
|
||||
DtError (ASL_ERROR, ASL_MSG_TABLE_SIGNATURE, *FieldList, NULL);
|
||||
sprintf (MsgBuffer, "Expected \"%s\"", "Signature");
|
||||
DtNameError (ASL_ERROR, ASL_MSG_INVALID_FIELD_NAME,
|
||||
*FieldList, MsgBuffer);
|
||||
return (AE_ERROR);
|
||||
}
|
||||
|
||||
|
@ -356,11 +382,6 @@ DtCompileDataTable (
|
|||
Status = DtCompileRsdp (FieldList);
|
||||
return (Status);
|
||||
}
|
||||
else if (!ACPI_STRNCMP (Signature, "OEM", 3))
|
||||
{
|
||||
DtFatal (ASL_MSG_OEM_TABLE, *FieldList, Signature);
|
||||
return (AE_ERROR);
|
||||
}
|
||||
|
||||
/*
|
||||
* All other tables must use the common ACPI table header. Insert the
|
||||
|
@ -377,15 +398,17 @@ DtCompileDataTable (
|
|||
|
||||
DtPushSubtable (Gbl_RootTable);
|
||||
|
||||
/* Match signature and dispatch appropriately */
|
||||
/* Validate the signature via the ACPI table list */
|
||||
|
||||
TableData = AcpiDmGetTableData (Signature);
|
||||
if (!TableData)
|
||||
{
|
||||
DtFatal (ASL_MSG_UNKNOWN_TABLE, *FieldList, Signature);
|
||||
return (AE_ERROR);
|
||||
DtCompileGeneric ((void **) FieldList);
|
||||
goto Out;
|
||||
}
|
||||
|
||||
/* Dispatch to per-table compile */
|
||||
|
||||
if (TableData->CmTableHandler)
|
||||
{
|
||||
/* Complex table, has a handler */
|
||||
|
@ -418,6 +441,7 @@ DtCompileDataTable (
|
|||
return (AE_ERROR);
|
||||
}
|
||||
|
||||
Out:
|
||||
/* Set the final table length and then the checksum */
|
||||
|
||||
DtSetTableLength ();
|
||||
|
@ -459,7 +483,6 @@ DtCompileTable (
|
|||
UINT8 FieldType;
|
||||
UINT8 *Buffer;
|
||||
UINT8 *FlagBuffer = NULL;
|
||||
UINT32 FlagBitPosition = 0;
|
||||
ACPI_STATUS Status;
|
||||
|
||||
|
||||
|
@ -469,9 +492,17 @@ DtCompileTable (
|
|||
}
|
||||
|
||||
Length = DtGetSubtableLength (*Field, Info);
|
||||
if (Length == ASL_EOF)
|
||||
{
|
||||
return (AE_ERROR);
|
||||
}
|
||||
|
||||
Subtable = UtLocalCalloc (sizeof (DT_SUBTABLE));
|
||||
|
||||
Subtable->Buffer = UtLocalCalloc (Length);
|
||||
if (Length > 0)
|
||||
{
|
||||
Subtable->Buffer = UtLocalCalloc (Length);
|
||||
}
|
||||
Subtable->Length = Length;
|
||||
Subtable->TotalLength = Length;
|
||||
Buffer = Subtable->Buffer;
|
||||
|
@ -492,30 +523,12 @@ DtCompileTable (
|
|||
goto Error;
|
||||
}
|
||||
|
||||
/* Does input field name match what is expected? */
|
||||
|
||||
if (ACPI_STRCMP (LocalField->Name, Info->Name))
|
||||
{
|
||||
/*
|
||||
* If Required = TRUE, the subtable must exist.
|
||||
* If Required = FALSE, the subtable is optional
|
||||
* (For example, AcpiDmTableInfoDmarScope in DMAR table is
|
||||
* optional)
|
||||
*/
|
||||
if (Required)
|
||||
{
|
||||
sprintf (MsgBuffer, "Expected \"%s\"", Info->Name);
|
||||
DtNameError (ASL_ERROR, ASL_MSG_INVALID_FIELD_NAME,
|
||||
LocalField, MsgBuffer);
|
||||
}
|
||||
else
|
||||
{
|
||||
Status = AE_NOT_FOUND;
|
||||
goto Error;
|
||||
}
|
||||
}
|
||||
/* Maintain table offsets */
|
||||
|
||||
LocalField->TableOffset = Gbl_CurrentTableOffset;
|
||||
FieldLength = DtGetFieldLength (LocalField, Info);
|
||||
Gbl_CurrentTableOffset += FieldLength;
|
||||
|
||||
FieldType = DtGetFieldType (Info);
|
||||
Gbl_InputFieldCount++;
|
||||
|
||||
|
@ -530,7 +543,6 @@ DtCompileTable (
|
|||
LocalField = LocalField->Next;
|
||||
*Field = LocalField;
|
||||
|
||||
FlagBitPosition = 0;
|
||||
FlagBuffer = Buffer;
|
||||
break;
|
||||
|
||||
|
@ -540,8 +552,7 @@ DtCompileTable (
|
|||
|
||||
if (FlagBuffer)
|
||||
{
|
||||
FlagBitPosition = DtCompileFlag (FlagBuffer,
|
||||
LocalField, Info, FlagBitPosition);
|
||||
DtCompileFlag (FlagBuffer, LocalField, Info);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -557,7 +568,6 @@ DtCompileTable (
|
|||
* Recursion (one level max): compile GAS (Generic Address)
|
||||
* or Notify in-line subtable
|
||||
*/
|
||||
LocalField = LocalField->Next;
|
||||
*Field = LocalField;
|
||||
|
||||
if (Info->Opcode == ACPI_DMT_GAS)
|
||||
|
@ -576,18 +586,28 @@ DtCompileTable (
|
|||
goto Error;
|
||||
}
|
||||
|
||||
DtSetSubtableLength (InlineSubtable);
|
||||
|
||||
ACPI_MEMCPY (Buffer, InlineSubtable->Buffer, FieldLength);
|
||||
ACPI_FREE (InlineSubtable->Buffer);
|
||||
ACPI_FREE (InlineSubtable);
|
||||
LocalField = *Field;
|
||||
break;
|
||||
|
||||
case DT_FIELD_TYPE_LABEL:
|
||||
|
||||
DtWriteFieldToListing (Buffer, LocalField, 0);
|
||||
LocalField = LocalField->Next;
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
/* Normal case for most field types (Integer, String, etc.) */
|
||||
|
||||
DtCompileOneField (Buffer, LocalField,
|
||||
FieldLength, FieldType, Info->Flags);
|
||||
|
||||
DtWriteFieldToListing (Buffer, LocalField, FieldLength);
|
||||
LocalField = LocalField->Next;
|
||||
|
||||
if (Info->Flags & DT_LENGTH)
|
||||
|
@ -597,6 +617,7 @@ DtCompileTable (
|
|||
Subtable->LengthField = Buffer;
|
||||
Subtable->SizeOfLengthField = FieldLength;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
|
@ -142,6 +142,10 @@
|
|||
#define DT_FIELD_TYPE_FLAG 4
|
||||
#define DT_FIELD_TYPE_FLAGS_INTEGER 5
|
||||
#define DT_FIELD_TYPE_INLINE_SUBTABLE 6
|
||||
#define DT_FIELD_TYPE_UUID 7
|
||||
#define DT_FIELD_TYPE_UNICODE 8
|
||||
#define DT_FIELD_TYPE_DEVICE_PATH 9
|
||||
#define DT_FIELD_TYPE_LABEL 10
|
||||
|
||||
|
||||
/*
|
||||
|
@ -149,13 +153,15 @@
|
|||
*/
|
||||
typedef struct dt_field
|
||||
{
|
||||
char *Name;
|
||||
char *Value;
|
||||
struct dt_field *Next;
|
||||
char *Name; /* Field name (from name : value) */
|
||||
char *Value; /* Field value (from name : value) */
|
||||
struct dt_field *Next; /* Next field */
|
||||
struct dt_field *NextLabel; /* If field is a label, next label */
|
||||
UINT32 Line; /* Line number for this field */
|
||||
UINT32 ByteOffset; /* Offset in source file for field */
|
||||
UINT32 NameColumn; /* Start column for field name */
|
||||
UINT32 Column; /* Start column for field value */
|
||||
UINT32 TableOffset;/* Binary offset within ACPI table */
|
||||
UINT8 Flags;
|
||||
|
||||
} DT_FIELD;
|
||||
|
@ -200,6 +206,14 @@ DT_EXTERN DT_SUBTABLE DT_INIT_GLOBAL (*Gbl_RootTable, NULL);
|
|||
|
||||
DT_EXTERN DT_SUBTABLE DT_INIT_GLOBAL (*Gbl_SubtableStack, NULL);
|
||||
|
||||
/* List for defined labels */
|
||||
|
||||
DT_EXTERN DT_FIELD DT_INIT_GLOBAL (*Gbl_LabelList, NULL);
|
||||
|
||||
/* Current offset within the binary output table */
|
||||
|
||||
DT_EXTERN UINT32 DT_INIT_GLOBAL (Gbl_CurrentTableOffset, 0);
|
||||
|
||||
|
||||
/* dtcompiler - main module */
|
||||
|
||||
|
@ -221,6 +235,16 @@ void
|
|||
DtOutputBinary (
|
||||
DT_SUBTABLE *RootTable);
|
||||
|
||||
void
|
||||
DtWriteFieldToListing (
|
||||
UINT8 *Buffer,
|
||||
DT_FIELD *Field,
|
||||
UINT32 Length);
|
||||
|
||||
void
|
||||
DtWriteTableToListing (
|
||||
void);
|
||||
|
||||
|
||||
/* dtsubtable - compile subtables */
|
||||
|
||||
|
@ -266,6 +290,28 @@ DtGetParentSubtable (
|
|||
DT_SUBTABLE *Subtable);
|
||||
|
||||
|
||||
/* dtexpress - Integer expressions and labels */
|
||||
|
||||
ACPI_STATUS
|
||||
DtResolveIntegerExpression (
|
||||
DT_FIELD *Field,
|
||||
UINT64 *ReturnValue);
|
||||
|
||||
UINT64
|
||||
DtDoOperator (
|
||||
UINT64 LeftValue,
|
||||
UINT32 Operator,
|
||||
UINT64 RightValue);
|
||||
|
||||
UINT64
|
||||
DtResolveLabel (
|
||||
char *LabelString);
|
||||
|
||||
void
|
||||
DtDetectAllLabels (
|
||||
DT_FIELD *FieldList);
|
||||
|
||||
|
||||
/* dtfield - Compile individual fields within a table */
|
||||
|
||||
void
|
||||
|
@ -290,12 +336,30 @@ DtCompileBuffer (
|
|||
DT_FIELD *Field,
|
||||
UINT32 ByteLength);
|
||||
|
||||
UINT32
|
||||
void
|
||||
DtCompileFlag (
|
||||
UINT8 *Buffer,
|
||||
DT_FIELD *Field,
|
||||
ACPI_DMTABLE_INFO *Info,
|
||||
UINT32 BitPosition);
|
||||
ACPI_DMTABLE_INFO *Info);
|
||||
|
||||
|
||||
/* dtparser - lex/yacc files */
|
||||
|
||||
UINT64
|
||||
DtEvaluateExpression (
|
||||
char *ExprString);
|
||||
|
||||
int
|
||||
DtInitLexer (
|
||||
char *String);
|
||||
|
||||
void
|
||||
DtTerminateLexer (
|
||||
void);
|
||||
|
||||
char *
|
||||
DtGetOpName (
|
||||
UINT32 ParseOpcode);
|
||||
|
||||
|
||||
/* dtutils - Miscellaneous utilities */
|
||||
|
@ -344,8 +408,7 @@ DtGetFileSize (
|
|||
|
||||
char*
|
||||
DtGetFieldValue (
|
||||
DT_FIELD *Field,
|
||||
char *Name);
|
||||
DT_FIELD *Field);
|
||||
|
||||
UINT8
|
||||
DtGetFieldType (
|
||||
|
@ -431,6 +494,10 @@ ACPI_STATUS
|
|||
DtCompileRsdt (
|
||||
void **PFieldList);
|
||||
|
||||
ACPI_STATUS
|
||||
DtCompileSlic (
|
||||
void **PFieldList);
|
||||
|
||||
ACPI_STATUS
|
||||
DtCompileSlit (
|
||||
void **PFieldList);
|
||||
|
@ -439,6 +506,10 @@ ACPI_STATUS
|
|||
DtCompileSrat (
|
||||
void **PFieldList);
|
||||
|
||||
ACPI_STATUS
|
||||
DtCompileUefi (
|
||||
void **PFieldList);
|
||||
|
||||
ACPI_STATUS
|
||||
DtCompileWdat (
|
||||
void **PFieldList);
|
||||
|
@ -447,9 +518,46 @@ ACPI_STATUS
|
|||
DtCompileXsdt (
|
||||
void **PFieldList);
|
||||
|
||||
ACPI_STATUS
|
||||
DtCompileGeneric (
|
||||
void **PFieldList);
|
||||
|
||||
/* Debug */
|
||||
ACPI_DMTABLE_INFO *
|
||||
DtGetGenericTableInfo (
|
||||
char *Name);
|
||||
|
||||
#define MYDEBUG printf
|
||||
/* ACPI Table templates */
|
||||
|
||||
extern const unsigned char TemplateAsf[];
|
||||
extern const unsigned char TemplateBoot[];
|
||||
extern const unsigned char TemplateBert[];
|
||||
extern const unsigned char TemplateCpep[];
|
||||
extern const unsigned char TemplateDbgp[];
|
||||
extern const unsigned char TemplateDmar[];
|
||||
extern const unsigned char TemplateEcdt[];
|
||||
extern const unsigned char TemplateEinj[];
|
||||
extern const unsigned char TemplateErst[];
|
||||
extern const unsigned char TemplateFadt[];
|
||||
extern const unsigned char TemplateHest[];
|
||||
extern const unsigned char TemplateHpet[];
|
||||
extern const unsigned char TemplateIvrs[];
|
||||
extern const unsigned char TemplateMadt[];
|
||||
extern const unsigned char TemplateMcfg[];
|
||||
extern const unsigned char TemplateMchi[];
|
||||
extern const unsigned char TemplateMsct[];
|
||||
extern const unsigned char TemplateRsdt[];
|
||||
extern const unsigned char TemplateSbst[];
|
||||
extern const unsigned char TemplateSlic[];
|
||||
extern const unsigned char TemplateSlit[];
|
||||
extern const unsigned char TemplateSpcr[];
|
||||
extern const unsigned char TemplateSpmi[];
|
||||
extern const unsigned char TemplateSrat[];
|
||||
extern const unsigned char TemplateTcpa[];
|
||||
extern const unsigned char TemplateUefi[];
|
||||
extern const unsigned char TemplateWaet[];
|
||||
extern const unsigned char TemplateWdat[];
|
||||
extern const unsigned char TemplateWddt[];
|
||||
extern const unsigned char TemplateWdrt[];
|
||||
extern const unsigned char TemplateXsdt[];
|
||||
|
||||
#endif
|
||||
|
|
|
@ -0,0 +1,480 @@
|
|||
/******************************************************************************
|
||||
*
|
||||
* Module Name: dtexpress.c - Support for integer expressions and labels
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
*
|
||||
* 2.1. This is your license from Intel Corp. under its intellectual property
|
||||
* rights. You may have additional license terms from the party that provided
|
||||
* you this software, covering your right to use that party's intellectual
|
||||
* property rights.
|
||||
*
|
||||
* 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
|
||||
* copy of the source code appearing in this file ("Covered Code") an
|
||||
* irrevocable, perpetual, worldwide license under Intel's copyrights in the
|
||||
* base code distributed originally by Intel ("Original Intel Code") to copy,
|
||||
* make derivatives, distribute, use and display any portion of the Covered
|
||||
* Code in any form, with the right to sublicense such rights; and
|
||||
*
|
||||
* 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
|
||||
* license (with the right to sublicense), under only those claims of Intel
|
||||
* patents that are infringed by the Original Intel Code, to make, use, sell,
|
||||
* offer to sell, and import the Covered Code and derivative works thereof
|
||||
* solely to the minimum extent necessary to exercise the above copyright
|
||||
* license, and in no event shall the patent license extend to any additions
|
||||
* to or modifications of the Original Intel Code. No other license or right
|
||||
* is granted directly or by implication, estoppel or otherwise;
|
||||
*
|
||||
* The above copyright and patent license is granted only if the following
|
||||
* conditions are met:
|
||||
*
|
||||
* 3. Conditions
|
||||
*
|
||||
* 3.1. Redistribution of Source with Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification with rights to further distribute source must include
|
||||
* the above Copyright Notice, the above License, this list of Conditions,
|
||||
* and the following Disclaimer and Export Compliance provision. In addition,
|
||||
* Licensee must cause all Covered Code to which Licensee contributes to
|
||||
* contain a file documenting the changes Licensee made to create that Covered
|
||||
* Code and the date of any change. Licensee must include in that file the
|
||||
* documentation of any changes made by any predecessor Licensee. Licensee
|
||||
* must include a prominent statement that the modification is derived,
|
||||
* directly or indirectly, from Original Intel Code.
|
||||
*
|
||||
* 3.2. Redistribution of Source with no Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification without rights to further distribute source must
|
||||
* include the following Disclaimer and Export Compliance provision in the
|
||||
* documentation and/or other materials provided with distribution. In
|
||||
* addition, Licensee may not authorize further sublicense of source of any
|
||||
* portion of the Covered Code, and must include terms to the effect that the
|
||||
* license from Licensee to its licensee is limited to the intellectual
|
||||
* property embodied in the software Licensee provides to its licensee, and
|
||||
* not to intellectual property embodied in modifications its licensee may
|
||||
* make.
|
||||
*
|
||||
* 3.3. Redistribution of Executable. Redistribution in executable form of any
|
||||
* substantial portion of the Covered Code or modification must reproduce the
|
||||
* above Copyright Notice, and the following Disclaimer and Export Compliance
|
||||
* provision in the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* 3.4. Intel retains all right, title, and interest in and to the Original
|
||||
* Intel Code.
|
||||
*
|
||||
* 3.5. Neither the name Intel nor any other trademark owned or controlled by
|
||||
* Intel shall be used in advertising or otherwise to promote the sale, use or
|
||||
* other dealings in products derived from or relating to the Covered Code
|
||||
* without prior written authorization from Intel.
|
||||
*
|
||||
* 4. Disclaimer and Export Compliance
|
||||
*
|
||||
* 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
|
||||
* HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
|
||||
* IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
|
||||
* INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
|
||||
* UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
|
||||
* PARTICULAR PURPOSE.
|
||||
*
|
||||
* 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
|
||||
* OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
|
||||
* COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
|
||||
* SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
|
||||
* CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
|
||||
* HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
|
||||
* SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
|
||||
* LIMITED REMEDY.
|
||||
*
|
||||
* 4.3. Licensee shall not export, either directly or indirectly, any of this
|
||||
* software or system incorporating such software without first obtaining any
|
||||
* required license or other approval from the U. S. Department of Commerce or
|
||||
* any other agency or department of the United States Government. In the
|
||||
* event Licensee exports any such software from the United States or
|
||||
* re-exports any such software from a foreign destination, Licensee shall
|
||||
* ensure that the distribution and export/re-export of the software is in
|
||||
* compliance with all laws, regulations, orders, or other restrictions of the
|
||||
* U.S. Export Administration Regulations. Licensee agrees that neither it nor
|
||||
* any of its subsidiaries will export/re-export any technical data, process,
|
||||
* software, or service, directly or indirectly, to any country for which the
|
||||
* United States government or any agency thereof requires an export license,
|
||||
* other governmental approval, or letter of assurance, without first obtaining
|
||||
* such license, approval or letter.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
#define __DTEXPRESS_C__
|
||||
|
||||
#include "aslcompiler.h"
|
||||
#include "dtcompiler.h"
|
||||
#include "dtparser.y.h"
|
||||
|
||||
#define _COMPONENT DT_COMPILER
|
||||
ACPI_MODULE_NAME ("dtexpress")
|
||||
|
||||
|
||||
/* Local prototypes */
|
||||
|
||||
static void
|
||||
DtInsertLabelField (
|
||||
DT_FIELD *Field);
|
||||
|
||||
static DT_FIELD *
|
||||
DtLookupLabel (
|
||||
char *Name);
|
||||
|
||||
/* Global used for errors during parse and related functions */
|
||||
|
||||
DT_FIELD *Gbl_CurrentField;
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* FUNCTION: DtResolveIntegerExpression
|
||||
*
|
||||
* PARAMETERS: Field - Field object with Integer expression
|
||||
* ReturnValue - Where the integer is returned
|
||||
*
|
||||
* RETURN: Status, and the resolved 64-bit integer value
|
||||
*
|
||||
* DESCRIPTION: Resolve an integer expression to a single value. Supports
|
||||
* both integer constants and labels.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
ACPI_STATUS
|
||||
DtResolveIntegerExpression (
|
||||
DT_FIELD *Field,
|
||||
UINT64 *ReturnValue)
|
||||
{
|
||||
UINT64 Result;
|
||||
|
||||
|
||||
DbgPrint (ASL_DEBUG_OUTPUT, "Full Integer expression: %s\n",
|
||||
Field->Value);
|
||||
|
||||
Gbl_CurrentField = Field;
|
||||
|
||||
Result = DtEvaluateExpression (Field->Value);
|
||||
*ReturnValue = Result;
|
||||
return (AE_OK);
|
||||
}
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* FUNCTION: DtDoOperator
|
||||
*
|
||||
* PARAMETERS: LeftValue - First 64-bit operand
|
||||
* Operator - Parse token for the operator (EXPOP_*)
|
||||
* RightValue - Second 64-bit operand
|
||||
*
|
||||
* RETURN: 64-bit result of the requested operation
|
||||
*
|
||||
* DESCRIPTION: Perform the various 64-bit integer math functions
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
UINT64
|
||||
DtDoOperator (
|
||||
UINT64 LeftValue,
|
||||
UINT32 Operator,
|
||||
UINT64 RightValue)
|
||||
{
|
||||
UINT64 Result;
|
||||
|
||||
|
||||
/* Perform the requested operation */
|
||||
|
||||
switch (Operator)
|
||||
{
|
||||
case EXPOP_ONES_COMPLIMENT:
|
||||
Result = ~RightValue;
|
||||
break;
|
||||
|
||||
case EXPOP_LOGICAL_NOT:
|
||||
Result = !RightValue;
|
||||
break;
|
||||
|
||||
case EXPOP_MULTIPLY:
|
||||
Result = LeftValue * RightValue;
|
||||
break;
|
||||
|
||||
case EXPOP_DIVIDE:
|
||||
if (!RightValue)
|
||||
{
|
||||
DtError (ASL_ERROR, ASL_MSG_DIVIDE_BY_ZERO,
|
||||
Gbl_CurrentField, Gbl_CurrentField->Value);
|
||||
return (0);
|
||||
}
|
||||
Result = LeftValue / RightValue;
|
||||
break;
|
||||
|
||||
case EXPOP_MODULO:
|
||||
if (!RightValue)
|
||||
{
|
||||
DtError (ASL_ERROR, ASL_MSG_DIVIDE_BY_ZERO,
|
||||
Gbl_CurrentField, Gbl_CurrentField->Value);
|
||||
return (0);
|
||||
}
|
||||
Result = LeftValue % RightValue;
|
||||
break;
|
||||
|
||||
case EXPOP_ADD:
|
||||
Result = LeftValue + RightValue;
|
||||
break;
|
||||
|
||||
case EXPOP_SUBTRACT:
|
||||
Result = LeftValue - RightValue;
|
||||
break;
|
||||
|
||||
case EXPOP_SHIFT_RIGHT:
|
||||
Result = LeftValue >> RightValue;
|
||||
break;
|
||||
|
||||
case EXPOP_SHIFT_LEFT:
|
||||
Result = LeftValue << RightValue;
|
||||
break;
|
||||
|
||||
case EXPOP_LESS:
|
||||
Result = LeftValue < RightValue;
|
||||
break;
|
||||
|
||||
case EXPOP_GREATER:
|
||||
Result = LeftValue > RightValue;
|
||||
break;
|
||||
|
||||
case EXPOP_LESS_EQUAL:
|
||||
Result = LeftValue <= RightValue;
|
||||
break;
|
||||
|
||||
case EXPOP_GREATER_EQUAL:
|
||||
Result = LeftValue >= RightValue;
|
||||
break;
|
||||
|
||||
case EXPOP_EQUAL:
|
||||
Result = LeftValue = RightValue;
|
||||
break;
|
||||
|
||||
case EXPOP_NOT_EQUAL:
|
||||
Result = LeftValue != RightValue;
|
||||
break;
|
||||
|
||||
case EXPOP_AND:
|
||||
Result = LeftValue & RightValue;
|
||||
break;
|
||||
|
||||
case EXPOP_XOR:
|
||||
Result = LeftValue ^ RightValue;
|
||||
break;
|
||||
|
||||
case EXPOP_OR:
|
||||
Result = LeftValue | RightValue;
|
||||
break;
|
||||
|
||||
case EXPOP_LOGICAL_AND:
|
||||
Result = LeftValue && RightValue;
|
||||
break;
|
||||
|
||||
case EXPOP_LOGICAL_OR:
|
||||
Result = LeftValue || RightValue;
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
/* Unknown operator */
|
||||
|
||||
DtFatal (ASL_MSG_INVALID_EXPRESSION,
|
||||
Gbl_CurrentField, Gbl_CurrentField->Value);
|
||||
return (0);
|
||||
}
|
||||
|
||||
DbgPrint (ASL_DEBUG_OUTPUT,
|
||||
"IntegerEval: %s (%8.8X%8.8X %s %8.8X%8.8X) = %8.8X%8.8X\n",
|
||||
Gbl_CurrentField->Value,
|
||||
ACPI_FORMAT_UINT64 (LeftValue),
|
||||
DtGetOpName (Operator),
|
||||
ACPI_FORMAT_UINT64 (RightValue),
|
||||
ACPI_FORMAT_UINT64 (Result));
|
||||
|
||||
return (Result);
|
||||
}
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* FUNCTION: DtResolveLabel
|
||||
*
|
||||
* PARAMETERS: LabelString - Contains the label
|
||||
*
|
||||
* RETURN: Table offset associated with the label
|
||||
*
|
||||
* DESCRIPTION: Lookup a lable and return its value.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
UINT64
|
||||
DtResolveLabel (
|
||||
char *LabelString)
|
||||
{
|
||||
DT_FIELD *LabelField;
|
||||
|
||||
|
||||
DbgPrint (ASL_DEBUG_OUTPUT, "Resolve Label: %s\n", LabelString);
|
||||
|
||||
/* Resolve a label reference to an integer (table offset) */
|
||||
|
||||
if (*LabelString != '$')
|
||||
{
|
||||
return (0);
|
||||
}
|
||||
|
||||
LabelField = DtLookupLabel (LabelString);
|
||||
if (!LabelField)
|
||||
{
|
||||
DtError (ASL_ERROR, ASL_MSG_UNKNOWN_LABEL,
|
||||
Gbl_CurrentField, LabelString);
|
||||
return (0);
|
||||
}
|
||||
|
||||
/* All we need from the label is the offset in the table */
|
||||
|
||||
DbgPrint (ASL_DEBUG_OUTPUT, "Resolved Label: 0x%8.8X\n",
|
||||
LabelField->TableOffset);
|
||||
|
||||
return (LabelField->TableOffset);
|
||||
}
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* FUNCTION: DtDetectAllLabels
|
||||
*
|
||||
* PARAMETERS: FieldList - Field object at start of generic list
|
||||
*
|
||||
* RETURN: None
|
||||
*
|
||||
* DESCRIPTION: Detect all labels in a list of "generic" opcodes (such as
|
||||
* a UEFI table.) and insert them into the global label list.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
void
|
||||
DtDetectAllLabels (
|
||||
DT_FIELD *FieldList)
|
||||
{
|
||||
ACPI_DMTABLE_INFO *Info;
|
||||
DT_FIELD *GenericField;
|
||||
UINT32 TableOffset;
|
||||
|
||||
|
||||
TableOffset = Gbl_CurrentTableOffset;
|
||||
GenericField = FieldList;
|
||||
|
||||
/*
|
||||
* Process all "Label:" fields within the parse tree. We need
|
||||
* to know the offsets for all labels before we can compile
|
||||
* the parse tree in order to handle forward references. Traverse
|
||||
* tree and get/set all field lengths of all operators in order to
|
||||
* determine the label offsets.
|
||||
*/
|
||||
while (GenericField)
|
||||
{
|
||||
Info = DtGetGenericTableInfo (GenericField->Name);
|
||||
if (Info)
|
||||
{
|
||||
/* Maintain table offsets */
|
||||
|
||||
GenericField->TableOffset = TableOffset;
|
||||
TableOffset += DtGetFieldLength (GenericField, Info);
|
||||
|
||||
/* Insert all labels in the global label list */
|
||||
|
||||
if (Info->Opcode == ACPI_DMT_LABEL)
|
||||
{
|
||||
DtInsertLabelField (GenericField);
|
||||
}
|
||||
}
|
||||
|
||||
GenericField = GenericField->Next;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* FUNCTION: DtInsertLabelField
|
||||
*
|
||||
* PARAMETERS: Field - Field object with Label to be inserted
|
||||
*
|
||||
* RETURN: None
|
||||
*
|
||||
* DESCRIPTION: Insert a label field into the global label list
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
static void
|
||||
DtInsertLabelField (
|
||||
DT_FIELD *Field)
|
||||
{
|
||||
|
||||
DbgPrint (ASL_DEBUG_OUTPUT,
|
||||
"DtInsertLabelField: Found Label : %s at output table offset %X\n",
|
||||
Field->Value, Field->TableOffset);
|
||||
|
||||
Field->NextLabel = Gbl_LabelList;
|
||||
Gbl_LabelList = Field;
|
||||
}
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* FUNCTION: DtLookupLabel
|
||||
*
|
||||
* PARAMETERS: Name - Label to be resolved
|
||||
*
|
||||
* RETURN: Field object associated with the label
|
||||
*
|
||||
* DESCRIPTION: Lookup a label in the global label list. Used during the
|
||||
* resolution of integer expressions.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
static DT_FIELD *
|
||||
DtLookupLabel (
|
||||
char *Name)
|
||||
{
|
||||
DT_FIELD *LabelField;
|
||||
|
||||
|
||||
/* Skip a leading $ */
|
||||
|
||||
if (*Name == '$')
|
||||
{
|
||||
Name++;
|
||||
}
|
||||
|
||||
/* Search global list */
|
||||
|
||||
LabelField = Gbl_LabelList;
|
||||
while (LabelField)
|
||||
{
|
||||
if (!ACPI_STRCMP (Name, LabelField->Value))
|
||||
{
|
||||
return (LabelField);
|
||||
}
|
||||
LabelField = LabelField->NextLabel;
|
||||
}
|
||||
|
||||
return (NULL);
|
||||
}
|
|
@ -8,7 +8,7 @@
|
|||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
|
@ -130,17 +130,23 @@ DtCompileString (
|
|||
DT_FIELD *Field,
|
||||
UINT32 ByteLength);
|
||||
|
||||
static char *
|
||||
DtPciPathToBuffer (
|
||||
char *PciPath);
|
||||
|
||||
static void
|
||||
DtCompilePciPath (
|
||||
DtCompileUnicode (
|
||||
UINT8 *Buffer,
|
||||
char *StringValue,
|
||||
DT_FIELD *Field,
|
||||
UINT32 ByteLength);
|
||||
|
||||
static ACPI_STATUS
|
||||
DtCompileUuid (
|
||||
UINT8 *Buffer,
|
||||
DT_FIELD *Field,
|
||||
UINT32 ByteLength);
|
||||
|
||||
static char *
|
||||
DtNormalizeBuffer (
|
||||
char *Buffer,
|
||||
UINT32 *Count);
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
|
@ -165,6 +171,7 @@ DtCompileOneField (
|
|||
UINT8 Type,
|
||||
UINT8 Flags)
|
||||
{
|
||||
ACPI_STATUS Status;
|
||||
|
||||
switch (Type)
|
||||
{
|
||||
|
@ -176,12 +183,24 @@ DtCompileOneField (
|
|||
DtCompileString (Buffer, Field, ByteLength);
|
||||
break;
|
||||
|
||||
case DT_FIELD_TYPE_UUID:
|
||||
Status = DtCompileUuid (Buffer, Field, ByteLength);
|
||||
if (ACPI_SUCCESS (Status))
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
/* Fall through. */
|
||||
|
||||
case DT_FIELD_TYPE_BUFFER:
|
||||
DtCompileBuffer (Buffer, Field->Value, Field, ByteLength);
|
||||
break;
|
||||
|
||||
case DT_FIELD_TYPE_PCI_PATH:
|
||||
DtCompilePciPath (Buffer, Field->Value, Field, ByteLength);
|
||||
case DT_FIELD_TYPE_UNICODE:
|
||||
DtCompileUnicode (Buffer, Field, ByteLength);
|
||||
break;
|
||||
|
||||
case DT_FIELD_TYPE_DEVICE_PATH:
|
||||
break;
|
||||
|
||||
default:
|
||||
|
@ -225,13 +244,93 @@ DtCompileString (
|
|||
Length = ByteLength;
|
||||
}
|
||||
|
||||
/* If input string is shorter than ByteLength, pad with blanks */
|
||||
|
||||
ACPI_MEMSET (Buffer, 0x20, ByteLength);
|
||||
ACPI_MEMCPY (Buffer, Field->Value, Length);
|
||||
}
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* FUNCTION: DtCompileUnicode
|
||||
*
|
||||
* PARAMETERS: Buffer - Output buffer
|
||||
* Field - String to be copied to buffer
|
||||
* ByteLength - Maximum length of string
|
||||
*
|
||||
* RETURN: None
|
||||
*
|
||||
* DESCRIPTION: Convert ASCII string to Unicode string
|
||||
*
|
||||
* Note: The Unicode string is 16 bits per character, no leading signature,
|
||||
* with a 16-bit terminating NULL.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
static void
|
||||
DtCompileUnicode (
|
||||
UINT8 *Buffer,
|
||||
DT_FIELD *Field,
|
||||
UINT32 ByteLength)
|
||||
{
|
||||
UINT32 Count;
|
||||
UINT32 i;
|
||||
char *AsciiString;
|
||||
UINT16 *UnicodeString;
|
||||
|
||||
|
||||
AsciiString = Field->Value;
|
||||
UnicodeString = (UINT16 *) Buffer;
|
||||
Count = ACPI_STRLEN (AsciiString) + 1;
|
||||
|
||||
/* Convert to Unicode string (including null terminator) */
|
||||
|
||||
for (i = 0; i < Count; i++)
|
||||
{
|
||||
UnicodeString[i] = (UINT16) AsciiString[i];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: DtCompileUuid
|
||||
*
|
||||
* PARAMETERS: Buffer - Output buffer
|
||||
* Field - String to be copied to buffer
|
||||
* ByteLength - Maximum length of string
|
||||
*
|
||||
* RETURN: None
|
||||
*
|
||||
* DESCRIPTION: Convert UUID string to 16-byte buffer
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
static ACPI_STATUS
|
||||
DtCompileUuid (
|
||||
UINT8 *Buffer,
|
||||
DT_FIELD *Field,
|
||||
UINT32 ByteLength)
|
||||
{
|
||||
char *InString;
|
||||
ACPI_STATUS Status;
|
||||
|
||||
|
||||
InString = Field->Value;
|
||||
|
||||
Status = AuValidateUuid (InString);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
sprintf (MsgBuffer, "%s", Field->Value);
|
||||
DtNameError (ASL_ERROR, ASL_MSG_INVALID_UUID, Field, MsgBuffer);
|
||||
}
|
||||
else
|
||||
{
|
||||
Status = AuConvertStringToUuid (InString, (char *) Buffer);
|
||||
}
|
||||
|
||||
return (Status);
|
||||
}
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* FUNCTION: DtCompileInteger
|
||||
|
@ -239,10 +338,12 @@ DtCompileString (
|
|||
* PARAMETERS: Buffer - Output buffer
|
||||
* Field - Field obj with Integer to be compiled
|
||||
* ByteLength - Byte length of the integer
|
||||
* Flags - Additional compile info
|
||||
*
|
||||
* RETURN: None
|
||||
*
|
||||
* DESCRIPTION: Compile an integer
|
||||
* DESCRIPTION: Compile an integer. Supports integer expressions with C-style
|
||||
* operators.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
|
@ -253,15 +354,12 @@ DtCompileInteger (
|
|||
UINT32 ByteLength,
|
||||
UINT8 Flags)
|
||||
{
|
||||
UINT64 Value = 0;
|
||||
UINT64 Value;
|
||||
UINT64 MaxValue;
|
||||
UINT8 *Hex;
|
||||
char *Message = NULL;
|
||||
ACPI_STATUS Status;
|
||||
int i;
|
||||
|
||||
|
||||
/* Byte length must be in range 1-8 */
|
||||
/* Output buffer byte length must be in range 1-8 */
|
||||
|
||||
if ((ByteLength > 8) || (ByteLength == 0))
|
||||
{
|
||||
|
@ -270,22 +368,12 @@ DtCompileInteger (
|
|||
return;
|
||||
}
|
||||
|
||||
/* Convert string to an actual integer */
|
||||
/* Resolve integer expression to a single integer value */
|
||||
|
||||
Status = DtStrtoul64 (Field->Value, &Value);
|
||||
Status = DtResolveIntegerExpression (Field, &Value);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
if (Status == AE_LIMIT)
|
||||
{
|
||||
Message = "Constant larger than 64 bits";
|
||||
}
|
||||
else if (Status == AE_BAD_CHARACTER)
|
||||
{
|
||||
Message = "Invalid character in constant";
|
||||
}
|
||||
|
||||
DtError (ASL_ERROR, ASL_MSG_INVALID_HEX_INTEGER, Field, Message);
|
||||
goto Exit;
|
||||
return;
|
||||
}
|
||||
|
||||
/* Ensure that reserved fields are set to zero */
|
||||
|
@ -317,29 +405,10 @@ DtCompileInteger (
|
|||
|
||||
if (Value > MaxValue)
|
||||
{
|
||||
sprintf (MsgBuffer, "Maximum %u bytes", ByteLength);
|
||||
sprintf (MsgBuffer, "%8.8X%8.8X", ACPI_FORMAT_UINT64 (Value));
|
||||
DtError (ASL_ERROR, ASL_MSG_INTEGER_SIZE, Field, MsgBuffer);
|
||||
}
|
||||
|
||||
/*
|
||||
* TBD: hard code for ASF! Capabilites field.
|
||||
*
|
||||
* This field is actually a buffer, not a 56-bit integer --
|
||||
* so, the ordering is reversed. Something should be fixed
|
||||
* so we don't need this code.
|
||||
*/
|
||||
if (ByteLength == 7)
|
||||
{
|
||||
Hex = ACPI_CAST_PTR (UINT8, &Value);
|
||||
for (i = 6; i >= 0; i--)
|
||||
{
|
||||
Buffer[i] = *Hex;
|
||||
Hex++;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
Exit:
|
||||
ACPI_MEMCPY (Buffer, &Value, ByteLength);
|
||||
return;
|
||||
}
|
||||
|
@ -347,33 +416,68 @@ Exit:
|
|||
|
||||
/******************************************************************************
|
||||
*
|
||||
* FUNCTION: DtPciPathToBuffer
|
||||
* FUNCTION: DtNormalizeBuffer
|
||||
*
|
||||
* PARAMETERS: PciPath - DMAR "PCI Path" field
|
||||
* PARAMETERS: Buffer - Input buffer
|
||||
* Count - Output the count of hex number in
|
||||
* the Buffer
|
||||
*
|
||||
* RETURN: Strings of PCI path
|
||||
* RETURN: The normalized buffer, freed by caller
|
||||
*
|
||||
* DESCRIPTION: Remove brackets and comma from DMAR "PCI Path" string, for
|
||||
* example: [1D, 01] ==> 1D 01
|
||||
* DESCRIPTION: [1A,2B,3C,4D] or 1A, 2B, 3C, 4D will be normalized
|
||||
* to 1A 2B 3C 4D
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
static char *
|
||||
DtPciPathToBuffer (
|
||||
char *PciPath)
|
||||
DtNormalizeBuffer (
|
||||
char *Buffer,
|
||||
UINT32 *Count)
|
||||
{
|
||||
char *Buffer;
|
||||
char *NewBuffer;
|
||||
char *TmpBuffer;
|
||||
UINT32 BufferCount = 0;
|
||||
BOOLEAN Separator = TRUE;
|
||||
char c;
|
||||
|
||||
|
||||
Buffer = UtLocalCalloc (6);
|
||||
NewBuffer = UtLocalCalloc (ACPI_STRLEN (Buffer) + 1);
|
||||
TmpBuffer = NewBuffer;
|
||||
|
||||
Buffer[0] = PciPath[1];
|
||||
Buffer[1] = PciPath[2];
|
||||
Buffer[2] = ' ';
|
||||
Buffer[3] = PciPath[5];
|
||||
Buffer[4] = PciPath[6];
|
||||
while ((c = *Buffer++))
|
||||
{
|
||||
switch (c)
|
||||
{
|
||||
/* Valid separators */
|
||||
|
||||
return (Buffer);
|
||||
case '[':
|
||||
case ']':
|
||||
case ' ':
|
||||
case ',':
|
||||
Separator = TRUE;
|
||||
break;
|
||||
|
||||
default:
|
||||
if (Separator)
|
||||
{
|
||||
/* Insert blank as the standard separator */
|
||||
|
||||
if (NewBuffer[0])
|
||||
{
|
||||
*TmpBuffer++ = ' ';
|
||||
BufferCount++;
|
||||
}
|
||||
|
||||
Separator = FALSE;
|
||||
}
|
||||
|
||||
*TmpBuffer++ = c;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
*Count = BufferCount + 1;
|
||||
return (NewBuffer);
|
||||
}
|
||||
|
||||
|
||||
|
@ -407,13 +511,17 @@ DtCompileBuffer (
|
|||
UINT32 Count;
|
||||
|
||||
|
||||
Count = ACPI_STRLEN (StringValue) / 3 + 1;
|
||||
/* Allow several different types of value separators */
|
||||
|
||||
StringValue = DtNormalizeBuffer (StringValue, &Count);
|
||||
|
||||
Hex[2] = 0;
|
||||
for (i = 0; i < Count; i++)
|
||||
{
|
||||
Hex[0] = StringValue[0];
|
||||
Hex[1] = StringValue[1];
|
||||
/* Each element of StringValue is three chars */
|
||||
|
||||
Hex[0] = StringValue[(3 * i)];
|
||||
Hex[1] = StringValue[(3 * i) + 1];
|
||||
|
||||
/* Convert one hex byte */
|
||||
|
||||
|
@ -426,46 +534,13 @@ DtCompileBuffer (
|
|||
}
|
||||
|
||||
Buffer[i] = (UINT8) Value;
|
||||
StringValue += 3;
|
||||
}
|
||||
|
||||
ACPI_FREE (StringValue);
|
||||
return (ByteLength - Count);
|
||||
}
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* FUNCTION: DtCompilePciPath
|
||||
*
|
||||
* PARAMETERS: Buffer - Output buffer
|
||||
* StringValue - DMAR pci path string
|
||||
* ByteLength - Byte length of DMAR pci path string, 2
|
||||
*
|
||||
* RETURN: None
|
||||
*
|
||||
* DESCRIPTION: Compile DMAR PCI path string to binary
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
static void
|
||||
DtCompilePciPath (
|
||||
UINT8 *Buffer,
|
||||
char *StringValue,
|
||||
DT_FIELD *Field,
|
||||
UINT32 ByteLength)
|
||||
{
|
||||
char *PciPathBuffer;
|
||||
|
||||
|
||||
/* Parse path to simple hex digits, then convert to binary */
|
||||
|
||||
PciPathBuffer = DtPciPathToBuffer (StringValue);
|
||||
|
||||
DtCompileBuffer (Buffer, PciPathBuffer, Field, ByteLength);
|
||||
ACPI_FREE (PciPathBuffer);
|
||||
}
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* FUNCTION: DtCompileFlag
|
||||
|
@ -473,23 +548,22 @@ DtCompilePciPath (
|
|||
* PARAMETERS: Buffer - Output buffer
|
||||
* Field - Field to be compiled
|
||||
* Info - Flag info
|
||||
* BitPosition - Flag bit position
|
||||
*
|
||||
* RETURN: Next flag bit position
|
||||
* RETURN:
|
||||
*
|
||||
* DESCRIPTION: Compile a flag
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
UINT32
|
||||
void
|
||||
DtCompileFlag (
|
||||
UINT8 *Buffer,
|
||||
DT_FIELD *Field,
|
||||
ACPI_DMTABLE_INFO *Info,
|
||||
UINT32 BitPosition)
|
||||
ACPI_DMTABLE_INFO *Info)
|
||||
{
|
||||
UINT64 Value = 0;
|
||||
UINT32 BitLength = 1;
|
||||
UINT8 BitPosition = 0;
|
||||
ACPI_STATUS Status;
|
||||
|
||||
|
||||
|
@ -510,12 +584,20 @@ DtCompileFlag (
|
|||
case ACPI_DMT_FLAG6:
|
||||
case ACPI_DMT_FLAG7:
|
||||
|
||||
BitPosition = Info->Opcode;
|
||||
BitLength = 1;
|
||||
break;
|
||||
|
||||
case ACPI_DMT_FLAGS0:
|
||||
|
||||
BitPosition = 0;
|
||||
BitLength = 2;
|
||||
break;
|
||||
|
||||
|
||||
case ACPI_DMT_FLAGS2:
|
||||
|
||||
BitPosition = 2;
|
||||
BitLength = 2;
|
||||
break;
|
||||
|
||||
|
@ -534,10 +616,5 @@ DtCompileFlag (
|
|||
Value = 0;
|
||||
}
|
||||
|
||||
/* Insert the flag, return next flag bit position */
|
||||
|
||||
Buffer += ACPI_DIV_8 (BitPosition);
|
||||
*Buffer |= (UINT8) (Value << ACPI_MOD_8 (BitPosition));
|
||||
|
||||
return (BitPosition + BitLength);
|
||||
*Buffer |= (UINT8) (Value << BitPosition);
|
||||
}
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
|
@ -122,33 +122,51 @@
|
|||
ACPI_MODULE_NAME ("dtio")
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* FUNCTION: DtIsComment
|
||||
*
|
||||
* PARAMETERS: Line - Current source code line
|
||||
*
|
||||
* RETURN: TRUE if comment, FALSE otherwise
|
||||
*
|
||||
* DESCRIPTION: Detect a comment in the source module
|
||||
*
|
||||
*****************************************************************************/
|
||||
/* Local prototypes */
|
||||
|
||||
/* TBD: Temporary: very simple code to detect comments */
|
||||
static char *
|
||||
DtTrim (
|
||||
char *String);
|
||||
|
||||
static int
|
||||
DtIsComment(
|
||||
char *Line)
|
||||
{
|
||||
static void
|
||||
DtLinkField (
|
||||
DT_FIELD *Field);
|
||||
|
||||
if (!ACPI_STRNCMP (Line, "/*", 2) ||
|
||||
!ACPI_STRNCMP (Line, " *", 2))
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
static ACPI_STATUS
|
||||
DtParseLine (
|
||||
char *LineBuffer,
|
||||
UINT32 Line,
|
||||
UINT32 Offset);
|
||||
|
||||
return 0;
|
||||
}
|
||||
UINT32
|
||||
DtGetNextLine (
|
||||
FILE *Handle);
|
||||
|
||||
static void
|
||||
DtWriteBinary (
|
||||
DT_SUBTABLE *Subtable,
|
||||
void *Context,
|
||||
void *ReturnValue);
|
||||
|
||||
static void
|
||||
DtDumpBuffer (
|
||||
UINT32 FileId,
|
||||
UINT8 *Buffer,
|
||||
UINT32 Offset,
|
||||
UINT32 Length);
|
||||
|
||||
|
||||
/* States for DtGetNextLine */
|
||||
|
||||
#define DT_NORMAL_TEXT 0
|
||||
#define DT_START_QUOTED_STRING 1
|
||||
#define DT_START_COMMENT 2
|
||||
#define DT_SLASH_ASTERISK_COMMENT 3
|
||||
#define DT_SLASH_SLASH_COMMENT 4
|
||||
#define DT_END_COMMENT 5
|
||||
#define DT_MERGE_LINES 6
|
||||
|
||||
static UINT32 Gbl_NextLineOffset;
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
|
@ -283,13 +301,13 @@ DtLinkField (
|
|||
* Line - Current line number in the source
|
||||
* Offset - Current byte offset of the line
|
||||
*
|
||||
* RETURN: None
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Parse one source line
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
static void
|
||||
static ACPI_STATUS
|
||||
DtParseLine (
|
||||
char *LineBuffer,
|
||||
UINT32 Line,
|
||||
|
@ -306,17 +324,25 @@ DtParseLine (
|
|||
DT_FIELD *Field;
|
||||
UINT32 Column;
|
||||
UINT32 NameColumn;
|
||||
BOOLEAN IsNullString = FALSE;
|
||||
|
||||
|
||||
if (!LineBuffer || DtIsComment (LineBuffer))
|
||||
if (!LineBuffer)
|
||||
{
|
||||
return;
|
||||
return (AE_OK);
|
||||
}
|
||||
|
||||
/* All lines after "Raw Table Data" are ingored */
|
||||
|
||||
if (strstr (LineBuffer, ACPI_RAW_TABLE_DATA_HEADER))
|
||||
{
|
||||
return (AE_NOT_FOUND);
|
||||
}
|
||||
|
||||
Colon = strchr (LineBuffer, ':');
|
||||
if (!Colon || *(Colon - 1) != ' ')
|
||||
if (!Colon)
|
||||
{
|
||||
return;
|
||||
return (AE_OK);
|
||||
}
|
||||
|
||||
Start = LineBuffer;
|
||||
|
@ -341,7 +367,6 @@ DtParseLine (
|
|||
|
||||
if (Start == Colon)
|
||||
{
|
||||
MYDEBUG ("ERROR: right bracket reaches colon position\n");
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -367,7 +392,6 @@ DtParseLine (
|
|||
ACPI_FREE (TmpName);
|
||||
|
||||
Start = End = (Colon + 1);
|
||||
|
||||
while (*End)
|
||||
{
|
||||
/* Found left quotation, go to the right quotation and break */
|
||||
|
@ -375,7 +399,14 @@ DtParseLine (
|
|||
if (*End == '"')
|
||||
{
|
||||
End++;
|
||||
while (*End && *End != '"')
|
||||
|
||||
/* Check for an explicit null string */
|
||||
|
||||
if (*End == '"')
|
||||
{
|
||||
IsNullString = TRUE;
|
||||
}
|
||||
while (*End && (*End != '"'))
|
||||
{
|
||||
End++;
|
||||
}
|
||||
|
@ -384,23 +415,32 @@ DtParseLine (
|
|||
break;
|
||||
}
|
||||
|
||||
if (*End == '(' ||
|
||||
*End == '<' ||
|
||||
*End == '/')
|
||||
/*
|
||||
* Special "comment" fields at line end, ignore them.
|
||||
* Note: normal slash-slash and slash-asterisk comments are
|
||||
* stripped already by the DtGetNextLine parser.
|
||||
*
|
||||
* TBD: Perhaps DtGetNextLine should parse the following type
|
||||
* of comments also.
|
||||
*/
|
||||
if (*End == '[')
|
||||
{
|
||||
End--;
|
||||
break;
|
||||
}
|
||||
|
||||
End++;
|
||||
}
|
||||
|
||||
Length = ACPI_PTR_DIFF (End, Start);
|
||||
TmpValue = UtLocalCalloc (Length + 1);
|
||||
|
||||
ACPI_STRNCPY (TmpValue, Start, Length);
|
||||
Value = DtTrim (TmpValue);
|
||||
ACPI_FREE (TmpValue);
|
||||
|
||||
if (Name && Value)
|
||||
/* Create a new field object only if we have a valid value field */
|
||||
|
||||
if ((Value && *Value) || IsNullString)
|
||||
{
|
||||
Field = UtLocalCalloc (sizeof (DT_FIELD));
|
||||
Field->Name = Name;
|
||||
|
@ -412,6 +452,261 @@ DtParseLine (
|
|||
|
||||
DtLinkField (Field);
|
||||
}
|
||||
else /* Ignore this field, it has no valid data */
|
||||
{
|
||||
ACPI_FREE (Name);
|
||||
ACPI_FREE (Value);
|
||||
}
|
||||
|
||||
return (AE_OK);
|
||||
}
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* FUNCTION: DtGetNextLine
|
||||
*
|
||||
* PARAMETERS: Handle - Open file handle for the source file
|
||||
*
|
||||
* RETURN: Filled line buffer and offset of start-of-line (ASL_EOF on EOF)
|
||||
*
|
||||
* DESCRIPTION: Get the next valid source line. Removes all comments.
|
||||
* Ignores empty lines.
|
||||
*
|
||||
* Handles both slash-asterisk and slash-slash comments.
|
||||
* Also, quoted strings, but no escapes within.
|
||||
*
|
||||
* Line is returned in Gbl_CurrentLineBuffer.
|
||||
* Line number in original file is returned in Gbl_CurrentLineNumber.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
UINT32
|
||||
DtGetNextLine (
|
||||
FILE *Handle)
|
||||
{
|
||||
BOOLEAN LineNotAllBlanks = FALSE;
|
||||
UINT32 State = DT_NORMAL_TEXT;
|
||||
UINT32 CurrentLineOffset;
|
||||
UINT32 i;
|
||||
char c;
|
||||
|
||||
|
||||
for (i = 0; i < ASL_LINE_BUFFER_SIZE;)
|
||||
{
|
||||
c = (char) getc (Handle);
|
||||
if (c == EOF)
|
||||
{
|
||||
switch (State)
|
||||
{
|
||||
case DT_START_QUOTED_STRING:
|
||||
case DT_SLASH_ASTERISK_COMMENT:
|
||||
case DT_SLASH_SLASH_COMMENT:
|
||||
|
||||
AcpiOsPrintf ("**** EOF within comment/string %u\n", State);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return (ASL_EOF);
|
||||
}
|
||||
|
||||
switch (State)
|
||||
{
|
||||
case DT_NORMAL_TEXT:
|
||||
|
||||
/* Normal text, insert char into line buffer */
|
||||
|
||||
Gbl_CurrentLineBuffer[i] = c;
|
||||
switch (c)
|
||||
{
|
||||
case '/':
|
||||
State = DT_START_COMMENT;
|
||||
break;
|
||||
|
||||
case '"':
|
||||
State = DT_START_QUOTED_STRING;
|
||||
LineNotAllBlanks = TRUE;
|
||||
i++;
|
||||
break;
|
||||
|
||||
case '\\':
|
||||
/*
|
||||
* The continuation char MUST be last char on this line.
|
||||
* Otherwise, it will be assumed to be a valid ASL char.
|
||||
*/
|
||||
State = DT_MERGE_LINES;
|
||||
break;
|
||||
|
||||
case '\n':
|
||||
CurrentLineOffset = Gbl_NextLineOffset;
|
||||
Gbl_NextLineOffset = (UINT32) ftell (Handle);
|
||||
Gbl_CurrentLineNumber++;
|
||||
|
||||
/*
|
||||
* Exit if line is complete. Ignore empty lines (only \n)
|
||||
* or lines that contain nothing but blanks.
|
||||
*/
|
||||
if ((i != 0) && LineNotAllBlanks)
|
||||
{
|
||||
Gbl_CurrentLineBuffer[i+1] = 0; /* Terminate string */
|
||||
return (CurrentLineOffset);
|
||||
}
|
||||
|
||||
/* Toss this line and start a new one */
|
||||
|
||||
i = 0;
|
||||
LineNotAllBlanks = FALSE;
|
||||
break;
|
||||
|
||||
default:
|
||||
if (c != ' ')
|
||||
{
|
||||
LineNotAllBlanks = TRUE;
|
||||
}
|
||||
|
||||
i++;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case DT_START_QUOTED_STRING:
|
||||
|
||||
/* Insert raw chars until end of quoted string */
|
||||
|
||||
Gbl_CurrentLineBuffer[i] = c;
|
||||
i++;
|
||||
|
||||
if (c == '"')
|
||||
{
|
||||
State = DT_NORMAL_TEXT;
|
||||
}
|
||||
break;
|
||||
|
||||
case DT_START_COMMENT:
|
||||
|
||||
/* Open comment if this character is an asterisk or slash */
|
||||
|
||||
switch (c)
|
||||
{
|
||||
case '*':
|
||||
State = DT_SLASH_ASTERISK_COMMENT;
|
||||
break;
|
||||
|
||||
case '/':
|
||||
State = DT_SLASH_SLASH_COMMENT;
|
||||
break;
|
||||
|
||||
default: /* Not a comment */
|
||||
i++; /* Save the preceeding slash */
|
||||
Gbl_CurrentLineBuffer[i] = c;
|
||||
i++;
|
||||
State = DT_NORMAL_TEXT;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case DT_SLASH_ASTERISK_COMMENT:
|
||||
|
||||
/* Ignore chars until an asterisk-slash is found */
|
||||
|
||||
switch (c)
|
||||
{
|
||||
case '\n':
|
||||
Gbl_NextLineOffset = (UINT32) ftell (Handle);
|
||||
Gbl_CurrentLineNumber++;
|
||||
break;
|
||||
|
||||
case '*':
|
||||
State = DT_END_COMMENT;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case DT_SLASH_SLASH_COMMENT:
|
||||
|
||||
/* Ignore chars until end-of-line */
|
||||
|
||||
if (c == '\n')
|
||||
{
|
||||
/* We will exit via the NORMAL_TEXT path */
|
||||
|
||||
ungetc (c, Handle);
|
||||
State = DT_NORMAL_TEXT;
|
||||
}
|
||||
break;
|
||||
|
||||
case DT_END_COMMENT:
|
||||
|
||||
/* End comment if this char is a slash */
|
||||
|
||||
switch (c)
|
||||
{
|
||||
case '/':
|
||||
State = DT_NORMAL_TEXT;
|
||||
break;
|
||||
|
||||
case '\n':
|
||||
CurrentLineOffset = Gbl_NextLineOffset;
|
||||
Gbl_NextLineOffset = (UINT32) ftell (Handle);
|
||||
Gbl_CurrentLineNumber++;
|
||||
break;
|
||||
|
||||
case '*':
|
||||
/* Consume all adjacent asterisks */
|
||||
break;
|
||||
|
||||
default:
|
||||
State = DT_SLASH_ASTERISK_COMMENT;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case DT_MERGE_LINES:
|
||||
|
||||
if (c != '\n')
|
||||
{
|
||||
/*
|
||||
* This is not a continuation backslash, it is a normal
|
||||
* normal ASL backslash - for example: Scope(\_SB_)
|
||||
*/
|
||||
i++; /* Keep the backslash that is already in the buffer */
|
||||
|
||||
ungetc (c, Handle);
|
||||
State = DT_NORMAL_TEXT;
|
||||
}
|
||||
else
|
||||
{
|
||||
/*
|
||||
* This is a continuation line -- a backlash followed
|
||||
* immediately by a newline. Insert a space between the
|
||||
* lines (overwrite the backslash)
|
||||
*/
|
||||
Gbl_CurrentLineBuffer[i] = ' ';
|
||||
i++;
|
||||
|
||||
/* Ignore newline, this will merge the lines */
|
||||
|
||||
CurrentLineOffset = Gbl_NextLineOffset;
|
||||
Gbl_NextLineOffset = (UINT32) ftell (Handle);
|
||||
Gbl_CurrentLineNumber++;
|
||||
State = DT_NORMAL_TEXT;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
DtFatal (ASL_MSG_COMPILER_INTERNAL, NULL, "Unknown input state");
|
||||
return (ASL_EOF);
|
||||
}
|
||||
}
|
||||
|
||||
printf ("ERROR - Input line is too long (max %u)\n", ASL_LINE_BUFFER_SIZE);
|
||||
return (ASL_EOF);
|
||||
}
|
||||
|
||||
|
||||
|
@ -423,7 +718,7 @@ DtParseLine (
|
|||
*
|
||||
* RETURN: Pointer to start of the constructed parse tree.
|
||||
*
|
||||
* DESCRIPTION: Scan source file, link all field name and value
|
||||
* DESCRIPTION: Scan source file, link all field names and values
|
||||
* to the global parse tree: Gbl_FieldList
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
@ -432,23 +727,58 @@ DT_FIELD *
|
|||
DtScanFile (
|
||||
FILE *Handle)
|
||||
{
|
||||
UINT32 Line = 0;
|
||||
UINT32 Offset = 0;
|
||||
ACPI_STATUS Status;
|
||||
UINT32 Offset;
|
||||
DT_FIELD *Next;
|
||||
|
||||
|
||||
ACPI_FUNCTION_NAME (DtScanFile);
|
||||
|
||||
|
||||
/* Get the file size */
|
||||
|
||||
Gbl_InputByteCount = DtGetFileSize (Handle);
|
||||
|
||||
Gbl_CurrentLineNumber = 0;
|
||||
Gbl_CurrentLineOffset = 0;
|
||||
Gbl_NextLineOffset = 0;
|
||||
|
||||
/* Scan line-by-line */
|
||||
|
||||
while (fgets (Gbl_CurrentLineBuffer, ASL_LINE_BUFFER_SIZE, Handle))
|
||||
while ((Offset = DtGetNextLine (Handle)) != ASL_EOF)
|
||||
{
|
||||
Line++;
|
||||
Gbl_CurrentLineNumber++;
|
||||
DtParseLine (Gbl_CurrentLineBuffer, Line, Offset);
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_PARSE, "Line %2.2u/%4.4X - %s",
|
||||
Gbl_CurrentLineNumber, Offset, Gbl_CurrentLineBuffer));
|
||||
|
||||
Offset = (UINT32) ftell (Handle);
|
||||
Status = DtParseLine (Gbl_CurrentLineBuffer, Gbl_CurrentLineNumber, Offset);
|
||||
if (Status == AE_NOT_FOUND)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* Dump the parse tree if debug enabled */
|
||||
|
||||
if (Gbl_DebugFlag)
|
||||
{
|
||||
Next = Gbl_FieldList;
|
||||
DbgPrint (ASL_DEBUG_OUTPUT, "Tree: %32s %32s %8s %8s %8s %8s %8s %8s\n\n",
|
||||
"Name", "Value", "Line", "ByteOff", "NameCol", "Column", "TableOff", "Flags");
|
||||
|
||||
while (Next)
|
||||
{
|
||||
DbgPrint (ASL_DEBUG_OUTPUT, "Field: %32.32s %32.32s %.8X %.8X %.8X %.8X %.8X %.8X\n",
|
||||
Next->Name,
|
||||
Next->Value,
|
||||
Next->Line,
|
||||
Next->ByteOffset,
|
||||
Next->NameColumn,
|
||||
Next->Column,
|
||||
Next->TableOffset,
|
||||
Next->Flags);
|
||||
|
||||
Next = Next->Next;
|
||||
}
|
||||
}
|
||||
|
||||
return (Gbl_FieldList);
|
||||
|
@ -459,7 +789,6 @@ DtScanFile (
|
|||
* Output functions
|
||||
*/
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* FUNCTION: DtWriteBinary
|
||||
|
@ -510,3 +839,197 @@ DtOutputBinary (
|
|||
DtWalkTableTree (RootTable, DtWriteBinary, NULL, NULL);
|
||||
Gbl_TableLength = DtGetFileSize (Gbl_Files[ASL_FILE_AML_OUTPUT].Handle);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Listing support
|
||||
*/
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* FUNCTION: DtDumpBuffer
|
||||
*
|
||||
* PARAMETERS: FileID - Where to write buffer data
|
||||
* Buffer - Buffer to dump
|
||||
* Offset - Offset in current table
|
||||
* Length - Buffer Length
|
||||
*
|
||||
* RETURN: None
|
||||
*
|
||||
* DESCRIPTION: Another copy of DumpBuffer routine (unfortunately).
|
||||
*
|
||||
* TBD: merge dump buffer routines
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
static void
|
||||
DtDumpBuffer (
|
||||
UINT32 FileId,
|
||||
UINT8 *Buffer,
|
||||
UINT32 Offset,
|
||||
UINT32 Length)
|
||||
{
|
||||
UINT32 i;
|
||||
UINT32 j;
|
||||
UINT8 BufChar;
|
||||
|
||||
|
||||
FlPrintFile (FileId, "Output: [%3.3Xh %4.4d %3d] ",
|
||||
Offset, Offset, Length);
|
||||
|
||||
i = 0;
|
||||
while (i < Length)
|
||||
{
|
||||
if (i >= 16)
|
||||
{
|
||||
FlPrintFile (FileId, "%24s", "");
|
||||
}
|
||||
|
||||
/* Print 16 hex chars */
|
||||
|
||||
for (j = 0; j < 16;)
|
||||
{
|
||||
if (i + j >= Length)
|
||||
{
|
||||
/* Dump fill spaces */
|
||||
|
||||
FlPrintFile (FileId, " ");
|
||||
j++;
|
||||
continue;
|
||||
}
|
||||
|
||||
FlPrintFile (FileId, "%02X ", Buffer[i+j]);
|
||||
j++;
|
||||
}
|
||||
|
||||
FlPrintFile (FileId, " ");
|
||||
for (j = 0; j < 16; j++)
|
||||
{
|
||||
if (i + j >= Length)
|
||||
{
|
||||
FlPrintFile (FileId, "\n\n");
|
||||
return;
|
||||
}
|
||||
|
||||
BufChar = Buffer[(ACPI_SIZE) i + j];
|
||||
if (ACPI_IS_PRINT (BufChar))
|
||||
{
|
||||
FlPrintFile (FileId, "%c", BufChar);
|
||||
}
|
||||
else
|
||||
{
|
||||
FlPrintFile (FileId, ".");
|
||||
}
|
||||
}
|
||||
|
||||
/* Done with that line. */
|
||||
|
||||
FlPrintFile (FileId, "\n");
|
||||
i += 16;
|
||||
}
|
||||
|
||||
FlPrintFile (FileId, "\n\n");
|
||||
}
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* FUNCTION: DtWriteFieldToListing
|
||||
*
|
||||
* PARAMETERS: Buffer - Contains the compiled data
|
||||
* Field - Field node for the input line
|
||||
* Length - Length of the output data
|
||||
*
|
||||
* RETURN: None
|
||||
*
|
||||
* DESCRIPTION: Write one field to the listing file (if listing is enabled).
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
void
|
||||
DtWriteFieldToListing (
|
||||
UINT8 *Buffer,
|
||||
DT_FIELD *Field,
|
||||
UINT32 Length)
|
||||
{
|
||||
UINT8 FileByte;
|
||||
|
||||
|
||||
if (!Gbl_ListingFlag || !Field)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
/* Dump the original source line */
|
||||
|
||||
FlPrintFile (ASL_FILE_LISTING_OUTPUT, "Input: ");
|
||||
FlSeekFile (ASL_FILE_INPUT, Field->ByteOffset);
|
||||
|
||||
while (FlReadFile (ASL_FILE_INPUT, &FileByte, 1) == AE_OK)
|
||||
{
|
||||
FlWriteFile (ASL_FILE_LISTING_OUTPUT, &FileByte, 1);
|
||||
if (FileByte == '\n')
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* Dump the line as parsed and represented internally */
|
||||
|
||||
FlPrintFile (ASL_FILE_LISTING_OUTPUT, "Parsed: %*s : %.64s",
|
||||
Field->Column-4, Field->Name, Field->Value);
|
||||
|
||||
if (strlen (Field->Value) > 64)
|
||||
{
|
||||
FlPrintFile (ASL_FILE_LISTING_OUTPUT, "...Additional data, length 0x%X\n",
|
||||
strlen (Field->Value));
|
||||
}
|
||||
FlPrintFile (ASL_FILE_LISTING_OUTPUT, "\n");
|
||||
|
||||
/* Dump the hex data that will be output for this field */
|
||||
|
||||
DtDumpBuffer (ASL_FILE_LISTING_OUTPUT, Buffer, Field->TableOffset, Length);
|
||||
}
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* FUNCTION: DtWriteTableToListing
|
||||
*
|
||||
* PARAMETERS: None
|
||||
*
|
||||
* RETURN: None
|
||||
*
|
||||
* DESCRIPTION: Write the entire compiled table to the listing file
|
||||
* in hex format
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
void
|
||||
DtWriteTableToListing (
|
||||
void)
|
||||
{
|
||||
UINT8 *Buffer;
|
||||
|
||||
|
||||
if (!Gbl_ListingFlag)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
/* Read the entire table from the output file */
|
||||
|
||||
Buffer = UtLocalCalloc (Gbl_TableLength);
|
||||
FlSeekFile (ASL_FILE_AML_OUTPUT, 0);
|
||||
FlReadFile (ASL_FILE_AML_OUTPUT, Buffer, Gbl_TableLength);
|
||||
|
||||
/* Dump the raw table data */
|
||||
|
||||
AcpiOsRedirectOutput (Gbl_Files[ASL_FILE_LISTING_OUTPUT].Handle);
|
||||
|
||||
AcpiOsPrintf ("\n%s: Length %d (0x%X)\n\n",
|
||||
ACPI_RAW_TABLE_DATA_HEADER, Gbl_TableLength, Gbl_TableLength);
|
||||
AcpiUtDumpBuffer2 (Buffer, Gbl_TableLength, DB_BYTE_DISPLAY);
|
||||
|
||||
AcpiOsRedirectOutput (stdout);
|
||||
}
|
||||
|
|
|
@ -0,0 +1,205 @@
|
|||
%{
|
||||
/******************************************************************************
|
||||
*
|
||||
* Module Name: dtparser.l - Flex input file for table compiler lexer
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
*
|
||||
* 2.1. This is your license from Intel Corp. under its intellectual property
|
||||
* rights. You may have additional license terms from the party that provided
|
||||
* you this software, covering your right to use that party's intellectual
|
||||
* property rights.
|
||||
*
|
||||
* 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
|
||||
* copy of the source code appearing in this file ("Covered Code") an
|
||||
* irrevocable, perpetual, worldwide license under Intel's copyrights in the
|
||||
* base code distributed originally by Intel ("Original Intel Code") to copy,
|
||||
* make derivatives, distribute, use and display any portion of the Covered
|
||||
* Code in any form, with the right to sublicense such rights; and
|
||||
*
|
||||
* 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
|
||||
* license (with the right to sublicense), under only those claims of Intel
|
||||
* patents that are infringed by the Original Intel Code, to make, use, sell,
|
||||
* offer to sell, and import the Covered Code and derivative works thereof
|
||||
* solely to the minimum extent necessary to exercise the above copyright
|
||||
* license, and in no event shall the patent license extend to any additions
|
||||
* to or modifications of the Original Intel Code. No other license or right
|
||||
* is granted directly or by implication, estoppel or otherwise;
|
||||
*
|
||||
* The above copyright and patent license is granted only if the following
|
||||
* conditions are met:
|
||||
*
|
||||
* 3. Conditions
|
||||
*
|
||||
* 3.1. Redistribution of Source with Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification with rights to further distribute source must include
|
||||
* the above Copyright Notice, the above License, this list of Conditions,
|
||||
* and the following Disclaimer and Export Compliance provision. In addition,
|
||||
* Licensee must cause all Covered Code to which Licensee contributes to
|
||||
* contain a file documenting the changes Licensee made to create that Covered
|
||||
* Code and the date of any change. Licensee must include in that file the
|
||||
* documentation of any changes made by any predecessor Licensee. Licensee
|
||||
* must include a prominent statement that the modification is derived,
|
||||
* directly or indirectly, from Original Intel Code.
|
||||
*
|
||||
* 3.2. Redistribution of Source with no Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification without rights to further distribute source must
|
||||
* include the following Disclaimer and Export Compliance provision in the
|
||||
* documentation and/or other materials provided with distribution. In
|
||||
* addition, Licensee may not authorize further sublicense of source of any
|
||||
* portion of the Covered Code, and must include terms to the effect that the
|
||||
* license from Licensee to its licensee is limited to the intellectual
|
||||
* property embodied in the software Licensee provides to its licensee, and
|
||||
* not to intellectual property embodied in modifications its licensee may
|
||||
* make.
|
||||
*
|
||||
* 3.3. Redistribution of Executable. Redistribution in executable form of any
|
||||
* substantial portion of the Covered Code or modification must reproduce the
|
||||
* above Copyright Notice, and the following Disclaimer and Export Compliance
|
||||
* provision in the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* 3.4. Intel retains all right, title, and interest in and to the Original
|
||||
* Intel Code.
|
||||
*
|
||||
* 3.5. Neither the name Intel nor any other trademark owned or controlled by
|
||||
* Intel shall be used in advertising or otherwise to promote the sale, use or
|
||||
* other dealings in products derived from or relating to the Covered Code
|
||||
* without prior written authorization from Intel.
|
||||
*
|
||||
* 4. Disclaimer and Export Compliance
|
||||
*
|
||||
* 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
|
||||
* HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
|
||||
* IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
|
||||
* INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
|
||||
* UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
|
||||
* PARTICULAR PURPOSE.
|
||||
*
|
||||
* 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
|
||||
* OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
|
||||
* COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
|
||||
* SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
|
||||
* CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
|
||||
* HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
|
||||
* SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
|
||||
* LIMITED REMEDY.
|
||||
*
|
||||
* 4.3. Licensee shall not export, either directly or indirectly, any of this
|
||||
* software or system incorporating such software without first obtaining any
|
||||
* required license or other approval from the U. S. Department of Commerce or
|
||||
* any other agency or department of the United States Government. In the
|
||||
* event Licensee exports any such software from the United States or
|
||||
* re-exports any such software from a foreign destination, Licensee shall
|
||||
* ensure that the distribution and export/re-export of the software is in
|
||||
* compliance with all laws, regulations, orders, or other restrictions of the
|
||||
* U.S. Export Administration Regulations. Licensee agrees that neither it nor
|
||||
* any of its subsidiaries will export/re-export any technical data, process,
|
||||
* software, or service, directly or indirectly, to any country for which the
|
||||
* United States government or any agency thereof requires an export license,
|
||||
* other governmental approval, or letter of assurance, without first obtaining
|
||||
* such license, approval or letter.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
#include "aslcompiler.h"
|
||||
#include "dtparser.y.h"
|
||||
|
||||
#define YY_NO_INPUT /* No file input, we use strings only */
|
||||
|
||||
#define _COMPONENT ACPI_COMPILER
|
||||
ACPI_MODULE_NAME ("dtscanner")
|
||||
%}
|
||||
|
||||
%option noyywrap
|
||||
%option nounput
|
||||
|
||||
Number [0-9a-fA-F]+
|
||||
HexNumber 0[xX][0-9a-fA-F]+
|
||||
DecimalNumber 0[dD][0-9]+
|
||||
LabelRef $[a-zA-Z][0-9a-zA-Z]*
|
||||
WhiteSpace [ \t\v\r]+
|
||||
NewLine [\n]
|
||||
|
||||
%%
|
||||
|
||||
\( return (EXPOP_PAREN_OPEN);
|
||||
\) return (EXPOP_PAREN_CLOSE);
|
||||
\~ return (EXPOP_ONES_COMPLIMENT);
|
||||
\! return (EXPOP_LOGICAL_NOT);
|
||||
\* return (EXPOP_MULTIPLY);
|
||||
\/ return (EXPOP_DIVIDE);
|
||||
\% return (EXPOP_MODULO);
|
||||
\+ return (EXPOP_ADD);
|
||||
\- return (EXPOP_SUBTRACT);
|
||||
">>" return (EXPOP_SHIFT_RIGHT);
|
||||
"<<" return (EXPOP_SHIFT_LEFT);
|
||||
\< return (EXPOP_LESS);
|
||||
\> return (EXPOP_GREATER);
|
||||
"<=" return (EXPOP_LESS_EQUAL);
|
||||
">=" return (EXPOP_GREATER_EQUAL);
|
||||
"==" return (EXPOP_EQUAL);
|
||||
"!=" return (EXPOP_NOT_EQUAL);
|
||||
\& return (EXPOP_AND);
|
||||
\^ return (EXPOP_XOR);
|
||||
\| return (EXPOP_OR);
|
||||
"&&" return (EXPOP_LOGICAL_AND);
|
||||
"||" return (EXPOP_LOGICAL_OR);
|
||||
<<EOF>> return (EXPOP_EOF); /* null end-of-string */
|
||||
|
||||
{LabelRef} return (EXPOP_LABEL);
|
||||
{Number} return (EXPOP_NUMBER);
|
||||
{HexNumber} return (EXPOP_HEX_NUMBER);
|
||||
{NewLine} return (EXPOP_NEW_LINE);
|
||||
{WhiteSpace} /* Ignore */
|
||||
|
||||
. return (EXPOP_EOF);
|
||||
|
||||
%%
|
||||
|
||||
/*
|
||||
* Local support functions
|
||||
*/
|
||||
YY_BUFFER_STATE LexBuffer;
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* FUNCTION: DtInitLexer, DtTerminateLexer
|
||||
*
|
||||
* PARAMETERS: String - Input string to be parsed
|
||||
*
|
||||
* RETURN: None
|
||||
*
|
||||
* DESCRIPTION: Initialization and termination routines for lexer. Lexer needs
|
||||
* a buffer to handle strings instead of a file.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
int
|
||||
DtInitLexer (
|
||||
char *String)
|
||||
{
|
||||
|
||||
LexBuffer = yy_scan_string (String);
|
||||
return (LexBuffer == NULL);
|
||||
}
|
||||
|
||||
void
|
||||
DtTerminateLexer (
|
||||
void)
|
||||
{
|
||||
|
||||
yy_delete_buffer (LexBuffer);
|
||||
}
|
|
@ -0,0 +1,345 @@
|
|||
%{
|
||||
/******************************************************************************
|
||||
*
|
||||
* Module Name: dtparser.y - Bison input file for table compiler parser
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
*
|
||||
* 2.1. This is your license from Intel Corp. under its intellectual property
|
||||
* rights. You may have additional license terms from the party that provided
|
||||
* you this software, covering your right to use that party's intellectual
|
||||
* property rights.
|
||||
*
|
||||
* 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
|
||||
* copy of the source code appearing in this file ("Covered Code") an
|
||||
* irrevocable, perpetual, worldwide license under Intel's copyrights in the
|
||||
* base code distributed originally by Intel ("Original Intel Code") to copy,
|
||||
* make derivatives, distribute, use and display any portion of the Covered
|
||||
* Code in any form, with the right to sublicense such rights; and
|
||||
*
|
||||
* 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
|
||||
* license (with the right to sublicense), under only those claims of Intel
|
||||
* patents that are infringed by the Original Intel Code, to make, use, sell,
|
||||
* offer to sell, and import the Covered Code and derivative works thereof
|
||||
* solely to the minimum extent necessary to exercise the above copyright
|
||||
* license, and in no event shall the patent license extend to any additions
|
||||
* to or modifications of the Original Intel Code. No other license or right
|
||||
* is granted directly or by implication, estoppel or otherwise;
|
||||
*
|
||||
* The above copyright and patent license is granted only if the following
|
||||
* conditions are met:
|
||||
*
|
||||
* 3. Conditions
|
||||
*
|
||||
* 3.1. Redistribution of Source with Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification with rights to further distribute source must include
|
||||
* the above Copyright Notice, the above License, this list of Conditions,
|
||||
* and the following Disclaimer and Export Compliance provision. In addition,
|
||||
* Licensee must cause all Covered Code to which Licensee contributes to
|
||||
* contain a file documenting the changes Licensee made to create that Covered
|
||||
* Code and the date of any change. Licensee must include in that file the
|
||||
* documentation of any changes made by any predecessor Licensee. Licensee
|
||||
* must include a prominent statement that the modification is derived,
|
||||
* directly or indirectly, from Original Intel Code.
|
||||
*
|
||||
* 3.2. Redistribution of Source with no Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification without rights to further distribute source must
|
||||
* include the following Disclaimer and Export Compliance provision in the
|
||||
* documentation and/or other materials provided with distribution. In
|
||||
* addition, Licensee may not authorize further sublicense of source of any
|
||||
* portion of the Covered Code, and must include terms to the effect that the
|
||||
* license from Licensee to its licensee is limited to the intellectual
|
||||
* property embodied in the software Licensee provides to its licensee, and
|
||||
* not to intellectual property embodied in modifications its licensee may
|
||||
* make.
|
||||
*
|
||||
* 3.3. Redistribution of Executable. Redistribution in executable form of any
|
||||
* substantial portion of the Covered Code or modification must reproduce the
|
||||
* above Copyright Notice, and the following Disclaimer and Export Compliance
|
||||
* provision in the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* 3.4. Intel retains all right, title, and interest in and to the Original
|
||||
* Intel Code.
|
||||
*
|
||||
* 3.5. Neither the name Intel nor any other trademark owned or controlled by
|
||||
* Intel shall be used in advertising or otherwise to promote the sale, use or
|
||||
* other dealings in products derived from or relating to the Covered Code
|
||||
* without prior written authorization from Intel.
|
||||
*
|
||||
* 4. Disclaimer and Export Compliance
|
||||
*
|
||||
* 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
|
||||
* HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
|
||||
* IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
|
||||
* INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
|
||||
* UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
|
||||
* PARTICULAR PURPOSE.
|
||||
*
|
||||
* 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
|
||||
* OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
|
||||
* COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
|
||||
* SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
|
||||
* CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
|
||||
* HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
|
||||
* SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
|
||||
* LIMITED REMEDY.
|
||||
*
|
||||
* 4.3. Licensee shall not export, either directly or indirectly, any of this
|
||||
* software or system incorporating such software without first obtaining any
|
||||
* required license or other approval from the U. S. Department of Commerce or
|
||||
* any other agency or department of the United States Government. In the
|
||||
* event Licensee exports any such software from the United States or
|
||||
* re-exports any such software from a foreign destination, Licensee shall
|
||||
* ensure that the distribution and export/re-export of the software is in
|
||||
* compliance with all laws, regulations, orders, or other restrictions of the
|
||||
* U.S. Export Administration Regulations. Licensee agrees that neither it nor
|
||||
* any of its subsidiaries will export/re-export any technical data, process,
|
||||
* software, or service, directly or indirectly, to any country for which the
|
||||
* United States government or any agency thereof requires an export license,
|
||||
* other governmental approval, or letter of assurance, without first obtaining
|
||||
* such license, approval or letter.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
#include "aslcompiler.h"
|
||||
#include "dtcompiler.h"
|
||||
|
||||
#define _COMPONENT DT_COMPILER
|
||||
ACPI_MODULE_NAME ("dtparser")
|
||||
|
||||
int DtParserlex (void);
|
||||
int DtParserparse (void);
|
||||
void DtParsererror (char const *msg);
|
||||
extern char *DtParsertext;
|
||||
extern DT_FIELD *Gbl_CurrentField;
|
||||
|
||||
UINT64 DtParserResult; /* Expression return value */
|
||||
|
||||
/* Bison/yacc configuration */
|
||||
|
||||
#define yytname DtParsername
|
||||
#define YYDEBUG 1 /* Enable debug output */
|
||||
#define YYERROR_VERBOSE 1 /* Verbose error messages */
|
||||
#define YYFLAG -32768
|
||||
|
||||
%}
|
||||
|
||||
%union
|
||||
{
|
||||
UINT64 value;
|
||||
UINT32 op;
|
||||
}
|
||||
|
||||
/*! [Begin] no source code translation */
|
||||
|
||||
%type <value> Expression
|
||||
|
||||
%token <op> EXPOP_EOF
|
||||
%token <op> EXPOP_NEW_LINE
|
||||
%token <op> EXPOP_NUMBER
|
||||
%token <op> EXPOP_HEX_NUMBER
|
||||
%token <op> EXPOP_DECIMAL_NUMBER
|
||||
%token <op> EXPOP_LABEL
|
||||
%token <op> EXPOP_PAREN_OPEN
|
||||
%token <op> EXPOP_PAREN_CLOSE
|
||||
|
||||
%left <op> EXPOP_LOGICAL_OR
|
||||
%left <op> EXPOP_LOGICAL_AND
|
||||
%left <op> EXPOP_OR
|
||||
%left <op> EXPOP_XOR
|
||||
%left <op> EXPOP_AND
|
||||
%left <op> EXPOP_EQUAL EXPOP_NOT_EQUAL
|
||||
%left <op> EXPOP_GREATER EXPOP_LESS EXPOP_GREATER_EQUAL EXPOP_LESS_EQUAL
|
||||
%left <op> EXPOP_SHIFT_RIGHT EXPOP_SHIFT_LEFT
|
||||
%left <op> EXPOP_ADD EXPOP_SUBTRACT
|
||||
%left <op> EXPOP_MULTIPLY EXPOP_DIVIDE EXPOP_MODULO
|
||||
%right <op> EXPOP_ONES_COMPLIMENT EXPOP_LOGICAL_NOT
|
||||
|
||||
%%
|
||||
|
||||
/*
|
||||
* Operator precedence rules (from K&R)
|
||||
*
|
||||
* 1) ( )
|
||||
* 2) ! ~ (unary operators that are supported here)
|
||||
* 3) * / %
|
||||
* 4) + -
|
||||
* 5) >> <<
|
||||
* 6) < > <= >=
|
||||
* 7) == !=
|
||||
* 8) &
|
||||
* 9) ^
|
||||
* 10) |
|
||||
* 11) &&
|
||||
* 12) ||
|
||||
*/
|
||||
Value
|
||||
: Expression EXPOP_NEW_LINE { DtParserResult=$1; return 0; } /* End of line (newline) */
|
||||
| Expression EXPOP_EOF { DtParserResult=$1; return 0; } /* End of string (0) */
|
||||
;
|
||||
|
||||
Expression
|
||||
|
||||
/* Unary operators */
|
||||
|
||||
: EXPOP_LOGICAL_NOT Expression { $$ = DtDoOperator ($2, EXPOP_LOGICAL_NOT, $2);}
|
||||
| EXPOP_ONES_COMPLIMENT Expression { $$ = DtDoOperator ($2, EXPOP_ONES_COMPLIMENT, $2);}
|
||||
|
||||
/* Binary operators */
|
||||
|
||||
| Expression EXPOP_MULTIPLY Expression { $$ = DtDoOperator ($1, EXPOP_MULTIPLY, $3);}
|
||||
| Expression EXPOP_DIVIDE Expression { $$ = DtDoOperator ($1, EXPOP_DIVIDE, $3);}
|
||||
| Expression EXPOP_MODULO Expression { $$ = DtDoOperator ($1, EXPOP_MODULO, $3);}
|
||||
| Expression EXPOP_ADD Expression { $$ = DtDoOperator ($1, EXPOP_ADD, $3);}
|
||||
| Expression EXPOP_SUBTRACT Expression { $$ = DtDoOperator ($1, EXPOP_SUBTRACT, $3);}
|
||||
| Expression EXPOP_SHIFT_RIGHT Expression { $$ = DtDoOperator ($1, EXPOP_SHIFT_RIGHT, $3);}
|
||||
| Expression EXPOP_SHIFT_LEFT Expression { $$ = DtDoOperator ($1, EXPOP_SHIFT_LEFT, $3);}
|
||||
| Expression EXPOP_GREATER Expression { $$ = DtDoOperator ($1, EXPOP_GREATER, $3);}
|
||||
| Expression EXPOP_LESS Expression { $$ = DtDoOperator ($1, EXPOP_LESS, $3);}
|
||||
| Expression EXPOP_GREATER_EQUAL Expression { $$ = DtDoOperator ($1, EXPOP_GREATER_EQUAL, $3);}
|
||||
| Expression EXPOP_LESS_EQUAL Expression { $$ = DtDoOperator ($1, EXPOP_LESS_EQUAL, $3);}
|
||||
| Expression EXPOP_EQUAL Expression { $$ = DtDoOperator ($1, EXPOP_EQUAL, $3);}
|
||||
| Expression EXPOP_NOT_EQUAL Expression { $$ = DtDoOperator ($1, EXPOP_NOT_EQUAL, $3);}
|
||||
| Expression EXPOP_AND Expression { $$ = DtDoOperator ($1, EXPOP_AND, $3);}
|
||||
| Expression EXPOP_XOR Expression { $$ = DtDoOperator ($1, EXPOP_XOR, $3);}
|
||||
| Expression EXPOP_OR Expression { $$ = DtDoOperator ($1, EXPOP_OR, $3);}
|
||||
| Expression EXPOP_LOGICAL_AND Expression { $$ = DtDoOperator ($1, EXPOP_LOGICAL_AND, $3);}
|
||||
| Expression EXPOP_LOGICAL_OR Expression { $$ = DtDoOperator ($1, EXPOP_LOGICAL_OR, $3);}
|
||||
|
||||
/* Parentheses: '(' Expression ')' */
|
||||
|
||||
| EXPOP_PAREN_OPEN Expression
|
||||
EXPOP_PAREN_CLOSE { $$ = $2;}
|
||||
|
||||
/* Label references (prefixed with $) */
|
||||
|
||||
| EXPOP_LABEL { $$ = DtResolveLabel (DtParsertext);}
|
||||
|
||||
/* Default base for a non-prefixed integer is 16 */
|
||||
|
||||
| EXPOP_NUMBER { UtStrtoul64 (DtParsertext, 16, &$$);}
|
||||
|
||||
/* Standard hex number (0x1234) */
|
||||
|
||||
| EXPOP_HEX_NUMBER { UtStrtoul64 (DtParsertext, 16, &$$);}
|
||||
|
||||
/* TBD: Decimal number with prefix (0d1234) - Not supported by UtStrtoul64 at this time */
|
||||
|
||||
| EXPOP_DECIMAL_NUMBER { UtStrtoul64 (DtParsertext, 10, &$$);}
|
||||
;
|
||||
%%
|
||||
|
||||
/*! [End] no source code translation !*/
|
||||
|
||||
/*
|
||||
* Local support functions, including parser entry point
|
||||
*/
|
||||
#define PR_FIRST_PARSE_OPCODE EXPOP_EOF
|
||||
#define PR_YYTNAME_START 3
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* FUNCTION: DtParsererror
|
||||
*
|
||||
* PARAMETERS: Message - Parser-generated error message
|
||||
*
|
||||
* RETURN: None
|
||||
*
|
||||
* DESCRIPTION: Handler for parser errors
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
void
|
||||
DtParsererror (
|
||||
char const *Message)
|
||||
{
|
||||
DtError (ASL_ERROR, ASL_MSG_SYNTAX,
|
||||
Gbl_CurrentField, (char *) Message);
|
||||
}
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* FUNCTION: DtGetOpName
|
||||
*
|
||||
* PARAMETERS: ParseOpcode - Parser token (EXPOP_*)
|
||||
*
|
||||
* RETURN: Pointer to the opcode name
|
||||
*
|
||||
* DESCRIPTION: Get the ascii name of the parse opcode for debug output
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
char *
|
||||
DtGetOpName (
|
||||
UINT32 ParseOpcode)
|
||||
{
|
||||
#ifdef ASL_YYTNAME_START
|
||||
/*
|
||||
* First entries (PR_YYTNAME_START) in yytname are special reserved names.
|
||||
* Ignore first 6 characters of name (EXPOP_)
|
||||
*/
|
||||
return ((char *) yytname
|
||||
[(ParseOpcode - PR_FIRST_PARSE_OPCODE) + PR_YYTNAME_START] + 6);
|
||||
#else
|
||||
return ("[Unknown parser generator]");
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* FUNCTION: DtEvaluateExpression
|
||||
*
|
||||
* PARAMETERS: ExprString - Expression to be evaluated. Must be
|
||||
* terminated by either a newline or a NUL
|
||||
* string terminator
|
||||
*
|
||||
* RETURN: 64-bit value for the expression
|
||||
*
|
||||
* DESCRIPTION: Main entry point for the DT expression parser
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
UINT64
|
||||
DtEvaluateExpression (
|
||||
char *ExprString)
|
||||
{
|
||||
|
||||
DbgPrint (ASL_DEBUG_OUTPUT,
|
||||
"**** Input expression: %s (Base 16)\n", ExprString);
|
||||
|
||||
/* Point lexer to the input string */
|
||||
|
||||
if (DtInitLexer (ExprString))
|
||||
{
|
||||
DtError (ASL_ERROR, ASL_MSG_COMPILER_INTERNAL,
|
||||
Gbl_CurrentField, "Could not initialize lexer");
|
||||
return (0);
|
||||
}
|
||||
|
||||
/* Parse/Evaluate the input string (value returned in DtParserResult) */
|
||||
|
||||
DtParserparse ();
|
||||
DtTerminateLexer ();
|
||||
|
||||
DbgPrint (ASL_DEBUG_OUTPUT,
|
||||
"**** Parser returned value: %u (%8.8X%8.8X)\n",
|
||||
(UINT32) DtParserResult, ACPI_FORMAT_UINT64 (DtParserResult));
|
||||
|
||||
return (DtParserResult);
|
||||
}
|
|
@ -8,7 +8,7 @@
|
|||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
|
@ -360,16 +360,58 @@ DtGetSubtableLength (
|
|||
ACPI_DMTABLE_INFO *Info)
|
||||
{
|
||||
UINT32 ByteLength = 0;
|
||||
UINT8 Step;
|
||||
UINT8 i;
|
||||
|
||||
|
||||
/* Walk entire Info table; Null name terminates */
|
||||
|
||||
for (; Info->Name; Info++)
|
||||
{
|
||||
if (!Field)
|
||||
{
|
||||
goto Error;
|
||||
}
|
||||
|
||||
ByteLength += DtGetFieldLength (Field, Info);
|
||||
|
||||
switch (Info->Opcode)
|
||||
{
|
||||
case ACPI_DMT_GAS:
|
||||
Step = 5;
|
||||
break;
|
||||
|
||||
case ACPI_DMT_HESTNTFY:
|
||||
Step = 9;
|
||||
break;
|
||||
|
||||
default:
|
||||
Step = 1;
|
||||
break;
|
||||
}
|
||||
|
||||
for (i = 0; i < Step; i++)
|
||||
{
|
||||
if (!Field)
|
||||
{
|
||||
goto Error;
|
||||
}
|
||||
|
||||
Field = Field->Next;
|
||||
}
|
||||
}
|
||||
|
||||
return (ByteLength);
|
||||
|
||||
Error:
|
||||
if (!Field)
|
||||
{
|
||||
sprintf (MsgBuffer, "Found NULL field - Field name \"%s\" needed",
|
||||
Info->Name);
|
||||
DtFatal (ASL_MSG_COMPILER_INTERNAL, NULL, MsgBuffer);
|
||||
}
|
||||
|
||||
return (ASL_EOF);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
|
@ -264,10 +264,13 @@ DtCompileRsdp (
|
|||
DT_FIELD **PFieldList)
|
||||
{
|
||||
DT_SUBTABLE *Subtable;
|
||||
ACPI_TABLE_RSDP *Table;
|
||||
ACPI_TABLE_RSDP *Rsdp;
|
||||
ACPI_RSDP_EXTENSION *RsdpExtension;
|
||||
ACPI_STATUS Status;
|
||||
|
||||
|
||||
/* Compile the "common" RSDP (ACPI 1.0) */
|
||||
|
||||
Status = DtCompileTable (PFieldList, AcpiDmTableInfoRsdp1,
|
||||
&Gbl_RootTable, TRUE);
|
||||
if (ACPI_FAILURE (Status))
|
||||
|
@ -275,11 +278,13 @@ DtCompileRsdp (
|
|||
return (Status);
|
||||
}
|
||||
|
||||
Table = ACPI_CAST_PTR (ACPI_TABLE_RSDP, Gbl_RootTable->Buffer);
|
||||
DtSetTableChecksum (&Table->Checksum);
|
||||
Rsdp = ACPI_CAST_PTR (ACPI_TABLE_RSDP, Gbl_RootTable->Buffer);
|
||||
DtSetTableChecksum (&Rsdp->Checksum);
|
||||
|
||||
if (Table->Revision > 0)
|
||||
if (Rsdp->Revision > 0)
|
||||
{
|
||||
/* Compile the "extended" part of the RSDP as a subtable */
|
||||
|
||||
Status = DtCompileTable (PFieldList, AcpiDmTableInfoRsdp2,
|
||||
&Subtable, TRUE);
|
||||
if (ACPI_FAILURE (Status))
|
||||
|
@ -288,7 +293,12 @@ DtCompileRsdp (
|
|||
}
|
||||
|
||||
DtInsertSubtable (Gbl_RootTable, Subtable);
|
||||
DtSetTableChecksum (&Table->ExtendedChecksum);
|
||||
|
||||
/* Set length and extended checksum for entire RSDP */
|
||||
|
||||
RsdpExtension = ACPI_CAST_PTR (ACPI_RSDP_EXTENSION, Subtable->Buffer);
|
||||
RsdpExtension->Length = Gbl_RootTable->Length + Subtable->Length;
|
||||
DtSetTableChecksum (&RsdpExtension->ExtendedChecksum);
|
||||
}
|
||||
|
||||
return (AE_OK);
|
||||
|
@ -1194,6 +1204,75 @@ DtCompileRsdt (
|
|||
}
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* FUNCTION: DtCompileSlic
|
||||
*
|
||||
* PARAMETERS: List - Current field list pointer
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Compile SLIC.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
ACPI_STATUS
|
||||
DtCompileSlic (
|
||||
void **List)
|
||||
{
|
||||
ACPI_STATUS Status;
|
||||
DT_SUBTABLE *Subtable;
|
||||
DT_SUBTABLE *ParentTable;
|
||||
DT_FIELD **PFieldList = (DT_FIELD **) List;
|
||||
DT_FIELD *SubtableStart;
|
||||
ACPI_SLIC_HEADER *SlicHeader;
|
||||
ACPI_DMTABLE_INFO *InfoTable;
|
||||
|
||||
|
||||
while (*PFieldList)
|
||||
{
|
||||
SubtableStart = *PFieldList;
|
||||
Status = DtCompileTable (PFieldList, AcpiDmTableInfoSlicHdr,
|
||||
&Subtable, TRUE);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return (Status);
|
||||
}
|
||||
|
||||
ParentTable = DtPeekSubtable ();
|
||||
DtInsertSubtable (ParentTable, Subtable);
|
||||
DtPushSubtable (Subtable);
|
||||
|
||||
SlicHeader = ACPI_CAST_PTR (ACPI_SLIC_HEADER, Subtable->Buffer);
|
||||
|
||||
switch (SlicHeader->Type)
|
||||
{
|
||||
case ACPI_SLIC_TYPE_PUBLIC_KEY:
|
||||
InfoTable = AcpiDmTableInfoSlic0;
|
||||
break;
|
||||
case ACPI_SLIC_TYPE_WINDOWS_MARKER:
|
||||
InfoTable = AcpiDmTableInfoSlic1;
|
||||
break;
|
||||
default:
|
||||
DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "SLIC");
|
||||
return (AE_ERROR);
|
||||
}
|
||||
|
||||
Status = DtCompileTable (PFieldList, InfoTable, &Subtable, TRUE);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return (Status);
|
||||
}
|
||||
|
||||
ParentTable = DtPeekSubtable ();
|
||||
DtInsertSubtable (ParentTable, Subtable);
|
||||
DtPopSubtable ();
|
||||
}
|
||||
|
||||
return (AE_OK);
|
||||
}
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* FUNCTION: DtCompileSlit
|
||||
|
@ -1217,7 +1296,6 @@ DtCompileSlit (
|
|||
DT_FIELD *FieldList;
|
||||
UINT32 Localities;
|
||||
UINT8 *LocalityBuffer;
|
||||
UINT32 RemainingData;
|
||||
|
||||
|
||||
Status = DtCompileTable (PFieldList, AcpiDmTableInfoSlit,
|
||||
|
@ -1233,22 +1311,17 @@ DtCompileSlit (
|
|||
Localities = *ACPI_CAST_PTR (UINT32, Subtable->Buffer);
|
||||
LocalityBuffer = UtLocalCalloc (Localities);
|
||||
|
||||
/* Compile each locality buffer */
|
||||
|
||||
FieldList = *PFieldList;
|
||||
while (FieldList)
|
||||
{
|
||||
/* Handle multiple-line buffer */
|
||||
|
||||
RemainingData = Localities;
|
||||
while (RemainingData && FieldList)
|
||||
{
|
||||
RemainingData = DtCompileBuffer (
|
||||
LocalityBuffer + (Localities - RemainingData),
|
||||
FieldList->Value, FieldList, RemainingData);
|
||||
FieldList = FieldList->Next;
|
||||
}
|
||||
DtCompileBuffer (LocalityBuffer,
|
||||
FieldList->Value, FieldList, Localities);
|
||||
|
||||
DtCreateSubtable (LocalityBuffer, Localities, &Subtable);
|
||||
DtInsertSubtable (ParentTable, Subtable);
|
||||
FieldList = FieldList->Next;
|
||||
}
|
||||
|
||||
ACPI_FREE (LocalityBuffer);
|
||||
|
@ -1338,6 +1411,102 @@ DtCompileSrat (
|
|||
}
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* FUNCTION: DtGetGenericTableInfo
|
||||
*
|
||||
* PARAMETERS: Name - Generic type name
|
||||
*
|
||||
* RETURN: Info entry
|
||||
*
|
||||
* DESCRIPTION: Obtain table info for a generic name entry
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
ACPI_DMTABLE_INFO *
|
||||
DtGetGenericTableInfo (
|
||||
char *Name)
|
||||
{
|
||||
ACPI_DMTABLE_INFO *Info;
|
||||
UINT32 i;
|
||||
|
||||
|
||||
if (!Name)
|
||||
{
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
/* Search info table for name match */
|
||||
|
||||
for (i = 0; ; i++)
|
||||
{
|
||||
Info = AcpiDmTableInfoGeneric[i];
|
||||
if (Info->Opcode == ACPI_DMT_EXIT)
|
||||
{
|
||||
Info = NULL;
|
||||
break;
|
||||
}
|
||||
|
||||
if (!ACPI_STRCMP (Name, Info->Name))
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return (Info);
|
||||
}
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* FUNCTION: DtCompileUefi
|
||||
*
|
||||
* PARAMETERS: List - Current field list pointer
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Compile UEFI.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
ACPI_STATUS
|
||||
DtCompileUefi (
|
||||
void **List)
|
||||
{
|
||||
ACPI_STATUS Status;
|
||||
DT_SUBTABLE *Subtable;
|
||||
DT_SUBTABLE *ParentTable;
|
||||
DT_FIELD **PFieldList = (DT_FIELD **) List;
|
||||
UINT16 *DataOffset;
|
||||
|
||||
|
||||
/* Compile the predefined portion of the UEFI table */
|
||||
|
||||
Status = DtCompileTable (PFieldList, AcpiDmTableInfoUefi,
|
||||
&Subtable, TRUE);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return (Status);
|
||||
}
|
||||
|
||||
DataOffset = (UINT16 *) (Subtable->Buffer + 16);
|
||||
*DataOffset = sizeof (ACPI_TABLE_UEFI);
|
||||
|
||||
ParentTable = DtPeekSubtable ();
|
||||
DtInsertSubtable (ParentTable, Subtable);
|
||||
|
||||
/*
|
||||
* Compile the "generic" portion of the UEFI table. This
|
||||
* part of the table is not predefined and any of the generic
|
||||
* operators may be used.
|
||||
*/
|
||||
|
||||
DtCompileGeneric ((void **) PFieldList);
|
||||
|
||||
return (AE_OK);
|
||||
}
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* FUNCTION: DtCompileWdat
|
||||
|
@ -1397,3 +1566,78 @@ DtCompileXsdt (
|
|||
|
||||
return (AE_OK);
|
||||
}
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* FUNCTION: DtCompileGeneric
|
||||
*
|
||||
* PARAMETERS: List - Current field list pointer
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Compile generic unknown table.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
ACPI_STATUS
|
||||
DtCompileGeneric (
|
||||
void **List)
|
||||
{
|
||||
ACPI_STATUS Status;
|
||||
DT_SUBTABLE *Subtable;
|
||||
DT_SUBTABLE *ParentTable;
|
||||
DT_FIELD **PFieldList = (DT_FIELD **) List;
|
||||
ACPI_DMTABLE_INFO *Info;
|
||||
|
||||
|
||||
ParentTable = DtPeekSubtable ();
|
||||
|
||||
/*
|
||||
* Compile the "generic" portion of the table. This
|
||||
* part of the table is not predefined and any of the generic
|
||||
* operators may be used.
|
||||
*/
|
||||
|
||||
/* Find any and all labels in the entire generic portion */
|
||||
|
||||
DtDetectAllLabels (*PFieldList);
|
||||
|
||||
/* Now we can actually compile the parse tree */
|
||||
|
||||
while (*PFieldList)
|
||||
{
|
||||
Info = DtGetGenericTableInfo ((*PFieldList)->Name);
|
||||
if (!Info)
|
||||
{
|
||||
sprintf (MsgBuffer, "Generic data type \"%s\" not found",
|
||||
(*PFieldList)->Name);
|
||||
DtNameError (ASL_ERROR, ASL_MSG_INVALID_FIELD_NAME,
|
||||
(*PFieldList), MsgBuffer);
|
||||
|
||||
*PFieldList = (*PFieldList)->Next;
|
||||
continue;
|
||||
}
|
||||
|
||||
Status = DtCompileTable (PFieldList, Info,
|
||||
&Subtable, TRUE);
|
||||
if (ACPI_SUCCESS (Status))
|
||||
{
|
||||
DtInsertSubtable (ParentTable, Subtable);
|
||||
}
|
||||
else
|
||||
{
|
||||
*PFieldList = (*PFieldList)->Next;
|
||||
|
||||
if (Status == AE_NOT_FOUND)
|
||||
{
|
||||
sprintf (MsgBuffer, "Generic data type \"%s\" not found",
|
||||
(*PFieldList)->Name);
|
||||
DtNameError (ASL_ERROR, ASL_MSG_INVALID_FIELD_NAME,
|
||||
(*PFieldList), MsgBuffer);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return (AE_OK);
|
||||
}
|
||||
|
|
|
@ -0,0 +1,446 @@
|
|||
/******************************************************************************
|
||||
*
|
||||
* Module Name: dttemplate - ACPI table template generation
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
*
|
||||
* 2.1. This is your license from Intel Corp. under its intellectual property
|
||||
* rights. You may have additional license terms from the party that provided
|
||||
* you this software, covering your right to use that party's intellectual
|
||||
* property rights.
|
||||
*
|
||||
* 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
|
||||
* copy of the source code appearing in this file ("Covered Code") an
|
||||
* irrevocable, perpetual, worldwide license under Intel's copyrights in the
|
||||
* base code distributed originally by Intel ("Original Intel Code") to copy,
|
||||
* make derivatives, distribute, use and display any portion of the Covered
|
||||
* Code in any form, with the right to sublicense such rights; and
|
||||
*
|
||||
* 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
|
||||
* license (with the right to sublicense), under only those claims of Intel
|
||||
* patents that are infringed by the Original Intel Code, to make, use, sell,
|
||||
* offer to sell, and import the Covered Code and derivative works thereof
|
||||
* solely to the minimum extent necessary to exercise the above copyright
|
||||
* license, and in no event shall the patent license extend to any additions
|
||||
* to or modifications of the Original Intel Code. No other license or right
|
||||
* is granted directly or by implication, estoppel or otherwise;
|
||||
*
|
||||
* The above copyright and patent license is granted only if the following
|
||||
* conditions are met:
|
||||
*
|
||||
* 3. Conditions
|
||||
*
|
||||
* 3.1. Redistribution of Source with Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification with rights to further distribute source must include
|
||||
* the above Copyright Notice, the above License, this list of Conditions,
|
||||
* and the following Disclaimer and Export Compliance provision. In addition,
|
||||
* Licensee must cause all Covered Code to which Licensee contributes to
|
||||
* contain a file documenting the changes Licensee made to create that Covered
|
||||
* Code and the date of any change. Licensee must include in that file the
|
||||
* documentation of any changes made by any predecessor Licensee. Licensee
|
||||
* must include a prominent statement that the modification is derived,
|
||||
* directly or indirectly, from Original Intel Code.
|
||||
*
|
||||
* 3.2. Redistribution of Source with no Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification without rights to further distribute source must
|
||||
* include the following Disclaimer and Export Compliance provision in the
|
||||
* documentation and/or other materials provided with distribution. In
|
||||
* addition, Licensee may not authorize further sublicense of source of any
|
||||
* portion of the Covered Code, and must include terms to the effect that the
|
||||
* license from Licensee to its licensee is limited to the intellectual
|
||||
* property embodied in the software Licensee provides to its licensee, and
|
||||
* not to intellectual property embodied in modifications its licensee may
|
||||
* make.
|
||||
*
|
||||
* 3.3. Redistribution of Executable. Redistribution in executable form of any
|
||||
* substantial portion of the Covered Code or modification must reproduce the
|
||||
* above Copyright Notice, and the following Disclaimer and Export Compliance
|
||||
* provision in the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* 3.4. Intel retains all right, title, and interest in and to the Original
|
||||
* Intel Code.
|
||||
*
|
||||
* 3.5. Neither the name Intel nor any other trademark owned or controlled by
|
||||
* Intel shall be used in advertising or otherwise to promote the sale, use or
|
||||
* other dealings in products derived from or relating to the Covered Code
|
||||
* without prior written authorization from Intel.
|
||||
*
|
||||
* 4. Disclaimer and Export Compliance
|
||||
*
|
||||
* 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
|
||||
* HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
|
||||
* IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
|
||||
* INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
|
||||
* UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
|
||||
* PARTICULAR PURPOSE.
|
||||
*
|
||||
* 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
|
||||
* OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
|
||||
* COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
|
||||
* SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
|
||||
* CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
|
||||
* HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
|
||||
* SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
|
||||
* LIMITED REMEDY.
|
||||
*
|
||||
* 4.3. Licensee shall not export, either directly or indirectly, any of this
|
||||
* software or system incorporating such software without first obtaining any
|
||||
* required license or other approval from the U. S. Department of Commerce or
|
||||
* any other agency or department of the United States Government. In the
|
||||
* event Licensee exports any such software from the United States or
|
||||
* re-exports any such software from a foreign destination, Licensee shall
|
||||
* ensure that the distribution and export/re-export of the software is in
|
||||
* compliance with all laws, regulations, orders, or other restrictions of the
|
||||
* U.S. Export Administration Regulations. Licensee agrees that neither it nor
|
||||
* any of its subsidiaries will export/re-export any technical data, process,
|
||||
* software, or service, directly or indirectly, to any country for which the
|
||||
* United States government or any agency thereof requires an export license,
|
||||
* other governmental approval, or letter of assurance, without first obtaining
|
||||
* such license, approval or letter.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
#include "aslcompiler.h"
|
||||
#include "acapps.h"
|
||||
#include "dtcompiler.h"
|
||||
#include "dttemplate.h" /* Contains the hex ACPI table templates */
|
||||
|
||||
#define _COMPONENT DT_COMPILER
|
||||
ACPI_MODULE_NAME ("dttemplate")
|
||||
|
||||
|
||||
/* Local prototypes */
|
||||
|
||||
static BOOLEAN
|
||||
AcpiUtIsSpecialTable (
|
||||
char *Signature);
|
||||
|
||||
static ACPI_STATUS
|
||||
DtCreateOneTemplate (
|
||||
char *Signature,
|
||||
ACPI_DMTABLE_DATA *TableData);
|
||||
|
||||
static ACPI_STATUS
|
||||
DtCreateAllTemplates (
|
||||
void);
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiUtIsSpecialTable
|
||||
*
|
||||
* PARAMETERS: Signature - ACPI table signature
|
||||
*
|
||||
* RETURN: TRUE if signature is a special ACPI table
|
||||
*
|
||||
* DESCRIPTION: Check for valid ACPI tables that are not in the main ACPI
|
||||
* table data structure (AcpiDmTableData).
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
static BOOLEAN
|
||||
AcpiUtIsSpecialTable (
|
||||
char *Signature)
|
||||
{
|
||||
|
||||
if (ACPI_COMPARE_NAME (Signature, ACPI_SIG_DSDT) ||
|
||||
ACPI_COMPARE_NAME (Signature, ACPI_SIG_SSDT) ||
|
||||
ACPI_COMPARE_NAME (Signature, ACPI_SIG_FACS) ||
|
||||
ACPI_COMPARE_NAME (Signature, ACPI_RSDP_NAME))
|
||||
{
|
||||
return (TRUE);
|
||||
}
|
||||
|
||||
return (FALSE);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: DtCreateTemplates
|
||||
*
|
||||
* PARAMETERS: Signature - ACPI table signature
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Create one or more template files.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
ACPI_STATUS
|
||||
DtCreateTemplates (
|
||||
char *Signature)
|
||||
{
|
||||
ACPI_DMTABLE_DATA *TableData;
|
||||
ACPI_STATUS Status;
|
||||
|
||||
|
||||
AslInitializeGlobals ();
|
||||
AcpiUtStrupr (Signature);
|
||||
|
||||
/* Create all known templates if requested */
|
||||
|
||||
if (!ACPI_STRNCMP (Signature, "ALL", 3) ||
|
||||
!ACPI_STRCMP (Signature, "*"))
|
||||
{
|
||||
Status = DtCreateAllTemplates ();
|
||||
return (Status);
|
||||
}
|
||||
|
||||
/*
|
||||
* Validate signature and get the template data:
|
||||
* 1) Signature must be 4 characters
|
||||
* 2) Signature must be a recognized ACPI table
|
||||
* 3) There must be a template associated with the signature
|
||||
*/
|
||||
if (strlen (Signature) != ACPI_NAME_SIZE)
|
||||
{
|
||||
fprintf (stderr, "%s, Invalid ACPI table signature\n", Signature);
|
||||
return (AE_ERROR);
|
||||
}
|
||||
|
||||
/*
|
||||
* Some slack for the two strange tables whose name is different than
|
||||
* their signatures: MADT->APIC and FADT->FACP.
|
||||
*/
|
||||
if (!strcmp (Signature, "MADT"))
|
||||
{
|
||||
Signature = "APIC";
|
||||
}
|
||||
else if (!strcmp (Signature, "FADT"))
|
||||
{
|
||||
Signature = "FACP";
|
||||
}
|
||||
|
||||
TableData = AcpiDmGetTableData (Signature);
|
||||
if (TableData)
|
||||
{
|
||||
if (!TableData->Template)
|
||||
{
|
||||
fprintf (stderr, "%4.4s, No template available\n", Signature);
|
||||
return (AE_ERROR);
|
||||
}
|
||||
}
|
||||
else if (!AcpiUtIsSpecialTable (Signature))
|
||||
{
|
||||
fprintf (stderr,
|
||||
"%4.4s, Unrecognized ACPI table signature\n", Signature);
|
||||
return (AE_ERROR);
|
||||
}
|
||||
|
||||
Status = AdInitialize ();
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return (Status);
|
||||
}
|
||||
|
||||
Status = DtCreateOneTemplate (Signature, TableData);
|
||||
return (Status);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: DtCreateAllTemplates
|
||||
*
|
||||
* PARAMETERS: None
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Create all currently defined template files
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
static ACPI_STATUS
|
||||
DtCreateAllTemplates (
|
||||
void)
|
||||
{
|
||||
ACPI_DMTABLE_DATA *TableData;
|
||||
ACPI_STATUS Status;
|
||||
|
||||
|
||||
Status = AdInitialize ();
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return (Status);
|
||||
}
|
||||
|
||||
fprintf (stderr, "Creating all supported Template files\n");
|
||||
|
||||
/* Walk entire ACPI table data structure */
|
||||
|
||||
for (TableData = AcpiDmTableData; TableData->Signature; TableData++)
|
||||
{
|
||||
/* If table has a template, create the template file */
|
||||
|
||||
if (TableData->Template)
|
||||
{
|
||||
Status = DtCreateOneTemplate (TableData->Signature,
|
||||
TableData);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return (Status);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Create the "special ACPI tables:
|
||||
* 1) DSDT/SSDT are AML tables, not data tables
|
||||
* 2) FACS and RSDP have non-standard headers
|
||||
*/
|
||||
Status = DtCreateOneTemplate (ACPI_SIG_DSDT, NULL);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return (Status);
|
||||
}
|
||||
|
||||
Status = DtCreateOneTemplate (ACPI_SIG_SSDT, NULL);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return (Status);
|
||||
}
|
||||
|
||||
Status = DtCreateOneTemplate (ACPI_SIG_FACS, NULL);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return (Status);
|
||||
}
|
||||
|
||||
Status = DtCreateOneTemplate (ACPI_RSDP_NAME, NULL);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return (Status);
|
||||
}
|
||||
|
||||
return (AE_OK);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: DtCreateOneTemplate
|
||||
*
|
||||
* PARAMETERS: Signature - ACPI signature, NULL terminated.
|
||||
* TableData - Entry in ACPI table data structure.
|
||||
* NULL if a special ACPI table.
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Create one template source file for the requested ACPI table.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
static ACPI_STATUS
|
||||
DtCreateOneTemplate (
|
||||
char *Signature,
|
||||
ACPI_DMTABLE_DATA *TableData)
|
||||
{
|
||||
char *DisasmFilename;
|
||||
FILE *File;
|
||||
ACPI_STATUS Status = AE_OK;
|
||||
|
||||
|
||||
/* New file will have a .asl suffix */
|
||||
|
||||
DisasmFilename = FlGenerateFilename (
|
||||
Signature, FILE_SUFFIX_ASL_CODE);
|
||||
if (!DisasmFilename)
|
||||
{
|
||||
fprintf (stderr, "Could not generate output filename\n");
|
||||
return (AE_ERROR);
|
||||
}
|
||||
|
||||
/* Probably should prompt to overwrite the file */
|
||||
|
||||
AcpiUtStrlwr (DisasmFilename);
|
||||
File = fopen (DisasmFilename, "w+");
|
||||
if (!File)
|
||||
{
|
||||
fprintf (stderr, "Could not open output file %s\n", DisasmFilename);
|
||||
return (AE_ERROR);
|
||||
}
|
||||
|
||||
/* Emit the common file header */
|
||||
|
||||
AcpiOsRedirectOutput (File);
|
||||
|
||||
AcpiOsPrintf ("/*\n");
|
||||
AcpiOsPrintf (ACPI_COMMON_HEADER ("iASL Compiler/Disassembler", " * "));
|
||||
|
||||
AcpiOsPrintf (" * Template for [%4.4s] ACPI Table\n",
|
||||
Signature);
|
||||
|
||||
/* Dump the actual ACPI table */
|
||||
|
||||
if (TableData)
|
||||
{
|
||||
/* Normal case, tables that appear in AcpiDmTableData */
|
||||
|
||||
if (Gbl_VerboseTemplates)
|
||||
{
|
||||
AcpiOsPrintf (" * Format: [HexOffset DecimalOffset ByteLength]"
|
||||
" FieldName : HexFieldValue\n */\n\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
AcpiOsPrintf (" * Format: [ByteLength]"
|
||||
" FieldName : HexFieldValue\n */\n\n");
|
||||
}
|
||||
|
||||
AcpiDmDumpDataTable (ACPI_CAST_PTR (ACPI_TABLE_HEADER,
|
||||
TableData->Template));
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Special ACPI tables - DSDT, SSDT, FACS, RSDP */
|
||||
|
||||
AcpiOsPrintf (" */\n\n");
|
||||
if (ACPI_COMPARE_NAME (Signature, ACPI_SIG_DSDT))
|
||||
{
|
||||
fwrite (TemplateDsdt, sizeof (TemplateDsdt) -1, 1, File);
|
||||
}
|
||||
else if (ACPI_COMPARE_NAME (Signature, ACPI_SIG_SSDT))
|
||||
{
|
||||
fwrite (TemplateSsdt, sizeof (TemplateSsdt) -1, 1, File);
|
||||
}
|
||||
else if (ACPI_COMPARE_NAME (Signature, ACPI_SIG_FACS))
|
||||
{
|
||||
AcpiDmDumpDataTable (ACPI_CAST_PTR (ACPI_TABLE_HEADER,
|
||||
TemplateFacs));
|
||||
}
|
||||
else if (ACPI_COMPARE_NAME (Signature, ACPI_RSDP_NAME))
|
||||
{
|
||||
AcpiDmDumpDataTable (ACPI_CAST_PTR (ACPI_TABLE_HEADER,
|
||||
TemplateRsdp));
|
||||
}
|
||||
else
|
||||
{
|
||||
fprintf (stderr,
|
||||
"%4.4s, Unrecognized ACPI table signature\n", Signature);
|
||||
return (AE_ERROR);
|
||||
}
|
||||
}
|
||||
|
||||
fprintf (stderr,
|
||||
"Created ACPI table template for [%4.4s], written to \"%s\"\n",
|
||||
Signature, DisasmFilename);
|
||||
|
||||
fclose (File);
|
||||
AcpiOsRedirectOutput (stdout);
|
||||
ACPI_FREE (DisasmFilename);
|
||||
return (Status);
|
||||
}
|
|
@ -0,0 +1,856 @@
|
|||
/******************************************************************************
|
||||
*
|
||||
* Module Name: dttemplate.h - ACPI table template definitions
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
*
|
||||
* 2.1. This is your license from Intel Corp. under its intellectual property
|
||||
* rights. You may have additional license terms from the party that provided
|
||||
* you this software, covering your right to use that party's intellectual
|
||||
* property rights.
|
||||
*
|
||||
* 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
|
||||
* copy of the source code appearing in this file ("Covered Code") an
|
||||
* irrevocable, perpetual, worldwide license under Intel's copyrights in the
|
||||
* base code distributed originally by Intel ("Original Intel Code") to copy,
|
||||
* make derivatives, distribute, use and display any portion of the Covered
|
||||
* Code in any form, with the right to sublicense such rights; and
|
||||
*
|
||||
* 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
|
||||
* license (with the right to sublicense), under only those claims of Intel
|
||||
* patents that are infringed by the Original Intel Code, to make, use, sell,
|
||||
* offer to sell, and import the Covered Code and derivative works thereof
|
||||
* solely to the minimum extent necessary to exercise the above copyright
|
||||
* license, and in no event shall the patent license extend to any additions
|
||||
* to or modifications of the Original Intel Code. No other license or right
|
||||
* is granted directly or by implication, estoppel or otherwise;
|
||||
*
|
||||
* The above copyright and patent license is granted only if the following
|
||||
* conditions are met:
|
||||
*
|
||||
* 3. Conditions
|
||||
*
|
||||
* 3.1. Redistribution of Source with Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification with rights to further distribute source must include
|
||||
* the above Copyright Notice, the above License, this list of Conditions,
|
||||
* and the following Disclaimer and Export Compliance provision. In addition,
|
||||
* Licensee must cause all Covered Code to which Licensee contributes to
|
||||
* contain a file documenting the changes Licensee made to create that Covered
|
||||
* Code and the date of any change. Licensee must include in that file the
|
||||
* documentation of any changes made by any predecessor Licensee. Licensee
|
||||
* must include a prominent statement that the modification is derived,
|
||||
* directly or indirectly, from Original Intel Code.
|
||||
*
|
||||
* 3.2. Redistribution of Source with no Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification without rights to further distribute source must
|
||||
* include the following Disclaimer and Export Compliance provision in the
|
||||
* documentation and/or other materials provided with distribution. In
|
||||
* addition, Licensee may not authorize further sublicense of source of any
|
||||
* portion of the Covered Code, and must include terms to the effect that the
|
||||
* license from Licensee to its licensee is limited to the intellectual
|
||||
* property embodied in the software Licensee provides to its licensee, and
|
||||
* not to intellectual property embodied in modifications its licensee may
|
||||
* make.
|
||||
*
|
||||
* 3.3. Redistribution of Executable. Redistribution in executable form of any
|
||||
* substantial portion of the Covered Code or modification must reproduce the
|
||||
* above Copyright Notice, and the following Disclaimer and Export Compliance
|
||||
* provision in the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* 3.4. Intel retains all right, title, and interest in and to the Original
|
||||
* Intel Code.
|
||||
*
|
||||
* 3.5. Neither the name Intel nor any other trademark owned or controlled by
|
||||
* Intel shall be used in advertising or otherwise to promote the sale, use or
|
||||
* other dealings in products derived from or relating to the Covered Code
|
||||
* without prior written authorization from Intel.
|
||||
*
|
||||
* 4. Disclaimer and Export Compliance
|
||||
*
|
||||
* 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
|
||||
* HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
|
||||
* IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
|
||||
* INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
|
||||
* UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
|
||||
* PARTICULAR PURPOSE.
|
||||
*
|
||||
* 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
|
||||
* OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
|
||||
* COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
|
||||
* SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
|
||||
* CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
|
||||
* HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
|
||||
* SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
|
||||
* LIMITED REMEDY.
|
||||
*
|
||||
* 4.3. Licensee shall not export, either directly or indirectly, any of this
|
||||
* software or system incorporating such software without first obtaining any
|
||||
* required license or other approval from the U. S. Department of Commerce or
|
||||
* any other agency or department of the United States Government. In the
|
||||
* event Licensee exports any such software from the United States or
|
||||
* re-exports any such software from a foreign destination, Licensee shall
|
||||
* ensure that the distribution and export/re-export of the software is in
|
||||
* compliance with all laws, regulations, orders, or other restrictions of the
|
||||
* U.S. Export Administration Regulations. Licensee agrees that neither it nor
|
||||
* any of its subsidiaries will export/re-export any technical data, process,
|
||||
* software, or service, directly or indirectly, to any country for which the
|
||||
* United States government or any agency thereof requires an export license,
|
||||
* other governmental approval, or letter of assurance, without first obtaining
|
||||
* such license, approval or letter.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
#ifndef __DTTEMPLATE_H
|
||||
#define __DTTEMPLATE_H
|
||||
|
||||
|
||||
/* Special templates for DSDT and SSDT (AML byte-code tables) */
|
||||
|
||||
const char TemplateDsdt[] =
|
||||
"DefinitionBlock (\"dsdt.aml\", \"DSDT\", 2, \"Intel\", \"Template\", 0x00000001)\n"
|
||||
"{\n"
|
||||
" Method (MAIN, 0, NotSerialized)\n"
|
||||
" {\n"
|
||||
" Return (Zero)\n"
|
||||
" }\n"
|
||||
"}\n\n";
|
||||
|
||||
const char TemplateSsdt[] =
|
||||
"DefinitionBlock (\"ssdt.aml\", \"SSDT\", 2, \"Intel\", \"Template\", 0x00000001)\n"
|
||||
"{\n"
|
||||
" Method (MAIN, 0, NotSerialized)\n"
|
||||
" {\n"
|
||||
" Return (Zero)\n"
|
||||
" }\n"
|
||||
"}\n\n";
|
||||
|
||||
|
||||
/* Templates for ACPI data tables */
|
||||
|
||||
const unsigned char TemplateAsf[] =
|
||||
{
|
||||
0x41,0x53,0x46,0x21,0x72,0x00,0x00,0x00, /* 00000000 "ASF!r..." */
|
||||
0x10,0x0B,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "..INTEL " */
|
||||
0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */
|
||||
0x01,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */
|
||||
0x28,0x05,0x10,0x20,0x00,0x00,0x10,0x00, /* 00000020 "(.. ...." */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000028 "........" */
|
||||
0x00,0x00,0x00,0x00,0x01,0x00,0x14,0x00, /* 00000030 "........" */
|
||||
0x00,0x00,0x01,0x0C,0x00,0x00,0x00,0x00, /* 00000038 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000040 "........" */
|
||||
0x02,0x00,0x0C,0x00,0x01,0x04,0x00,0x00, /* 00000048 "........" */
|
||||
0x00,0x00,0x00,0x00,0x03,0x00,0x17,0x00, /* 00000050 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000058 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000060 "........" */
|
||||
0x00,0x00,0x00,0x84,0x00,0x07,0x00,0x00, /* 00000068 "........" */
|
||||
0x01,0x00 /* 00000070 ".." */
|
||||
};
|
||||
|
||||
const unsigned char TemplateBert[] =
|
||||
{
|
||||
0x42,0x45,0x52,0x54,0x30,0x00,0x00,0x00, /* 00000000 "BERT0..." */
|
||||
0x01,0x15,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "..INTEL " */
|
||||
0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */
|
||||
0x01,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */
|
||||
0x28,0x05,0x10,0x20,0x00,0x00,0x00,0x00, /* 00000020 "(.. ...." */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 /* 00000028 "........" */
|
||||
};
|
||||
|
||||
const unsigned char TemplateBoot[] =
|
||||
{
|
||||
0x42,0x4F,0x4F,0x54,0x28,0x00,0x00,0x00, /* 00000000 "BOOT(..." */
|
||||
0x01,0x0D,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "..INTEL " */
|
||||
0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */
|
||||
0x00,0x00,0x04,0x06,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */
|
||||
0x28,0x05,0x10,0x20,0x00,0x00,0x00,0x00 /* 00000020 "(.. ...." */
|
||||
};
|
||||
|
||||
const unsigned char TemplateCpep[] =
|
||||
{
|
||||
0x43,0x50,0x45,0x50,0x34,0x00,0x00,0x00, /* 00000000 "CPEP4..." */
|
||||
0x01,0x0F,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "..INTEL " */
|
||||
0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */
|
||||
0x00,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */
|
||||
0x28,0x05,0x10,0x20,0x00,0x00,0x00,0x00, /* 00000020 "(.. ...." */
|
||||
0x00,0x00,0x00,0x00,0x00,0x08,0x00,0x00, /* 00000028 "........" */
|
||||
0x00,0x00,0x00,0x00 /* 00000030 "...." */
|
||||
};
|
||||
|
||||
const unsigned char TemplateDbgp[] =
|
||||
{
|
||||
0x44,0x42,0x47,0x50,0x34,0x00,0x00,0x00, /* 00000000 "DBGP4..." */
|
||||
0x01,0x1A,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "..INTEL " */
|
||||
0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */
|
||||
0x00,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */
|
||||
0x28,0x05,0x10,0x20,0x00,0x00,0x00,0x00, /* 00000020 "(.. ...." */
|
||||
0x00,0x08,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000028 "........" */
|
||||
0x00,0x00,0x00,0x00 /* 00000030 "...." */
|
||||
};
|
||||
|
||||
const unsigned char TemplateDmar[] =
|
||||
{
|
||||
0x44,0x4D,0x41,0x52,0x8C,0x00,0x00,0x00, /* 00000000 "DMAR...." */
|
||||
0x01,0x15,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "..INTEL " */
|
||||
0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */
|
||||
0x01,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */
|
||||
0x28,0x05,0x10,0x20,0x2F,0x01,0x00,0x00, /* 00000020 "(.. /..." */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000028 "........" */
|
||||
0x00,0x00,0x18,0x00,0x01,0x00,0x00,0x00, /* 00000030 "........" */
|
||||
0x00,0x00,0x02,0xFD,0x00,0x00,0x00,0x00, /* 00000038 "........" */
|
||||
0x03,0x08,0x00,0x00,0x08,0xF0,0x1F,0x07, /* 00000040 "........" */
|
||||
0x01,0x00,0x20,0x00,0x00,0x00,0x00,0x00, /* 00000048 ".. ....." */
|
||||
0x00,0x10,0xC2,0x78,0x00,0x00,0x00,0x00, /* 00000050 "...x...." */
|
||||
0xFF,0x3F,0xC2,0x78,0x00,0x00,0x00,0x00, /* 00000058 ".?.x...." */
|
||||
0x01,0x08,0x00,0x00,0x00,0x00,0x1D,0x00, /* 00000060 "........" */
|
||||
0x02,0x00,0x10,0x00,0x00,0x00,0x00,0x00, /* 00000068 "........" */
|
||||
0x02,0x08,0x00,0x00,0x00,0x00,0x01,0x00, /* 00000070 "........" */
|
||||
0x03,0x00,0x14,0x00,0x00,0x00,0x00,0x00, /* 00000078 "........" */
|
||||
0x00,0x00,0x02,0xFD,0x00,0x00,0x00,0x00, /* 00000080 "........" */
|
||||
0x00,0x00,0x00,0x00 /* 00000088 "...." */
|
||||
};
|
||||
|
||||
const unsigned char TemplateEcdt[] =
|
||||
{
|
||||
0x45,0x43,0x44,0x54,0x42,0x00,0x00,0x00, /* 00000000 "ECDTB..." */
|
||||
0x01,0x2D,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 ".-INTEL " */
|
||||
0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */
|
||||
0x01,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */
|
||||
0x28,0x05,0x10,0x20,0x01,0x08,0x00,0x00, /* 00000020 "(.. ...." */
|
||||
0x66,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000028 "f......." */
|
||||
0x01,0x08,0x00,0x00,0x62,0x00,0x00,0x00, /* 00000030 "....b..." */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000038 "........" */
|
||||
0x09,0x00 /* 00000040 ".." */
|
||||
};
|
||||
|
||||
const unsigned char TemplateEinj[] =
|
||||
{
|
||||
0x45,0x49,0x4E,0x4A,0x30,0x01,0x00,0x00, /* 00000000 "EINJ0..." */
|
||||
0x01,0x09,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "..INTEL " */
|
||||
0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */
|
||||
0x01,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */
|
||||
0x28,0x05,0x10,0x20,0x30,0x00,0x00,0x00, /* 00000020 "(.. 0..." */
|
||||
0x00,0x00,0x00,0x00,0x0A,0x00,0x00,0x00, /* 00000028 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x40,0x00,0x04, /* 00000030 ".....@.." */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000038 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000040 "........" */
|
||||
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, /* 00000048 "........" */
|
||||
0x01,0x00,0x00,0x00,0x00,0x40,0x00,0x04, /* 00000050 ".....@.." */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000058 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000060 "........" */
|
||||
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, /* 00000068 "........" */
|
||||
0x02,0x02,0x01,0x00,0x00,0x40,0x00,0x04, /* 00000070 ".....@.." */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000078 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000080 "........" */
|
||||
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, /* 00000088 "........" */
|
||||
0x03,0x00,0x00,0x00,0x00,0x40,0x00,0x04, /* 00000090 ".....@.." */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000098 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000A0 "........" */
|
||||
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, /* 000000A8 "........" */
|
||||
0x04,0x03,0x01,0x00,0x00,0x40,0x00,0x04, /* 000000B0 ".....@.." */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000B8 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000C0 "........" */
|
||||
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, /* 000000C8 "........" */
|
||||
0x05,0x03,0x01,0x00,0x01,0x10,0x00,0x02, /* 000000D0 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000D8 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000E0 "........" */
|
||||
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, /* 000000E8 "........" */
|
||||
0x06,0x01,0x00,0x00,0x00,0x40,0x00,0x04, /* 000000F0 ".....@.." */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000F8 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000100 "........" */
|
||||
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, /* 00000108 "........" */
|
||||
0x07,0x00,0x01,0x00,0x00,0x40,0x00,0x04, /* 00000110 ".....@.." */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000118 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000120 "........" */
|
||||
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF /* 00000128 "........" */
|
||||
};
|
||||
|
||||
const unsigned char TemplateErst[] =
|
||||
{
|
||||
0x45,0x52,0x53,0x54,0x30,0x02,0x00,0x00, /* 00000000 "ERST0..." */
|
||||
0x01,0xAB,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "..INTEL " */
|
||||
0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */
|
||||
0x01,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */
|
||||
0x28,0x05,0x10,0x20,0x30,0x00,0x00,0x00, /* 00000020 "(.. 0..." */
|
||||
0x00,0x00,0x00,0x00,0x10,0x00,0x00,0x00, /* 00000028 "........" */
|
||||
0x00,0x03,0x00,0x00,0x00,0x40,0x00,0x04, /* 00000030 ".....@.." */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000038 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000040 "........" */
|
||||
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, /* 00000048 "........" */
|
||||
0x01,0x03,0x00,0x00,0x00,0x40,0x00,0x04, /* 00000050 ".....@.." */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000058 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000060 "........" */
|
||||
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, /* 00000068 "........" */
|
||||
0x02,0x03,0x00,0x00,0x00,0x40,0x00,0x04, /* 00000070 ".....@.." */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000078 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000080 "........" */
|
||||
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, /* 00000088 "........" */
|
||||
0x03,0x04,0x01,0x00,0x00,0x40,0x00,0x04, /* 00000090 ".....@.." */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000098 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000A0 "........" */
|
||||
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, /* 000000A8 "........" */
|
||||
0x04,0x02,0x00,0x00,0x00,0x40,0x00,0x04, /* 000000B0 ".....@.." */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000B8 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000C0 "........" */
|
||||
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, /* 000000C8 "........" */
|
||||
0x05,0x03,0x00,0x00,0x01,0x08,0x00,0x01, /* 000000D0 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000D8 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000E0 "........" */
|
||||
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, /* 000000E8 "........" */
|
||||
0x06,0x01,0x00,0x00,0x00,0x40,0x00,0x04, /* 000000F0 ".....@.." */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000F8 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000100 "........" */
|
||||
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, /* 00000108 "........" */
|
||||
0x07,0x00,0x00,0x00,0x00,0x40,0x00,0x04, /* 00000110 ".....@.." */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000118 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000120 "........" */
|
||||
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, /* 00000128 "........" */
|
||||
0x08,0x00,0x00,0x00,0x00,0x40,0x00,0x04, /* 00000130 ".....@.." */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000138 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000140 "........" */
|
||||
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, /* 00000148 "........" */
|
||||
0x09,0x02,0x00,0x00,0x00,0x40,0x00,0x04, /* 00000150 ".....@.." */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000158 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000160 "........" */
|
||||
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, /* 00000168 "........" */
|
||||
0x0A,0x00,0x00,0x00,0x00,0x40,0x00,0x04, /* 00000170 ".....@.." */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000178 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000180 "........" */
|
||||
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, /* 00000188 "........" */
|
||||
0x0B,0x03,0x00,0x00,0x00,0x40,0x00,0x04, /* 00000190 ".....@.." */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000198 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000001A0 "........" */
|
||||
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, /* 000001A8 "........" */
|
||||
0x0C,0x00,0x00,0x00,0x00,0x40,0x00,0x04, /* 000001B0 ".....@.." */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000001B8 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000001C0 "........" */
|
||||
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, /* 000001C8 "........" */
|
||||
0x0D,0x00,0x00,0x00,0x00,0x40,0x00,0x04, /* 000001D0 ".....@.." */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000001D8 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000001E0 "........" */
|
||||
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, /* 000001E8 "........" */
|
||||
0x0E,0x00,0x00,0x00,0x00,0x40,0x00,0x04, /* 000001F0 ".....@.." */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000001F8 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000200 "........" */
|
||||
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, /* 00000208 "........" */
|
||||
0x0F,0x00,0x00,0x00,0x00,0x40,0x00,0x04, /* 00000210 ".....@.." */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000218 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000220 "........" */
|
||||
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF /* 00000228 "........" */
|
||||
};
|
||||
|
||||
const unsigned char TemplateFacs[] =
|
||||
{
|
||||
0x46,0x41,0x43,0x53,0x40,0x00,0x00,0x00, /* 00000000 "FACS@..." */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000008 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000010 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000018 "........" */
|
||||
0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000020 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000028 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000030 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 /* 00000038 "........" */
|
||||
};
|
||||
|
||||
const unsigned char TemplateFadt[] =
|
||||
{
|
||||
0x46,0x41,0x43,0x50,0xF4,0x00,0x00,0x00, /* 00000000 "FACP...." */
|
||||
0x04,0x4E,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 ".NINTEL " */
|
||||
0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */
|
||||
0x00,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */
|
||||
0x28,0x05,0x10,0x20,0x01,0x00,0x00,0x00, /* 00000020 "(.. ...." */
|
||||
0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000028 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000030 "........" */
|
||||
0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000038 "........" */
|
||||
0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000040 "........" */
|
||||
0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000048 "........" */
|
||||
0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000050 "........" */
|
||||
0x04,0x02,0x01,0x04,0x08,0x00,0x00,0x00, /* 00000058 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000060 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000068 "........" */
|
||||
0x00,0x00,0x00,0x00,0x01,0x08,0x00,0x01, /* 00000070 "........" */
|
||||
0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000078 "........" */
|
||||
0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000080 "........" */
|
||||
0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000088 "........" */
|
||||
0x00,0x00,0x00,0x00,0x01,0x20,0x00,0x02, /* 00000090 "..... .." */
|
||||
0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000098 "........" */
|
||||
0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000A0 "........" */
|
||||
0x00,0x00,0x00,0x00,0x01,0x10,0x00,0x02, /* 000000A8 "........" */
|
||||
0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000B0 "........" */
|
||||
0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000B8 "........" */
|
||||
0x00,0x00,0x00,0x00,0x01,0x08,0x00,0x00, /* 000000C0 "........" */
|
||||
0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000C8 "........" */
|
||||
0x01,0x20,0x00,0x03,0x01,0x00,0x00,0x00, /* 000000D0 ". ......" */
|
||||
0x00,0x00,0x00,0x00,0x01,0x80,0x00,0x01, /* 000000D8 "........" */
|
||||
0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000E0 "........" */
|
||||
0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000E8 "........" */
|
||||
0x00,0x00,0x00,0x00 /* 000000F0 "...." */
|
||||
};
|
||||
|
||||
const unsigned char TemplateHest[] =
|
||||
{
|
||||
0x48,0x45,0x53,0x54,0xD4,0x01,0x00,0x00, /* 00000000 "HEST...." */
|
||||
0x01,0x20,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 ". INTEL " */
|
||||
0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */
|
||||
0x01,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */
|
||||
0x28,0x05,0x10,0x20,0x04,0x00,0x00,0x00, /* 00000020 "(.. ...." */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01, /* 00000028 "........" */
|
||||
0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000030 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000038 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000040 "........" */
|
||||
0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000048 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000050 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000058 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000060 "........" */
|
||||
0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000068 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000070 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000078 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000080 "........" */
|
||||
0x01,0x00,0x01,0x00,0x00,0x00,0x00,0x01, /* 00000088 "........" */
|
||||
0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000090 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000098 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000A0 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000A8 "........" */
|
||||
0x00,0x00,0x00,0x00,0x02,0x00,0x00,0x00, /* 000000B0 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000B8 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000C0 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000C8 "........" */
|
||||
0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 000000D0 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000D8 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000E0 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000E8 "........" */
|
||||
0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x01, /* 000000F0 "........" */
|
||||
0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 000000F8 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000100 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000108 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000110 "........" */
|
||||
0x00,0x00,0x00,0x00,0x08,0x00,0x00,0x00, /* 00000118 "........" */
|
||||
0x00,0x00,0x00,0x01,0x01,0x00,0x00,0x00, /* 00000120 "........" */
|
||||
0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000128 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000130 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000138 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000140 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000148 "........" */
|
||||
0x00,0x00,0x00,0x00,0x09,0x00,0x02,0x00, /* 00000150 "........" */
|
||||
0xFF,0xFF,0x00,0x01,0x01,0x00,0x00,0x00, /* 00000158 "........" */
|
||||
0x01,0x00,0x00,0x00,0x00,0x10,0x00,0x00, /* 00000160 "........" */
|
||||
0x00,0x40,0x00,0x04,0x00,0x00,0x00,0x00, /* 00000168 ".@......" */
|
||||
0x00,0x00,0x00,0x00,0x03,0x1C,0x00,0x00, /* 00000170 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000178 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000180 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000188 "........" */
|
||||
0x00,0x10,0x00,0x00,0x09,0x00,0x03,0x00, /* 00000190 "........" */
|
||||
0x00,0x00,0x00,0x01,0x01,0x00,0x00,0x00, /* 00000198 "........" */
|
||||
0x01,0x00,0x00,0x00,0x00,0x10,0x00,0x00, /* 000001A0 "........" */
|
||||
0x00,0x40,0x00,0x04,0x00,0x00,0x00,0x00, /* 000001A8 ".@......" */
|
||||
0x00,0x00,0x00,0x00,0x04,0x1C,0x00,0x00, /* 000001B0 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000001B8 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000001C0 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000001C8 "........" */
|
||||
0x00,0x10,0x00,0x00 /* 000001D0 "...." */
|
||||
};
|
||||
|
||||
const unsigned char TemplateHpet[] =
|
||||
{
|
||||
0x48,0x50,0x45,0x54,0x38,0x00,0x00,0x00, /* 00000000 "HPET8..." */
|
||||
0x01,0x09,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "..INTEL " */
|
||||
0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */
|
||||
0x01,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */
|
||||
0x28,0x05,0x10,0x20,0x00,0x00,0x00,0x00, /* 00000020 "(.. ...." */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000028 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 /* 00000030 "........" */
|
||||
};
|
||||
|
||||
const unsigned char TemplateIvrs[] =
|
||||
{
|
||||
0x49,0x56,0x52,0x53,0xBC,0x00,0x00,0x00, /* 00000000 "IVRS...." */
|
||||
0x01,0x87,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "..INTEL " */
|
||||
0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */
|
||||
0x01,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */
|
||||
0x28,0x05,0x10,0x20,0x00,0x00,0x00,0x00, /* 00000020 "(.. ...." */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000028 "........" */
|
||||
0x10,0x14,0x34,0x00,0x00,0x00,0x00,0x00, /* 00000030 "..4....." */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000038 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000040 "........" */
|
||||
0x00,0x00,0x00,0x00,0x40,0x00,0x00,0x00, /* 00000048 "....@..." */
|
||||
0x00,0x00,0x00,0x00,0x42,0x00,0x00,0x00, /* 00000050 "....B..." */
|
||||
0x00,0x00,0x00,0x00,0x48,0x00,0x00,0x00, /* 00000058 "....H..." */
|
||||
0x00,0x00,0x00,0x00,0x20,0x08,0x20,0x00, /* 00000060 ".... . ." */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000068 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000070 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000078 "........" */
|
||||
0x00,0x00,0x00,0x00,0x21,0x04,0x20,0x00, /* 00000080 "....!. ." */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000088 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000090 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000098 "........" */
|
||||
0x00,0x00,0x00,0x00,0x10,0x14,0x18,0x00, /* 000000A0 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000A8 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000B0 "........" */
|
||||
0x00,0x00,0x00,0x00 /* 000000B8 "...." */
|
||||
};
|
||||
|
||||
const unsigned char TemplateMadt[] =
|
||||
{
|
||||
0x41,0x50,0x49,0x43,0xB6,0x00,0x00,0x00, /* 00000000 "APIC...." */
|
||||
0x01,0x45,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 ".EINTEL " */
|
||||
0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */
|
||||
0x01,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */
|
||||
0x28,0x05,0x10,0x20,0x00,0x00,0x00,0x00, /* 00000020 "(.. ...." */
|
||||
0x01,0x00,0x00,0x00,0x00,0x08,0x00,0x00, /* 00000028 "........" */
|
||||
0x01,0x00,0x00,0x00,0x01,0x0C,0x01,0x00, /* 00000030 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000038 "........" */
|
||||
0x02,0x0A,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000040 "........" */
|
||||
0x00,0x00,0x03,0x08,0x0D,0x00,0x01,0x00, /* 00000048 "........" */
|
||||
0x00,0x00,0x04,0x06,0x00,0x05,0x00,0x01, /* 00000050 "........" */
|
||||
0x05,0x0C,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000058 "........" */
|
||||
0x00,0x00,0x00,0x00,0x06,0x10,0x00,0x00, /* 00000060 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000068 "........" */
|
||||
0x00,0x00,0x00,0x00,0x07,0x16,0x00,0x00, /* 00000070 "........" */
|
||||
0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000078 "........" */
|
||||
0x00,0x00,0x00,0x00,0x5C,0x43,0x50,0x55, /* 00000080 "....\CPU" */
|
||||
0x30,0x00,0x08,0x10,0x05,0x00,0x00,0x00, /* 00000088 "0......." */
|
||||
0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00, /* 00000090 "........" */
|
||||
0x00,0x00,0x09,0x10,0x00,0x00,0x00,0x00, /* 00000098 "........" */
|
||||
0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00, /* 000000A0 "........" */
|
||||
0x00,0x00,0x0A,0x0C,0x05,0x00,0x00,0x00, /* 000000A8 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00 /* 000000B0 "......" */
|
||||
};
|
||||
|
||||
const unsigned char TemplateMcfg[] =
|
||||
{
|
||||
0x4D,0x43,0x46,0x47,0x3C,0x00,0x00,0x00, /* 00000000 "MCFG<..." */
|
||||
0x01,0x19,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "..INTEL " */
|
||||
0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */
|
||||
0x01,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */
|
||||
0x28,0x05,0x10,0x20,0x00,0x00,0x00,0x00, /* 00000020 "(.. ...." */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000028 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000030 "........" */
|
||||
0x00,0x00,0x00,0x00 /* 00000038 "...." */
|
||||
};
|
||||
|
||||
const unsigned char TemplateMchi[] =
|
||||
{
|
||||
0x4D,0x43,0x48,0x49,0x45,0x00,0x00,0x00, /* 00000000 "MCHIE..." */
|
||||
0x01,0xE4,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "..INTEL " */
|
||||
0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */
|
||||
0x15,0x07,0x00,0x02,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */
|
||||
0x28,0x05,0x10,0x20,0x01,0x00,0x00,0x00, /* 00000020 "(.. ...." */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000028 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x02,0x08,0x00, /* 00000030 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000038 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00 /* 00000040 "....." */
|
||||
};
|
||||
|
||||
const unsigned char TemplateMsct[] =
|
||||
{
|
||||
0x4D,0x53,0x43,0x54,0x90,0x00,0x00,0x00, /* 00000000 "MSCT...." */
|
||||
0x01,0xB7,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "..INTEL " */
|
||||
0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */
|
||||
0x01,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */
|
||||
0x28,0x05,0x10,0x20,0x38,0x00,0x00,0x00, /* 00000020 "(.. 8..." */
|
||||
0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000028 "........" */
|
||||
0xFF,0xFF,0xFF,0xFF,0xFF,0x0F,0x00,0x00, /* 00000030 "........" */
|
||||
0x01,0x16,0x00,0x00,0x00,0x00,0x03,0x00, /* 00000038 "........" */
|
||||
0x00,0x00,0x10,0x00,0x00,0x00,0x00,0x00, /* 00000040 "........" */
|
||||
0x00,0x00,0x40,0x00,0x00,0x00,0x01,0x16, /* 00000048 "..@....." */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000050 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000058 "........" */
|
||||
0x00,0x00,0x00,0x00,0x01,0x16,0x00,0x00, /* 00000060 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000068 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000070 "........" */
|
||||
0x00,0x00,0x01,0x16,0x00,0x00,0x00,0x00, /* 00000078 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000080 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 /* 00000088 "........" */
|
||||
};
|
||||
|
||||
const unsigned char TemplateRsdp[] =
|
||||
{
|
||||
0x52,0x53,0x44,0x20,0x50,0x54,0x52,0x20, /* 00000000 "RSD PTR " */
|
||||
0x43,0x49,0x4E,0x54,0x45,0x4C,0x20,0x02, /* 00000008 "CINTEL ." */
|
||||
0x00,0x00,0x00,0x00,0x24,0x00,0x00,0x00, /* 00000010 "....$..." */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000018 "........" */
|
||||
0xDC,0x00,0x00,0x00 /* 00000020 "...." */
|
||||
};
|
||||
|
||||
const unsigned char TemplateRsdt[] =
|
||||
{
|
||||
0x52,0x53,0x44,0x54,0x44,0x00,0x00,0x00, /* 00000000 "RSDTD..." */
|
||||
0x01,0xB1,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "..INTEL " */
|
||||
0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */
|
||||
0x01,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */
|
||||
0x28,0x05,0x10,0x20,0x10,0x00,0x00,0x00, /* 00000020 "(.. ...." */
|
||||
0x20,0x00,0x00,0x00,0x30,0x00,0x00,0x00, /* 00000028 " ...0..." */
|
||||
0x40,0x00,0x00,0x00,0x50,0x00,0x00,0x00, /* 00000030 "@...P..." */
|
||||
0x60,0x00,0x00,0x00,0x70,0x00,0x00,0x00, /* 00000038 "`...p..." */
|
||||
0x80,0x00,0x00,0x00 /* 00000040 "...." */
|
||||
};
|
||||
|
||||
const unsigned char TemplateSbst[] =
|
||||
{
|
||||
0x53,0x42,0x53,0x54,0x30,0x00,0x00,0x00, /* 00000000 "SBST0..." */
|
||||
0x01,0x06,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "..INTEL " */
|
||||
0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */
|
||||
0x01,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */
|
||||
0x28,0x05,0x10,0x20,0x00,0x00,0x00,0x00, /* 00000020 "(.. ...." */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 /* 00000028 "........" */
|
||||
};
|
||||
|
||||
const unsigned char TemplateSlic[] =
|
||||
{
|
||||
0x53,0x4C,0x49,0x43,0x76,0x01,0x00,0x00, /* 00000000 "SLICv..." */
|
||||
0x01,0x07,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "..INTEL " */
|
||||
0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */
|
||||
0x01,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */
|
||||
0x11,0x02,0x11,0x20,0x00,0x00,0x00,0x00, /* 00000020 "... ...." */
|
||||
0x9C,0x00,0x00,0x00,0x06,0x02,0x00,0x00, /* 00000028 "........" */
|
||||
0x00,0x24,0x00,0x00,0x52,0x53,0x41,0x31, /* 00000030 ".$..RSA1" */
|
||||
0x00,0x04,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000038 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000040 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000048 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000050 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000058 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000060 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000068 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000070 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000078 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000080 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000088 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000090 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000098 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000A0 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000A8 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000B0 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000B8 "........" */
|
||||
0x01,0x00,0x00,0x00,0xB6,0x00,0x00,0x00, /* 000000C0 "........" */
|
||||
0x00,0x00,0x02,0x00,0x49,0x4E,0x54,0x45, /* 000000C8 "....INTE" */
|
||||
0x4C,0x20,0x54,0x45,0x4D,0x50,0x4C,0x41, /* 000000D0 "L TEMPLA" */
|
||||
0x54,0x45,0x57,0x49,0x4E,0x44,0x4F,0x57, /* 000000D8 "TEWINDOW" */
|
||||
0x53,0x20,0x01,0x00,0x02,0x00,0x00,0x00, /* 000000E0 "S ......" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000E8 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000F0 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000F8 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000100 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000108 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000110 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000118 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000120 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000128 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000130 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000138 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000140 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000148 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000150 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000158 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000160 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000168 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00 /* 00000170 "......" */
|
||||
};
|
||||
|
||||
const unsigned char TemplateSlit[] =
|
||||
{
|
||||
0x53,0x4C,0x49,0x54,0xBC,0x01,0x00,0x00, /* 00000000 "SLIT...." */
|
||||
0x01,0x00,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "..INTEL " */
|
||||
0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */
|
||||
0x01,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */
|
||||
0x16,0x03,0x11,0x20,0x14,0x00,0x00,0x00, /* 00000020 "... ...." */
|
||||
0x00,0x00,0x00,0x00,0x0A,0x10,0x16,0x17, /* 00000028 "........" */
|
||||
0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, /* 00000030 "........" */
|
||||
0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27, /* 00000038 " !"#$%&'" */
|
||||
0x10,0x0A,0x15,0x16,0x17,0x18,0x19,0x1A, /* 00000040 "........" */
|
||||
0x1B,0x1C,0x1D,0x1E,0x1F,0x20,0x21,0x22, /* 00000048 "..... !"" */
|
||||
0x23,0x24,0x25,0x26,0x16,0x15,0x0A,0x10, /* 00000050 "#$%&...." */
|
||||
0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D, /* 00000058 "........" */
|
||||
0x1E,0x1F,0x20,0x21,0x22,0x23,0x24,0x25, /* 00000060 ".. !"#$%" */
|
||||
0x17,0x16,0x10,0x0A,0x15,0x16,0x17,0x18, /* 00000068 "........" */
|
||||
0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F,0x20, /* 00000070 "....... " */
|
||||
0x21,0x22,0x23,0x24,0x18,0x17,0x16,0x15, /* 00000078 "!"#$...." */
|
||||
0x0A,0x10,0x16,0x17,0x18,0x19,0x1A,0x1B, /* 00000080 "........" */
|
||||
0x1C,0x1D,0x1E,0x1F,0x20,0x21,0x22,0x23, /* 00000088 ".... !"#" */
|
||||
0x19,0x18,0x17,0x16,0x10,0x0A,0x15,0x16, /* 00000090 "........" */
|
||||
0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E, /* 00000098 "........" */
|
||||
0x1F,0x20,0x21,0x22,0x1A,0x19,0x18,0x17, /* 000000A0 ". !"...." */
|
||||
0x16,0x15,0x0A,0x10,0x16,0x17,0x18,0x19, /* 000000A8 "........" */
|
||||
0x1A,0x1B,0x1C,0x1D,0x1E,0x1F,0x20,0x21, /* 000000B0 "...... !" */
|
||||
0x1B,0x1A,0x19,0x18,0x17,0x16,0x10,0x0A, /* 000000B8 "........" */
|
||||
0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C, /* 000000C0 "........" */
|
||||
0x1D,0x1E,0x1F,0x20,0x1C,0x1B,0x1A,0x19, /* 000000C8 "... ...." */
|
||||
0x18,0x17,0x16,0x15,0x0A,0x10,0x16,0x17, /* 000000D0 "........" */
|
||||
0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, /* 000000D8 "........" */
|
||||
0x1D,0x1C,0x1B,0x1A,0x19,0x18,0x17,0x16, /* 000000E0 "........" */
|
||||
0x10,0x0A,0x15,0x16,0x17,0x18,0x19,0x1A, /* 000000E8 "........" */
|
||||
0x1B,0x1C,0x1D,0x1E,0x1E,0x1D,0x1C,0x1B, /* 000000F0 "........" */
|
||||
0x1A,0x19,0x18,0x17,0x16,0x15,0x0A,0x10, /* 000000F8 "........" */
|
||||
0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D, /* 00000100 "........" */
|
||||
0x1F,0x1E,0x1D,0x1C,0x1B,0x1A,0x19,0x18, /* 00000108 "........" */
|
||||
0x17,0x16,0x10,0x0A,0x15,0x16,0x17,0x18, /* 00000110 "........" */
|
||||
0x19,0x1A,0x1B,0x1C,0x20,0x1F,0x1E,0x1D, /* 00000118 ".... ..." */
|
||||
0x1C,0x1B,0x1A,0x19,0x18,0x17,0x16,0x15, /* 00000120 "........" */
|
||||
0x0A,0x10,0x16,0x17,0x18,0x19,0x1A,0x1B, /* 00000128 "........" */
|
||||
0x21,0x20,0x1F,0x1E,0x1D,0x1C,0x1B,0x1A, /* 00000130 "! ......" */
|
||||
0x19,0x18,0x17,0x16,0x10,0x0A,0x15,0x16, /* 00000138 "........" */
|
||||
0x17,0x18,0x19,0x1A,0x22,0x21,0x20,0x1F, /* 00000140 "...."! ." */
|
||||
0x1E,0x1D,0x1C,0x1B,0x1A,0x19,0x18,0x17, /* 00000148 "........" */
|
||||
0x16,0x15,0x0A,0x10,0x16,0x17,0x18,0x19, /* 00000150 "........" */
|
||||
0x23,0x22,0x21,0x20,0x1F,0x1E,0x1D,0x1C, /* 00000158 "#"! ...." */
|
||||
0x1B,0x1A,0x19,0x18,0x17,0x16,0x10,0x0A, /* 00000160 "........" */
|
||||
0x15,0x16,0x17,0x18,0x24,0x23,0x22,0x21, /* 00000168 "....$#"!" */
|
||||
0x20,0x1F,0x1E,0x1D,0x1C,0x1B,0x1A,0x19, /* 00000170 " ......." */
|
||||
0x18,0x17,0x16,0x15,0x0A,0x10,0x16,0x17, /* 00000178 "........" */
|
||||
0x25,0x24,0x23,0x22,0x21,0x20,0x1F,0x1E, /* 00000180 "%$#"! .." */
|
||||
0x1D,0x1C,0x1B,0x1A,0x19,0x18,0x17,0x16, /* 00000188 "........" */
|
||||
0x10,0x0A,0x15,0x16,0x26,0x25,0x24,0x23, /* 00000190 "....&%$#" */
|
||||
0x22,0x21,0x20,0x1F,0x1E,0x1D,0x1C,0x1B, /* 00000198 ""! ....." */
|
||||
0x1A,0x19,0x18,0x17,0x16,0x15,0x0A,0x10, /* 000001A0 "........" */
|
||||
0x27,0x26,0x25,0x24,0x23,0x22,0x21,0x20, /* 000001A8 "'&%$#"! " */
|
||||
0x1F,0x1E,0x1D,0x1C,0x1B,0x1A,0x19,0x18, /* 000001B0 "........" */
|
||||
0x17,0x16,0x10,0x0A /* 000001B8 "...." */
|
||||
};
|
||||
|
||||
const unsigned char TemplateSpcr[] =
|
||||
{
|
||||
0x53,0x50,0x43,0x52,0x50,0x00,0x00,0x00, /* 00000000 "SPCRP..." */
|
||||
0x01,0xE3,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "..INTEL " */
|
||||
0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */
|
||||
0x00,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */
|
||||
0x28,0x05,0x10,0x20,0x00,0x00,0x00,0x00, /* 00000020 "(.. ...." */
|
||||
0x00,0x08,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000028 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000030 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000038 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000040 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 /* 00000048 "........" */
|
||||
};
|
||||
|
||||
const unsigned char TemplateSpmi[] =
|
||||
{
|
||||
0x53,0x50,0x4D,0x49,0x41,0x00,0x00,0x00, /* 00000000 "SPMIA..." */
|
||||
0x04,0xED,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "..INTEL " */
|
||||
0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */
|
||||
0x00,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */
|
||||
0x28,0x05,0x10,0x20,0x00,0x00,0x00,0x00, /* 00000020 "(.. ...." */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000028 "........" */
|
||||
0x00,0x08,0x00,0x01,0x00,0x00,0x00,0x00, /* 00000030 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000038 "........" */
|
||||
0x00 /* 00000040 "." */
|
||||
};
|
||||
|
||||
const unsigned char TemplateSrat[] =
|
||||
{
|
||||
0x53,0x52,0x41,0x54,0x80,0x00,0x00,0x00, /* 00000000 "SRAT...." */
|
||||
0x03,0x5A,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 ".ZINTEL " */
|
||||
0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */
|
||||
0x01,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */
|
||||
0x28,0x05,0x10,0x20,0x01,0x00,0x00,0x00, /* 00000020 "(.. ...." */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000028 "........" */
|
||||
0x00,0x10,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000030 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000038 "........" */
|
||||
0x01,0x28,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000040 ".(......" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000048 "........" */
|
||||
0x00,0xFC,0x09,0x00,0x00,0x00,0x00,0x00, /* 00000050 "........" */
|
||||
0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000058 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000060 "........" */
|
||||
0x02,0x18,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000068 "........" */
|
||||
0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000070 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 /* 00000078 "........" */
|
||||
};
|
||||
|
||||
const unsigned char TemplateTcpa[] =
|
||||
{
|
||||
0x54,0x43,0x50,0x41,0x32,0x00,0x00,0x00, /* 00000000 "TCPA2..." */
|
||||
0x01,0x67,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 ".gINTEL " */
|
||||
0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */
|
||||
0x80,0x31,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 ".1..INTL" */
|
||||
0x28,0x05,0x10,0x20,0x00,0x00,0x00,0x00, /* 00000020 "(.. ...." */
|
||||
0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00, /* 00000028 "........" */
|
||||
0x00,0x00 /* 00000030 ".." */
|
||||
};
|
||||
|
||||
const unsigned char TemplateUefi[] =
|
||||
{
|
||||
0x55,0x45,0x46,0x49,0x36,0x00,0x00,0x00, /* 00000000 "UEFI6..." */
|
||||
0x01,0x9B,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "..INTEL " */
|
||||
0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */
|
||||
0x01,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */
|
||||
0x28,0x05,0x10,0x20,0x00,0x01,0x02,0x03, /* 00000020 "(.. ...." */
|
||||
0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B, /* 00000028 "........" */
|
||||
0x0C,0x0D,0x0E,0x0F,0x00,0x00 /* 00000030 "......" */
|
||||
};
|
||||
|
||||
const unsigned char TemplateWaet[] =
|
||||
{
|
||||
0x57,0x41,0x45,0x54,0x28,0x00,0x00,0x00, /* 00000000 "WAET(..." */
|
||||
0x01,0x19,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "..INTEL " */
|
||||
0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */
|
||||
0x01,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */
|
||||
0x28,0x05,0x10,0x20,0x00,0x00,0x00,0x00 /* 00000020 "(.. ...." */
|
||||
};
|
||||
|
||||
const unsigned char TemplateWdat[] =
|
||||
{
|
||||
0x57,0x44,0x41,0x54,0x5C,0x00,0x00,0x00, /* 00000000 "WDAT\..." */
|
||||
0x01,0xE3,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "..INTEL " */
|
||||
0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */
|
||||
0x00,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */
|
||||
0x28,0x05,0x10,0x20,0x20,0x00,0x00,0x00, /* 00000020 "(.. ..." */
|
||||
0xFF,0x00,0xFF,0xFF,0xFF,0x00,0x00,0x00, /* 00000028 "........" */
|
||||
0x58,0x02,0x00,0x00,0xFF,0x03,0x00,0x00, /* 00000030 "X......." */
|
||||
0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000038 "........" */
|
||||
0x0E,0x00,0x00,0x00,0x01,0x02,0x00,0x00, /* 00000040 "........" */
|
||||
0x01,0x10,0x00,0x02,0x60,0x04,0x00,0x00, /* 00000048 "....`..." */
|
||||
0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000050 "........" */
|
||||
0x01,0x00,0x00,0x00 /* 00000058 "...." */
|
||||
};
|
||||
|
||||
const unsigned char TemplateWddt[] =
|
||||
{
|
||||
0x57,0x44,0x44,0x54,0x40,0x00,0x00,0x00, /* 00000000 "WDDT@..." */
|
||||
0x01,0x00,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "..INTEL " */
|
||||
0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */
|
||||
0x00,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */
|
||||
0x28,0x05,0x10,0x20,0x00,0x00,0x00,0x00, /* 00000020 "(.. ...." */
|
||||
0x00,0x00,0x01,0xFF,0x00,0x00,0x00,0x00, /* 00000028 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000030 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 /* 00000038 "........" */
|
||||
};
|
||||
|
||||
const unsigned char TemplateWdrt[] =
|
||||
{
|
||||
0x57,0x44,0x52,0x54,0x47,0x00,0x00,0x00, /* 00000000 "WDRTG..." */
|
||||
0x01,0xB0,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "..INTEL " */
|
||||
0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */
|
||||
0x01,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */
|
||||
0x28,0x05,0x10,0x20,0x00,0x20,0x00,0x00, /* 00000020 "(.. . .." */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000028 "........" */
|
||||
0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000030 ". ......" */
|
||||
0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF, /* 00000038 "........" */
|
||||
0x00,0x00,0x00,0x00,0xFF,0xFF,0x00 /* 00000040 "......." */
|
||||
};
|
||||
|
||||
const unsigned char TemplateXsdt[] =
|
||||
{
|
||||
0x58,0x53,0x44,0x54,0x64,0x00,0x00,0x00, /* 00000000 "XSDTd..." */
|
||||
0x01,0x8B,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "..INTEL " */
|
||||
0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */
|
||||
0x01,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */
|
||||
0x28,0x05,0x10,0x20,0x10,0x00,0x00,0x00, /* 00000020 "(.. ...." */
|
||||
0x00,0x00,0x00,0x00,0x20,0x00,0x00,0x00, /* 00000028 ".... ..." */
|
||||
0x00,0x00,0x00,0x00,0x30,0x00,0x00,0x00, /* 00000030 "....0..." */
|
||||
0x00,0x00,0x00,0x00,0x40,0x00,0x00,0x00, /* 00000038 "....@..." */
|
||||
0x00,0x00,0x00,0x00,0x50,0x00,0x00,0x00, /* 00000040 "....P..." */
|
||||
0x00,0x00,0x00,0x00,0x60,0x00,0x00,0x00, /* 00000048 "....`..." */
|
||||
0x00,0x00,0x00,0x00,0x70,0x00,0x00,0x00, /* 00000050 "....p..." */
|
||||
0x00,0x00,0x00,0x00,0x80,0x00,0x00,0x00, /* 00000058 "........" */
|
||||
0x00,0x00,0x00,0x00 /* 00000060 "...." */
|
||||
};
|
||||
|
||||
#endif
|
|
@ -8,7 +8,7 @@
|
|||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
|
@ -261,8 +261,16 @@ DtFatal (
|
|||
|
||||
DtError (ASL_ERROR, MessageId, FieldObject, ExtraMessage);
|
||||
|
||||
/*
|
||||
* TBD: remove this entire function, DtFatal
|
||||
*
|
||||
* We cannot abort the compiler on error, because we may be compiling a
|
||||
* list of files. We must move on to the next file.
|
||||
*/
|
||||
#ifdef __OBSOLETE
|
||||
CmCleanupAndExit ();
|
||||
exit (1);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
@ -388,7 +396,6 @@ DtGetFileSize (
|
|||
* FUNCTION: DtGetFieldValue
|
||||
*
|
||||
* PARAMETERS: Field - Current field list pointer
|
||||
* Name - Field name
|
||||
*
|
||||
* RETURN: Field value
|
||||
*
|
||||
|
@ -398,23 +405,14 @@ DtGetFileSize (
|
|||
|
||||
char *
|
||||
DtGetFieldValue (
|
||||
DT_FIELD *Field,
|
||||
char *Name)
|
||||
DT_FIELD *Field)
|
||||
{
|
||||
|
||||
/* Search the field list for the name */
|
||||
|
||||
while (Field)
|
||||
if (!Field)
|
||||
{
|
||||
if (!ACPI_STRCMP (Name, Field->Name))
|
||||
{
|
||||
return (Field->Value);
|
||||
}
|
||||
|
||||
Field = Field->Next;
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
return (NULL);
|
||||
return (Field->Value);
|
||||
}
|
||||
|
||||
|
||||
|
@ -471,12 +469,11 @@ DtGetFieldType (
|
|||
break;
|
||||
|
||||
case ACPI_DMT_BUFFER:
|
||||
case ACPI_DMT_BUF7:
|
||||
case ACPI_DMT_BUF16:
|
||||
Type = DT_FIELD_TYPE_BUFFER;
|
||||
break;
|
||||
|
||||
case ACPI_DMT_BUF128:
|
||||
case ACPI_DMT_PCI_PATH:
|
||||
Type = DT_FIELD_TYPE_PCI_PATH;
|
||||
Type = DT_FIELD_TYPE_BUFFER;
|
||||
break;
|
||||
|
||||
case ACPI_DMT_GAS:
|
||||
|
@ -484,6 +481,22 @@ DtGetFieldType (
|
|||
Type = DT_FIELD_TYPE_INLINE_SUBTABLE;
|
||||
break;
|
||||
|
||||
case ACPI_DMT_UNICODE:
|
||||
Type = DT_FIELD_TYPE_UNICODE;
|
||||
break;
|
||||
|
||||
case ACPI_DMT_UUID:
|
||||
Type = DT_FIELD_TYPE_UUID;
|
||||
break;
|
||||
|
||||
case ACPI_DMT_DEVICE_PATH:
|
||||
Type = DT_FIELD_TYPE_DEVICE_PATH;
|
||||
break;
|
||||
|
||||
case ACPI_DMT_LABEL:
|
||||
Type = DT_FIELD_TYPE_LABEL;
|
||||
break;
|
||||
|
||||
default:
|
||||
Type = DT_FIELD_TYPE_INTEGER;
|
||||
break;
|
||||
|
@ -536,13 +549,15 @@ DtGetBufferLength (
|
|||
*
|
||||
* FUNCTION: DtGetFieldLength
|
||||
*
|
||||
* PARAMETERS: Field - Current field list pointer
|
||||
* PARAMETERS: Field - Current field
|
||||
* Info - Data table info
|
||||
*
|
||||
* RETURN: Field length
|
||||
*
|
||||
* DESCRIPTION: Get length of bytes needed to compile the field
|
||||
*
|
||||
* Note: This function must remain in sync with AcpiDmDumpTable.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
UINT32
|
||||
|
@ -568,18 +583,24 @@ DtGetFieldLength (
|
|||
case ACPI_DMT_FLAG7:
|
||||
case ACPI_DMT_FLAGS0:
|
||||
case ACPI_DMT_FLAGS2:
|
||||
case ACPI_DMT_LABEL:
|
||||
ByteLength = 0;
|
||||
break;
|
||||
|
||||
case ACPI_DMT_UINT8:
|
||||
case ACPI_DMT_CHKSUM:
|
||||
case ACPI_DMT_SPACEID:
|
||||
case ACPI_DMT_ACCWIDTH:
|
||||
case ACPI_DMT_IVRS:
|
||||
case ACPI_DMT_MADT:
|
||||
case ACPI_DMT_SRAT:
|
||||
case ACPI_DMT_ASF:
|
||||
case ACPI_DMT_HESTNTYP:
|
||||
case ACPI_DMT_FADTPM:
|
||||
case ACPI_DMT_IVRS:
|
||||
case ACPI_DMT_EINJACT:
|
||||
case ACPI_DMT_EINJINST:
|
||||
case ACPI_DMT_ERSTACT:
|
||||
case ACPI_DMT_ERSTINST:
|
||||
ByteLength = 1;
|
||||
break;
|
||||
|
||||
|
@ -596,6 +617,7 @@ DtGetFieldLength (
|
|||
|
||||
case ACPI_DMT_UINT32:
|
||||
case ACPI_DMT_NAME4:
|
||||
case ACPI_DMT_SLIC:
|
||||
case ACPI_DMT_SIG:
|
||||
ByteLength = 4;
|
||||
break;
|
||||
|
@ -605,6 +627,7 @@ DtGetFieldLength (
|
|||
break;
|
||||
|
||||
case ACPI_DMT_UINT56:
|
||||
case ACPI_DMT_BUF7:
|
||||
ByteLength = 7;
|
||||
break;
|
||||
|
||||
|
@ -614,11 +637,18 @@ DtGetFieldLength (
|
|||
break;
|
||||
|
||||
case ACPI_DMT_STRING:
|
||||
Value = DtGetFieldValue (Field, Info->Name);
|
||||
Value = DtGetFieldValue (Field);
|
||||
if (Value)
|
||||
{
|
||||
ByteLength = ACPI_STRLEN (Value) + 1;
|
||||
}
|
||||
else
|
||||
{ /* At this point, this is a fatal error */
|
||||
|
||||
/* TBD: error if Value is NULL? (as below?) */
|
||||
|
||||
ByteLength = ACPI_STRLEN (Value) + 1;
|
||||
sprintf (MsgBuffer, "Expected \"%s\"", Info->Name);
|
||||
DtFatal (ASL_MSG_COMPILER_INTERNAL, NULL, MsgBuffer);
|
||||
return (0);
|
||||
}
|
||||
break;
|
||||
|
||||
case ACPI_DMT_GAS:
|
||||
|
@ -630,7 +660,7 @@ DtGetFieldLength (
|
|||
break;
|
||||
|
||||
case ACPI_DMT_BUFFER:
|
||||
Value = DtGetFieldValue (Field, Info->Name);
|
||||
Value = DtGetFieldValue (Field);
|
||||
if (Value)
|
||||
{
|
||||
ByteLength = DtGetBufferLength (Value);
|
||||
|
@ -640,16 +670,30 @@ DtGetFieldLength (
|
|||
|
||||
sprintf (MsgBuffer, "Expected \"%s\"", Info->Name);
|
||||
DtFatal (ASL_MSG_COMPILER_INTERNAL, NULL, MsgBuffer);
|
||||
return (0);
|
||||
}
|
||||
break;
|
||||
|
||||
case ACPI_DMT_BUF16:
|
||||
case ACPI_DMT_UUID:
|
||||
ByteLength = 16;
|
||||
break;
|
||||
|
||||
case ACPI_DMT_BUF128:
|
||||
ByteLength = 128;
|
||||
break;
|
||||
|
||||
case ACPI_DMT_UNICODE:
|
||||
Value = DtGetFieldValue (Field);
|
||||
|
||||
/* TBD: error if Value is NULL? (as below?) */
|
||||
|
||||
ByteLength = (ACPI_STRLEN (Value) + 1) * sizeof(UINT16);
|
||||
break;
|
||||
|
||||
default:
|
||||
DtFatal (ASL_MSG_COMPILER_INTERNAL, Field, "Invalid table opcode");
|
||||
break;
|
||||
return (0);
|
||||
}
|
||||
|
||||
return (ByteLength);
|
||||
|
@ -753,6 +797,11 @@ DtSetTableLength (
|
|||
ChildTable = DtGetNextSubtable (ParentTable, ChildTable);
|
||||
if (ChildTable)
|
||||
{
|
||||
if (ChildTable->LengthField)
|
||||
{
|
||||
DtSetSubtableLength (ChildTable);
|
||||
}
|
||||
|
||||
if (ChildTable->Child)
|
||||
{
|
||||
ParentTable = ChildTable;
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -8,7 +8,7 @@
|
|||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
|
@ -141,6 +141,50 @@ AcpiDbGetPointer (
|
|||
void *Target);
|
||||
|
||||
|
||||
/*
|
||||
* System handler information.
|
||||
* Used for Handlers command, in AcpiDbDisplayHandlers.
|
||||
*/
|
||||
#define ACPI_PREDEFINED_PREFIX "%25s (%.2X) : "
|
||||
#define ACPI_HANDLER_NAME_STRING "%30s : "
|
||||
#define ACPI_HANDLER_PRESENT_STRING "%-9s (%p)\n"
|
||||
#define ACPI_HANDLER_NOT_PRESENT_STRING "%-9s\n"
|
||||
|
||||
/* All predefined Address Space IDs */
|
||||
|
||||
static ACPI_ADR_SPACE_TYPE AcpiGbl_SpaceIdList[] =
|
||||
{
|
||||
ACPI_ADR_SPACE_SYSTEM_MEMORY,
|
||||
ACPI_ADR_SPACE_SYSTEM_IO,
|
||||
ACPI_ADR_SPACE_PCI_CONFIG,
|
||||
ACPI_ADR_SPACE_EC,
|
||||
ACPI_ADR_SPACE_SMBUS,
|
||||
ACPI_ADR_SPACE_CMOS,
|
||||
ACPI_ADR_SPACE_PCI_BAR_TARGET,
|
||||
ACPI_ADR_SPACE_IPMI,
|
||||
ACPI_ADR_SPACE_DATA_TABLE,
|
||||
ACPI_ADR_SPACE_FIXED_HARDWARE
|
||||
};
|
||||
|
||||
/* Global handler information */
|
||||
|
||||
typedef struct acpi_handler_info
|
||||
{
|
||||
void *Handler;
|
||||
char *Name;
|
||||
|
||||
} ACPI_HANDLER_INFO;
|
||||
|
||||
static ACPI_HANDLER_INFO AcpiGbl_HandlerList[] =
|
||||
{
|
||||
{&AcpiGbl_SystemNotify.Handler, "System Notifications"},
|
||||
{&AcpiGbl_DeviceNotify.Handler, "Device Notifications"},
|
||||
{&AcpiGbl_TableHandler, "ACPI Table Events"},
|
||||
{&AcpiGbl_ExceptionHandler, "Control Method Exceptions"},
|
||||
{&AcpiGbl_InterfaceHandler, "OSI Invocations"}
|
||||
};
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiDbGetPointer
|
||||
|
@ -896,7 +940,8 @@ AcpiDbDisplayGpes (
|
|||
GpeIndex = (i * ACPI_GPE_REGISTER_WIDTH) + j;
|
||||
GpeEventInfo = &GpeBlock->EventInfo[GpeIndex];
|
||||
|
||||
if (!(GpeEventInfo->Flags & ACPI_GPE_DISPATCH_MASK))
|
||||
if ((GpeEventInfo->Flags & ACPI_GPE_DISPATCH_MASK) ==
|
||||
ACPI_GPE_DISPATCH_NONE)
|
||||
{
|
||||
/* This GPE is not used (no method or handler), ignore it */
|
||||
|
||||
|
@ -904,10 +949,9 @@ AcpiDbDisplayGpes (
|
|||
}
|
||||
|
||||
AcpiOsPrintf (
|
||||
" GPE %.2X: %p RunRefs %2.2X WakeRefs %2.2X Flags %2.2X (",
|
||||
" GPE %.2X: %p RunRefs %2.2X Flags %2.2X (",
|
||||
GpeBlock->BlockBaseNumber + GpeIndex, GpeEventInfo,
|
||||
GpeEventInfo->RuntimeCount, GpeEventInfo->WakeupCount,
|
||||
GpeEventInfo->Flags);
|
||||
GpeEventInfo->RuntimeCount, GpeEventInfo->Flags);
|
||||
|
||||
/* Decode the flags byte */
|
||||
|
||||
|
@ -931,14 +975,17 @@ AcpiDbDisplayGpes (
|
|||
|
||||
switch (GpeEventInfo->Flags & ACPI_GPE_DISPATCH_MASK)
|
||||
{
|
||||
case ACPI_GPE_DISPATCH_NOT_USED:
|
||||
case ACPI_GPE_DISPATCH_NONE:
|
||||
AcpiOsPrintf ("NotUsed");
|
||||
break;
|
||||
case ACPI_GPE_DISPATCH_METHOD:
|
||||
AcpiOsPrintf ("Method");
|
||||
break;
|
||||
case ACPI_GPE_DISPATCH_HANDLER:
|
||||
AcpiOsPrintf ("Handler");
|
||||
break;
|
||||
case ACPI_GPE_DISPATCH_METHOD:
|
||||
AcpiOsPrintf ("Method");
|
||||
case ACPI_GPE_DISPATCH_NOTIFY:
|
||||
AcpiOsPrintf ("Notify");
|
||||
break;
|
||||
default:
|
||||
AcpiOsPrintf ("UNKNOWN: %X",
|
||||
|
@ -956,5 +1003,101 @@ AcpiDbDisplayGpes (
|
|||
}
|
||||
}
|
||||
|
||||
#endif /* ACPI_DEBUGGER */
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiDbDisplayHandlers
|
||||
*
|
||||
* PARAMETERS: None
|
||||
*
|
||||
* RETURN: None
|
||||
*
|
||||
* DESCRIPTION: Display the currently installed global handlers
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
void
|
||||
AcpiDbDisplayHandlers (
|
||||
void)
|
||||
{
|
||||
ACPI_OPERAND_OBJECT *ObjDesc;
|
||||
ACPI_OPERAND_OBJECT *HandlerObj;
|
||||
ACPI_ADR_SPACE_TYPE SpaceId;
|
||||
UINT32 i;
|
||||
|
||||
|
||||
/* Operation region handlers */
|
||||
|
||||
AcpiOsPrintf ("\nOperation Region Handlers:\n");
|
||||
|
||||
ObjDesc = AcpiNsGetAttachedObject (AcpiGbl_RootNode);
|
||||
if (ObjDesc)
|
||||
{
|
||||
for (i = 0; i < ACPI_ARRAY_LENGTH (AcpiGbl_SpaceIdList); i++)
|
||||
{
|
||||
SpaceId = AcpiGbl_SpaceIdList[i];
|
||||
HandlerObj = ObjDesc->Device.Handler;
|
||||
|
||||
AcpiOsPrintf (ACPI_PREDEFINED_PREFIX,
|
||||
AcpiUtGetRegionName ((UINT8) SpaceId), SpaceId);
|
||||
|
||||
while (HandlerObj)
|
||||
{
|
||||
if (i == HandlerObj->AddressSpace.SpaceId)
|
||||
{
|
||||
AcpiOsPrintf (ACPI_HANDLER_PRESENT_STRING,
|
||||
(HandlerObj->AddressSpace.HandlerFlags &
|
||||
ACPI_ADDR_HANDLER_DEFAULT_INSTALLED) ? "Default" : "User",
|
||||
HandlerObj->AddressSpace.Handler);
|
||||
goto FoundHandler;
|
||||
}
|
||||
|
||||
HandlerObj = HandlerObj->AddressSpace.Next;
|
||||
}
|
||||
|
||||
/* There is no handler for this SpaceId */
|
||||
|
||||
AcpiOsPrintf ("None\n");
|
||||
|
||||
FoundHandler:;
|
||||
}
|
||||
}
|
||||
|
||||
/* Fixed event handlers */
|
||||
|
||||
AcpiOsPrintf ("\nFixed Event Handlers:\n");
|
||||
|
||||
for (i = 0; i < ACPI_NUM_FIXED_EVENTS; i++)
|
||||
{
|
||||
AcpiOsPrintf (ACPI_PREDEFINED_PREFIX, AcpiUtGetEventName (i), i);
|
||||
if (AcpiGbl_FixedEventHandlers[i].Handler)
|
||||
{
|
||||
AcpiOsPrintf (ACPI_HANDLER_PRESENT_STRING, "User",
|
||||
AcpiGbl_FixedEventHandlers[i].Handler);
|
||||
}
|
||||
else
|
||||
{
|
||||
AcpiOsPrintf (ACPI_HANDLER_NOT_PRESENT_STRING, "None");
|
||||
}
|
||||
}
|
||||
|
||||
/* Miscellaneous global handlers */
|
||||
|
||||
AcpiOsPrintf ("\nMiscellaneous Global Handlers:\n");
|
||||
|
||||
for (i = 0; i < ACPI_ARRAY_LENGTH (AcpiGbl_HandlerList); i++)
|
||||
{
|
||||
AcpiOsPrintf (ACPI_HANDLER_NAME_STRING, AcpiGbl_HandlerList[i].Name);
|
||||
if (AcpiGbl_HandlerList[i].Handler)
|
||||
{
|
||||
AcpiOsPrintf (ACPI_HANDLER_PRESENT_STRING, "User",
|
||||
AcpiGbl_HandlerList[i].Handler);
|
||||
}
|
||||
else
|
||||
{
|
||||
AcpiOsPrintf (ACPI_HANDLER_NOT_PRESENT_STRING, "None");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* ACPI_DEBUGGER */
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
|
@ -125,7 +125,8 @@
|
|||
ACPI_MODULE_NAME ("dbexec")
|
||||
|
||||
|
||||
static ACPI_DB_METHOD_INFO AcpiGbl_DbMethodInfo;
|
||||
static ACPI_DB_METHOD_INFO AcpiGbl_DbMethodInfo;
|
||||
#define DB_DEFAULT_PKG_ELEMENTS 33
|
||||
|
||||
/* Local prototypes */
|
||||
|
||||
|
@ -153,6 +154,348 @@ AcpiDbExecutionWalk (
|
|||
void *Context,
|
||||
void **ReturnValue);
|
||||
|
||||
static ACPI_STATUS
|
||||
AcpiDbHexCharToValue (
|
||||
int HexChar,
|
||||
UINT8 *ReturnValue);
|
||||
|
||||
static ACPI_STATUS
|
||||
AcpiDbConvertToPackage (
|
||||
char *String,
|
||||
ACPI_OBJECT *Object);
|
||||
|
||||
static ACPI_STATUS
|
||||
AcpiDbConvertToObject (
|
||||
ACPI_OBJECT_TYPE Type,
|
||||
char *String,
|
||||
ACPI_OBJECT *Object);
|
||||
|
||||
static void
|
||||
AcpiDbDeleteObjects (
|
||||
UINT32 Count,
|
||||
ACPI_OBJECT *Objects);
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiDbHexCharToValue
|
||||
*
|
||||
* PARAMETERS: HexChar - Ascii Hex digit, 0-9|a-f|A-F
|
||||
* ReturnValue - Where the converted value is returned
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Convert a single hex character to a 4-bit number (0-16).
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
static ACPI_STATUS
|
||||
AcpiDbHexCharToValue (
|
||||
int HexChar,
|
||||
UINT8 *ReturnValue)
|
||||
{
|
||||
UINT8 Value;
|
||||
|
||||
|
||||
/* Digit must be ascii [0-9a-fA-F] */
|
||||
|
||||
if (!ACPI_IS_XDIGIT (HexChar))
|
||||
{
|
||||
return (AE_BAD_HEX_CONSTANT);
|
||||
}
|
||||
|
||||
if (HexChar <= 0x39)
|
||||
{
|
||||
Value = (UINT8) (HexChar - 0x30);
|
||||
}
|
||||
else
|
||||
{
|
||||
Value = (UINT8) (ACPI_TOUPPER (HexChar) - 0x37);
|
||||
}
|
||||
|
||||
*ReturnValue = Value;
|
||||
return (AE_OK);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiDbHexByteToBinary
|
||||
*
|
||||
* PARAMETERS: HexByte - Double hex digit (0x00 - 0xFF) in format:
|
||||
* HiByte then LoByte.
|
||||
* ReturnValue - Where the converted value is returned
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Convert two hex characters to an 8 bit number (0 - 255).
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
static ACPI_STATUS
|
||||
AcpiDbHexByteToBinary (
|
||||
char *HexByte,
|
||||
UINT8 *ReturnValue)
|
||||
{
|
||||
UINT8 Local0;
|
||||
UINT8 Local1;
|
||||
ACPI_STATUS Status;
|
||||
|
||||
|
||||
/* High byte */
|
||||
|
||||
Status = AcpiDbHexCharToValue (HexByte[0], &Local0);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return (Status);
|
||||
}
|
||||
|
||||
/* Low byte */
|
||||
|
||||
Status = AcpiDbHexCharToValue (HexByte[1], &Local1);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return (Status);
|
||||
}
|
||||
|
||||
*ReturnValue = (UINT8) ((Local0 << 4) | Local1);
|
||||
return (AE_OK);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiDbConvertToBuffer
|
||||
*
|
||||
* PARAMETERS: String - Input string to be converted
|
||||
* Object - Where the buffer object is returned
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Convert a string to a buffer object. String is treated a list
|
||||
* of buffer elements, each separated by a space or comma.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
static ACPI_STATUS
|
||||
AcpiDbConvertToBuffer (
|
||||
char *String,
|
||||
ACPI_OBJECT *Object)
|
||||
{
|
||||
UINT32 i;
|
||||
UINT32 j;
|
||||
UINT32 Length;
|
||||
UINT8 *Buffer;
|
||||
ACPI_STATUS Status;
|
||||
|
||||
|
||||
/* Generate the final buffer length */
|
||||
|
||||
for (i = 0, Length = 0; String[i];)
|
||||
{
|
||||
i+=2;
|
||||
Length++;
|
||||
|
||||
while (String[i] &&
|
||||
((String[i] == ',') || (String[i] == ' ')))
|
||||
{
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
Buffer = ACPI_ALLOCATE (Length);
|
||||
if (!Buffer)
|
||||
{
|
||||
return (AE_NO_MEMORY);
|
||||
}
|
||||
|
||||
/* Convert the command line bytes to the buffer */
|
||||
|
||||
for (i = 0, j = 0; String[i];)
|
||||
{
|
||||
Status = AcpiDbHexByteToBinary (&String[i], &Buffer[j]);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
ACPI_FREE (Buffer);
|
||||
return (Status);
|
||||
}
|
||||
|
||||
j++;
|
||||
i+=2;
|
||||
while (String[i] &&
|
||||
((String[i] == ',') || (String[i] == ' ')))
|
||||
{
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
Object->Type = ACPI_TYPE_BUFFER;
|
||||
Object->Buffer.Pointer = Buffer;
|
||||
Object->Buffer.Length = Length;
|
||||
return (AE_OK);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiDbConvertToPackage
|
||||
*
|
||||
* PARAMETERS: String - Input string to be converted
|
||||
* Object - Where the package object is returned
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Convert a string to a package object. Handles nested packages
|
||||
* via recursion with AcpiDbConvertToObject.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
static ACPI_STATUS
|
||||
AcpiDbConvertToPackage (
|
||||
char *String,
|
||||
ACPI_OBJECT *Object)
|
||||
{
|
||||
char *This;
|
||||
char *Next;
|
||||
UINT32 i;
|
||||
ACPI_OBJECT_TYPE Type;
|
||||
ACPI_OBJECT *Elements;
|
||||
ACPI_STATUS Status;
|
||||
|
||||
|
||||
Elements = ACPI_ALLOCATE_ZEROED (
|
||||
DB_DEFAULT_PKG_ELEMENTS * sizeof (ACPI_OBJECT));
|
||||
|
||||
This = String;
|
||||
for (i = 0; i < (DB_DEFAULT_PKG_ELEMENTS - 1); i++)
|
||||
{
|
||||
This = AcpiDbGetNextToken (This, &Next, &Type);
|
||||
if (!This)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
/* Recursive call to convert each package element */
|
||||
|
||||
Status = AcpiDbConvertToObject (Type, This, &Elements[i]);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
AcpiDbDeleteObjects (i + 1, Elements);
|
||||
ACPI_FREE (Elements);
|
||||
return (Status);
|
||||
}
|
||||
|
||||
This = Next;
|
||||
}
|
||||
|
||||
Object->Type = ACPI_TYPE_PACKAGE;
|
||||
Object->Package.Count = i;
|
||||
Object->Package.Elements = Elements;
|
||||
return (AE_OK);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiDbConvertToObject
|
||||
*
|
||||
* PARAMETERS: Type - Object type as determined by parser
|
||||
* String - Input string to be converted
|
||||
* Object - Where the new object is returned
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Convert a typed and tokenized string to an ACPI_OBJECT. Typing:
|
||||
* 1) String objects were surrounded by quotes.
|
||||
* 2) Buffer objects were surrounded by parentheses.
|
||||
* 3) Package objects were surrounded by brackets "[]".
|
||||
* 4) All standalone tokens are treated as integers.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
static ACPI_STATUS
|
||||
AcpiDbConvertToObject (
|
||||
ACPI_OBJECT_TYPE Type,
|
||||
char *String,
|
||||
ACPI_OBJECT *Object)
|
||||
{
|
||||
ACPI_STATUS Status = AE_OK;
|
||||
|
||||
|
||||
switch (Type)
|
||||
{
|
||||
case ACPI_TYPE_STRING:
|
||||
Object->Type = ACPI_TYPE_STRING;
|
||||
Object->String.Pointer = String;
|
||||
Object->String.Length = (UINT32) ACPI_STRLEN (String);
|
||||
break;
|
||||
|
||||
case ACPI_TYPE_BUFFER:
|
||||
Status = AcpiDbConvertToBuffer (String, Object);
|
||||
break;
|
||||
|
||||
case ACPI_TYPE_PACKAGE:
|
||||
Status = AcpiDbConvertToPackage (String, Object);
|
||||
break;
|
||||
|
||||
default:
|
||||
Object->Type = ACPI_TYPE_INTEGER;
|
||||
Status = AcpiUtStrtoul64 (String, 16, &Object->Integer.Value);
|
||||
break;
|
||||
}
|
||||
|
||||
return (Status);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiDbDeleteObjects
|
||||
*
|
||||
* PARAMETERS: Count - Count of objects in the list
|
||||
* Objects - Array of ACPI_OBJECTs to be deleted
|
||||
*
|
||||
* RETURN: None
|
||||
*
|
||||
* DESCRIPTION: Delete a list of ACPI_OBJECTS. Handles packages and nested
|
||||
* packages via recursion.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
static void
|
||||
AcpiDbDeleteObjects (
|
||||
UINT32 Count,
|
||||
ACPI_OBJECT *Objects)
|
||||
{
|
||||
UINT32 i;
|
||||
|
||||
|
||||
for (i = 0; i < Count; i++)
|
||||
{
|
||||
switch (Objects[i].Type)
|
||||
{
|
||||
case ACPI_TYPE_BUFFER:
|
||||
ACPI_FREE (Objects[i].Buffer.Pointer);
|
||||
break;
|
||||
|
||||
case ACPI_TYPE_PACKAGE:
|
||||
|
||||
/* Recursive call to delete package elements */
|
||||
|
||||
AcpiDbDeleteObjects (Objects[i].Package.Count,
|
||||
Objects[i].Package.Elements);
|
||||
|
||||
/* Free the elements array */
|
||||
|
||||
ACPI_FREE (Objects[i].Package.Elements);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
|
@ -176,8 +519,11 @@ AcpiDbExecuteMethod (
|
|||
ACPI_OBJECT_LIST ParamObjects;
|
||||
ACPI_OBJECT Params[ACPI_METHOD_NUM_ARGS];
|
||||
ACPI_HANDLE Handle;
|
||||
UINT32 i;
|
||||
ACPI_DEVICE_INFO *ObjInfo;
|
||||
UINT32 i;
|
||||
|
||||
|
||||
ACPI_FUNCTION_TRACE (DbExecuteMethod);
|
||||
|
||||
|
||||
if (AcpiGbl_DbOutputToFile && !AcpiDbgLevel)
|
||||
|
@ -190,7 +536,7 @@ AcpiDbExecuteMethod (
|
|||
Status = AcpiGetHandle (NULL, Info->Pathname, &Handle);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return (Status);
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
/* Get the object info for number of method parameters */
|
||||
|
@ -198,7 +544,7 @@ AcpiDbExecuteMethod (
|
|||
Status = AcpiGetObjectInfo (Handle, &ObjInfo);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return (Status);
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
ParamObjects.Pointer = NULL;
|
||||
|
@ -208,22 +554,37 @@ AcpiDbExecuteMethod (
|
|||
{
|
||||
/* Are there arguments to the method? */
|
||||
|
||||
i = 0;
|
||||
if (Info->Args && Info->Args[0])
|
||||
{
|
||||
for (i = 0; Info->Args[i] && i < ACPI_METHOD_NUM_ARGS; i++)
|
||||
/* Get arguments passed on the command line */
|
||||
|
||||
for (; Info->Args[i] &&
|
||||
(i < ACPI_METHOD_NUM_ARGS) &&
|
||||
(i < ObjInfo->ParamCount);
|
||||
i++)
|
||||
{
|
||||
Params[i].Type = ACPI_TYPE_INTEGER;
|
||||
Params[i].Integer.Value = ACPI_STRTOUL (Info->Args[i], NULL, 16);
|
||||
/* Convert input string (token) to an actual ACPI_OBJECT */
|
||||
|
||||
Status = AcpiDbConvertToObject (Info->Types[i],
|
||||
Info->Args[i], &Params[i]);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
ACPI_EXCEPTION ((AE_INFO, Status,
|
||||
"While parsing method arguments"));
|
||||
goto Cleanup;
|
||||
}
|
||||
}
|
||||
|
||||
ParamObjects.Pointer = Params;
|
||||
ParamObjects.Count = i;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Setup default parameters */
|
||||
|
||||
for (i = 0; i < ObjInfo->ParamCount; i++)
|
||||
/* Create additional "default" parameters as needed */
|
||||
|
||||
if (i < ObjInfo->ParamCount)
|
||||
{
|
||||
AcpiOsPrintf ("Adding %u arguments containing default values\n",
|
||||
ObjInfo->ParamCount - i);
|
||||
|
||||
for (; i < ObjInfo->ParamCount; i++)
|
||||
{
|
||||
switch (i)
|
||||
{
|
||||
|
@ -247,13 +608,11 @@ AcpiDbExecuteMethod (
|
|||
break;
|
||||
}
|
||||
}
|
||||
|
||||
ParamObjects.Pointer = Params;
|
||||
ParamObjects.Count = ObjInfo->ParamCount;
|
||||
}
|
||||
}
|
||||
|
||||
ACPI_FREE (ObjInfo);
|
||||
ParamObjects.Count = ObjInfo->ParamCount;
|
||||
ParamObjects.Pointer = Params;
|
||||
}
|
||||
|
||||
/* Prepare for a return object of arbitrary size */
|
||||
|
||||
|
@ -264,12 +623,29 @@ AcpiDbExecuteMethod (
|
|||
|
||||
AcpiGbl_MethodExecuting = TRUE;
|
||||
Status = AcpiEvaluateObject (NULL,
|
||||
Info->Pathname, &ParamObjects, ReturnObj);
|
||||
Info->Pathname, &ParamObjects, ReturnObj);
|
||||
|
||||
AcpiGbl_CmSingleStep = FALSE;
|
||||
AcpiGbl_MethodExecuting = FALSE;
|
||||
|
||||
return (Status);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
ACPI_EXCEPTION ((AE_INFO, Status,
|
||||
"while executing %s from debugger", Info->Pathname));
|
||||
|
||||
if (Status == AE_BUFFER_OVERFLOW)
|
||||
{
|
||||
ACPI_ERROR ((AE_INFO,
|
||||
"Possible overflow of internal debugger buffer (size 0x%X needed 0x%X)",
|
||||
ACPI_DEBUG_BUFFER_SIZE, (UINT32) ReturnObj->Length));
|
||||
}
|
||||
}
|
||||
|
||||
Cleanup:
|
||||
AcpiDbDeleteObjects (ObjInfo->ParamCount, Params);
|
||||
ACPI_FREE (ObjInfo);
|
||||
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
|
||||
|
@ -433,6 +809,7 @@ void
|
|||
AcpiDbExecute (
|
||||
char *Name,
|
||||
char **Args,
|
||||
ACPI_OBJECT_TYPE *Types,
|
||||
UINT32 Flags)
|
||||
{
|
||||
ACPI_STATUS Status;
|
||||
|
@ -470,6 +847,7 @@ AcpiDbExecute (
|
|||
AcpiUtStrupr (NameString);
|
||||
AcpiGbl_DbMethodInfo.Name = NameString;
|
||||
AcpiGbl_DbMethodInfo.Args = Args;
|
||||
AcpiGbl_DbMethodInfo.Types = Types;
|
||||
AcpiGbl_DbMethodInfo.Flags = Flags;
|
||||
|
||||
ReturnObj.Pointer = NULL;
|
||||
|
@ -567,14 +945,12 @@ AcpiDbMethodThread (
|
|||
if (Info->InitArgs)
|
||||
{
|
||||
AcpiDbUInt32ToHexString (Info->NumCreated, Info->IndexOfThreadStr);
|
||||
AcpiDbUInt32ToHexString (ACPI_TO_INTEGER (AcpiOsGetThreadId ()),
|
||||
Info->IdOfThreadStr);
|
||||
AcpiDbUInt32ToHexString ((UINT32) AcpiOsGetThreadId (), Info->IdOfThreadStr);
|
||||
}
|
||||
|
||||
if (Info->Threads && (Info->NumCreated < Info->NumThreads))
|
||||
{
|
||||
Info->Threads[Info->NumCreated++] =
|
||||
ACPI_TO_INTEGER (AcpiOsGetThreadId());
|
||||
Info->Threads[Info->NumCreated++] = AcpiOsGetThreadId();
|
||||
}
|
||||
|
||||
LocalInfo = *Info;
|
||||
|
@ -584,6 +960,8 @@ AcpiDbMethodThread (
|
|||
LocalInfo.Arguments[2] = LocalInfo.IndexOfThreadStr;
|
||||
LocalInfo.Arguments[3] = NULL;
|
||||
|
||||
LocalInfo.Types = LocalInfo.ArgTypes;
|
||||
|
||||
(void) AcpiOsSignalSemaphore (Info->InfoGate, 1);
|
||||
|
||||
for (i = 0; i < Info->NumLoops; i++)
|
||||
|
@ -722,8 +1100,8 @@ AcpiDbCreateExecutionThreads (
|
|||
/* Array to store IDs of threads */
|
||||
|
||||
AcpiGbl_DbMethodInfo.NumThreads = NumThreads;
|
||||
Size = 4 * AcpiGbl_DbMethodInfo.NumThreads;
|
||||
AcpiGbl_DbMethodInfo.Threads = (UINT32 *) AcpiOsAllocate (Size);
|
||||
Size = sizeof (ACPI_THREAD_ID) * AcpiGbl_DbMethodInfo.NumThreads;
|
||||
AcpiGbl_DbMethodInfo.Threads = AcpiOsAllocate (Size);
|
||||
if (AcpiGbl_DbMethodInfo.Threads == NULL)
|
||||
{
|
||||
AcpiOsPrintf ("No memory for thread IDs array\n");
|
||||
|
@ -751,6 +1129,12 @@ AcpiDbCreateExecutionThreads (
|
|||
AcpiGbl_DbMethodInfo.Arguments[1] = AcpiGbl_DbMethodInfo.IdOfThreadStr;
|
||||
AcpiGbl_DbMethodInfo.Arguments[2] = AcpiGbl_DbMethodInfo.IndexOfThreadStr;
|
||||
AcpiGbl_DbMethodInfo.Arguments[3] = NULL;
|
||||
|
||||
AcpiGbl_DbMethodInfo.Types = AcpiGbl_DbMethodInfo.ArgTypes;
|
||||
AcpiGbl_DbMethodInfo.ArgTypes[0] = ACPI_TYPE_INTEGER;
|
||||
AcpiGbl_DbMethodInfo.ArgTypes[1] = ACPI_TYPE_INTEGER;
|
||||
AcpiGbl_DbMethodInfo.ArgTypes[2] = ACPI_TYPE_INTEGER;
|
||||
|
||||
AcpiDbUInt32ToHexString (NumThreads, AcpiGbl_DbMethodInfo.NumThreadsStr);
|
||||
|
||||
AcpiDbExecuteSetup (&AcpiGbl_DbMethodInfo);
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
|
@ -126,11 +126,6 @@
|
|||
|
||||
/* Local prototypes */
|
||||
|
||||
static char *
|
||||
AcpiDbGetNextToken (
|
||||
char *String,
|
||||
char **Next);
|
||||
|
||||
static UINT32
|
||||
AcpiDbGetLine (
|
||||
char *InputBuffer);
|
||||
|
@ -145,7 +140,7 @@ AcpiDbSingleThread (
|
|||
|
||||
static void
|
||||
AcpiDbDisplayHelp (
|
||||
char *HelpType);
|
||||
void);
|
||||
|
||||
|
||||
/*
|
||||
|
@ -176,6 +171,7 @@ enum AcpiExDebuggerCommands
|
|||
CMD_GO,
|
||||
CMD_GPE,
|
||||
CMD_GPES,
|
||||
CMD_HANDLERS,
|
||||
CMD_HELP,
|
||||
CMD_HELP2,
|
||||
CMD_HISTORY,
|
||||
|
@ -194,6 +190,7 @@ enum AcpiExDebuggerCommands
|
|||
CMD_NOTIFY,
|
||||
CMD_OBJECT,
|
||||
CMD_OPEN,
|
||||
CMD_OSI,
|
||||
CMD_OWNER,
|
||||
CMD_PREDEFINED,
|
||||
CMD_PREFIX,
|
||||
|
@ -242,6 +239,7 @@ static const COMMAND_INFO AcpiGbl_DbCommands[] =
|
|||
{"GO", 0},
|
||||
{"GPE", 2},
|
||||
{"GPES", 0},
|
||||
{"HANDLERS", 0},
|
||||
{"HELP", 0},
|
||||
{"?", 0},
|
||||
{"HISTORY", 0},
|
||||
|
@ -260,6 +258,7 @@ static const COMMAND_INFO AcpiGbl_DbCommands[] =
|
|||
{"NOTIFY", 2},
|
||||
{"OBJECT", 1},
|
||||
{"OPEN", 1},
|
||||
{"OSI", 0},
|
||||
{"OWNER", 1},
|
||||
{"PREDEFINED", 0},
|
||||
{"PREFIX", 0},
|
||||
|
@ -286,7 +285,7 @@ static const COMMAND_INFO AcpiGbl_DbCommands[] =
|
|||
*
|
||||
* FUNCTION: AcpiDbDisplayHelp
|
||||
*
|
||||
* PARAMETERS: HelpType - Subcommand (optional)
|
||||
* PARAMETERS: None
|
||||
*
|
||||
* RETURN: None
|
||||
*
|
||||
|
@ -296,119 +295,84 @@ static const COMMAND_INFO AcpiGbl_DbCommands[] =
|
|||
|
||||
static void
|
||||
AcpiDbDisplayHelp (
|
||||
char *HelpType)
|
||||
void)
|
||||
{
|
||||
|
||||
AcpiUtStrupr (HelpType);
|
||||
AcpiOsPrintf ("\nGeneral-Purpose Commands:\n");
|
||||
AcpiOsPrintf (" Allocations Display list of current memory allocations\n");
|
||||
AcpiOsPrintf (" Dump <Address>|<Namepath>\n");
|
||||
AcpiOsPrintf (" [Byte|Word|Dword|Qword] Display ACPI objects or memory\n");
|
||||
AcpiOsPrintf (" EnableAcpi Enable ACPI (hardware) mode\n");
|
||||
AcpiOsPrintf (" Handlers Info about global handlers\n");
|
||||
AcpiOsPrintf (" Help This help screen\n");
|
||||
AcpiOsPrintf (" History Display command history buffer\n");
|
||||
AcpiOsPrintf (" Level [<DebugLevel>] [console] Get/Set debug level for file or console\n");
|
||||
AcpiOsPrintf (" Locks Current status of internal mutexes\n");
|
||||
AcpiOsPrintf (" Osi [Install|Remove <name>] Display or modify global _OSI list\n");
|
||||
AcpiOsPrintf (" Quit or Exit Exit this command\n");
|
||||
AcpiOsPrintf (" Stats [Allocations|Memory|Misc|\n");
|
||||
AcpiOsPrintf (" Objects|Sizes|Stack|Tables] Display namespace and memory statistics\n");
|
||||
AcpiOsPrintf (" Allocations Display list of current memory allocations\n");
|
||||
AcpiOsPrintf (" Memory Dump internal memory lists\n");
|
||||
AcpiOsPrintf (" Misc Namespace search and mutex stats\n");
|
||||
AcpiOsPrintf (" Objects Summary of namespace objects\n");
|
||||
AcpiOsPrintf (" Sizes Sizes for each of the internal objects\n");
|
||||
AcpiOsPrintf (" Stack Display CPU stack usage\n");
|
||||
AcpiOsPrintf (" Tables Info about current ACPI table(s)\n");
|
||||
AcpiOsPrintf (" Tables Display info about loaded ACPI tables\n");
|
||||
AcpiOsPrintf (" Unload <TableSig> [Instance] Unload an ACPI table\n");
|
||||
AcpiOsPrintf (" ! <CommandNumber> Execute command from history buffer\n");
|
||||
AcpiOsPrintf (" !! Execute last command again\n");
|
||||
|
||||
/* No parameter, just give the overview */
|
||||
AcpiOsPrintf ("\nNamespace Access Commands:\n");
|
||||
AcpiOsPrintf (" Businfo Display system bus info\n");
|
||||
AcpiOsPrintf (" Disassemble <Method> Disassemble a control method\n");
|
||||
AcpiOsPrintf (" Event <F|G> <Value> Generate AcpiEvent (Fixed/GPE)\n");
|
||||
AcpiOsPrintf (" Find <AcpiName> (? is wildcard) Find ACPI name(s) with wildcards\n");
|
||||
AcpiOsPrintf (" Gpe <GpeNum> <GpeBlock> Simulate a GPE\n");
|
||||
AcpiOsPrintf (" Gpes Display info on all GPEs\n");
|
||||
AcpiOsPrintf (" Integrity Validate namespace integrity\n");
|
||||
AcpiOsPrintf (" Methods Display list of loaded control methods\n");
|
||||
AcpiOsPrintf (" Namespace [Object] [Depth] Display loaded namespace tree/subtree\n");
|
||||
AcpiOsPrintf (" Notify <Object> <Value> Send a notification on Object\n");
|
||||
AcpiOsPrintf (" Objects <ObjectType> Display all objects of the given type\n");
|
||||
AcpiOsPrintf (" Owner <OwnerId> [Depth] Display loaded namespace by object owner\n");
|
||||
AcpiOsPrintf (" Predefined Check all predefined names\n");
|
||||
AcpiOsPrintf (" Prefix [<NamePath>] Set or Get current execution prefix\n");
|
||||
AcpiOsPrintf (" References <Addr> Find all references to object at addr\n");
|
||||
AcpiOsPrintf (" Resources <Device> Get and display Device resources\n");
|
||||
AcpiOsPrintf (" Set N <NamedObject> <Value> Set value for named integer\n");
|
||||
AcpiOsPrintf (" Sleep <SleepState> Simulate sleep/wake sequence\n");
|
||||
AcpiOsPrintf (" Terminate Delete namespace and all internal objects\n");
|
||||
AcpiOsPrintf (" Type <Object> Display object type\n");
|
||||
|
||||
if (!HelpType)
|
||||
{
|
||||
AcpiOsPrintf ("ACPI CA Debugger Commands\n\n");
|
||||
AcpiOsPrintf ("The following classes of commands are available. Help is available for\n");
|
||||
AcpiOsPrintf ("each class by entering \"Help <ClassName>\"\n\n");
|
||||
AcpiOsPrintf (" [GENERAL] General-Purpose Commands\n");
|
||||
AcpiOsPrintf (" [NAMESPACE] Namespace Access Commands\n");
|
||||
AcpiOsPrintf (" [METHOD] Control Method Execution Commands\n");
|
||||
AcpiOsPrintf (" [STATISTICS] Statistical Information\n");
|
||||
AcpiOsPrintf (" [FILE] File I/O Commands\n");
|
||||
return;
|
||||
}
|
||||
AcpiOsPrintf ("\nControl Method Execution Commands:\n");
|
||||
AcpiOsPrintf (" Arguments (or Args) Display method arguments\n");
|
||||
AcpiOsPrintf (" Breakpoint <AmlOffset> Set an AML execution breakpoint\n");
|
||||
AcpiOsPrintf (" Call Run to next control method invocation\n");
|
||||
AcpiOsPrintf (" Debug <Namepath> [Arguments] Single Step a control method\n");
|
||||
AcpiOsPrintf (" Execute <Namepath> [Arguments] Execute control method\n");
|
||||
AcpiOsPrintf (" Hex Integer Integer method argument\n");
|
||||
AcpiOsPrintf (" \"Ascii String\" String method argument\n");
|
||||
AcpiOsPrintf (" (Byte List) Buffer method argument\n");
|
||||
AcpiOsPrintf (" [Package Element List] Package method argument\n");
|
||||
AcpiOsPrintf (" Go Allow method to run to completion\n");
|
||||
AcpiOsPrintf (" Information Display info about the current method\n");
|
||||
AcpiOsPrintf (" Into Step into (not over) a method call\n");
|
||||
AcpiOsPrintf (" List [# of Aml Opcodes] Display method ASL statements\n");
|
||||
AcpiOsPrintf (" Locals Display method local variables\n");
|
||||
AcpiOsPrintf (" Results Display method result stack\n");
|
||||
AcpiOsPrintf (" Set <A|L> <#> <Value> Set method data (Arguments/Locals)\n");
|
||||
AcpiOsPrintf (" Stop Terminate control method\n");
|
||||
AcpiOsPrintf (" Thread <Threads><Loops><NamePath> Spawn threads to execute method(s)\n");
|
||||
AcpiOsPrintf (" Trace <method name> Trace method execution\n");
|
||||
AcpiOsPrintf (" Tree Display control method calling tree\n");
|
||||
AcpiOsPrintf (" <Enter> Single step next AML opcode (over calls)\n");
|
||||
|
||||
/*
|
||||
* Parameter is the command class
|
||||
*
|
||||
* The idea here is to keep each class of commands smaller than a screenful
|
||||
*/
|
||||
switch (HelpType[0])
|
||||
{
|
||||
case 'G':
|
||||
AcpiOsPrintf ("\nGeneral-Purpose Commands\n\n");
|
||||
AcpiOsPrintf ("Allocations Display list of current memory allocations\n");
|
||||
AcpiOsPrintf ("Dump <Address>|<Namepath>\n");
|
||||
AcpiOsPrintf (" [Byte|Word|Dword|Qword] Display ACPI objects or memory\n");
|
||||
AcpiOsPrintf ("EnableAcpi Enable ACPI (hardware) mode\n");
|
||||
AcpiOsPrintf ("Help This help screen\n");
|
||||
AcpiOsPrintf ("History Display command history buffer\n");
|
||||
AcpiOsPrintf ("Level [<DebugLevel>] [console] Get/Set debug level for file or console\n");
|
||||
AcpiOsPrintf ("Locks Current status of internal mutexes\n");
|
||||
AcpiOsPrintf ("Quit or Exit Exit this command\n");
|
||||
AcpiOsPrintf ("Stats [Allocations|Memory|Misc\n");
|
||||
AcpiOsPrintf (" |Objects|Sizes|Stack|Tables] Display namespace and memory statistics\n");
|
||||
AcpiOsPrintf ("Tables Display info about loaded ACPI tables\n");
|
||||
AcpiOsPrintf ("Unload <TableSig> [Instance] Unload an ACPI table\n");
|
||||
AcpiOsPrintf ("! <CommandNumber> Execute command from history buffer\n");
|
||||
AcpiOsPrintf ("!! Execute last command again\n");
|
||||
return;
|
||||
|
||||
case 'S':
|
||||
AcpiOsPrintf ("\nStats Subcommands\n\n");
|
||||
AcpiOsPrintf ("Allocations Display list of current memory allocations\n");
|
||||
AcpiOsPrintf ("Memory Dump internal memory lists\n");
|
||||
AcpiOsPrintf ("Misc Namespace search and mutex stats\n");
|
||||
AcpiOsPrintf ("Objects Summary of namespace objects\n");
|
||||
AcpiOsPrintf ("Sizes Sizes for each of the internal objects\n");
|
||||
AcpiOsPrintf ("Stack Display CPU stack usage\n");
|
||||
AcpiOsPrintf ("Tables Info about current ACPI table(s)\n");
|
||||
return;
|
||||
|
||||
case 'N':
|
||||
AcpiOsPrintf ("\nNamespace Access Commands\n\n");
|
||||
AcpiOsPrintf ("Businfo Display system bus info\n");
|
||||
AcpiOsPrintf ("Disassemble <Method> Disassemble a control method\n");
|
||||
AcpiOsPrintf ("Event <F|G> <Value> Generate AcpiEvent (Fixed/GPE)\n");
|
||||
AcpiOsPrintf ("Find <AcpiName> (? is wildcard) Find ACPI name(s) with wildcards\n");
|
||||
AcpiOsPrintf ("Gpe <GpeNum> <GpeBlock> Simulate a GPE\n");
|
||||
AcpiOsPrintf ("Gpes Display info on all GPEs\n");
|
||||
AcpiOsPrintf ("Integrity Validate namespace integrity\n");
|
||||
AcpiOsPrintf ("Methods Display list of loaded control methods\n");
|
||||
AcpiOsPrintf ("Namespace [Object] [Depth] Display loaded namespace tree/subtree\n");
|
||||
AcpiOsPrintf ("Notify <Object> <Value> Send a notification on Object\n");
|
||||
AcpiOsPrintf ("Objects <ObjectType> Display all objects of the given type\n");
|
||||
AcpiOsPrintf ("Owner <OwnerId> [Depth] Display loaded namespace by object owner\n");
|
||||
AcpiOsPrintf ("Predefined Check all predefined names\n");
|
||||
AcpiOsPrintf ("Prefix [<NamePath>] Set or Get current execution prefix\n");
|
||||
AcpiOsPrintf ("References <Addr> Find all references to object at addr\n");
|
||||
AcpiOsPrintf ("Resources <Device> Get and display Device resources\n");
|
||||
AcpiOsPrintf ("Set N <NamedObject> <Value> Set value for named integer\n");
|
||||
AcpiOsPrintf ("Sleep <SleepState> Simulate sleep/wake sequence\n");
|
||||
AcpiOsPrintf ("Terminate Delete namespace and all internal objects\n");
|
||||
AcpiOsPrintf ("Type <Object> Display object type\n");
|
||||
return;
|
||||
|
||||
case 'M':
|
||||
AcpiOsPrintf ("\nControl Method Execution Commands\n\n");
|
||||
AcpiOsPrintf ("Arguments (or Args) Display method arguments\n");
|
||||
AcpiOsPrintf ("Breakpoint <AmlOffset> Set an AML execution breakpoint\n");
|
||||
AcpiOsPrintf ("Call Run to next control method invocation\n");
|
||||
AcpiOsPrintf ("Debug <Namepath> [Arguments] Single Step a control method\n");
|
||||
AcpiOsPrintf ("Execute <Namepath> [Arguments] Execute control method\n");
|
||||
AcpiOsPrintf ("Go Allow method to run to completion\n");
|
||||
AcpiOsPrintf ("Information Display info about the current method\n");
|
||||
AcpiOsPrintf ("Into Step into (not over) a method call\n");
|
||||
AcpiOsPrintf ("List [# of Aml Opcodes] Display method ASL statements\n");
|
||||
AcpiOsPrintf ("Locals Display method local variables\n");
|
||||
AcpiOsPrintf ("Results Display method result stack\n");
|
||||
AcpiOsPrintf ("Set <A|L> <#> <Value> Set method data (Arguments/Locals)\n");
|
||||
AcpiOsPrintf ("Stop Terminate control method\n");
|
||||
AcpiOsPrintf ("Thread <Threads><Loops><NamePath> Spawn threads to execute method(s)\n");
|
||||
AcpiOsPrintf ("Trace <method name> Trace method execution\n");
|
||||
AcpiOsPrintf ("Tree Display control method calling tree\n");
|
||||
AcpiOsPrintf ("<Enter> Single step next AML opcode (over calls)\n");
|
||||
return;
|
||||
|
||||
case 'F':
|
||||
AcpiOsPrintf ("\nFile I/O Commands\n\n");
|
||||
AcpiOsPrintf ("Close Close debug output file\n");
|
||||
AcpiOsPrintf ("Open <Output Filename> Open a file for debug output\n");
|
||||
AcpiOsPrintf ("Load <Input Filename> Load ACPI table from a file\n");
|
||||
return;
|
||||
|
||||
default:
|
||||
AcpiOsPrintf ("Unrecognized Command Class: %s\n", HelpType);
|
||||
return;
|
||||
}
|
||||
AcpiOsPrintf ("\nFile I/O Commands:\n");
|
||||
AcpiOsPrintf (" Close Close debug output file\n");
|
||||
AcpiOsPrintf (" Load <Input Filename> Load ACPI table from a file\n");
|
||||
AcpiOsPrintf (" Open <Output Filename> Open a file for debug output\n");
|
||||
}
|
||||
|
||||
|
||||
|
@ -425,12 +389,15 @@ AcpiDbDisplayHelp (
|
|||
*
|
||||
******************************************************************************/
|
||||
|
||||
static char *
|
||||
char *
|
||||
AcpiDbGetNextToken (
|
||||
char *String,
|
||||
char **Next)
|
||||
char **Next,
|
||||
ACPI_OBJECT_TYPE *ReturnType)
|
||||
{
|
||||
char *Start;
|
||||
UINT32 Depth;
|
||||
ACPI_OBJECT_TYPE Type = ACPI_TYPE_INTEGER;
|
||||
|
||||
|
||||
/* At end of buffer? */
|
||||
|
@ -440,7 +407,7 @@ AcpiDbGetNextToken (
|
|||
return (NULL);
|
||||
}
|
||||
|
||||
/* Get rid of any spaces at the beginning */
|
||||
/* Remove any spaces at the beginning */
|
||||
|
||||
if (*String == ' ')
|
||||
{
|
||||
|
@ -455,13 +422,97 @@ AcpiDbGetNextToken (
|
|||
}
|
||||
}
|
||||
|
||||
Start = String;
|
||||
|
||||
/* Find end of token */
|
||||
|
||||
while (*String && (*String != ' '))
|
||||
switch (*String)
|
||||
{
|
||||
case '"':
|
||||
|
||||
/* This is a quoted string, scan until closing quote */
|
||||
|
||||
String++;
|
||||
Start = String;
|
||||
Type = ACPI_TYPE_STRING;
|
||||
|
||||
/* Find end of string */
|
||||
|
||||
while (*String && (*String != '"'))
|
||||
{
|
||||
String++;
|
||||
}
|
||||
break;
|
||||
|
||||
case '(':
|
||||
|
||||
/* This is the start of a buffer, scan until closing paren */
|
||||
|
||||
String++;
|
||||
Start = String;
|
||||
Type = ACPI_TYPE_BUFFER;
|
||||
|
||||
/* Find end of buffer */
|
||||
|
||||
while (*String && (*String != ')'))
|
||||
{
|
||||
String++;
|
||||
}
|
||||
break;
|
||||
|
||||
case '[':
|
||||
|
||||
/* This is the start of a package, scan until closing bracket */
|
||||
|
||||
String++;
|
||||
Depth = 1;
|
||||
Start = String;
|
||||
Type = ACPI_TYPE_PACKAGE;
|
||||
|
||||
/* Find end of package (closing bracket) */
|
||||
|
||||
while (*String)
|
||||
{
|
||||
/* Handle String package elements */
|
||||
|
||||
if (*String == '"')
|
||||
{
|
||||
/* Find end of string */
|
||||
|
||||
String++;
|
||||
while (*String && (*String != '"'))
|
||||
{
|
||||
String++;
|
||||
}
|
||||
if (!(*String))
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if (*String == '[')
|
||||
{
|
||||
Depth++; /* A nested package declaration */
|
||||
}
|
||||
else if (*String == ']')
|
||||
{
|
||||
Depth--;
|
||||
if (Depth == 0) /* Found final package closing bracket */
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
String++;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
Start = String;
|
||||
|
||||
/* Find end of token */
|
||||
|
||||
while (*String && (*String != ' '))
|
||||
{
|
||||
String++;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
if (!(*String))
|
||||
|
@ -474,6 +525,7 @@ AcpiDbGetNextToken (
|
|||
*Next = String + 1;
|
||||
}
|
||||
|
||||
*ReturnType = Type;
|
||||
return (Start);
|
||||
}
|
||||
|
||||
|
@ -506,7 +558,8 @@ AcpiDbGetLine (
|
|||
This = AcpiGbl_DbParsedBuf;
|
||||
for (i = 0; i < ACPI_DEBUGGER_MAX_ARGS; i++)
|
||||
{
|
||||
AcpiGbl_DbArgs[i] = AcpiDbGetNextToken (This, &Next);
|
||||
AcpiGbl_DbArgs[i] = AcpiDbGetNextToken (This, &Next,
|
||||
&AcpiGbl_DbArgTypes[i]);
|
||||
if (!AcpiGbl_DbArgs[i])
|
||||
{
|
||||
break;
|
||||
|
@ -665,7 +718,8 @@ AcpiDbCommandDispatch (
|
|||
break;
|
||||
|
||||
case CMD_DEBUG:
|
||||
AcpiDbExecute (AcpiGbl_DbArgs[1], &AcpiGbl_DbArgs[2], EX_SINGLE_STEP);
|
||||
AcpiDbExecute (AcpiGbl_DbArgs[1],
|
||||
&AcpiGbl_DbArgs[2], &AcpiGbl_DbArgTypes[2], EX_SINGLE_STEP);
|
||||
break;
|
||||
|
||||
case CMD_DISASSEMBLE:
|
||||
|
@ -691,7 +745,7 @@ AcpiDbCommandDispatch (
|
|||
|
||||
case CMD_EXECUTE:
|
||||
AcpiDbExecute (AcpiGbl_DbArgs[1],
|
||||
&AcpiGbl_DbArgs[2], EX_NO_SINGLE_STEP);
|
||||
&AcpiGbl_DbArgs[2], &AcpiGbl_DbArgTypes[2], EX_NO_SINGLE_STEP);
|
||||
break;
|
||||
|
||||
case CMD_FIND:
|
||||
|
@ -710,9 +764,13 @@ AcpiDbCommandDispatch (
|
|||
AcpiDbDisplayGpes ();
|
||||
break;
|
||||
|
||||
case CMD_HANDLERS:
|
||||
AcpiDbDisplayHandlers ();
|
||||
break;
|
||||
|
||||
case CMD_HELP:
|
||||
case CMD_HELP2:
|
||||
AcpiDbDisplayHelp (AcpiGbl_DbArgs[1]);
|
||||
AcpiDbDisplayHelp ();
|
||||
break;
|
||||
|
||||
case CMD_HISTORY:
|
||||
|
@ -820,6 +878,10 @@ AcpiDbCommandDispatch (
|
|||
AcpiDbOpenDebugFile (AcpiGbl_DbArgs[1]);
|
||||
break;
|
||||
|
||||
case CMD_OSI:
|
||||
AcpiDbDisplayInterfaces (AcpiGbl_DbArgs[1], AcpiGbl_DbArgs[2]);
|
||||
break;
|
||||
|
||||
case CMD_OWNER:
|
||||
AcpiDbDumpNamespaceByOwner (AcpiGbl_DbArgs[1], AcpiGbl_DbArgs[2]);
|
||||
break;
|
||||
|
@ -1043,7 +1105,13 @@ AcpiDbUserCommands (
|
|||
|
||||
/* Get the user input line */
|
||||
|
||||
(void) AcpiOsGetLine (AcpiGbl_DbLineBuf);
|
||||
Status = AcpiOsGetLine (AcpiGbl_DbLineBuf,
|
||||
ACPI_DB_LINE_BUFFER_SIZE, NULL);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
ACPI_EXCEPTION ((AE_INFO, Status, "While parsing command line"));
|
||||
return (Status);
|
||||
}
|
||||
|
||||
/* Check for single or multithreaded debug */
|
||||
|
||||
|
|
|
@ -0,0 +1,597 @@
|
|||
/*******************************************************************************
|
||||
*
|
||||
* Module Name: dbmethod - Debug commands for control methods
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
*
|
||||
* 2.1. This is your license from Intel Corp. under its intellectual property
|
||||
* rights. You may have additional license terms from the party that provided
|
||||
* you this software, covering your right to use that party's intellectual
|
||||
* property rights.
|
||||
*
|
||||
* 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
|
||||
* copy of the source code appearing in this file ("Covered Code") an
|
||||
* irrevocable, perpetual, worldwide license under Intel's copyrights in the
|
||||
* base code distributed originally by Intel ("Original Intel Code") to copy,
|
||||
* make derivatives, distribute, use and display any portion of the Covered
|
||||
* Code in any form, with the right to sublicense such rights; and
|
||||
*
|
||||
* 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
|
||||
* license (with the right to sublicense), under only those claims of Intel
|
||||
* patents that are infringed by the Original Intel Code, to make, use, sell,
|
||||
* offer to sell, and import the Covered Code and derivative works thereof
|
||||
* solely to the minimum extent necessary to exercise the above copyright
|
||||
* license, and in no event shall the patent license extend to any additions
|
||||
* to or modifications of the Original Intel Code. No other license or right
|
||||
* is granted directly or by implication, estoppel or otherwise;
|
||||
*
|
||||
* The above copyright and patent license is granted only if the following
|
||||
* conditions are met:
|
||||
*
|
||||
* 3. Conditions
|
||||
*
|
||||
* 3.1. Redistribution of Source with Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification with rights to further distribute source must include
|
||||
* the above Copyright Notice, the above License, this list of Conditions,
|
||||
* and the following Disclaimer and Export Compliance provision. In addition,
|
||||
* Licensee must cause all Covered Code to which Licensee contributes to
|
||||
* contain a file documenting the changes Licensee made to create that Covered
|
||||
* Code and the date of any change. Licensee must include in that file the
|
||||
* documentation of any changes made by any predecessor Licensee. Licensee
|
||||
* must include a prominent statement that the modification is derived,
|
||||
* directly or indirectly, from Original Intel Code.
|
||||
*
|
||||
* 3.2. Redistribution of Source with no Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification without rights to further distribute source must
|
||||
* include the following Disclaimer and Export Compliance provision in the
|
||||
* documentation and/or other materials provided with distribution. In
|
||||
* addition, Licensee may not authorize further sublicense of source of any
|
||||
* portion of the Covered Code, and must include terms to the effect that the
|
||||
* license from Licensee to its licensee is limited to the intellectual
|
||||
* property embodied in the software Licensee provides to its licensee, and
|
||||
* not to intellectual property embodied in modifications its licensee may
|
||||
* make.
|
||||
*
|
||||
* 3.3. Redistribution of Executable. Redistribution in executable form of any
|
||||
* substantial portion of the Covered Code or modification must reproduce the
|
||||
* above Copyright Notice, and the following Disclaimer and Export Compliance
|
||||
* provision in the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* 3.4. Intel retains all right, title, and interest in and to the Original
|
||||
* Intel Code.
|
||||
*
|
||||
* 3.5. Neither the name Intel nor any other trademark owned or controlled by
|
||||
* Intel shall be used in advertising or otherwise to promote the sale, use or
|
||||
* other dealings in products derived from or relating to the Covered Code
|
||||
* without prior written authorization from Intel.
|
||||
*
|
||||
* 4. Disclaimer and Export Compliance
|
||||
*
|
||||
* 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
|
||||
* HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
|
||||
* IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
|
||||
* INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
|
||||
* UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
|
||||
* PARTICULAR PURPOSE.
|
||||
*
|
||||
* 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
|
||||
* OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
|
||||
* COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
|
||||
* SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
|
||||
* CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
|
||||
* HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
|
||||
* SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
|
||||
* LIMITED REMEDY.
|
||||
*
|
||||
* 4.3. Licensee shall not export, either directly or indirectly, any of this
|
||||
* software or system incorporating such software without first obtaining any
|
||||
* required license or other approval from the U. S. Department of Commerce or
|
||||
* any other agency or department of the United States Government. In the
|
||||
* event Licensee exports any such software from the United States or
|
||||
* re-exports any such software from a foreign destination, Licensee shall
|
||||
* ensure that the distribution and export/re-export of the software is in
|
||||
* compliance with all laws, regulations, orders, or other restrictions of the
|
||||
* U.S. Export Administration Regulations. Licensee agrees that neither it nor
|
||||
* any of its subsidiaries will export/re-export any technical data, process,
|
||||
* software, or service, directly or indirectly, to any country for which the
|
||||
* United States government or any agency thereof requires an export license,
|
||||
* other governmental approval, or letter of assurance, without first obtaining
|
||||
* such license, approval or letter.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
|
||||
#include "acpi.h"
|
||||
#include "accommon.h"
|
||||
#include "acdispat.h"
|
||||
#include "acnamesp.h"
|
||||
#include "acdebug.h"
|
||||
#include "acdisasm.h"
|
||||
#include "acparser.h"
|
||||
|
||||
|
||||
#ifdef ACPI_DEBUGGER
|
||||
|
||||
#define _COMPONENT ACPI_CA_DEBUGGER
|
||||
ACPI_MODULE_NAME ("dbmethod")
|
||||
|
||||
|
||||
/* Local prototypes */
|
||||
|
||||
static ACPI_STATUS
|
||||
AcpiDbWalkForExecute (
|
||||
ACPI_HANDLE ObjHandle,
|
||||
UINT32 NestingLevel,
|
||||
void *Context,
|
||||
void **ReturnValue);
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiDbSetMethodBreakpoint
|
||||
*
|
||||
* PARAMETERS: Location - AML offset of breakpoint
|
||||
* WalkState - Current walk info
|
||||
* Op - Current Op (from parse walk)
|
||||
*
|
||||
* RETURN: None
|
||||
*
|
||||
* DESCRIPTION: Set a breakpoint in a control method at the specified
|
||||
* AML offset
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
void
|
||||
AcpiDbSetMethodBreakpoint (
|
||||
char *Location,
|
||||
ACPI_WALK_STATE *WalkState,
|
||||
ACPI_PARSE_OBJECT *Op)
|
||||
{
|
||||
UINT32 Address;
|
||||
|
||||
|
||||
if (!Op)
|
||||
{
|
||||
AcpiOsPrintf ("There is no method currently executing\n");
|
||||
return;
|
||||
}
|
||||
|
||||
/* Get and verify the breakpoint address */
|
||||
|
||||
Address = ACPI_STRTOUL (Location, NULL, 16);
|
||||
if (Address <= Op->Common.AmlOffset)
|
||||
{
|
||||
AcpiOsPrintf ("Breakpoint %X is beyond current address %X\n",
|
||||
Address, Op->Common.AmlOffset);
|
||||
}
|
||||
|
||||
/* Save breakpoint in current walk */
|
||||
|
||||
WalkState->UserBreakpoint = Address;
|
||||
AcpiOsPrintf ("Breakpoint set at AML offset %X\n", Address);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiDbSetMethodCallBreakpoint
|
||||
*
|
||||
* PARAMETERS: Op - Current Op (from parse walk)
|
||||
*
|
||||
* RETURN: None
|
||||
*
|
||||
* DESCRIPTION: Set a breakpoint in a control method at the specified
|
||||
* AML offset
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
void
|
||||
AcpiDbSetMethodCallBreakpoint (
|
||||
ACPI_PARSE_OBJECT *Op)
|
||||
{
|
||||
|
||||
|
||||
if (!Op)
|
||||
{
|
||||
AcpiOsPrintf ("There is no method currently executing\n");
|
||||
return;
|
||||
}
|
||||
|
||||
AcpiGbl_StepToNextCall = TRUE;
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiDbSetMethodData
|
||||
*
|
||||
* PARAMETERS: TypeArg - L for local, A for argument
|
||||
* IndexArg - which one
|
||||
* ValueArg - Value to set.
|
||||
*
|
||||
* RETURN: None
|
||||
*
|
||||
* DESCRIPTION: Set a local or argument for the running control method.
|
||||
* NOTE: only object supported is Number.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
void
|
||||
AcpiDbSetMethodData (
|
||||
char *TypeArg,
|
||||
char *IndexArg,
|
||||
char *ValueArg)
|
||||
{
|
||||
char Type;
|
||||
UINT32 Index;
|
||||
UINT32 Value;
|
||||
ACPI_WALK_STATE *WalkState;
|
||||
ACPI_OPERAND_OBJECT *ObjDesc;
|
||||
ACPI_STATUS Status;
|
||||
ACPI_NAMESPACE_NODE *Node;
|
||||
|
||||
|
||||
/* Validate TypeArg */
|
||||
|
||||
AcpiUtStrupr (TypeArg);
|
||||
Type = TypeArg[0];
|
||||
if ((Type != 'L') &&
|
||||
(Type != 'A') &&
|
||||
(Type != 'N'))
|
||||
{
|
||||
AcpiOsPrintf ("Invalid SET operand: %s\n", TypeArg);
|
||||
return;
|
||||
}
|
||||
|
||||
Value = ACPI_STRTOUL (ValueArg, NULL, 16);
|
||||
|
||||
if (Type == 'N')
|
||||
{
|
||||
Node = AcpiDbConvertToNode (IndexArg);
|
||||
if (Node->Type != ACPI_TYPE_INTEGER)
|
||||
{
|
||||
AcpiOsPrintf ("Can only set Integer nodes\n");
|
||||
return;
|
||||
}
|
||||
ObjDesc = Node->Object;
|
||||
ObjDesc->Integer.Value = Value;
|
||||
return;
|
||||
}
|
||||
|
||||
/* Get the index and value */
|
||||
|
||||
Index = ACPI_STRTOUL (IndexArg, NULL, 16);
|
||||
|
||||
WalkState = AcpiDsGetCurrentWalkState (AcpiGbl_CurrentWalkList);
|
||||
if (!WalkState)
|
||||
{
|
||||
AcpiOsPrintf ("There is no method currently executing\n");
|
||||
return;
|
||||
}
|
||||
|
||||
/* Create and initialize the new object */
|
||||
|
||||
ObjDesc = AcpiUtCreateIntegerObject ((UINT64) Value);
|
||||
if (!ObjDesc)
|
||||
{
|
||||
AcpiOsPrintf ("Could not create an internal object\n");
|
||||
return;
|
||||
}
|
||||
|
||||
/* Store the new object into the target */
|
||||
|
||||
switch (Type)
|
||||
{
|
||||
case 'A':
|
||||
|
||||
/* Set a method argument */
|
||||
|
||||
if (Index > ACPI_METHOD_MAX_ARG)
|
||||
{
|
||||
AcpiOsPrintf ("Arg%u - Invalid argument name\n", Index);
|
||||
goto Cleanup;
|
||||
}
|
||||
|
||||
Status = AcpiDsStoreObjectToLocal (ACPI_REFCLASS_ARG, Index, ObjDesc,
|
||||
WalkState);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
goto Cleanup;
|
||||
}
|
||||
|
||||
ObjDesc = WalkState->Arguments[Index].Object;
|
||||
|
||||
AcpiOsPrintf ("Arg%u: ", Index);
|
||||
AcpiDmDisplayInternalObject (ObjDesc, WalkState);
|
||||
break;
|
||||
|
||||
case 'L':
|
||||
|
||||
/* Set a method local */
|
||||
|
||||
if (Index > ACPI_METHOD_MAX_LOCAL)
|
||||
{
|
||||
AcpiOsPrintf ("Local%u - Invalid local variable name\n", Index);
|
||||
goto Cleanup;
|
||||
}
|
||||
|
||||
Status = AcpiDsStoreObjectToLocal (ACPI_REFCLASS_LOCAL, Index, ObjDesc,
|
||||
WalkState);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
goto Cleanup;
|
||||
}
|
||||
|
||||
ObjDesc = WalkState->LocalVariables[Index].Object;
|
||||
|
||||
AcpiOsPrintf ("Local%u: ", Index);
|
||||
AcpiDmDisplayInternalObject (ObjDesc, WalkState);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
Cleanup:
|
||||
AcpiUtRemoveReference (ObjDesc);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiDbDisassembleAml
|
||||
*
|
||||
* PARAMETERS: Statements - Number of statements to disassemble
|
||||
* Op - Current Op (from parse walk)
|
||||
*
|
||||
* RETURN: None
|
||||
*
|
||||
* DESCRIPTION: Display disassembled AML (ASL) starting from Op for the number
|
||||
* of statements specified.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
void
|
||||
AcpiDbDisassembleAml (
|
||||
char *Statements,
|
||||
ACPI_PARSE_OBJECT *Op)
|
||||
{
|
||||
UINT32 NumStatements = 8;
|
||||
|
||||
|
||||
if (!Op)
|
||||
{
|
||||
AcpiOsPrintf ("There is no method currently executing\n");
|
||||
return;
|
||||
}
|
||||
|
||||
if (Statements)
|
||||
{
|
||||
NumStatements = ACPI_STRTOUL (Statements, NULL, 0);
|
||||
}
|
||||
|
||||
AcpiDmDisassemble (NULL, Op, NumStatements);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiDbDisassembleMethod
|
||||
*
|
||||
* PARAMETERS: Name - Name of control method
|
||||
*
|
||||
* RETURN: None
|
||||
*
|
||||
* DESCRIPTION: Display disassembled AML (ASL) starting from Op for the number
|
||||
* of statements specified.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiDbDisassembleMethod (
|
||||
char *Name)
|
||||
{
|
||||
ACPI_STATUS Status;
|
||||
ACPI_PARSE_OBJECT *Op;
|
||||
ACPI_WALK_STATE *WalkState;
|
||||
ACPI_OPERAND_OBJECT *ObjDesc;
|
||||
ACPI_NAMESPACE_NODE *Method;
|
||||
|
||||
|
||||
Method = AcpiDbConvertToNode (Name);
|
||||
if (!Method)
|
||||
{
|
||||
return (AE_BAD_PARAMETER);
|
||||
}
|
||||
|
||||
ObjDesc = Method->Object;
|
||||
|
||||
Op = AcpiPsCreateScopeOp ();
|
||||
if (!Op)
|
||||
{
|
||||
return (AE_NO_MEMORY);
|
||||
}
|
||||
|
||||
/* Create and initialize a new walk state */
|
||||
|
||||
WalkState = AcpiDsCreateWalkState (0, Op, NULL, NULL);
|
||||
if (!WalkState)
|
||||
{
|
||||
return (AE_NO_MEMORY);
|
||||
}
|
||||
|
||||
Status = AcpiDsInitAmlWalk (WalkState, Op, NULL,
|
||||
ObjDesc->Method.AmlStart,
|
||||
ObjDesc->Method.AmlLength, NULL, ACPI_IMODE_LOAD_PASS1);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return (Status);
|
||||
}
|
||||
|
||||
/* Parse the AML */
|
||||
|
||||
WalkState->ParseFlags &= ~ACPI_PARSE_DELETE_TREE;
|
||||
WalkState->ParseFlags |= ACPI_PARSE_DISASSEMBLE;
|
||||
Status = AcpiPsParseAml (WalkState);
|
||||
|
||||
AcpiDmDisassemble (NULL, Op, 0);
|
||||
AcpiPsDeleteParseTree (Op);
|
||||
return (AE_OK);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiDbWalkForExecute
|
||||
*
|
||||
* PARAMETERS: Callback from WalkNamespace
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Batch execution module. Currently only executes predefined
|
||||
* ACPI names.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
static ACPI_STATUS
|
||||
AcpiDbWalkForExecute (
|
||||
ACPI_HANDLE ObjHandle,
|
||||
UINT32 NestingLevel,
|
||||
void *Context,
|
||||
void **ReturnValue)
|
||||
{
|
||||
ACPI_NAMESPACE_NODE *Node = (ACPI_NAMESPACE_NODE *) ObjHandle;
|
||||
ACPI_EXECUTE_WALK *Info = (ACPI_EXECUTE_WALK *) Context;
|
||||
ACPI_BUFFER ReturnObj;
|
||||
ACPI_STATUS Status;
|
||||
char *Pathname;
|
||||
UINT32 i;
|
||||
ACPI_DEVICE_INFO *ObjInfo;
|
||||
ACPI_OBJECT_LIST ParamObjects;
|
||||
ACPI_OBJECT Params[ACPI_METHOD_NUM_ARGS];
|
||||
const ACPI_PREDEFINED_INFO *Predefined;
|
||||
|
||||
|
||||
Predefined = AcpiNsCheckForPredefinedName (Node);
|
||||
if (!Predefined)
|
||||
{
|
||||
return (AE_OK);
|
||||
}
|
||||
|
||||
if (Node->Type == ACPI_TYPE_LOCAL_SCOPE)
|
||||
{
|
||||
return (AE_OK);
|
||||
}
|
||||
|
||||
Pathname = AcpiNsGetExternalPathname (Node);
|
||||
if (!Pathname)
|
||||
{
|
||||
return (AE_OK);
|
||||
}
|
||||
|
||||
/* Get the object info for number of method parameters */
|
||||
|
||||
Status = AcpiGetObjectInfo (ObjHandle, &ObjInfo);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return (Status);
|
||||
}
|
||||
|
||||
ParamObjects.Pointer = NULL;
|
||||
ParamObjects.Count = 0;
|
||||
|
||||
if (ObjInfo->Type == ACPI_TYPE_METHOD)
|
||||
{
|
||||
/* Setup default parameters */
|
||||
|
||||
for (i = 0; i < ObjInfo->ParamCount; i++)
|
||||
{
|
||||
Params[i].Type = ACPI_TYPE_INTEGER;
|
||||
Params[i].Integer.Value = 1;
|
||||
}
|
||||
|
||||
ParamObjects.Pointer = Params;
|
||||
ParamObjects.Count = ObjInfo->ParamCount;
|
||||
}
|
||||
|
||||
ACPI_FREE (ObjInfo);
|
||||
ReturnObj.Pointer = NULL;
|
||||
ReturnObj.Length = ACPI_ALLOCATE_BUFFER;
|
||||
|
||||
/* Do the actual method execution */
|
||||
|
||||
AcpiGbl_MethodExecuting = TRUE;
|
||||
|
||||
Status = AcpiEvaluateObject (Node, NULL, &ParamObjects, &ReturnObj);
|
||||
|
||||
AcpiOsPrintf ("%-32s returned %s\n", Pathname, AcpiFormatException (Status));
|
||||
AcpiGbl_MethodExecuting = FALSE;
|
||||
ACPI_FREE (Pathname);
|
||||
|
||||
/* Ignore status from method execution */
|
||||
|
||||
Status = AE_OK;
|
||||
|
||||
/* Update count, check if we have executed enough methods */
|
||||
|
||||
Info->Count++;
|
||||
if (Info->Count >= Info->MaxCount)
|
||||
{
|
||||
Status = AE_CTRL_TERMINATE;
|
||||
}
|
||||
|
||||
return (Status);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiDbBatchExecute
|
||||
*
|
||||
* PARAMETERS: CountArg - Max number of methods to execute
|
||||
*
|
||||
* RETURN: None
|
||||
*
|
||||
* DESCRIPTION: Namespace batch execution. Execute predefined names in the
|
||||
* namespace, up to the max count, if specified.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
void
|
||||
AcpiDbBatchExecute (
|
||||
char *CountArg)
|
||||
{
|
||||
ACPI_EXECUTE_WALK Info;
|
||||
|
||||
|
||||
Info.Count = 0;
|
||||
Info.MaxCount = ACPI_UINT32_MAX;
|
||||
|
||||
if (CountArg)
|
||||
{
|
||||
Info.MaxCount = ACPI_STRTOUL (CountArg, NULL, 0);
|
||||
}
|
||||
|
||||
|
||||
/* Search all nodes in namespace */
|
||||
|
||||
(void) AcpiWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT, ACPI_UINT32_MAX,
|
||||
AcpiDbWalkForExecute, NULL, (void *) &Info, NULL);
|
||||
|
||||
AcpiOsPrintf ("Executed %u predefined names in the namespace\n", Info.Count);
|
||||
}
|
||||
|
||||
#endif /* ACPI_DEBUGGER */
|
File diff suppressed because it is too large
Load Diff
|
@ -8,7 +8,7 @@
|
|||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
|
@ -454,7 +454,7 @@ AcpiDbUInt32ToHexString (
|
|||
UINT32 Value,
|
||||
char *Buffer)
|
||||
{
|
||||
UINT8 i;
|
||||
int i;
|
||||
|
||||
|
||||
if (Value == 0)
|
||||
|
@ -463,10 +463,9 @@ AcpiDbUInt32ToHexString (
|
|||
return;
|
||||
}
|
||||
|
||||
ACPI_STRCPY (Buffer, "0x");
|
||||
Buffer[10] = '\0';
|
||||
Buffer[8] = '\0';
|
||||
|
||||
for (i = 9; i > 1; i--)
|
||||
for (i = 7; i >= 0; i--)
|
||||
{
|
||||
Buffer[i] = Converter [Value & 0x0F];
|
||||
Value = Value >> 4;
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
|
@ -209,7 +209,13 @@ AcpiDbStartCommand (
|
|||
|
||||
/* Get the user input line */
|
||||
|
||||
(void) AcpiOsGetLine (AcpiGbl_DbLineBuf);
|
||||
Status = AcpiOsGetLine (AcpiGbl_DbLineBuf,
|
||||
ACPI_DB_LINE_BUFFER_SIZE, NULL);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
ACPI_EXCEPTION ((AE_INFO, Status, "While parsing command line"));
|
||||
return (Status);
|
||||
}
|
||||
}
|
||||
|
||||
Status = AcpiDbCommandDispatch (AcpiGbl_DbLineBuf, WalkState, Op);
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
|
|
|
@ -0,0 +1,502 @@
|
|||
/******************************************************************************
|
||||
*
|
||||
* Module Name: dsargs - Support for execution of dynamic arguments for static
|
||||
* objects (regions, fields, buffer fields, etc.)
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
*
|
||||
* 2.1. This is your license from Intel Corp. under its intellectual property
|
||||
* rights. You may have additional license terms from the party that provided
|
||||
* you this software, covering your right to use that party's intellectual
|
||||
* property rights.
|
||||
*
|
||||
* 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
|
||||
* copy of the source code appearing in this file ("Covered Code") an
|
||||
* irrevocable, perpetual, worldwide license under Intel's copyrights in the
|
||||
* base code distributed originally by Intel ("Original Intel Code") to copy,
|
||||
* make derivatives, distribute, use and display any portion of the Covered
|
||||
* Code in any form, with the right to sublicense such rights; and
|
||||
*
|
||||
* 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
|
||||
* license (with the right to sublicense), under only those claims of Intel
|
||||
* patents that are infringed by the Original Intel Code, to make, use, sell,
|
||||
* offer to sell, and import the Covered Code and derivative works thereof
|
||||
* solely to the minimum extent necessary to exercise the above copyright
|
||||
* license, and in no event shall the patent license extend to any additions
|
||||
* to or modifications of the Original Intel Code. No other license or right
|
||||
* is granted directly or by implication, estoppel or otherwise;
|
||||
*
|
||||
* The above copyright and patent license is granted only if the following
|
||||
* conditions are met:
|
||||
*
|
||||
* 3. Conditions
|
||||
*
|
||||
* 3.1. Redistribution of Source with Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification with rights to further distribute source must include
|
||||
* the above Copyright Notice, the above License, this list of Conditions,
|
||||
* and the following Disclaimer and Export Compliance provision. In addition,
|
||||
* Licensee must cause all Covered Code to which Licensee contributes to
|
||||
* contain a file documenting the changes Licensee made to create that Covered
|
||||
* Code and the date of any change. Licensee must include in that file the
|
||||
* documentation of any changes made by any predecessor Licensee. Licensee
|
||||
* must include a prominent statement that the modification is derived,
|
||||
* directly or indirectly, from Original Intel Code.
|
||||
*
|
||||
* 3.2. Redistribution of Source with no Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification without rights to further distribute source must
|
||||
* include the following Disclaimer and Export Compliance provision in the
|
||||
* documentation and/or other materials provided with distribution. In
|
||||
* addition, Licensee may not authorize further sublicense of source of any
|
||||
* portion of the Covered Code, and must include terms to the effect that the
|
||||
* license from Licensee to its licensee is limited to the intellectual
|
||||
* property embodied in the software Licensee provides to its licensee, and
|
||||
* not to intellectual property embodied in modifications its licensee may
|
||||
* make.
|
||||
*
|
||||
* 3.3. Redistribution of Executable. Redistribution in executable form of any
|
||||
* substantial portion of the Covered Code or modification must reproduce the
|
||||
* above Copyright Notice, and the following Disclaimer and Export Compliance
|
||||
* provision in the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* 3.4. Intel retains all right, title, and interest in and to the Original
|
||||
* Intel Code.
|
||||
*
|
||||
* 3.5. Neither the name Intel nor any other trademark owned or controlled by
|
||||
* Intel shall be used in advertising or otherwise to promote the sale, use or
|
||||
* other dealings in products derived from or relating to the Covered Code
|
||||
* without prior written authorization from Intel.
|
||||
*
|
||||
* 4. Disclaimer and Export Compliance
|
||||
*
|
||||
* 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
|
||||
* HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
|
||||
* IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
|
||||
* INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
|
||||
* UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
|
||||
* PARTICULAR PURPOSE.
|
||||
*
|
||||
* 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
|
||||
* OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
|
||||
* COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
|
||||
* SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
|
||||
* CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
|
||||
* HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
|
||||
* SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
|
||||
* LIMITED REMEDY.
|
||||
*
|
||||
* 4.3. Licensee shall not export, either directly or indirectly, any of this
|
||||
* software or system incorporating such software without first obtaining any
|
||||
* required license or other approval from the U. S. Department of Commerce or
|
||||
* any other agency or department of the United States Government. In the
|
||||
* event Licensee exports any such software from the United States or
|
||||
* re-exports any such software from a foreign destination, Licensee shall
|
||||
* ensure that the distribution and export/re-export of the software is in
|
||||
* compliance with all laws, regulations, orders, or other restrictions of the
|
||||
* U.S. Export Administration Regulations. Licensee agrees that neither it nor
|
||||
* any of its subsidiaries will export/re-export any technical data, process,
|
||||
* software, or service, directly or indirectly, to any country for which the
|
||||
* United States government or any agency thereof requires an export license,
|
||||
* other governmental approval, or letter of assurance, without first obtaining
|
||||
* such license, approval or letter.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
#define __DSARGS_C__
|
||||
|
||||
#include "acpi.h"
|
||||
#include "accommon.h"
|
||||
#include "acparser.h"
|
||||
#include "amlcode.h"
|
||||
#include "acdispat.h"
|
||||
#include "acnamesp.h"
|
||||
|
||||
#define _COMPONENT ACPI_DISPATCHER
|
||||
ACPI_MODULE_NAME ("dsargs")
|
||||
|
||||
/* Local prototypes */
|
||||
|
||||
static ACPI_STATUS
|
||||
AcpiDsExecuteArguments (
|
||||
ACPI_NAMESPACE_NODE *Node,
|
||||
ACPI_NAMESPACE_NODE *ScopeNode,
|
||||
UINT32 AmlLength,
|
||||
UINT8 *AmlStart);
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiDsExecuteArguments
|
||||
*
|
||||
* PARAMETERS: Node - Object NS node
|
||||
* ScopeNode - Parent NS node
|
||||
* AmlLength - Length of executable AML
|
||||
* AmlStart - Pointer to the AML
|
||||
*
|
||||
* RETURN: Status.
|
||||
*
|
||||
* DESCRIPTION: Late (deferred) execution of region or field arguments
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
static ACPI_STATUS
|
||||
AcpiDsExecuteArguments (
|
||||
ACPI_NAMESPACE_NODE *Node,
|
||||
ACPI_NAMESPACE_NODE *ScopeNode,
|
||||
UINT32 AmlLength,
|
||||
UINT8 *AmlStart)
|
||||
{
|
||||
ACPI_STATUS Status;
|
||||
ACPI_PARSE_OBJECT *Op;
|
||||
ACPI_WALK_STATE *WalkState;
|
||||
|
||||
|
||||
ACPI_FUNCTION_TRACE (DsExecuteArguments);
|
||||
|
||||
|
||||
/* Allocate a new parser op to be the root of the parsed tree */
|
||||
|
||||
Op = AcpiPsAllocOp (AML_INT_EVAL_SUBTREE_OP);
|
||||
if (!Op)
|
||||
{
|
||||
return_ACPI_STATUS (AE_NO_MEMORY);
|
||||
}
|
||||
|
||||
/* Save the Node for use in AcpiPsParseAml */
|
||||
|
||||
Op->Common.Node = ScopeNode;
|
||||
|
||||
/* Create and initialize a new parser state */
|
||||
|
||||
WalkState = AcpiDsCreateWalkState (0, NULL, NULL, NULL);
|
||||
if (!WalkState)
|
||||
{
|
||||
Status = AE_NO_MEMORY;
|
||||
goto Cleanup;
|
||||
}
|
||||
|
||||
Status = AcpiDsInitAmlWalk (WalkState, Op, NULL, AmlStart,
|
||||
AmlLength, NULL, ACPI_IMODE_LOAD_PASS1);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
AcpiDsDeleteWalkState (WalkState);
|
||||
goto Cleanup;
|
||||
}
|
||||
|
||||
/* Mark this parse as a deferred opcode */
|
||||
|
||||
WalkState->ParseFlags = ACPI_PARSE_DEFERRED_OP;
|
||||
WalkState->DeferredNode = Node;
|
||||
|
||||
/* Pass1: Parse the entire declaration */
|
||||
|
||||
Status = AcpiPsParseAml (WalkState);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
goto Cleanup;
|
||||
}
|
||||
|
||||
/* Get and init the Op created above */
|
||||
|
||||
Op->Common.Node = Node;
|
||||
AcpiPsDeleteParseTree (Op);
|
||||
|
||||
/* Evaluate the deferred arguments */
|
||||
|
||||
Op = AcpiPsAllocOp (AML_INT_EVAL_SUBTREE_OP);
|
||||
if (!Op)
|
||||
{
|
||||
return_ACPI_STATUS (AE_NO_MEMORY);
|
||||
}
|
||||
|
||||
Op->Common.Node = ScopeNode;
|
||||
|
||||
/* Create and initialize a new parser state */
|
||||
|
||||
WalkState = AcpiDsCreateWalkState (0, NULL, NULL, NULL);
|
||||
if (!WalkState)
|
||||
{
|
||||
Status = AE_NO_MEMORY;
|
||||
goto Cleanup;
|
||||
}
|
||||
|
||||
/* Execute the opcode and arguments */
|
||||
|
||||
Status = AcpiDsInitAmlWalk (WalkState, Op, NULL, AmlStart,
|
||||
AmlLength, NULL, ACPI_IMODE_EXECUTE);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
AcpiDsDeleteWalkState (WalkState);
|
||||
goto Cleanup;
|
||||
}
|
||||
|
||||
/* Mark this execution as a deferred opcode */
|
||||
|
||||
WalkState->DeferredNode = Node;
|
||||
Status = AcpiPsParseAml (WalkState);
|
||||
|
||||
Cleanup:
|
||||
AcpiPsDeleteParseTree (Op);
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiDsGetBufferFieldArguments
|
||||
*
|
||||
* PARAMETERS: ObjDesc - A valid BufferField object
|
||||
*
|
||||
* RETURN: Status.
|
||||
*
|
||||
* DESCRIPTION: Get BufferField Buffer and Index. This implements the late
|
||||
* evaluation of these field attributes.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiDsGetBufferFieldArguments (
|
||||
ACPI_OPERAND_OBJECT *ObjDesc)
|
||||
{
|
||||
ACPI_OPERAND_OBJECT *ExtraDesc;
|
||||
ACPI_NAMESPACE_NODE *Node;
|
||||
ACPI_STATUS Status;
|
||||
|
||||
|
||||
ACPI_FUNCTION_TRACE_PTR (DsGetBufferFieldArguments, ObjDesc);
|
||||
|
||||
|
||||
if (ObjDesc->Common.Flags & AOPOBJ_DATA_VALID)
|
||||
{
|
||||
return_ACPI_STATUS (AE_OK);
|
||||
}
|
||||
|
||||
/* Get the AML pointer (method object) and BufferField node */
|
||||
|
||||
ExtraDesc = AcpiNsGetSecondaryObject (ObjDesc);
|
||||
Node = ObjDesc->BufferField.Node;
|
||||
|
||||
ACPI_DEBUG_EXEC (AcpiUtDisplayInitPathname (ACPI_TYPE_BUFFER_FIELD,
|
||||
Node, NULL));
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "[%4.4s] BufferField Arg Init\n",
|
||||
AcpiUtGetNodeName (Node)));
|
||||
|
||||
/* Execute the AML code for the TermArg arguments */
|
||||
|
||||
Status = AcpiDsExecuteArguments (Node, Node->Parent,
|
||||
ExtraDesc->Extra.AmlLength, ExtraDesc->Extra.AmlStart);
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiDsGetBankFieldArguments
|
||||
*
|
||||
* PARAMETERS: ObjDesc - A valid BankField object
|
||||
*
|
||||
* RETURN: Status.
|
||||
*
|
||||
* DESCRIPTION: Get BankField BankValue. This implements the late
|
||||
* evaluation of these field attributes.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiDsGetBankFieldArguments (
|
||||
ACPI_OPERAND_OBJECT *ObjDesc)
|
||||
{
|
||||
ACPI_OPERAND_OBJECT *ExtraDesc;
|
||||
ACPI_NAMESPACE_NODE *Node;
|
||||
ACPI_STATUS Status;
|
||||
|
||||
|
||||
ACPI_FUNCTION_TRACE_PTR (DsGetBankFieldArguments, ObjDesc);
|
||||
|
||||
|
||||
if (ObjDesc->Common.Flags & AOPOBJ_DATA_VALID)
|
||||
{
|
||||
return_ACPI_STATUS (AE_OK);
|
||||
}
|
||||
|
||||
/* Get the AML pointer (method object) and BankField node */
|
||||
|
||||
ExtraDesc = AcpiNsGetSecondaryObject (ObjDesc);
|
||||
Node = ObjDesc->BankField.Node;
|
||||
|
||||
ACPI_DEBUG_EXEC (AcpiUtDisplayInitPathname (ACPI_TYPE_LOCAL_BANK_FIELD,
|
||||
Node, NULL));
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "[%4.4s] BankField Arg Init\n",
|
||||
AcpiUtGetNodeName (Node)));
|
||||
|
||||
/* Execute the AML code for the TermArg arguments */
|
||||
|
||||
Status = AcpiDsExecuteArguments (Node, Node->Parent,
|
||||
ExtraDesc->Extra.AmlLength, ExtraDesc->Extra.AmlStart);
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiDsGetBufferArguments
|
||||
*
|
||||
* PARAMETERS: ObjDesc - A valid Buffer object
|
||||
*
|
||||
* RETURN: Status.
|
||||
*
|
||||
* DESCRIPTION: Get Buffer length and initializer byte list. This implements
|
||||
* the late evaluation of these attributes.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiDsGetBufferArguments (
|
||||
ACPI_OPERAND_OBJECT *ObjDesc)
|
||||
{
|
||||
ACPI_NAMESPACE_NODE *Node;
|
||||
ACPI_STATUS Status;
|
||||
|
||||
|
||||
ACPI_FUNCTION_TRACE_PTR (DsGetBufferArguments, ObjDesc);
|
||||
|
||||
|
||||
if (ObjDesc->Common.Flags & AOPOBJ_DATA_VALID)
|
||||
{
|
||||
return_ACPI_STATUS (AE_OK);
|
||||
}
|
||||
|
||||
/* Get the Buffer node */
|
||||
|
||||
Node = ObjDesc->Buffer.Node;
|
||||
if (!Node)
|
||||
{
|
||||
ACPI_ERROR ((AE_INFO,
|
||||
"No pointer back to namespace node in buffer object %p", ObjDesc));
|
||||
return_ACPI_STATUS (AE_AML_INTERNAL);
|
||||
}
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Buffer Arg Init\n"));
|
||||
|
||||
/* Execute the AML code for the TermArg arguments */
|
||||
|
||||
Status = AcpiDsExecuteArguments (Node, Node,
|
||||
ObjDesc->Buffer.AmlLength, ObjDesc->Buffer.AmlStart);
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiDsGetPackageArguments
|
||||
*
|
||||
* PARAMETERS: ObjDesc - A valid Package object
|
||||
*
|
||||
* RETURN: Status.
|
||||
*
|
||||
* DESCRIPTION: Get Package length and initializer byte list. This implements
|
||||
* the late evaluation of these attributes.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiDsGetPackageArguments (
|
||||
ACPI_OPERAND_OBJECT *ObjDesc)
|
||||
{
|
||||
ACPI_NAMESPACE_NODE *Node;
|
||||
ACPI_STATUS Status;
|
||||
|
||||
|
||||
ACPI_FUNCTION_TRACE_PTR (DsGetPackageArguments, ObjDesc);
|
||||
|
||||
|
||||
if (ObjDesc->Common.Flags & AOPOBJ_DATA_VALID)
|
||||
{
|
||||
return_ACPI_STATUS (AE_OK);
|
||||
}
|
||||
|
||||
/* Get the Package node */
|
||||
|
||||
Node = ObjDesc->Package.Node;
|
||||
if (!Node)
|
||||
{
|
||||
ACPI_ERROR ((AE_INFO,
|
||||
"No pointer back to namespace node in package %p", ObjDesc));
|
||||
return_ACPI_STATUS (AE_AML_INTERNAL);
|
||||
}
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Package Arg Init\n"));
|
||||
|
||||
/* Execute the AML code for the TermArg arguments */
|
||||
|
||||
Status = AcpiDsExecuteArguments (Node, Node,
|
||||
ObjDesc->Package.AmlLength, ObjDesc->Package.AmlStart);
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiDsGetRegionArguments
|
||||
*
|
||||
* PARAMETERS: ObjDesc - A valid region object
|
||||
*
|
||||
* RETURN: Status.
|
||||
*
|
||||
* DESCRIPTION: Get region address and length. This implements the late
|
||||
* evaluation of these region attributes.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiDsGetRegionArguments (
|
||||
ACPI_OPERAND_OBJECT *ObjDesc)
|
||||
{
|
||||
ACPI_NAMESPACE_NODE *Node;
|
||||
ACPI_STATUS Status;
|
||||
ACPI_OPERAND_OBJECT *ExtraDesc;
|
||||
|
||||
|
||||
ACPI_FUNCTION_TRACE_PTR (DsGetRegionArguments, ObjDesc);
|
||||
|
||||
|
||||
if (ObjDesc->Region.Flags & AOPOBJ_DATA_VALID)
|
||||
{
|
||||
return_ACPI_STATUS (AE_OK);
|
||||
}
|
||||
|
||||
ExtraDesc = AcpiNsGetSecondaryObject (ObjDesc);
|
||||
if (!ExtraDesc)
|
||||
{
|
||||
return_ACPI_STATUS (AE_NOT_EXIST);
|
||||
}
|
||||
|
||||
/* Get the Region node */
|
||||
|
||||
Node = ObjDesc->Region.Node;
|
||||
|
||||
ACPI_DEBUG_EXEC (AcpiUtDisplayInitPathname (ACPI_TYPE_REGION, Node, NULL));
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "[%4.4s] OpRegion Arg Init at AML %p\n",
|
||||
AcpiUtGetNodeName (Node), ExtraDesc->Extra.AmlStart));
|
||||
|
||||
/* Execute the argument AML */
|
||||
|
||||
Status = AcpiDsExecuteArguments (Node, Node->Parent,
|
||||
ExtraDesc->Extra.AmlLength, ExtraDesc->Extra.AmlStart);
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
|
@ -0,0 +1,496 @@
|
|||
/******************************************************************************
|
||||
*
|
||||
* Module Name: dscontrol - Support for execution control opcodes -
|
||||
* if/else/while/return
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
*
|
||||
* 2.1. This is your license from Intel Corp. under its intellectual property
|
||||
* rights. You may have additional license terms from the party that provided
|
||||
* you this software, covering your right to use that party's intellectual
|
||||
* property rights.
|
||||
*
|
||||
* 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
|
||||
* copy of the source code appearing in this file ("Covered Code") an
|
||||
* irrevocable, perpetual, worldwide license under Intel's copyrights in the
|
||||
* base code distributed originally by Intel ("Original Intel Code") to copy,
|
||||
* make derivatives, distribute, use and display any portion of the Covered
|
||||
* Code in any form, with the right to sublicense such rights; and
|
||||
*
|
||||
* 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
|
||||
* license (with the right to sublicense), under only those claims of Intel
|
||||
* patents that are infringed by the Original Intel Code, to make, use, sell,
|
||||
* offer to sell, and import the Covered Code and derivative works thereof
|
||||
* solely to the minimum extent necessary to exercise the above copyright
|
||||
* license, and in no event shall the patent license extend to any additions
|
||||
* to or modifications of the Original Intel Code. No other license or right
|
||||
* is granted directly or by implication, estoppel or otherwise;
|
||||
*
|
||||
* The above copyright and patent license is granted only if the following
|
||||
* conditions are met:
|
||||
*
|
||||
* 3. Conditions
|
||||
*
|
||||
* 3.1. Redistribution of Source with Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification with rights to further distribute source must include
|
||||
* the above Copyright Notice, the above License, this list of Conditions,
|
||||
* and the following Disclaimer and Export Compliance provision. In addition,
|
||||
* Licensee must cause all Covered Code to which Licensee contributes to
|
||||
* contain a file documenting the changes Licensee made to create that Covered
|
||||
* Code and the date of any change. Licensee must include in that file the
|
||||
* documentation of any changes made by any predecessor Licensee. Licensee
|
||||
* must include a prominent statement that the modification is derived,
|
||||
* directly or indirectly, from Original Intel Code.
|
||||
*
|
||||
* 3.2. Redistribution of Source with no Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification without rights to further distribute source must
|
||||
* include the following Disclaimer and Export Compliance provision in the
|
||||
* documentation and/or other materials provided with distribution. In
|
||||
* addition, Licensee may not authorize further sublicense of source of any
|
||||
* portion of the Covered Code, and must include terms to the effect that the
|
||||
* license from Licensee to its licensee is limited to the intellectual
|
||||
* property embodied in the software Licensee provides to its licensee, and
|
||||
* not to intellectual property embodied in modifications its licensee may
|
||||
* make.
|
||||
*
|
||||
* 3.3. Redistribution of Executable. Redistribution in executable form of any
|
||||
* substantial portion of the Covered Code or modification must reproduce the
|
||||
* above Copyright Notice, and the following Disclaimer and Export Compliance
|
||||
* provision in the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* 3.4. Intel retains all right, title, and interest in and to the Original
|
||||
* Intel Code.
|
||||
*
|
||||
* 3.5. Neither the name Intel nor any other trademark owned or controlled by
|
||||
* Intel shall be used in advertising or otherwise to promote the sale, use or
|
||||
* other dealings in products derived from or relating to the Covered Code
|
||||
* without prior written authorization from Intel.
|
||||
*
|
||||
* 4. Disclaimer and Export Compliance
|
||||
*
|
||||
* 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
|
||||
* HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
|
||||
* IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
|
||||
* INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
|
||||
* UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
|
||||
* PARTICULAR PURPOSE.
|
||||
*
|
||||
* 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
|
||||
* OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
|
||||
* COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
|
||||
* SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
|
||||
* CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
|
||||
* HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
|
||||
* SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
|
||||
* LIMITED REMEDY.
|
||||
*
|
||||
* 4.3. Licensee shall not export, either directly or indirectly, any of this
|
||||
* software or system incorporating such software without first obtaining any
|
||||
* required license or other approval from the U. S. Department of Commerce or
|
||||
* any other agency or department of the United States Government. In the
|
||||
* event Licensee exports any such software from the United States or
|
||||
* re-exports any such software from a foreign destination, Licensee shall
|
||||
* ensure that the distribution and export/re-export of the software is in
|
||||
* compliance with all laws, regulations, orders, or other restrictions of the
|
||||
* U.S. Export Administration Regulations. Licensee agrees that neither it nor
|
||||
* any of its subsidiaries will export/re-export any technical data, process,
|
||||
* software, or service, directly or indirectly, to any country for which the
|
||||
* United States government or any agency thereof requires an export license,
|
||||
* other governmental approval, or letter of assurance, without first obtaining
|
||||
* such license, approval or letter.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
#define __DSCONTROL_C__
|
||||
|
||||
#include "acpi.h"
|
||||
#include "accommon.h"
|
||||
#include "amlcode.h"
|
||||
#include "acdispat.h"
|
||||
#include "acinterp.h"
|
||||
|
||||
#define _COMPONENT ACPI_DISPATCHER
|
||||
ACPI_MODULE_NAME ("dscontrol")
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiDsExecBeginControlOp
|
||||
*
|
||||
* PARAMETERS: WalkList - The list that owns the walk stack
|
||||
* Op - The control Op
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Handles all control ops encountered during control method
|
||||
* execution.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiDsExecBeginControlOp (
|
||||
ACPI_WALK_STATE *WalkState,
|
||||
ACPI_PARSE_OBJECT *Op)
|
||||
{
|
||||
ACPI_STATUS Status = AE_OK;
|
||||
ACPI_GENERIC_STATE *ControlState;
|
||||
|
||||
|
||||
ACPI_FUNCTION_NAME (DsExecBeginControlOp);
|
||||
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "Op=%p Opcode=%2.2X State=%p\n",
|
||||
Op, Op->Common.AmlOpcode, WalkState));
|
||||
|
||||
switch (Op->Common.AmlOpcode)
|
||||
{
|
||||
case AML_WHILE_OP:
|
||||
|
||||
/*
|
||||
* If this is an additional iteration of a while loop, continue.
|
||||
* There is no need to allocate a new control state.
|
||||
*/
|
||||
if (WalkState->ControlState)
|
||||
{
|
||||
if (WalkState->ControlState->Control.AmlPredicateStart ==
|
||||
(WalkState->ParserState.Aml - 1))
|
||||
{
|
||||
/* Reset the state to start-of-loop */
|
||||
|
||||
WalkState->ControlState->Common.State =
|
||||
ACPI_CONTROL_CONDITIONAL_EXECUTING;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/*lint -fallthrough */
|
||||
|
||||
case AML_IF_OP:
|
||||
|
||||
/*
|
||||
* IF/WHILE: Create a new control state to manage these
|
||||
* constructs. We need to manage these as a stack, in order
|
||||
* to handle nesting.
|
||||
*/
|
||||
ControlState = AcpiUtCreateControlState ();
|
||||
if (!ControlState)
|
||||
{
|
||||
Status = AE_NO_MEMORY;
|
||||
break;
|
||||
}
|
||||
/*
|
||||
* Save a pointer to the predicate for multiple executions
|
||||
* of a loop
|
||||
*/
|
||||
ControlState->Control.AmlPredicateStart = WalkState->ParserState.Aml - 1;
|
||||
ControlState->Control.PackageEnd = WalkState->ParserState.PkgEnd;
|
||||
ControlState->Control.Opcode = Op->Common.AmlOpcode;
|
||||
|
||||
|
||||
/* Push the control state on this walk's control stack */
|
||||
|
||||
AcpiUtPushGenericState (&WalkState->ControlState, ControlState);
|
||||
break;
|
||||
|
||||
case AML_ELSE_OP:
|
||||
|
||||
/* Predicate is in the state object */
|
||||
/* If predicate is true, the IF was executed, ignore ELSE part */
|
||||
|
||||
if (WalkState->LastPredicate)
|
||||
{
|
||||
Status = AE_CTRL_TRUE;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case AML_RETURN_OP:
|
||||
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return (Status);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiDsExecEndControlOp
|
||||
*
|
||||
* PARAMETERS: WalkList - The list that owns the walk stack
|
||||
* Op - The control Op
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Handles all control ops encountered during control method
|
||||
* execution.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiDsExecEndControlOp (
|
||||
ACPI_WALK_STATE *WalkState,
|
||||
ACPI_PARSE_OBJECT *Op)
|
||||
{
|
||||
ACPI_STATUS Status = AE_OK;
|
||||
ACPI_GENERIC_STATE *ControlState;
|
||||
|
||||
|
||||
ACPI_FUNCTION_NAME (DsExecEndControlOp);
|
||||
|
||||
|
||||
switch (Op->Common.AmlOpcode)
|
||||
{
|
||||
case AML_IF_OP:
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "[IF_OP] Op=%p\n", Op));
|
||||
|
||||
/*
|
||||
* Save the result of the predicate in case there is an
|
||||
* ELSE to come
|
||||
*/
|
||||
WalkState->LastPredicate =
|
||||
(BOOLEAN) WalkState->ControlState->Common.Value;
|
||||
|
||||
/*
|
||||
* Pop the control state that was created at the start
|
||||
* of the IF and free it
|
||||
*/
|
||||
ControlState = AcpiUtPopGenericState (&WalkState->ControlState);
|
||||
AcpiUtDeleteGenericState (ControlState);
|
||||
break;
|
||||
|
||||
|
||||
case AML_ELSE_OP:
|
||||
|
||||
break;
|
||||
|
||||
|
||||
case AML_WHILE_OP:
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "[WHILE_OP] Op=%p\n", Op));
|
||||
|
||||
ControlState = WalkState->ControlState;
|
||||
if (ControlState->Common.Value)
|
||||
{
|
||||
/* Predicate was true, the body of the loop was just executed */
|
||||
|
||||
/*
|
||||
* This loop counter mechanism allows the interpreter to escape
|
||||
* possibly infinite loops. This can occur in poorly written AML
|
||||
* when the hardware does not respond within a while loop and the
|
||||
* loop does not implement a timeout.
|
||||
*/
|
||||
ControlState->Control.LoopCount++;
|
||||
if (ControlState->Control.LoopCount > ACPI_MAX_LOOP_ITERATIONS)
|
||||
{
|
||||
Status = AE_AML_INFINITE_LOOP;
|
||||
break;
|
||||
}
|
||||
|
||||
/*
|
||||
* Go back and evaluate the predicate and maybe execute the loop
|
||||
* another time
|
||||
*/
|
||||
Status = AE_CTRL_PENDING;
|
||||
WalkState->AmlLastWhile = ControlState->Control.AmlPredicateStart;
|
||||
break;
|
||||
}
|
||||
|
||||
/* Predicate was false, terminate this while loop */
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
|
||||
"[WHILE_OP] termination! Op=%p\n",Op));
|
||||
|
||||
/* Pop this control state and free it */
|
||||
|
||||
ControlState = AcpiUtPopGenericState (&WalkState->ControlState);
|
||||
AcpiUtDeleteGenericState (ControlState);
|
||||
break;
|
||||
|
||||
|
||||
case AML_RETURN_OP:
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
|
||||
"[RETURN_OP] Op=%p Arg=%p\n",Op, Op->Common.Value.Arg));
|
||||
|
||||
/*
|
||||
* One optional operand -- the return value
|
||||
* It can be either an immediate operand or a result that
|
||||
* has been bubbled up the tree
|
||||
*/
|
||||
if (Op->Common.Value.Arg)
|
||||
{
|
||||
/* Since we have a real Return(), delete any implicit return */
|
||||
|
||||
AcpiDsClearImplicitReturn (WalkState);
|
||||
|
||||
/* Return statement has an immediate operand */
|
||||
|
||||
Status = AcpiDsCreateOperands (WalkState, Op->Common.Value.Arg);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return (Status);
|
||||
}
|
||||
|
||||
/*
|
||||
* If value being returned is a Reference (such as
|
||||
* an arg or local), resolve it now because it may
|
||||
* cease to exist at the end of the method.
|
||||
*/
|
||||
Status = AcpiExResolveToValue (&WalkState->Operands [0], WalkState);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return (Status);
|
||||
}
|
||||
|
||||
/*
|
||||
* Get the return value and save as the last result
|
||||
* value. This is the only place where WalkState->ReturnDesc
|
||||
* is set to anything other than zero!
|
||||
*/
|
||||
WalkState->ReturnDesc = WalkState->Operands[0];
|
||||
}
|
||||
else if (WalkState->ResultCount)
|
||||
{
|
||||
/* Since we have a real Return(), delete any implicit return */
|
||||
|
||||
AcpiDsClearImplicitReturn (WalkState);
|
||||
|
||||
/*
|
||||
* The return value has come from a previous calculation.
|
||||
*
|
||||
* If value being returned is a Reference (such as
|
||||
* an arg or local), resolve it now because it may
|
||||
* cease to exist at the end of the method.
|
||||
*
|
||||
* Allow references created by the Index operator to return
|
||||
* unchanged.
|
||||
*/
|
||||
if ((ACPI_GET_DESCRIPTOR_TYPE (WalkState->Results->Results.ObjDesc[0]) == ACPI_DESC_TYPE_OPERAND) &&
|
||||
((WalkState->Results->Results.ObjDesc [0])->Common.Type == ACPI_TYPE_LOCAL_REFERENCE) &&
|
||||
((WalkState->Results->Results.ObjDesc [0])->Reference.Class != ACPI_REFCLASS_INDEX))
|
||||
{
|
||||
Status = AcpiExResolveToValue (&WalkState->Results->Results.ObjDesc [0], WalkState);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return (Status);
|
||||
}
|
||||
}
|
||||
|
||||
WalkState->ReturnDesc = WalkState->Results->Results.ObjDesc [0];
|
||||
}
|
||||
else
|
||||
{
|
||||
/* No return operand */
|
||||
|
||||
if (WalkState->NumOperands)
|
||||
{
|
||||
AcpiUtRemoveReference (WalkState->Operands [0]);
|
||||
}
|
||||
|
||||
WalkState->Operands [0] = NULL;
|
||||
WalkState->NumOperands = 0;
|
||||
WalkState->ReturnDesc = NULL;
|
||||
}
|
||||
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
|
||||
"Completed RETURN_OP State=%p, RetVal=%p\n",
|
||||
WalkState, WalkState->ReturnDesc));
|
||||
|
||||
/* End the control method execution right now */
|
||||
|
||||
Status = AE_CTRL_TERMINATE;
|
||||
break;
|
||||
|
||||
|
||||
case AML_NOOP_OP:
|
||||
|
||||
/* Just do nothing! */
|
||||
break;
|
||||
|
||||
|
||||
case AML_BREAK_POINT_OP:
|
||||
|
||||
/*
|
||||
* Set the single-step flag. This will cause the debugger (if present)
|
||||
* to break to the console within the AML debugger at the start of the
|
||||
* next AML instruction.
|
||||
*/
|
||||
ACPI_DEBUGGER_EXEC (
|
||||
AcpiGbl_CmSingleStep = TRUE);
|
||||
ACPI_DEBUGGER_EXEC (
|
||||
AcpiOsPrintf ("**break** Executed AML BreakPoint opcode\n"));
|
||||
|
||||
/* Call to the OSL in case OS wants a piece of the action */
|
||||
|
||||
Status = AcpiOsSignal (ACPI_SIGNAL_BREAKPOINT,
|
||||
"Executed AML Breakpoint opcode");
|
||||
break;
|
||||
|
||||
|
||||
case AML_BREAK_OP:
|
||||
case AML_CONTINUE_OP: /* ACPI 2.0 */
|
||||
|
||||
|
||||
/* Pop and delete control states until we find a while */
|
||||
|
||||
while (WalkState->ControlState &&
|
||||
(WalkState->ControlState->Control.Opcode != AML_WHILE_OP))
|
||||
{
|
||||
ControlState = AcpiUtPopGenericState (&WalkState->ControlState);
|
||||
AcpiUtDeleteGenericState (ControlState);
|
||||
}
|
||||
|
||||
/* No while found? */
|
||||
|
||||
if (!WalkState->ControlState)
|
||||
{
|
||||
return (AE_AML_NO_WHILE);
|
||||
}
|
||||
|
||||
/* Was: WalkState->AmlLastWhile = WalkState->ControlState->Control.AmlPredicateStart; */
|
||||
|
||||
WalkState->AmlLastWhile = WalkState->ControlState->Control.PackageEnd;
|
||||
|
||||
/* Return status depending on opcode */
|
||||
|
||||
if (Op->Common.AmlOpcode == AML_BREAK_OP)
|
||||
{
|
||||
Status = AE_CTRL_BREAK;
|
||||
}
|
||||
else
|
||||
{
|
||||
Status = AE_CTRL_CONTINUE;
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
|
||||
ACPI_ERROR ((AE_INFO, "Unknown control opcode=0x%X Op=%p",
|
||||
Op->Common.AmlOpcode, Op));
|
||||
|
||||
Status = AE_AML_BAD_OPCODE;
|
||||
break;
|
||||
}
|
||||
|
||||
return (Status);
|
||||
}
|
|
@ -8,7 +8,7 @@
|
|||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
|
@ -117,7 +117,6 @@
|
|||
|
||||
#include "acpi.h"
|
||||
#include "accommon.h"
|
||||
#include "amlcode.h"
|
||||
#include "acdispat.h"
|
||||
#include "acinterp.h"
|
||||
#include "acnamesp.h"
|
||||
|
@ -291,7 +290,7 @@ AcpiDsBeginMethodExecution (
|
|||
/*
|
||||
* If this method is serialized, we need to acquire the method mutex.
|
||||
*/
|
||||
if (ObjDesc->Method.MethodFlags & AML_METHOD_SERIALIZED)
|
||||
if (ObjDesc->Method.InfoFlags & ACPI_METHOD_SERIALIZED)
|
||||
{
|
||||
/*
|
||||
* Create a mutex for the method if it is defined to be Serialized
|
||||
|
@ -517,9 +516,9 @@ AcpiDsCallControlMethod (
|
|||
|
||||
/* Invoke an internal method if necessary */
|
||||
|
||||
if (ObjDesc->Method.MethodFlags & AML_METHOD_INTERNAL_ONLY)
|
||||
if (ObjDesc->Method.InfoFlags & ACPI_METHOD_INTERNAL_ONLY)
|
||||
{
|
||||
Status = ObjDesc->Method.Extra.Implementation (NextWalkState);
|
||||
Status = ObjDesc->Method.Dispatch.Implementation (NextWalkState);
|
||||
if (Status == AE_OK)
|
||||
{
|
||||
Status = AE_CTRL_TERMINATE;
|
||||
|
@ -694,11 +693,14 @@ AcpiDsTerminateControlMethod (
|
|||
|
||||
/*
|
||||
* Delete any namespace objects created anywhere within the
|
||||
* namespace by the execution of this method. Unless this method
|
||||
* is a module-level executable code method, in which case we
|
||||
* want make the objects permanent.
|
||||
* namespace by the execution of this method. Unless:
|
||||
* 1) This method is a module-level executable code method, in which
|
||||
* case we want make the objects permanent.
|
||||
* 2) There are other threads executing the method, in which case we
|
||||
* will wait until the last thread has completed.
|
||||
*/
|
||||
if (!(MethodDesc->Method.Flags & AOPOBJ_MODULE_LEVEL))
|
||||
if (!(MethodDesc->Method.InfoFlags & ACPI_METHOD_MODULE_LEVEL) &&
|
||||
(MethodDesc->Method.ThreadCount == 1))
|
||||
{
|
||||
/* Delete any direct children of (created by) this method */
|
||||
|
||||
|
@ -707,10 +709,14 @@ AcpiDsTerminateControlMethod (
|
|||
/*
|
||||
* Delete any objects that were created by this method
|
||||
* elsewhere in the namespace (if any were created).
|
||||
* Use of the ACPI_METHOD_MODIFIED_NAMESPACE optimizes the
|
||||
* deletion such that we don't have to perform an entire
|
||||
* namespace walk for every control method execution.
|
||||
*/
|
||||
if (MethodDesc->Method.Flags & AOPOBJ_MODIFIED_NAMESPACE)
|
||||
if (MethodDesc->Method.InfoFlags & ACPI_METHOD_MODIFIED_NAMESPACE)
|
||||
{
|
||||
AcpiNsDeleteNamespaceByOwner (MethodDesc->Method.OwnerId);
|
||||
MethodDesc->Method.InfoFlags &= ~ACPI_METHOD_MODIFIED_NAMESPACE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -748,20 +754,39 @@ AcpiDsTerminateControlMethod (
|
|||
* Serialized if it appears that the method is incorrectly written and
|
||||
* does not support multiple thread execution. The best example of this
|
||||
* is if such a method creates namespace objects and blocks. A second
|
||||
* thread will fail with an AE_ALREADY_EXISTS exception
|
||||
* thread will fail with an AE_ALREADY_EXISTS exception.
|
||||
*
|
||||
* This code is here because we must wait until the last thread exits
|
||||
* before creating the synchronization semaphore.
|
||||
* before marking the method as serialized.
|
||||
*/
|
||||
if ((MethodDesc->Method.MethodFlags & AML_METHOD_SERIALIZED) &&
|
||||
(!MethodDesc->Method.Mutex))
|
||||
if (MethodDesc->Method.InfoFlags & ACPI_METHOD_SERIALIZED_PENDING)
|
||||
{
|
||||
(void) AcpiDsCreateMethodMutex (MethodDesc);
|
||||
if (WalkState)
|
||||
{
|
||||
ACPI_INFO ((AE_INFO,
|
||||
"Marking method %4.4s as Serialized because of AE_ALREADY_EXISTS error",
|
||||
WalkState->MethodNode->Name.Ascii));
|
||||
}
|
||||
|
||||
/*
|
||||
* Method tried to create an object twice and was marked as
|
||||
* "pending serialized". The probable cause is that the method
|
||||
* cannot handle reentrancy.
|
||||
*
|
||||
* The method was created as NotSerialized, but it tried to create
|
||||
* a named object and then blocked, causing the second thread
|
||||
* entrance to begin and then fail. Workaround this problem by
|
||||
* marking the method permanently as Serialized when the last
|
||||
* thread exits here.
|
||||
*/
|
||||
MethodDesc->Method.InfoFlags &= ~ACPI_METHOD_SERIALIZED_PENDING;
|
||||
MethodDesc->Method.InfoFlags |= ACPI_METHOD_SERIALIZED;
|
||||
MethodDesc->Method.SyncLevel = 0;
|
||||
}
|
||||
|
||||
/* No more threads, we can free the OwnerId */
|
||||
|
||||
if (!(MethodDesc->Method.Flags & AOPOBJ_MODULE_LEVEL))
|
||||
if (!(MethodDesc->Method.InfoFlags & ACPI_METHOD_MODULE_LEVEL))
|
||||
{
|
||||
AcpiUtReleaseOwnerId (&MethodDesc->Method.OwnerId);
|
||||
}
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
|
@ -159,6 +159,7 @@ AcpiDsBuildInternalObject (
|
|||
{
|
||||
ACPI_OPERAND_OBJECT *ObjDesc;
|
||||
ACPI_STATUS Status;
|
||||
ACPI_OBJECT_TYPE Type;
|
||||
|
||||
|
||||
ACPI_FUNCTION_TRACE (DsBuildInternalObject);
|
||||
|
@ -241,7 +242,20 @@ AcpiDsBuildInternalObject (
|
|||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
switch (Op->Common.Node->Type)
|
||||
/*
|
||||
* Special handling for Alias objects. We need to setup the type
|
||||
* and the Op->Common.Node to point to the Alias target. Note,
|
||||
* Alias has at most one level of indirection internally.
|
||||
*/
|
||||
Type = Op->Common.Node->Type;
|
||||
if (Type == ACPI_TYPE_LOCAL_ALIAS)
|
||||
{
|
||||
Type = ObjDesc->Common.Type;
|
||||
Op->Common.Node = ACPI_CAST_PTR (ACPI_NAMESPACE_NODE,
|
||||
Op->Common.Node->Object);
|
||||
}
|
||||
|
||||
switch (Type)
|
||||
{
|
||||
/*
|
||||
* For these types, we need the actual node, not the subobject.
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
/******************************************************************************
|
||||
*
|
||||
* Module Name: dsopcode - Dispatcher Op Region support and handling of
|
||||
* "control" opcodes
|
||||
* Module Name: dsopcode - Dispatcher suport for regions and fields
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
|
@ -9,7 +8,7 @@
|
|||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
|
@ -131,13 +130,6 @@
|
|||
|
||||
/* Local prototypes */
|
||||
|
||||
static ACPI_STATUS
|
||||
AcpiDsExecuteArguments (
|
||||
ACPI_NAMESPACE_NODE *Node,
|
||||
ACPI_NAMESPACE_NODE *ScopeNode,
|
||||
UINT32 AmlLength,
|
||||
UINT8 *AmlStart);
|
||||
|
||||
static ACPI_STATUS
|
||||
AcpiDsInitBufferField (
|
||||
UINT16 AmlOpcode,
|
||||
|
@ -148,369 +140,6 @@ AcpiDsInitBufferField (
|
|||
ACPI_OPERAND_OBJECT *ResultDesc);
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiDsExecuteArguments
|
||||
*
|
||||
* PARAMETERS: Node - Object NS node
|
||||
* ScopeNode - Parent NS node
|
||||
* AmlLength - Length of executable AML
|
||||
* AmlStart - Pointer to the AML
|
||||
*
|
||||
* RETURN: Status.
|
||||
*
|
||||
* DESCRIPTION: Late (deferred) execution of region or field arguments
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
static ACPI_STATUS
|
||||
AcpiDsExecuteArguments (
|
||||
ACPI_NAMESPACE_NODE *Node,
|
||||
ACPI_NAMESPACE_NODE *ScopeNode,
|
||||
UINT32 AmlLength,
|
||||
UINT8 *AmlStart)
|
||||
{
|
||||
ACPI_STATUS Status;
|
||||
ACPI_PARSE_OBJECT *Op;
|
||||
ACPI_WALK_STATE *WalkState;
|
||||
|
||||
|
||||
ACPI_FUNCTION_TRACE (DsExecuteArguments);
|
||||
|
||||
|
||||
/*
|
||||
* Allocate a new parser op to be the root of the parsed tree
|
||||
*/
|
||||
Op = AcpiPsAllocOp (AML_INT_EVAL_SUBTREE_OP);
|
||||
if (!Op)
|
||||
{
|
||||
return_ACPI_STATUS (AE_NO_MEMORY);
|
||||
}
|
||||
|
||||
/* Save the Node for use in AcpiPsParseAml */
|
||||
|
||||
Op->Common.Node = ScopeNode;
|
||||
|
||||
/* Create and initialize a new parser state */
|
||||
|
||||
WalkState = AcpiDsCreateWalkState (0, NULL, NULL, NULL);
|
||||
if (!WalkState)
|
||||
{
|
||||
Status = AE_NO_MEMORY;
|
||||
goto Cleanup;
|
||||
}
|
||||
|
||||
Status = AcpiDsInitAmlWalk (WalkState, Op, NULL, AmlStart,
|
||||
AmlLength, NULL, ACPI_IMODE_LOAD_PASS1);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
AcpiDsDeleteWalkState (WalkState);
|
||||
goto Cleanup;
|
||||
}
|
||||
|
||||
/* Mark this parse as a deferred opcode */
|
||||
|
||||
WalkState->ParseFlags = ACPI_PARSE_DEFERRED_OP;
|
||||
WalkState->DeferredNode = Node;
|
||||
|
||||
/* Pass1: Parse the entire declaration */
|
||||
|
||||
Status = AcpiPsParseAml (WalkState);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
goto Cleanup;
|
||||
}
|
||||
|
||||
/* Get and init the Op created above */
|
||||
|
||||
Op->Common.Node = Node;
|
||||
AcpiPsDeleteParseTree (Op);
|
||||
|
||||
/* Evaluate the deferred arguments */
|
||||
|
||||
Op = AcpiPsAllocOp (AML_INT_EVAL_SUBTREE_OP);
|
||||
if (!Op)
|
||||
{
|
||||
return_ACPI_STATUS (AE_NO_MEMORY);
|
||||
}
|
||||
|
||||
Op->Common.Node = ScopeNode;
|
||||
|
||||
/* Create and initialize a new parser state */
|
||||
|
||||
WalkState = AcpiDsCreateWalkState (0, NULL, NULL, NULL);
|
||||
if (!WalkState)
|
||||
{
|
||||
Status = AE_NO_MEMORY;
|
||||
goto Cleanup;
|
||||
}
|
||||
|
||||
/* Execute the opcode and arguments */
|
||||
|
||||
Status = AcpiDsInitAmlWalk (WalkState, Op, NULL, AmlStart,
|
||||
AmlLength, NULL, ACPI_IMODE_EXECUTE);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
AcpiDsDeleteWalkState (WalkState);
|
||||
goto Cleanup;
|
||||
}
|
||||
|
||||
/* Mark this execution as a deferred opcode */
|
||||
|
||||
WalkState->DeferredNode = Node;
|
||||
Status = AcpiPsParseAml (WalkState);
|
||||
|
||||
Cleanup:
|
||||
AcpiPsDeleteParseTree (Op);
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiDsGetBufferFieldArguments
|
||||
*
|
||||
* PARAMETERS: ObjDesc - A valid BufferField object
|
||||
*
|
||||
* RETURN: Status.
|
||||
*
|
||||
* DESCRIPTION: Get BufferField Buffer and Index. This implements the late
|
||||
* evaluation of these field attributes.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiDsGetBufferFieldArguments (
|
||||
ACPI_OPERAND_OBJECT *ObjDesc)
|
||||
{
|
||||
ACPI_OPERAND_OBJECT *ExtraDesc;
|
||||
ACPI_NAMESPACE_NODE *Node;
|
||||
ACPI_STATUS Status;
|
||||
|
||||
|
||||
ACPI_FUNCTION_TRACE_PTR (DsGetBufferFieldArguments, ObjDesc);
|
||||
|
||||
|
||||
if (ObjDesc->Common.Flags & AOPOBJ_DATA_VALID)
|
||||
{
|
||||
return_ACPI_STATUS (AE_OK);
|
||||
}
|
||||
|
||||
/* Get the AML pointer (method object) and BufferField node */
|
||||
|
||||
ExtraDesc = AcpiNsGetSecondaryObject (ObjDesc);
|
||||
Node = ObjDesc->BufferField.Node;
|
||||
|
||||
ACPI_DEBUG_EXEC(AcpiUtDisplayInitPathname (ACPI_TYPE_BUFFER_FIELD, Node, NULL));
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "[%4.4s] BufferField Arg Init\n",
|
||||
AcpiUtGetNodeName (Node)));
|
||||
|
||||
/* Execute the AML code for the TermArg arguments */
|
||||
|
||||
Status = AcpiDsExecuteArguments (Node, Node->Parent,
|
||||
ExtraDesc->Extra.AmlLength, ExtraDesc->Extra.AmlStart);
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiDsGetBankFieldArguments
|
||||
*
|
||||
* PARAMETERS: ObjDesc - A valid BankField object
|
||||
*
|
||||
* RETURN: Status.
|
||||
*
|
||||
* DESCRIPTION: Get BankField BankValue. This implements the late
|
||||
* evaluation of these field attributes.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiDsGetBankFieldArguments (
|
||||
ACPI_OPERAND_OBJECT *ObjDesc)
|
||||
{
|
||||
ACPI_OPERAND_OBJECT *ExtraDesc;
|
||||
ACPI_NAMESPACE_NODE *Node;
|
||||
ACPI_STATUS Status;
|
||||
|
||||
|
||||
ACPI_FUNCTION_TRACE_PTR (DsGetBankFieldArguments, ObjDesc);
|
||||
|
||||
|
||||
if (ObjDesc->Common.Flags & AOPOBJ_DATA_VALID)
|
||||
{
|
||||
return_ACPI_STATUS (AE_OK);
|
||||
}
|
||||
|
||||
/* Get the AML pointer (method object) and BankField node */
|
||||
|
||||
ExtraDesc = AcpiNsGetSecondaryObject (ObjDesc);
|
||||
Node = ObjDesc->BankField.Node;
|
||||
|
||||
ACPI_DEBUG_EXEC(AcpiUtDisplayInitPathname (ACPI_TYPE_LOCAL_BANK_FIELD, Node, NULL));
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "[%4.4s] BankField Arg Init\n",
|
||||
AcpiUtGetNodeName (Node)));
|
||||
|
||||
/* Execute the AML code for the TermArg arguments */
|
||||
|
||||
Status = AcpiDsExecuteArguments (Node, Node->Parent,
|
||||
ExtraDesc->Extra.AmlLength, ExtraDesc->Extra.AmlStart);
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiDsGetBufferArguments
|
||||
*
|
||||
* PARAMETERS: ObjDesc - A valid Buffer object
|
||||
*
|
||||
* RETURN: Status.
|
||||
*
|
||||
* DESCRIPTION: Get Buffer length and initializer byte list. This implements
|
||||
* the late evaluation of these attributes.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiDsGetBufferArguments (
|
||||
ACPI_OPERAND_OBJECT *ObjDesc)
|
||||
{
|
||||
ACPI_NAMESPACE_NODE *Node;
|
||||
ACPI_STATUS Status;
|
||||
|
||||
|
||||
ACPI_FUNCTION_TRACE_PTR (DsGetBufferArguments, ObjDesc);
|
||||
|
||||
|
||||
if (ObjDesc->Common.Flags & AOPOBJ_DATA_VALID)
|
||||
{
|
||||
return_ACPI_STATUS (AE_OK);
|
||||
}
|
||||
|
||||
/* Get the Buffer node */
|
||||
|
||||
Node = ObjDesc->Buffer.Node;
|
||||
if (!Node)
|
||||
{
|
||||
ACPI_ERROR ((AE_INFO,
|
||||
"No pointer back to namespace node in buffer object %p", ObjDesc));
|
||||
return_ACPI_STATUS (AE_AML_INTERNAL);
|
||||
}
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Buffer Arg Init\n"));
|
||||
|
||||
/* Execute the AML code for the TermArg arguments */
|
||||
|
||||
Status = AcpiDsExecuteArguments (Node, Node,
|
||||
ObjDesc->Buffer.AmlLength, ObjDesc->Buffer.AmlStart);
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiDsGetPackageArguments
|
||||
*
|
||||
* PARAMETERS: ObjDesc - A valid Package object
|
||||
*
|
||||
* RETURN: Status.
|
||||
*
|
||||
* DESCRIPTION: Get Package length and initializer byte list. This implements
|
||||
* the late evaluation of these attributes.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiDsGetPackageArguments (
|
||||
ACPI_OPERAND_OBJECT *ObjDesc)
|
||||
{
|
||||
ACPI_NAMESPACE_NODE *Node;
|
||||
ACPI_STATUS Status;
|
||||
|
||||
|
||||
ACPI_FUNCTION_TRACE_PTR (DsGetPackageArguments, ObjDesc);
|
||||
|
||||
|
||||
if (ObjDesc->Common.Flags & AOPOBJ_DATA_VALID)
|
||||
{
|
||||
return_ACPI_STATUS (AE_OK);
|
||||
}
|
||||
|
||||
/* Get the Package node */
|
||||
|
||||
Node = ObjDesc->Package.Node;
|
||||
if (!Node)
|
||||
{
|
||||
ACPI_ERROR ((AE_INFO,
|
||||
"No pointer back to namespace node in package %p", ObjDesc));
|
||||
return_ACPI_STATUS (AE_AML_INTERNAL);
|
||||
}
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Package Arg Init\n"));
|
||||
|
||||
/* Execute the AML code for the TermArg arguments */
|
||||
|
||||
Status = AcpiDsExecuteArguments (Node, Node,
|
||||
ObjDesc->Package.AmlLength, ObjDesc->Package.AmlStart);
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiDsGetRegionArguments
|
||||
*
|
||||
* PARAMETERS: ObjDesc - A valid region object
|
||||
*
|
||||
* RETURN: Status.
|
||||
*
|
||||
* DESCRIPTION: Get region address and length. This implements the late
|
||||
* evaluation of these region attributes.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiDsGetRegionArguments (
|
||||
ACPI_OPERAND_OBJECT *ObjDesc)
|
||||
{
|
||||
ACPI_NAMESPACE_NODE *Node;
|
||||
ACPI_STATUS Status;
|
||||
ACPI_OPERAND_OBJECT *ExtraDesc;
|
||||
|
||||
|
||||
ACPI_FUNCTION_TRACE_PTR (DsGetRegionArguments, ObjDesc);
|
||||
|
||||
|
||||
if (ObjDesc->Region.Flags & AOPOBJ_DATA_VALID)
|
||||
{
|
||||
return_ACPI_STATUS (AE_OK);
|
||||
}
|
||||
|
||||
ExtraDesc = AcpiNsGetSecondaryObject (ObjDesc);
|
||||
if (!ExtraDesc)
|
||||
{
|
||||
return_ACPI_STATUS (AE_NOT_EXIST);
|
||||
}
|
||||
|
||||
/* Get the Region node */
|
||||
|
||||
Node = ObjDesc->Region.Node;
|
||||
|
||||
ACPI_DEBUG_EXEC (AcpiUtDisplayInitPathname (ACPI_TYPE_REGION, Node, NULL));
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "[%4.4s] OpRegion Arg Init at AML %p\n",
|
||||
AcpiUtGetNodeName (Node), ExtraDesc->Extra.AmlStart));
|
||||
|
||||
/* Execute the argument AML */
|
||||
|
||||
Status = AcpiDsExecuteArguments (Node, Node->Parent,
|
||||
ExtraDesc->Extra.AmlLength, ExtraDesc->Extra.AmlStart);
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiDsInitializeRegion
|
||||
|
@ -942,8 +571,9 @@ AcpiDsEvalRegionOperands (
|
|||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Get region address and length
|
||||
* Called from AcpiDsExecEndOp during DataTableRegion parse tree walk
|
||||
* DESCRIPTION: Get region address and length.
|
||||
* Called from AcpiDsExecEndOp during DataTableRegion parse
|
||||
* tree walk.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
|
@ -1249,371 +879,3 @@ AcpiDsEvalBankFieldOperands (
|
|||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiDsExecBeginControlOp
|
||||
*
|
||||
* PARAMETERS: WalkList - The list that owns the walk stack
|
||||
* Op - The control Op
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Handles all control ops encountered during control method
|
||||
* execution.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiDsExecBeginControlOp (
|
||||
ACPI_WALK_STATE *WalkState,
|
||||
ACPI_PARSE_OBJECT *Op)
|
||||
{
|
||||
ACPI_STATUS Status = AE_OK;
|
||||
ACPI_GENERIC_STATE *ControlState;
|
||||
|
||||
|
||||
ACPI_FUNCTION_NAME (DsExecBeginControlOp);
|
||||
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "Op=%p Opcode=%2.2X State=%p\n", Op,
|
||||
Op->Common.AmlOpcode, WalkState));
|
||||
|
||||
switch (Op->Common.AmlOpcode)
|
||||
{
|
||||
case AML_WHILE_OP:
|
||||
|
||||
/*
|
||||
* If this is an additional iteration of a while loop, continue.
|
||||
* There is no need to allocate a new control state.
|
||||
*/
|
||||
if (WalkState->ControlState)
|
||||
{
|
||||
if (WalkState->ControlState->Control.AmlPredicateStart ==
|
||||
(WalkState->ParserState.Aml - 1))
|
||||
{
|
||||
/* Reset the state to start-of-loop */
|
||||
|
||||
WalkState->ControlState->Common.State = ACPI_CONTROL_CONDITIONAL_EXECUTING;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/*lint -fallthrough */
|
||||
|
||||
case AML_IF_OP:
|
||||
|
||||
/*
|
||||
* IF/WHILE: Create a new control state to manage these
|
||||
* constructs. We need to manage these as a stack, in order
|
||||
* to handle nesting.
|
||||
*/
|
||||
ControlState = AcpiUtCreateControlState ();
|
||||
if (!ControlState)
|
||||
{
|
||||
Status = AE_NO_MEMORY;
|
||||
break;
|
||||
}
|
||||
/*
|
||||
* Save a pointer to the predicate for multiple executions
|
||||
* of a loop
|
||||
*/
|
||||
ControlState->Control.AmlPredicateStart = WalkState->ParserState.Aml - 1;
|
||||
ControlState->Control.PackageEnd = WalkState->ParserState.PkgEnd;
|
||||
ControlState->Control.Opcode = Op->Common.AmlOpcode;
|
||||
|
||||
|
||||
/* Push the control state on this walk's control stack */
|
||||
|
||||
AcpiUtPushGenericState (&WalkState->ControlState, ControlState);
|
||||
break;
|
||||
|
||||
case AML_ELSE_OP:
|
||||
|
||||
/* Predicate is in the state object */
|
||||
/* If predicate is true, the IF was executed, ignore ELSE part */
|
||||
|
||||
if (WalkState->LastPredicate)
|
||||
{
|
||||
Status = AE_CTRL_TRUE;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case AML_RETURN_OP:
|
||||
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return (Status);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiDsExecEndControlOp
|
||||
*
|
||||
* PARAMETERS: WalkList - The list that owns the walk stack
|
||||
* Op - The control Op
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Handles all control ops encountered during control method
|
||||
* execution.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiDsExecEndControlOp (
|
||||
ACPI_WALK_STATE *WalkState,
|
||||
ACPI_PARSE_OBJECT *Op)
|
||||
{
|
||||
ACPI_STATUS Status = AE_OK;
|
||||
ACPI_GENERIC_STATE *ControlState;
|
||||
|
||||
|
||||
ACPI_FUNCTION_NAME (DsExecEndControlOp);
|
||||
|
||||
|
||||
switch (Op->Common.AmlOpcode)
|
||||
{
|
||||
case AML_IF_OP:
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "[IF_OP] Op=%p\n", Op));
|
||||
|
||||
/*
|
||||
* Save the result of the predicate in case there is an
|
||||
* ELSE to come
|
||||
*/
|
||||
WalkState->LastPredicate =
|
||||
(BOOLEAN) WalkState->ControlState->Common.Value;
|
||||
|
||||
/*
|
||||
* Pop the control state that was created at the start
|
||||
* of the IF and free it
|
||||
*/
|
||||
ControlState = AcpiUtPopGenericState (&WalkState->ControlState);
|
||||
AcpiUtDeleteGenericState (ControlState);
|
||||
break;
|
||||
|
||||
|
||||
case AML_ELSE_OP:
|
||||
|
||||
break;
|
||||
|
||||
|
||||
case AML_WHILE_OP:
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "[WHILE_OP] Op=%p\n", Op));
|
||||
|
||||
ControlState = WalkState->ControlState;
|
||||
if (ControlState->Common.Value)
|
||||
{
|
||||
/* Predicate was true, the body of the loop was just executed */
|
||||
|
||||
/*
|
||||
* This loop counter mechanism allows the interpreter to escape
|
||||
* possibly infinite loops. This can occur in poorly written AML
|
||||
* when the hardware does not respond within a while loop and the
|
||||
* loop does not implement a timeout.
|
||||
*/
|
||||
ControlState->Control.LoopCount++;
|
||||
if (ControlState->Control.LoopCount > ACPI_MAX_LOOP_ITERATIONS)
|
||||
{
|
||||
Status = AE_AML_INFINITE_LOOP;
|
||||
break;
|
||||
}
|
||||
|
||||
/*
|
||||
* Go back and evaluate the predicate and maybe execute the loop
|
||||
* another time
|
||||
*/
|
||||
Status = AE_CTRL_PENDING;
|
||||
WalkState->AmlLastWhile = ControlState->Control.AmlPredicateStart;
|
||||
break;
|
||||
}
|
||||
|
||||
/* Predicate was false, terminate this while loop */
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
|
||||
"[WHILE_OP] termination! Op=%p\n",Op));
|
||||
|
||||
/* Pop this control state and free it */
|
||||
|
||||
ControlState = AcpiUtPopGenericState (&WalkState->ControlState);
|
||||
AcpiUtDeleteGenericState (ControlState);
|
||||
break;
|
||||
|
||||
|
||||
case AML_RETURN_OP:
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
|
||||
"[RETURN_OP] Op=%p Arg=%p\n",Op, Op->Common.Value.Arg));
|
||||
|
||||
/*
|
||||
* One optional operand -- the return value
|
||||
* It can be either an immediate operand or a result that
|
||||
* has been bubbled up the tree
|
||||
*/
|
||||
if (Op->Common.Value.Arg)
|
||||
{
|
||||
/* Since we have a real Return(), delete any implicit return */
|
||||
|
||||
AcpiDsClearImplicitReturn (WalkState);
|
||||
|
||||
/* Return statement has an immediate operand */
|
||||
|
||||
Status = AcpiDsCreateOperands (WalkState, Op->Common.Value.Arg);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return (Status);
|
||||
}
|
||||
|
||||
/*
|
||||
* If value being returned is a Reference (such as
|
||||
* an arg or local), resolve it now because it may
|
||||
* cease to exist at the end of the method.
|
||||
*/
|
||||
Status = AcpiExResolveToValue (&WalkState->Operands [0], WalkState);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return (Status);
|
||||
}
|
||||
|
||||
/*
|
||||
* Get the return value and save as the last result
|
||||
* value. This is the only place where WalkState->ReturnDesc
|
||||
* is set to anything other than zero!
|
||||
*/
|
||||
WalkState->ReturnDesc = WalkState->Operands[0];
|
||||
}
|
||||
else if (WalkState->ResultCount)
|
||||
{
|
||||
/* Since we have a real Return(), delete any implicit return */
|
||||
|
||||
AcpiDsClearImplicitReturn (WalkState);
|
||||
|
||||
/*
|
||||
* The return value has come from a previous calculation.
|
||||
*
|
||||
* If value being returned is a Reference (such as
|
||||
* an arg or local), resolve it now because it may
|
||||
* cease to exist at the end of the method.
|
||||
*
|
||||
* Allow references created by the Index operator to return unchanged.
|
||||
*/
|
||||
if ((ACPI_GET_DESCRIPTOR_TYPE (WalkState->Results->Results.ObjDesc[0]) == ACPI_DESC_TYPE_OPERAND) &&
|
||||
((WalkState->Results->Results.ObjDesc [0])->Common.Type == ACPI_TYPE_LOCAL_REFERENCE) &&
|
||||
((WalkState->Results->Results.ObjDesc [0])->Reference.Class != ACPI_REFCLASS_INDEX))
|
||||
{
|
||||
Status = AcpiExResolveToValue (&WalkState->Results->Results.ObjDesc [0], WalkState);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return (Status);
|
||||
}
|
||||
}
|
||||
|
||||
WalkState->ReturnDesc = WalkState->Results->Results.ObjDesc [0];
|
||||
}
|
||||
else
|
||||
{
|
||||
/* No return operand */
|
||||
|
||||
if (WalkState->NumOperands)
|
||||
{
|
||||
AcpiUtRemoveReference (WalkState->Operands [0]);
|
||||
}
|
||||
|
||||
WalkState->Operands [0] = NULL;
|
||||
WalkState->NumOperands = 0;
|
||||
WalkState->ReturnDesc = NULL;
|
||||
}
|
||||
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
|
||||
"Completed RETURN_OP State=%p, RetVal=%p\n",
|
||||
WalkState, WalkState->ReturnDesc));
|
||||
|
||||
/* End the control method execution right now */
|
||||
|
||||
Status = AE_CTRL_TERMINATE;
|
||||
break;
|
||||
|
||||
|
||||
case AML_NOOP_OP:
|
||||
|
||||
/* Just do nothing! */
|
||||
break;
|
||||
|
||||
|
||||
case AML_BREAK_POINT_OP:
|
||||
|
||||
/*
|
||||
* Set the single-step flag. This will cause the debugger (if present)
|
||||
* to break to the console within the AML debugger at the start of the
|
||||
* next AML instruction.
|
||||
*/
|
||||
ACPI_DEBUGGER_EXEC (
|
||||
AcpiGbl_CmSingleStep = TRUE);
|
||||
ACPI_DEBUGGER_EXEC (
|
||||
AcpiOsPrintf ("**break** Executed AML BreakPoint opcode\n"));
|
||||
|
||||
/* Call to the OSL in case OS wants a piece of the action */
|
||||
|
||||
Status = AcpiOsSignal (ACPI_SIGNAL_BREAKPOINT,
|
||||
"Executed AML Breakpoint opcode");
|
||||
break;
|
||||
|
||||
|
||||
case AML_BREAK_OP:
|
||||
case AML_CONTINUE_OP: /* ACPI 2.0 */
|
||||
|
||||
|
||||
/* Pop and delete control states until we find a while */
|
||||
|
||||
while (WalkState->ControlState &&
|
||||
(WalkState->ControlState->Control.Opcode != AML_WHILE_OP))
|
||||
{
|
||||
ControlState = AcpiUtPopGenericState (&WalkState->ControlState);
|
||||
AcpiUtDeleteGenericState (ControlState);
|
||||
}
|
||||
|
||||
/* No while found? */
|
||||
|
||||
if (!WalkState->ControlState)
|
||||
{
|
||||
return (AE_AML_NO_WHILE);
|
||||
}
|
||||
|
||||
/* Was: WalkState->AmlLastWhile = WalkState->ControlState->Control.AmlPredicateStart; */
|
||||
|
||||
WalkState->AmlLastWhile = WalkState->ControlState->Control.PackageEnd;
|
||||
|
||||
/* Return status depending on opcode */
|
||||
|
||||
if (Op->Common.AmlOpcode == AML_BREAK_OP)
|
||||
{
|
||||
Status = AE_CTRL_BREAK;
|
||||
}
|
||||
else
|
||||
{
|
||||
Status = AE_CTRL_CONTINUE;
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
|
||||
ACPI_ERROR ((AE_INFO, "Unknown control opcode=0x%X Op=%p",
|
||||
Op->Common.AmlOpcode, Op));
|
||||
|
||||
Status = AE_AML_BAD_OPCODE;
|
||||
break;
|
||||
}
|
||||
|
||||
return (Status);
|
||||
}
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
|
@ -400,10 +400,26 @@ AcpiDsExecBeginOp (
|
|||
* we must enter this object into the namespace. The created
|
||||
* object is temporary and will be deleted upon completion of
|
||||
* the execution of this method.
|
||||
*
|
||||
* Note 10/2010: Except for the Scope() op. This opcode does
|
||||
* not actually create a new object, it refers to an existing
|
||||
* object. However, for Scope(), we want to indeed open a
|
||||
* new scope.
|
||||
*/
|
||||
Status = AcpiDsLoad2BeginOp (WalkState, NULL);
|
||||
if (Op->Common.AmlOpcode != AML_SCOPE_OP)
|
||||
{
|
||||
Status = AcpiDsLoad2BeginOp (WalkState, NULL);
|
||||
}
|
||||
else
|
||||
{
|
||||
Status = AcpiDsScopeStackPush (Op->Named.Node,
|
||||
Op->Named.Node->Type, WalkState);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/******************************************************************************
|
||||
*
|
||||
* Module Name: dswload - Dispatcher namespace load callbacks
|
||||
* Module Name: dswload - Dispatcher first pass namespace load callbacks
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
|
@ -8,7 +8,7 @@
|
|||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
|
@ -122,7 +122,6 @@
|
|||
#include "acdispat.h"
|
||||
#include "acinterp.h"
|
||||
#include "acnamesp.h"
|
||||
#include "acevents.h"
|
||||
|
||||
#ifdef ACPI_ASL_COMPILER
|
||||
#include "acdisasm.h"
|
||||
|
@ -539,7 +538,7 @@ AcpiDsLoad1EndOp (
|
|||
else if (Op->Common.AmlOpcode == AML_DATA_REGION_OP)
|
||||
{
|
||||
Status = AcpiExCreateRegion (Op->Named.Data, Op->Named.Length,
|
||||
REGION_DATA_TABLE, WalkState);
|
||||
ACPI_ADR_SPACE_DATA_TABLE, WalkState);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return_ACPI_STATUS (Status);
|
||||
|
@ -622,695 +621,3 @@ AcpiDsLoad1EndOp (
|
|||
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiDsLoad2BeginOp
|
||||
*
|
||||
* PARAMETERS: WalkState - Current state of the parse tree walk
|
||||
* OutOp - Wher to return op if a new one is created
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Descending callback used during the loading of ACPI tables.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiDsLoad2BeginOp (
|
||||
ACPI_WALK_STATE *WalkState,
|
||||
ACPI_PARSE_OBJECT **OutOp)
|
||||
{
|
||||
ACPI_PARSE_OBJECT *Op;
|
||||
ACPI_NAMESPACE_NODE *Node;
|
||||
ACPI_STATUS Status;
|
||||
ACPI_OBJECT_TYPE ObjectType;
|
||||
char *BufferPtr;
|
||||
UINT32 Flags;
|
||||
|
||||
|
||||
ACPI_FUNCTION_TRACE (DsLoad2BeginOp);
|
||||
|
||||
|
||||
Op = WalkState->Op;
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "Op=%p State=%p\n", Op, WalkState));
|
||||
|
||||
if (Op)
|
||||
{
|
||||
if ((WalkState->ControlState) &&
|
||||
(WalkState->ControlState->Common.State ==
|
||||
ACPI_CONTROL_CONDITIONAL_EXECUTING))
|
||||
{
|
||||
/* We are executing a while loop outside of a method */
|
||||
|
||||
Status = AcpiDsExecBeginOp (WalkState, OutOp);
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
/* We only care about Namespace opcodes here */
|
||||
|
||||
if ((!(WalkState->OpInfo->Flags & AML_NSOPCODE) &&
|
||||
(WalkState->Opcode != AML_INT_NAMEPATH_OP)) ||
|
||||
(!(WalkState->OpInfo->Flags & AML_NAMED)))
|
||||
{
|
||||
return_ACPI_STATUS (AE_OK);
|
||||
}
|
||||
|
||||
/* Get the name we are going to enter or lookup in the namespace */
|
||||
|
||||
if (WalkState->Opcode == AML_INT_NAMEPATH_OP)
|
||||
{
|
||||
/* For Namepath op, get the path string */
|
||||
|
||||
BufferPtr = Op->Common.Value.String;
|
||||
if (!BufferPtr)
|
||||
{
|
||||
/* No name, just exit */
|
||||
|
||||
return_ACPI_STATUS (AE_OK);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Get name from the op */
|
||||
|
||||
BufferPtr = ACPI_CAST_PTR (char, &Op->Named.Name);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Get the namestring from the raw AML */
|
||||
|
||||
BufferPtr = AcpiPsGetNextNamestring (&WalkState->ParserState);
|
||||
}
|
||||
|
||||
/* Map the opcode into an internal object type */
|
||||
|
||||
ObjectType = WalkState->OpInfo->ObjectType;
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
|
||||
"State=%p Op=%p Type=%X\n", WalkState, Op, ObjectType));
|
||||
|
||||
switch (WalkState->Opcode)
|
||||
{
|
||||
case AML_FIELD_OP:
|
||||
case AML_BANK_FIELD_OP:
|
||||
case AML_INDEX_FIELD_OP:
|
||||
|
||||
Node = NULL;
|
||||
Status = AE_OK;
|
||||
break;
|
||||
|
||||
case AML_INT_NAMEPATH_OP:
|
||||
/*
|
||||
* The NamePath is an object reference to an existing object.
|
||||
* Don't enter the name into the namespace, but look it up
|
||||
* for use later.
|
||||
*/
|
||||
Status = AcpiNsLookup (WalkState->ScopeInfo, BufferPtr, ObjectType,
|
||||
ACPI_IMODE_EXECUTE, ACPI_NS_SEARCH_PARENT,
|
||||
WalkState, &(Node));
|
||||
break;
|
||||
|
||||
case AML_SCOPE_OP:
|
||||
|
||||
/* Special case for Scope(\) -> refers to the Root node */
|
||||
|
||||
if (Op && (Op->Named.Node == AcpiGbl_RootNode))
|
||||
{
|
||||
Node = Op->Named.Node;
|
||||
|
||||
Status = AcpiDsScopeStackPush (Node, ObjectType, WalkState);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/*
|
||||
* The Path is an object reference to an existing object.
|
||||
* Don't enter the name into the namespace, but look it up
|
||||
* for use later.
|
||||
*/
|
||||
Status = AcpiNsLookup (WalkState->ScopeInfo, BufferPtr, ObjectType,
|
||||
ACPI_IMODE_EXECUTE, ACPI_NS_SEARCH_PARENT,
|
||||
WalkState, &(Node));
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
#ifdef ACPI_ASL_COMPILER
|
||||
if (Status == AE_NOT_FOUND)
|
||||
{
|
||||
Status = AE_OK;
|
||||
}
|
||||
else
|
||||
{
|
||||
ACPI_ERROR_NAMESPACE (BufferPtr, Status);
|
||||
}
|
||||
#else
|
||||
ACPI_ERROR_NAMESPACE (BufferPtr, Status);
|
||||
#endif
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* We must check to make sure that the target is
|
||||
* one of the opcodes that actually opens a scope
|
||||
*/
|
||||
switch (Node->Type)
|
||||
{
|
||||
case ACPI_TYPE_ANY:
|
||||
case ACPI_TYPE_LOCAL_SCOPE: /* Scope */
|
||||
case ACPI_TYPE_DEVICE:
|
||||
case ACPI_TYPE_POWER:
|
||||
case ACPI_TYPE_PROCESSOR:
|
||||
case ACPI_TYPE_THERMAL:
|
||||
|
||||
/* These are acceptable types */
|
||||
break;
|
||||
|
||||
case ACPI_TYPE_INTEGER:
|
||||
case ACPI_TYPE_STRING:
|
||||
case ACPI_TYPE_BUFFER:
|
||||
|
||||
/*
|
||||
* These types we will allow, but we will change the type.
|
||||
* This enables some existing code of the form:
|
||||
*
|
||||
* Name (DEB, 0)
|
||||
* Scope (DEB) { ... }
|
||||
*/
|
||||
ACPI_WARNING ((AE_INFO,
|
||||
"Type override - [%4.4s] had invalid type (%s) "
|
||||
"for Scope operator, changed to type ANY\n",
|
||||
AcpiUtGetNodeName (Node), AcpiUtGetTypeName (Node->Type)));
|
||||
|
||||
Node->Type = ACPI_TYPE_ANY;
|
||||
WalkState->ScopeInfo->Common.Value = ACPI_TYPE_ANY;
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
/* All other types are an error */
|
||||
|
||||
ACPI_ERROR ((AE_INFO,
|
||||
"Invalid type (%s) for target of "
|
||||
"Scope operator [%4.4s] (Cannot override)",
|
||||
AcpiUtGetTypeName (Node->Type), AcpiUtGetNodeName (Node)));
|
||||
|
||||
return (AE_AML_OPERAND_TYPE);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
/* All other opcodes */
|
||||
|
||||
if (Op && Op->Common.Node)
|
||||
{
|
||||
/* This op/node was previously entered into the namespace */
|
||||
|
||||
Node = Op->Common.Node;
|
||||
|
||||
if (AcpiNsOpensScope (ObjectType))
|
||||
{
|
||||
Status = AcpiDsScopeStackPush (Node, ObjectType, WalkState);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
}
|
||||
|
||||
return_ACPI_STATUS (AE_OK);
|
||||
}
|
||||
|
||||
/*
|
||||
* Enter the named type into the internal namespace. We enter the name
|
||||
* as we go downward in the parse tree. Any necessary subobjects that
|
||||
* involve arguments to the opcode must be created as we go back up the
|
||||
* parse tree later.
|
||||
*
|
||||
* Note: Name may already exist if we are executing a deferred opcode.
|
||||
*/
|
||||
if (WalkState->DeferredNode)
|
||||
{
|
||||
/* This name is already in the namespace, get the node */
|
||||
|
||||
Node = WalkState->DeferredNode;
|
||||
Status = AE_OK;
|
||||
break;
|
||||
}
|
||||
|
||||
Flags = ACPI_NS_NO_UPSEARCH;
|
||||
if (WalkState->PassNumber == ACPI_IMODE_EXECUTE)
|
||||
{
|
||||
/* Execution mode, node cannot already exist, node is temporary */
|
||||
|
||||
Flags |= ACPI_NS_ERROR_IF_FOUND;
|
||||
|
||||
if (!(WalkState->ParseFlags & ACPI_PARSE_MODULE_LEVEL))
|
||||
{
|
||||
Flags |= ACPI_NS_TEMPORARY;
|
||||
}
|
||||
}
|
||||
|
||||
/* Add new entry or lookup existing entry */
|
||||
|
||||
Status = AcpiNsLookup (WalkState->ScopeInfo, BufferPtr, ObjectType,
|
||||
ACPI_IMODE_LOAD_PASS2, Flags, WalkState, &Node);
|
||||
|
||||
if (ACPI_SUCCESS (Status) && (Flags & ACPI_NS_TEMPORARY))
|
||||
{
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
|
||||
"***New Node [%4.4s] %p is temporary\n",
|
||||
AcpiUtGetNodeName (Node), Node));
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
ACPI_ERROR_NAMESPACE (BufferPtr, Status);
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
if (!Op)
|
||||
{
|
||||
/* Create a new op */
|
||||
|
||||
Op = AcpiPsAllocOp (WalkState->Opcode);
|
||||
if (!Op)
|
||||
{
|
||||
return_ACPI_STATUS (AE_NO_MEMORY);
|
||||
}
|
||||
|
||||
/* Initialize the new op */
|
||||
|
||||
if (Node)
|
||||
{
|
||||
Op->Named.Name = Node->Name.Integer;
|
||||
}
|
||||
*OutOp = Op;
|
||||
}
|
||||
|
||||
/*
|
||||
* Put the Node in the "op" object that the parser uses, so we
|
||||
* can get it again quickly when this scope is closed
|
||||
*/
|
||||
Op->Common.Node = Node;
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiDsLoad2EndOp
|
||||
*
|
||||
* PARAMETERS: WalkState - Current state of the parse tree walk
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Ascending callback used during the loading of the namespace,
|
||||
* both control methods and everything else.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiDsLoad2EndOp (
|
||||
ACPI_WALK_STATE *WalkState)
|
||||
{
|
||||
ACPI_PARSE_OBJECT *Op;
|
||||
ACPI_STATUS Status = AE_OK;
|
||||
ACPI_OBJECT_TYPE ObjectType;
|
||||
ACPI_NAMESPACE_NODE *Node;
|
||||
ACPI_PARSE_OBJECT *Arg;
|
||||
ACPI_NAMESPACE_NODE *NewNode;
|
||||
#ifndef ACPI_NO_METHOD_EXECUTION
|
||||
UINT32 i;
|
||||
UINT8 RegionSpace;
|
||||
#endif
|
||||
|
||||
|
||||
ACPI_FUNCTION_TRACE (DsLoad2EndOp);
|
||||
|
||||
Op = WalkState->Op;
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "Opcode [%s] Op %p State %p\n",
|
||||
WalkState->OpInfo->Name, Op, WalkState));
|
||||
|
||||
/* Check if opcode had an associated namespace object */
|
||||
|
||||
if (!(WalkState->OpInfo->Flags & AML_NSOBJECT))
|
||||
{
|
||||
return_ACPI_STATUS (AE_OK);
|
||||
}
|
||||
|
||||
if (Op->Common.AmlOpcode == AML_SCOPE_OP)
|
||||
{
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
|
||||
"Ending scope Op=%p State=%p\n", Op, WalkState));
|
||||
}
|
||||
|
||||
ObjectType = WalkState->OpInfo->ObjectType;
|
||||
|
||||
/*
|
||||
* Get the Node/name from the earlier lookup
|
||||
* (It was saved in the *op structure)
|
||||
*/
|
||||
Node = Op->Common.Node;
|
||||
|
||||
/*
|
||||
* Put the Node on the object stack (Contains the ACPI Name of
|
||||
* this object)
|
||||
*/
|
||||
WalkState->Operands[0] = (void *) Node;
|
||||
WalkState->NumOperands = 1;
|
||||
|
||||
/* Pop the scope stack */
|
||||
|
||||
if (AcpiNsOpensScope (ObjectType) &&
|
||||
(Op->Common.AmlOpcode != AML_INT_METHODCALL_OP))
|
||||
{
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "(%s) Popping scope for Op %p\n",
|
||||
AcpiUtGetTypeName (ObjectType), Op));
|
||||
|
||||
Status = AcpiDsScopeStackPop (WalkState);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
goto Cleanup;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Named operations are as follows:
|
||||
*
|
||||
* AML_ALIAS
|
||||
* AML_BANKFIELD
|
||||
* AML_CREATEBITFIELD
|
||||
* AML_CREATEBYTEFIELD
|
||||
* AML_CREATEDWORDFIELD
|
||||
* AML_CREATEFIELD
|
||||
* AML_CREATEQWORDFIELD
|
||||
* AML_CREATEWORDFIELD
|
||||
* AML_DATA_REGION
|
||||
* AML_DEVICE
|
||||
* AML_EVENT
|
||||
* AML_FIELD
|
||||
* AML_INDEXFIELD
|
||||
* AML_METHOD
|
||||
* AML_METHODCALL
|
||||
* AML_MUTEX
|
||||
* AML_NAME
|
||||
* AML_NAMEDFIELD
|
||||
* AML_OPREGION
|
||||
* AML_POWERRES
|
||||
* AML_PROCESSOR
|
||||
* AML_SCOPE
|
||||
* AML_THERMALZONE
|
||||
*/
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
|
||||
"Create-Load [%s] State=%p Op=%p NamedObj=%p\n",
|
||||
AcpiPsGetOpcodeName (Op->Common.AmlOpcode), WalkState, Op, Node));
|
||||
|
||||
/* Decode the opcode */
|
||||
|
||||
Arg = Op->Common.Value.Arg;
|
||||
|
||||
switch (WalkState->OpInfo->Type)
|
||||
{
|
||||
#ifndef ACPI_NO_METHOD_EXECUTION
|
||||
|
||||
case AML_TYPE_CREATE_FIELD:
|
||||
/*
|
||||
* Create the field object, but the field buffer and index must
|
||||
* be evaluated later during the execution phase
|
||||
*/
|
||||
Status = AcpiDsCreateBufferField (Op, WalkState);
|
||||
break;
|
||||
|
||||
|
||||
case AML_TYPE_NAMED_FIELD:
|
||||
/*
|
||||
* If we are executing a method, initialize the field
|
||||
*/
|
||||
if (WalkState->MethodNode)
|
||||
{
|
||||
Status = AcpiDsInitFieldObjects (Op, WalkState);
|
||||
}
|
||||
|
||||
switch (Op->Common.AmlOpcode)
|
||||
{
|
||||
case AML_INDEX_FIELD_OP:
|
||||
|
||||
Status = AcpiDsCreateIndexField (Op, (ACPI_HANDLE) Arg->Common.Node,
|
||||
WalkState);
|
||||
break;
|
||||
|
||||
case AML_BANK_FIELD_OP:
|
||||
|
||||
Status = AcpiDsCreateBankField (Op, Arg->Common.Node, WalkState);
|
||||
break;
|
||||
|
||||
case AML_FIELD_OP:
|
||||
|
||||
Status = AcpiDsCreateField (Op, Arg->Common.Node, WalkState);
|
||||
break;
|
||||
|
||||
default:
|
||||
/* All NAMED_FIELD opcodes must be handled above */
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
case AML_TYPE_NAMED_SIMPLE:
|
||||
|
||||
Status = AcpiDsCreateOperands (WalkState, Arg);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
goto Cleanup;
|
||||
}
|
||||
|
||||
switch (Op->Common.AmlOpcode)
|
||||
{
|
||||
case AML_PROCESSOR_OP:
|
||||
|
||||
Status = AcpiExCreateProcessor (WalkState);
|
||||
break;
|
||||
|
||||
case AML_POWER_RES_OP:
|
||||
|
||||
Status = AcpiExCreatePowerResource (WalkState);
|
||||
break;
|
||||
|
||||
case AML_MUTEX_OP:
|
||||
|
||||
Status = AcpiExCreateMutex (WalkState);
|
||||
break;
|
||||
|
||||
case AML_EVENT_OP:
|
||||
|
||||
Status = AcpiExCreateEvent (WalkState);
|
||||
break;
|
||||
|
||||
|
||||
case AML_ALIAS_OP:
|
||||
|
||||
Status = AcpiExCreateAlias (WalkState);
|
||||
break;
|
||||
|
||||
default:
|
||||
/* Unknown opcode */
|
||||
|
||||
Status = AE_OK;
|
||||
goto Cleanup;
|
||||
}
|
||||
|
||||
/* Delete operands */
|
||||
|
||||
for (i = 1; i < WalkState->NumOperands; i++)
|
||||
{
|
||||
AcpiUtRemoveReference (WalkState->Operands[i]);
|
||||
WalkState->Operands[i] = NULL;
|
||||
}
|
||||
|
||||
break;
|
||||
#endif /* ACPI_NO_METHOD_EXECUTION */
|
||||
|
||||
case AML_TYPE_NAMED_COMPLEX:
|
||||
|
||||
switch (Op->Common.AmlOpcode)
|
||||
{
|
||||
#ifndef ACPI_NO_METHOD_EXECUTION
|
||||
case AML_REGION_OP:
|
||||
case AML_DATA_REGION_OP:
|
||||
|
||||
if (Op->Common.AmlOpcode == AML_REGION_OP)
|
||||
{
|
||||
RegionSpace = (ACPI_ADR_SPACE_TYPE)
|
||||
((Op->Common.Value.Arg)->Common.Value.Integer);
|
||||
}
|
||||
else
|
||||
{
|
||||
RegionSpace = REGION_DATA_TABLE;
|
||||
}
|
||||
|
||||
/*
|
||||
* The OpRegion is not fully parsed at this time. The only valid
|
||||
* argument is the SpaceId. (We must save the address of the
|
||||
* AML of the address and length operands)
|
||||
*
|
||||
* If we have a valid region, initialize it. The namespace is
|
||||
* unlocked at this point.
|
||||
*
|
||||
* Need to unlock interpreter if it is locked (if we are running
|
||||
* a control method), in order to allow _REG methods to be run
|
||||
* during AcpiEvInitializeRegion.
|
||||
*/
|
||||
if (WalkState->MethodNode)
|
||||
{
|
||||
/*
|
||||
* Executing a method: initialize the region and unlock
|
||||
* the interpreter
|
||||
*/
|
||||
Status = AcpiExCreateRegion (Op->Named.Data, Op->Named.Length,
|
||||
RegionSpace, WalkState);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return (Status);
|
||||
}
|
||||
|
||||
AcpiExExitInterpreter ();
|
||||
}
|
||||
|
||||
Status = AcpiEvInitializeRegion (AcpiNsGetAttachedObject (Node),
|
||||
FALSE);
|
||||
if (WalkState->MethodNode)
|
||||
{
|
||||
AcpiExEnterInterpreter ();
|
||||
}
|
||||
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
/*
|
||||
* If AE_NOT_EXIST is returned, it is not fatal
|
||||
* because many regions get created before a handler
|
||||
* is installed for said region.
|
||||
*/
|
||||
if (AE_NOT_EXIST == Status)
|
||||
{
|
||||
Status = AE_OK;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
case AML_NAME_OP:
|
||||
|
||||
Status = AcpiDsCreateNode (WalkState, Node, Op);
|
||||
break;
|
||||
|
||||
|
||||
case AML_METHOD_OP:
|
||||
/*
|
||||
* MethodOp PkgLength NameString MethodFlags TermList
|
||||
*
|
||||
* Note: We must create the method node/object pair as soon as we
|
||||
* see the method declaration. This allows later pass1 parsing
|
||||
* of invocations of the method (need to know the number of
|
||||
* arguments.)
|
||||
*/
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
|
||||
"LOADING-Method: State=%p Op=%p NamedObj=%p\n",
|
||||
WalkState, Op, Op->Named.Node));
|
||||
|
||||
if (!AcpiNsGetAttachedObject (Op->Named.Node))
|
||||
{
|
||||
WalkState->Operands[0] = ACPI_CAST_PTR (void, Op->Named.Node);
|
||||
WalkState->NumOperands = 1;
|
||||
|
||||
Status = AcpiDsCreateOperands (WalkState, Op->Common.Value.Arg);
|
||||
if (ACPI_SUCCESS (Status))
|
||||
{
|
||||
Status = AcpiExCreateMethod (Op->Named.Data,
|
||||
Op->Named.Length, WalkState);
|
||||
}
|
||||
WalkState->Operands[0] = NULL;
|
||||
WalkState->NumOperands = 0;
|
||||
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
#endif /* ACPI_NO_METHOD_EXECUTION */
|
||||
|
||||
default:
|
||||
/* All NAMED_COMPLEX opcodes must be handled above */
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
case AML_CLASS_INTERNAL:
|
||||
|
||||
/* case AML_INT_NAMEPATH_OP: */
|
||||
break;
|
||||
|
||||
|
||||
case AML_CLASS_METHOD_CALL:
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
|
||||
"RESOLVING-MethodCall: State=%p Op=%p NamedObj=%p\n",
|
||||
WalkState, Op, Node));
|
||||
|
||||
/*
|
||||
* Lookup the method name and save the Node
|
||||
*/
|
||||
Status = AcpiNsLookup (WalkState->ScopeInfo, Arg->Common.Value.String,
|
||||
ACPI_TYPE_ANY, ACPI_IMODE_LOAD_PASS2,
|
||||
ACPI_NS_SEARCH_PARENT | ACPI_NS_DONT_OPEN_SCOPE,
|
||||
WalkState, &(NewNode));
|
||||
if (ACPI_SUCCESS (Status))
|
||||
{
|
||||
/*
|
||||
* Make sure that what we found is indeed a method
|
||||
* We didn't search for a method on purpose, to see if the name
|
||||
* would resolve
|
||||
*/
|
||||
if (NewNode->Type != ACPI_TYPE_METHOD)
|
||||
{
|
||||
Status = AE_AML_OPERAND_TYPE;
|
||||
}
|
||||
|
||||
/* We could put the returned object (Node) on the object stack for
|
||||
* later, but for now, we will put it in the "op" object that the
|
||||
* parser uses, so we can get it again at the end of this scope
|
||||
*/
|
||||
Op->Common.Node = NewNode;
|
||||
}
|
||||
else
|
||||
{
|
||||
ACPI_ERROR_NAMESPACE (Arg->Common.Value.String, Status);
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
Cleanup:
|
||||
|
||||
/* Remove the Node pushed at the very beginning */
|
||||
|
||||
WalkState->Operands[0] = NULL;
|
||||
WalkState->NumOperands = 0;
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -0,0 +1,819 @@
|
|||
/******************************************************************************
|
||||
*
|
||||
* Module Name: dswload2 - Dispatcher second pass namespace load callbacks
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
*
|
||||
* 2.1. This is your license from Intel Corp. under its intellectual property
|
||||
* rights. You may have additional license terms from the party that provided
|
||||
* you this software, covering your right to use that party's intellectual
|
||||
* property rights.
|
||||
*
|
||||
* 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
|
||||
* copy of the source code appearing in this file ("Covered Code") an
|
||||
* irrevocable, perpetual, worldwide license under Intel's copyrights in the
|
||||
* base code distributed originally by Intel ("Original Intel Code") to copy,
|
||||
* make derivatives, distribute, use and display any portion of the Covered
|
||||
* Code in any form, with the right to sublicense such rights; and
|
||||
*
|
||||
* 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
|
||||
* license (with the right to sublicense), under only those claims of Intel
|
||||
* patents that are infringed by the Original Intel Code, to make, use, sell,
|
||||
* offer to sell, and import the Covered Code and derivative works thereof
|
||||
* solely to the minimum extent necessary to exercise the above copyright
|
||||
* license, and in no event shall the patent license extend to any additions
|
||||
* to or modifications of the Original Intel Code. No other license or right
|
||||
* is granted directly or by implication, estoppel or otherwise;
|
||||
*
|
||||
* The above copyright and patent license is granted only if the following
|
||||
* conditions are met:
|
||||
*
|
||||
* 3. Conditions
|
||||
*
|
||||
* 3.1. Redistribution of Source with Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification with rights to further distribute source must include
|
||||
* the above Copyright Notice, the above License, this list of Conditions,
|
||||
* and the following Disclaimer and Export Compliance provision. In addition,
|
||||
* Licensee must cause all Covered Code to which Licensee contributes to
|
||||
* contain a file documenting the changes Licensee made to create that Covered
|
||||
* Code and the date of any change. Licensee must include in that file the
|
||||
* documentation of any changes made by any predecessor Licensee. Licensee
|
||||
* must include a prominent statement that the modification is derived,
|
||||
* directly or indirectly, from Original Intel Code.
|
||||
*
|
||||
* 3.2. Redistribution of Source with no Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification without rights to further distribute source must
|
||||
* include the following Disclaimer and Export Compliance provision in the
|
||||
* documentation and/or other materials provided with distribution. In
|
||||
* addition, Licensee may not authorize further sublicense of source of any
|
||||
* portion of the Covered Code, and must include terms to the effect that the
|
||||
* license from Licensee to its licensee is limited to the intellectual
|
||||
* property embodied in the software Licensee provides to its licensee, and
|
||||
* not to intellectual property embodied in modifications its licensee may
|
||||
* make.
|
||||
*
|
||||
* 3.3. Redistribution of Executable. Redistribution in executable form of any
|
||||
* substantial portion of the Covered Code or modification must reproduce the
|
||||
* above Copyright Notice, and the following Disclaimer and Export Compliance
|
||||
* provision in the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* 3.4. Intel retains all right, title, and interest in and to the Original
|
||||
* Intel Code.
|
||||
*
|
||||
* 3.5. Neither the name Intel nor any other trademark owned or controlled by
|
||||
* Intel shall be used in advertising or otherwise to promote the sale, use or
|
||||
* other dealings in products derived from or relating to the Covered Code
|
||||
* without prior written authorization from Intel.
|
||||
*
|
||||
* 4. Disclaimer and Export Compliance
|
||||
*
|
||||
* 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
|
||||
* HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
|
||||
* IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
|
||||
* INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
|
||||
* UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
|
||||
* PARTICULAR PURPOSE.
|
||||
*
|
||||
* 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
|
||||
* OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
|
||||
* COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
|
||||
* SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
|
||||
* CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
|
||||
* HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
|
||||
* SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
|
||||
* LIMITED REMEDY.
|
||||
*
|
||||
* 4.3. Licensee shall not export, either directly or indirectly, any of this
|
||||
* software or system incorporating such software without first obtaining any
|
||||
* required license or other approval from the U. S. Department of Commerce or
|
||||
* any other agency or department of the United States Government. In the
|
||||
* event Licensee exports any such software from the United States or
|
||||
* re-exports any such software from a foreign destination, Licensee shall
|
||||
* ensure that the distribution and export/re-export of the software is in
|
||||
* compliance with all laws, regulations, orders, or other restrictions of the
|
||||
* U.S. Export Administration Regulations. Licensee agrees that neither it nor
|
||||
* any of its subsidiaries will export/re-export any technical data, process,
|
||||
* software, or service, directly or indirectly, to any country for which the
|
||||
* United States government or any agency thereof requires an export license,
|
||||
* other governmental approval, or letter of assurance, without first obtaining
|
||||
* such license, approval or letter.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
#define __DSWLOAD2_C__
|
||||
|
||||
#include "acpi.h"
|
||||
#include "accommon.h"
|
||||
#include "acparser.h"
|
||||
#include "amlcode.h"
|
||||
#include "acdispat.h"
|
||||
#include "acinterp.h"
|
||||
#include "acnamesp.h"
|
||||
#include "acevents.h"
|
||||
|
||||
#define _COMPONENT ACPI_DISPATCHER
|
||||
ACPI_MODULE_NAME ("dswload2")
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiDsLoad2BeginOp
|
||||
*
|
||||
* PARAMETERS: WalkState - Current state of the parse tree walk
|
||||
* OutOp - Wher to return op if a new one is created
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Descending callback used during the loading of ACPI tables.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiDsLoad2BeginOp (
|
||||
ACPI_WALK_STATE *WalkState,
|
||||
ACPI_PARSE_OBJECT **OutOp)
|
||||
{
|
||||
ACPI_PARSE_OBJECT *Op;
|
||||
ACPI_NAMESPACE_NODE *Node;
|
||||
ACPI_STATUS Status;
|
||||
ACPI_OBJECT_TYPE ObjectType;
|
||||
char *BufferPtr;
|
||||
UINT32 Flags;
|
||||
|
||||
|
||||
ACPI_FUNCTION_TRACE (DsLoad2BeginOp);
|
||||
|
||||
|
||||
Op = WalkState->Op;
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "Op=%p State=%p\n", Op, WalkState));
|
||||
|
||||
if (Op)
|
||||
{
|
||||
if ((WalkState->ControlState) &&
|
||||
(WalkState->ControlState->Common.State ==
|
||||
ACPI_CONTROL_CONDITIONAL_EXECUTING))
|
||||
{
|
||||
/* We are executing a while loop outside of a method */
|
||||
|
||||
Status = AcpiDsExecBeginOp (WalkState, OutOp);
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
/* We only care about Namespace opcodes here */
|
||||
|
||||
if ((!(WalkState->OpInfo->Flags & AML_NSOPCODE) &&
|
||||
(WalkState->Opcode != AML_INT_NAMEPATH_OP)) ||
|
||||
(!(WalkState->OpInfo->Flags & AML_NAMED)))
|
||||
{
|
||||
return_ACPI_STATUS (AE_OK);
|
||||
}
|
||||
|
||||
/* Get the name we are going to enter or lookup in the namespace */
|
||||
|
||||
if (WalkState->Opcode == AML_INT_NAMEPATH_OP)
|
||||
{
|
||||
/* For Namepath op, get the path string */
|
||||
|
||||
BufferPtr = Op->Common.Value.String;
|
||||
if (!BufferPtr)
|
||||
{
|
||||
/* No name, just exit */
|
||||
|
||||
return_ACPI_STATUS (AE_OK);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Get name from the op */
|
||||
|
||||
BufferPtr = ACPI_CAST_PTR (char, &Op->Named.Name);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Get the namestring from the raw AML */
|
||||
|
||||
BufferPtr = AcpiPsGetNextNamestring (&WalkState->ParserState);
|
||||
}
|
||||
|
||||
/* Map the opcode into an internal object type */
|
||||
|
||||
ObjectType = WalkState->OpInfo->ObjectType;
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
|
||||
"State=%p Op=%p Type=%X\n", WalkState, Op, ObjectType));
|
||||
|
||||
switch (WalkState->Opcode)
|
||||
{
|
||||
case AML_FIELD_OP:
|
||||
case AML_BANK_FIELD_OP:
|
||||
case AML_INDEX_FIELD_OP:
|
||||
|
||||
Node = NULL;
|
||||
Status = AE_OK;
|
||||
break;
|
||||
|
||||
case AML_INT_NAMEPATH_OP:
|
||||
/*
|
||||
* The NamePath is an object reference to an existing object.
|
||||
* Don't enter the name into the namespace, but look it up
|
||||
* for use later.
|
||||
*/
|
||||
Status = AcpiNsLookup (WalkState->ScopeInfo, BufferPtr, ObjectType,
|
||||
ACPI_IMODE_EXECUTE, ACPI_NS_SEARCH_PARENT,
|
||||
WalkState, &(Node));
|
||||
break;
|
||||
|
||||
case AML_SCOPE_OP:
|
||||
|
||||
/* Special case for Scope(\) -> refers to the Root node */
|
||||
|
||||
if (Op && (Op->Named.Node == AcpiGbl_RootNode))
|
||||
{
|
||||
Node = Op->Named.Node;
|
||||
|
||||
Status = AcpiDsScopeStackPush (Node, ObjectType, WalkState);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/*
|
||||
* The Path is an object reference to an existing object.
|
||||
* Don't enter the name into the namespace, but look it up
|
||||
* for use later.
|
||||
*/
|
||||
Status = AcpiNsLookup (WalkState->ScopeInfo, BufferPtr, ObjectType,
|
||||
ACPI_IMODE_EXECUTE, ACPI_NS_SEARCH_PARENT,
|
||||
WalkState, &(Node));
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
#ifdef ACPI_ASL_COMPILER
|
||||
if (Status == AE_NOT_FOUND)
|
||||
{
|
||||
Status = AE_OK;
|
||||
}
|
||||
else
|
||||
{
|
||||
ACPI_ERROR_NAMESPACE (BufferPtr, Status);
|
||||
}
|
||||
#else
|
||||
ACPI_ERROR_NAMESPACE (BufferPtr, Status);
|
||||
#endif
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* We must check to make sure that the target is
|
||||
* one of the opcodes that actually opens a scope
|
||||
*/
|
||||
switch (Node->Type)
|
||||
{
|
||||
case ACPI_TYPE_ANY:
|
||||
case ACPI_TYPE_LOCAL_SCOPE: /* Scope */
|
||||
case ACPI_TYPE_DEVICE:
|
||||
case ACPI_TYPE_POWER:
|
||||
case ACPI_TYPE_PROCESSOR:
|
||||
case ACPI_TYPE_THERMAL:
|
||||
|
||||
/* These are acceptable types */
|
||||
break;
|
||||
|
||||
case ACPI_TYPE_INTEGER:
|
||||
case ACPI_TYPE_STRING:
|
||||
case ACPI_TYPE_BUFFER:
|
||||
|
||||
/*
|
||||
* These types we will allow, but we will change the type.
|
||||
* This enables some existing code of the form:
|
||||
*
|
||||
* Name (DEB, 0)
|
||||
* Scope (DEB) { ... }
|
||||
*/
|
||||
ACPI_WARNING ((AE_INFO,
|
||||
"Type override - [%4.4s] had invalid type (%s) "
|
||||
"for Scope operator, changed to type ANY\n",
|
||||
AcpiUtGetNodeName (Node), AcpiUtGetTypeName (Node->Type)));
|
||||
|
||||
Node->Type = ACPI_TYPE_ANY;
|
||||
WalkState->ScopeInfo->Common.Value = ACPI_TYPE_ANY;
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
/* All other types are an error */
|
||||
|
||||
ACPI_ERROR ((AE_INFO,
|
||||
"Invalid type (%s) for target of "
|
||||
"Scope operator [%4.4s] (Cannot override)",
|
||||
AcpiUtGetTypeName (Node->Type), AcpiUtGetNodeName (Node)));
|
||||
|
||||
return (AE_AML_OPERAND_TYPE);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
/* All other opcodes */
|
||||
|
||||
if (Op && Op->Common.Node)
|
||||
{
|
||||
/* This op/node was previously entered into the namespace */
|
||||
|
||||
Node = Op->Common.Node;
|
||||
|
||||
if (AcpiNsOpensScope (ObjectType))
|
||||
{
|
||||
Status = AcpiDsScopeStackPush (Node, ObjectType, WalkState);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
}
|
||||
|
||||
return_ACPI_STATUS (AE_OK);
|
||||
}
|
||||
|
||||
/*
|
||||
* Enter the named type into the internal namespace. We enter the name
|
||||
* as we go downward in the parse tree. Any necessary subobjects that
|
||||
* involve arguments to the opcode must be created as we go back up the
|
||||
* parse tree later.
|
||||
*
|
||||
* Note: Name may already exist if we are executing a deferred opcode.
|
||||
*/
|
||||
if (WalkState->DeferredNode)
|
||||
{
|
||||
/* This name is already in the namespace, get the node */
|
||||
|
||||
Node = WalkState->DeferredNode;
|
||||
Status = AE_OK;
|
||||
break;
|
||||
}
|
||||
|
||||
Flags = ACPI_NS_NO_UPSEARCH;
|
||||
if (WalkState->PassNumber == ACPI_IMODE_EXECUTE)
|
||||
{
|
||||
/* Execution mode, node cannot already exist, node is temporary */
|
||||
|
||||
Flags |= ACPI_NS_ERROR_IF_FOUND;
|
||||
|
||||
if (!(WalkState->ParseFlags & ACPI_PARSE_MODULE_LEVEL))
|
||||
{
|
||||
Flags |= ACPI_NS_TEMPORARY;
|
||||
}
|
||||
}
|
||||
|
||||
/* Add new entry or lookup existing entry */
|
||||
|
||||
Status = AcpiNsLookup (WalkState->ScopeInfo, BufferPtr, ObjectType,
|
||||
ACPI_IMODE_LOAD_PASS2, Flags, WalkState, &Node);
|
||||
|
||||
if (ACPI_SUCCESS (Status) && (Flags & ACPI_NS_TEMPORARY))
|
||||
{
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
|
||||
"***New Node [%4.4s] %p is temporary\n",
|
||||
AcpiUtGetNodeName (Node), Node));
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
ACPI_ERROR_NAMESPACE (BufferPtr, Status);
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
if (!Op)
|
||||
{
|
||||
/* Create a new op */
|
||||
|
||||
Op = AcpiPsAllocOp (WalkState->Opcode);
|
||||
if (!Op)
|
||||
{
|
||||
return_ACPI_STATUS (AE_NO_MEMORY);
|
||||
}
|
||||
|
||||
/* Initialize the new op */
|
||||
|
||||
if (Node)
|
||||
{
|
||||
Op->Named.Name = Node->Name.Integer;
|
||||
}
|
||||
*OutOp = Op;
|
||||
}
|
||||
|
||||
/*
|
||||
* Put the Node in the "op" object that the parser uses, so we
|
||||
* can get it again quickly when this scope is closed
|
||||
*/
|
||||
Op->Common.Node = Node;
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiDsLoad2EndOp
|
||||
*
|
||||
* PARAMETERS: WalkState - Current state of the parse tree walk
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Ascending callback used during the loading of the namespace,
|
||||
* both control methods and everything else.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiDsLoad2EndOp (
|
||||
ACPI_WALK_STATE *WalkState)
|
||||
{
|
||||
ACPI_PARSE_OBJECT *Op;
|
||||
ACPI_STATUS Status = AE_OK;
|
||||
ACPI_OBJECT_TYPE ObjectType;
|
||||
ACPI_NAMESPACE_NODE *Node;
|
||||
ACPI_PARSE_OBJECT *Arg;
|
||||
ACPI_NAMESPACE_NODE *NewNode;
|
||||
#ifndef ACPI_NO_METHOD_EXECUTION
|
||||
UINT32 i;
|
||||
UINT8 RegionSpace;
|
||||
#endif
|
||||
|
||||
|
||||
ACPI_FUNCTION_TRACE (DsLoad2EndOp);
|
||||
|
||||
Op = WalkState->Op;
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "Opcode [%s] Op %p State %p\n",
|
||||
WalkState->OpInfo->Name, Op, WalkState));
|
||||
|
||||
/* Check if opcode had an associated namespace object */
|
||||
|
||||
if (!(WalkState->OpInfo->Flags & AML_NSOBJECT))
|
||||
{
|
||||
return_ACPI_STATUS (AE_OK);
|
||||
}
|
||||
|
||||
if (Op->Common.AmlOpcode == AML_SCOPE_OP)
|
||||
{
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
|
||||
"Ending scope Op=%p State=%p\n", Op, WalkState));
|
||||
}
|
||||
|
||||
ObjectType = WalkState->OpInfo->ObjectType;
|
||||
|
||||
/*
|
||||
* Get the Node/name from the earlier lookup
|
||||
* (It was saved in the *op structure)
|
||||
*/
|
||||
Node = Op->Common.Node;
|
||||
|
||||
/*
|
||||
* Put the Node on the object stack (Contains the ACPI Name of
|
||||
* this object)
|
||||
*/
|
||||
WalkState->Operands[0] = (void *) Node;
|
||||
WalkState->NumOperands = 1;
|
||||
|
||||
/* Pop the scope stack */
|
||||
|
||||
if (AcpiNsOpensScope (ObjectType) &&
|
||||
(Op->Common.AmlOpcode != AML_INT_METHODCALL_OP))
|
||||
{
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "(%s) Popping scope for Op %p\n",
|
||||
AcpiUtGetTypeName (ObjectType), Op));
|
||||
|
||||
Status = AcpiDsScopeStackPop (WalkState);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
goto Cleanup;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Named operations are as follows:
|
||||
*
|
||||
* AML_ALIAS
|
||||
* AML_BANKFIELD
|
||||
* AML_CREATEBITFIELD
|
||||
* AML_CREATEBYTEFIELD
|
||||
* AML_CREATEDWORDFIELD
|
||||
* AML_CREATEFIELD
|
||||
* AML_CREATEQWORDFIELD
|
||||
* AML_CREATEWORDFIELD
|
||||
* AML_DATA_REGION
|
||||
* AML_DEVICE
|
||||
* AML_EVENT
|
||||
* AML_FIELD
|
||||
* AML_INDEXFIELD
|
||||
* AML_METHOD
|
||||
* AML_METHODCALL
|
||||
* AML_MUTEX
|
||||
* AML_NAME
|
||||
* AML_NAMEDFIELD
|
||||
* AML_OPREGION
|
||||
* AML_POWERRES
|
||||
* AML_PROCESSOR
|
||||
* AML_SCOPE
|
||||
* AML_THERMALZONE
|
||||
*/
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
|
||||
"Create-Load [%s] State=%p Op=%p NamedObj=%p\n",
|
||||
AcpiPsGetOpcodeName (Op->Common.AmlOpcode), WalkState, Op, Node));
|
||||
|
||||
/* Decode the opcode */
|
||||
|
||||
Arg = Op->Common.Value.Arg;
|
||||
|
||||
switch (WalkState->OpInfo->Type)
|
||||
{
|
||||
#ifndef ACPI_NO_METHOD_EXECUTION
|
||||
|
||||
case AML_TYPE_CREATE_FIELD:
|
||||
/*
|
||||
* Create the field object, but the field buffer and index must
|
||||
* be evaluated later during the execution phase
|
||||
*/
|
||||
Status = AcpiDsCreateBufferField (Op, WalkState);
|
||||
break;
|
||||
|
||||
|
||||
case AML_TYPE_NAMED_FIELD:
|
||||
/*
|
||||
* If we are executing a method, initialize the field
|
||||
*/
|
||||
if (WalkState->MethodNode)
|
||||
{
|
||||
Status = AcpiDsInitFieldObjects (Op, WalkState);
|
||||
}
|
||||
|
||||
switch (Op->Common.AmlOpcode)
|
||||
{
|
||||
case AML_INDEX_FIELD_OP:
|
||||
|
||||
Status = AcpiDsCreateIndexField (Op, (ACPI_HANDLE) Arg->Common.Node,
|
||||
WalkState);
|
||||
break;
|
||||
|
||||
case AML_BANK_FIELD_OP:
|
||||
|
||||
Status = AcpiDsCreateBankField (Op, Arg->Common.Node, WalkState);
|
||||
break;
|
||||
|
||||
case AML_FIELD_OP:
|
||||
|
||||
Status = AcpiDsCreateField (Op, Arg->Common.Node, WalkState);
|
||||
break;
|
||||
|
||||
default:
|
||||
/* All NAMED_FIELD opcodes must be handled above */
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
case AML_TYPE_NAMED_SIMPLE:
|
||||
|
||||
Status = AcpiDsCreateOperands (WalkState, Arg);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
goto Cleanup;
|
||||
}
|
||||
|
||||
switch (Op->Common.AmlOpcode)
|
||||
{
|
||||
case AML_PROCESSOR_OP:
|
||||
|
||||
Status = AcpiExCreateProcessor (WalkState);
|
||||
break;
|
||||
|
||||
case AML_POWER_RES_OP:
|
||||
|
||||
Status = AcpiExCreatePowerResource (WalkState);
|
||||
break;
|
||||
|
||||
case AML_MUTEX_OP:
|
||||
|
||||
Status = AcpiExCreateMutex (WalkState);
|
||||
break;
|
||||
|
||||
case AML_EVENT_OP:
|
||||
|
||||
Status = AcpiExCreateEvent (WalkState);
|
||||
break;
|
||||
|
||||
|
||||
case AML_ALIAS_OP:
|
||||
|
||||
Status = AcpiExCreateAlias (WalkState);
|
||||
break;
|
||||
|
||||
default:
|
||||
/* Unknown opcode */
|
||||
|
||||
Status = AE_OK;
|
||||
goto Cleanup;
|
||||
}
|
||||
|
||||
/* Delete operands */
|
||||
|
||||
for (i = 1; i < WalkState->NumOperands; i++)
|
||||
{
|
||||
AcpiUtRemoveReference (WalkState->Operands[i]);
|
||||
WalkState->Operands[i] = NULL;
|
||||
}
|
||||
|
||||
break;
|
||||
#endif /* ACPI_NO_METHOD_EXECUTION */
|
||||
|
||||
case AML_TYPE_NAMED_COMPLEX:
|
||||
|
||||
switch (Op->Common.AmlOpcode)
|
||||
{
|
||||
#ifndef ACPI_NO_METHOD_EXECUTION
|
||||
case AML_REGION_OP:
|
||||
case AML_DATA_REGION_OP:
|
||||
|
||||
if (Op->Common.AmlOpcode == AML_REGION_OP)
|
||||
{
|
||||
RegionSpace = (ACPI_ADR_SPACE_TYPE)
|
||||
((Op->Common.Value.Arg)->Common.Value.Integer);
|
||||
}
|
||||
else
|
||||
{
|
||||
RegionSpace = ACPI_ADR_SPACE_DATA_TABLE;
|
||||
}
|
||||
|
||||
/*
|
||||
* The OpRegion is not fully parsed at this time. The only valid
|
||||
* argument is the SpaceId. (We must save the address of the
|
||||
* AML of the address and length operands)
|
||||
*
|
||||
* If we have a valid region, initialize it. The namespace is
|
||||
* unlocked at this point.
|
||||
*
|
||||
* Need to unlock interpreter if it is locked (if we are running
|
||||
* a control method), in order to allow _REG methods to be run
|
||||
* during AcpiEvInitializeRegion.
|
||||
*/
|
||||
if (WalkState->MethodNode)
|
||||
{
|
||||
/*
|
||||
* Executing a method: initialize the region and unlock
|
||||
* the interpreter
|
||||
*/
|
||||
Status = AcpiExCreateRegion (Op->Named.Data, Op->Named.Length,
|
||||
RegionSpace, WalkState);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return (Status);
|
||||
}
|
||||
|
||||
AcpiExExitInterpreter ();
|
||||
}
|
||||
|
||||
Status = AcpiEvInitializeRegion (AcpiNsGetAttachedObject (Node),
|
||||
FALSE);
|
||||
if (WalkState->MethodNode)
|
||||
{
|
||||
AcpiExEnterInterpreter ();
|
||||
}
|
||||
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
/*
|
||||
* If AE_NOT_EXIST is returned, it is not fatal
|
||||
* because many regions get created before a handler
|
||||
* is installed for said region.
|
||||
*/
|
||||
if (AE_NOT_EXIST == Status)
|
||||
{
|
||||
Status = AE_OK;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
case AML_NAME_OP:
|
||||
|
||||
Status = AcpiDsCreateNode (WalkState, Node, Op);
|
||||
break;
|
||||
|
||||
|
||||
case AML_METHOD_OP:
|
||||
/*
|
||||
* MethodOp PkgLength NameString MethodFlags TermList
|
||||
*
|
||||
* Note: We must create the method node/object pair as soon as we
|
||||
* see the method declaration. This allows later pass1 parsing
|
||||
* of invocations of the method (need to know the number of
|
||||
* arguments.)
|
||||
*/
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
|
||||
"LOADING-Method: State=%p Op=%p NamedObj=%p\n",
|
||||
WalkState, Op, Op->Named.Node));
|
||||
|
||||
if (!AcpiNsGetAttachedObject (Op->Named.Node))
|
||||
{
|
||||
WalkState->Operands[0] = ACPI_CAST_PTR (void, Op->Named.Node);
|
||||
WalkState->NumOperands = 1;
|
||||
|
||||
Status = AcpiDsCreateOperands (WalkState, Op->Common.Value.Arg);
|
||||
if (ACPI_SUCCESS (Status))
|
||||
{
|
||||
Status = AcpiExCreateMethod (Op->Named.Data,
|
||||
Op->Named.Length, WalkState);
|
||||
}
|
||||
WalkState->Operands[0] = NULL;
|
||||
WalkState->NumOperands = 0;
|
||||
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
#endif /* ACPI_NO_METHOD_EXECUTION */
|
||||
|
||||
default:
|
||||
/* All NAMED_COMPLEX opcodes must be handled above */
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
case AML_CLASS_INTERNAL:
|
||||
|
||||
/* case AML_INT_NAMEPATH_OP: */
|
||||
break;
|
||||
|
||||
|
||||
case AML_CLASS_METHOD_CALL:
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
|
||||
"RESOLVING-MethodCall: State=%p Op=%p NamedObj=%p\n",
|
||||
WalkState, Op, Node));
|
||||
|
||||
/*
|
||||
* Lookup the method name and save the Node
|
||||
*/
|
||||
Status = AcpiNsLookup (WalkState->ScopeInfo, Arg->Common.Value.String,
|
||||
ACPI_TYPE_ANY, ACPI_IMODE_LOAD_PASS2,
|
||||
ACPI_NS_SEARCH_PARENT | ACPI_NS_DONT_OPEN_SCOPE,
|
||||
WalkState, &(NewNode));
|
||||
if (ACPI_SUCCESS (Status))
|
||||
{
|
||||
/*
|
||||
* Make sure that what we found is indeed a method
|
||||
* We didn't search for a method on purpose, to see if the name
|
||||
* would resolve
|
||||
*/
|
||||
if (NewNode->Type != ACPI_TYPE_METHOD)
|
||||
{
|
||||
Status = AE_AML_OPERAND_TYPE;
|
||||
}
|
||||
|
||||
/* We could put the returned object (Node) on the object stack for
|
||||
* later, but for now, we will put it in the "op" object that the
|
||||
* parser uses, so we can get it again at the end of this scope
|
||||
*/
|
||||
Op->Common.Node = NewNode;
|
||||
}
|
||||
else
|
||||
{
|
||||
ACPI_ERROR_NAMESPACE (Arg->Common.Value.String, Status);
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
Cleanup:
|
||||
|
||||
/* Remove the Node pushed at the very beginning */
|
||||
|
||||
WalkState->Operands[0] = NULL;
|
||||
WalkState->NumOperands = 0;
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
|
@ -8,7 +8,7 @@
|
|||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
|
@ -178,54 +178,6 @@ AcpiEvInitializeEvents (
|
|||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiEvInstallFadtGpes
|
||||
*
|
||||
* PARAMETERS: None
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Completes initialization of the FADT-defined GPE blocks
|
||||
* (0 and 1). This causes the _PRW methods to be run, so the HW
|
||||
* must be fully initialized at this point, including global lock
|
||||
* support.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiEvInstallFadtGpes (
|
||||
void)
|
||||
{
|
||||
ACPI_STATUS Status;
|
||||
|
||||
|
||||
ACPI_FUNCTION_TRACE (EvInstallFadtGpes);
|
||||
|
||||
|
||||
/* Namespace must be locked */
|
||||
|
||||
Status = AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return (Status);
|
||||
}
|
||||
|
||||
/* FADT GPE Block 0 */
|
||||
|
||||
(void) AcpiEvInitializeGpeBlock (
|
||||
AcpiGbl_FadtGpeDevice, AcpiGbl_GpeFadtBlocks[0]);
|
||||
|
||||
/* FADT GPE Block 1 */
|
||||
|
||||
(void) AcpiEvInitializeGpeBlock (
|
||||
AcpiGbl_FadtGpeDevice, AcpiGbl_GpeFadtBlocks[1]);
|
||||
|
||||
(void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE);
|
||||
return_ACPI_STATUS (AE_OK);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiEvInstallXruptHandlers
|
||||
|
@ -366,9 +318,17 @@ AcpiEvFixedEventDetect (
|
|||
if ((FixedStatus & AcpiGbl_FixedEventInfo[i].StatusBitMask) &&
|
||||
(FixedEnable & AcpiGbl_FixedEventInfo[i].EnableBitMask))
|
||||
{
|
||||
/* Found an active (signalled) event */
|
||||
|
||||
/*
|
||||
* Found an active (signalled) event. Invoke global event
|
||||
* handler if present.
|
||||
*/
|
||||
AcpiFixedEventCount[i]++;
|
||||
if (AcpiGbl_GlobalEventHandler)
|
||||
{
|
||||
AcpiGbl_GlobalEventHandler (ACPI_EVENT_TYPE_FIXED, NULL,
|
||||
i, AcpiGbl_GlobalEventHandlerContext);
|
||||
}
|
||||
|
||||
IntStatus |= AcpiEvFixedEventDispatch (i);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,439 @@
|
|||
/******************************************************************************
|
||||
*
|
||||
* Module Name: evglock - Global Lock support
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
*
|
||||
* 2.1. This is your license from Intel Corp. under its intellectual property
|
||||
* rights. You may have additional license terms from the party that provided
|
||||
* you this software, covering your right to use that party's intellectual
|
||||
* property rights.
|
||||
*
|
||||
* 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
|
||||
* copy of the source code appearing in this file ("Covered Code") an
|
||||
* irrevocable, perpetual, worldwide license under Intel's copyrights in the
|
||||
* base code distributed originally by Intel ("Original Intel Code") to copy,
|
||||
* make derivatives, distribute, use and display any portion of the Covered
|
||||
* Code in any form, with the right to sublicense such rights; and
|
||||
*
|
||||
* 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
|
||||
* license (with the right to sublicense), under only those claims of Intel
|
||||
* patents that are infringed by the Original Intel Code, to make, use, sell,
|
||||
* offer to sell, and import the Covered Code and derivative works thereof
|
||||
* solely to the minimum extent necessary to exercise the above copyright
|
||||
* license, and in no event shall the patent license extend to any additions
|
||||
* to or modifications of the Original Intel Code. No other license or right
|
||||
* is granted directly or by implication, estoppel or otherwise;
|
||||
*
|
||||
* The above copyright and patent license is granted only if the following
|
||||
* conditions are met:
|
||||
*
|
||||
* 3. Conditions
|
||||
*
|
||||
* 3.1. Redistribution of Source with Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification with rights to further distribute source must include
|
||||
* the above Copyright Notice, the above License, this list of Conditions,
|
||||
* and the following Disclaimer and Export Compliance provision. In addition,
|
||||
* Licensee must cause all Covered Code to which Licensee contributes to
|
||||
* contain a file documenting the changes Licensee made to create that Covered
|
||||
* Code and the date of any change. Licensee must include in that file the
|
||||
* documentation of any changes made by any predecessor Licensee. Licensee
|
||||
* must include a prominent statement that the modification is derived,
|
||||
* directly or indirectly, from Original Intel Code.
|
||||
*
|
||||
* 3.2. Redistribution of Source with no Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification without rights to further distribute source must
|
||||
* include the following Disclaimer and Export Compliance provision in the
|
||||
* documentation and/or other materials provided with distribution. In
|
||||
* addition, Licensee may not authorize further sublicense of source of any
|
||||
* portion of the Covered Code, and must include terms to the effect that the
|
||||
* license from Licensee to its licensee is limited to the intellectual
|
||||
* property embodied in the software Licensee provides to its licensee, and
|
||||
* not to intellectual property embodied in modifications its licensee may
|
||||
* make.
|
||||
*
|
||||
* 3.3. Redistribution of Executable. Redistribution in executable form of any
|
||||
* substantial portion of the Covered Code or modification must reproduce the
|
||||
* above Copyright Notice, and the following Disclaimer and Export Compliance
|
||||
* provision in the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* 3.4. Intel retains all right, title, and interest in and to the Original
|
||||
* Intel Code.
|
||||
*
|
||||
* 3.5. Neither the name Intel nor any other trademark owned or controlled by
|
||||
* Intel shall be used in advertising or otherwise to promote the sale, use or
|
||||
* other dealings in products derived from or relating to the Covered Code
|
||||
* without prior written authorization from Intel.
|
||||
*
|
||||
* 4. Disclaimer and Export Compliance
|
||||
*
|
||||
* 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
|
||||
* HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
|
||||
* IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
|
||||
* INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
|
||||
* UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
|
||||
* PARTICULAR PURPOSE.
|
||||
*
|
||||
* 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
|
||||
* OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
|
||||
* COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
|
||||
* SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
|
||||
* CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
|
||||
* HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
|
||||
* SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
|
||||
* LIMITED REMEDY.
|
||||
*
|
||||
* 4.3. Licensee shall not export, either directly or indirectly, any of this
|
||||
* software or system incorporating such software without first obtaining any
|
||||
* required license or other approval from the U. S. Department of Commerce or
|
||||
* any other agency or department of the United States Government. In the
|
||||
* event Licensee exports any such software from the United States or
|
||||
* re-exports any such software from a foreign destination, Licensee shall
|
||||
* ensure that the distribution and export/re-export of the software is in
|
||||
* compliance with all laws, regulations, orders, or other restrictions of the
|
||||
* U.S. Export Administration Regulations. Licensee agrees that neither it nor
|
||||
* any of its subsidiaries will export/re-export any technical data, process,
|
||||
* software, or service, directly or indirectly, to any country for which the
|
||||
* United States government or any agency thereof requires an export license,
|
||||
* other governmental approval, or letter of assurance, without first obtaining
|
||||
* such license, approval or letter.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
#include "acpi.h"
|
||||
#include "accommon.h"
|
||||
#include "acevents.h"
|
||||
#include "acinterp.h"
|
||||
|
||||
#define _COMPONENT ACPI_EVENTS
|
||||
ACPI_MODULE_NAME ("evglock")
|
||||
|
||||
|
||||
/* Local prototypes */
|
||||
|
||||
static UINT32
|
||||
AcpiEvGlobalLockHandler (
|
||||
void *Context);
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiEvInitGlobalLockHandler
|
||||
*
|
||||
* PARAMETERS: None
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Install a handler for the global lock release event
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiEvInitGlobalLockHandler (
|
||||
void)
|
||||
{
|
||||
ACPI_STATUS Status;
|
||||
|
||||
|
||||
ACPI_FUNCTION_TRACE (EvInitGlobalLockHandler);
|
||||
|
||||
|
||||
/* Attempt installation of the global lock handler */
|
||||
|
||||
Status = AcpiInstallFixedEventHandler (ACPI_EVENT_GLOBAL,
|
||||
AcpiEvGlobalLockHandler, NULL);
|
||||
|
||||
/*
|
||||
* If the global lock does not exist on this platform, the attempt to
|
||||
* enable GBL_STATUS will fail (the GBL_ENABLE bit will not stick).
|
||||
* Map to AE_OK, but mark global lock as not present. Any attempt to
|
||||
* actually use the global lock will be flagged with an error.
|
||||
*/
|
||||
AcpiGbl_GlobalLockPresent = FALSE;
|
||||
if (Status == AE_NO_HARDWARE_RESPONSE)
|
||||
{
|
||||
ACPI_ERROR ((AE_INFO,
|
||||
"No response from Global Lock hardware, disabling lock"));
|
||||
|
||||
return_ACPI_STATUS (AE_OK);
|
||||
}
|
||||
|
||||
Status = AcpiOsCreateLock (&AcpiGbl_GlobalLockPendingLock);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
AcpiGbl_GlobalLockPending = FALSE;
|
||||
AcpiGbl_GlobalLockPresent = TRUE;
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiEvRemoveGlobalLockHandler
|
||||
*
|
||||
* PARAMETERS: None
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Remove the handler for the Global Lock
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiEvRemoveGlobalLockHandler (
|
||||
void)
|
||||
{
|
||||
ACPI_STATUS Status;
|
||||
|
||||
|
||||
ACPI_FUNCTION_TRACE (EvRemoveGlobalLockHandler);
|
||||
|
||||
AcpiGbl_GlobalLockPresent = FALSE;
|
||||
Status = AcpiRemoveFixedEventHandler (ACPI_EVENT_GLOBAL,
|
||||
AcpiEvGlobalLockHandler);
|
||||
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiEvGlobalLockHandler
|
||||
*
|
||||
* PARAMETERS: Context - From thread interface, not used
|
||||
*
|
||||
* RETURN: ACPI_INTERRUPT_HANDLED
|
||||
*
|
||||
* DESCRIPTION: Invoked directly from the SCI handler when a global lock
|
||||
* release interrupt occurs. If there is actually a pending
|
||||
* request for the lock, signal the waiting thread.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
static UINT32
|
||||
AcpiEvGlobalLockHandler (
|
||||
void *Context)
|
||||
{
|
||||
ACPI_STATUS Status;
|
||||
ACPI_CPU_FLAGS Flags;
|
||||
|
||||
|
||||
Flags = AcpiOsAcquireLock (AcpiGbl_GlobalLockPendingLock);
|
||||
|
||||
/*
|
||||
* If a request for the global lock is not actually pending,
|
||||
* we are done. This handles "spurious" global lock interrupts
|
||||
* which are possible (and have been seen) with bad BIOSs.
|
||||
*/
|
||||
if (!AcpiGbl_GlobalLockPending)
|
||||
{
|
||||
goto CleanupAndExit;
|
||||
}
|
||||
|
||||
/*
|
||||
* Send a unit to the global lock semaphore. The actual acquisition
|
||||
* of the global lock will be performed by the waiting thread.
|
||||
*/
|
||||
Status = AcpiOsSignalSemaphore (AcpiGbl_GlobalLockSemaphore, 1);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
ACPI_ERROR ((AE_INFO, "Could not signal Global Lock semaphore"));
|
||||
}
|
||||
|
||||
AcpiGbl_GlobalLockPending = FALSE;
|
||||
|
||||
|
||||
CleanupAndExit:
|
||||
|
||||
AcpiOsReleaseLock (AcpiGbl_GlobalLockPendingLock, Flags);
|
||||
return (ACPI_INTERRUPT_HANDLED);
|
||||
}
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiEvAcquireGlobalLock
|
||||
*
|
||||
* PARAMETERS: Timeout - Max time to wait for the lock, in millisec.
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Attempt to gain ownership of the Global Lock.
|
||||
*
|
||||
* MUTEX: Interpreter must be locked
|
||||
*
|
||||
* Note: The original implementation allowed multiple threads to "acquire" the
|
||||
* Global Lock, and the OS would hold the lock until the last thread had
|
||||
* released it. However, this could potentially starve the BIOS out of the
|
||||
* lock, especially in the case where there is a tight handshake between the
|
||||
* Embedded Controller driver and the BIOS. Therefore, this implementation
|
||||
* allows only one thread to acquire the HW Global Lock at a time, and makes
|
||||
* the global lock appear as a standard mutex on the OS side.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiEvAcquireGlobalLock (
|
||||
UINT16 Timeout)
|
||||
{
|
||||
ACPI_CPU_FLAGS Flags;
|
||||
ACPI_STATUS Status;
|
||||
BOOLEAN Acquired = FALSE;
|
||||
|
||||
|
||||
ACPI_FUNCTION_TRACE (EvAcquireGlobalLock);
|
||||
|
||||
|
||||
/*
|
||||
* Only one thread can acquire the GL at a time, the GlobalLockMutex
|
||||
* enforces this. This interface releases the interpreter if we must wait.
|
||||
*/
|
||||
Status = AcpiExSystemWaitMutex (AcpiGbl_GlobalLockMutex->Mutex.OsMutex,
|
||||
Timeout);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
/*
|
||||
* Update the global lock handle and check for wraparound. The handle is
|
||||
* only used for the external global lock interfaces, but it is updated
|
||||
* here to properly handle the case where a single thread may acquire the
|
||||
* lock via both the AML and the AcpiAcquireGlobalLock interfaces. The
|
||||
* handle is therefore updated on the first acquire from a given thread
|
||||
* regardless of where the acquisition request originated.
|
||||
*/
|
||||
AcpiGbl_GlobalLockHandle++;
|
||||
if (AcpiGbl_GlobalLockHandle == 0)
|
||||
{
|
||||
AcpiGbl_GlobalLockHandle = 1;
|
||||
}
|
||||
|
||||
/*
|
||||
* Make sure that a global lock actually exists. If not, just
|
||||
* treat the lock as a standard mutex.
|
||||
*/
|
||||
if (!AcpiGbl_GlobalLockPresent)
|
||||
{
|
||||
AcpiGbl_GlobalLockAcquired = TRUE;
|
||||
return_ACPI_STATUS (AE_OK);
|
||||
}
|
||||
|
||||
Flags = AcpiOsAcquireLock (AcpiGbl_GlobalLockPendingLock);
|
||||
|
||||
do
|
||||
{
|
||||
/* Attempt to acquire the actual hardware lock */
|
||||
|
||||
ACPI_ACQUIRE_GLOBAL_LOCK (AcpiGbl_FACS, Acquired);
|
||||
if (Acquired)
|
||||
{
|
||||
AcpiGbl_GlobalLockAcquired = TRUE;
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
|
||||
"Acquired hardware Global Lock\n"));
|
||||
break;
|
||||
}
|
||||
|
||||
/*
|
||||
* Did not get the lock. The pending bit was set above, and
|
||||
* we must now wait until we receive the global lock
|
||||
* released interrupt.
|
||||
*/
|
||||
AcpiGbl_GlobalLockPending = TRUE;
|
||||
AcpiOsReleaseLock (AcpiGbl_GlobalLockPendingLock, Flags);
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
|
||||
"Waiting for hardware Global Lock\n"));
|
||||
|
||||
/*
|
||||
* Wait for handshake with the global lock interrupt handler.
|
||||
* This interface releases the interpreter if we must wait.
|
||||
*/
|
||||
Status = AcpiExSystemWaitSemaphore (AcpiGbl_GlobalLockSemaphore,
|
||||
ACPI_WAIT_FOREVER);
|
||||
|
||||
Flags = AcpiOsAcquireLock (AcpiGbl_GlobalLockPendingLock);
|
||||
|
||||
} while (ACPI_SUCCESS (Status));
|
||||
|
||||
AcpiGbl_GlobalLockPending = FALSE;
|
||||
AcpiOsReleaseLock (AcpiGbl_GlobalLockPendingLock, Flags);
|
||||
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiEvReleaseGlobalLock
|
||||
*
|
||||
* PARAMETERS: None
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Releases ownership of the Global Lock.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiEvReleaseGlobalLock (
|
||||
void)
|
||||
{
|
||||
BOOLEAN Pending = FALSE;
|
||||
ACPI_STATUS Status = AE_OK;
|
||||
|
||||
|
||||
ACPI_FUNCTION_TRACE (EvReleaseGlobalLock);
|
||||
|
||||
|
||||
/* Lock must be already acquired */
|
||||
|
||||
if (!AcpiGbl_GlobalLockAcquired)
|
||||
{
|
||||
ACPI_WARNING ((AE_INFO,
|
||||
"Cannot release the ACPI Global Lock, it has not been acquired"));
|
||||
return_ACPI_STATUS (AE_NOT_ACQUIRED);
|
||||
}
|
||||
|
||||
if (AcpiGbl_GlobalLockPresent)
|
||||
{
|
||||
/* Allow any thread to release the lock */
|
||||
|
||||
ACPI_RELEASE_GLOBAL_LOCK (AcpiGbl_FACS, Pending);
|
||||
|
||||
/*
|
||||
* If the pending bit was set, we must write GBL_RLS to the control
|
||||
* register
|
||||
*/
|
||||
if (Pending)
|
||||
{
|
||||
Status = AcpiWriteBitRegister (
|
||||
ACPI_BITREG_GLOBAL_LOCK_RELEASE, ACPI_ENABLE_EVENT);
|
||||
}
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Released hardware Global Lock\n"));
|
||||
}
|
||||
|
||||
AcpiGbl_GlobalLockAcquired = FALSE;
|
||||
|
||||
/* Release the local GL mutex */
|
||||
|
||||
AcpiOsReleaseMutex (AcpiGbl_GlobalLockMutex->Mutex.OsMutex);
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue