Subversion Repositories Kolibri OS

Compare Revisions

No changes between revisions

Regard whitespace Rev 2215 → Rev 2216

/drivers/devman/acpi.c
68,6 → 68,7
#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
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
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
goto err;
}
 
status = AcpiInitializeTables(NULL, 0, TRUE);
status = AcpiInitializeTables (NULL, 16, FALSE);
if (status != AE_OK) {
dbgprintf("AcpiInitializeTables failed (%s)\n",
AcpiFormatException(status));
/drivers/devman/acpica/Makefile
31,6 → 31,7
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
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
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
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))
/drivers/devman/acpica/README
1,79 → 1,137
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:
 
1) a cross-OS AML interpreter
http://www.acpica.org/downloads/binary_tools.php
 
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.
Documentation is available at acpica.org:
 
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.
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.
 
2) iasl, an ASL compiler/decompiler
acpibin
acpiexec
acpihelp
acpinames
acpisrc
acpixtract
iasl
 
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.
 
Requirements
------------
 
make
gcc compiler (4+)
bison or yacc
flex or lex
 
 
Configuration
-------------
 
The Makefiles contain this configuration information:
 
HOST = _LINUX /* Host system, must appear in acenv.h */
CC = gcc /* C compiler */
 
 
1) acpibin, an AML file tool
 
acpibin compares AML files, dumps AML binary files to text files,
extracts binary AML from text files, and other AML file
manipulation.
 
To compile:
 
cd compiler
cd acpica/source/tools/acpibin
make
make install /* install the binary to /usr/bin */
 
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.
2) acpiexec, a user-space AML interpreter
 
acpiexec allows the loading of ACPI tables and execution of control
methods from user space. Useful for debugging AML code and testing
the AML interpreter. Hardware access is simulated.
 
3) acpisrc, a source code conversion tool
To compile:
 
cd acpica/source/tools/acpiexec
make
make install /* install the binary to /usr/bin */
 
 
3) acpihelp, syntax help for ASL operators and reserved names
 
acpihelp displays the syntax for all of the ASL operators, as well
as information about the ASL/ACPI reserved names (4-char names that
start with underscore.)
 
To compile:
 
cd acpica/source/tools/acpihelp
make
make install /* install the binary to /usr/bin */
 
 
4) acpinames, load and dump acpi namespace
 
acpinames loads an ACPI namespace from a binary ACPI table file.
This is a smaller version of acpiexec that loads an acpi table and
dumps the resulting namespace. It is primarily intended to demonstrate
the configurability of ACPICA.
 
To compile:
 
cd acpica/source/tools/acpinames
make
make install /* install the binary to /usr/bin */
 
 
5) acpisrc, a source code conversion tool
 
acpisrc converts the standard form of the acpica source release (included
here) into a version that meets Linux coding guidelines. This consists
mainly of performing a series of string replacements and transformations
to the code.
to the code. It can also be used to clean the acpica source and generate
statistics.
 
To compile:
 
cd tools/acpisrc
cd acpica/source/tools/acpisrc
make
make install /* install the binary to /usr/bin */
 
It has been compiled on Linux, but should easily port to other Unix
environments.
 
6) acpixtract, extract binary ACPI tables from an acpidump
 
4) acpibin, an AML file tool
acpixtract is used to extract binary ACPI tables from the ASCII text
output of an acpidump utility (available on several different hosts.)
 
acpibin compares AML files, dumps AML binary files to text files,
extracts binary AML from text files, and other AML file
manipulation.
 
To compile:
 
cd tools/acpibin
cd acpica/source/tools/acpixtract
make
make install /* install the binary to /usr/bin */
 
 
5) acpiexec, a user-space AML interpreter
7) iasl, an optimizing ASL compiler/disassembler
 
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.
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 tools/acpiexec
cd acpica/source/compiler
make
 
 
Thanks -- The ACPI CA Team
make install /* install the binary to /usr/bin */
/drivers/devman/acpica/changes.txt
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.
 
/drivers/devman/acpica/common/adfile.c
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
*
******************************************************************************/
 
INT32
static INT32
AdWriteBuffer (
char *Filename,
char *Buffer,
/drivers/devman/acpica/common/adisasm.c
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
 
/* 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
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
* External filenames separated by commas
* Example: iasl -e file1,file2,file3 -d xxx.aml
*/
if (Gbl_ExternalFilename)
while (ExternalFileList)
{
ExternalFilename = strtok (Gbl_ExternalFilename, ",");
ExternalFilename = ExternalFileList->Path;
if (!ACPI_STRCMP (ExternalFilename, Filename))
{
/* Next external file */
 
while (ExternalFilename)
{
ExternalFileList = ExternalFileList->Next;
 
continue;
}
 
Status = AcpiDbGetTableFromFile (ExternalFilename, &ExternalTable);
if (ACPI_FAILURE (Status))
{
372,13 → 374,15
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
 
/* 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
*
*****************************************************************************/
 
void
static void
AdCreateTableHeader (
char *Filename,
ACPI_TABLE_HEADER *Table)
644,7 → 648,7
*/
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
 
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
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
*
*****************************************************************************/
 
ACPI_STATUS
static ACPI_STATUS
AdDeferredParse (
ACPI_PARSE_OBJECT *Op,
UINT8 *Aml,
900,7 → 904,7
*
*****************************************************************************/
 
ACPI_STATUS
static ACPI_STATUS
AdParseDeferredOps (
ACPI_PARSE_OBJECT *Root)
{
/drivers/devman/acpica/common/adwalk.c
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
ACPI_PARSE_OBJECT *NextOp;
ACPI_NAMESPACE_NODE *Node;
ACPI_OPERAND_OBJECT *Object;
UINT32 ParamCount = 0;
 
 
WalkState = Info->WalkState;
880,18 → 881,13
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
/drivers/devman/acpica/common/dmextern.c
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
312,6 → 312,95
 
/*******************************************************************************
*
* 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
*
* PARAMETERS: Op - Current parser Op
/drivers/devman/acpica/common/dmrestag.c
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
 
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 */
 
/drivers/devman/acpica/common/dmtable.c
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,11 → 133,14
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 */
 
static const char *AcpiDmAsfSubnames[] =
158,6 → 162,74
"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
"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
"Unknown Profile Type"
};
 
#define ACPI_GAS_WIDTH_RESERVED 5
 
static const char *AcpiDmGasAccessWidth[] =
{
"Undefined/Legacy",
"Byte Access:8",
"Word Access:16",
"DWord Access:32",
"QWord Access:64",
"Unknown Width Encoding"
};
 
 
/*******************************************************************************
*
* ACPI Table Data, indexed by signature.
*
* Each entry contains: Signature, Table Info, Handler, Description
* 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.
* 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.
*
******************************************************************************/
 
static ACPI_DMTABLE_DATA AcpiDmTableData[] =
ACPI_DMTABLE_DATA AcpiDmTableData[] =
{
{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}
{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: AcpiTbGenerateChecksum
* FUNCTION: AcpiDmGenerateChecksum
*
* PARAMETERS: Table - Pointer to a valid ACPI table (with a
* standard ACPI header)
* 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,8 → 387,10
******************************************************************************/
 
UINT8
AcpiTbGenerateChecksum (
ACPI_TABLE_HEADER *Table)
AcpiDmGenerateChecksum (
void *Table,
UINT32 Length,
UINT8 OriginalChecksum)
{
UINT8 Checksum;
 
300,11 → 397,11
 
/* 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,11 → 526,15
}
}
 
/* 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,17 → 561,51
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);
}
}
}
}
 
void
AcpiDmLineHeader2 (
480,8 → 615,23
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 : ",
Offset, Offset, ByteLength, Name, Value);
}
491,6 → 641,7
Offset, Offset, Name, Value);
}
}
}
 
 
/*******************************************************************************
508,6 → 659,8
*
* DESCRIPTION: Display ACPI table contents by walking the Info table.
*
* Note: This function must remain in sync with DtGetFieldLength.
*
******************************************************************************/
 
ACPI_STATUS
562,6 → 715,7
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:
568,6 → 722,10
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,6 → 739,7
case ACPI_DMT_UINT32:
case ACPI_DMT_NAME4:
case ACPI_DMT_SIG:
case ACPI_DMT_SLIC:
ByteLength = 4;
break;
case ACPI_DMT_NAME6:
587,6 → 746,7
ByteLength = 6;
break;
case ACPI_DMT_UINT56:
case ACPI_DMT_BUF7:
ByteLength = 7;
break;
case ACPI_DMT_UINT64:
594,8 → 754,12
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
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
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
/* 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
 
/* 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
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,9 → 1009,61
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:
 
/* HEST subtable types */
814,12 → 1074,12
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
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,9 → 1109,22
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:
 
/* SRAT subtable types */
863,7 → 1135,7
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
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
break;
}
 
AcpiOsPrintf ("%2.2X <%s>\n", *Target, Name);
AcpiOsPrintf (UINT8_FORMAT, *Target, Name);
break;
 
case ACPI_DMT_EXIT:
/drivers/devman/acpica/common/dmtbdump.c
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,6 → 124,12
ACPI_MODULE_NAME ("dmtbdump")
 
 
static void
AcpiDmValidateFadtLength (
UINT32 Revision,
UINT32 Length);
 
 
/*******************************************************************************
*
* FUNCTION: AcpiDmDumpRsdp
130,7 → 136,8
*
* 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,7 → 147,9
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 */
147,13 → 156,34
 
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
*
* 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
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,11 → 312,73
/* 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);
}
 
 
/*******************************************************************************
*
* FUNCTION: AcpiDmDumpAsf
*
* PARAMETERS: Table - A ASF table
595,7 → 692,7
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
{
AcpiOsPrintf ("\n");
Status = AcpiDmDumpTable (Length, Offset, SubTable,
sizeof (ACPI_WHEA_HEADER), AcpiDmTableInfoEinj0);
sizeof (ACPI_WHEA_HEADER), AcpiDmTableInfoErst0);
if (ACPI_FAILURE (Status))
{
return;
1250,6 → 1347,81
 
/*******************************************************************************
*
* 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
*
* PARAMETERS: Table - An SLIT
1306,12 → 1478,17
 
/* 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);
}
}
}
 
/* Point to next row */
 
/drivers/devman/acpica/common/dmtbinfo.c
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
123,6 → 123,31
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
*/
#define ACPI_FACS_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_FACS,f)
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_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 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 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 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,13 → 797,27
 
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
};
 
 
/*******************************************************************************
*
* HEST - Hardware Error Source table
786,7 → 838,8
 
#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,8 → 861,10
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},
816,7 → 871,7
{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 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_DMT_TERMINATOR
};
 
 
/* 6: PCI Express Root Port AER */
 
ACPI_DMTABLE_INFO AcpiDmTableInfoHest6[] =
1300,17 → 1356,46
 
/*******************************************************************************
*
* 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
};
 
 
/*******************************************************************************
*
* SLIT - System Locality Information Table
1425,15 → 1510,15
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 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 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
};
1537,6 → 1622,46
 
/*******************************************************************************
*
* 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_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}
};
/drivers/devman/acpica/common/getopt.c
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 <stdio.h>
#include <string.h>
#include "acpi.h"
#include "accommon.h"
#include "acapps.h"
 
#include <stdio.h>
#include <string.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
 
/* Get the option */
 
CurrentChar =
AcpiGbl_Optopt =
argv[AcpiGbl_Optind][CurrentCharPtr];
CurrentChar = argv[AcpiGbl_Optind][CurrentCharPtr];
 
/* Make sure that the option is legal */
 
/drivers/devman/acpica/compiler/aslanalyze.c
1,7 → 1,6
 
/******************************************************************************
*
* Module Name: aslanalyze.c - check for semantic errors
* Module Name: aslanalyze.c - Support functions for parse tree walks
*
*****************************************************************************/
 
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
117,60 → 116,13
 
#include "aslcompiler.h"
#include "aslcompiler.y.h"
#include "acparser.h"
#include "amlcode.h"
#include <string.h>
 
 
#define _COMPONENT ACPI_COMPILER
ACPI_MODULE_NAME ("aslanalyze")
 
/* Local prototypes */
 
static UINT32
AnMapArgTypeToBtype (
UINT32 ArgType);
 
static UINT32
AnMapEtypeToBtype (
UINT32 Etype);
 
static void
AnFormatBtype (
char *Buffer,
UINT32 Btype);
 
static UINT32
AnGetBtype (
ACPI_PARSE_OBJECT *Op);
 
static UINT32
AnMapObjTypeToBtype (
ACPI_PARSE_OBJECT *Op);
 
static BOOLEAN
AnLastStatementIsReturn (
ACPI_PARSE_OBJECT *Op);
 
static void
AnCheckMethodReturnValue (
ACPI_PARSE_OBJECT *Op,
const ACPI_OPCODE_INFO *OpInfo,
ACPI_PARSE_OBJECT *ArgOp,
UINT32 RequiredBtypes,
UINT32 ThisNodeBtype);
 
static BOOLEAN
AnIsInternalMethod (
ACPI_PARSE_OBJECT *Op);
 
static UINT32
AnGetInternalMethodReturnType (
ACPI_PARSE_OBJECT *Op);
 
BOOLEAN
AnIsResultUsed (
ACPI_PARSE_OBJECT *Op);
 
 
/*******************************************************************************
*
* FUNCTION: AnIsInternalMethod
183,7 → 135,7
*
******************************************************************************/
 
static BOOLEAN
BOOLEAN
AnIsInternalMethod (
ACPI_PARSE_OBJECT *Op)
{
210,7 → 162,7
*
******************************************************************************/
 
static UINT32
UINT32
AnGetInternalMethodReturnType (
ACPI_PARSE_OBJECT *Op)
{
227,791 → 179,108
 
/*******************************************************************************
*
* FUNCTION: AnMapArgTypeToBtype
* FUNCTION: AnCheckId
*
* PARAMETERS: ArgType - The ARGI required type(s) for this argument,
* from the opcode info table
* PARAMETERS: Op - Current parse op
* Type - HID or CID
*
* RETURN: The corresponding Bit-encoded types
* RETURN: None
*
* DESCRIPTION: Convert an encoded ARGI required argument type code into a
* bitfield type code. Implements the implicit source conversion
* rules.
* DESCRIPTION: Perform various checks on _HID and _CID strings. Only limited
* checks can be performed on _CID strings.
*
******************************************************************************/
 
static 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
*
******************************************************************************/
 
static 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.
*
******************************************************************************/
 
static 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"
*
******************************************************************************/
 
static 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);
}
}
 
 
/*******************************************************************************
*
* FUNCTION: AnMethodAnalysisWalkBegin
*
* PARAMETERS: ASL_WALK_CALLBACK
*
* RETURN: Status
*
* DESCRIPTION: Descending callback for the analysis walk. Check methods for:
* 1) Initialized local variables
* 2) Valid arguments
* 3) Return types
*
******************************************************************************/
 
ACPI_STATUS
AnMethodAnalysisWalkBegin (
void
AnCheckId (
ACPI_PARSE_OBJECT *Op,
UINT32 Level,
void *Context)
ACPI_NAME Type)
{
ASL_ANALYSIS_WALK_INFO *WalkInfo = (ASL_ANALYSIS_WALK_INFO *) Context;
ASL_METHOD_INFO *MethodInfo = WalkInfo->MethodStack;
ACPI_PARSE_OBJECT *Next;
UINT32 RegisterNumber;
UINT32 i;
char LocalName[] = "Local0";
char ArgName[] = "Arg0";
ACPI_PARSE_OBJECT *ArgNode;
ACPI_PARSE_OBJECT *NextType;
ACPI_PARSE_OBJECT *NextParamType;
UINT8 ActualArgs = 0;
ACPI_SIZE Length;
UINT32 AlphaPrefixLength;
 
 
switch (Op->Asl.ParseOpcode)
{
case PARSEOP_METHOD:
/* Only care about string versions of _HID/_CID (integers are legal) */
 
TotalMethods++;
 
/* Create and init method info */
 
MethodInfo = UtLocalCalloc (sizeof (ASL_METHOD_INFO));
MethodInfo->Next = WalkInfo->MethodStack;
MethodInfo->Op = Op;
 
WalkInfo->MethodStack = MethodInfo;
 
/* Get the name node, ignored here */
 
Next = Op->Asl.Child;
 
/* Get the NumArguments node */
 
Next = Next->Asl.Next;
MethodInfo->NumArguments = (UINT8)
(((UINT8) Next->Asl.Value.Integer) & 0x07);
 
/* Get the SerializeRule and SyncLevel nodes, ignored here */
 
Next = Next->Asl.Next;
Next = Next->Asl.Next;
ArgNode = Next;
 
/* Get the ReturnType node */
 
Next = Next->Asl.Next;
 
NextType = Next->Asl.Child;
while (NextType)
if (Op->Asl.ParseOpcode != PARSEOP_STRING_LITERAL)
{
/* Get and map each of the ReturnTypes */
 
MethodInfo->ValidReturnTypes |= AnMapObjTypeToBtype (NextType);
NextType->Asl.ParseOpcode = PARSEOP_DEFAULT_ARG;
NextType = NextType->Asl.Next;
return;
}
 
/* Get the ParameterType node */
/* For both _HID and _CID, the string must be non-null */
 
Next = Next->Asl.Next;
 
NextType = Next->Asl.Child;
while (NextType)
Length = strlen (Op->Asl.Value.String);
if (!Length)
{
if (NextType->Asl.ParseOpcode == PARSEOP_DEFAULT_ARG)
{
NextParamType = NextType->Asl.Child;
while (NextParamType)
{
MethodInfo->ValidArgTypes[ActualArgs] |= AnMapObjTypeToBtype (NextParamType);
NextParamType->Asl.ParseOpcode = PARSEOP_DEFAULT_ARG;
NextParamType = NextParamType->Asl.Next;
AslError (ASL_ERROR, ASL_MSG_NULL_STRING,
Op, NULL);
return;
}
}
else
{
MethodInfo->ValidArgTypes[ActualArgs] =
AnMapObjTypeToBtype (NextType);
NextType->Asl.ParseOpcode = PARSEOP_DEFAULT_ARG;
ActualArgs++;
}
 
NextType = NextType->Asl.Next;
}
 
if ((MethodInfo->NumArguments) &&
(MethodInfo->NumArguments != ActualArgs))
{
/* error: Param list did not match number of args */
}
 
/* Allow numarguments == 0 for Function() */
 
if ((!MethodInfo->NumArguments) && (ActualArgs))
{
MethodInfo->NumArguments = ActualArgs;
ArgNode->Asl.Value.Integer |= ActualArgs;
}
 
/*
* Actual arguments are initialized at method entry.
* All other ArgX "registers" can be used as locals, so we
* track their initialization.
* One of the things we want to catch here is the use of a leading
* asterisk in the string -- an odd construct that certain platform
* manufacturers are fond of. Technically, a leading asterisk is OK
* for _CID, but a valid use of this has not been seen.
*/
for (i = 0; i < MethodInfo->NumArguments; i++)
if (*Op->Asl.Value.String == '*')
{
MethodInfo->ArgInitialized[i] = TRUE;
AslError (ASL_ERROR, ASL_MSG_LEADING_ASTERISK,
Op, Op->Asl.Value.String);
return;
}
break;
 
/* _CID strings are bus-specific, no more checks can be performed */
 
case PARSEOP_METHODCALL:
 
if (MethodInfo &&
(Op->Asl.Node == MethodInfo->Op->Asl.Node))
if (Type == ASL_TYPE_CID)
{
AslError (ASL_REMARK, ASL_MSG_RECURSION, Op, Op->Asl.ExternalName);
return;
}
break;
 
/* For _HID, all characters must be alphanumeric */
 
case PARSEOP_LOCAL0:
case PARSEOP_LOCAL1:
case PARSEOP_LOCAL2:
case PARSEOP_LOCAL3:
case PARSEOP_LOCAL4:
case PARSEOP_LOCAL5:
case PARSEOP_LOCAL6:
case PARSEOP_LOCAL7:
 
if (!MethodInfo)
for (i = 0; Op->Asl.Value.String[i]; i++)
{
/*
* Local was used outside a control method, or there was an error
* in the method declaration.
*/
AslError (ASL_REMARK, ASL_MSG_LOCAL_OUTSIDE_METHOD, Op, Op->Asl.ExternalName);
return (AE_ERROR);
}
 
RegisterNumber = (Op->Asl.AmlOpcode & 0x000F);
 
/*
* If the local is being used as a target, mark the local
* initialized
*/
if (Op->Asl.CompileFlags & NODE_IS_TARGET)
if (!isalnum ((int) Op->Asl.Value.String[i]))
{
MethodInfo->LocalInitialized[RegisterNumber] = TRUE;
}
 
/*
* Otherwise, this is a reference, check if the local
* has been previously initialized.
*
* The only operator that accepts an uninitialized value is ObjectType()
*/
else if ((!MethodInfo->LocalInitialized[RegisterNumber]) &&
(Op->Asl.Parent->Asl.ParseOpcode != PARSEOP_OBJECTTYPE))
{
LocalName[strlen (LocalName) -1] = (char) (RegisterNumber + 0x30);
AslError (ASL_ERROR, ASL_MSG_LOCAL_INIT, Op, LocalName);
}
AslError (ASL_ERROR, ASL_MSG_ALPHANUMERIC_STRING,
Op, Op->Asl.Value.String);
break;
 
 
case PARSEOP_ARG0:
case PARSEOP_ARG1:
case PARSEOP_ARG2:
case PARSEOP_ARG3:
case PARSEOP_ARG4:
case PARSEOP_ARG5:
case PARSEOP_ARG6:
 
if (!MethodInfo)
{
/*
* Arg was used outside a control method, or there was an error
* in the method declaration.
*/
AslError (ASL_REMARK, ASL_MSG_LOCAL_OUTSIDE_METHOD, Op, Op->Asl.ExternalName);
return (AE_ERROR);
}
 
RegisterNumber = (Op->Asl.AmlOpcode & 0x000F) - 8;
ArgName[strlen (ArgName) -1] = (char) (RegisterNumber + 0x30);
 
/*
* If the Arg is being used as a target, mark the local
* initialized
*/
if (Op->Asl.CompileFlags & NODE_IS_TARGET)
{
MethodInfo->ArgInitialized[RegisterNumber] = TRUE;
}
 
/*
* Otherwise, this is a reference, check if the Arg
* has been previously initialized.
*
* The only operator that accepts an uninitialized value is ObjectType()
*/
else if ((!MethodInfo->ArgInitialized[RegisterNumber]) &&
(Op->Asl.Parent->Asl.ParseOpcode != PARSEOP_OBJECTTYPE))
{
AslError (ASL_ERROR, ASL_MSG_ARG_INIT, Op, ArgName);
}
/* _HID String must be of the form "XXX####" or "ACPI####" */
 
/* Flag this arg if it is not a "real" argument to the method */
 
if (RegisterNumber >= MethodInfo->NumArguments)
if ((Length < 7) || (Length > 8))
{
AslError (ASL_REMARK, ASL_MSG_NOT_PARAMETER, Op, ArgName);
AslError (ASL_ERROR, ASL_MSG_HID_LENGTH,
Op, Op->Asl.Value.String);
return;
}
break;
 
/* _HID Length is valid, now check for uppercase (first 3 or 4 chars) */
 
case PARSEOP_RETURN:
 
if (!MethodInfo)
AlphaPrefixLength = 3;
if (Length >= 8)
{
/*
* Probably was an error in the method declaration,
* no additional error here
*/
ACPI_WARNING ((AE_INFO, "%p, No parent method", Op));
return (AE_ERROR);
AlphaPrefixLength = 4;
}
 
/* Child indicates a return value */
/* Ensure the alphabetic prefix is all uppercase */
 
if ((Op->Asl.Child) &&
(Op->Asl.Child->Asl.ParseOpcode != PARSEOP_DEFAULT_ARG))
for (i = 0; (i < AlphaPrefixLength) && Op->Asl.Value.String[i]; i++)
{
MethodInfo->NumReturnWithValue++;
}
else
if (!isupper ((int) Op->Asl.Value.String[i]))
{
MethodInfo->NumReturnNoValue++;
}
AslError (ASL_ERROR, ASL_MSG_UPPER_CASE,
Op, &Op->Asl.Value.String[i]);
break;
 
 
case PARSEOP_BREAK:
case PARSEOP_CONTINUE:
 
Next = Op->Asl.Parent;
while (Next)
{
if (Next->Asl.ParseOpcode == PARSEOP_WHILE)
{
break;
}
Next = Next->Asl.Parent;
}
 
if (!Next)
{
AslError (ASL_ERROR, ASL_MSG_NO_WHILE, Op, NULL);
}
break;
 
 
case PARSEOP_STALL:
 
/* We can range check if the argument is an integer */
 
if ((Op->Asl.Child->Asl.ParseOpcode == PARSEOP_INTEGER) &&
(Op->Asl.Child->Asl.Value.Integer > ACPI_UINT8_MAX))
{
AslError (ASL_ERROR, ASL_MSG_INVALID_TIME, Op, NULL);
}
break;
 
 
case PARSEOP_DEVICE:
case PARSEOP_EVENT:
case PARSEOP_MUTEX:
case PARSEOP_OPERATIONREGION:
case PARSEOP_POWERRESOURCE:
case PARSEOP_PROCESSOR:
case PARSEOP_THERMALZONE:
 
/*
* The first operand is a name to be created in the namespace.
* Check against the reserved list.
*/
i = ApCheckForPredefinedName (Op, Op->Asl.NameSeg);
if (i < ACPI_VALID_RESERVED_NAME_MAX)
{
AslError (ASL_ERROR, ASL_MSG_RESERVED_USE, Op, Op->Asl.ExternalName);
}
break;
 
 
case PARSEOP_NAME:
 
/* Typecheck any predefined names statically defined with Name() */
 
ApCheckForPredefinedObject (Op, Op->Asl.NameSeg);
 
/* Special typechecking for _HID */
 
if (!ACPI_STRCMP (METHOD_NAME__HID, Op->Asl.NameSeg))
{
Next = Op->Asl.Child->Asl.Next;
if (Next->Asl.ParseOpcode == PARSEOP_STRING_LITERAL)
{
/*
* _HID is a string, all characters must be alphanumeric.
* One of the things we want to catch here is the use of
* a leading asterisk in the string.
*/
for (i = 0; Next->Asl.Value.String[i]; i++)
{
if (!isalnum ((int) Next->Asl.Value.String[i]))
{
AslError (ASL_ERROR, ASL_MSG_ALPHANUMERIC_STRING,
Next, Next->Asl.Value.String);
break;
}
}
}
}
break;
 
 
default:
break;
}
 
return AE_OK;
}
 
 
/*******************************************************************************
*
* FUNCTION: AnLastStatementIsReturn
1026,7 → 295,7
*
******************************************************************************/
 
static BOOLEAN
BOOLEAN
AnLastStatementIsReturn (
ACPI_PARSE_OBJECT *Op)
{
1033,9 → 302,8
ACPI_PARSE_OBJECT *Next;
 
 
/*
* Check if last statement is a return
*/
/* Check if last statement is a return */
 
Next = ASL_GET_CHILD_NODE (Op);
while (Next)
{
1042,296 → 310,18
if ((!Next->Asl.Next) &&
(Next->Asl.ParseOpcode == PARSEOP_RETURN))
{
return TRUE;
return (TRUE);
}
 
Next = ASL_GET_PEER_NODE (Next);
}
 
return FALSE;
return (FALSE);
}
 
 
/*******************************************************************************
*
* FUNCTION: AnMethodAnalysisWalkEnd
*
* PARAMETERS: ASL_WALK_CALLBACK
*
* RETURN: Status
*
* DESCRIPTION: Ascending callback for analysis walk. Complete method
* return analysis.
*
******************************************************************************/
 
ACPI_STATUS
AnMethodAnalysisWalkEnd (
ACPI_PARSE_OBJECT *Op,
UINT32 Level,
void *Context)
{
ASL_ANALYSIS_WALK_INFO *WalkInfo = (ASL_ANALYSIS_WALK_INFO *) Context;
ASL_METHOD_INFO *MethodInfo = WalkInfo->MethodStack;
 
 
switch (Op->Asl.ParseOpcode)
{
case PARSEOP_METHOD:
case PARSEOP_RETURN:
if (!MethodInfo)
{
printf ("No method info for method! [%s]\n", Op->Asl.Namepath);
AslError (ASL_ERROR, ASL_MSG_COMPILER_INTERNAL, Op,
"No method info for this method");
CmCleanupAndExit ();
return (AE_AML_INTERNAL);
}
break;
 
default:
break;
}
 
switch (Op->Asl.ParseOpcode)
{
case PARSEOP_METHOD:
 
WalkInfo->MethodStack = MethodInfo->Next;
 
/*
* Check if there is no return statement at the end of the
* method AND we can actually get there -- i.e., the execution
* of the method can possibly terminate without a return statement.
*/
if ((!AnLastStatementIsReturn (Op)) &&
(!(Op->Asl.CompileFlags & NODE_HAS_NO_EXIT)))
{
/*
* No return statement, and execution can possibly exit
* via this path. This is equivalent to Return ()
*/
MethodInfo->NumReturnNoValue++;
}
 
/*
* Check for case where some return statements have a return value
* and some do not. Exit without a return statement is a return with
* no value
*/
if (MethodInfo->NumReturnNoValue &&
MethodInfo->NumReturnWithValue)
{
AslError (ASL_WARNING, ASL_MSG_RETURN_TYPES, Op,
Op->Asl.ExternalName);
}
 
/*
* If there are any RETURN() statements with no value, or there is a
* control path that allows the method to exit without a return value,
* we mark the method as a method that does not return a value. This
* knowledge can be used to check method invocations that expect a
* returned value.
*/
if (MethodInfo->NumReturnNoValue)
{
if (MethodInfo->NumReturnWithValue)
{
Op->Asl.CompileFlags |= NODE_METHOD_SOME_NO_RETVAL;
}
else
{
Op->Asl.CompileFlags |= NODE_METHOD_NO_RETVAL;
}
}
 
/*
* Check predefined method names for correct return behavior
* and correct number of arguments
*/
ApCheckForPredefinedMethod (Op, MethodInfo);
ACPI_FREE (MethodInfo);
break;
 
 
case PARSEOP_RETURN:
 
/*
* If the parent is a predefined method name, attempt to typecheck
* the return value. Only static types can be validated.
*/
ApCheckPredefinedReturnValue (Op, MethodInfo);
 
/*
* The parent block does not "exit" and continue execution -- the
* method is terminated here with the Return() statement.
*/
Op->Asl.Parent->Asl.CompileFlags |= NODE_HAS_NO_EXIT;
 
/* Used in the "typing" pass later */
 
Op->Asl.ParentMethod = MethodInfo->Op;
 
/*
* If there is a peer node after the return statement, then this
* node is unreachable code -- i.e., it won't be executed because of
* the preceeding Return() statement.
*/
if (Op->Asl.Next)
{
AslError (ASL_WARNING, ASL_MSG_UNREACHABLE_CODE, Op->Asl.Next, NULL);
}
break;
 
 
case PARSEOP_IF:
 
if ((Op->Asl.CompileFlags & NODE_HAS_NO_EXIT) &&
(Op->Asl.Next) &&
(Op->Asl.Next->Asl.ParseOpcode == PARSEOP_ELSE))
{
/*
* This IF has a corresponding ELSE. The IF block has no exit,
* (it contains an unconditional Return)
* mark the ELSE block to remember this fact.
*/
Op->Asl.Next->Asl.CompileFlags |= NODE_IF_HAS_NO_EXIT;
}
break;
 
 
case PARSEOP_ELSE:
 
if ((Op->Asl.CompileFlags & NODE_HAS_NO_EXIT) &&
(Op->Asl.CompileFlags & NODE_IF_HAS_NO_EXIT))
{
/*
* This ELSE block has no exit and the corresponding IF block
* has no exit either. Therefore, the parent node has no exit.
*/
Op->Asl.Parent->Asl.CompileFlags |= NODE_HAS_NO_EXIT;
}
break;
 
 
default:
 
if ((Op->Asl.CompileFlags & NODE_HAS_NO_EXIT) &&
(Op->Asl.Parent))
{
/* If this node has no exit, then the parent has no exit either */
 
Op->Asl.Parent->Asl.CompileFlags |= NODE_HAS_NO_EXIT;
}
break;
}
 
return AE_OK;
}
 
 
/*******************************************************************************
*
* FUNCTION: AnMethodTypingWalkBegin
*
* PARAMETERS: ASL_WALK_CALLBACK
*
* RETURN: Status
*
* DESCRIPTION: Descending callback for the typing walk.
*
******************************************************************************/
 
ACPI_STATUS
AnMethodTypingWalkBegin (
ACPI_PARSE_OBJECT *Op,
UINT32 Level,
void *Context)
{
 
return AE_OK;
}
 
 
/*******************************************************************************
*
* FUNCTION: AnMethodTypingWalkEnd
*
* PARAMETERS: ASL_WALK_CALLBACK
*
* RETURN: Status
*
* DESCRIPTION: Ascending callback for typing walk. Complete the method
* return analysis. Check methods for:
* 1) Initialized local variables
* 2) Valid arguments
* 3) Return types
*
******************************************************************************/
 
ACPI_STATUS
AnMethodTypingWalkEnd (
ACPI_PARSE_OBJECT *Op,
UINT32 Level,
void *Context)
{
UINT32 ThisNodeBtype;
 
 
switch (Op->Asl.ParseOpcode)
{
case PARSEOP_METHOD:
 
Op->Asl.CompileFlags |= NODE_METHOD_TYPED;
break;
 
case PARSEOP_RETURN:
 
if ((Op->Asl.Child) &&
(Op->Asl.Child->Asl.ParseOpcode != PARSEOP_DEFAULT_ARG))
{
ThisNodeBtype = AnGetBtype (Op->Asl.Child);
 
if ((Op->Asl.Child->Asl.ParseOpcode == PARSEOP_METHODCALL) &&
(ThisNodeBtype == (ACPI_UINT32_MAX -1)))
{
/*
* The called method is untyped at this time (typically a
* forward reference).
*
* Check for a recursive method call first.
*/
if (Op->Asl.ParentMethod != Op->Asl.Child->Asl.Node->Op)
{
/* We must type the method here */
 
TrWalkParseTree (Op->Asl.Child->Asl.Node->Op,
ASL_WALK_VISIT_TWICE, AnMethodTypingWalkBegin,
AnMethodTypingWalkEnd, NULL);
 
ThisNodeBtype = AnGetBtype (Op->Asl.Child);
}
}
 
/* Returns a value, save the value type */
 
if (Op->Asl.ParentMethod)
{
Op->Asl.ParentMethod->Asl.AcpiBtype |= ThisNodeBtype;
}
}
break;
 
default:
break;
}
 
return AE_OK;
}
 
 
/*******************************************************************************
*
* FUNCTION: AnCheckMethodReturnValue
*
* PARAMETERS: Op - Parent
1347,7 → 337,7
*
******************************************************************************/
 
static void
void
AnCheckMethodReturnValue (
ACPI_PARSE_OBJECT *Op,
const ACPI_OPCODE_INFO *OpInfo,
1384,7 → 374,6
AnFormatBtype (StringBuffer, ThisNodeBtype);
AnFormatBtype (StringBuffer2, RequiredBtypes);
 
 
/*
* The case where the method does not return any value at all
* was already handled in the namespace cross reference
1405,344 → 394,6
 
/*******************************************************************************
*
* FUNCTION: AnOperandTypecheckWalkBegin
*
* PARAMETERS: ASL_WALK_CALLBACK
*
* RETURN: Status
*
* DESCRIPTION: Descending callback for the analysis walk. Check methods for:
* 1) Initialized local variables
* 2) Valid arguments
* 3) Return types
*
******************************************************************************/
 
ACPI_STATUS
AnOperandTypecheckWalkBegin (
ACPI_PARSE_OBJECT *Op,
UINT32 Level,
void *Context)
{
 
return AE_OK;
}
 
 
/*******************************************************************************
*
* FUNCTION: AnOperandTypecheckWalkEnd
*
* PARAMETERS: ASL_WALK_CALLBACK
*
* RETURN: Status
*
* DESCRIPTION: Ascending callback for analysis walk. Complete method
* return analysis.
*
******************************************************************************/
 
ACPI_STATUS
AnOperandTypecheckWalkEnd (
ACPI_PARSE_OBJECT *Op,
UINT32 Level,
void *Context)
{
const ACPI_OPCODE_INFO *OpInfo;
UINT32 RuntimeArgTypes;
UINT32 RuntimeArgTypes2;
UINT32 RequiredBtypes;
UINT32 ThisNodeBtype;
UINT32 CommonBtypes;
UINT32 OpcodeClass;
ACPI_PARSE_OBJECT *ArgOp;
UINT32 ArgType;
 
 
switch (Op->Asl.AmlOpcode)
{
case AML_RAW_DATA_BYTE:
case AML_RAW_DATA_WORD:
case AML_RAW_DATA_DWORD:
case AML_RAW_DATA_QWORD:
case AML_RAW_DATA_BUFFER:
case AML_RAW_DATA_CHAIN:
case AML_PACKAGE_LENGTH:
case AML_UNASSIGNED_OPCODE:
case AML_DEFAULT_ARG_OP:
 
/* Ignore the internal (compiler-only) AML opcodes */
 
return (AE_OK);
 
default:
break;
}
 
OpInfo = AcpiPsGetOpcodeInfo (Op->Asl.AmlOpcode);
if (!OpInfo)
{
return (AE_OK);
}
 
ArgOp = Op->Asl.Child;
RuntimeArgTypes = OpInfo->RuntimeArgs;
OpcodeClass = OpInfo->Class;
 
#ifdef ASL_ERROR_NAMED_OBJECT_IN_WHILE
/*
* Update 11/2008: In practice, we can't perform this check. A simple
* analysis is not sufficient. Also, it can cause errors when compiling
* disassembled code because of the way Switch operators are implemented
* (a While(One) loop with a named temp variable created within.)
*/
 
/*
* If we are creating a named object, check if we are within a while loop
* by checking if the parent is a WHILE op. This is a simple analysis, but
* probably sufficient for many cases.
*
* Allow Scope(), Buffer(), and Package().
*/
if (((OpcodeClass == AML_CLASS_NAMED_OBJECT) && (Op->Asl.AmlOpcode != AML_SCOPE_OP)) ||
((OpcodeClass == AML_CLASS_CREATE) && (OpInfo->Flags & AML_NSNODE)))
{
if (Op->Asl.Parent->Asl.AmlOpcode == AML_WHILE_OP)
{
AslError (ASL_ERROR, ASL_MSG_NAMED_OBJECT_IN_WHILE, Op, NULL);
}
}
#endif
 
/*
* Special case for control opcodes IF/RETURN/WHILE since they
* have no runtime arg list (at this time)
*/
switch (Op->Asl.AmlOpcode)
{
case AML_IF_OP:
case AML_WHILE_OP:
case AML_RETURN_OP:
 
if (ArgOp->Asl.ParseOpcode == PARSEOP_METHODCALL)
{
/* Check for an internal method */
 
if (AnIsInternalMethod (ArgOp))
{
return (AE_OK);
}
 
/* The lone arg is a method call, check it */
 
RequiredBtypes = AnMapArgTypeToBtype (ARGI_INTEGER);
if (Op->Asl.AmlOpcode == AML_RETURN_OP)
{
RequiredBtypes = 0xFFFFFFFF;
}
 
ThisNodeBtype = AnGetBtype (ArgOp);
if (ThisNodeBtype == ACPI_UINT32_MAX)
{
return (AE_OK);
}
AnCheckMethodReturnValue (Op, OpInfo, ArgOp,
RequiredBtypes, ThisNodeBtype);
}
return (AE_OK);
 
default:
break;
}
 
/* Ignore the non-executable opcodes */
 
if (RuntimeArgTypes == ARGI_INVALID_OPCODE)
{
return (AE_OK);
}
 
switch (OpcodeClass)
{
case AML_CLASS_EXECUTE:
case AML_CLASS_CREATE:
case AML_CLASS_CONTROL:
case AML_CLASS_RETURN_VALUE:
 
/* TBD: Change class or fix typechecking for these */
 
if ((Op->Asl.AmlOpcode == AML_BUFFER_OP) ||
(Op->Asl.AmlOpcode == AML_PACKAGE_OP) ||
(Op->Asl.AmlOpcode == AML_VAR_PACKAGE_OP))
{
break;
}
 
/* Reverse the runtime argument list */
 
RuntimeArgTypes2 = 0;
while ((ArgType = GET_CURRENT_ARG_TYPE (RuntimeArgTypes)))
{
RuntimeArgTypes2 <<= ARG_TYPE_WIDTH;
RuntimeArgTypes2 |= ArgType;
INCREMENT_ARG_LIST (RuntimeArgTypes);
}
 
while ((ArgType = GET_CURRENT_ARG_TYPE (RuntimeArgTypes2)))
{
RequiredBtypes = AnMapArgTypeToBtype (ArgType);
 
ThisNodeBtype = AnGetBtype (ArgOp);
if (ThisNodeBtype == ACPI_UINT32_MAX)
{
goto NextArgument;
}
 
/* Examine the arg based on the required type of the arg */
 
switch (ArgType)
{
case ARGI_TARGETREF:
 
if (ArgOp->Asl.ParseOpcode == PARSEOP_ZERO)
{
/* ZERO is the placeholder for "don't store result" */
 
ThisNodeBtype = RequiredBtypes;
break;
}
 
if (ArgOp->Asl.ParseOpcode == PARSEOP_INTEGER)
{
/*
* This is the case where an original reference to a resource
* descriptor field has been replaced by an (Integer) offset.
* These named fields are supported at compile-time only;
* the names are not passed to the interpreter (via the AML).
*/
if ((ArgOp->Asl.Node->Type == ACPI_TYPE_LOCAL_RESOURCE_FIELD) ||
(ArgOp->Asl.Node->Type == ACPI_TYPE_LOCAL_RESOURCE))
{
AslError (ASL_ERROR, ASL_MSG_RESOURCE_FIELD, ArgOp, NULL);
}
else
{
AslError (ASL_ERROR, ASL_MSG_INVALID_TYPE, ArgOp, NULL);
}
break;
}
 
if ((ArgOp->Asl.ParseOpcode == PARSEOP_METHODCALL) ||
(ArgOp->Asl.ParseOpcode == PARSEOP_DEREFOF))
{
break;
}
 
ThisNodeBtype = RequiredBtypes;
break;
 
 
case ARGI_REFERENCE: /* References */
case ARGI_INTEGER_REF:
case ARGI_OBJECT_REF:
case ARGI_DEVICE_REF:
 
switch (ArgOp->Asl.ParseOpcode)
{
case PARSEOP_LOCAL0:
case PARSEOP_LOCAL1:
case PARSEOP_LOCAL2:
case PARSEOP_LOCAL3:
case PARSEOP_LOCAL4:
case PARSEOP_LOCAL5:
case PARSEOP_LOCAL6:
case PARSEOP_LOCAL7:
 
/* TBD: implement analysis of current value (type) of the local */
/* For now, just treat any local as a typematch */
 
/*ThisNodeBtype = RequiredBtypes;*/
break;
 
case PARSEOP_ARG0:
case PARSEOP_ARG1:
case PARSEOP_ARG2:
case PARSEOP_ARG3:
case PARSEOP_ARG4:
case PARSEOP_ARG5:
case PARSEOP_ARG6:
 
/* Hard to analyze argument types, sow we won't */
/* For now, just treat any arg as a typematch */
 
/* ThisNodeBtype = RequiredBtypes; */
break;
 
case PARSEOP_DEBUG:
break;
 
case PARSEOP_REFOF:
case PARSEOP_INDEX:
default:
break;
 
}
break;
 
case ARGI_INTEGER:
default:
break;
}
 
 
CommonBtypes = ThisNodeBtype & RequiredBtypes;
 
if (ArgOp->Asl.ParseOpcode == PARSEOP_METHODCALL)
{
if (AnIsInternalMethod (ArgOp))
{
return (AE_OK);
}
 
/* Check a method call for a valid return value */
 
AnCheckMethodReturnValue (Op, OpInfo, ArgOp,
RequiredBtypes, ThisNodeBtype);
}
 
/*
* Now check if the actual type(s) match at least one
* bit to the required type
*/
else if (!CommonBtypes)
{
/* No match -- this is a type mismatch error */
 
AnFormatBtype (StringBuffer, ThisNodeBtype);
AnFormatBtype (StringBuffer2, RequiredBtypes);
 
sprintf (MsgBuffer, "[%s] found, %s operator requires [%s]",
StringBuffer, OpInfo->Name, StringBuffer2);
 
AslError (ASL_ERROR, ASL_MSG_INVALID_TYPE, ArgOp, MsgBuffer);
}
 
NextArgument:
ArgOp = ArgOp->Asl.Next;
INCREMENT_ARG_LIST (RuntimeArgTypes2);
}
break;
 
default:
break;
}
 
return (AE_OK);
}
 
 
/*******************************************************************************
*
* FUNCTION: AnIsResultUsed
*
* PARAMETERS: Op - Parent op for the operator
1810,211 → 461,150
 
/*******************************************************************************
*
* FUNCTION: AnOtherSemanticAnalysisWalkBegin
* FUNCTION: ApCheckForGpeNameConflict
*
* PARAMETERS: ASL_WALK_CALLBACK
* PARAMETERS: Op - Current parse op
*
* RETURN: Status
* RETURN: None
*
* DESCRIPTION: Descending callback for the analysis walk. Checks for
* miscellaneous issues in the code.
* DESCRIPTION: Check for a conflict between GPE names within this scope.
* Conflict means two GPE names with the same GPE number, but
* different types -- such as _L1C and _E1C.
*
******************************************************************************/
 
ACPI_STATUS
AnOtherSemanticAnalysisWalkBegin (
ACPI_PARSE_OBJECT *Op,
UINT32 Level,
void *Context)
void
ApCheckForGpeNameConflict (
ACPI_PARSE_OBJECT *Op)
{
ACPI_PARSE_OBJECT *ArgNode;
ACPI_PARSE_OBJECT *PrevArgNode = NULL;
const ACPI_OPCODE_INFO *OpInfo;
ACPI_PARSE_OBJECT *NextOp;
UINT32 GpeNumber;
char Name[ACPI_NAME_SIZE + 1];
char Target[ACPI_NAME_SIZE];
 
 
OpInfo = AcpiPsGetOpcodeInfo (Op->Asl.AmlOpcode);
/* Need a null-terminated string version of NameSeg */
 
ACPI_MOVE_32_TO_32 (Name, &Op->Asl.NameSeg);
Name[ACPI_NAME_SIZE] = 0;
 
/*
* Determine if an execution class operator actually does something by
* checking if it has a target and/or the function return value is used.
* (Target is optional, so a standalone statement can actually do nothing.)
* For a GPE method:
* 1st char must be underscore
* 2nd char must be L or E
* 3rd/4th chars must be a hex number
*/
if ((OpInfo->Class == AML_CLASS_EXECUTE) &&
(OpInfo->Flags & AML_HAS_RETVAL) &&
(!AnIsResultUsed (Op)))
if ((Name[0] != '_') ||
((Name[1] != 'L') && (Name[1] != 'E')))
{
if (OpInfo->Flags & AML_HAS_TARGET)
{
/*
* Find the target node, it is always the last child. If the traget
* is not specified in the ASL, a default node of type Zero was
* created by the parser.
*/
ArgNode = Op->Asl.Child;
while (ArgNode->Asl.Next)
{
PrevArgNode = ArgNode;
ArgNode = ArgNode->Asl.Next;
return;
}
 
/* Divide() is the only weird case, it has two targets */
/* Verify 3rd/4th chars are a valid hex value */
 
if (Op->Asl.AmlOpcode == AML_DIVIDE_OP)
GpeNumber = ACPI_STRTOUL (&Name[2], NULL, 16);
if (GpeNumber == ACPI_UINT32_MAX)
{
if ((ArgNode->Asl.ParseOpcode == PARSEOP_ZERO) &&
(PrevArgNode->Asl.ParseOpcode == PARSEOP_ZERO))
{
AslError (ASL_WARNING, ASL_MSG_RESULT_NOT_USED, Op, Op->Asl.ExternalName);
return;
}
}
else if (ArgNode->Asl.ParseOpcode == PARSEOP_ZERO)
{
AslError (ASL_WARNING, ASL_MSG_RESULT_NOT_USED, Op, Op->Asl.ExternalName);
}
}
else
{
 
/*
* Has no target and the result is not used. Only a couple opcodes
* can have this combination.
* We are now sure we have an _Lxx or _Exx.
* Create the target name that would cause collision (Flip E/L)
*/
switch (Op->Asl.ParseOpcode)
ACPI_MOVE_32_TO_32 (Target, Name);
 
/* Inject opposite letter ("L" versus "E") */
 
if (Name[1] == 'L')
{
case PARSEOP_ACQUIRE:
case PARSEOP_WAIT:
case PARSEOP_LOADTABLE:
break;
 
default:
AslError (ASL_WARNING, ASL_MSG_RESULT_NOT_USED, Op, Op->Asl.ExternalName);
break;
Target[1] = 'E';
}
else /* Name[1] == 'E' */
{
Target[1] = 'L';
}
}
 
/* Search all peers (objects within this scope) for target match */
 
/*
* Semantic checks for individual ASL operators
*/
switch (Op->Asl.ParseOpcode)
NextOp = Op->Asl.Next;
while (NextOp)
{
case PARSEOP_ACQUIRE:
case PARSEOP_WAIT:
/*
* Emit a warning if the timeout parameter for these operators is not
* ACPI_WAIT_FOREVER, and the result value from the operator is not
* checked, meaning that a timeout could happen, but the code
* would not know about it.
* We mostly care about methods, but check Name() constructs also,
* even though they will get another error for not being a method.
* All GPE names must be defined as control methods.
*/
 
/* First child is the namepath, 2nd child is timeout */
 
ArgNode = Op->Asl.Child;
ArgNode = ArgNode->Asl.Next;
 
/*
* Check for the WAIT_FOREVER case - defined by the ACPI spec to be
* 0xFFFF or greater
*/
if (((ArgNode->Asl.ParseOpcode == PARSEOP_WORDCONST) ||
(ArgNode->Asl.ParseOpcode == PARSEOP_INTEGER)) &&
(ArgNode->Asl.Value.Integer >= (UINT64) ACPI_WAIT_FOREVER))
if ((NextOp->Asl.ParseOpcode == PARSEOP_METHOD) ||
(NextOp->Asl.ParseOpcode == PARSEOP_NAME))
{
break;
}
 
/*
* The operation could timeout. If the return value is not used
* (indicates timeout occurred), issue a warning
*/
if (!AnIsResultUsed (Op))
if (ACPI_COMPARE_NAME (Target, NextOp->Asl.NameSeg))
{
AslError (ASL_WARNING, ASL_MSG_TIMEOUT, ArgNode, Op->Asl.ExternalName);
}
break;
/* Found both _Exy and _Lxy in the same scope, error */
 
case PARSEOP_CREATEFIELD:
/*
* Check for a zero Length (NumBits) operand. NumBits is the 3rd operand
*/
ArgNode = Op->Asl.Child;
ArgNode = ArgNode->Asl.Next;
ArgNode = ArgNode->Asl.Next;
 
if ((ArgNode->Asl.ParseOpcode == PARSEOP_ZERO) ||
((ArgNode->Asl.ParseOpcode == PARSEOP_INTEGER) &&
(ArgNode->Asl.Value.Integer == 0)))
{
AslError (ASL_ERROR, ASL_MSG_NON_ZERO, ArgNode, NULL);
AslError (ASL_ERROR, ASL_MSG_GPE_NAME_CONFLICT, NextOp,
Name);
return;
}
break;
}
 
default:
break;
NextOp = NextOp->Asl.Next;
}
 
return AE_OK;
/* OK, no conflict found */
 
return;
}
 
 
/*******************************************************************************
*
* FUNCTION: AnOtherSemanticAnalysisWalkEnd
* FUNCTION: ApCheckRegMethod
*
* PARAMETERS: ASL_WALK_CALLBACK
* PARAMETERS: Op - Current parse op
*
* RETURN: Status
* RETURN: None
*
* DESCRIPTION: Ascending callback for analysis walk. Complete method
* return analysis.
* DESCRIPTION: Ensure that a _REG method has a corresponding Operation
* Region declaration within the same scope. Note: _REG is defined
* to have two arguments and must therefore be defined as a
* control method.
*
******************************************************************************/
 
ACPI_STATUS
AnOtherSemanticAnalysisWalkEnd (
ACPI_PARSE_OBJECT *Op,
UINT32 Level,
void *Context)
void
ApCheckRegMethod (
ACPI_PARSE_OBJECT *Op)
{
ACPI_PARSE_OBJECT *Next;
ACPI_PARSE_OBJECT *Parent;
 
return AE_OK;
 
/* We are only interested in _REG methods */
 
if (!ACPI_COMPARE_NAME (METHOD_NAME__REG, &Op->Asl.NameSeg))
{
return;
}
 
/* Get the start of the current scope */
 
#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
*
******************************************************************************/
Parent = Op->Asl.Parent;
Next = Parent->Asl.Child;
 
UINT32
AnMapBtypeToEtype (
UINT32 Btype)
{
UINT32 i;
UINT32 Etype;
/* Search entire scope for an operation region declaration */
 
 
if (Btype == 0)
while (Next)
{
return 0;
if (Next->Asl.ParseOpcode == PARSEOP_OPERATIONREGION)
{
return; /* Found region, OK */
}
 
Etype = 1;
for (i = 1; i < Btype; i *= 2)
{
Etype++;
Next = Next->Asl.Next;
}
 
return (Etype);
/* No region found, issue warning */
 
AslError (ASL_WARNING, ASL_MSG_NO_REGION, Op, NULL);
}
#endif
 
/drivers/devman/acpica/compiler/aslbtypes.c
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
/drivers/devman/acpica/compiler/aslcodegen.c
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
 
/* 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 */
 
/drivers/devman/acpica/compiler/aslcompile.c
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
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
UINT32 FileId)
{
char *Prefix = "";
char *UtilityName;
 
 
/* Set line prefix depending on the destination file type */
192,36 → 195,21
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
*
******************************************************************************/
 
void
static void
FlConsumeAnsiComment (
ASL_FILE_INFO *FileInfo,
ASL_FILE_STATUS *Status)
389,7 → 377,7
}
 
 
void
static void
FlConsumeNewComment (
ASL_FILE_INFO *FileInfo,
ASL_FILE_STATUS *Status)
684,9 → 672,8
 
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 */
693,9 → 680,8
 
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 */
702,9 → 688,9
 
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
 
/*
* 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))
{
/drivers/devman/acpica/compiler/aslcompiler.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
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
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
 
 
/*
* aslanalyze - semantic analysis
* aslwalks - semantic analysis and parse tree walks
*/
ACPI_STATUS
AnOtherSemanticAnalysisWalkBegin (
243,12 → 251,6
void *Context);
 
ACPI_STATUS
AnOperandTypecheckWalkBegin (
ACPI_PARSE_OBJECT *Op,
UINT32 Level,
void *Context);
 
ACPI_STATUS
AnOperandTypecheckWalkEnd (
ACPI_PARSE_OBJECT *Op,
UINT32 Level,
267,18 → 269,79
void *Context);
 
ACPI_STATUS
AnMethodTypingWalkBegin (
AnMethodTypingWalkEnd (
ACPI_PARSE_OBJECT *Op,
UINT32 Level,
void *Context);
 
ACPI_STATUS
AnMethodTypingWalkEnd (
 
/*
* 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,
UINT32 Level,
void *Context);
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
 
int
AslCompilererror(
char *s);
const char *s);
 
void
AslCommonError (
470,7 → 533,7
/*
* aslpredef - ACPI predefined names support
*/
void
BOOLEAN
ApCheckForPredefinedMethod (
ACPI_PARSE_OBJECT *Op,
ASL_METHOD_INFO *MethodInfo);
552,6 → 615,10
UINT64 Value);
 
ACPI_PARSE_OBJECT *
TrCreateConstantLeafNode (
UINT32 ParseOpcode);
 
ACPI_PARSE_OBJECT *
TrLinkChildren (
ACPI_PARSE_OBJECT *Op,
UINT32 NumChildren,
677,7 → 744,11
LsDisplayNamespace (
void);
 
void
LsSetupNsList (
void *Handle);
 
 
/*
* aslutils - common compiler utilites
*/
694,6 → 765,10
#define ASL_TREE_OUTPUT 2
 
void
UtDisplaySupportedTables (
void);
 
void
UtDisplayConstantOpcodes (
void);
 
764,8 → 839,31
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
*/
void
778,7 → 876,8
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
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
DtDoCompile(
void);
 
ACPI_STATUS
DtCreateTemplates (
char *Signature);
 
#endif /* __ASLCOMPILER_H */
 
/drivers/devman/acpica/compiler/aslcompiler.l
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
"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('}'); }
/drivers/devman/acpica/compiler/aslcompiler.y
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,38 → 138,34
* ResourceMacroList, and FieldUnitList
*/
 
void * AslLocalAllocate (unsigned int Size);
 
/*
* Next statement is important - this makes everything public so that
* we can access some of the parser tables from other modules
*/
/* Bison/yacc configuration */
 
#define static
#undef alloca
#define alloca AslLocalAllocate
#define YYERROR_VERBOSE 1
#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
* 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;
184,7 → 172,6
ACPI_PARSE_OBJECT *n;
}
 
 
/*! [Begin] no source code translation */
 
/*
193,7 → 180,6
*/
%expect 60
 
 
/*
* Token types: These are returned by the lexer
*
200,7 → 186,6
* 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
%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
%type <n> OptionalReference
%type <n> OptionalAccessSize
 
 
%type <n> TermArgItem
%type <n> NameStringItem
 
794,6 → 785,21
| 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
: 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
: 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
;
 
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
| ',' error {$$ = AslDoError (); yyclearin;}
;
 
 
%%
 
 
3187,3 → 3195,32
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
}
/drivers/devman/acpica/compiler/asldefine.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
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,12 → 138,23
#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
*/
#define ASL_RESDESC_OFFSET(m) ACPI_OFFSET (AML_RESOURCE, m)
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 */
/drivers/devman/acpica/compiler/aslerror.c
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
UINT32 ErrorColumn;
FILE *OutputFile;
FILE *SourceFile;
long FileSize;
BOOLEAN PrematureEOF = FALSE;
 
 
if (Gbl_NoErrors)
280,8 → 282,28
/* 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)
{
fprintf (OutputFile, "%s", Header);
300,9 → 322,16
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.
*/
if (!PrematureEOF)
{
/*
* 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)
327,6 → 356,8
RActual = fread (&SourceByte, 1, 1, SourceFile);
}
}
}
 
fprintf (OutputFile, "\n");
}
}
369,7 → 400,7
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
fprintf (OutputFile, " (%s)", ExtraMessage);
}
 
if (PrematureEOF)
{
fprintf (OutputFile, " and premature End-Of-File");
}
 
fprintf (OutputFile, "\n");
if (Gbl_VerboseErrors)
{
656,13 → 692,13
 
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);
ACPI_CAST_PTR (char, CompilerMessage));
 
return 0;
}
/drivers/devman/acpica/compiler/aslfiles.c
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
*
******************************************************************************/
 
FILE *
static FILE *
FlOpenIncludeWithPrefix (
char *PrefixDir,
char *Filename)
768,9 → 768,11
char *Filename;
 
 
/* Create/Open a combined source output file */
/* Create/Open a hex output file if asked */
 
Filename = FlGenerateFilename (FilenamePrefix, FILE_SUFFIX_SOURCE);
if (Gbl_HexOutputFlag)
{
Filename = FlGenerateFilename (FilenamePrefix, FILE_SUFFIX_HEX_DUMP);
if (!Filename)
{
AslCommonError (ASL_ERROR, ASL_MSG_LISTING_FILENAME,
778,13 → 780,38
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");
/* Open the hex file, text mode */
 
FlOpenFile (ASL_FILE_HEX_OUTPUT, Filename, "w+");
 
AslCompilerSignon (ASL_FILE_HEX_OUTPUT);
AslCompilerFileHeader (ASL_FILE_HEX_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);
}
 
/* Create/Open a listing output file if asked */
 
if (Gbl_ListingFlag)
805,6 → 832,28
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
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
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);
}
 
/drivers/devman/acpica/compiler/aslfold.c
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
/drivers/devman/acpica/compiler/aslglobal.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
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 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_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 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,8 → 253,8
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);
ASL_EXTERN UINT32 ASL_INIT_GLOBAL (Gbl_CurrentLine, 0);
269,6 → 270,7
 
ASL_EXTERN ASL_ANALYSIS_WALK_INFO AnalysisWalkInfo;
ASL_EXTERN ACPI_TABLE_HEADER TableHeader;
extern char AslHexLookup[];
 
/* Event timing */
 
/drivers/devman/acpica/compiler/asllength.c
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
/drivers/devman/acpica/compiler/asllisting.c
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
LsDoHexOutputAsl (
void);
 
ACPI_STATUS
static ACPI_STATUS
LsTreeWriteWalk (
ACPI_PARSE_OBJECT *Op,
UINT32 Level,
222,7 → 222,7
*
******************************************************************************/
 
ACPI_STATUS
static ACPI_STATUS
LsTreeWriteWalk (
ACPI_PARSE_OBJECT *Op,
UINT32 Level,
/drivers/devman/acpica/compiler/aslload.c
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
/drivers/devman/acpica/compiler/asllookup.c
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
void *Context,
void **ReturnValue);
 
void
LsSetupNsList (
void *Handle);
 
ACPI_PARSE_OBJECT *
static ACPI_PARSE_OBJECT *
LkGetNameOp (
ACPI_PARSE_OBJECT *Op);
 
623,7 → 619,7
*
******************************************************************************/
 
ACPI_PARSE_OBJECT *
static ACPI_PARSE_OBJECT *
LkGetNameOp (
ACPI_PARSE_OBJECT *Op)
{
1327,8 → 1323,8
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
}
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)
{
/drivers/devman/acpica/compiler/aslmain.c
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
 
 
#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
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
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
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
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
BOOLEAN IsResponseFile)
{
int j;
ACPI_STATUS Status;
 
 
/* Get the command line options */
489,10 → 497,12
{
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
Gbl_DoCompile = FALSE;
break;
 
case 'a':
Gbl_DoCompile = FALSE;
Gbl_DisassembleAll = TRUE;
break;
 
case 'c':
break;
 
543,7 → 558,12
 
 
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
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
break;
 
 
case 'T':
Gbl_DoTemplates = TRUE;
Gbl_TemplateSignature = AcpiGbl_Optarg;
break;
 
 
case 'v':
 
switch (AcpiGbl_Optarg[0])
797,6 → 826,10
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
break;
 
 
case 'y':
 
Gbl_DataTableCompilerAvailable = TRUE;
break;
 
 
case 'z':
 
Gbl_UseOriginalCompilerId = TRUE;
872,6 → 899,7
char **argv)
{
int BadCommandLine = 0;
ACPI_STATUS Status;
 
 
/* Minimum command line contains at least the command and an input file */
878,7 → 906,7
 
if (argc < 2)
{
AslCompilerSignon (ASL_FILE_STDOUT);
printf (ACPI_COMMON_SIGNON (ASL_COMPILER_NAME));
Usage ();
exit (1);
}
887,6 → 915,16
 
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
 
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
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
/* Init and command line */
 
AslInitialize ();
Index = AslCommandLine (argc, argv);
Index1 = Index2 = AslCommandLine (argc, argv);
 
/* Options that have no additional parameters or pathnames */
 
959,19 → 1000,38
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);
}
 
/drivers/devman/acpica/compiler/aslmap.c
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
/* 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
/* 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),
/drivers/devman/acpica/compiler/aslmessages.h
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 */
/drivers/devman/acpica/compiler/aslopcodes.c
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
/* 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
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 */
/drivers/devman/acpica/compiler/asloperands.c
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
/drivers/devman/acpica/compiler/aslopt.c
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
/drivers/devman/acpica/compiler/aslpredef.c
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
*
******************************************************************************/
 
void
BOOLEAN
ApCheckForPredefinedMethod (
ACPI_PARSE_OBJECT *Op,
ASL_METHOD_INFO *MethodInfo)
240,7 → 243,7
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,11 → 310,60
}
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);
}
 
 
/*******************************************************************************
*
* FUNCTION: ApCheckPredefinedReturnValue
*
* PARAMETERS: Op - A parse node of type "RETURN".
323,7 → 375,9
* 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,10 → 397,16
 
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;
353,10 → 413,11
 
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;
}
 
/drivers/devman/acpica/compiler/aslresource.c
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
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
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
* 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
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
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)
/drivers/devman/acpica/compiler/aslrestype1.c
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
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
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
Descriptor->Memory24.Maximum,
Descriptor->Memory24.AddressLength,
Descriptor->Memory24.Alignment,
MinOp, MaxOp, LengthOp, NULL);
MinOp, MaxOp, LengthOp, NULL, Op);
 
return (Rnode);
}
410,7 → 408,7
Descriptor->Memory32.Maximum,
Descriptor->Memory32.AddressLength,
Descriptor->Memory32.Alignment,
MinOp, MaxOp, LengthOp, AlignOp);
MinOp, MaxOp, LengthOp, AlignOp, Op);
 
return (Rnode);
}
/drivers/devman/acpica/compiler/aslrestype1i.c
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
Descriptor->Io.Maximum,
Descriptor->Io.AddressLength,
Descriptor->Io.Alignment,
MinOp, MaxOp, LengthOp, AlignOp);
MinOp, MaxOp, LengthOp, AlignOp, Op);
 
return (Rnode);
}
/drivers/devman/acpica/compiler/aslrestype2.c
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
/drivers/devman/acpica/compiler/aslrestype2d.c
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
/* 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
/* 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
/* 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;
/drivers/devman/acpica/compiler/aslrestype2e.c
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
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
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
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);
/drivers/devman/acpica/compiler/aslrestype2q.c
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
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
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
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;
/drivers/devman/acpica/compiler/aslrestype2w.c
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
/* 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
/* 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
/* 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;
/drivers/devman/acpica/compiler/aslstartup.c
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
*
******************************************************************************/
 
static void
void
AslInitializeGlobals (
void)
{
187,6 → 182,9
 
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
#ifdef WIN32
void *DirInfo;
char *Filename;
int FileCount;
 
 
FileCount = 0;
278,7 → 277,7
*
******************************************************************************/
 
UINT8
static UINT8
AslDetectSourceFileType (
ASL_FILE_INFO *Info)
{
398,7 → 397,7
/* Shutdown compiler and ACPICA subsystem */
 
AeClearErrorLog ();
AcpiTerminate ();
(void) AcpiTerminate ();
 
/*
* Gbl_Files[ASL_FILE_INPUT].Filename was replaced with the
464,17 → 463,6
*/
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
*/
case ASL_INPUT_TYPE_ASCII_ASL:
 
 
/* ACPICA subsystem initialization */
 
Status = AdInitialize ();
500,7 → 487,7
}
 
Status = CmDoCompile ();
AcpiTerminate ();
(void) AcpiTerminate ();
 
/*
* Return non-zero exit code if there have been errors, unless the
542,10 → 529,11
 
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
 
/* 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
 
/* 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);
/drivers/devman/acpica/compiler/aslstubs.c
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
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);
}
/drivers/devman/acpica/compiler/asltransform.c
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
/drivers/devman/acpica/compiler/asltree.c
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")
475,6 → 476,75
 
/*******************************************************************************
*
* 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
*
* PARAMETERS: ParseOpcode - New opcode to be assigned to the node
/drivers/devman/acpica/compiler/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
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
} 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 */
/drivers/devman/acpica/compiler/aslutils.c
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
 
/* Local prototypes */
 
static ACPI_STATUS
UtStrtoul64 (
char *String,
UINT32 Base,
UINT64 *RetInteger);
 
static void
UtPadNameWithUnderscores (
char *NameSeg,
157,6 → 146,50
 
/*******************************************************************************
*
* 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
*
* PARAMETERS: None
340,8 → 373,8
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
{
 
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';
}
 
476,32 → 509,6
 
/*******************************************************************************
*
* 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
*
* PARAMETERS: FileID - ID of outpout file
521,8 → 528,8
{
/* 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
*
******************************************************************************/
 
static ACPI_STATUS
ACPI_STATUS
UtStrtoul64 (
char *String,
UINT32 Base,
/drivers/devman/acpica/compiler/asluuid.c
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);
}
/drivers/devman/acpica/compiler/aslwalks.c
0,0 → 1,1236
/******************************************************************************
*
* Module Name: aslwalks.c - major analytical parse tree walks
*
*****************************************************************************/
 
/******************************************************************************
*
* 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 "acparser.h"
#include "amlcode.h"
 
 
#define _COMPONENT ACPI_COMPILER
ACPI_MODULE_NAME ("aslwalks")
 
 
/*******************************************************************************
*
* FUNCTION: AnMethodAnalysisWalkBegin
*
* PARAMETERS: ASL_WALK_CALLBACK
*
* RETURN: Status
*
* DESCRIPTION: Descending callback for the analysis walk. Check methods for:
* 1) Initialized local variables
* 2) Valid arguments
* 3) Return types
*
******************************************************************************/
 
ACPI_STATUS
AnMethodAnalysisWalkBegin (
ACPI_PARSE_OBJECT *Op,
UINT32 Level,
void *Context)
{
ASL_ANALYSIS_WALK_INFO *WalkInfo = (ASL_ANALYSIS_WALK_INFO *) Context;
ASL_METHOD_INFO *MethodInfo = WalkInfo->MethodStack;
ACPI_PARSE_OBJECT *Next;
UINT32 RegisterNumber;
UINT32 i;
char LocalName[] = "Local0";
char ArgName[] = "Arg0";
ACPI_PARSE_OBJECT *ArgNode;
ACPI_PARSE_OBJECT *NextType;
ACPI_PARSE_OBJECT *NextParamType;
UINT8 ActualArgs = 0;
 
 
switch (Op->Asl.ParseOpcode)
{
case PARSEOP_METHOD:
 
TotalMethods++;
 
/* Create and init method info */
 
MethodInfo = UtLocalCalloc (sizeof (ASL_METHOD_INFO));
MethodInfo->Next = WalkInfo->MethodStack;
MethodInfo->Op = Op;
 
WalkInfo->MethodStack = MethodInfo;
 
/* Get the name node, ignored here */
 
Next = Op->Asl.Child;
 
/* Get the NumArguments node */
 
Next = Next->Asl.Next;
MethodInfo->NumArguments = (UINT8)
(((UINT8) Next->Asl.Value.Integer) & 0x07);
 
/* Get the SerializeRule and SyncLevel nodes, ignored here */
 
Next = Next->Asl.Next;
Next = Next->Asl.Next;
ArgNode = Next;
 
/* Get the ReturnType node */
 
Next = Next->Asl.Next;
 
NextType = Next->Asl.Child;
while (NextType)
{
/* Get and map each of the ReturnTypes */
 
MethodInfo->ValidReturnTypes |= AnMapObjTypeToBtype (NextType);
NextType->Asl.ParseOpcode = PARSEOP_DEFAULT_ARG;
NextType = NextType->Asl.Next;
}
 
/* Get the ParameterType node */
 
Next = Next->Asl.Next;
 
NextType = Next->Asl.Child;
while (NextType)
{
if (NextType->Asl.ParseOpcode == PARSEOP_DEFAULT_ARG)
{
NextParamType = NextType->Asl.Child;
while (NextParamType)
{
MethodInfo->ValidArgTypes[ActualArgs] |= AnMapObjTypeToBtype (NextParamType);
NextParamType->Asl.ParseOpcode = PARSEOP_DEFAULT_ARG;
NextParamType = NextParamType->Asl.Next;
}
}
else
{
MethodInfo->ValidArgTypes[ActualArgs] =
AnMapObjTypeToBtype (NextType);
NextType->Asl.ParseOpcode = PARSEOP_DEFAULT_ARG;
ActualArgs++;
}
 
NextType = NextType->Asl.Next;
}
 
if ((MethodInfo->NumArguments) &&
(MethodInfo->NumArguments != ActualArgs))
{
/* error: Param list did not match number of args */
}
 
/* Allow numarguments == 0 for Function() */
 
if ((!MethodInfo->NumArguments) && (ActualArgs))
{
MethodInfo->NumArguments = ActualArgs;
ArgNode->Asl.Value.Integer |= ActualArgs;
}
 
/*
* Actual arguments are initialized at method entry.
* All other ArgX "registers" can be used as locals, so we
* track their initialization.
*/
for (i = 0; i < MethodInfo->NumArguments; i++)
{
MethodInfo->ArgInitialized[i] = TRUE;
}
break;
 
 
case PARSEOP_METHODCALL:
 
if (MethodInfo &&
(Op->Asl.Node == MethodInfo->Op->Asl.Node))
{
AslError (ASL_REMARK, ASL_MSG_RECURSION, Op, Op->Asl.ExternalName);
}
break;
 
 
case PARSEOP_LOCAL0:
case PARSEOP_LOCAL1:
case PARSEOP_LOCAL2:
case PARSEOP_LOCAL3:
case PARSEOP_LOCAL4:
case PARSEOP_LOCAL5:
case PARSEOP_LOCAL6:
case PARSEOP_LOCAL7:
 
if (!MethodInfo)
{
/*
* Local was used outside a control method, or there was an error
* in the method declaration.
*/
AslError (ASL_REMARK, ASL_MSG_LOCAL_OUTSIDE_METHOD, Op, Op->Asl.ExternalName);
return (AE_ERROR);
}
 
RegisterNumber = (Op->Asl.AmlOpcode & 0x000F);
 
/*
* If the local is being used as a target, mark the local
* initialized
*/
if (Op->Asl.CompileFlags & NODE_IS_TARGET)
{
MethodInfo->LocalInitialized[RegisterNumber] = TRUE;
}
 
/*
* Otherwise, this is a reference, check if the local
* has been previously initialized.
*
* The only operator that accepts an uninitialized value is ObjectType()
*/
else if ((!MethodInfo->LocalInitialized[RegisterNumber]) &&
(Op->Asl.Parent->Asl.ParseOpcode != PARSEOP_OBJECTTYPE))
{
LocalName[strlen (LocalName) -1] = (char) (RegisterNumber + 0x30);
AslError (ASL_ERROR, ASL_MSG_LOCAL_INIT, Op, LocalName);
}
break;
 
 
case PARSEOP_ARG0:
case PARSEOP_ARG1:
case PARSEOP_ARG2:
case PARSEOP_ARG3:
case PARSEOP_ARG4:
case PARSEOP_ARG5:
case PARSEOP_ARG6:
 
if (!MethodInfo)
{
/*
* Arg was used outside a control method, or there was an error
* in the method declaration.
*/
AslError (ASL_REMARK, ASL_MSG_LOCAL_OUTSIDE_METHOD, Op, Op->Asl.ExternalName);
return (AE_ERROR);
}
 
RegisterNumber = (Op->Asl.AmlOpcode & 0x000F) - 8;
ArgName[strlen (ArgName) -1] = (char) (RegisterNumber + 0x30);
 
/*
* If the Arg is being used as a target, mark the local
* initialized
*/
if (Op->Asl.CompileFlags & NODE_IS_TARGET)
{
MethodInfo->ArgInitialized[RegisterNumber] = TRUE;
}
 
/*
* Otherwise, this is a reference, check if the Arg
* has been previously initialized.
*
* The only operator that accepts an uninitialized value is ObjectType()
*/
else if ((!MethodInfo->ArgInitialized[RegisterNumber]) &&
(Op->Asl.Parent->Asl.ParseOpcode != PARSEOP_OBJECTTYPE))
{
AslError (ASL_ERROR, ASL_MSG_ARG_INIT, Op, ArgName);
}
 
/* Flag this arg if it is not a "real" argument to the method */
 
if (RegisterNumber >= MethodInfo->NumArguments)
{
AslError (ASL_REMARK, ASL_MSG_NOT_PARAMETER, Op, ArgName);
}
break;
 
 
case PARSEOP_RETURN:
 
if (!MethodInfo)
{
/*
* Probably was an error in the method declaration,
* no additional error here
*/
ACPI_WARNING ((AE_INFO, "%p, No parent method", Op));
return (AE_ERROR);
}
 
/*
* A child indicates a possible return value. A simple Return or
* Return() is marked with NODE_IS_NULL_RETURN by the parser so
* that it is not counted as a "real" return-with-value, although
* the AML code that is actually emitted is Return(0). The AML
* definition of Return has a required parameter, so we are
* forced to convert a null return to Return(0).
*/
if ((Op->Asl.Child) &&
(Op->Asl.Child->Asl.ParseOpcode != PARSEOP_DEFAULT_ARG) &&
(!(Op->Asl.Child->Asl.CompileFlags & NODE_IS_NULL_RETURN)))
{
MethodInfo->NumReturnWithValue++;
}
else
{
MethodInfo->NumReturnNoValue++;
}
break;
 
 
case PARSEOP_BREAK:
case PARSEOP_CONTINUE:
 
Next = Op->Asl.Parent;
while (Next)
{
if (Next->Asl.ParseOpcode == PARSEOP_WHILE)
{
break;
}
Next = Next->Asl.Parent;
}
 
if (!Next)
{
AslError (ASL_ERROR, ASL_MSG_NO_WHILE, Op, NULL);
}
break;
 
 
case PARSEOP_STALL:
 
/* We can range check if the argument is an integer */
 
if ((Op->Asl.Child->Asl.ParseOpcode == PARSEOP_INTEGER) &&
(Op->Asl.Child->Asl.Value.Integer > ACPI_UINT8_MAX))
{
AslError (ASL_ERROR, ASL_MSG_INVALID_TIME, Op, NULL);
}
break;
 
 
case PARSEOP_DEVICE:
case PARSEOP_EVENT:
case PARSEOP_MUTEX:
case PARSEOP_OPERATIONREGION:
case PARSEOP_POWERRESOURCE:
case PARSEOP_PROCESSOR:
case PARSEOP_THERMALZONE:
 
/*
* The first operand is a name to be created in the namespace.
* Check against the reserved list.
*/
i = ApCheckForPredefinedName (Op, Op->Asl.NameSeg);
if (i < ACPI_VALID_RESERVED_NAME_MAX)
{
AslError (ASL_ERROR, ASL_MSG_RESERVED_USE, Op, Op->Asl.ExternalName);
}
break;
 
 
case PARSEOP_NAME:
 
/* Typecheck any predefined names statically defined with Name() */
 
ApCheckForPredefinedObject (Op, Op->Asl.NameSeg);
 
/* Special typechecking for _HID */
 
if (!ACPI_STRCMP (METHOD_NAME__HID, Op->Asl.NameSeg))
{
Next = Op->Asl.Child->Asl.Next;
AnCheckId (Next, ASL_TYPE_HID);
}
 
/* Special typechecking for _CID */
 
else if (!ACPI_STRCMP (METHOD_NAME__CID, Op->Asl.NameSeg))
{
Next = Op->Asl.Child->Asl.Next;
 
if ((Next->Asl.ParseOpcode == PARSEOP_PACKAGE) ||
(Next->Asl.ParseOpcode == PARSEOP_VAR_PACKAGE))
{
Next = Next->Asl.Child;
while (Next)
{
AnCheckId (Next, ASL_TYPE_CID);
Next = Next->Asl.Next;
}
}
else
{
AnCheckId (Next, ASL_TYPE_CID);
}
}
break;
 
 
default:
break;
}
 
return (AE_OK);
}
 
 
/*******************************************************************************
*
* FUNCTION: AnMethodAnalysisWalkEnd
*
* PARAMETERS: ASL_WALK_CALLBACK
*
* RETURN: Status
*
* DESCRIPTION: Ascending callback for analysis walk. Complete method
* return analysis.
*
******************************************************************************/
 
ACPI_STATUS
AnMethodAnalysisWalkEnd (
ACPI_PARSE_OBJECT *Op,
UINT32 Level,
void *Context)
{
ASL_ANALYSIS_WALK_INFO *WalkInfo = (ASL_ANALYSIS_WALK_INFO *) Context;
ASL_METHOD_INFO *MethodInfo = WalkInfo->MethodStack;
 
 
switch (Op->Asl.ParseOpcode)
{
case PARSEOP_METHOD:
case PARSEOP_RETURN:
if (!MethodInfo)
{
printf ("No method info for method! [%s]\n", Op->Asl.Namepath);
AslError (ASL_ERROR, ASL_MSG_COMPILER_INTERNAL, Op,
"No method info for this method");
 
CmCleanupAndExit ();
return (AE_AML_INTERNAL);
}
break;
 
default:
break;
}
 
switch (Op->Asl.ParseOpcode)
{
case PARSEOP_METHOD:
 
WalkInfo->MethodStack = MethodInfo->Next;
 
/*
* Check if there is no return statement at the end of the
* method AND we can actually get there -- i.e., the execution
* of the method can possibly terminate without a return statement.
*/
if ((!AnLastStatementIsReturn (Op)) &&
(!(Op->Asl.CompileFlags & NODE_HAS_NO_EXIT)))
{
/*
* No return statement, and execution can possibly exit
* via this path. This is equivalent to Return ()
*/
MethodInfo->NumReturnNoValue++;
}
 
/*
* Check for case where some return statements have a return value
* and some do not. Exit without a return statement is a return with
* no value
*/
if (MethodInfo->NumReturnNoValue &&
MethodInfo->NumReturnWithValue)
{
AslError (ASL_WARNING, ASL_MSG_RETURN_TYPES, Op,
Op->Asl.ExternalName);
}
 
/*
* If there are any RETURN() statements with no value, or there is a
* control path that allows the method to exit without a return value,
* we mark the method as a method that does not return a value. This
* knowledge can be used to check method invocations that expect a
* returned value.
*/
if (MethodInfo->NumReturnNoValue)
{
if (MethodInfo->NumReturnWithValue)
{
Op->Asl.CompileFlags |= NODE_METHOD_SOME_NO_RETVAL;
}
else
{
Op->Asl.CompileFlags |= NODE_METHOD_NO_RETVAL;
}
}
 
/*
* Check predefined method names for correct return behavior
* and correct number of arguments. Also, some special checks
* For GPE and _REG methods.
*/
if (ApCheckForPredefinedMethod (Op, MethodInfo))
{
/* Special check for two names like _L01 and _E01 in same scope */
 
ApCheckForGpeNameConflict (Op);
 
/*
* Special check for _REG: Must have an operation region definition
* within the same scope!
*/
ApCheckRegMethod (Op);
}
 
ACPI_FREE (MethodInfo);
break;
 
 
case PARSEOP_NAME:
 
/* Special check for two names like _L01 and _E01 in same scope */
 
ApCheckForGpeNameConflict (Op);
break;
 
 
case PARSEOP_RETURN:
 
/*
* If the parent is a predefined method name, attempt to typecheck
* the return value. Only static types can be validated.
*/
ApCheckPredefinedReturnValue (Op, MethodInfo);
 
/*
* The parent block does not "exit" and continue execution -- the
* method is terminated here with the Return() statement.
*/
Op->Asl.Parent->Asl.CompileFlags |= NODE_HAS_NO_EXIT;
 
/* Used in the "typing" pass later */
 
Op->Asl.ParentMethod = MethodInfo->Op;
 
/*
* If there is a peer node after the return statement, then this
* node is unreachable code -- i.e., it won't be executed because of
* the preceeding Return() statement.
*/
if (Op->Asl.Next)
{
AslError (ASL_WARNING, ASL_MSG_UNREACHABLE_CODE, Op->Asl.Next, NULL);
}
break;
 
 
case PARSEOP_IF:
 
if ((Op->Asl.CompileFlags & NODE_HAS_NO_EXIT) &&
(Op->Asl.Next) &&
(Op->Asl.Next->Asl.ParseOpcode == PARSEOP_ELSE))
{
/*
* This IF has a corresponding ELSE. The IF block has no exit,
* (it contains an unconditional Return)
* mark the ELSE block to remember this fact.
*/
Op->Asl.Next->Asl.CompileFlags |= NODE_IF_HAS_NO_EXIT;
}
break;
 
 
case PARSEOP_ELSE:
 
if ((Op->Asl.CompileFlags & NODE_HAS_NO_EXIT) &&
(Op->Asl.CompileFlags & NODE_IF_HAS_NO_EXIT))
{
/*
* This ELSE block has no exit and the corresponding IF block
* has no exit either. Therefore, the parent node has no exit.
*/
Op->Asl.Parent->Asl.CompileFlags |= NODE_HAS_NO_EXIT;
}
break;
 
 
default:
 
if ((Op->Asl.CompileFlags & NODE_HAS_NO_EXIT) &&
(Op->Asl.Parent))
{
/* If this node has no exit, then the parent has no exit either */
 
Op->Asl.Parent->Asl.CompileFlags |= NODE_HAS_NO_EXIT;
}
break;
}
 
return (AE_OK);
}
 
 
/*******************************************************************************
*
* FUNCTION: AnMethodTypingWalkEnd
*
* PARAMETERS: ASL_WALK_CALLBACK
*
* RETURN: Status
*
* DESCRIPTION: Ascending callback for typing walk. Complete the method
* return analysis. Check methods for:
* 1) Initialized local variables
* 2) Valid arguments
* 3) Return types
*
******************************************************************************/
 
ACPI_STATUS
AnMethodTypingWalkEnd (
ACPI_PARSE_OBJECT *Op,
UINT32 Level,
void *Context)
{
UINT32 ThisNodeBtype;
 
 
switch (Op->Asl.ParseOpcode)
{
case PARSEOP_METHOD:
 
Op->Asl.CompileFlags |= NODE_METHOD_TYPED;
break;
 
case PARSEOP_RETURN:
 
if ((Op->Asl.Child) &&
(Op->Asl.Child->Asl.ParseOpcode != PARSEOP_DEFAULT_ARG))
{
ThisNodeBtype = AnGetBtype (Op->Asl.Child);
 
if ((Op->Asl.Child->Asl.ParseOpcode == PARSEOP_METHODCALL) &&
(ThisNodeBtype == (ACPI_UINT32_MAX -1)))
{
/*
* The called method is untyped at this time (typically a
* forward reference).
*
* Check for a recursive method call first.
*/
if (Op->Asl.ParentMethod != Op->Asl.Child->Asl.Node->Op)
{
/* We must type the method here */
 
TrWalkParseTree (Op->Asl.Child->Asl.Node->Op,
ASL_WALK_VISIT_UPWARD, NULL,
AnMethodTypingWalkEnd, NULL);
 
ThisNodeBtype = AnGetBtype (Op->Asl.Child);
}
}
 
/* Returns a value, save the value type */
 
if (Op->Asl.ParentMethod)
{
Op->Asl.ParentMethod->Asl.AcpiBtype |= ThisNodeBtype;
}
}
break;
 
default:
break;
}
 
return (AE_OK);
}
 
 
/*******************************************************************************
*
* FUNCTION: AnOperandTypecheckWalkEnd
*
* PARAMETERS: ASL_WALK_CALLBACK
*
* RETURN: Status
*
* DESCRIPTION: Ascending callback for analysis walk. Complete method
* return analysis.
*
******************************************************************************/
 
ACPI_STATUS
AnOperandTypecheckWalkEnd (
ACPI_PARSE_OBJECT *Op,
UINT32 Level,
void *Context)
{
const ACPI_OPCODE_INFO *OpInfo;
UINT32 RuntimeArgTypes;
UINT32 RuntimeArgTypes2;
UINT32 RequiredBtypes;
UINT32 ThisNodeBtype;
UINT32 CommonBtypes;
UINT32 OpcodeClass;
ACPI_PARSE_OBJECT *ArgOp;
UINT32 ArgType;
 
 
switch (Op->Asl.AmlOpcode)
{
case AML_RAW_DATA_BYTE:
case AML_RAW_DATA_WORD:
case AML_RAW_DATA_DWORD:
case AML_RAW_DATA_QWORD:
case AML_RAW_DATA_BUFFER:
case AML_RAW_DATA_CHAIN:
case AML_PACKAGE_LENGTH:
case AML_UNASSIGNED_OPCODE:
case AML_DEFAULT_ARG_OP:
 
/* Ignore the internal (compiler-only) AML opcodes */
 
return (AE_OK);
 
default:
break;
}
 
OpInfo = AcpiPsGetOpcodeInfo (Op->Asl.AmlOpcode);
if (!OpInfo)
{
return (AE_OK);
}
 
ArgOp = Op->Asl.Child;
RuntimeArgTypes = OpInfo->RuntimeArgs;
OpcodeClass = OpInfo->Class;
 
#ifdef ASL_ERROR_NAMED_OBJECT_IN_WHILE
/*
* Update 11/2008: In practice, we can't perform this check. A simple
* analysis is not sufficient. Also, it can cause errors when compiling
* disassembled code because of the way Switch operators are implemented
* (a While(One) loop with a named temp variable created within.)
*/
 
/*
* If we are creating a named object, check if we are within a while loop
* by checking if the parent is a WHILE op. This is a simple analysis, but
* probably sufficient for many cases.
*
* Allow Scope(), Buffer(), and Package().
*/
if (((OpcodeClass == AML_CLASS_NAMED_OBJECT) && (Op->Asl.AmlOpcode != AML_SCOPE_OP)) ||
((OpcodeClass == AML_CLASS_CREATE) && (OpInfo->Flags & AML_NSNODE)))
{
if (Op->Asl.Parent->Asl.AmlOpcode == AML_WHILE_OP)
{
AslError (ASL_ERROR, ASL_MSG_NAMED_OBJECT_IN_WHILE, Op, NULL);
}
}
#endif
 
/*
* Special case for control opcodes IF/RETURN/WHILE since they
* have no runtime arg list (at this time)
*/
switch (Op->Asl.AmlOpcode)
{
case AML_IF_OP:
case AML_WHILE_OP:
case AML_RETURN_OP:
 
if (ArgOp->Asl.ParseOpcode == PARSEOP_METHODCALL)
{
/* Check for an internal method */
 
if (AnIsInternalMethod (ArgOp))
{
return (AE_OK);
}
 
/* The lone arg is a method call, check it */
 
RequiredBtypes = AnMapArgTypeToBtype (ARGI_INTEGER);
if (Op->Asl.AmlOpcode == AML_RETURN_OP)
{
RequiredBtypes = 0xFFFFFFFF;
}
 
ThisNodeBtype = AnGetBtype (ArgOp);
if (ThisNodeBtype == ACPI_UINT32_MAX)
{
return (AE_OK);
}
AnCheckMethodReturnValue (Op, OpInfo, ArgOp,
RequiredBtypes, ThisNodeBtype);
}
return (AE_OK);
 
default:
break;
}
 
/* Ignore the non-executable opcodes */
 
if (RuntimeArgTypes == ARGI_INVALID_OPCODE)
{
return (AE_OK);
}
 
switch (OpcodeClass)
{
case AML_CLASS_EXECUTE:
case AML_CLASS_CREATE:
case AML_CLASS_CONTROL:
case AML_CLASS_RETURN_VALUE:
 
/* TBD: Change class or fix typechecking for these */
 
if ((Op->Asl.AmlOpcode == AML_BUFFER_OP) ||
(Op->Asl.AmlOpcode == AML_PACKAGE_OP) ||
(Op->Asl.AmlOpcode == AML_VAR_PACKAGE_OP))
{
break;
}
 
/* Reverse the runtime argument list */
 
RuntimeArgTypes2 = 0;
while ((ArgType = GET_CURRENT_ARG_TYPE (RuntimeArgTypes)))
{
RuntimeArgTypes2 <<= ARG_TYPE_WIDTH;
RuntimeArgTypes2 |= ArgType;
INCREMENT_ARG_LIST (RuntimeArgTypes);
}
 
while ((ArgType = GET_CURRENT_ARG_TYPE (RuntimeArgTypes2)))
{
RequiredBtypes = AnMapArgTypeToBtype (ArgType);
 
ThisNodeBtype = AnGetBtype (ArgOp);
if (ThisNodeBtype == ACPI_UINT32_MAX)
{
goto NextArgument;
}
 
/* Examine the arg based on the required type of the arg */
 
switch (ArgType)
{
case ARGI_TARGETREF:
 
if (ArgOp->Asl.ParseOpcode == PARSEOP_ZERO)
{
/* ZERO is the placeholder for "don't store result" */
 
ThisNodeBtype = RequiredBtypes;
break;
}
 
if (ArgOp->Asl.ParseOpcode == PARSEOP_INTEGER)
{
/*
* This is the case where an original reference to a resource
* descriptor field has been replaced by an (Integer) offset.
* These named fields are supported at compile-time only;
* the names are not passed to the interpreter (via the AML).
*/
if ((ArgOp->Asl.Node->Type == ACPI_TYPE_LOCAL_RESOURCE_FIELD) ||
(ArgOp->Asl.Node->Type == ACPI_TYPE_LOCAL_RESOURCE))
{
AslError (ASL_ERROR, ASL_MSG_RESOURCE_FIELD, ArgOp, NULL);
}
else
{
AslError (ASL_ERROR, ASL_MSG_INVALID_TYPE, ArgOp, NULL);
}
break;
}
 
if ((ArgOp->Asl.ParseOpcode == PARSEOP_METHODCALL) ||
(ArgOp->Asl.ParseOpcode == PARSEOP_DEREFOF))
{
break;
}
 
ThisNodeBtype = RequiredBtypes;
break;
 
 
case ARGI_REFERENCE: /* References */
case ARGI_INTEGER_REF:
case ARGI_OBJECT_REF:
case ARGI_DEVICE_REF:
 
switch (ArgOp->Asl.ParseOpcode)
{
case PARSEOP_LOCAL0:
case PARSEOP_LOCAL1:
case PARSEOP_LOCAL2:
case PARSEOP_LOCAL3:
case PARSEOP_LOCAL4:
case PARSEOP_LOCAL5:
case PARSEOP_LOCAL6:
case PARSEOP_LOCAL7:
 
/* TBD: implement analysis of current value (type) of the local */
/* For now, just treat any local as a typematch */
 
/*ThisNodeBtype = RequiredBtypes;*/
break;
 
case PARSEOP_ARG0:
case PARSEOP_ARG1:
case PARSEOP_ARG2:
case PARSEOP_ARG3:
case PARSEOP_ARG4:
case PARSEOP_ARG5:
case PARSEOP_ARG6:
 
/* Hard to analyze argument types, sow we won't */
/* For now, just treat any arg as a typematch */
 
/* ThisNodeBtype = RequiredBtypes; */
break;
 
case PARSEOP_DEBUG:
break;
 
case PARSEOP_REFOF:
case PARSEOP_INDEX:
default:
break;
 
}
break;
 
case ARGI_INTEGER:
default:
break;
}
 
 
CommonBtypes = ThisNodeBtype & RequiredBtypes;
 
if (ArgOp->Asl.ParseOpcode == PARSEOP_METHODCALL)
{
if (AnIsInternalMethod (ArgOp))
{
return (AE_OK);
}
 
/* Check a method call for a valid return value */
 
AnCheckMethodReturnValue (Op, OpInfo, ArgOp,
RequiredBtypes, ThisNodeBtype);
}
 
/*
* Now check if the actual type(s) match at least one
* bit to the required type
*/
else if (!CommonBtypes)
{
/* No match -- this is a type mismatch error */
 
AnFormatBtype (StringBuffer, ThisNodeBtype);
AnFormatBtype (StringBuffer2, RequiredBtypes);
 
sprintf (MsgBuffer, "[%s] found, %s operator requires [%s]",
StringBuffer, OpInfo->Name, StringBuffer2);
 
AslError (ASL_ERROR, ASL_MSG_INVALID_TYPE, ArgOp, MsgBuffer);
}
 
NextArgument:
ArgOp = ArgOp->Asl.Next;
INCREMENT_ARG_LIST (RuntimeArgTypes2);
}
break;
 
default:
break;
}
 
return (AE_OK);
}
 
 
/*******************************************************************************
*
* FUNCTION: AnOtherSemanticAnalysisWalkBegin
*
* PARAMETERS: ASL_WALK_CALLBACK
*
* RETURN: Status
*
* DESCRIPTION: Descending callback for the analysis walk. Checks for
* miscellaneous issues in the code.
*
******************************************************************************/
 
ACPI_STATUS
AnOtherSemanticAnalysisWalkBegin (
ACPI_PARSE_OBJECT *Op,
UINT32 Level,
void *Context)
{
ACPI_PARSE_OBJECT *ArgNode;
ACPI_PARSE_OBJECT *PrevArgNode = NULL;
const ACPI_OPCODE_INFO *OpInfo;
 
 
OpInfo = AcpiPsGetOpcodeInfo (Op->Asl.AmlOpcode);
 
/*
* Determine if an execution class operator actually does something by
* checking if it has a target and/or the function return value is used.
* (Target is optional, so a standalone statement can actually do nothing.)
*/
if ((OpInfo->Class == AML_CLASS_EXECUTE) &&
(OpInfo->Flags & AML_HAS_RETVAL) &&
(!AnIsResultUsed (Op)))
{
if (OpInfo->Flags & AML_HAS_TARGET)
{
/*
* Find the target node, it is always the last child. If the traget
* is not specified in the ASL, a default node of type Zero was
* created by the parser.
*/
ArgNode = Op->Asl.Child;
while (ArgNode->Asl.Next)
{
PrevArgNode = ArgNode;
ArgNode = ArgNode->Asl.Next;
}
 
/* Divide() is the only weird case, it has two targets */
 
if (Op->Asl.AmlOpcode == AML_DIVIDE_OP)
{
if ((ArgNode->Asl.ParseOpcode == PARSEOP_ZERO) &&
(PrevArgNode) &&
(PrevArgNode->Asl.ParseOpcode == PARSEOP_ZERO))
{
AslError (ASL_WARNING, ASL_MSG_RESULT_NOT_USED,
Op, Op->Asl.ExternalName);
}
}
else if (ArgNode->Asl.ParseOpcode == PARSEOP_ZERO)
{
AslError (ASL_WARNING, ASL_MSG_RESULT_NOT_USED,
Op, Op->Asl.ExternalName);
}
}
else
{
/*
* Has no target and the result is not used. Only a couple opcodes
* can have this combination.
*/
switch (Op->Asl.ParseOpcode)
{
case PARSEOP_ACQUIRE:
case PARSEOP_WAIT:
case PARSEOP_LOADTABLE:
break;
 
default:
AslError (ASL_WARNING, ASL_MSG_RESULT_NOT_USED,
Op, Op->Asl.ExternalName);
break;
}
}
}
 
 
/*
* Semantic checks for individual ASL operators
*/
switch (Op->Asl.ParseOpcode)
{
case PARSEOP_ACQUIRE:
case PARSEOP_WAIT:
/*
* Emit a warning if the timeout parameter for these operators is not
* ACPI_WAIT_FOREVER, and the result value from the operator is not
* checked, meaning that a timeout could happen, but the code
* would not know about it.
*/
 
/* First child is the namepath, 2nd child is timeout */
 
ArgNode = Op->Asl.Child;
ArgNode = ArgNode->Asl.Next;
 
/*
* Check for the WAIT_FOREVER case - defined by the ACPI spec to be
* 0xFFFF or greater
*/
if (((ArgNode->Asl.ParseOpcode == PARSEOP_WORDCONST) ||
(ArgNode->Asl.ParseOpcode == PARSEOP_INTEGER)) &&
(ArgNode->Asl.Value.Integer >= (UINT64) ACPI_WAIT_FOREVER))
{
break;
}
 
/*
* The operation could timeout. If the return value is not used
* (indicates timeout occurred), issue a warning
*/
if (!AnIsResultUsed (Op))
{
AslError (ASL_WARNING, ASL_MSG_TIMEOUT, ArgNode,
Op->Asl.ExternalName);
}
break;
 
case PARSEOP_CREATEFIELD:
/*
* Check for a zero Length (NumBits) operand. NumBits is the 3rd operand
*/
ArgNode = Op->Asl.Child;
ArgNode = ArgNode->Asl.Next;
ArgNode = ArgNode->Asl.Next;
 
if ((ArgNode->Asl.ParseOpcode == PARSEOP_ZERO) ||
((ArgNode->Asl.ParseOpcode == PARSEOP_INTEGER) &&
(ArgNode->Asl.Value.Integer == 0)))
{
AslError (ASL_ERROR, ASL_MSG_NON_ZERO, ArgNode, NULL);
}
break;
 
default:
break;
}
 
return (AE_OK);
}
/drivers/devman/acpica/compiler/dtcompile.c
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
 
/* Local prototypes */
 
static void
static ACPI_STATUS
DtInitialize (
void);
 
166,7 → 166,12
 
/* 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
/* 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
 
DtError (ASL_ERROR, ASL_MSG_SYNTAX, NULL,
"Could not compile input file");
 
goto CleanupAndExit;
}
 
219,6 → 227,7
 
DtOutputBinary (Gbl_RootTable);
LsDoHexOutput ();
DtWriteTableToListing ();
 
CleanupAndExit:
 
233,7 → 242,7
*
* PARAMETERS: None
*
* RETURN: None
* RETURN: Status
*
* DESCRIPTION: Initialize data table compiler globals. Enables multiple
* compiles per invocation.
240,16 → 249,31
*
*****************************************************************************/
 
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
Next = Next->Next;
}
 
Next->Value = CompilerCreatorId;
Next->Value = ASL_CREATOR_ID;
Next->Flags = DT_FIELD_NOT_ALLOCATED;
 
Next = Next->Next;
325,10 → 349,12
 
/* 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
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
 
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
return (AE_ERROR);
}
 
Out:
/* Set the final table length and then the checksum */
 
DtSetTableLength ();
459,7 → 483,6
UINT8 FieldType;
UINT8 *Buffer;
UINT8 *FlagBuffer = NULL;
UINT32 FlagBitPosition = 0;
ACPI_STATUS Status;
 
 
469,9 → 492,17
}
 
Length = DtGetSubtableLength (*Field, Info);
if (Length == ASL_EOF)
{
return (AE_ERROR);
}
 
Subtable = UtLocalCalloc (sizeof (DT_SUBTABLE));
 
if (Length > 0)
{
Subtable->Buffer = UtLocalCalloc (Length);
}
Subtable->Length = Length;
Subtable->TotalLength = Length;
Buffer = Subtable->Buffer;
492,30 → 523,12
goto Error;
}
 
/* Does input field name match what is expected? */
/* Maintain table offsets */
 
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;
}
}
LocalField->TableOffset = Gbl_CurrentTableOffset;
FieldLength = DtGetFieldLength (LocalField, Info);
Gbl_CurrentTableOffset += FieldLength;
 
FieldLength = DtGetFieldLength (LocalField, Info);
FieldType = DtGetFieldType (Info);
Gbl_InputFieldCount++;
 
530,7 → 543,6
LocalField = LocalField->Next;
*Field = LocalField;
 
FlagBitPosition = 0;
FlagBuffer = Buffer;
break;
 
540,8 → 552,7
 
if (FlagBuffer)
{
FlagBitPosition = DtCompileFlag (FlagBuffer,
LocalField, Info, FlagBitPosition);
DtCompileFlag (FlagBuffer, LocalField, Info);
}
else
{
557,7 → 568,6
* 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,6 → 586,8
goto Error;
}
 
DtSetSubtableLength (InlineSubtable);
 
ACPI_MEMCPY (Buffer, InlineSubtable->Buffer, FieldLength);
ACPI_FREE (InlineSubtable->Buffer);
ACPI_FREE (InlineSubtable);
582,6 → 594,12
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.) */
588,6 → 606,8
 
DtCompileOneField (Buffer, LocalField,
FieldLength, FieldType, Info->Flags);
 
DtWriteFieldToListing (Buffer, LocalField, FieldLength);
LocalField = LocalField->Next;
 
if (Info->Flags & DT_LENGTH)
597,6 → 617,7
Subtable->LengthField = Buffer;
Subtable->SizeOfLengthField = FieldLength;
}
 
break;
}
 
/drivers/devman/acpica/compiler/dtcompiler.h
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,7 → 206,15
 
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 */
 
ACPI_STATUS
221,7 → 235,17
DtOutputBinary (
DT_SUBTABLE *RootTable);
 
void
DtWriteFieldToListing (
UINT8 *Buffer,
DT_FIELD *Field,
UINT32 Length);
 
void
DtWriteTableToListing (
void);
 
 
/* dtsubtable - compile subtables */
 
void
266,6 → 290,28
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,14 → 336,32
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 */
 
typedef
344,8 → 408,7
 
char*
DtGetFieldValue (
DT_FIELD *Field,
char *Name);
DT_FIELD *Field);
 
UINT8
DtGetFieldType (
432,6 → 495,10
void **PFieldList);
 
ACPI_STATUS
DtCompileSlic (
void **PFieldList);
 
ACPI_STATUS
DtCompileSlit (
void **PFieldList);
 
440,6 → 507,10
void **PFieldList);
 
ACPI_STATUS
DtCompileUefi (
void **PFieldList);
 
ACPI_STATUS
DtCompileWdat (
void **PFieldList);
 
447,9 → 518,46
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
/drivers/devman/acpica/compiler/dtexpress.c
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);
}
/drivers/devman/acpica/compiler/dtfield.c
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,18 → 130,24
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);
 
 
/******************************************************************************
*
* FUNCTION: DtCompileOneField
165,6 → 171,7
UINT8 Type,
UINT8 Flags)
{
ACPI_STATUS Status;
 
switch (Type)
{
176,14 → 183,26
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:
DtFatal (ASL_MSG_COMPILER_INTERNAL, Field, "Invalid field type");
break;
225,9 → 244,6
Length = ByteLength;
}
 
/* If input string is shorter than ByteLength, pad with blanks */
 
ACPI_MEMSET (Buffer, 0x20, ByteLength);
ACPI_MEMCPY (Buffer, Field->Value, Length);
}
 
234,15 → 250,100
 
/******************************************************************************
*
* 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
*
* 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
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,24 → 368,14
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";
return;
}
else if (Status == AE_BAD_CHARACTER)
{
Message = "Invalid character in constant";
}
 
DtError (ASL_ERROR, ASL_MSG_INVALID_HEX_INTEGER, Field, Message);
goto Exit;
}
 
/* Ensure that reserved fields are set to zero */
/* TBD: should we set to zero, or just make this an ERROR? */
/* TBD: Probably better to use a flag */
317,29 → 405,10
 
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,36 → 416,71
 
/******************************************************************************
*
* 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);
}
 
 
/******************************************************************************
*
* FUNCTION: DtCompileBuffer
407,14 → 511,18
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 */
 
Value = 0;
426,9 → 534,9
}
 
Buffer[i] = (UINT8) Value;
StringValue += 3;
}
 
ACPI_FREE (StringValue);
return (ByteLength - Count);
}
 
435,61 → 543,27
 
/******************************************************************************
*
* 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
*
* 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
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
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);
}
/drivers/devman/acpica/compiler/dtio.c
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,35 → 122,53
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;
 
 
/******************************************************************************
*
* FUNCTION: DtTrim
283,13 → 301,13
* 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
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
 
if (Start == Colon)
{
MYDEBUG ("ERROR: right bracket reaches colon position\n");
break;
}
 
367,7 → 392,6
ACPI_FREE (TmpName);
 
Start = End = (Colon + 1);
 
while (*End)
{
/* Found left quotation, go to the right quotation and break */
375,8 → 399,15
if (*End == '"')
{
End++;
while (*End && *End != '"')
 
/* Check for an explicit null string */
 
if (*End == '"')
{
IsNullString = TRUE;
}
while (*End && (*End != '"'))
{
End++;
}
 
384,23 → 415,32
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,11 → 452,266
 
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);
}
 
 
/******************************************************************************
*
* FUNCTION: DtScanFile
*
* PARAMETERS: Handle - Open file handle for the source file
423,7 → 718,7
*
* 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,25 → 727,60
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
* Output functions
*/
 
 
/******************************************************************************
*
* FUNCTION: DtWriteBinary
510,3 → 839,197
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);
}
/drivers/devman/acpica/compiler/dtparser.l
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);
}
/drivers/devman/acpica/compiler/dtparser.y
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);
}
/drivers/devman/acpica/compiler/dtsubtable.c
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,6 → 360,8
ACPI_DMTABLE_INFO *Info)
{
UINT32 ByteLength = 0;
UINT8 Step;
UINT8 i;
 
 
/* Walk entire Info table; Null name terminates */
366,13 → 368,53
 
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);
}
 
 
/******************************************************************************
*
* FUNCTION: DtSetSubtableLength
/drivers/devman/acpica/compiler/dttable.c
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
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
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
}
 
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);
1196,6 → 1206,75
 
/******************************************************************************
*
* 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
*
* PARAMETERS: List - Current field list pointer
1217,7 → 1296,6
DT_FIELD *FieldList;
UINT32 Localities;
UINT8 *LocalityBuffer;
UINT32 RemainingData;
 
 
Status = DtCompileTable (PFieldList, AcpiDmTableInfoSlit,
1233,22 → 1311,17
Localities = *ACPI_CAST_PTR (UINT32, Subtable->Buffer);
LocalityBuffer = UtLocalCalloc (Localities);
 
/* Compile each locality buffer */
 
FieldList = *PFieldList;
while (FieldList)
{
/* Handle multiple-line buffer */
DtCompileBuffer (LocalityBuffer,
FieldList->Value, FieldList, Localities);
 
RemainingData = Localities;
while (RemainingData && FieldList)
{
RemainingData = DtCompileBuffer (
LocalityBuffer + (Localities - RemainingData),
FieldList->Value, FieldList, RemainingData);
FieldList = FieldList->Next;
}
 
DtCreateSubtable (LocalityBuffer, Localities, &Subtable);
DtInsertSubtable (ParentTable, Subtable);
FieldList = FieldList->Next;
}
 
ACPI_FREE (LocalityBuffer);
1340,6 → 1413,102
 
/******************************************************************************
*
* 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
*
* PARAMETERS: List - Current field list pointer
1397,3 → 1566,78
 
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);
}
/drivers/devman/acpica/compiler/dttemplate.c
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);
}
/drivers/devman/acpica/compiler/dttemplate.h
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
/drivers/devman/acpica/compiler/dtutils.c
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
 
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
* FUNCTION: DtGetFieldValue
*
* PARAMETERS: Field - Current field list pointer
* Name - Field name
*
* RETURN: Field value
*
398,26 → 405,17
 
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);
return (NULL);
}
 
Field = Field->Next;
return (Field->Value);
}
 
return (NULL);
}
 
 
/******************************************************************************
*
* FUNCTION: DtGetFieldType
471,19 → 469,34
break;
 
case ACPI_DMT_BUFFER:
case ACPI_DMT_BUF7:
case ACPI_DMT_BUF16:
case ACPI_DMT_BUF128:
case ACPI_DMT_PCI_PATH:
Type = DT_FIELD_TYPE_BUFFER;
break;
 
case ACPI_DMT_PCI_PATH:
Type = DT_FIELD_TYPE_PCI_PATH;
break;
 
case ACPI_DMT_GAS:
case ACPI_DMT_HESTNTFY:
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,7 → 549,7
*
* FUNCTION: DtGetFieldLength
*
* PARAMETERS: Field - Current field list pointer
* PARAMETERS: Field - Current field
* Info - Data table info
*
* RETURN: Field length
543,6 → 556,8
*
* DESCRIPTION: Get length of bytes needed to compile the field
*
* Note: This function must remain in sync with AcpiDmDumpTable.
*
*****************************************************************************/
 
UINT32
568,6 → 583,7
case ACPI_DMT_FLAG7:
case ACPI_DMT_FLAGS0:
case ACPI_DMT_FLAGS2:
case ACPI_DMT_LABEL:
ByteLength = 0;
break;
 
574,12 → 590,17
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
 
case ACPI_DMT_UINT32:
case ACPI_DMT_NAME4:
case ACPI_DMT_SLIC:
case ACPI_DMT_SIG:
ByteLength = 4;
break;
605,6 → 627,7
break;
 
case ACPI_DMT_UINT56:
case ACPI_DMT_BUF7:
ByteLength = 7;
break;
 
614,11 → 637,18
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
break;
 
case ACPI_DMT_BUFFER:
Value = DtGetFieldValue (Field, Info->Name);
Value = DtGetFieldValue (Field);
if (Value)
{
ByteLength = DtGetBufferLength (Value);
640,16 → 670,30
 
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
ChildTable = DtGetNextSubtable (ParentTable, ChildTable);
if (ChildTable)
{
if (ChildTable->LengthField)
{
DtSetSubtableLength (ChildTable);
}
 
if (ChildTable->Child)
{
ParentTable = ChildTable;
/drivers/devman/acpica/debugger/dbcmds.c
1,6 → 1,6
/*******************************************************************************
*
* Module Name: dbcmds - debug commands and output routines
* Module Name: dbcmds - Miscellaneous debug commands and output routines
*
******************************************************************************/
 
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
116,14 → 116,10
 
#include "acpi.h"
#include "accommon.h"
#include "acdispat.h"
#include "acnamesp.h"
#include "acevents.h"
#include "acdebug.h"
#include "acresrc.h"
#include "acdisasm.h"
#include "actables.h"
#include "acparser.h"
 
#ifdef ACPI_DEBUGGER
 
133,38 → 129,6
 
/* Local prototypes */
 
static ACPI_STATUS
AcpiDbIntegrityWalk (
ACPI_HANDLE ObjHandle,
UINT32 NestingLevel,
void *Context,
void **ReturnValue);
 
static ACPI_STATUS
AcpiDbWalkAndMatchName (
ACPI_HANDLE ObjHandle,
UINT32 NestingLevel,
void *Context,
void **ReturnValue);
 
static ACPI_STATUS
AcpiDbWalkForReferences (
ACPI_HANDLE ObjHandle,
UINT32 NestingLevel,
void *Context,
void **ReturnValue);
 
static ACPI_STATUS
AcpiDbWalkForSpecificObjects (
ACPI_HANDLE ObjHandle,
UINT32 NestingLevel,
void *Context,
void **ReturnValue);
 
static ACPI_NAMESPACE_NODE *
AcpiDbConvertToNode (
char *InString);
 
static void
AcpiDmCompareAmlResources (
UINT8 *Aml1Buffer,
178,38 → 142,6
char *Name);
 
 
/*
* Arguments for the Objects command
* These object types map directly to the ACPI_TYPES
*/
static ARGUMENT_INFO AcpiDbObjectTypes [] =
{
{"ANY"},
{"INTEGERS"},
{"STRINGS"},
{"BUFFERS"},
{"PACKAGES"},
{"FIELDS"},
{"DEVICES"},
{"EVENTS"},
{"METHODS"},
{"MUTEXES"},
{"REGIONS"},
{"POWERRESOURCES"},
{"PROCESSORS"},
{"THERMALZONES"},
{"BUFFERFIELDS"},
{"DDBHANDLES"},
{"DEBUG"},
{"REGIONFIELDS"},
{"BANKFIELDS"},
{"INDEXFIELDS"},
{"REFERENCES"},
{"ALIAS"},
{NULL} /* Must be null terminated */
};
 
 
/*******************************************************************************
*
* FUNCTION: AcpiDbConvertToNode
223,7 → 155,7
*
******************************************************************************/
 
static ACPI_NAMESPACE_NODE *
ACPI_NAMESPACE_NODE *
AcpiDbConvertToNode (
char *InString)
{
310,321 → 242,8
return (Status);
}
 
 
/*******************************************************************************
*
* FUNCTION: AcpiDbWalkForReferences
*
* PARAMETERS: Callback from WalkNamespace
*
* RETURN: Status
*
* DESCRIPTION: Check if this namespace object refers to the target object
* that is passed in as the context value.
*
* Note: Currently doesn't check subobjects within the Node's object
*
******************************************************************************/
 
static ACPI_STATUS
AcpiDbWalkForReferences (
ACPI_HANDLE ObjHandle,
UINT32 NestingLevel,
void *Context,
void **ReturnValue)
{
ACPI_OPERAND_OBJECT *ObjDesc = (ACPI_OPERAND_OBJECT *) Context;
ACPI_NAMESPACE_NODE *Node = (ACPI_NAMESPACE_NODE *) ObjHandle;
 
 
/* Check for match against the namespace node itself */
 
if (Node == (void *) ObjDesc)
{
AcpiOsPrintf ("Object is a Node [%4.4s]\n",
AcpiUtGetNodeName (Node));
}
 
/* Check for match against the object attached to the node */
 
if (AcpiNsGetAttachedObject (Node) == ObjDesc)
{
AcpiOsPrintf ("Reference at Node->Object %p [%4.4s]\n",
Node, AcpiUtGetNodeName (Node));
}
 
return (AE_OK);
}
 
 
/*******************************************************************************
*
* FUNCTION: AcpiDbFindReferences
*
* PARAMETERS: ObjectArg - String with hex value of the object
*
* RETURN: None
*
* DESCRIPTION: Search namespace for all references to the input object
*
******************************************************************************/
 
void
AcpiDbFindReferences (
char *ObjectArg)
{
ACPI_OPERAND_OBJECT *ObjDesc;
 
 
/* Convert string to object pointer */
 
ObjDesc = ACPI_TO_POINTER (ACPI_STRTOUL (ObjectArg, NULL, 16));
 
/* Search all nodes in namespace */
 
(void) AcpiWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT, ACPI_UINT32_MAX,
AcpiDbWalkForReferences, NULL, (void *) ObjDesc, NULL);
}
 
 
/*******************************************************************************
*
* FUNCTION: AcpiDbWalkForPredefinedNames
*
* PARAMETERS: Callback from WalkNamespace
*
* RETURN: Status
*
* DESCRIPTION: Detect and display predefined ACPI names (names that start with
* an underscore)
*
******************************************************************************/
 
static ACPI_STATUS
AcpiDbWalkForPredefinedNames (
ACPI_HANDLE ObjHandle,
UINT32 NestingLevel,
void *Context,
void **ReturnValue)
{
ACPI_NAMESPACE_NODE *Node = (ACPI_NAMESPACE_NODE *) ObjHandle;
UINT32 *Count = (UINT32 *) Context;
const ACPI_PREDEFINED_INFO *Predefined;
const ACPI_PREDEFINED_INFO *Package = NULL;
char *Pathname;
 
 
Predefined = AcpiNsCheckForPredefinedName (Node);
if (!Predefined)
{
return (AE_OK);
}
 
Pathname = AcpiNsGetExternalPathname (Node);
if (!Pathname)
{
return (AE_OK);
}
 
/* If method returns a package, the info is in the next table entry */
 
if (Predefined->Info.ExpectedBtypes & ACPI_BTYPE_PACKAGE)
{
Package = Predefined + 1;
}
 
AcpiOsPrintf ("%-32s arg %X ret %2.2X", Pathname,
Predefined->Info.ParamCount, Predefined->Info.ExpectedBtypes);
 
if (Package)
{
AcpiOsPrintf (" PkgType %2.2X ObjType %2.2X Count %2.2X",
Package->RetInfo.Type, Package->RetInfo.ObjectType1,
Package->RetInfo.Count1);
}
 
AcpiOsPrintf("\n");
 
AcpiNsCheckParameterCount (Pathname, Node, ACPI_UINT32_MAX, Predefined);
ACPI_FREE (Pathname);
(*Count)++;
 
return (AE_OK);
}
 
 
/*******************************************************************************
*
* FUNCTION: AcpiDbCheckPredefinedNames
*
* PARAMETERS: None
*
* RETURN: None
*
* DESCRIPTION: Validate all predefined names in the namespace
*
******************************************************************************/
 
void
AcpiDbCheckPredefinedNames (
void)
{
UINT32 Count = 0;
 
 
/* Search all nodes in namespace */
 
(void) AcpiWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT, ACPI_UINT32_MAX,
AcpiDbWalkForPredefinedNames, NULL, (void *) &Count, NULL);
 
AcpiOsPrintf ("Found %u predefined names in the namespace\n", Count);
}
 
 
/*******************************************************************************
*
* 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);
}
 
 
/*******************************************************************************
*
* FUNCTION: AcpiDbDisplayLocks
*
* PARAMETERS: None
763,282 → 382,6
 
/*******************************************************************************
*
* 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: 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: AcpiDbDumpNamespace
*
* PARAMETERS: StartArg - Node to begin namespace dump
* DepthArg - Maximum tree depth to be dumped
*
* RETURN: None
*
* DESCRIPTION: Dump entire namespace or a subtree. Each node is displayed
* with type and other information.
*
******************************************************************************/
 
void
AcpiDbDumpNamespace (
char *StartArg,
char *DepthArg)
{
ACPI_HANDLE SubtreeEntry = AcpiGbl_RootNode;
UINT32 MaxDepth = ACPI_UINT32_MAX;
 
 
/* No argument given, just start at the root and dump entire namespace */
 
if (StartArg)
{
SubtreeEntry = AcpiDbConvertToNode (StartArg);
if (!SubtreeEntry)
{
return;
}
 
/* Now we can check for the depth argument */
 
if (DepthArg)
{
MaxDepth = ACPI_STRTOUL (DepthArg, NULL, 0);
}
}
 
AcpiDbSetOutputDestination (ACPI_DB_DUPLICATE_OUTPUT);
AcpiOsPrintf ("ACPI Namespace (from %4.4s (%p) subtree):\n",
((ACPI_NAMESPACE_NODE *) SubtreeEntry)->Name.Ascii, SubtreeEntry);
 
/* Display the subtree */
 
AcpiDbSetOutputDestination (ACPI_DB_REDIRECTABLE_OUTPUT);
AcpiNsDumpObjects (ACPI_TYPE_ANY, ACPI_DISPLAY_SUMMARY, MaxDepth,
ACPI_OWNER_ID_MAX, SubtreeEntry);
AcpiDbSetOutputDestination (ACPI_DB_CONSOLE_OUTPUT);
}
 
 
/*******************************************************************************
*
* FUNCTION: AcpiDbDumpNamespaceByOwner
*
* PARAMETERS: OwnerArg - Owner ID whose nodes will be displayed
* DepthArg - Maximum tree depth to be dumped
*
* RETURN: None
*
* DESCRIPTION: Dump elements of the namespace that are owned by the OwnerId.
*
******************************************************************************/
 
void
AcpiDbDumpNamespaceByOwner (
char *OwnerArg,
char *DepthArg)
{
ACPI_HANDLE SubtreeEntry = AcpiGbl_RootNode;
UINT32 MaxDepth = ACPI_UINT32_MAX;
ACPI_OWNER_ID OwnerId;
 
 
OwnerId = (ACPI_OWNER_ID) ACPI_STRTOUL (OwnerArg, NULL, 0);
 
/* Now we can check for the depth argument */
 
if (DepthArg)
{
MaxDepth = ACPI_STRTOUL (DepthArg, NULL, 0);
}
 
AcpiDbSetOutputDestination (ACPI_DB_DUPLICATE_OUTPUT);
AcpiOsPrintf ("ACPI Namespace by owner %X:\n", OwnerId);
 
/* Display the subtree */
 
AcpiDbSetOutputDestination (ACPI_DB_REDIRECTABLE_OUTPUT);
AcpiNsDumpObjects (ACPI_TYPE_ANY, ACPI_DISPLAY_SUMMARY, MaxDepth, OwnerId,
SubtreeEntry);
AcpiDbSetOutputDestination (ACPI_DB_CONSOLE_OUTPUT);
}
 
 
/*******************************************************************************
*
* FUNCTION: AcpiDbSendNotify
*
* PARAMETERS: Name - Name of ACPI object to send the notify to
1093,421 → 436,93
 
/*******************************************************************************
*
* FUNCTION: AcpiDbSetMethodData
* FUNCTION: AcpiDbDisplayInterfaces
*
* PARAMETERS: TypeArg - L for local, A for argument
* IndexArg - which one
* ValueArg - Value to set.
* PARAMETERS: ActionArg - Null, "install", or "remove"
* InterfaceNameArg - Name for install/remove options
*
* RETURN: None
*
* DESCRIPTION: Set a local or argument for the running control method.
* NOTE: only object supported is Number.
* DESCRIPTION: Display or modify the global _OSI interface list
*
******************************************************************************/
 
void
AcpiDbSetMethodData (
char *TypeArg,
char *IndexArg,
char *ValueArg)
AcpiDbDisplayInterfaces (
char *ActionArg,
char *InterfaceNameArg)
{
char Type;
UINT32 Index;
UINT32 Value;
ACPI_WALK_STATE *WalkState;
ACPI_OPERAND_OBJECT *ObjDesc;
ACPI_INTERFACE_INFO *NextInterface;
char *SubString;
ACPI_STATUS Status;
ACPI_NAMESPACE_NODE *Node;
 
 
/* Validate TypeArg */
/* If no arguments, just display current interface list */
 
AcpiUtStrupr (TypeArg);
Type = TypeArg[0];
if ((Type != 'L') &&
(Type != 'A') &&
(Type != 'N'))
if (!ActionArg)
{
AcpiOsPrintf ("Invalid SET operand: %s\n", TypeArg);
return;
}
(void) AcpiOsAcquireMutex (AcpiGbl_OsiMutex,
ACPI_WAIT_FOREVER);
 
Value = ACPI_STRTOUL (ValueArg, NULL, 16);
NextInterface = AcpiGbl_SupportedInterfaces;
 
if (Type == 'N')
while (NextInterface)
{
Node = AcpiDbConvertToNode (IndexArg);
if (Node->Type != ACPI_TYPE_INTEGER)
if (!(NextInterface->Flags & ACPI_OSI_INVALID))
{
AcpiOsPrintf ("Can only set Integer nodes\n");
return;
AcpiOsPrintf ("%s\n", NextInterface->Name);
}
ObjDesc = Node->Object;
ObjDesc->Integer.Value = Value;
return;
NextInterface = NextInterface->Next;
}
 
/* 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");
AcpiOsReleaseMutex (AcpiGbl_OsiMutex);
return;
}
 
/* Create and initialize the new object */
/* If ActionArg exists, so must InterfaceNameArg */
 
ObjDesc = AcpiUtCreateIntegerObject ((UINT64) Value);
if (!ObjDesc)
if (!InterfaceNameArg)
{
AcpiOsPrintf ("Could not create an internal object\n");
AcpiOsPrintf ("Missing Interface Name argument\n");
return;
}
 
/* Store the new object into the target */
/* Uppercase the action for match below */
 
switch (Type)
{
case 'A':
AcpiUtStrupr (ActionArg);
 
/* Set a method argument */
/* Install - install an interface */
 
if (Index > ACPI_METHOD_MAX_ARG)
SubString = ACPI_STRSTR ("INSTALL", ActionArg);
if (SubString)
{
AcpiOsPrintf ("Arg%u - Invalid argument name\n", Index);
goto Cleanup;
}
 
Status = AcpiDsStoreObjectToLocal (ACPI_REFCLASS_ARG, Index, ObjDesc,
WalkState);
Status = AcpiInstallInterface (InterfaceNameArg);
if (ACPI_FAILURE (Status))
{
goto Cleanup;
AcpiOsPrintf ("%s, while installing \"%s\"\n",
AcpiFormatException (Status), InterfaceNameArg);
}
 
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;
return;
}
 
Status = AcpiDsStoreObjectToLocal (ACPI_REFCLASS_LOCAL, Index, ObjDesc,
WalkState);
if (ACPI_FAILURE (Status))
{
goto Cleanup;
}
/* Remove - remove an interface */
 
ObjDesc = WalkState->LocalVariables[Index].Object;
 
AcpiOsPrintf ("Local%u: ", Index);
AcpiDmDisplayInternalObject (ObjDesc, WalkState);
break;
 
default:
break;
}
 
Cleanup:
AcpiUtRemoveReference (ObjDesc);
}
 
 
/*******************************************************************************
*
* FUNCTION: AcpiDbWalkForSpecificObjects
*
* PARAMETERS: Callback from WalkNamespace
*
* RETURN: Status
*
* DESCRIPTION: Display short info about objects in the namespace
*
******************************************************************************/
 
static ACPI_STATUS
AcpiDbWalkForSpecificObjects (
ACPI_HANDLE ObjHandle,
UINT32 NestingLevel,
void *Context,
void **ReturnValue)
SubString = ACPI_STRSTR ("REMOVE", ActionArg);
if (SubString)
{
ACPI_WALK_INFO *Info = (ACPI_WALK_INFO *) Context;
ACPI_BUFFER Buffer;
ACPI_STATUS Status;
 
 
Info->Count++;
 
/* Get and display the full pathname to this object */
 
Buffer.Length = ACPI_ALLOCATE_LOCAL_BUFFER;
Status = AcpiNsHandleToPathname (ObjHandle, &Buffer);
Status = AcpiRemoveInterface (InterfaceNameArg);
if (ACPI_FAILURE (Status))
{
AcpiOsPrintf ("Could Not get pathname for object %p\n", ObjHandle);
return (AE_OK);
AcpiOsPrintf ("%s, while removing \"%s\"\n",
AcpiFormatException (Status), InterfaceNameArg);
}
 
AcpiOsPrintf ("%32s", (char *) Buffer.Pointer);
ACPI_FREE (Buffer.Pointer);
 
/* Dump short info about the object */
 
(void) AcpiNsDumpOneObject (ObjHandle, NestingLevel, Info, NULL);
return (AE_OK);
}
 
 
/*******************************************************************************
*
* FUNCTION: AcpiDbDisplayObjects
*
* PARAMETERS: ObjTypeArg - Type of object to display
* DisplayCountArg - Max depth to display
*
* RETURN: None
*
* DESCRIPTION: Display objects in the namespace of the requested type
*
******************************************************************************/
 
ACPI_STATUS
AcpiDbDisplayObjects (
char *ObjTypeArg,
char *DisplayCountArg)
{
ACPI_WALK_INFO Info;
ACPI_OBJECT_TYPE Type;
 
 
/* Get the object type */
 
Type = AcpiDbMatchArgument (ObjTypeArg, AcpiDbObjectTypes);
if (Type == ACPI_TYPE_NOT_FOUND)
{
AcpiOsPrintf ("Invalid or unsupported argument\n");
return (AE_OK);
}
 
AcpiDbSetOutputDestination (ACPI_DB_DUPLICATE_OUTPUT);
AcpiOsPrintf (
"Objects of type [%s] defined in the current ACPI Namespace:\n",
AcpiUtGetTypeName (Type));
 
AcpiDbSetOutputDestination (ACPI_DB_REDIRECTABLE_OUTPUT);
 
Info.Count = 0;
Info.OwnerId = ACPI_OWNER_ID_MAX;
Info.DebugLevel = ACPI_UINT32_MAX;
Info.DisplayType = ACPI_DISPLAY_SUMMARY | ACPI_DISPLAY_SHORT;
 
/* Walk the namespace from the root */
 
(void) AcpiWalkNamespace (Type, ACPI_ROOT_OBJECT, ACPI_UINT32_MAX,
AcpiDbWalkForSpecificObjects, NULL, (void *) &Info, NULL);
 
AcpiOsPrintf (
"\nFound %u objects of type [%s] in the current ACPI Namespace\n",
Info.Count, AcpiUtGetTypeName (Type));
 
AcpiDbSetOutputDestination (ACPI_DB_CONSOLE_OUTPUT);
return (AE_OK);
}
 
 
/*******************************************************************************
*
* FUNCTION: AcpiDbWalkAndMatchName
*
* PARAMETERS: Callback from WalkNamespace
*
* RETURN: Status
*
* DESCRIPTION: Find a particular name/names within the namespace. Wildcards
* are supported -- '?' matches any character.
*
******************************************************************************/
 
static ACPI_STATUS
AcpiDbWalkAndMatchName (
ACPI_HANDLE ObjHandle,
UINT32 NestingLevel,
void *Context,
void **ReturnValue)
{
ACPI_STATUS Status;
char *RequestedName = (char *) Context;
UINT32 i;
ACPI_BUFFER Buffer;
ACPI_WALK_INFO Info;
 
 
/* Check for a name match */
 
for (i = 0; i < 4; i++)
{
/* Wildcard support */
 
if ((RequestedName[i] != '?') &&
(RequestedName[i] != ((ACPI_NAMESPACE_NODE *) ObjHandle)->Name.Ascii[i]))
{
/* No match, just exit */
 
return (AE_OK);
}
}
 
/* Get the full pathname to this object */
 
Buffer.Length = ACPI_ALLOCATE_LOCAL_BUFFER;
Status = AcpiNsHandleToPathname (ObjHandle, &Buffer);
if (ACPI_FAILURE (Status))
{
AcpiOsPrintf ("Could Not get pathname for object %p\n", ObjHandle);
}
else
{
Info.OwnerId = ACPI_OWNER_ID_MAX;
Info.DebugLevel = ACPI_UINT32_MAX;
Info.DisplayType = ACPI_DISPLAY_SUMMARY | ACPI_DISPLAY_SHORT;
 
AcpiOsPrintf ("%32s", (char *) Buffer.Pointer);
(void) AcpiNsDumpOneObject (ObjHandle, NestingLevel, &Info, NULL);
ACPI_FREE (Buffer.Pointer);
}
 
return (AE_OK);
}
 
 
/*******************************************************************************
*
* FUNCTION: AcpiDbFindNameInNamespace
*
* PARAMETERS: NameArg - The 4-character ACPI name to find.
* wildcards are supported.
*
* RETURN: None
*
* DESCRIPTION: Search the namespace for a given name (with wildcards)
*
******************************************************************************/
 
ACPI_STATUS
AcpiDbFindNameInNamespace (
char *NameArg)
{
char AcpiName[5] = "____";
char *AcpiNamePtr = AcpiName;
 
 
if (ACPI_STRLEN (NameArg) > 4)
{
AcpiOsPrintf ("Name must be no longer than 4 characters\n");
return (AE_OK);
}
 
/* Pad out name with underscores as necessary to create a 4-char name */
 
AcpiUtStrupr (NameArg);
while (*NameArg)
{
*AcpiNamePtr = *NameArg;
AcpiNamePtr++;
NameArg++;
}
 
/* Walk the namespace from the root */
 
(void) AcpiWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT, ACPI_UINT32_MAX,
AcpiDbWalkAndMatchName, NULL, AcpiName, NULL);
 
AcpiDbSetOutputDestination (ACPI_DB_CONSOLE_OUTPUT);
return (AE_OK);
}
 
 
/*******************************************************************************
*
* FUNCTION: AcpiDbSetScope
*
* PARAMETERS: Name - New scope path
*
* RETURN: Status
*
* DESCRIPTION: Set the "current scope" as maintained by this utility.
* The scope is used as a prefix to ACPI paths.
*
******************************************************************************/
 
void
AcpiDbSetScope (
char *Name)
{
ACPI_STATUS Status;
ACPI_NAMESPACE_NODE *Node;
 
 
if (!Name || Name[0] == 0)
{
AcpiOsPrintf ("Current scope: %s\n", AcpiGbl_DbScopeBuf);
return;
}
 
AcpiDbPrepNamestring (Name);
/* Invalid ActionArg */
 
if (Name[0] == '\\')
{
/* Validate new scope from the root */
 
Status = AcpiNsGetNode (AcpiGbl_RootNode, Name, ACPI_NS_NO_UPSEARCH,
&Node);
if (ACPI_FAILURE (Status))
{
goto ErrorExit;
}
 
ACPI_STRCPY (AcpiGbl_DbScopeBuf, Name);
ACPI_STRCAT (AcpiGbl_DbScopeBuf, "\\");
}
else
{
/* Validate new scope relative to old scope */
 
Status = AcpiNsGetNode (AcpiGbl_DbScopeNode, Name, ACPI_NS_NO_UPSEARCH,
&Node);
if (ACPI_FAILURE (Status))
{
goto ErrorExit;
}
 
ACPI_STRCAT (AcpiGbl_DbScopeBuf, Name);
ACPI_STRCAT (AcpiGbl_DbScopeBuf, "\\");
}
 
AcpiGbl_DbScopeNode = Node;
AcpiOsPrintf ("New scope: %s\n", AcpiGbl_DbScopeBuf);
AcpiOsPrintf ("Invalid action argument: %s\n", ActionArg);
return;
 
ErrorExit:
 
AcpiOsPrintf ("Could not attach scope: %s, %s\n",
Name, AcpiFormatException (Status));
}
 
 
1839,112 → 854,6
 
/*******************************************************************************
*
* FUNCTION: AcpiDbIntegrityWalk
*
* PARAMETERS: Callback from WalkNamespace
*
* RETURN: Status
*
* DESCRIPTION: Examine one NS node for valid values.
*
******************************************************************************/
 
static ACPI_STATUS
AcpiDbIntegrityWalk (
ACPI_HANDLE ObjHandle,
UINT32 NestingLevel,
void *Context,
void **ReturnValue)
{
ACPI_INTEGRITY_INFO *Info = (ACPI_INTEGRITY_INFO *) Context;
ACPI_NAMESPACE_NODE *Node = (ACPI_NAMESPACE_NODE *) ObjHandle;
ACPI_OPERAND_OBJECT *Object;
BOOLEAN Alias = TRUE;
 
 
Info->Nodes++;
 
/* Verify the NS node, and dereference aliases */
 
while (Alias)
{
if (ACPI_GET_DESCRIPTOR_TYPE (Node) != ACPI_DESC_TYPE_NAMED)
{
AcpiOsPrintf ("Invalid Descriptor Type for Node %p [%s] - is %2.2X should be %2.2X\n",
Node, AcpiUtGetDescriptorName (Node), ACPI_GET_DESCRIPTOR_TYPE (Node),
ACPI_DESC_TYPE_NAMED);
return (AE_OK);
}
 
if ((Node->Type == ACPI_TYPE_LOCAL_ALIAS) ||
(Node->Type == ACPI_TYPE_LOCAL_METHOD_ALIAS))
{
Node = (ACPI_NAMESPACE_NODE *) Node->Object;
}
else
{
Alias = FALSE;
}
}
 
if (Node->Type > ACPI_TYPE_LOCAL_MAX)
{
AcpiOsPrintf ("Invalid Object Type for Node %p, Type = %X\n",
Node, Node->Type);
return (AE_OK);
}
 
if (!AcpiUtValidAcpiName (Node->Name.Integer))
{
AcpiOsPrintf ("Invalid AcpiName for Node %p\n", Node);
return (AE_OK);
}
 
Object = AcpiNsGetAttachedObject (Node);
if (Object)
{
Info->Objects++;
if (ACPI_GET_DESCRIPTOR_TYPE (Object) != ACPI_DESC_TYPE_OPERAND)
{
AcpiOsPrintf ("Invalid Descriptor Type for Object %p [%s]\n",
Object, AcpiUtGetDescriptorName (Object));
}
}
 
return (AE_OK);
}
 
 
/*******************************************************************************
*
* FUNCTION: AcpiDbCheckIntegrity
*
* PARAMETERS: None
*
* RETURN: None
*
* DESCRIPTION: Check entire namespace for data structure integrity
*
******************************************************************************/
 
void
AcpiDbCheckIntegrity (
void)
{
ACPI_INTEGRITY_INFO Info = {0,0};
 
/* Search all nodes in namespace */
 
(void) AcpiWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT, ACPI_UINT32_MAX,
AcpiDbIntegrityWalk, NULL, (void *) &Info, NULL);
 
AcpiOsPrintf ("Verified %u namespace nodes with %u Objects\n",
Info.Nodes, Info.Objects);
}
 
 
/*******************************************************************************
*
* FUNCTION: AcpiDbGenerateGpe
*
* PARAMETERS: GpeArg - Raw GPE number, ascii string
1979,151 → 888,7
return;
}
 
(void) AcpiEvGpeDispatch (GpeEventInfo, GpeNumber);
(void) AcpiEvGpeDispatch (NULL, GpeEventInfo, GpeNumber);
}
 
 
/*******************************************************************************
*
* FUNCTION: AcpiDbBusWalk
*
* PARAMETERS: Callback from WalkNamespace
*
* RETURN: Status
*
* DESCRIPTION: Display info about device objects that have a corresponding
* _PRT method.
*
******************************************************************************/
 
static ACPI_STATUS
AcpiDbBusWalk (
ACPI_HANDLE ObjHandle,
UINT32 NestingLevel,
void *Context,
void **ReturnValue)
{
ACPI_NAMESPACE_NODE *Node = (ACPI_NAMESPACE_NODE *) ObjHandle;
ACPI_STATUS Status;
ACPI_BUFFER Buffer;
ACPI_NAMESPACE_NODE *TempNode;
ACPI_DEVICE_INFO *Info;
UINT32 i;
 
 
if ((Node->Type != ACPI_TYPE_DEVICE) &&
(Node->Type != ACPI_TYPE_PROCESSOR))
{
return (AE_OK);
}
 
/* Exit if there is no _PRT under this device */
 
Status = AcpiGetHandle (Node, METHOD_NAME__PRT,
ACPI_CAST_PTR (ACPI_HANDLE, &TempNode));
if (ACPI_FAILURE (Status))
{
return (AE_OK);
}
 
/* Get the full path to this device object */
 
Buffer.Length = ACPI_ALLOCATE_LOCAL_BUFFER;
Status = AcpiNsHandleToPathname (ObjHandle, &Buffer);
if (ACPI_FAILURE (Status))
{
AcpiOsPrintf ("Could Not get pathname for object %p\n", ObjHandle);
return (AE_OK);
}
 
Status = AcpiGetObjectInfo (ObjHandle, &Info);
if (ACPI_FAILURE (Status))
{
return (AE_OK);
}
 
/* Display the full path */
 
AcpiOsPrintf ("%-32s Type %X", (char *) Buffer.Pointer, Node->Type);
ACPI_FREE (Buffer.Pointer);
 
if (Info->Flags & ACPI_PCI_ROOT_BRIDGE)
{
AcpiOsPrintf (" - Is PCI Root Bridge");
}
AcpiOsPrintf ("\n");
 
/* _PRT info */
 
AcpiOsPrintf ("_PRT: %p\n", TempNode);
 
/* Dump _ADR, _HID, _UID, _CID */
 
if (Info->Valid & ACPI_VALID_ADR)
{
AcpiOsPrintf ("_ADR: %8.8X%8.8X\n", ACPI_FORMAT_UINT64 (Info->Address));
}
else
{
AcpiOsPrintf ("_ADR: <Not Present>\n");
}
 
if (Info->Valid & ACPI_VALID_HID)
{
AcpiOsPrintf ("_HID: %s\n", Info->HardwareId.String);
}
else
{
AcpiOsPrintf ("_HID: <Not Present>\n");
}
 
if (Info->Valid & ACPI_VALID_UID)
{
AcpiOsPrintf ("_UID: %s\n", Info->UniqueId.String);
}
else
{
AcpiOsPrintf ("_UID: <Not Present>\n");
}
 
if (Info->Valid & ACPI_VALID_CID)
{
for (i = 0; i < Info->CompatibleIdList.Count; i++)
{
AcpiOsPrintf ("_CID: %s\n",
Info->CompatibleIdList.Ids[i].String);
}
}
else
{
AcpiOsPrintf ("_CID: <Not Present>\n");
}
 
ACPI_FREE (Info);
return (AE_OK);
}
 
 
/*******************************************************************************
*
* FUNCTION: AcpiDbGetBusInfo
*
* PARAMETERS: None
*
* RETURN: None
*
* DESCRIPTION: Display info about system busses.
*
******************************************************************************/
 
void
AcpiDbGetBusInfo (
void)
{
/* Search all nodes in namespace */
 
(void) AcpiWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT, ACPI_UINT32_MAX,
AcpiDbBusWalk, NULL, NULL, NULL);
}
 
#endif /* ACPI_DEBUGGER */
/drivers/devman/acpica/debugger/dbdisply.c
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
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
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
}
 
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
 
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
}
}
 
 
/*******************************************************************************
*
* 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 */
 
/drivers/devman/acpica/debugger/dbexec.c
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,6 → 126,7
 
 
static ACPI_DB_METHOD_INFO AcpiGbl_DbMethodInfo;
#define DB_DEFAULT_PKG_ELEMENTS 33
 
/* Local prototypes */
 
153,9 → 154,351
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;
}
}
}
 
 
/*******************************************************************************
*
* FUNCTION: AcpiDbExecuteMethod
*
* PARAMETERS: Info - Valid info segment
176,10 → 519,13
ACPI_OBJECT_LIST ParamObjects;
ACPI_OBJECT Params[ACPI_METHOD_NUM_ARGS];
ACPI_HANDLE Handle;
ACPI_DEVICE_INFO *ObjInfo;
UINT32 i;
ACPI_DEVICE_INFO *ObjInfo;
 
 
ACPI_FUNCTION_TRACE (DbExecuteMethod);
 
 
if (AcpiGbl_DbOutputToFile && !AcpiDbgLevel)
{
AcpiOsPrintf ("Warning: debug output is not enabled!\n");
190,7 → 536,7
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
Status = AcpiGetObjectInfo (Handle, &ObjInfo);
if (ACPI_FAILURE (Status))
{
return (Status);
return_ACPI_STATUS (Status);
}
 
ParamObjects.Pointer = NULL;
208,22 → 554,37
{
/* 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
/* Create additional "default" parameters as needed */
 
if (i < ObjInfo->ParamCount)
{
/* Setup default parameters */
AcpiOsPrintf ("Adding %u arguments containing default values\n",
ObjInfo->ParamCount - i);
 
for (i = 0; i < ObjInfo->ParamCount; i++)
for (; i < ObjInfo->ParamCount; i++)
{
switch (i)
{
247,14 → 608,12
break;
}
}
}
 
ParamObjects.Count = ObjInfo->ParamCount;
ParamObjects.Pointer = Params;
ParamObjects.Count = ObjInfo->ParamCount;
}
}
 
ACPI_FREE (ObjInfo);
 
/* Prepare for a return object of arbitrary size */
 
ReturnObj->Pointer = AcpiGbl_DbBuffer;
269,10 → 628,27
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);
}
 
 
/*******************************************************************************
*
* FUNCTION: AcpiDbExecuteSetup
433,6 → 809,7
AcpiDbExecute (
char *Name,
char **Args,
ACPI_OBJECT_TYPE *Types,
UINT32 Flags)
{
ACPI_STATUS Status;
470,6 → 847,7
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
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
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
/* 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
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);
/drivers/devman/acpica/debugger/dbfileio.c
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
/drivers/devman/acpica/debugger/dbhistry.c
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
/drivers/devman/acpica/debugger/dbinput.c
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
 
static void
AcpiDbDisplayHelp (
char *HelpType);
void);
 
 
/*
176,6 → 171,7
CMD_GO,
CMD_GPE,
CMD_GPES,
CMD_HANDLERS,
CMD_HELP,
CMD_HELP2,
CMD_HISTORY,
194,6 → 190,7
CMD_NOTIFY,
CMD_OBJECT,
CMD_OPEN,
CMD_OSI,
CMD_OWNER,
CMD_PREDEFINED,
CMD_PREFIX,
242,6 → 239,7
{"GO", 0},
{"GPE", 2},
{"GPES", 0},
{"HANDLERS", 0},
{"HELP", 0},
{"?", 0},
{"HISTORY", 0},
260,6 → 258,7
{"NOTIFY", 2},
{"OBJECT", 1},
{"OPEN", 1},
{"OSI", 0},
{"OWNER", 1},
{"PREDEFINED", 0},
{"PREFIX", 0},
286,7 → 285,7
*
* FUNCTION: AcpiDbDisplayHelp
*
* PARAMETERS: HelpType - Subcommand (optional)
* PARAMETERS: None
*
* RETURN: None
*
296,54 → 295,23
 
static void
AcpiDbDisplayHelp (
char *HelpType)
void)
{
 
AcpiUtStrupr (HelpType);
 
/* No parameter, just give the overview */
 
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;
}
 
/*
* 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 ("\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 ("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 (" 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");
351,10 → 319,12
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;
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");
 
case 'N':
AcpiOsPrintf ("\nNamespace Access Commands\n\n");
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");
375,15 → 345,17
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 ("\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");
396,20 → 368,12
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 ("\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");
AcpiOsPrintf ("Load <Input Filename> Load ACPI table from a file\n");
return;
 
default:
AcpiOsPrintf ("Unrecognized Command Class: %s\n", HelpType);
return;
}
}
 
 
/*******************************************************************************
425,12 → 389,15
*
******************************************************************************/
 
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
return (NULL);
}
 
/* Get rid of any spaces at the beginning */
/* Remove any spaces at the beginning */
 
if (*String == ' ')
{
455,8 → 422,90
}
}
 
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 != ' '))
463,6 → 512,8
{
String++;
}
break;
}
 
if (!(*String))
{
474,6 → 525,7
*Next = String + 1;
}
 
*ReturnType = Type;
return (Start);
}
 
506,7 → 558,8
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
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
 
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
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
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
 
/* 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 */
 
/drivers/devman/acpica/debugger/dbmethod.c
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 */
/drivers/devman/acpica/debugger/dbnames.c
0,0 → 1,1006
/*******************************************************************************
*
* Module Name: dbnames - Debugger commands for the acpi namespace
*
******************************************************************************/
 
/******************************************************************************
*
* 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 "acnamesp.h"
#include "acdebug.h"
 
 
#ifdef ACPI_DEBUGGER
 
#define _COMPONENT ACPI_CA_DEBUGGER
ACPI_MODULE_NAME ("dbnames")
 
 
/* Local prototypes */
 
static ACPI_STATUS
AcpiDbWalkAndMatchName (
ACPI_HANDLE ObjHandle,
UINT32 NestingLevel,
void *Context,
void **ReturnValue);
 
static ACPI_STATUS
AcpiDbWalkForPredefinedNames (
ACPI_HANDLE ObjHandle,
UINT32 NestingLevel,
void *Context,
void **ReturnValue);
 
static ACPI_STATUS
AcpiDbWalkForSpecificObjects (
ACPI_HANDLE ObjHandle,
UINT32 NestingLevel,
void *Context,
void **ReturnValue);
 
static ACPI_STATUS
AcpiDbIntegrityWalk (
ACPI_HANDLE ObjHandle,
UINT32 NestingLevel,
void *Context,
void **ReturnValue);
 
static ACPI_STATUS
AcpiDbWalkForReferences (
ACPI_HANDLE ObjHandle,
UINT32 NestingLevel,
void *Context,
void **ReturnValue);
 
static ACPI_STATUS
AcpiDbBusWalk (
ACPI_HANDLE ObjHandle,
UINT32 NestingLevel,
void *Context,
void **ReturnValue);
 
/*
* Arguments for the Objects command
* These object types map directly to the ACPI_TYPES
*/
static ARGUMENT_INFO AcpiDbObjectTypes [] =
{
{"ANY"},
{"INTEGERS"},
{"STRINGS"},
{"BUFFERS"},
{"PACKAGES"},
{"FIELDS"},
{"DEVICES"},
{"EVENTS"},
{"METHODS"},
{"MUTEXES"},
{"REGIONS"},
{"POWERRESOURCES"},
{"PROCESSORS"},
{"THERMALZONES"},
{"BUFFERFIELDS"},
{"DDBHANDLES"},
{"DEBUG"},
{"REGIONFIELDS"},
{"BANKFIELDS"},
{"INDEXFIELDS"},
{"REFERENCES"},
{"ALIAS"},
{NULL} /* Must be null terminated */
};
 
 
/*******************************************************************************
*
* FUNCTION: AcpiDbSetScope
*
* PARAMETERS: Name - New scope path
*
* RETURN: Status
*
* DESCRIPTION: Set the "current scope" as maintained by this utility.
* The scope is used as a prefix to ACPI paths.
*
******************************************************************************/
 
void
AcpiDbSetScope (
char *Name)
{
ACPI_STATUS Status;
ACPI_NAMESPACE_NODE *Node;
 
 
if (!Name || Name[0] == 0)
{
AcpiOsPrintf ("Current scope: %s\n", AcpiGbl_DbScopeBuf);
return;
}
 
AcpiDbPrepNamestring (Name);
 
if (Name[0] == '\\')
{
/* Validate new scope from the root */
 
Status = AcpiNsGetNode (AcpiGbl_RootNode, Name, ACPI_NS_NO_UPSEARCH,
&Node);
if (ACPI_FAILURE (Status))
{
goto ErrorExit;
}
 
ACPI_STRCPY (AcpiGbl_DbScopeBuf, Name);
ACPI_STRCAT (AcpiGbl_DbScopeBuf, "\\");
}
else
{
/* Validate new scope relative to old scope */
 
Status = AcpiNsGetNode (AcpiGbl_DbScopeNode, Name, ACPI_NS_NO_UPSEARCH,
&Node);
if (ACPI_FAILURE (Status))
{
goto ErrorExit;
}
 
ACPI_STRCAT (AcpiGbl_DbScopeBuf, Name);
ACPI_STRCAT (AcpiGbl_DbScopeBuf, "\\");
}
 
AcpiGbl_DbScopeNode = Node;
AcpiOsPrintf ("New scope: %s\n", AcpiGbl_DbScopeBuf);
return;
 
ErrorExit:
 
AcpiOsPrintf ("Could not attach scope: %s, %s\n",
Name, AcpiFormatException (Status));
}
 
 
/*******************************************************************************
*
* FUNCTION: AcpiDbDumpNamespace
*
* PARAMETERS: StartArg - Node to begin namespace dump
* DepthArg - Maximum tree depth to be dumped
*
* RETURN: None
*
* DESCRIPTION: Dump entire namespace or a subtree. Each node is displayed
* with type and other information.
*
******************************************************************************/
 
void
AcpiDbDumpNamespace (
char *StartArg,
char *DepthArg)
{
ACPI_HANDLE SubtreeEntry = AcpiGbl_RootNode;
UINT32 MaxDepth = ACPI_UINT32_MAX;
 
 
/* No argument given, just start at the root and dump entire namespace */
 
if (StartArg)
{
SubtreeEntry = AcpiDbConvertToNode (StartArg);
if (!SubtreeEntry)
{
return;
}
 
/* Now we can check for the depth argument */
 
if (DepthArg)
{
MaxDepth = ACPI_STRTOUL (DepthArg, NULL, 0);
}
}
 
AcpiDbSetOutputDestination (ACPI_DB_DUPLICATE_OUTPUT);
AcpiOsPrintf ("ACPI Namespace (from %4.4s (%p) subtree):\n",
((ACPI_NAMESPACE_NODE *) SubtreeEntry)->Name.Ascii, SubtreeEntry);
 
/* Display the subtree */
 
AcpiDbSetOutputDestination (ACPI_DB_REDIRECTABLE_OUTPUT);
AcpiNsDumpObjects (ACPI_TYPE_ANY, ACPI_DISPLAY_SUMMARY, MaxDepth,
ACPI_OWNER_ID_MAX, SubtreeEntry);
AcpiDbSetOutputDestination (ACPI_DB_CONSOLE_OUTPUT);
}
 
 
/*******************************************************************************
*
* FUNCTION: AcpiDbDumpNamespaceByOwner
*
* PARAMETERS: OwnerArg - Owner ID whose nodes will be displayed
* DepthArg - Maximum tree depth to be dumped
*
* RETURN: None
*
* DESCRIPTION: Dump elements of the namespace that are owned by the OwnerId.
*
******************************************************************************/
 
void
AcpiDbDumpNamespaceByOwner (
char *OwnerArg,
char *DepthArg)
{
ACPI_HANDLE SubtreeEntry = AcpiGbl_RootNode;
UINT32 MaxDepth = ACPI_UINT32_MAX;
ACPI_OWNER_ID OwnerId;
 
 
OwnerId = (ACPI_OWNER_ID) ACPI_STRTOUL (OwnerArg, NULL, 0);
 
/* Now we can check for the depth argument */
 
if (DepthArg)
{
MaxDepth = ACPI_STRTOUL (DepthArg, NULL, 0);
}
 
AcpiDbSetOutputDestination (ACPI_DB_DUPLICATE_OUTPUT);
AcpiOsPrintf ("ACPI Namespace by owner %X:\n", OwnerId);
 
/* Display the subtree */
 
AcpiDbSetOutputDestination (ACPI_DB_REDIRECTABLE_OUTPUT);
AcpiNsDumpObjects (ACPI_TYPE_ANY, ACPI_DISPLAY_SUMMARY, MaxDepth, OwnerId,
SubtreeEntry);
AcpiDbSetOutputDestination (ACPI_DB_CONSOLE_OUTPUT);
}
 
 
/*******************************************************************************
*
* FUNCTION: AcpiDbWalkAndMatchName
*
* PARAMETERS: Callback from WalkNamespace
*
* RETURN: Status
*
* DESCRIPTION: Find a particular name/names within the namespace. Wildcards
* are supported -- '?' matches any character.
*
******************************************************************************/
 
static ACPI_STATUS
AcpiDbWalkAndMatchName (
ACPI_HANDLE ObjHandle,
UINT32 NestingLevel,
void *Context,
void **ReturnValue)
{
ACPI_STATUS Status;
char *RequestedName = (char *) Context;
UINT32 i;
ACPI_BUFFER Buffer;
ACPI_WALK_INFO Info;
 
 
/* Check for a name match */
 
for (i = 0; i < 4; i++)
{
/* Wildcard support */
 
if ((RequestedName[i] != '?') &&
(RequestedName[i] != ((ACPI_NAMESPACE_NODE *) ObjHandle)->Name.Ascii[i]))
{
/* No match, just exit */
 
return (AE_OK);
}
}
 
/* Get the full pathname to this object */
 
Buffer.Length = ACPI_ALLOCATE_LOCAL_BUFFER;
Status = AcpiNsHandleToPathname (ObjHandle, &Buffer);
if (ACPI_FAILURE (Status))
{
AcpiOsPrintf ("Could Not get pathname for object %p\n", ObjHandle);
}
else
{
Info.OwnerId = ACPI_OWNER_ID_MAX;
Info.DebugLevel = ACPI_UINT32_MAX;
Info.DisplayType = ACPI_DISPLAY_SUMMARY | ACPI_DISPLAY_SHORT;
 
AcpiOsPrintf ("%32s", (char *) Buffer.Pointer);
(void) AcpiNsDumpOneObject (ObjHandle, NestingLevel, &Info, NULL);
ACPI_FREE (Buffer.Pointer);
}
 
return (AE_OK);
}
 
 
/*******************************************************************************
*
* FUNCTION: AcpiDbFindNameInNamespace
*
* PARAMETERS: NameArg - The 4-character ACPI name to find.
* wildcards are supported.
*
* RETURN: None
*
* DESCRIPTION: Search the namespace for a given name (with wildcards)
*
******************************************************************************/
 
ACPI_STATUS
AcpiDbFindNameInNamespace (
char *NameArg)
{
char AcpiName[5] = "____";
char *AcpiNamePtr = AcpiName;
 
 
if (ACPI_STRLEN (NameArg) > 4)
{
AcpiOsPrintf ("Name must be no longer than 4 characters\n");
return (AE_OK);
}
 
/* Pad out name with underscores as necessary to create a 4-char name */
 
AcpiUtStrupr (NameArg);
while (*NameArg)
{
*AcpiNamePtr = *NameArg;
AcpiNamePtr++;
NameArg++;
}
 
/* Walk the namespace from the root */
 
(void) AcpiWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT, ACPI_UINT32_MAX,
AcpiDbWalkAndMatchName, NULL, AcpiName, NULL);
 
AcpiDbSetOutputDestination (ACPI_DB_CONSOLE_OUTPUT);
return (AE_OK);
}
 
 
/*******************************************************************************
*
* FUNCTION: AcpiDbWalkForPredefinedNames
*
* PARAMETERS: Callback from WalkNamespace
*
* RETURN: Status
*
* DESCRIPTION: Detect and display predefined ACPI names (names that start with
* an underscore)
*
******************************************************************************/
 
static ACPI_STATUS
AcpiDbWalkForPredefinedNames (
ACPI_HANDLE ObjHandle,
UINT32 NestingLevel,
void *Context,
void **ReturnValue)
{
ACPI_NAMESPACE_NODE *Node = (ACPI_NAMESPACE_NODE *) ObjHandle;
UINT32 *Count = (UINT32 *) Context;
const ACPI_PREDEFINED_INFO *Predefined;
const ACPI_PREDEFINED_INFO *Package = NULL;
char *Pathname;
 
 
Predefined = AcpiNsCheckForPredefinedName (Node);
if (!Predefined)
{
return (AE_OK);
}
 
Pathname = AcpiNsGetExternalPathname (Node);
if (!Pathname)
{
return (AE_OK);
}
 
/* If method returns a package, the info is in the next table entry */
 
if (Predefined->Info.ExpectedBtypes & ACPI_BTYPE_PACKAGE)
{
Package = Predefined + 1;
}
 
AcpiOsPrintf ("%-32s arg %X ret %2.2X", Pathname,
Predefined->Info.ParamCount, Predefined->Info.ExpectedBtypes);
 
if (Package)
{
AcpiOsPrintf (" PkgType %2.2X ObjType %2.2X Count %2.2X",
Package->RetInfo.Type, Package->RetInfo.ObjectType1,
Package->RetInfo.Count1);
}
 
AcpiOsPrintf("\n");
 
AcpiNsCheckParameterCount (Pathname, Node, ACPI_UINT32_MAX, Predefined);
ACPI_FREE (Pathname);
(*Count)++;
 
return (AE_OK);
}
 
 
/*******************************************************************************
*
* FUNCTION: AcpiDbCheckPredefinedNames
*
* PARAMETERS: None
*
* RETURN: None
*
* DESCRIPTION: Validate all predefined names in the namespace
*
******************************************************************************/
 
void
AcpiDbCheckPredefinedNames (
void)
{
UINT32 Count = 0;
 
 
/* Search all nodes in namespace */
 
(void) AcpiWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT, ACPI_UINT32_MAX,
AcpiDbWalkForPredefinedNames, NULL, (void *) &Count, NULL);
 
AcpiOsPrintf ("Found %u predefined names in the namespace\n", Count);
}
 
 
/*******************************************************************************
*
* FUNCTION: AcpiDbWalkForSpecificObjects
*
* PARAMETERS: Callback from WalkNamespace
*
* RETURN: Status
*
* DESCRIPTION: Display short info about objects in the namespace
*
******************************************************************************/
 
static ACPI_STATUS
AcpiDbWalkForSpecificObjects (
ACPI_HANDLE ObjHandle,
UINT32 NestingLevel,
void *Context,
void **ReturnValue)
{
ACPI_WALK_INFO *Info = (ACPI_WALK_INFO *) Context;
ACPI_BUFFER Buffer;
ACPI_STATUS Status;
 
 
Info->Count++;
 
/* Get and display the full pathname to this object */
 
Buffer.Length = ACPI_ALLOCATE_LOCAL_BUFFER;
Status = AcpiNsHandleToPathname (ObjHandle, &Buffer);
if (ACPI_FAILURE (Status))
{
AcpiOsPrintf ("Could Not get pathname for object %p\n", ObjHandle);
return (AE_OK);
}
 
AcpiOsPrintf ("%32s", (char *) Buffer.Pointer);
ACPI_FREE (Buffer.Pointer);
 
/* Dump short info about the object */
 
(void) AcpiNsDumpOneObject (ObjHandle, NestingLevel, Info, NULL);
return (AE_OK);
}
 
 
/*******************************************************************************
*
* FUNCTION: AcpiDbDisplayObjects
*
* PARAMETERS: ObjTypeArg - Type of object to display
* DisplayCountArg - Max depth to display
*
* RETURN: None
*
* DESCRIPTION: Display objects in the namespace of the requested type
*
******************************************************************************/
 
ACPI_STATUS
AcpiDbDisplayObjects (
char *ObjTypeArg,
char *DisplayCountArg)
{
ACPI_WALK_INFO Info;
ACPI_OBJECT_TYPE Type;
 
 
/* Get the object type */
 
Type = AcpiDbMatchArgument (ObjTypeArg, AcpiDbObjectTypes);
if (Type == ACPI_TYPE_NOT_FOUND)
{
AcpiOsPrintf ("Invalid or unsupported argument\n");
return (AE_OK);
}
 
AcpiDbSetOutputDestination (ACPI_DB_DUPLICATE_OUTPUT);
AcpiOsPrintf (
"Objects of type [%s] defined in the current ACPI Namespace:\n",
AcpiUtGetTypeName (Type));
 
AcpiDbSetOutputDestination (ACPI_DB_REDIRECTABLE_OUTPUT);
 
Info.Count = 0;
Info.OwnerId = ACPI_OWNER_ID_MAX;
Info.DebugLevel = ACPI_UINT32_MAX;
Info.DisplayType = ACPI_DISPLAY_SUMMARY | ACPI_DISPLAY_SHORT;
 
/* Walk the namespace from the root */
 
(void) AcpiWalkNamespace (Type, ACPI_ROOT_OBJECT, ACPI_UINT32_MAX,
AcpiDbWalkForSpecificObjects, NULL, (void *) &Info, NULL);
 
AcpiOsPrintf (
"\nFound %u objects of type [%s] in the current ACPI Namespace\n",
Info.Count, AcpiUtGetTypeName (Type));
 
AcpiDbSetOutputDestination (ACPI_DB_CONSOLE_OUTPUT);
return (AE_OK);
}
 
 
/*******************************************************************************
*
* FUNCTION: AcpiDbIntegrityWalk
*
* PARAMETERS: Callback from WalkNamespace
*
* RETURN: Status
*
* DESCRIPTION: Examine one NS node for valid values.
*
******************************************************************************/
 
static ACPI_STATUS
AcpiDbIntegrityWalk (
ACPI_HANDLE ObjHandle,
UINT32 NestingLevel,
void *Context,
void **ReturnValue)
{
ACPI_INTEGRITY_INFO *Info = (ACPI_INTEGRITY_INFO *) Context;
ACPI_NAMESPACE_NODE *Node = (ACPI_NAMESPACE_NODE *) ObjHandle;
ACPI_OPERAND_OBJECT *Object;
BOOLEAN Alias = TRUE;
 
 
Info->Nodes++;
 
/* Verify the NS node, and dereference aliases */
 
while (Alias)
{
if (ACPI_GET_DESCRIPTOR_TYPE (Node) != ACPI_DESC_TYPE_NAMED)
{
AcpiOsPrintf ("Invalid Descriptor Type for Node %p [%s] - is %2.2X should be %2.2X\n",
Node, AcpiUtGetDescriptorName (Node), ACPI_GET_DESCRIPTOR_TYPE (Node),
ACPI_DESC_TYPE_NAMED);
return (AE_OK);
}
 
if ((Node->Type == ACPI_TYPE_LOCAL_ALIAS) ||
(Node->Type == ACPI_TYPE_LOCAL_METHOD_ALIAS))
{
Node = (ACPI_NAMESPACE_NODE *) Node->Object;
}
else
{
Alias = FALSE;
}
}
 
if (Node->Type > ACPI_TYPE_LOCAL_MAX)
{
AcpiOsPrintf ("Invalid Object Type for Node %p, Type = %X\n",
Node, Node->Type);
return (AE_OK);
}
 
if (!AcpiUtValidAcpiName (Node->Name.Integer))
{
AcpiOsPrintf ("Invalid AcpiName for Node %p\n", Node);
return (AE_OK);
}
 
Object = AcpiNsGetAttachedObject (Node);
if (Object)
{
Info->Objects++;
if (ACPI_GET_DESCRIPTOR_TYPE (Object) != ACPI_DESC_TYPE_OPERAND)
{
AcpiOsPrintf ("Invalid Descriptor Type for Object %p [%s]\n",
Object, AcpiUtGetDescriptorName (Object));
}
}
 
return (AE_OK);
}
 
 
/*******************************************************************************
*
* FUNCTION: AcpiDbCheckIntegrity
*
* PARAMETERS: None
*
* RETURN: None
*
* DESCRIPTION: Check entire namespace for data structure integrity
*
******************************************************************************/
 
void
AcpiDbCheckIntegrity (
void)
{
ACPI_INTEGRITY_INFO Info = {0,0};
 
/* Search all nodes in namespace */
 
(void) AcpiWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT, ACPI_UINT32_MAX,
AcpiDbIntegrityWalk, NULL, (void *) &Info, NULL);
 
AcpiOsPrintf ("Verified %u namespace nodes with %u Objects\n",
Info.Nodes, Info.Objects);
}
 
 
/*******************************************************************************
*
* FUNCTION: AcpiDbWalkForReferences
*
* PARAMETERS: Callback from WalkNamespace
*
* RETURN: Status
*
* DESCRIPTION: Check if this namespace object refers to the target object
* that is passed in as the context value.
*
* Note: Currently doesn't check subobjects within the Node's object
*
******************************************************************************/
 
static ACPI_STATUS
AcpiDbWalkForReferences (
ACPI_HANDLE ObjHandle,
UINT32 NestingLevel,
void *Context,
void **ReturnValue)
{
ACPI_OPERAND_OBJECT *ObjDesc = (ACPI_OPERAND_OBJECT *) Context;
ACPI_NAMESPACE_NODE *Node = (ACPI_NAMESPACE_NODE *) ObjHandle;
 
 
/* Check for match against the namespace node itself */
 
if (Node == (void *) ObjDesc)
{
AcpiOsPrintf ("Object is a Node [%4.4s]\n",
AcpiUtGetNodeName (Node));
}
 
/* Check for match against the object attached to the node */
 
if (AcpiNsGetAttachedObject (Node) == ObjDesc)
{
AcpiOsPrintf ("Reference at Node->Object %p [%4.4s]\n",
Node, AcpiUtGetNodeName (Node));
}
 
return (AE_OK);
}
 
 
/*******************************************************************************
*
* FUNCTION: AcpiDbFindReferences
*
* PARAMETERS: ObjectArg - String with hex value of the object
*
* RETURN: None
*
* DESCRIPTION: Search namespace for all references to the input object
*
******************************************************************************/
 
void
AcpiDbFindReferences (
char *ObjectArg)
{
ACPI_OPERAND_OBJECT *ObjDesc;
 
 
/* Convert string to object pointer */
 
ObjDesc = ACPI_TO_POINTER (ACPI_STRTOUL (ObjectArg, NULL, 16));
 
/* Search all nodes in namespace */
 
(void) AcpiWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT, ACPI_UINT32_MAX,
AcpiDbWalkForReferences, NULL, (void *) ObjDesc, NULL);
}
 
 
/*******************************************************************************
*
* FUNCTION: AcpiDbBusWalk
*
* PARAMETERS: Callback from WalkNamespace
*
* RETURN: Status
*
* DESCRIPTION: Display info about device objects that have a corresponding
* _PRT method.
*
******************************************************************************/
 
static ACPI_STATUS
AcpiDbBusWalk (
ACPI_HANDLE ObjHandle,
UINT32 NestingLevel,
void *Context,
void **ReturnValue)
{
ACPI_NAMESPACE_NODE *Node = (ACPI_NAMESPACE_NODE *) ObjHandle;
ACPI_STATUS Status;
ACPI_BUFFER Buffer;
ACPI_NAMESPACE_NODE *TempNode;
ACPI_DEVICE_INFO *Info;
UINT32 i;
 
 
if ((Node->Type != ACPI_TYPE_DEVICE) &&
(Node->Type != ACPI_TYPE_PROCESSOR))
{
return (AE_OK);
}
 
/* Exit if there is no _PRT under this device */
 
Status = AcpiGetHandle (Node, METHOD_NAME__PRT,
ACPI_CAST_PTR (ACPI_HANDLE, &TempNode));
if (ACPI_FAILURE (Status))
{
return (AE_OK);
}
 
/* Get the full path to this device object */
 
Buffer.Length = ACPI_ALLOCATE_LOCAL_BUFFER;
Status = AcpiNsHandleToPathname (ObjHandle, &Buffer);
if (ACPI_FAILURE (Status))
{
AcpiOsPrintf ("Could Not get pathname for object %p\n", ObjHandle);
return (AE_OK);
}
 
Status = AcpiGetObjectInfo (ObjHandle, &Info);
if (ACPI_FAILURE (Status))
{
return (AE_OK);
}
 
/* Display the full path */
 
AcpiOsPrintf ("%-32s Type %X", (char *) Buffer.Pointer, Node->Type);
ACPI_FREE (Buffer.Pointer);
 
if (Info->Flags & ACPI_PCI_ROOT_BRIDGE)
{
AcpiOsPrintf (" - Is PCI Root Bridge");
}
AcpiOsPrintf ("\n");
 
/* _PRT info */
 
AcpiOsPrintf ("_PRT: %p\n", TempNode);
 
/* Dump _ADR, _HID, _UID, _CID */
 
if (Info->Valid & ACPI_VALID_ADR)
{
AcpiOsPrintf ("_ADR: %8.8X%8.8X\n", ACPI_FORMAT_UINT64 (Info->Address));
}
else
{
AcpiOsPrintf ("_ADR: <Not Present>\n");
}
 
if (Info->Valid & ACPI_VALID_HID)
{
AcpiOsPrintf ("_HID: %s\n", Info->HardwareId.String);
}
else
{
AcpiOsPrintf ("_HID: <Not Present>\n");
}
 
if (Info->Valid & ACPI_VALID_UID)
{
AcpiOsPrintf ("_UID: %s\n", Info->UniqueId.String);
}
else
{
AcpiOsPrintf ("_UID: <Not Present>\n");
}
 
if (Info->Valid & ACPI_VALID_CID)
{
for (i = 0; i < Info->CompatibleIdList.Count; i++)
{
AcpiOsPrintf ("_CID: %s\n",
Info->CompatibleIdList.Ids[i].String);
}
}
else
{
AcpiOsPrintf ("_CID: <Not Present>\n");
}
 
ACPI_FREE (Info);
return (AE_OK);
}
 
 
/*******************************************************************************
*
* FUNCTION: AcpiDbGetBusInfo
*
* PARAMETERS: None
*
* RETURN: None
*
* DESCRIPTION: Display info about system busses.
*
******************************************************************************/
 
void
AcpiDbGetBusInfo (
void)
{
/* Search all nodes in namespace */
 
(void) AcpiWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT, ACPI_UINT32_MAX,
AcpiDbBusWalk, NULL, NULL, NULL);
}
 
#endif /* ACPI_DEBUGGER */
/drivers/devman/acpica/debugger/dbstats.c
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
/drivers/devman/acpica/debugger/dbutils.c
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
UINT32 Value,
char *Buffer)
{
UINT8 i;
int i;
 
 
if (Value == 0)
463,10 → 463,9
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;
/drivers/devman/acpica/debugger/dbxface.c
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,8 → 209,14
 
/* 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);
}
/drivers/devman/acpica/disassembler/dmbuffer.c
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
/drivers/devman/acpica/disassembler/dmnames.c
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
/drivers/devman/acpica/disassembler/dmobject.c
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
/drivers/devman/acpica/disassembler/dmopcode.c
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
/drivers/devman/acpica/disassembler/dmresrc.c
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
/drivers/devman/acpica/disassembler/dmresrcl.c
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
/drivers/devman/acpica/disassembler/dmresrcs.c
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
/drivers/devman/acpica/disassembler/dmutils.c
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
/drivers/devman/acpica/disassembler/dmwalk.c
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
/drivers/devman/acpica/dispatcher/dsargs.c
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);
}
/drivers/devman/acpica/dispatcher/dscontrol.c
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);
}
/drivers/devman/acpica/dispatcher/dsfield.c
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
/drivers/devman/acpica/dispatcher/dsinit.c
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
/drivers/devman/acpica/dispatcher/dsmethod.c
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
/*
* 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
 
/* 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
 
/*
* 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
/*
* 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
* 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);
}
/drivers/devman/acpica/dispatcher/dsmthdat.c
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
/drivers/devman/acpica/dispatcher/dsobject.c
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
{
ACPI_OPERAND_OBJECT *ObjDesc;
ACPI_STATUS Status;
ACPI_OBJECT_TYPE Type;
 
 
ACPI_FUNCTION_TRACE (DsBuildInternalObject);
241,8 → 242,21
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.
* However, the subobject did not get an extra reference count above.
/drivers/devman/acpica/dispatcher/dsopcode.c
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
132,13 → 131,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,
ACPI_OPERAND_OBJECT *ObjDesc,
150,369 → 142,6
 
/*******************************************************************************
*
* 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
*
* PARAMETERS: ObjHandle - Region namespace node
942,8 → 571,9
*
* 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
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);
}
 
/drivers/devman/acpica/dispatcher/dsutils.c
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
/drivers/devman/acpica/dispatcher/dswexec.c
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
* 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.
*/
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;
 
 
/drivers/devman/acpica/dispatcher/dswload.c
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
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
 
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);
}
 
 
/drivers/devman/acpica/dispatcher/dswload2.c
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);
}
 
/drivers/devman/acpica/dispatcher/dswscope.c
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
/drivers/devman/acpica/dispatcher/dswstate.c
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
/drivers/devman/acpica/events/evevent.c
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,54 → 180,6
 
/*******************************************************************************
*
* 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
*
* PARAMETERS: None
366,9 → 318,17
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);
}
 
AcpiFixedEventCount[i]++;
IntStatus |= AcpiEvFixedEventDispatch (i);
}
}
/drivers/devman/acpica/events/evglock.c
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);
}
/drivers/devman/acpica/events/evgpe.c
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,26 → 134,26
 
/*******************************************************************************
*
* FUNCTION: AcpiEvUpdateGpeEnableMasks
* FUNCTION: AcpiEvUpdateGpeEnableMask
*
* PARAMETERS: GpeEventInfo - GPE to update
*
* RETURN: Status
*
* DESCRIPTION: Updates GPE register enable masks based upon whether there are
* references (either wake or run) to this GPE
* DESCRIPTION: Updates GPE register enable mask based upon whether there are
* runtime references to this GPE
*
******************************************************************************/
 
ACPI_STATUS
AcpiEvUpdateGpeEnableMasks (
AcpiEvUpdateGpeEnableMask (
ACPI_GPE_EVENT_INFO *GpeEventInfo)
{
ACPI_GPE_REGISTER_INFO *GpeRegisterInfo;
UINT8 RegisterBit;
UINT32 RegisterBit;
 
 
ACPI_FUNCTION_TRACE (EvUpdateGpeEnableMasks);
ACPI_FUNCTION_TRACE (EvUpdateGpeEnableMask);
 
 
GpeRegisterInfo = GpeEventInfo->RegisterInfo;
162,26 → 162,19
return_ACPI_STATUS (AE_NOT_EXIST);
}
 
RegisterBit = (UINT8)
(1 << (GpeEventInfo->GpeNumber - GpeRegisterInfo->BaseGpeNumber));
RegisterBit = AcpiHwGetGpeRegisterBit (GpeEventInfo, GpeRegisterInfo);
 
/* Clear the wake/run bits up front */
/* Clear the run bit up front */
 
ACPI_CLEAR_BIT (GpeRegisterInfo->EnableForWake, RegisterBit);
ACPI_CLEAR_BIT (GpeRegisterInfo->EnableForRun, RegisterBit);
 
/* Set the mask bits only if there are references to this GPE */
/* Set the mask bit only if there are references to this GPE */
 
if (GpeEventInfo->RuntimeCount)
{
ACPI_SET_BIT (GpeRegisterInfo->EnableForRun, RegisterBit);
ACPI_SET_BIT (GpeRegisterInfo->EnableForRun, (UINT8) RegisterBit);
}
 
if (GpeEventInfo->WakeupCount)
{
ACPI_SET_BIT (GpeRegisterInfo->EnableForWake, RegisterBit);
}
 
return_ACPI_STATUS (AE_OK);
}
 
194,11 → 187,8
*
* RETURN: Status
*
* DESCRIPTION: Hardware-enable a GPE. Always enables the GPE, regardless
* of type or number of references.
* DESCRIPTION: Clear a GPE of stale events and enable it.
*
* Note: The GPE lock should be already acquired when this function is called.
*
******************************************************************************/
 
ACPI_STATUS
212,24 → 202,17
 
 
/*
* We will only allow a GPE to be enabled if it has either an
* associated method (_Lxx/_Exx) or a handler. Otherwise, the
* GPE will be immediately disabled by AcpiEvGpeDispatch the
* first time it fires.
* We will only allow a GPE to be enabled if it has either an associated
* method (_Lxx/_Exx) or a handler, or is using the implicit notify
* feature. Otherwise, the GPE will be immediately disabled by
* AcpiEvGpeDispatch the first time it fires.
*/
if (!(GpeEventInfo->Flags & ACPI_GPE_DISPATCH_MASK))
if ((GpeEventInfo->Flags & ACPI_GPE_DISPATCH_MASK) ==
ACPI_GPE_DISPATCH_NONE)
{
return_ACPI_STATUS (AE_NO_HANDLER);
}
 
/* Ensure the HW enable masks are current */
 
Status = AcpiEvUpdateGpeEnableMasks (GpeEventInfo);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
}
 
/* Clear the GPE (of stale events) */
 
Status = AcpiHwClearGpe (GpeEventInfo);
240,7 → 223,7
 
/* Enable the requested GPE */
 
Status = AcpiHwWriteGpeEnableReg (GpeEventInfo);
Status = AcpiHwLowSetGpe (GpeEventInfo, ACPI_GPE_ENABLE);
return_ACPI_STATUS (Status);
}
 
247,52 → 230,98
 
/*******************************************************************************
*
* FUNCTION: AcpiEvDisableGpe
* FUNCTION: AcpiEvAddGpeReference
*
* PARAMETERS: GpeEventInfo - GPE to disable
* PARAMETERS: GpeEventInfo - Add a reference to this GPE
*
* RETURN: Status
*
* DESCRIPTION: Hardware-disable a GPE. Always disables the requested GPE,
* regardless of the type or number of references.
* DESCRIPTION: Add a reference to a GPE. On the first reference, the GPE is
* hardware-enabled.
*
* Note: The GPE lock should be already acquired when this function is called.
*
******************************************************************************/
 
ACPI_STATUS
AcpiEvDisableGpe (
AcpiEvAddGpeReference (
ACPI_GPE_EVENT_INFO *GpeEventInfo)
{
ACPI_STATUS Status;
ACPI_STATUS Status = AE_OK;
 
 
ACPI_FUNCTION_TRACE (EvDisableGpe);
ACPI_FUNCTION_TRACE (EvAddGpeReference);
 
 
/*
* Note: Always disable the GPE, even if we think that that it is already
* disabled. It is possible that the AML or some other code has enabled
* the GPE behind our back.
*/
if (GpeEventInfo->RuntimeCount == ACPI_UINT8_MAX)
{
return_ACPI_STATUS (AE_LIMIT);
}
 
/* Ensure the HW enable masks are current */
GpeEventInfo->RuntimeCount++;
if (GpeEventInfo->RuntimeCount == 1)
{
/* Enable on first reference */
 
Status = AcpiEvUpdateGpeEnableMasks (GpeEventInfo);
Status = AcpiEvUpdateGpeEnableMask (GpeEventInfo);
if (ACPI_SUCCESS (Status))
{
Status = AcpiEvEnableGpe (GpeEventInfo);
}
 
if (ACPI_FAILURE (Status))
{
GpeEventInfo->RuntimeCount--;
}
}
 
return_ACPI_STATUS (Status);
}
 
/*
* Always H/W disable this GPE, even if we don't know the GPE type.
* Simply clear the enable bit for this particular GPE, but do not
* write out the current GPE enable mask since this may inadvertently
* enable GPEs too early. An example is a rogue GPE that has arrived
* during ACPICA initialization - possibly because AML or other code
* has enabled the GPE.
*/
Status = AcpiHwLowDisableGpe (GpeEventInfo);
 
/*******************************************************************************
*
* FUNCTION: AcpiEvRemoveGpeReference
*
* PARAMETERS: GpeEventInfo - Remove a reference to this GPE
*
* RETURN: Status
*
* DESCRIPTION: Remove a reference to a GPE. When the last reference is
* removed, the GPE is hardware-disabled.
*
******************************************************************************/
 
ACPI_STATUS
AcpiEvRemoveGpeReference (
ACPI_GPE_EVENT_INFO *GpeEventInfo)
{
ACPI_STATUS Status = AE_OK;
 
 
ACPI_FUNCTION_TRACE (EvRemoveGpeReference);
 
 
if (!GpeEventInfo->RuntimeCount)
{
return_ACPI_STATUS (AE_LIMIT);
}
 
GpeEventInfo->RuntimeCount--;
if (!GpeEventInfo->RuntimeCount)
{
/* Disable on last reference */
 
Status = AcpiEvUpdateGpeEnableMask (GpeEventInfo);
if (ACPI_SUCCESS (Status))
{
Status = AcpiHwLowSetGpe (GpeEventInfo, ACPI_GPE_DISABLE);
}
 
if (ACPI_FAILURE (Status))
{
GpeEventInfo->RuntimeCount++;
}
}
 
return_ACPI_STATUS (Status);
}
 
465,6 → 494,16
 
GpeRegisterInfo = &GpeBlock->RegisterInfo[i];
 
/*
* Optimization: If there are no GPEs enabled within this
* register, we can safely ignore the entire register.
*/
if (!(GpeRegisterInfo->EnableForRun |
GpeRegisterInfo->EnableForWake))
{
continue;
}
 
/* Read the Status Register */
 
Status = AcpiHwRead (&StatusReg, &GpeRegisterInfo->StatusAddress);
482,7 → 521,7
}
 
ACPI_DEBUG_PRINT ((ACPI_DB_INTERRUPTS,
"Read GPE Register at GPE%X: Status=%02X, Enable=%02X\n",
"Read GPE Register at GPE%02X: Status=%02X, Enable=%02X\n",
GpeRegisterInfo->BaseGpeNumber, StatusReg, EnableReg));
 
/* Check if there is anything active at all in this register */
507,7 → 546,7
* Found an active GPE. Dispatch the event to a handler
* or method.
*/
IntStatus |= AcpiEvGpeDispatch (
IntStatus |= AcpiEvGpeDispatch (GpeBlock->Node,
&GpeBlock->EventInfo[((ACPI_SIZE) i *
ACPI_GPE_REGISTER_WIDTH) + j],
j + GpeRegisterInfo->BaseGpeNumber);
578,10 → 617,6
return_VOID;
}
 
/* Update the GPE register masks for return to enabled state */
 
(void) AcpiEvUpdateGpeEnableMasks (GpeEventInfo);
 
/*
* Take a snapshot of the GPE info for this level - we copy the info to
* prevent a race condition with RemoveHandler/RemoveBlock.
595,13 → 630,27
return_VOID;
}
 
/* Do the correct dispatch - normal method or implicit notify */
 
switch (LocalGpeEventInfo->Flags & ACPI_GPE_DISPATCH_MASK)
{
case ACPI_GPE_DISPATCH_NOTIFY:
 
/*
* Must check for control method type dispatch one more time to avoid a
* race with EvGpeInstallHandler
* Implicit notify.
* Dispatch a DEVICE_WAKE notify to the appropriate handler.
* NOTE: the request is queued for execution after this method
* completes. The notify handlers are NOT invoked synchronously
* from this thread -- because handlers may in turn run other
* control methods.
*/
if ((LocalGpeEventInfo->Flags & ACPI_GPE_DISPATCH_MASK) ==
ACPI_GPE_DISPATCH_METHOD)
{
Status = AcpiEvQueueNotifyRequest (
LocalGpeEventInfo->Dispatch.DeviceNode,
ACPI_NOTIFY_DEVICE_WAKE);
break;
 
case ACPI_GPE_DISPATCH_METHOD:
 
/* Allocate the evaluation information block */
 
Info = ACPI_ALLOCATE_ZEROED (sizeof (ACPI_EVALUATE_INFO));
612,8 → 661,8
else
{
/*
* Invoke the GPE Method (_Lxx, _Exx) i.e., evaluate the _Lxx/_Exx
* control method that corresponds to this GPE
* Invoke the GPE Method (_Lxx, _Exx) i.e., evaluate the
* _Lxx/_Exx control method that corresponds to this GPE
*/
Info->PrefixNode = LocalGpeEventInfo->Dispatch.MethodNode;
Info->Flags = ACPI_IGNORE_RETURN_VALUE;
628,6 → 677,11
"while evaluating GPE method [%4.4s]",
AcpiUtGetNodeName (LocalGpeEventInfo->Dispatch.MethodNode)));
}
 
break;
 
default:
return_VOID; /* Should never happen */
}
 
/* Defer enabling of GPE until all notify handlers are done */
647,6 → 701,7
* FUNCTION: AcpiEvAsynchEnableGpe
*
* PARAMETERS: Context (GpeEventInfo) - Info for this GPE
* Callback from AcpiOsExecute
*
* RETURN: None
*
660,6 → 715,32
void *Context)
{
ACPI_GPE_EVENT_INFO *GpeEventInfo = Context;
 
 
(void) AcpiEvFinishGpe (GpeEventInfo);
 
ACPI_FREE (GpeEventInfo);
return;
}
 
 
/*******************************************************************************
*
* FUNCTION: AcpiEvFinishGpe
*
* PARAMETERS: GpeEventInfo - Info for this GPE
*
* RETURN: Status
*
* DESCRIPTION: Clear/Enable a GPE. Common code that is used after execution
* of a GPE method or a synchronous or asynchronous GPE handler.
*
******************************************************************************/
 
ACPI_STATUS
AcpiEvFinishGpe (
ACPI_GPE_EVENT_INFO *GpeEventInfo)
{
ACPI_STATUS Status;
 
 
667,23 → 748,23
ACPI_GPE_LEVEL_TRIGGERED)
{
/*
* GPE is level-triggered, we clear the GPE status bit after handling
* the event.
* GPE is level-triggered, we clear the GPE status bit after
* handling the event.
*/
Status = AcpiHwClearGpe (GpeEventInfo);
if (ACPI_FAILURE (Status))
{
goto Exit;
return (Status);
}
}
 
/* Enable this GPE */
 
(void) AcpiHwWriteGpeEnableReg (GpeEventInfo);
 
Exit:
ACPI_FREE (GpeEventInfo);
return;
/*
* Enable this GPE, conditionally. This means that the GPE will
* only be physically enabled if the EnableForRun bit is set
* in the EventInfo.
*/
(void) AcpiHwLowSetGpe (GpeEventInfo, ACPI_GPE_CONDITIONAL_ENABLE);
return (AE_OK);
}
 
 
691,7 → 772,8
*
* FUNCTION: AcpiEvGpeDispatch
*
* PARAMETERS: GpeEventInfo - Info for this GPE
* PARAMETERS: GpeDevice - Device node. NULL for GPE0/GPE1
* GpeEventInfo - Info for this GPE
* GpeNumber - Number relative to the parent GPE block
*
* RETURN: INTERRUPT_HANDLED or INTERRUPT_NOT_HANDLED
705,16 → 787,25
 
UINT32
AcpiEvGpeDispatch (
ACPI_NAMESPACE_NODE *GpeDevice,
ACPI_GPE_EVENT_INFO *GpeEventInfo,
UINT32 GpeNumber)
{
ACPI_STATUS Status;
UINT32 ReturnValue;
 
 
ACPI_FUNCTION_TRACE (EvGpeDispatch);
 
 
/* Invoke global event handler if present */
 
AcpiGpeCount++;
if (AcpiGbl_GlobalEventHandler)
{
AcpiGbl_GlobalEventHandler (ACPI_EVENT_TYPE_GPE, GpeDevice,
GpeNumber, AcpiGbl_GlobalEventHandlerContext);
}
 
/*
* If edge-triggered, clear the GPE status bit now. Note that
727,60 → 818,57
if (ACPI_FAILURE (Status))
{
ACPI_EXCEPTION ((AE_INFO, Status,
"Unable to clear GPE[0x%2X]", GpeNumber));
"Unable to clear GPE%02X", GpeNumber));
return_UINT32 (ACPI_INTERRUPT_NOT_HANDLED);
}
}
 
/*
* Dispatch the GPE to either an installed handler, or the control method
* associated with this GPE (_Lxx or _Exx). If a handler exists, we invoke
* it and do not attempt to run the method. If there is neither a handler
* nor a method, we disable this GPE to prevent further such pointless
* events from firing.
* Always disable the GPE so that it does not keep firing before
* any asynchronous activity completes (either from the execution
* of a GPE method or an asynchronous GPE handler.)
*
* If there is no handler or method to run, just disable the
* GPE and leave it disabled permanently to prevent further such
* pointless events from firing.
*/
Status = AcpiHwLowSetGpe (GpeEventInfo, ACPI_GPE_DISABLE);
if (ACPI_FAILURE (Status))
{
ACPI_EXCEPTION ((AE_INFO, Status,
"Unable to disable GPE%02X", GpeNumber));
return_UINT32 (ACPI_INTERRUPT_NOT_HANDLED);
}
 
/*
* Dispatch the GPE to either an installed handler or the control
* method associated with this GPE (_Lxx or _Exx). If a handler
* exists, we invoke it and do not attempt to run the method.
* If there is neither a handler nor a method, leave the GPE
* disabled.
*/
switch (GpeEventInfo->Flags & ACPI_GPE_DISPATCH_MASK)
{
case ACPI_GPE_DISPATCH_HANDLER:
 
/*
* Invoke the installed handler (at interrupt level)
* Ignore return status for now.
* TBD: leave GPE disabled on error?
*/
(void) GpeEventInfo->Dispatch.Handler->Address (
/* Invoke the installed handler (at interrupt level) */
 
ReturnValue = GpeEventInfo->Dispatch.Handler->Address (
GpeDevice, GpeNumber,
GpeEventInfo->Dispatch.Handler->Context);
 
/* It is now safe to clear level-triggered events. */
/* If requested, clear (if level-triggered) and reenable the GPE */
 
if ((GpeEventInfo->Flags & ACPI_GPE_XRUPT_TYPE_MASK) ==
ACPI_GPE_LEVEL_TRIGGERED)
if (ReturnValue & ACPI_REENABLE_GPE)
{
Status = AcpiHwClearGpe (GpeEventInfo);
if (ACPI_FAILURE (Status))
{
ACPI_EXCEPTION ((AE_INFO, Status,
"Unable to clear GPE[0x%2X]", GpeNumber));
return_UINT32 (ACPI_INTERRUPT_NOT_HANDLED);
(void) AcpiEvFinishGpe (GpeEventInfo);
}
}
break;
 
case ACPI_GPE_DISPATCH_METHOD:
case ACPI_GPE_DISPATCH_NOTIFY:
 
/*
* Disable the GPE, so it doesn't keep firing before the method has a
* chance to run (it runs asynchronously with interrupts enabled).
*/
Status = AcpiEvDisableGpe (GpeEventInfo);
if (ACPI_FAILURE (Status))
{
ACPI_EXCEPTION ((AE_INFO, Status,
"Unable to disable GPE[0x%2X]", GpeNumber));
return_UINT32 (ACPI_INTERRUPT_NOT_HANDLED);
}
 
/*
* Execute the method associated with the GPE
* NOTE: Level-triggered GPEs are cleared after the method completes.
*/
789,7 → 877,7
if (ACPI_FAILURE (Status))
{
ACPI_EXCEPTION ((AE_INFO, Status,
"Unable to queue handler for GPE[0x%2X] - event disabled",
"Unable to queue handler for GPE%02X - event disabled",
GpeNumber));
}
break;
802,20 → 890,8
* a GPE to be enabled if it has no handler or method.
*/
ACPI_ERROR ((AE_INFO,
"No handler or method for GPE[0x%2X], disabling event",
"No handler or method for GPE%02X, disabling event",
GpeNumber));
 
/*
* Disable the GPE. The GPE will remain disabled a handler
* is installed or ACPICA is restarted.
*/
Status = AcpiEvDisableGpe (GpeEventInfo);
if (ACPI_FAILURE (Status))
{
ACPI_EXCEPTION ((AE_INFO, Status,
"Unable to disable GPE[0x%2X]", GpeNumber));
return_UINT32 (ACPI_INTERRUPT_NOT_HANDLED);
}
break;
}
 
/drivers/devman/acpica/events/evgpeblk.c
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
467,6 → 467,7
 
GpeBlock->Node = GpeDevice;
GpeBlock->GpeCount = (UINT16) (RegisterCount * ACPI_GPE_REGISTER_WIDTH);
GpeBlock->Initialized = FALSE;
GpeBlock->RegisterCount = RegisterCount;
GpeBlock->BlockBaseNumber = GpeBlockBaseNumber;
 
493,11 → 494,12
return_ACPI_STATUS (Status);
}
 
AcpiGbl_AllGpesInitialized = FALSE;
 
/* Find all GPE methods (_Lxx or_Exx) for this block */
 
WalkInfo.GpeBlock = GpeBlock;
WalkInfo.GpeDevice = GpeDevice;
WalkInfo.EnableThisGpe = FALSE;
WalkInfo.ExecuteByOwnerId = FALSE;
 
Status = AcpiNsWalkNamespace (ACPI_TYPE_METHOD, GpeDevice,
529,14 → 531,12
*
* FUNCTION: AcpiEvInitializeGpeBlock
*
* PARAMETERS: GpeDevice - Handle to the parent GPE block
* GpeBlock - Gpe Block info
* PARAMETERS: ACPI_GPE_CALLBACK
*
* RETURN: Status
*
* DESCRIPTION: Initialize and enable a GPE block. First find and run any
* _PRT methods associated with the block, then enable the
* appropriate GPEs.
* DESCRIPTION: Initialize and enable a GPE block. Enable GPEs that have
* associated methods.
* Note: Assumes namespace is locked.
*
******************************************************************************/
543,16 → 543,14
 
ACPI_STATUS
AcpiEvInitializeGpeBlock (
ACPI_NAMESPACE_NODE *GpeDevice,
ACPI_GPE_BLOCK_INFO *GpeBlock)
ACPI_GPE_XRUPT_INFO *GpeXruptInfo,
ACPI_GPE_BLOCK_INFO *GpeBlock,
void *Ignored)
{
ACPI_STATUS Status;
ACPI_GPE_EVENT_INFO *GpeEventInfo;
ACPI_GPE_WALK_INFO WalkInfo;
UINT32 WakeGpeCount;
UINT32 GpeEnabledCount;
UINT32 GpeIndex;
UINT32 GpeNumber;
UINT32 i;
UINT32 j;
 
560,51 → 558,22
ACPI_FUNCTION_TRACE (EvInitializeGpeBlock);
 
 
/* Ignore a null GPE block (e.g., if no GPE block 1 exists) */
 
if (!GpeBlock)
{
return_ACPI_STATUS (AE_OK);
}
 
/*
* Runtime option: Should wake GPEs be enabled at runtime? The default
* is no, they should only be enabled just as the machine goes to sleep.
* Ignore a null GPE block (e.g., if no GPE block 1 exists), and
* any GPE blocks that have been initialized already.
*/
if (AcpiGbl_LeaveWakeGpesDisabled)
if (!GpeBlock || GpeBlock->Initialized)
{
/*
* Differentiate runtime vs wake GPEs, via the _PRW control methods.
* Each GPE that has one or more _PRWs that reference it is by
* definition a wake GPE and will not be enabled while the machine
* is running.
*/
WalkInfo.GpeBlock = GpeBlock;
WalkInfo.GpeDevice = GpeDevice;
WalkInfo.ExecuteByOwnerId = FALSE;
 
Status = AcpiNsWalkNamespace (ACPI_TYPE_DEVICE, ACPI_ROOT_OBJECT,
ACPI_UINT32_MAX, ACPI_NS_WALK_UNLOCK,
AcpiEvMatchPrwAndGpe, NULL, &WalkInfo, NULL);
if (ACPI_FAILURE (Status))
{
ACPI_EXCEPTION ((AE_INFO, Status, "While executing _PRW methods"));
return_ACPI_STATUS (AE_OK);
}
}
 
/*
* Enable all GPEs that have a corresponding method and are not
* capable of generating wakeups. Any other GPEs within this block
* must be enabled via the AcpiEnableGpe interface.
* Enable all GPEs that have a corresponding method and have the
* ACPI_GPE_CAN_WAKE flag unset. Any other GPEs within this block
* must be enabled via the acpi_enable_gpe() interface.
*/
WakeGpeCount = 0;
GpeEnabledCount = 0;
 
if (GpeDevice == AcpiGbl_FadtGpeDevice)
{
GpeDevice = NULL;
}
 
for (i = 0; i < GpeBlock->RegisterCount; i++)
{
for (j = 0; j < ACPI_GPE_REGISTER_WIDTH; j++)
614,33 → 583,23
GpeIndex = (i * ACPI_GPE_REGISTER_WIDTH) + j;
GpeEventInfo = &GpeBlock->EventInfo[GpeIndex];
 
/* Ignore GPEs that can wake the system */
 
if (GpeEventInfo->Flags & ACPI_GPE_CAN_WAKE)
/*
* Ignore GPEs that have no corresponding _Lxx/_Exx method
* and GPEs that are used to wake the system
*/
if (((GpeEventInfo->Flags & ACPI_GPE_DISPATCH_MASK) == ACPI_GPE_DISPATCH_NONE) ||
((GpeEventInfo->Flags & ACPI_GPE_DISPATCH_MASK) == ACPI_GPE_DISPATCH_HANDLER) ||
(GpeEventInfo->Flags & ACPI_GPE_CAN_WAKE))
{
WakeGpeCount++;
if (AcpiGbl_LeaveWakeGpesDisabled)
{
continue;
}
}
 
/* Ignore GPEs that have no corresponding _Lxx/_Exx method */
 
if (!(GpeEventInfo->Flags & ACPI_GPE_DISPATCH_METHOD))
{
continue;
}
 
/* Enable this GPE */
 
GpeNumber = GpeIndex + GpeBlock->BlockBaseNumber;
Status = AcpiEnableGpe (GpeDevice, GpeNumber,
ACPI_GPE_TYPE_RUNTIME);
Status = AcpiEvAddGpeReference (GpeEventInfo);
if (ACPI_FAILURE (Status))
{
ACPI_EXCEPTION ((AE_INFO, Status,
"Could not enable GPE 0x%02X", GpeNumber));
"Could not enable GPE 0x%02X",
GpeIndex + GpeBlock->BlockBaseNumber));
continue;
}
 
648,13 → 607,13
}
}
 
if (GpeEnabledCount || WakeGpeCount)
if (GpeEnabledCount)
{
ACPI_DEBUG_PRINT ((ACPI_DB_INIT,
"Enabled %u Runtime GPEs, added %u Wake GPEs in this block\n",
GpeEnabledCount, WakeGpeCount));
"Enabled %u GPEs in this block\n", GpeEnabledCount));
}
 
GpeBlock->Initialized = TRUE;
return_ACPI_STATUS (AE_OK);
}
 
/drivers/devman/acpica/events/evgpeinit.c
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
118,12 → 118,28
#include "accommon.h"
#include "acevents.h"
#include "acnamesp.h"
#include "acinterp.h"
 
#define _COMPONENT ACPI_EVENTS
ACPI_MODULE_NAME ("evgpeinit")
 
 
/*
* Note: History of _PRW support in ACPICA
*
* Originally (2000 - 2010), the GPE initialization code performed a walk of
* the entire namespace to execute the _PRW methods and detect all GPEs
* capable of waking the system.
*
* As of 10/2010, the _PRW method execution has been removed since it is
* actually unnecessary. The host OS must in fact execute all _PRW methods
* in order to identify the device/power-resource dependencies. We now put
* the onus on the host OS to identify the wake GPEs as part of this process
* and to inform ACPICA of these GPEs via the AcpiSetupGpeForWake interface. This
* not only reduces the complexity of the ACPICA initialization code, but in
* some cases (on systems with very large namespaces) it should reduce the
* kernel boot time as well.
*/
 
/*******************************************************************************
*
* FUNCTION: AcpiEvGpeInitialize
288,10 → 304,7
*
* DESCRIPTION: Check for new GPE methods (_Lxx/_Exx) made available as a
* result of a Load() or LoadTable() operation. If new GPE
* methods have been installed, register the new methods and
* enable and runtime GPEs that are associated with them. Also,
* run any newly loaded _PRW methods in order to discover any
* new CAN_WAKE GPEs.
* methods have been installed, register the new methods.
*
******************************************************************************/
 
303,50 → 316,14
ACPI_GPE_BLOCK_INFO *GpeBlock;
ACPI_GPE_WALK_INFO WalkInfo;
ACPI_STATUS Status = AE_OK;
UINT32 NewWakeGpeCount = 0;
 
 
/* We will examine only _PRW/_Lxx/_Exx methods owned by this table */
 
WalkInfo.OwnerId = TableOwnerId;
WalkInfo.ExecuteByOwnerId = TRUE;
WalkInfo.Count = 0;
 
if (AcpiGbl_LeaveWakeGpesDisabled)
{
/*
* 1) Run any newly-loaded _PRW methods to find any GPEs that
* can now be marked as CAN_WAKE GPEs. Note: We must run the
* _PRW methods before we process the _Lxx/_Exx methods because
* we will enable all runtime GPEs associated with the new
* _Lxx/_Exx methods at the time we process those methods.
* Find any _Lxx/_Exx GPE methods that have just been loaded.
*
* Unlock interpreter so that we can run the _PRW methods.
*/
WalkInfo.GpeBlock = NULL;
WalkInfo.GpeDevice = NULL;
 
AcpiExExitInterpreter ();
 
Status = AcpiNsWalkNamespace (ACPI_TYPE_DEVICE, ACPI_ROOT_OBJECT,
ACPI_UINT32_MAX, ACPI_NS_WALK_NO_UNLOCK,
AcpiEvMatchPrwAndGpe, NULL, &WalkInfo, NULL);
if (ACPI_FAILURE (Status))
{
ACPI_EXCEPTION ((AE_INFO, Status,
"While executing _PRW methods"));
}
 
AcpiExEnterInterpreter ();
NewWakeGpeCount = WalkInfo.Count;
}
 
/*
* 2) Find any _Lxx/_Exx GPE methods that have just been loaded.
* Any GPEs that correspond to new _Lxx/_Exx methods are immediately
* enabled.
*
* Any GPEs that correspond to new _Lxx/_Exx methods and are not
* marked as CAN_WAKE are immediately enabled.
*
* Examine the namespace underneath each GpeDevice within the
* GpeBlock lists.
*/
357,7 → 334,8
}
 
WalkInfo.Count = 0;
WalkInfo.EnableThisGpe = TRUE;
WalkInfo.OwnerId = TableOwnerId;
WalkInfo.ExecuteByOwnerId = TRUE;
 
/* Walk the interrupt level descriptor list */
 
388,11 → 366,9
GpeXruptInfo = GpeXruptInfo->Next;
}
 
if (WalkInfo.Count || NewWakeGpeCount)
if (WalkInfo.Count)
{
ACPI_INFO ((AE_INFO,
"Enabled %u new runtime GPEs, added %u new wakeup GPEs",
WalkInfo.Count, NewWakeGpeCount));
ACPI_INFO ((AE_INFO, "Enabled %u new GPEs", WalkInfo.Count));
}
 
(void) AcpiUtReleaseMutex (ACPI_MTX_EVENTS);
423,8 → 399,6
*
* If WalkInfo->ExecuteByOwnerId is TRUE, we only execute examine GPE methods
* with that owner.
* If WalkInfo->EnableThisGpe is TRUE, the GPE that is referred to by a GPE
* method is immediately enabled (Used for Load/LoadTable operators)
*
******************************************************************************/
 
438,8 → 412,6
ACPI_NAMESPACE_NODE *MethodNode = ACPI_CAST_PTR (ACPI_NAMESPACE_NODE, ObjHandle);
ACPI_GPE_WALK_INFO *WalkInfo = ACPI_CAST_PTR (ACPI_GPE_WALK_INFO, Context);
ACPI_GPE_EVENT_INFO *GpeEventInfo;
ACPI_NAMESPACE_NODE *GpeDevice;
ACPI_STATUS Status;
UINT32 GpeNumber;
char Name[ACPI_NAME_SIZE + 1];
UINT8 Type;
474,9 → 446,6
/*
* 3) Edge/Level determination is based on the 2nd character
* of the method name
*
* NOTE: Default GPE type is RUNTIME only. Later, if a _PRW object is
* found that points to this GPE, the ACPI_GPE_CAN_WAKE flag is set.
*/
switch (Name[1])
{
551,213 → 520,12
* Add the GPE information from above to the GpeEventInfo block for
* use during dispatch of this GPE.
*/
GpeEventInfo->Flags &= ~(ACPI_GPE_DISPATCH_MASK);
GpeEventInfo->Flags |= (UINT8) (Type | ACPI_GPE_DISPATCH_METHOD);
GpeEventInfo->Dispatch.MethodNode = MethodNode;
 
/*
* Enable this GPE if requested. This only happens when during the
* execution of a Load or LoadTable operator. We have found a new
* GPE method and want to immediately enable the GPE if it is a
* runtime GPE.
*/
if (WalkInfo->EnableThisGpe)
{
/* Ignore GPEs that can wake the system */
 
if (!(GpeEventInfo->Flags & ACPI_GPE_CAN_WAKE) ||
!AcpiGbl_LeaveWakeGpesDisabled)
{
WalkInfo->Count++;
GpeDevice = WalkInfo->GpeDevice;
 
if (GpeDevice == AcpiGbl_FadtGpeDevice)
{
GpeDevice = NULL;
}
 
Status = AcpiEnableGpe (GpeDevice, GpeNumber,
ACPI_GPE_TYPE_RUNTIME);
if (ACPI_FAILURE (Status))
{
ACPI_EXCEPTION ((AE_INFO, Status,
"Could not enable GPE 0x%02X", GpeNumber));
}
}
}
 
ACPI_DEBUG_PRINT ((ACPI_DB_LOAD,
"Registered GPE method %s as GPE number 0x%.2X\n",
Name, GpeNumber));
return_ACPI_STATUS (AE_OK);
}
 
 
/*******************************************************************************
*
* FUNCTION: AcpiEvMatchPrwAndGpe
*
* PARAMETERS: Callback from WalkNamespace
*
* RETURN: Status. NOTE: We ignore errors so that the _PRW walk is
* not aborted on a single _PRW failure.
*
* DESCRIPTION: Called from AcpiWalkNamespace. Expects each object to be a
* Device. Run the _PRW method. If present, extract the GPE
* number and mark the GPE as a CAN_WAKE GPE. Allows a
* per-OwnerId execution if ExecuteByOwnerId is TRUE in the
* WalkInfo parameter block.
*
* If WalkInfo->ExecuteByOwnerId is TRUE, we only execute _PRWs with that
* owner.
* If WalkInfo->GpeDevice is NULL, we execute every _PRW found. Otherwise,
* we only execute _PRWs that refer to the input GpeDevice.
*
******************************************************************************/
 
ACPI_STATUS
AcpiEvMatchPrwAndGpe (
ACPI_HANDLE ObjHandle,
UINT32 Level,
void *Context,
void **ReturnValue)
{
ACPI_GPE_WALK_INFO *WalkInfo = ACPI_CAST_PTR (ACPI_GPE_WALK_INFO, Context);
ACPI_NAMESPACE_NODE *GpeDevice;
ACPI_GPE_BLOCK_INFO *GpeBlock;
ACPI_NAMESPACE_NODE *TargetGpeDevice;
ACPI_NAMESPACE_NODE *PrwNode;
ACPI_GPE_EVENT_INFO *GpeEventInfo;
ACPI_OPERAND_OBJECT *PkgDesc;
ACPI_OPERAND_OBJECT *ObjDesc;
UINT32 GpeNumber;
ACPI_STATUS Status;
 
 
ACPI_FUNCTION_TRACE (EvMatchPrwAndGpe);
 
 
/* Check for a _PRW method under this device */
 
Status = AcpiNsGetNode (ObjHandle, METHOD_NAME__PRW,
ACPI_NS_NO_UPSEARCH, &PrwNode);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (AE_OK);
}
 
/* Check if requested OwnerId matches this OwnerId */
 
if ((WalkInfo->ExecuteByOwnerId) &&
(PrwNode->OwnerId != WalkInfo->OwnerId))
{
return_ACPI_STATUS (AE_OK);
}
 
/* Execute the _PRW */
 
Status = AcpiUtEvaluateObject (PrwNode, NULL,
ACPI_BTYPE_PACKAGE, &PkgDesc);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (AE_OK);
}
 
/* The returned _PRW package must have at least two elements */
 
if (PkgDesc->Package.Count < 2)
{
goto Cleanup;
}
 
/* Extract pointers from the input context */
 
GpeDevice = WalkInfo->GpeDevice;
GpeBlock = WalkInfo->GpeBlock;
 
/*
* The _PRW object must return a package, we are only interested
* in the first element
*/
ObjDesc = PkgDesc->Package.Elements[0];
 
if (ObjDesc->Common.Type == ACPI_TYPE_INTEGER)
{
/* Use FADT-defined GPE device (from definition of _PRW) */
 
TargetGpeDevice = NULL;
if (GpeDevice)
{
TargetGpeDevice = AcpiGbl_FadtGpeDevice;
}
 
/* Integer is the GPE number in the FADT described GPE blocks */
 
GpeNumber = (UINT32) ObjDesc->Integer.Value;
}
else if (ObjDesc->Common.Type == ACPI_TYPE_PACKAGE)
{
/* Package contains a GPE reference and GPE number within a GPE block */
 
if ((ObjDesc->Package.Count < 2) ||
((ObjDesc->Package.Elements[0])->Common.Type !=
ACPI_TYPE_LOCAL_REFERENCE) ||
((ObjDesc->Package.Elements[1])->Common.Type !=
ACPI_TYPE_INTEGER))
{
goto Cleanup;
}
 
/* Get GPE block reference and decode */
 
TargetGpeDevice = ObjDesc->Package.Elements[0]->Reference.Node;
GpeNumber = (UINT32) ObjDesc->Package.Elements[1]->Integer.Value;
}
else
{
/* Unknown type, just ignore it */
 
goto Cleanup;
}
 
/* Get the GpeEventInfo for this GPE */
 
if (GpeDevice)
{
/*
* Is this GPE within this block?
*
* TRUE if and only if these conditions are true:
* 1) The GPE devices match.
* 2) The GPE index(number) is within the range of the Gpe Block
* associated with the GPE device.
*/
if (GpeDevice != TargetGpeDevice)
{
goto Cleanup;
}
 
GpeEventInfo = AcpiEvLowGetGpeInfo (GpeNumber, GpeBlock);
}
else
{
/* GpeDevice is NULL, just match the TargetDevice and GpeNumber */
 
GpeEventInfo = AcpiEvGetGpeEventInfo (TargetGpeDevice, GpeNumber);
}
 
if (GpeEventInfo)
{
if (!(GpeEventInfo->Flags & ACPI_GPE_CAN_WAKE))
{
/* This GPE can wake the system */
 
GpeEventInfo->Flags |= ACPI_GPE_CAN_WAKE;
WalkInfo->Count++;
}
}
 
Cleanup:
AcpiUtRemoveReference (PkgDesc);
return_ACPI_STATUS (AE_OK);
}
 
/drivers/devman/acpica/events/evgpeutil.c
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
241,6 → 241,51
 
/*******************************************************************************
*
* FUNCTION: AcpiEvGetGpeDevice
*
* PARAMETERS: GPE_WALK_CALLBACK
*
* RETURN: Status
*
* DESCRIPTION: Matches the input GPE index (0-CurrentGpeCount) with a GPE
* block device. NULL if the GPE is one of the FADT-defined GPEs.
*
******************************************************************************/
 
ACPI_STATUS
AcpiEvGetGpeDevice (
ACPI_GPE_XRUPT_INFO *GpeXruptInfo,
ACPI_GPE_BLOCK_INFO *GpeBlock,
void *Context)
{
ACPI_GPE_DEVICE_INFO *Info = Context;
 
 
/* Increment Index by the number of GPEs in this block */
 
Info->NextBlockBaseIndex += GpeBlock->GpeCount;
 
if (Info->Index < Info->NextBlockBaseIndex)
{
/*
* The GPE index is within this block, get the node. Leave the node
* NULL for the FADT-defined GPEs
*/
if ((GpeBlock->Node)->Type == ACPI_TYPE_DEVICE)
{
Info->GpeDevice = GpeBlock->Node;
}
 
Info->Status = AE_OK;
return (AE_CTRL_END);
}
 
return (AE_OK);
}
 
 
/*******************************************************************************
*
* FUNCTION: AcpiEvGetGpeXruptBlock
*
* PARAMETERS: InterruptNumber - Interrupt for a GPE block
/drivers/devman/acpica/events/evmisc.c
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 "accommon.h"
#include "acevents.h"
#include "acnamesp.h"
#include "acinterp.h"
 
#define _COMPONENT ACPI_EVENTS
ACPI_MODULE_NAME ("evmisc")
129,15 → 128,7
AcpiEvNotifyDispatch (
void *Context);
 
static UINT32
AcpiEvGlobalLockHandler (
void *Context);
 
static ACPI_STATUS
AcpiEvRemoveGlobalLockHandler (
void);
 
 
/*******************************************************************************
*
* FUNCTION: AcpiEvIsNotifyObject
372,294 → 363,8
}
 
 
/*******************************************************************************
*
* 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. Attempt to acquire the global lock,
* if successful, signal the thread waiting for the lock.
*
* NOTE: Assumes that the semaphore can be signaled from interrupt level. If
* this is not possible for some reason, a separate thread will have to be
* scheduled to do this.
*
******************************************************************************/
 
static UINT32
AcpiEvGlobalLockHandler (
void *Context)
{
BOOLEAN Acquired = FALSE;
ACPI_STATUS Status;
 
 
/*
* Attempt to get the lock.
*
* If we don't get it now, it will be marked pending and we will
* take another interrupt when it becomes free.
*/
ACPI_ACQUIRE_GLOBAL_LOCK (AcpiGbl_FACS, Acquired);
if (Acquired)
{
/* Got the lock, now wake the thread waiting for it */
 
AcpiGbl_GlobalLockAcquired = TRUE;
 
/* Send a unit to the semaphore */
 
Status = AcpiOsSignalSemaphore (AcpiGbl_GlobalLockSemaphore, 1);
if (ACPI_FAILURE (Status))
{
ACPI_ERROR ((AE_INFO, "Could not signal Global Lock semaphore"));
}
}
 
return (ACPI_INTERRUPT_HANDLED);
}
 
 
/*******************************************************************************
*
* 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.
*/
if (Status == AE_NO_HARDWARE_RESPONSE)
{
ACPI_ERROR ((AE_INFO,
"No response from Global Lock hardware, disabling lock"));
 
AcpiGbl_GlobalLockPresent = FALSE;
return_ACPI_STATUS (AE_OK);
}
 
AcpiGbl_GlobalLockPresent = TRUE;
return_ACPI_STATUS (Status);
}
 
 
/*******************************************************************************
*
* FUNCTION: AcpiEvRemoveGlobalLockHandler
*
* PARAMETERS: None
*
* RETURN: Status
*
* DESCRIPTION: Remove the handler for the Global Lock
*
******************************************************************************/
 
static 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: 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_STATUS Status = AE_OK;
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);
}
 
/* Attempt to acquire the actual hardware lock */
 
ACPI_ACQUIRE_GLOBAL_LOCK (AcpiGbl_FACS, Acquired);
if (Acquired)
{
/* We got the lock */
 
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Acquired hardware Global Lock\n"));
 
AcpiGbl_GlobalLockAcquired = TRUE;
return_ACPI_STATUS (AE_OK);
}
 
/*
* Did not get the lock. The pending bit was set above, and we must now
* wait until we get the global lock released interrupt.
*/
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);
 
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);
}
 
 
/******************************************************************************
*
* FUNCTION: AcpiEvTerminate
*
* PARAMETERS: none
737,4 → 442,3
}
return_VOID;
}
 
/drivers/devman/acpica/events/evregion.c
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
133,6 → 133,10
ACPI_NAMESPACE_NODE *Node,
ACPI_ADR_SPACE_TYPE SpaceId);
 
static void
AcpiEvOrphanEcRegMethod (
void);
 
static ACPI_STATUS
AcpiEvRegRun (
ACPI_HANDLE ObjHandle,
334,6 → 338,8
}
}
 
AcpiGbl_RegMethodsExecuted = TRUE;
 
(void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE);
return_ACPI_STATUS (Status);
}
681,7 → 687,7
 
/* Now stop region accesses by executing the _REG method */
 
Status = AcpiEvExecuteRegMethod (RegionObj, 0);
Status = AcpiEvExecuteRegMethod (RegionObj, ACPI_REG_DISCONNECT);
if (ACPI_FAILURE (Status))
{
ACPI_EXCEPTION ((AE_INFO, Status, "from region _REG, [%s]",
1212,6 → 1218,13
ACPI_NS_WALK_UNLOCK, AcpiEvRegRun, NULL,
&SpaceId, NULL);
 
/* Special case for EC: handle "orphan" _REG methods with no region */
 
if (SpaceId == ACPI_ADR_SPACE_EC)
{
AcpiEvOrphanEcRegMethod ();
}
 
return_ACPI_STATUS (Status);
}
 
1278,7 → 1291,122
return (AE_OK);
}
 
Status = AcpiEvExecuteRegMethod (ObjDesc, 1);
Status = AcpiEvExecuteRegMethod (ObjDesc, ACPI_REG_CONNECT);
return (Status);
}
 
 
/*******************************************************************************
*
* FUNCTION: AcpiEvOrphanEcRegMethod
*
* PARAMETERS: None
*
* RETURN: None
*
* DESCRIPTION: Execute an "orphan" _REG method that appears under the EC
* device. This is a _REG method that has no corresponding region
* within the EC device scope. The orphan _REG method appears to
* have been enabled by the description of the ECDT in the ACPI
* specification: "The availability of the region space can be
* detected by providing a _REG method object underneath the
* Embedded Controller device."
*
* To quickly access the EC device, we use the EC_ID that appears
* within the ECDT. Otherwise, we would need to perform a time-
* consuming namespace walk, executing _HID methods to find the
* EC device.
*
******************************************************************************/
 
static void
AcpiEvOrphanEcRegMethod (
void)
{
ACPI_TABLE_ECDT *Table;
ACPI_STATUS Status;
ACPI_OBJECT_LIST Args;
ACPI_OBJECT Objects[2];
ACPI_NAMESPACE_NODE *EcDeviceNode;
ACPI_NAMESPACE_NODE *RegMethod;
ACPI_NAMESPACE_NODE *NextNode;
 
 
ACPI_FUNCTION_TRACE (EvOrphanEcRegMethod);
 
 
/* Get the ECDT (if present in system) */
 
Status = AcpiGetTable (ACPI_SIG_ECDT, 0,
ACPI_CAST_INDIRECT_PTR (ACPI_TABLE_HEADER, &Table));
if (ACPI_FAILURE (Status))
{
return_VOID;
}
 
/* We need a valid EC_ID string */
 
if (!(*Table->Id))
{
return_VOID;
}
 
/* Namespace is currently locked, must release */
 
(void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE);
 
/* Get a handle to the EC device referenced in the ECDT */
 
Status = AcpiGetHandle (NULL,
ACPI_CAST_PTR (char, Table->Id),
ACPI_CAST_PTR (ACPI_HANDLE, &EcDeviceNode));
if (ACPI_FAILURE (Status))
{
goto Exit;
}
 
/* Get a handle to a _REG method immediately under the EC device */
 
Status = AcpiGetHandle (EcDeviceNode,
METHOD_NAME__REG, ACPI_CAST_PTR (ACPI_HANDLE, &RegMethod));
if (ACPI_FAILURE (Status))
{
goto Exit;
}
 
/*
* Execute the _REG method only if there is no Operation Region in
* this scope with the Embedded Controller space ID. Otherwise, it
* will already have been executed. Note, this allows for Regions
* with other space IDs to be present; but the code below will then
* execute the _REG method with the EC space ID argument.
*/
NextNode = AcpiNsGetNextNode (EcDeviceNode, NULL);
while (NextNode)
{
if ((NextNode->Type == ACPI_TYPE_REGION) &&
(NextNode->Object) &&
(NextNode->Object->Region.SpaceId == ACPI_ADR_SPACE_EC))
{
goto Exit; /* Do not execute _REG */
}
NextNode = AcpiNsGetNextNode (EcDeviceNode, NextNode);
}
 
/* Evaluate the _REG(EC,Connect) method */
 
Args.Count = 2;
Args.Pointer = Objects;
Objects[0].Type = ACPI_TYPE_INTEGER;
Objects[0].Integer.Value = ACPI_ADR_SPACE_EC;
Objects[1].Type = ACPI_TYPE_INTEGER;
Objects[1].Integer.Value = ACPI_REG_CONNECT;
 
Status = AcpiEvaluateObject (RegMethod, NULL, &Args, NULL);
 
Exit:
/* We ignore all errors from above, don't care */
 
Status = AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE);
return_VOID;
}
/drivers/devman/acpica/events/evrgnini.c
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
395,8 → 395,8
}
 
/*
* Get the PCI device and function numbers from the _ADR object contained
* in the parent's scope.
* Get the PCI device and function numbers from the _ADR object
* contained in the parent's scope.
*/
Status = AcpiUtEvaluateNumericObject (METHOD_NAME__ADR,
PciDeviceNode, &PciValue);
429,9 → 429,14
PciId->Bus = ACPI_LOWORD (PciValue);
}
 
/* Complete this device's PciId */
/* Complete/update the PCI ID for this device */
 
AcpiOsDerivePciId (PciRootNode, RegionObj->Region.Node, &PciId);
Status = AcpiHwDerivePciId (PciId, PciRootNode, RegionObj->Region.Node);
if (ACPI_FAILURE (Status))
{
ACPI_FREE (PciId);
return_ACPI_STATUS (Status);
}
 
*RegionContext = PciId;
return_ACPI_STATUS (AE_OK);
724,9 → 729,9
*
* See AcpiNsExecModuleCode
*/
if (ObjDesc->Method.Flags & AOPOBJ_MODULE_LEVEL)
if (ObjDesc->Method.InfoFlags & ACPI_METHOD_MODULE_LEVEL)
{
HandlerObj = ObjDesc->Method.Extra.Handler;
HandlerObj = ObjDesc->Method.Dispatch.Handler;
}
break;
 
763,7 → 768,7
}
}
 
Status = AcpiEvExecuteRegMethod (RegionObj, 1);
Status = AcpiEvExecuteRegMethod (RegionObj, ACPI_REG_CONNECT);
 
if (AcpiNsLocked)
{
/drivers/devman/acpica/events/evsci.c
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
/drivers/devman/acpica/events/evxface.c
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
177,6 → 177,66
 
/*******************************************************************************
*
* FUNCTION: AcpiInstallGlobalEventHandler
*
* PARAMETERS: Handler - Pointer to the global event handler function
* Context - Value passed to the handler on each event
*
* RETURN: Status
*
* DESCRIPTION: Saves the pointer to the handler function. The global handler
* is invoked upon each incoming GPE and Fixed Event. It is
* invoked at interrupt level at the time of the event dispatch.
* Can be used to update event counters, etc.
*
******************************************************************************/
 
ACPI_STATUS
AcpiInstallGlobalEventHandler (
ACPI_GBL_EVENT_HANDLER Handler,
void *Context)
{
ACPI_STATUS Status;
 
 
ACPI_FUNCTION_TRACE (AcpiInstallGlobalEventHandler);
 
 
/* Parameter validation */
 
if (!Handler)
{
return_ACPI_STATUS (AE_BAD_PARAMETER);
}
 
Status = AcpiUtAcquireMutex (ACPI_MTX_EVENTS);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
}
 
/* Don't allow two handlers. */
 
if (AcpiGbl_GlobalEventHandler)
{
Status = AE_ALREADY_EXISTS;
goto Cleanup;
}
 
AcpiGbl_GlobalEventHandler = Handler;
AcpiGbl_GlobalEventHandlerContext = Context;
 
 
Cleanup:
(void) AcpiUtReleaseMutex (ACPI_MTX_EVENTS);
return_ACPI_STATUS (Status);
}
 
ACPI_EXPORT_SYMBOL (AcpiInstallGlobalEventHandler)
 
 
/*******************************************************************************
*
* FUNCTION: AcpiInstallFixedEventHandler
*
* PARAMETERS: Event - Event type to enable.
691,11 → 751,11
ACPI_HANDLE GpeDevice,
UINT32 GpeNumber,
UINT32 Type,
ACPI_EVENT_HANDLER Address,
ACPI_GPE_HANDLER Address,
void *Context)
{
ACPI_GPE_EVENT_INFO *GpeEventInfo;
ACPI_HANDLER_INFO *Handler;
ACPI_GPE_HANDLER_INFO *Handler;
ACPI_STATUS Status;
ACPI_CPU_FLAGS Flags;
 
716,6 → 776,17
return_ACPI_STATUS (Status);
}
 
/* Allocate and init handler object (before lock) */
 
Handler = ACPI_ALLOCATE_ZEROED (sizeof (ACPI_GPE_HANDLER_INFO));
if (!Handler)
{
Status = AE_NO_MEMORY;
goto UnlockAndExit;
}
 
Flags = AcpiOsAcquireLock (AcpiGbl_GpeLock);
 
/* Ensure that we have a valid GPE number */
 
GpeEventInfo = AcpiEvGetGpeEventInfo (GpeDevice, GpeNumber);
722,7 → 793,7
if (!GpeEventInfo)
{
Status = AE_BAD_PARAMETER;
goto UnlockAndExit;
goto FreeAndExit;
}
 
/* Make sure that there isn't a handler there already */
731,36 → 802,40
ACPI_GPE_DISPATCH_HANDLER)
{
Status = AE_ALREADY_EXISTS;
goto UnlockAndExit;
goto FreeAndExit;
}
 
/* Allocate and init handler object */
 
Handler = ACPI_ALLOCATE_ZEROED (sizeof (ACPI_HANDLER_INFO));
if (!Handler)
{
Status = AE_NO_MEMORY;
goto UnlockAndExit;
}
 
Handler->Address = Address;
Handler->Context = Context;
Handler->MethodNode = GpeEventInfo->Dispatch.MethodNode;
Handler->OriginalFlags = (UINT8) (GpeEventInfo->Flags &
(ACPI_GPE_XRUPT_TYPE_MASK | ACPI_GPE_DISPATCH_MASK));
 
/* Disable the GPE before installing the handler */
/*
* If the GPE is associated with a method, it may have been enabled
* automatically during initialization, in which case it has to be
* disabled now to avoid spurious execution of the handler.
*/
if (((Handler->OriginalFlags & ACPI_GPE_DISPATCH_METHOD) ||
(Handler->OriginalFlags & ACPI_GPE_DISPATCH_NOTIFY)) &&
GpeEventInfo->RuntimeCount)
{
Handler->OriginallyEnabled = TRUE;
(void) AcpiEvRemoveGpeReference (GpeEventInfo);
 
Status = AcpiEvDisableGpe (GpeEventInfo);
if (ACPI_FAILURE (Status))
/* Sanity check of original type against new type */
 
if (Type != (UINT32) (GpeEventInfo->Flags & ACPI_GPE_XRUPT_TYPE_MASK))
{
goto UnlockAndExit;
ACPI_WARNING ((AE_INFO, "GPE type mismatch (level/edge)"));
}
}
 
/* Install the handler */
 
Flags = AcpiOsAcquireLock (AcpiGbl_GpeLock);
GpeEventInfo->Dispatch.Handler = Handler;
 
/* Setup up dispatch flags to indicate handler (vs. method) */
/* Setup up dispatch flags to indicate handler (vs. method/notify) */
 
GpeEventInfo->Flags &= ~(ACPI_GPE_XRUPT_TYPE_MASK | ACPI_GPE_DISPATCH_MASK);
GpeEventInfo->Flags |= (UINT8) (Type | ACPI_GPE_DISPATCH_HANDLER);
771,6 → 846,11
UnlockAndExit:
(void) AcpiUtReleaseMutex (ACPI_MTX_EVENTS);
return_ACPI_STATUS (Status);
 
FreeAndExit:
AcpiOsReleaseLock (AcpiGbl_GpeLock, Flags);
ACPI_FREE (Handler);
goto UnlockAndExit;
}
 
ACPI_EXPORT_SYMBOL (AcpiInstallGpeHandler)
795,10 → 875,10
AcpiRemoveGpeHandler (
ACPI_HANDLE GpeDevice,
UINT32 GpeNumber,
ACPI_EVENT_HANDLER Address)
ACPI_GPE_HANDLER Address)
{
ACPI_GPE_EVENT_INFO *GpeEventInfo;
ACPI_HANDLER_INFO *Handler;
ACPI_GPE_HANDLER_INFO *Handler;
ACPI_STATUS Status;
ACPI_CPU_FLAGS Flags;
 
819,6 → 899,8
return_ACPI_STATUS (Status);
}
 
Flags = AcpiOsAcquireLock (AcpiGbl_GpeLock);
 
/* Ensure that we have a valid GPE number */
 
GpeEventInfo = AcpiEvGetGpeEventInfo (GpeDevice, GpeNumber);
845,28 → 927,27
goto UnlockAndExit;
}
 
/* Disable the GPE before removing the handler */
 
Status = AcpiEvDisableGpe (GpeEventInfo);
if (ACPI_FAILURE (Status))
{
goto UnlockAndExit;
}
 
/* Remove the handler */
 
Flags = AcpiOsAcquireLock (AcpiGbl_GpeLock);
Handler = GpeEventInfo->Dispatch.Handler;
 
/* Restore Method node (if any), set dispatch flags */
 
GpeEventInfo->Dispatch.MethodNode = Handler->MethodNode;
GpeEventInfo->Flags &= ~ACPI_GPE_DISPATCH_MASK; /* Clear bits */
if (Handler->MethodNode)
GpeEventInfo->Flags &=
~(ACPI_GPE_XRUPT_TYPE_MASK | ACPI_GPE_DISPATCH_MASK);
GpeEventInfo->Flags |= Handler->OriginalFlags;
 
/*
* If the GPE was previously associated with a method and it was
* enabled, it should be enabled at this point to restore the
* post-initialization configuration.
*/
if ((Handler->OriginalFlags & ACPI_GPE_DISPATCH_METHOD) &&
Handler->OriginallyEnabled)
{
GpeEventInfo->Flags |= ACPI_GPE_DISPATCH_METHOD;
(void) AcpiEvAddGpeReference (GpeEventInfo);
}
AcpiOsReleaseLock (AcpiGbl_GpeLock, Flags);
 
/* Now we can free the handler object */
 
874,6 → 955,7
 
 
UnlockAndExit:
AcpiOsReleaseLock (AcpiGbl_GpeLock, Flags);
(void) AcpiUtReleaseMutex (ACPI_MTX_EVENTS);
return_ACPI_STATUS (Status);
}
/drivers/devman/acpica/events/evxfevnt.c
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
118,22 → 118,12
 
#include "acpi.h"
#include "accommon.h"
#include "acevents.h"
#include "acnamesp.h"
#include "actables.h"
 
#define _COMPONENT ACPI_EVENTS
ACPI_MODULE_NAME ("evxfevnt")
 
/* Local prototypes */
 
static ACPI_STATUS
AcpiEvGetGpeDevice (
ACPI_GPE_XRUPT_INFO *GpeXruptInfo,
ACPI_GPE_BLOCK_INFO *GpeBlock,
void *Context);
 
 
/*******************************************************************************
*
* FUNCTION: AcpiEnable
307,283 → 297,9
 
/*******************************************************************************
*
* FUNCTION: AcpiEnableGpe
*
* PARAMETERS: GpeDevice - Parent GPE Device. NULL for GPE0/GPE1
* GpeNumber - GPE level within the GPE block
* GpeType - ACPI_GPE_TYPE_RUNTIME or ACPI_GPE_TYPE_WAKE
* or both
*
* RETURN: Status
*
* DESCRIPTION: Add a reference to a GPE. On the first reference, the GPE is
* hardware-enabled (for runtime GPEs), or the GPE register mask
* is updated (for wake GPEs).
*
******************************************************************************/
 
ACPI_STATUS
AcpiEnableGpe (
ACPI_HANDLE GpeDevice,
UINT32 GpeNumber,
UINT8 GpeType)
{
ACPI_STATUS Status = AE_OK;
ACPI_GPE_EVENT_INFO *GpeEventInfo;
ACPI_CPU_FLAGS Flags;
 
 
ACPI_FUNCTION_TRACE (AcpiEnableGpe);
 
 
/* Parameter validation */
 
if (!GpeType || (GpeType & ~ACPI_GPE_TYPE_WAKE_RUN))
{
return_ACPI_STATUS (AE_BAD_PARAMETER);
}
 
Flags = AcpiOsAcquireLock (AcpiGbl_GpeLock);
 
/* Ensure that we have a valid GPE number */
 
GpeEventInfo = AcpiEvGetGpeEventInfo (GpeDevice, GpeNumber);
if (!GpeEventInfo)
{
Status = AE_BAD_PARAMETER;
goto UnlockAndExit;
}
 
if (GpeType & ACPI_GPE_TYPE_RUNTIME)
{
if (GpeEventInfo->RuntimeCount == ACPI_UINT8_MAX)
{
Status = AE_LIMIT; /* Too many references */
goto UnlockAndExit;
}
 
GpeEventInfo->RuntimeCount++;
if (GpeEventInfo->RuntimeCount == 1)
{
Status = AcpiEvEnableGpe (GpeEventInfo);
if (ACPI_FAILURE (Status))
{
GpeEventInfo->RuntimeCount--;
goto UnlockAndExit;
}
}
}
 
if (GpeType & ACPI_GPE_TYPE_WAKE)
{
/* The GPE must have the ability to wake the system */
 
if (!(GpeEventInfo->Flags & ACPI_GPE_CAN_WAKE))
{
Status = AE_TYPE;
goto UnlockAndExit;
}
 
if (GpeEventInfo->WakeupCount == ACPI_UINT8_MAX)
{
Status = AE_LIMIT; /* Too many references */
goto UnlockAndExit;
}
 
/*
* Update the enable mask on the first wakeup reference. Wake GPEs
* are only hardware-enabled just before sleeping.
*/
GpeEventInfo->WakeupCount++;
if (GpeEventInfo->WakeupCount == 1)
{
(void) AcpiEvUpdateGpeEnableMasks (GpeEventInfo);
}
}
 
UnlockAndExit:
AcpiOsReleaseLock (AcpiGbl_GpeLock, Flags);
return_ACPI_STATUS (Status);
}
 
ACPI_EXPORT_SYMBOL (AcpiEnableGpe)
 
 
/*******************************************************************************
*
* FUNCTION: AcpiDisableGpe
*
* PARAMETERS: GpeDevice - Parent GPE Device. NULL for GPE0/GPE1
* GpeNumber - GPE level within the GPE block
* GpeType - ACPI_GPE_TYPE_RUNTIME or ACPI_GPE_TYPE_WAKE
* or both
*
* RETURN: Status
*
* DESCRIPTION: Remove a reference to a GPE. When the last reference is
* removed, only then is the GPE disabled (for runtime GPEs), or
* the GPE mask bit disabled (for wake GPEs)
*
******************************************************************************/
 
ACPI_STATUS
AcpiDisableGpe (
ACPI_HANDLE GpeDevice,
UINT32 GpeNumber,
UINT8 GpeType)
{
ACPI_STATUS Status = AE_OK;
ACPI_GPE_EVENT_INFO *GpeEventInfo;
ACPI_CPU_FLAGS Flags;
 
 
ACPI_FUNCTION_TRACE (AcpiDisableGpe);
 
 
/* Parameter validation */
 
if (!GpeType || (GpeType & ~ACPI_GPE_TYPE_WAKE_RUN))
{
return_ACPI_STATUS (AE_BAD_PARAMETER);
}
 
Flags = AcpiOsAcquireLock (AcpiGbl_GpeLock);
 
/* Ensure that we have a valid GPE number */
 
GpeEventInfo = AcpiEvGetGpeEventInfo (GpeDevice, GpeNumber);
if (!GpeEventInfo)
{
Status = AE_BAD_PARAMETER;
goto UnlockAndExit;
}
 
/* Hardware-disable a runtime GPE on removal of the last reference */
 
if (GpeType & ACPI_GPE_TYPE_RUNTIME)
{
if (!GpeEventInfo->RuntimeCount)
{
Status = AE_LIMIT; /* There are no references to remove */
goto UnlockAndExit;
}
 
GpeEventInfo->RuntimeCount--;
if (!GpeEventInfo->RuntimeCount)
{
Status = AcpiEvDisableGpe (GpeEventInfo);
if (ACPI_FAILURE (Status))
{
GpeEventInfo->RuntimeCount++;
goto UnlockAndExit;
}
}
}
 
/*
* Update masks for wake GPE on removal of the last reference.
* No need to hardware-disable wake GPEs here, they are not currently
* enabled.
*/
if (GpeType & ACPI_GPE_TYPE_WAKE)
{
if (!GpeEventInfo->WakeupCount)
{
Status = AE_LIMIT; /* There are no references to remove */
goto UnlockAndExit;
}
 
GpeEventInfo->WakeupCount--;
if (!GpeEventInfo->WakeupCount)
{
(void) AcpiEvUpdateGpeEnableMasks (GpeEventInfo);
}
}
 
 
UnlockAndExit:
AcpiOsReleaseLock (AcpiGbl_GpeLock, Flags);
return_ACPI_STATUS (Status);
}
 
ACPI_EXPORT_SYMBOL (AcpiDisableGpe)
 
 
/*******************************************************************************
*
* FUNCTION: AcpiSetGpe
*
* PARAMETERS: GpeDevice - Parent GPE Device. NULL for GPE0/GPE1
* GpeNumber - GPE level within the GPE block
* Action - ACPI_GPE_ENABLE or ACPI_GPE_DISABLE
*
* RETURN: Status
*
* DESCRIPTION: Enable or disable an individual GPE. This function bypasses
* the reference count mechanism used in the AcpiEnableGpe and
* AcpiDisableGpe interfaces -- and should be used with care.
*
* Note: Typically used to disable a runtime GPE for short period of time,
* then re-enable it, without disturbing the existing reference counts. This
* is useful, for example, in the Embedded Controller (EC) driver.
*
******************************************************************************/
 
ACPI_STATUS
AcpiSetGpe (
ACPI_HANDLE GpeDevice,
UINT32 GpeNumber,
UINT8 Action)
{
ACPI_GPE_EVENT_INFO *GpeEventInfo;
ACPI_STATUS Status;
ACPI_CPU_FLAGS Flags;
 
 
ACPI_FUNCTION_TRACE (AcpiSetGpe);
 
 
Flags = AcpiOsAcquireLock (AcpiGbl_GpeLock);
 
/* Ensure that we have a valid GPE number */
 
GpeEventInfo = AcpiEvGetGpeEventInfo (GpeDevice, GpeNumber);
if (!GpeEventInfo)
{
Status = AE_BAD_PARAMETER;
goto UnlockAndExit;
}
 
/* Perform the action */
 
switch (Action)
{
case ACPI_GPE_ENABLE:
Status = AcpiEvEnableGpe (GpeEventInfo);
break;
 
case ACPI_GPE_DISABLE:
Status = AcpiEvDisableGpe (GpeEventInfo);
break;
 
default:
Status = AE_BAD_PARAMETER;
break;
}
 
UnlockAndExit:
AcpiOsReleaseLock (AcpiGbl_GpeLock, Flags);
return_ACPI_STATUS (Status);
}
 
ACPI_EXPORT_SYMBOL (AcpiSetGpe)
 
 
/*******************************************************************************
*
* FUNCTION: AcpiDisableEvent
*
* PARAMETERS: Event - The fixed eventto be enabled
* PARAMETERS: Event - The fixed event to be disabled
* Flags - Reserved
*
* RETURN: Status
688,53 → 404,6
 
/*******************************************************************************
*
* FUNCTION: AcpiClearGpe
*
* PARAMETERS: GpeDevice - Parent GPE Device. NULL for GPE0/GPE1
* GpeNumber - GPE level within the GPE block
*
* RETURN: Status
*
* DESCRIPTION: Clear an ACPI event (general purpose)
*
******************************************************************************/
 
ACPI_STATUS
AcpiClearGpe (
ACPI_HANDLE GpeDevice,
UINT32 GpeNumber)
{
ACPI_STATUS Status = AE_OK;
ACPI_GPE_EVENT_INFO *GpeEventInfo;
ACPI_CPU_FLAGS Flags;
 
 
ACPI_FUNCTION_TRACE (AcpiClearGpe);
 
 
Flags = AcpiOsAcquireLock (AcpiGbl_GpeLock);
 
/* Ensure that we have a valid GPE number */
 
GpeEventInfo = AcpiEvGetGpeEventInfo (GpeDevice, GpeNumber);
if (!GpeEventInfo)
{
Status = AE_BAD_PARAMETER;
goto UnlockAndExit;
}
 
Status = AcpiHwClearGpe (GpeEventInfo);
 
UnlockAndExit:
AcpiOsReleaseLock (AcpiGbl_GpeLock, Flags);
return_ACPI_STATUS (Status);
}
 
ACPI_EXPORT_SYMBOL (AcpiClearGpe)
 
 
/*******************************************************************************
*
* FUNCTION: AcpiGetEventStatus
*
* PARAMETERS: Event - The fixed event
781,400 → 450,3
ACPI_EXPORT_SYMBOL (AcpiGetEventStatus)
 
 
/*******************************************************************************
*
* FUNCTION: AcpiGetGpeStatus
*
* PARAMETERS: GpeDevice - Parent GPE Device. NULL for GPE0/GPE1
* GpeNumber - GPE level within the GPE block
* EventStatus - Where the current status of the event will
* be returned
*
* RETURN: Status
*
* DESCRIPTION: Get status of an event (general purpose)
*
******************************************************************************/
 
ACPI_STATUS
AcpiGetGpeStatus (
ACPI_HANDLE GpeDevice,
UINT32 GpeNumber,
ACPI_EVENT_STATUS *EventStatus)
{
ACPI_STATUS Status = AE_OK;
ACPI_GPE_EVENT_INFO *GpeEventInfo;
ACPI_CPU_FLAGS Flags;
 
 
ACPI_FUNCTION_TRACE (AcpiGetGpeStatus);
 
 
Flags = AcpiOsAcquireLock (AcpiGbl_GpeLock);
 
/* Ensure that we have a valid GPE number */
 
GpeEventInfo = AcpiEvGetGpeEventInfo (GpeDevice, GpeNumber);
if (!GpeEventInfo)
{
Status = AE_BAD_PARAMETER;
goto UnlockAndExit;
}
 
/* Obtain status on the requested GPE number */
 
Status = AcpiHwGetGpeStatus (GpeEventInfo, EventStatus);
 
UnlockAndExit:
AcpiOsReleaseLock (AcpiGbl_GpeLock, Flags);
return_ACPI_STATUS (Status);
}
 
ACPI_EXPORT_SYMBOL (AcpiGetGpeStatus)
 
 
/*******************************************************************************
*
* FUNCTION: AcpiInstallGpeBlock
*
* PARAMETERS: GpeDevice - Handle to the parent GPE Block Device
* GpeBlockAddress - Address and SpaceID
* RegisterCount - Number of GPE register pairs in the block
* InterruptNumber - H/W interrupt for the block
*
* RETURN: Status
*
* DESCRIPTION: Create and Install a block of GPE registers
*
******************************************************************************/
 
ACPI_STATUS
AcpiInstallGpeBlock (
ACPI_HANDLE GpeDevice,
ACPI_GENERIC_ADDRESS *GpeBlockAddress,
UINT32 RegisterCount,
UINT32 InterruptNumber)
{
ACPI_STATUS Status;
ACPI_OPERAND_OBJECT *ObjDesc;
ACPI_NAMESPACE_NODE *Node;
ACPI_GPE_BLOCK_INFO *GpeBlock;
 
 
ACPI_FUNCTION_TRACE (AcpiInstallGpeBlock);
 
 
if ((!GpeDevice) ||
(!GpeBlockAddress) ||
(!RegisterCount))
{
return_ACPI_STATUS (AE_BAD_PARAMETER);
}
 
Status = AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE);
if (ACPI_FAILURE (Status))
{
return (Status);
}
 
Node = AcpiNsValidateHandle (GpeDevice);
if (!Node)
{
Status = AE_BAD_PARAMETER;
goto UnlockAndExit;
}
 
/*
* For user-installed GPE Block Devices, the GpeBlockBaseNumber
* is always zero
*/
Status = AcpiEvCreateGpeBlock (Node, GpeBlockAddress, RegisterCount,
0, InterruptNumber, &GpeBlock);
if (ACPI_FAILURE (Status))
{
goto UnlockAndExit;
}
 
/* Install block in the DeviceObject attached to the node */
 
ObjDesc = AcpiNsGetAttachedObject (Node);
if (!ObjDesc)
{
/*
* No object, create a new one (Device nodes do not always have
* an attached object)
*/
ObjDesc = AcpiUtCreateInternalObject (ACPI_TYPE_DEVICE);
if (!ObjDesc)
{
Status = AE_NO_MEMORY;
goto UnlockAndExit;
}
 
Status = AcpiNsAttachObject (Node, ObjDesc, ACPI_TYPE_DEVICE);
 
/* Remove local reference to the object */
 
AcpiUtRemoveReference (ObjDesc);
if (ACPI_FAILURE (Status))
{
goto UnlockAndExit;
}
}
 
/* Now install the GPE block in the DeviceObject */
 
ObjDesc->Device.GpeBlock = GpeBlock;
 
/* Run the _PRW methods and enable the runtime GPEs in the new block */
 
Status = AcpiEvInitializeGpeBlock (Node, GpeBlock);
 
 
UnlockAndExit:
(void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE);
return_ACPI_STATUS (Status);
}
 
ACPI_EXPORT_SYMBOL (AcpiInstallGpeBlock)
 
 
/*******************************************************************************
*
* FUNCTION: AcpiRemoveGpeBlock
*
* PARAMETERS: GpeDevice - Handle to the parent GPE Block Device
*
* RETURN: Status
*
* DESCRIPTION: Remove a previously installed block of GPE registers
*
******************************************************************************/
 
ACPI_STATUS
AcpiRemoveGpeBlock (
ACPI_HANDLE GpeDevice)
{
ACPI_OPERAND_OBJECT *ObjDesc;
ACPI_STATUS Status;
ACPI_NAMESPACE_NODE *Node;
 
 
ACPI_FUNCTION_TRACE (AcpiRemoveGpeBlock);
 
 
if (!GpeDevice)
{
return_ACPI_STATUS (AE_BAD_PARAMETER);
}
 
Status = AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE);
if (ACPI_FAILURE (Status))
{
return (Status);
}
 
Node = AcpiNsValidateHandle (GpeDevice);
if (!Node)
{
Status = AE_BAD_PARAMETER;
goto UnlockAndExit;
}
 
/* Get the DeviceObject attached to the node */
 
ObjDesc = AcpiNsGetAttachedObject (Node);
if (!ObjDesc ||
!ObjDesc->Device.GpeBlock)
{
return_ACPI_STATUS (AE_NULL_OBJECT);
}
 
/* Delete the GPE block (but not the DeviceObject) */
 
Status = AcpiEvDeleteGpeBlock (ObjDesc->Device.GpeBlock);
if (ACPI_SUCCESS (Status))
{
ObjDesc->Device.GpeBlock = NULL;
}
 
UnlockAndExit:
(void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE);
return_ACPI_STATUS (Status);
}
 
ACPI_EXPORT_SYMBOL (AcpiRemoveGpeBlock)
 
 
/*******************************************************************************
*
* FUNCTION: AcpiGetGpeDevice
*
* PARAMETERS: Index - System GPE index (0-CurrentGpeCount)
* GpeDevice - Where the parent GPE Device is returned
*
* RETURN: Status
*
* DESCRIPTION: Obtain the GPE device associated with the input index. A NULL
* gpe device indicates that the gpe number is contained in one of
* the FADT-defined gpe blocks. Otherwise, the GPE block device.
*
******************************************************************************/
 
ACPI_STATUS
AcpiGetGpeDevice (
UINT32 Index,
ACPI_HANDLE *GpeDevice)
{
ACPI_GPE_DEVICE_INFO Info;
ACPI_STATUS Status;
 
 
ACPI_FUNCTION_TRACE (AcpiGetGpeDevice);
 
 
if (!GpeDevice)
{
return_ACPI_STATUS (AE_BAD_PARAMETER);
}
 
if (Index >= AcpiCurrentGpeCount)
{
return_ACPI_STATUS (AE_NOT_EXIST);
}
 
/* Setup and walk the GPE list */
 
Info.Index = Index;
Info.Status = AE_NOT_EXIST;
Info.GpeDevice = NULL;
Info.NextBlockBaseIndex = 0;
 
Status = AcpiEvWalkGpeList (AcpiEvGetGpeDevice, &Info);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
}
 
*GpeDevice = ACPI_CAST_PTR (ACPI_HANDLE, Info.GpeDevice);
return_ACPI_STATUS (Info.Status);
}
 
ACPI_EXPORT_SYMBOL (AcpiGetGpeDevice)
 
 
/*******************************************************************************
*
* FUNCTION: AcpiEvGetGpeDevice
*
* PARAMETERS: GPE_WALK_CALLBACK
*
* RETURN: Status
*
* DESCRIPTION: Matches the input GPE index (0-CurrentGpeCount) with a GPE
* block device. NULL if the GPE is one of the FADT-defined GPEs.
*
******************************************************************************/
 
static ACPI_STATUS
AcpiEvGetGpeDevice (
ACPI_GPE_XRUPT_INFO *GpeXruptInfo,
ACPI_GPE_BLOCK_INFO *GpeBlock,
void *Context)
{
ACPI_GPE_DEVICE_INFO *Info = Context;
 
 
/* Increment Index by the number of GPEs in this block */
 
Info->NextBlockBaseIndex += GpeBlock->GpeCount;
 
if (Info->Index < Info->NextBlockBaseIndex)
{
/*
* The GPE index is within this block, get the node. Leave the node
* NULL for the FADT-defined GPEs
*/
if ((GpeBlock->Node)->Type == ACPI_TYPE_DEVICE)
{
Info->GpeDevice = GpeBlock->Node;
}
 
Info->Status = AE_OK;
return (AE_CTRL_END);
}
 
return (AE_OK);
}
 
 
/******************************************************************************
*
* FUNCTION: AcpiDisableAllGpes
*
* PARAMETERS: None
*
* RETURN: Status
*
* DESCRIPTION: Disable and clear all GPEs in all GPE blocks
*
******************************************************************************/
 
ACPI_STATUS
AcpiDisableAllGpes (
void)
{
ACPI_STATUS Status;
 
 
ACPI_FUNCTION_TRACE (AcpiDisableAllGpes);
 
 
Status = AcpiUtAcquireMutex (ACPI_MTX_EVENTS);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
}
 
Status = AcpiHwDisableAllGpes ();
(void) AcpiUtReleaseMutex (ACPI_MTX_EVENTS);
 
return_ACPI_STATUS (Status);
}
 
 
/******************************************************************************
*
* FUNCTION: AcpiEnableAllRuntimeGpes
*
* PARAMETERS: None
*
* RETURN: Status
*
* DESCRIPTION: Enable all "runtime" GPEs, in all GPE blocks
*
******************************************************************************/
 
ACPI_STATUS
AcpiEnableAllRuntimeGpes (
void)
{
ACPI_STATUS Status;
 
 
ACPI_FUNCTION_TRACE (AcpiEnableAllRuntimeGpes);
 
 
Status = AcpiUtAcquireMutex (ACPI_MTX_EVENTS);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
}
 
Status = AcpiHwEnableAllRuntimeGpes ();
(void) AcpiUtReleaseMutex (ACPI_MTX_EVENTS);
 
return_ACPI_STATUS (Status);
}
 
 
/drivers/devman/acpica/events/evxfgpe.c
0,0 → 1,972
/******************************************************************************
*
* Module Name: evxfgpe - External Interfaces for General Purpose Events (GPEs)
*
*****************************************************************************/
 
/******************************************************************************
*
* 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 __EVXFGPE_C__
 
#include "acpi.h"
#include "accommon.h"
#include "acevents.h"
#include "acnamesp.h"
 
#define _COMPONENT ACPI_EVENTS
ACPI_MODULE_NAME ("evxfgpe")
 
 
/*******************************************************************************
*
* FUNCTION: AcpiUpdateAllGpes
*
* PARAMETERS: None
*
* RETURN: Status
*
* DESCRIPTION: Complete GPE initialization and enable all GPEs that have
* associated _Lxx or _Exx methods and are not pointed to by any
* device _PRW methods (this indicates that these GPEs are
* generally intended for system or device wakeup. Such GPEs
* have to be enabled directly when the devices whose _PRW
* methods point to them are set up for wakeup signaling.)
*
* NOTE: Should be called after any GPEs are added to the system. Primarily,
* after the system _PRW methods have been run, but also after a GPE Block
* Device has been added or if any new GPE methods have been added via a
* dynamic table load.
*
******************************************************************************/
 
ACPI_STATUS
AcpiUpdateAllGpes (
void)
{
ACPI_STATUS Status;
 
 
ACPI_FUNCTION_TRACE (AcpiUpdateGpes);
 
 
Status = AcpiUtAcquireMutex (ACPI_MTX_EVENTS);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
}
 
if (AcpiGbl_AllGpesInitialized)
{
goto UnlockAndExit;
}
 
Status = AcpiEvWalkGpeList (AcpiEvInitializeGpeBlock, NULL);
if (ACPI_SUCCESS (Status))
{
AcpiGbl_AllGpesInitialized = TRUE;
}
 
UnlockAndExit:
(void) AcpiUtReleaseMutex (ACPI_MTX_EVENTS);
return_ACPI_STATUS (Status);
}
 
ACPI_EXPORT_SYMBOL (AcpiUpdateAllGpes)
 
 
/*******************************************************************************
*
* FUNCTION: AcpiEnableGpe
*
* PARAMETERS: GpeDevice - Parent GPE Device. NULL for GPE0/GPE1
* GpeNumber - GPE level within the GPE block
*
* RETURN: Status
*
* DESCRIPTION: Add a reference to a GPE. On the first reference, the GPE is
* hardware-enabled.
*
******************************************************************************/
 
ACPI_STATUS
AcpiEnableGpe (
ACPI_HANDLE GpeDevice,
UINT32 GpeNumber)
{
ACPI_STATUS Status = AE_BAD_PARAMETER;
ACPI_GPE_EVENT_INFO *GpeEventInfo;
ACPI_CPU_FLAGS Flags;
 
 
ACPI_FUNCTION_TRACE (AcpiEnableGpe);
 
 
Flags = AcpiOsAcquireLock (AcpiGbl_GpeLock);
 
/* Ensure that we have a valid GPE number */
 
GpeEventInfo = AcpiEvGetGpeEventInfo (GpeDevice, GpeNumber);
if (GpeEventInfo)
{
Status = AcpiEvAddGpeReference (GpeEventInfo);
}
 
AcpiOsReleaseLock (AcpiGbl_GpeLock, Flags);
return_ACPI_STATUS (Status);
}
 
ACPI_EXPORT_SYMBOL (AcpiEnableGpe)
 
 
/*******************************************************************************
*
* FUNCTION: AcpiDisableGpe
*
* PARAMETERS: GpeDevice - Parent GPE Device. NULL for GPE0/GPE1
* GpeNumber - GPE level within the GPE block
*
* RETURN: Status
*
* DESCRIPTION: Remove a reference to a GPE. When the last reference is
* removed, only then is the GPE disabled (for runtime GPEs), or
* the GPE mask bit disabled (for wake GPEs)
*
******************************************************************************/
 
ACPI_STATUS
AcpiDisableGpe (
ACPI_HANDLE GpeDevice,
UINT32 GpeNumber)
{
ACPI_STATUS Status = AE_BAD_PARAMETER;
ACPI_GPE_EVENT_INFO *GpeEventInfo;
ACPI_CPU_FLAGS Flags;
 
 
ACPI_FUNCTION_TRACE (AcpiDisableGpe);
 
 
Flags = AcpiOsAcquireLock (AcpiGbl_GpeLock);
 
/* Ensure that we have a valid GPE number */
 
GpeEventInfo = AcpiEvGetGpeEventInfo (GpeDevice, GpeNumber);
if (GpeEventInfo)
{
Status = AcpiEvRemoveGpeReference (GpeEventInfo);
}
 
AcpiOsReleaseLock (AcpiGbl_GpeLock, Flags);
return_ACPI_STATUS (Status);
}
 
ACPI_EXPORT_SYMBOL (AcpiDisableGpe)
 
 
/*******************************************************************************
*
* FUNCTION: AcpiSetGpe
*
* PARAMETERS: GpeDevice - Parent GPE Device. NULL for GPE0/GPE1
* GpeNumber - GPE level within the GPE block
* Action - ACPI_GPE_ENABLE or ACPI_GPE_DISABLE
*
* RETURN: Status
*
* DESCRIPTION: Enable or disable an individual GPE. This function bypasses
* the reference count mechanism used in the AcpiEnableGpe and
* AcpiDisableGpe interfaces -- and should be used with care.
*
* Note: Typically used to disable a runtime GPE for short period of time,
* then re-enable it, without disturbing the existing reference counts. This
* is useful, for example, in the Embedded Controller (EC) driver.
*
******************************************************************************/
 
ACPI_STATUS
AcpiSetGpe (
ACPI_HANDLE GpeDevice,
UINT32 GpeNumber,
UINT8 Action)
{
ACPI_GPE_EVENT_INFO *GpeEventInfo;
ACPI_STATUS Status;
ACPI_CPU_FLAGS Flags;
 
 
ACPI_FUNCTION_TRACE (AcpiSetGpe);
 
 
Flags = AcpiOsAcquireLock (AcpiGbl_GpeLock);
 
/* Ensure that we have a valid GPE number */
 
GpeEventInfo = AcpiEvGetGpeEventInfo (GpeDevice, GpeNumber);
if (!GpeEventInfo)
{
Status = AE_BAD_PARAMETER;
goto UnlockAndExit;
}
 
/* Perform the action */
 
switch (Action)
{
case ACPI_GPE_ENABLE:
Status = AcpiEvEnableGpe (GpeEventInfo);
break;
 
case ACPI_GPE_DISABLE:
Status = AcpiHwLowSetGpe (GpeEventInfo, ACPI_GPE_DISABLE);
break;
 
default:
Status = AE_BAD_PARAMETER;
break;
}
 
UnlockAndExit:
AcpiOsReleaseLock (AcpiGbl_GpeLock, Flags);
return_ACPI_STATUS (Status);
}
 
ACPI_EXPORT_SYMBOL (AcpiSetGpe)
 
 
/*******************************************************************************
*
* FUNCTION: AcpiSetupGpeForWake
*
* PARAMETERS: WakeDevice - Device associated with the GPE (via _PRW)
* GpeDevice - Parent GPE Device. NULL for GPE0/GPE1
* GpeNumber - GPE level within the GPE block
*
* RETURN: Status
*
* DESCRIPTION: Mark a GPE as having the ability to wake the system. This
* interface is intended to be used as the host executes the
* _PRW methods (Power Resources for Wake) in the system tables.
* Each _PRW appears under a Device Object (The WakeDevice), and
* contains the info for the wake GPE associated with the
* WakeDevice.
*
******************************************************************************/
 
ACPI_STATUS
AcpiSetupGpeForWake (
ACPI_HANDLE WakeDevice,
ACPI_HANDLE GpeDevice,
UINT32 GpeNumber)
{
ACPI_STATUS Status = AE_BAD_PARAMETER;
ACPI_GPE_EVENT_INFO *GpeEventInfo;
ACPI_NAMESPACE_NODE *DeviceNode;
ACPI_CPU_FLAGS Flags;
 
 
ACPI_FUNCTION_TRACE (AcpiSetupGpeForWake);
 
 
/* Parameter Validation */
 
if (!WakeDevice)
{
/*
* By forcing WakeDevice to be valid, we automatically enable the
* implicit notify feature on all hosts.
*/
return_ACPI_STATUS (AE_BAD_PARAMETER);
}
 
/* Handle root object case */
 
if (WakeDevice == ACPI_ROOT_OBJECT)
{
DeviceNode = AcpiGbl_RootNode;
}
else
{
DeviceNode = ACPI_CAST_PTR (ACPI_NAMESPACE_NODE, WakeDevice);
}
 
/* Validate WakeDevice is of type Device */
 
if (DeviceNode->Type != ACPI_TYPE_DEVICE)
{
return_ACPI_STATUS (AE_BAD_PARAMETER);
}
 
Flags = AcpiOsAcquireLock (AcpiGbl_GpeLock);
 
/* Ensure that we have a valid GPE number */
 
GpeEventInfo = AcpiEvGetGpeEventInfo (GpeDevice, GpeNumber);
if (GpeEventInfo)
{
/*
* If there is no method or handler for this GPE, then the
* WakeDevice will be notified whenever this GPE fires (aka
* "implicit notify") Note: The GPE is assumed to be
* level-triggered (for windows compatibility).
*/
if ((GpeEventInfo->Flags & ACPI_GPE_DISPATCH_MASK) ==
ACPI_GPE_DISPATCH_NONE)
{
GpeEventInfo->Flags =
(ACPI_GPE_DISPATCH_NOTIFY | ACPI_GPE_LEVEL_TRIGGERED);
GpeEventInfo->Dispatch.DeviceNode = DeviceNode;
}
 
GpeEventInfo->Flags |= ACPI_GPE_CAN_WAKE;
Status = AE_OK;
}
 
AcpiOsReleaseLock (AcpiGbl_GpeLock, Flags);
return_ACPI_STATUS (Status);
}
 
ACPI_EXPORT_SYMBOL (AcpiSetupGpeForWake)
 
 
/*******************************************************************************
*
* FUNCTION: AcpiSetGpeWakeMask
*
* PARAMETERS: GpeDevice - Parent GPE Device. NULL for GPE0/GPE1
* GpeNumber - GPE level within the GPE block
* Action - Enable or Disable
*
* RETURN: Status
*
* DESCRIPTION: Set or clear the GPE's wakeup enable mask bit. The GPE must
* already be marked as a WAKE GPE.
*
******************************************************************************/
 
ACPI_STATUS
AcpiSetGpeWakeMask (
ACPI_HANDLE GpeDevice,
UINT32 GpeNumber,
UINT8 Action)
{
ACPI_STATUS Status = AE_OK;
ACPI_GPE_EVENT_INFO *GpeEventInfo;
ACPI_GPE_REGISTER_INFO *GpeRegisterInfo;
ACPI_CPU_FLAGS Flags;
UINT32 RegisterBit;
 
 
ACPI_FUNCTION_TRACE (AcpiSetGpeWakeMask);
 
 
Flags = AcpiOsAcquireLock (AcpiGbl_GpeLock);
 
/*
* Ensure that we have a valid GPE number and that this GPE is in
* fact a wake GPE
*/
GpeEventInfo = AcpiEvGetGpeEventInfo (GpeDevice, GpeNumber);
if (!GpeEventInfo)
{
Status = AE_BAD_PARAMETER;
goto UnlockAndExit;
}
 
if (!(GpeEventInfo->Flags & ACPI_GPE_CAN_WAKE))
{
Status = AE_TYPE;
goto UnlockAndExit;
}
 
GpeRegisterInfo = GpeEventInfo->RegisterInfo;
if (!GpeRegisterInfo)
{
Status = AE_NOT_EXIST;
goto UnlockAndExit;
}
 
RegisterBit = AcpiHwGetGpeRegisterBit (GpeEventInfo, GpeRegisterInfo);
 
/* Perform the action */
 
switch (Action)
{
case ACPI_GPE_ENABLE:
ACPI_SET_BIT (GpeRegisterInfo->EnableForWake, (UINT8) RegisterBit);
break;
 
case ACPI_GPE_DISABLE:
ACPI_CLEAR_BIT (GpeRegisterInfo->EnableForWake, (UINT8) RegisterBit);
break;
 
default:
ACPI_ERROR ((AE_INFO, "%u, Invalid action", Action));
Status = AE_BAD_PARAMETER;
break;
}
 
UnlockAndExit:
AcpiOsReleaseLock (AcpiGbl_GpeLock, Flags);
return_ACPI_STATUS (Status);
}
 
ACPI_EXPORT_SYMBOL (AcpiSetGpeWakeMask)
 
 
/*******************************************************************************
*
* FUNCTION: AcpiClearGpe
*
* PARAMETERS: GpeDevice - Parent GPE Device. NULL for GPE0/GPE1
* GpeNumber - GPE level within the GPE block
*
* RETURN: Status
*
* DESCRIPTION: Clear an ACPI event (general purpose)
*
******************************************************************************/
 
ACPI_STATUS
AcpiClearGpe (
ACPI_HANDLE GpeDevice,
UINT32 GpeNumber)
{
ACPI_STATUS Status = AE_OK;
ACPI_GPE_EVENT_INFO *GpeEventInfo;
ACPI_CPU_FLAGS Flags;
 
 
ACPI_FUNCTION_TRACE (AcpiClearGpe);
 
 
Flags = AcpiOsAcquireLock (AcpiGbl_GpeLock);
 
/* Ensure that we have a valid GPE number */
 
GpeEventInfo = AcpiEvGetGpeEventInfo (GpeDevice, GpeNumber);
if (!GpeEventInfo)
{
Status = AE_BAD_PARAMETER;
goto UnlockAndExit;
}
 
Status = AcpiHwClearGpe (GpeEventInfo);
 
UnlockAndExit:
AcpiOsReleaseLock (AcpiGbl_GpeLock, Flags);
return_ACPI_STATUS (Status);
}
 
ACPI_EXPORT_SYMBOL (AcpiClearGpe)
 
 
/*******************************************************************************
*
* FUNCTION: AcpiGetGpeStatus
*
* PARAMETERS: GpeDevice - Parent GPE Device. NULL for GPE0/GPE1
* GpeNumber - GPE level within the GPE block
* EventStatus - Where the current status of the event
* will be returned
*
* RETURN: Status
*
* DESCRIPTION: Get the current status of a GPE (signalled/not_signalled)
*
******************************************************************************/
 
ACPI_STATUS
AcpiGetGpeStatus (
ACPI_HANDLE GpeDevice,
UINT32 GpeNumber,
ACPI_EVENT_STATUS *EventStatus)
{
ACPI_STATUS Status = AE_OK;
ACPI_GPE_EVENT_INFO *GpeEventInfo;
ACPI_CPU_FLAGS Flags;
 
 
ACPI_FUNCTION_TRACE (AcpiGetGpeStatus);
 
 
Flags = AcpiOsAcquireLock (AcpiGbl_GpeLock);
 
/* Ensure that we have a valid GPE number */
 
GpeEventInfo = AcpiEvGetGpeEventInfo (GpeDevice, GpeNumber);
if (!GpeEventInfo)
{
Status = AE_BAD_PARAMETER;
goto UnlockAndExit;
}
 
/* Obtain status on the requested GPE number */
 
Status = AcpiHwGetGpeStatus (GpeEventInfo, EventStatus);
 
UnlockAndExit:
AcpiOsReleaseLock (AcpiGbl_GpeLock, Flags);
return_ACPI_STATUS (Status);
}
 
ACPI_EXPORT_SYMBOL (AcpiGetGpeStatus)
 
 
/*******************************************************************************
*
* FUNCTION: AcpiFinishGpe
*
* PARAMETERS: GpeDevice - Namespace node for the GPE Block
* (NULL for FADT defined GPEs)
* GpeNumber - GPE level within the GPE block
*
* RETURN: Status
*
* DESCRIPTION: Clear and conditionally reenable a GPE. This completes the GPE
* processing. Intended for use by asynchronous host-installed
* GPE handlers. The GPE is only reenabled if the EnableForRun bit
* is set in the GPE info.
*
******************************************************************************/
 
ACPI_STATUS
AcpiFinishGpe (
ACPI_HANDLE GpeDevice,
UINT32 GpeNumber)
{
ACPI_GPE_EVENT_INFO *GpeEventInfo;
ACPI_STATUS Status;
ACPI_CPU_FLAGS Flags;
 
 
ACPI_FUNCTION_TRACE (AcpiFinishGpe);
 
 
Flags = AcpiOsAcquireLock (AcpiGbl_GpeLock);
 
/* Ensure that we have a valid GPE number */
 
GpeEventInfo = AcpiEvGetGpeEventInfo (GpeDevice, GpeNumber);
if (!GpeEventInfo)
{
Status = AE_BAD_PARAMETER;
goto UnlockAndExit;
}
 
Status = AcpiEvFinishGpe (GpeEventInfo);
 
UnlockAndExit:
AcpiOsReleaseLock (AcpiGbl_GpeLock, Flags);
return_ACPI_STATUS (Status);
}
 
ACPI_EXPORT_SYMBOL (AcpiFinishGpe)
 
 
/******************************************************************************
*
* FUNCTION: AcpiDisableAllGpes
*
* PARAMETERS: None
*
* RETURN: Status
*
* DESCRIPTION: Disable and clear all GPEs in all GPE blocks
*
******************************************************************************/
 
ACPI_STATUS
AcpiDisableAllGpes (
void)
{
ACPI_STATUS Status;
 
 
ACPI_FUNCTION_TRACE (AcpiDisableAllGpes);
 
 
Status = AcpiUtAcquireMutex (ACPI_MTX_EVENTS);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
}
 
Status = AcpiHwDisableAllGpes ();
(void) AcpiUtReleaseMutex (ACPI_MTX_EVENTS);
 
return_ACPI_STATUS (Status);
}
 
ACPI_EXPORT_SYMBOL (AcpiDisableAllGpes)
 
 
/******************************************************************************
*
* FUNCTION: AcpiEnableAllRuntimeGpes
*
* PARAMETERS: None
*
* RETURN: Status
*
* DESCRIPTION: Enable all "runtime" GPEs, in all GPE blocks
*
******************************************************************************/
 
ACPI_STATUS
AcpiEnableAllRuntimeGpes (
void)
{
ACPI_STATUS Status;
 
 
ACPI_FUNCTION_TRACE (AcpiEnableAllRuntimeGpes);
 
 
Status = AcpiUtAcquireMutex (ACPI_MTX_EVENTS);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
}
 
Status = AcpiHwEnableAllRuntimeGpes ();
(void) AcpiUtReleaseMutex (ACPI_MTX_EVENTS);
 
return_ACPI_STATUS (Status);
}
 
ACPI_EXPORT_SYMBOL (AcpiEnableAllRuntimeGpes)
 
 
/*******************************************************************************
*
* FUNCTION: AcpiInstallGpeBlock
*
* PARAMETERS: GpeDevice - Handle to the parent GPE Block Device
* GpeBlockAddress - Address and SpaceID
* RegisterCount - Number of GPE register pairs in the block
* InterruptNumber - H/W interrupt for the block
*
* RETURN: Status
*
* DESCRIPTION: Create and Install a block of GPE registers. The GPEs are not
* enabled here.
*
******************************************************************************/
 
ACPI_STATUS
AcpiInstallGpeBlock (
ACPI_HANDLE GpeDevice,
ACPI_GENERIC_ADDRESS *GpeBlockAddress,
UINT32 RegisterCount,
UINT32 InterruptNumber)
{
ACPI_STATUS Status;
ACPI_OPERAND_OBJECT *ObjDesc;
ACPI_NAMESPACE_NODE *Node;
ACPI_GPE_BLOCK_INFO *GpeBlock;
 
 
ACPI_FUNCTION_TRACE (AcpiInstallGpeBlock);
 
 
if ((!GpeDevice) ||
(!GpeBlockAddress) ||
(!RegisterCount))
{
return_ACPI_STATUS (AE_BAD_PARAMETER);
}
 
Status = AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE);
if (ACPI_FAILURE (Status))
{
return (Status);
}
 
Node = AcpiNsValidateHandle (GpeDevice);
if (!Node)
{
Status = AE_BAD_PARAMETER;
goto UnlockAndExit;
}
 
/*
* For user-installed GPE Block Devices, the GpeBlockBaseNumber
* is always zero
*/
Status = AcpiEvCreateGpeBlock (Node, GpeBlockAddress, RegisterCount,
0, InterruptNumber, &GpeBlock);
if (ACPI_FAILURE (Status))
{
goto UnlockAndExit;
}
 
/* Install block in the DeviceObject attached to the node */
 
ObjDesc = AcpiNsGetAttachedObject (Node);
if (!ObjDesc)
{
/*
* No object, create a new one (Device nodes do not always have
* an attached object)
*/
ObjDesc = AcpiUtCreateInternalObject (ACPI_TYPE_DEVICE);
if (!ObjDesc)
{
Status = AE_NO_MEMORY;
goto UnlockAndExit;
}
 
Status = AcpiNsAttachObject (Node, ObjDesc, ACPI_TYPE_DEVICE);
 
/* Remove local reference to the object */
 
AcpiUtRemoveReference (ObjDesc);
if (ACPI_FAILURE (Status))
{
goto UnlockAndExit;
}
}
 
/* Now install the GPE block in the DeviceObject */
 
ObjDesc->Device.GpeBlock = GpeBlock;
 
 
UnlockAndExit:
(void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE);
return_ACPI_STATUS (Status);
}
 
ACPI_EXPORT_SYMBOL (AcpiInstallGpeBlock)
 
 
/*******************************************************************************
*
* FUNCTION: AcpiRemoveGpeBlock
*
* PARAMETERS: GpeDevice - Handle to the parent GPE Block Device
*
* RETURN: Status
*
* DESCRIPTION: Remove a previously installed block of GPE registers
*
******************************************************************************/
 
ACPI_STATUS
AcpiRemoveGpeBlock (
ACPI_HANDLE GpeDevice)
{
ACPI_OPERAND_OBJECT *ObjDesc;
ACPI_STATUS Status;
ACPI_NAMESPACE_NODE *Node;
 
 
ACPI_FUNCTION_TRACE (AcpiRemoveGpeBlock);
 
 
if (!GpeDevice)
{
return_ACPI_STATUS (AE_BAD_PARAMETER);
}
 
Status = AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE);
if (ACPI_FAILURE (Status))
{
return (Status);
}
 
Node = AcpiNsValidateHandle (GpeDevice);
if (!Node)
{
Status = AE_BAD_PARAMETER;
goto UnlockAndExit;
}
 
/* Get the DeviceObject attached to the node */
 
ObjDesc = AcpiNsGetAttachedObject (Node);
if (!ObjDesc ||
!ObjDesc->Device.GpeBlock)
{
return_ACPI_STATUS (AE_NULL_OBJECT);
}
 
/* Delete the GPE block (but not the DeviceObject) */
 
Status = AcpiEvDeleteGpeBlock (ObjDesc->Device.GpeBlock);
if (ACPI_SUCCESS (Status))
{
ObjDesc->Device.GpeBlock = NULL;
}
 
UnlockAndExit:
(void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE);
return_ACPI_STATUS (Status);
}
 
ACPI_EXPORT_SYMBOL (AcpiRemoveGpeBlock)
 
 
/*******************************************************************************
*
* FUNCTION: AcpiGetGpeDevice
*
* PARAMETERS: Index - System GPE index (0-CurrentGpeCount)
* GpeDevice - Where the parent GPE Device is returned
*
* RETURN: Status
*
* DESCRIPTION: Obtain the GPE device associated with the input index. A NULL
* gpe device indicates that the gpe number is contained in one of
* the FADT-defined gpe blocks. Otherwise, the GPE block device.
*
******************************************************************************/
 
ACPI_STATUS
AcpiGetGpeDevice (
UINT32 Index,
ACPI_HANDLE *GpeDevice)
{
ACPI_GPE_DEVICE_INFO Info;
ACPI_STATUS Status;
 
 
ACPI_FUNCTION_TRACE (AcpiGetGpeDevice);
 
 
if (!GpeDevice)
{
return_ACPI_STATUS (AE_BAD_PARAMETER);
}
 
if (Index >= AcpiCurrentGpeCount)
{
return_ACPI_STATUS (AE_NOT_EXIST);
}
 
/* Setup and walk the GPE list */
 
Info.Index = Index;
Info.Status = AE_NOT_EXIST;
Info.GpeDevice = NULL;
Info.NextBlockBaseIndex = 0;
 
Status = AcpiEvWalkGpeList (AcpiEvGetGpeDevice, &Info);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
}
 
*GpeDevice = ACPI_CAST_PTR (ACPI_HANDLE, Info.GpeDevice);
return_ACPI_STATUS (Info.Status);
}
 
ACPI_EXPORT_SYMBOL (AcpiGetGpeDevice)
/drivers/devman/acpica/events/evxfregn.c
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,12
*
* DESCRIPTION: Install a handler for all OpRegions of a given SpaceId.
*
* NOTE: This function should only be called after AcpiEnableSubsystem has
* been called. This is because any _REG methods associated with the Space ID
* are executed here, and these methods can only be safely executed after
* the default handlers have been installed and the hardware has been
* initialized (via AcpiEnableSubsystem.)
*
******************************************************************************/
 
ACPI_STATUS
186,10 → 192,43
goto UnlockAndExit;
}
 
/*
* For the default SpaceIDs, (the IDs for which there are default region handlers
* installed) Only execute the _REG methods if the global initialization _REG
* methods have already been run (via AcpiInitializeObjects). In other words,
* we will defer the execution of the _REG methods for these SpaceIDs until
* execution of AcpiInitializeObjects. This is done because we need the handlers
* for the default spaces (mem/io/pci/table) to be installed before we can run
* any control methods (or _REG methods). There is known BIOS code that depends
* on this.
*
* For all other SpaceIDs, we can safely execute the _REG methods immediately.
* This means that for IDs like EmbeddedController, this function should be called
* only after AcpiEnableSubsystem has been called.
*/
switch (SpaceId)
{
case ACPI_ADR_SPACE_SYSTEM_MEMORY:
case ACPI_ADR_SPACE_SYSTEM_IO:
case ACPI_ADR_SPACE_PCI_CONFIG:
case ACPI_ADR_SPACE_DATA_TABLE:
 
if (!AcpiGbl_RegMethodsExecuted)
{
/* We will defer execution of the _REG methods for this space */
goto UnlockAndExit;
}
break;
 
default:
break;
}
 
/* Run all _REG methods for this address space */
 
Status = AcpiEvExecuteRegMethods (Node, SpaceId);
 
 
UnlockAndExit:
(void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE);
return_ACPI_STATUS (Status);
/drivers/devman/acpica/executer/exconfig.c
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
206,8 → 206,11
AcpiNsExecModuleCodeList ();
AcpiExEnterInterpreter ();
 
/* Update GPEs for any new _PRW or _Lxx/_Exx methods. Ignore errors */
 
/*
* Update GPEs for any new _Lxx/_Exx methods. Ignore errors. The host is
* responsible for discovering any new wake GPEs by running _PRW methods
* that may have been loaded by this table.
*/
Status = AcpiTbGetOwnerId (TableIndex, &OwnerId);
if (ACPI_SUCCESS (Status))
{
/drivers/devman/acpica/executer/exconvrt.c
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
/drivers/devman/acpica/executer/excreate.c
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
400,7 → 400,8
* range
*/
if ((RegionSpace >= ACPI_NUM_PREDEFINED_REGIONS) &&
(RegionSpace < ACPI_USER_REGION_BEGIN))
(RegionSpace < ACPI_USER_REGION_BEGIN) &&
(RegionSpace != ACPI_ADR_SPACE_DATA_TABLE))
{
ACPI_ERROR ((AE_INFO, "Invalid AddressSpace type 0x%X", RegionSpace));
return_ACPI_STATUS (AE_AML_INVALID_SPACE_ID);
595,12 → 596,10
ObjDesc->Method.AmlLength = AmlLength;
 
/*
* Disassemble the method flags. Split off the Arg Count
* for efficiency
* Disassemble the method flags. Split off the ArgCount, Serialized
* flag, and SyncLevel for efficiency.
*/
MethodFlags = (UINT8) Operand[1]->Integer.Value;
 
ObjDesc->Method.MethodFlags = (UINT8) (MethodFlags & ~AML_METHOD_ARG_COUNT);
ObjDesc->Method.ParamCount = (UINT8) (MethodFlags & AML_METHOD_ARG_COUNT);
 
/*
609,6 → 608,8
*/
if (MethodFlags & AML_METHOD_SERIALIZED)
{
ObjDesc->Method.InfoFlags = ACPI_METHOD_SERIALIZED;
 
/*
* ACPI 1.0: SyncLevel = 0
* ACPI 2.0: SyncLevel = SyncLevel in method declaration
/drivers/devman/acpica/executer/exdebug.c
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
/drivers/devman/acpica/executer/exdump.c
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
216,7 → 216,7
static ACPI_EXDUMP_INFO AcpiExDumpMethod[9] =
{
{ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE (AcpiExDumpMethod), NULL},
{ACPI_EXD_UINT8, ACPI_EXD_OFFSET (Method.MethodFlags), "Method Flags"},
{ACPI_EXD_UINT8, ACPI_EXD_OFFSET (Method.InfoFlags), "Info Flags"},
{ACPI_EXD_UINT8, ACPI_EXD_OFFSET (Method.ParamCount), "Parameter Count"},
{ACPI_EXD_UINT8, ACPI_EXD_OFFSET (Method.SyncLevel), "Sync Level"},
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Method.Mutex), "Mutex"},
/drivers/devman/acpica/executer/exfield.c
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
/drivers/devman/acpica/executer/exfldio.c
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
370,7 → 370,7
if (Status == AE_NOT_IMPLEMENTED)
{
ACPI_ERROR ((AE_INFO,
"Region %s(0x%X) not implemented",
"Region %s (ID=%u) not implemented",
AcpiUtGetRegionName (RgnDesc->Region.SpaceId),
RgnDesc->Region.SpaceId));
}
377,7 → 377,7
else if (Status == AE_NOT_EXIST)
{
ACPI_ERROR ((AE_INFO,
"Region %s(0x%X) has no handler",
"Region %s (ID=%u) has no handler",
AcpiUtGetRegionName (RgnDesc->Region.SpaceId),
RgnDesc->Region.SpaceId));
}
/drivers/devman/acpica/executer/exmisc.c
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
/drivers/devman/acpica/executer/exmutex.c
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,10 → 513,10
(ObjDesc != AcpiGbl_GlobalLockMutex))
{
ACPI_ERROR ((AE_INFO,
"Thread %p cannot release Mutex [%4.4s] acquired by thread %p",
ACPI_CAST_PTR (void, WalkState->Thread->ThreadId),
"Thread %u cannot release Mutex [%4.4s] acquired by thread %u",
(UINT32) WalkState->Thread->ThreadId,
AcpiUtGetNodeName (ObjDesc->Mutex.Node),
ACPI_CAST_PTR (void, OwnerThread->ThreadId)));
(UINT32) OwnerThread->ThreadId));
return_ACPI_STATUS (AE_AML_NOT_OWNER);
}
 
/drivers/devman/acpica/executer/exnames.c
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
/drivers/devman/acpica/executer/exoparg1.c
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
/drivers/devman/acpica/executer/exoparg2.c
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
/drivers/devman/acpica/executer/exoparg3.c
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
/drivers/devman/acpica/executer/exoparg6.c
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
/drivers/devman/acpica/executer/exprep.c
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
/drivers/devman/acpica/executer/exregion.c
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
/drivers/devman/acpica/executer/exresnte.c
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
/drivers/devman/acpica/executer/exresolv.c
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
/drivers/devman/acpica/executer/exresop.c
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
/drivers/devman/acpica/executer/exstore.c
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
/drivers/devman/acpica/executer/exstoren.c
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
/drivers/devman/acpica/executer/exstorob.c
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
/drivers/devman/acpica/executer/exsystem.c
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
/drivers/devman/acpica/executer/exutils.c
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
/drivers/devman/acpica/generate/lint/options.lnt
79,4 → 79,7
-e820 // Allow Boolean test of a parenthesized assignment
-e778 // Allow constant expressions to evaluate to zero
-e662 // Allow "pointer overrun" for dynamic structures
-e831
-e831
-e784 // Allow "Nul character truncated from string" for lookup tables
-e661 // Allow access beyond "end of pointer" for ACPI tables declared with x[1] fields
-e796 // Allow access beyond "end of pointer" for namestrings
/drivers/devman/acpica/generate/unix/Makefile
0,0 → 1,40
#
# Common make for acpica tools and utilities
#
 
#
# Note: This makefile is intended to be used from within the native
# ACPICA directory structure, from under generate/unix. It specifically
# places all object files in a generate/unix subdirectory, not within
# the various ACPICA source directories. This prevents collisions
# between different compilations of the same source file with different
# compile options, and prevents pollution of the source code.
#
include Makefile.config
 
 
all: ${PROGS}
${PROGS}: FORCE
@cd $@; make; ls -al $@
 
clean: FORCE
@for d in ${PROGS}; do \
(cd $$d; \
if [ $$? -ne 0 ]; then \
echo "Bad element of PROGS: <$$d>"; \
else \
pwd; make clean; \
fi); \
done
 
install: FORCE
@for d in ${PROGS}; do \
(cd $$d; \
if [ $$? -ne 0 ]; then \
echo "Bad element of PROGS: <$$d>"; \
else \
pwd; make install; \
fi); \
done
 
FORCE:
/drivers/devman/acpica/generate/unix/Makefile.config
0,0 → 1,116
#
# Makefile.config
#
# Common configuration and setup file to generate the ACPICA tools and
# utilities: the iASL compiler, acpiexec, acpihelp, acpinames, acpisrc,
# acpixtract, acpibin.
#
# This file is included by the individual makefiles for each tool.
#
 
#
# Note: This makefile is intended to be used from within the native
# ACPICA directory structure, from under generate/unix. It specifically
# places all object files in a generate/unix subdirectory, not within
# the various ACPICA source directories. This prevents collisions
# between different compilations of the same source file with different
# compile options, and prevents pollution of the source code.
#
 
#
# Configuration
# Notes:
# gcc should be version 4 or greater, otherwise some of the options
# used will not be recognized.
# Global optimization flags (such as -O2, -Os) are not used, since
# they cause issues on some compilers.
# The _GNU_SOURCE symbol is required for many hosts.
#
PROGS = acpibin acpiexec acpihelp acpinames acpisrc acpixtract iasl
 
HOST = _CYGWIN
CC = gcc
COMPILE = $(CC) -c $(CFLAGS) $(CWARNINGFLAGS) -o$@ $?
 
#
# Common defines
#
ACPICA_SRC = ../../../source
ACPICA_COMMON = $(ACPICA_SRC)/common
ACPICA_CORE = $(ACPICA_SRC)/components
ACPICA_TOOLS = $(ACPICA_SRC)/tools
ACPICA_OSL = $(ACPICA_SRC)/os_specific/service_layers
ASL_COMPILER = $(ACPICA_SRC)/compiler
COPYPROG = @mkdir -p ../bin; rm -f ../bin/$(PROG); cp --remove-destination $(PROG) ../bin
INSTALLDIR = /usr/bin
INSTALLPROG = cp --remove-destination $(PROG) $(INSTALLDIR)
#
# Common compiler flags. The warning flags in addition to -Wall are not
# automatically included in -Wall.
#
CFLAGS += \
-D$(HOST) \
-D_GNU_SOURCE \
-I$(ACPICA_SRC)/include
 
CWARNINGFLAGS = \
-ansi \
-Wall \
-Wbad-function-cast \
-Wdeclaration-after-statement \
-Werror \
-Wformat=2 \
-Wmissing-declarations \
-Wmissing-prototypes \
-Wstrict-aliasing=0 \
-Wstrict-prototypes \
-Wswitch-default \
-Wpointer-arith \
-Wundef
 
#
# gcc 4+ flags
#
CWARNINGFLAGS += \
-Waddress \
-Waggregate-return \
-Wchar-subscripts \
-Wempty-body \
-Wlogical-op \
-Wmissing-declarations \
-Wmissing-field-initializers \
-Wmissing-parameter-type \
-Wnested-externs \
-Wold-style-declaration \
-Wold-style-definition \
-Wredundant-decls \
-Wtype-limits
 
#
# Extra warning flags (possible future use)
#
#CWARNINGFLAGS += \
# -Wcast-qual \
# -Wconversion
# -Wshadow \
 
#
# Bison/Flex configuration
#
# -v: verbose, produces a .output file
# -d: produces the defines header file
# -y: act like yacc
#
# -i: generate case insensitive scanner
# -s: suppress default rule, abort on unknown input
#
# Berkeley yacc configuration
#
#YACC= byacc
#YFLAGS += -v -d
#
YACC= bison
YFLAGS += -v -d -y
 
LEX= flex
LFLAGS += -i -s
/drivers/devman/acpica/generate/unix/acpibin/Makefile
0,0 → 1,109
#
# acpibin - Binary ACPI table utility
#
 
#
# Note: This makefile is intended to be used from within the native
# ACPICA directory structure, from under generate/unix. It specifically
# places all object files in a generate/unix subdirectory, not within
# the various ACPICA source directories. This prevents collisions
# between different compilations of the same source file with different
# compile options, and prevents pollution of the source code.
#
include ../Makefile.config
PROG = acpibin
 
#
# Flags specific to acpibin
#
CFLAGS+= \
-DACPI_BIN_APP \
-I$(ACPICA_TOOLS)/acpibin
 
OBJS = \
abcompare.o \
abmain.o \
utalloc.o \
utcache.o \
utdebug.o \
utdecode.o \
utglobal.o \
utlock.o \
utmath.o \
utmisc.o \
utmutex.o \
utstate.o \
utxferror.o \
osunixxf.o \
getopt.o
 
#
# Root rule
#
$(PROG) : $(OBJS)
$(CC) $(LDFLAGS) $(OBJS) -o $(PROG)
$(COPYPROG)
 
#
# acpibin source
#
abcompare.o : $(ACPICA_TOOLS)/acpibin/abcompare.c
$(COMPILE)
 
abmain.o : $(ACPICA_TOOLS)/acpibin/abmain.c
$(COMPILE)
 
#
# ACPICA core source - common
#
getopt.o : $(ACPICA_COMMON)/getopt.c
$(COMPILE)
 
#
# ACPICA core source
#
utalloc.o : $(ACPICA_CORE)/utilities/utalloc.c
$(COMPILE)
 
utcache.o : $(ACPICA_CORE)/utilities/utcache.c
$(COMPILE)
 
utdebug.o : $(ACPICA_CORE)/utilities/utdebug.c
$(COMPILE)
 
utdecode.o : $(ACPICA_CORE)/utilities/utdecode.c
$(COMPILE)
 
utglobal.o : $(ACPICA_CORE)/utilities/utglobal.c
$(COMPILE)
 
utlock.o : $(ACPICA_CORE)/utilities/utlock.c
$(COMPILE)
 
utmath.o : $(ACPICA_CORE)/utilities/utmath.c
$(COMPILE)
 
utmisc.o : $(ACPICA_CORE)/utilities/utmisc.c
$(COMPILE)
 
utmutex.o : $(ACPICA_CORE)/utilities/utmutex.c
$(COMPILE)
 
utstate.o : $(ACPICA_CORE)/utilities/utstate.c
$(COMPILE)
 
utxferror.o : $(ACPICA_CORE)/utilities/utxferror.c
$(COMPILE)
 
#
# Unix OS services layer (OSL)
#
osunixxf.o : $(ACPICA_OSL)/osunixxf.c
$(COMPILE)
 
 
clean :
rm -f $(PROG) $(PROG).exe $(OBJS)
 
install :
$(INSTALLPROG)
/drivers/devman/acpica/generate/unix/acpibin
Property changes:
Added: bugtraq:number
+true
\ No newline at end of property
/drivers/devman/acpica/generate/unix/acpiexec/Makefile
0,0 → 1,660
#
# acpiexec: ACPI execution simulator. Runs ACPICA code in user
# space. Loads ACPI tables, displays the namespace, and allows
# execution of control methods.
#
 
#
# Note: This makefile is intended to be used from within the native
# ACPICA directory structure, from under generate/unix. It specifically
# places all object files in a generate/unix subdirectory, not within
# the various ACPICA source directories. This prevents collisions
# between different compilations of the same source file with different
# compile options, and prevents pollution of the source code.
#
include ../Makefile.config
PROG = acpiexec
 
#
# Flags specific to acpiexec utility
#
CFLAGS+= \
-DACPI_EXEC_APP \
-I$(ACPICA_TOOLS)/acpiexec
LDFLAGS += -lpthread -lrt
 
OBJS = \
aeexec.o \
aehandlers.o \
aemain.o \
aetables.o \
dbcmds.o \
dbdisply.o \
dbexec.o \
dbfileio.o \
dbhistry.o \
dbinput.o \
dbmethod.o \
dbnames.o \
dbstats.o \
dbutils.o \
dbxface.o \
dmbuffer.o \
dmnames.o \
dmobject.o \
dmopcode.o \
dmresrc.o \
dmresrcl.o \
dmresrcs.o \
dmutils.o \
dmwalk.o \
dsargs.o \
dscontrol.o \
dsfield.o \
dsinit.o \
dsmethod.o \
dsmthdat.o \
dsobject.o \
dsopcode.o \
dsutils.o \
dswexec.o \
dswload.o \
dswload2.o \
dswscope.o \
dswstate.o \
evevent.o \
evglock.o \
evgpe.o \
evgpeblk.o \
evgpeinit.o \
evgpeutil.o \
evmisc.o \
evregion.o \
evrgnini.o \
evsci.o \
evxface.o \
evxfevnt.o \
evxfgpe.o \
evxfregn.o \
exconfig.o \
exconvrt.o \
excreate.o \
exdebug.o \
exdump.o \
exfield.o \
exfldio.o \
exmisc.o \
exmutex.o \
exnames.o \
exoparg1.o \
exoparg2.o \
exoparg3.o \
exoparg6.o \
exprep.o \
exregion.o \
exresnte.o \
exresolv.o \
exresop.o \
exstore.o \
exstoren.o \
exstorob.o \
exsystem.o \
exutils.o \
getopt.o \
hwacpi.o \
hwgpe.o \
hwpci.o \
hwregs.o \
hwsleep.o \
hwvalid.o \
hwxface.o \
nsaccess.o \
nsalloc.o \
nsdump.o \
nsdumpdv.o \
nseval.o \
nsinit.o \
nsload.o \
nsnames.o \
nsobject.o \
nsparse.o \
nspredef.o \
nsrepair.o \
nsrepair2.o \
nssearch.o \
nsutils.o \
nswalk.o \
nsxfeval.o \
nsxfname.o \
nsxfobj.o \
osunixxf.o \
psargs.o \
psloop.o \
psopcode.o \
psparse.o \
psscope.o \
pstree.o \
psutils.o \
pswalk.o \
psxface.o \
rsaddr.o \
rscalc.o \
rscreate.o \
rsdump.o \
rsinfo.o \
rsio.o \
rsirq.o \
rslist.o \
rsmemory.o \
rsmisc.o \
rsutils.o \
rsxface.o \
tbfadt.o \
tbfind.o \
tbinstal.o \
tbutils.o \
tbxface.o \
tbxfroot.o \
utalloc.o \
utcache.o \
utcopy.o \
utdebug.o \
utdecode.o \
utdelete.o \
uteval.o \
utglobal.o \
utids.o \
utinit.o \
utlock.o \
utmath.o \
utmisc.o \
utmutex.o \
utobject.o \
utresrc.o \
utstate.o \
uttrack.o \
utosi.o \
utxferror.o \
utxface.o
 
#
# Root rule
#
$(PROG) : $(OBJS)
$(CC) $(LDFLAGS) $(OBJS) -o $(PROG)
$(COPYPROG)
 
#
# acpiexec source
#
aeexec.o : $(ACPICA_TOOLS)/acpiexec/aeexec.c
$(COMPILE)
 
aehandlers.o : $(ACPICA_TOOLS)/acpiexec/aehandlers.c
$(COMPILE)
 
aemain.o : $(ACPICA_TOOLS)/acpiexec/aemain.c
$(COMPILE)
 
aetables.o : $(ACPICA_TOOLS)/acpiexec/aetables.c
$(COMPILE)
 
#
# ACPICA core source - common
#
getopt.o : $(ACPICA_COMMON)/getopt.c
$(COMPILE)
 
#
# ACPICA core source
#
dbcmds.o : $(ACPICA_CORE)/debugger/dbcmds.c
$(COMPILE)
 
dbdisply.o : $(ACPICA_CORE)/debugger/dbdisply.c
$(COMPILE)
 
dbexec.o : $(ACPICA_CORE)/debugger/dbexec.c
$(COMPILE)
 
dbfileio.o : $(ACPICA_CORE)/debugger/dbfileio.c
$(COMPILE)
 
dbhistry.o : $(ACPICA_CORE)/debugger/dbhistry.c
$(COMPILE)
 
dbinput.o : $(ACPICA_CORE)/debugger/dbinput.c
$(COMPILE)
 
dbmethod.o : $(ACPICA_CORE)/debugger/dbmethod.c
$(COMPILE)
 
dbnames.o : $(ACPICA_CORE)/debugger/dbnames.c
$(COMPILE)
 
dbstats.o : $(ACPICA_CORE)/debugger/dbstats.c
$(COMPILE)
 
dbutils.o : $(ACPICA_CORE)/debugger/dbutils.c
$(COMPILE)
 
dbxface.o : $(ACPICA_CORE)/debugger/dbxface.c
$(COMPILE)
 
dmbuffer.o : $(ACPICA_CORE)/disassembler/dmbuffer.c
$(COMPILE)
 
dmnames.o : $(ACPICA_CORE)/disassembler/dmnames.c
$(COMPILE)
 
dmobject.o : $(ACPICA_CORE)/disassembler/dmobject.c
$(COMPILE)
 
dmopcode.o : $(ACPICA_CORE)/disassembler/dmopcode.c
$(COMPILE)
 
dmresrc.o : $(ACPICA_CORE)/disassembler/dmresrc.c
$(COMPILE)
 
dmresrcl.o : $(ACPICA_CORE)/disassembler/dmresrcl.c
$(COMPILE)
 
dmresrcs.o : $(ACPICA_CORE)/disassembler/dmresrcs.c
$(COMPILE)
 
dmutils.o : $(ACPICA_CORE)/disassembler/dmutils.c
$(COMPILE)
 
dmwalk.o : $(ACPICA_CORE)/disassembler/dmwalk.c
$(COMPILE)
 
dsargs.o : $(ACPICA_CORE)/dispatcher/dsargs.c
$(COMPILE)
 
dscontrol.o : $(ACPICA_CORE)/dispatcher/dscontrol.c
$(COMPILE)
 
dsfield.o : $(ACPICA_CORE)/dispatcher/dsfield.c
$(COMPILE)
 
dsinit.o : $(ACPICA_CORE)/dispatcher/dsinit.c
$(COMPILE)
 
dsmethod.o : $(ACPICA_CORE)/dispatcher/dsmethod.c
$(COMPILE)
 
dsmthdat.o : $(ACPICA_CORE)/dispatcher/dsmthdat.c
$(COMPILE)
 
dsobject.o : $(ACPICA_CORE)/dispatcher/dsobject.c
$(COMPILE)
 
dsopcode.o : $(ACPICA_CORE)/dispatcher/dsopcode.c
$(COMPILE)
 
dsutils.o : $(ACPICA_CORE)/dispatcher/dsutils.c
$(COMPILE)
 
dswexec.o : $(ACPICA_CORE)/dispatcher/dswexec.c
$(COMPILE)
 
dswload.o : $(ACPICA_CORE)/dispatcher/dswload.c
$(COMPILE)
 
dswload2.o : $(ACPICA_CORE)/dispatcher/dswload2.c
$(COMPILE)
 
dswscope.o : $(ACPICA_CORE)/dispatcher/dswscope.c
$(COMPILE)
 
dswstate.o : $(ACPICA_CORE)/dispatcher/dswstate.c
$(COMPILE)
 
evevent.o : $(ACPICA_CORE)/events/evevent.c
$(COMPILE)
 
evglock.o : $(ACPICA_CORE)/events/evglock.c
$(COMPILE)
 
evgpe.o : $(ACPICA_CORE)/events/evgpe.c
$(COMPILE)
 
evgpeblk.o : $(ACPICA_CORE)/events/evgpeblk.c
$(COMPILE)
 
evgpeinit.o : $(ACPICA_CORE)/events/evgpeinit.c
$(COMPILE)
 
evgpeutil.o : $(ACPICA_CORE)/events/evgpeutil.c
$(COMPILE)
 
evmisc.o : $(ACPICA_CORE)/events/evmisc.c
$(COMPILE)
 
evregion.o : $(ACPICA_CORE)/events/evregion.c
$(COMPILE)
 
evrgnini.o : $(ACPICA_CORE)/events/evrgnini.c
$(COMPILE)
 
evsci.o : $(ACPICA_CORE)/events/evsci.c
$(COMPILE)
 
evxface.o : $(ACPICA_CORE)/events/evxface.c
$(COMPILE)
 
evxfevnt.o : $(ACPICA_CORE)/events/evxfevnt.c
$(COMPILE)
 
evxfgpe.o : $(ACPICA_CORE)/events/evxfgpe.c
$(COMPILE)
 
evxfregn.o : $(ACPICA_CORE)/events/evxfregn.c
$(COMPILE)
 
exconfig.o : $(ACPICA_CORE)/executer/exconfig.c
$(COMPILE)
 
exconvrt.o : $(ACPICA_CORE)/executer/exconvrt.c
$(COMPILE)
 
excreate.o : $(ACPICA_CORE)/executer/excreate.c
$(COMPILE)
 
exdebug.o : $(ACPICA_CORE)/executer/exdebug.c
$(COMPILE)
 
exdump.o : $(ACPICA_CORE)/executer/exdump.c
$(COMPILE)
 
exfield.o : $(ACPICA_CORE)/executer/exfield.c
$(COMPILE)
 
exfldio.o : $(ACPICA_CORE)/executer/exfldio.c
$(COMPILE)
 
exmisc.o : $(ACPICA_CORE)/executer/exmisc.c
$(COMPILE)
 
exmutex.o : $(ACPICA_CORE)/executer/exmutex.c
$(COMPILE)
 
exnames.o : $(ACPICA_CORE)/executer/exnames.c
$(COMPILE)
 
exoparg1.o : $(ACPICA_CORE)/executer/exoparg1.c
$(COMPILE)
 
exoparg2.o : $(ACPICA_CORE)/executer/exoparg2.c
$(COMPILE)
 
exoparg3.o : $(ACPICA_CORE)/executer/exoparg3.c
$(COMPILE)
 
exoparg6.o : $(ACPICA_CORE)/executer/exoparg6.c
$(COMPILE)
 
exprep.o : $(ACPICA_CORE)/executer/exprep.c
$(COMPILE)
 
exregion.o : $(ACPICA_CORE)/executer/exregion.c
$(COMPILE)
 
exresnte.o : $(ACPICA_CORE)/executer/exresnte.c
$(COMPILE)
 
exresolv.o : $(ACPICA_CORE)/executer/exresolv.c
$(COMPILE)
 
exresop.o : $(ACPICA_CORE)/executer/exresop.c
$(COMPILE)
 
exstore.o : $(ACPICA_CORE)/executer/exstore.c
$(COMPILE)
 
exstoren.o : $(ACPICA_CORE)/executer/exstoren.c
$(COMPILE)
 
exstorob.o : $(ACPICA_CORE)/executer/exstorob.c
$(COMPILE)
 
exsystem.o : $(ACPICA_CORE)/executer/exsystem.c
$(COMPILE)
 
exutils.o : $(ACPICA_CORE)/executer/exutils.c
$(COMPILE)
 
hwacpi.o : $(ACPICA_CORE)/hardware/hwacpi.c
$(COMPILE)
 
hwgpe.o : $(ACPICA_CORE)/hardware/hwgpe.c
$(COMPILE)
 
hwpci.o : $(ACPICA_CORE)/hardware/hwpci.c
$(COMPILE)
 
hwregs.o : $(ACPICA_CORE)/hardware/hwregs.c
$(COMPILE)
 
hwsleep.o : $(ACPICA_CORE)/hardware/hwsleep.c
$(COMPILE)
 
hwvalid.o : $(ACPICA_CORE)/hardware/hwvalid.c
$(COMPILE)
 
hwxface.o : $(ACPICA_CORE)/hardware/hwxface.c
$(COMPILE)
 
nsaccess.o : $(ACPICA_CORE)/namespace/nsaccess.c
$(COMPILE)
 
nsalloc.o : $(ACPICA_CORE)/namespace/nsalloc.c
$(COMPILE)
 
nsdump.o : $(ACPICA_CORE)/namespace/nsdump.c
$(COMPILE)
 
nsdumpdv.o : $(ACPICA_CORE)/namespace/nsdumpdv.c
$(COMPILE)
 
nseval.o : $(ACPICA_CORE)/namespace/nseval.c
$(COMPILE)
 
nsinit.o : $(ACPICA_CORE)/namespace/nsinit.c
$(COMPILE)
 
nsload.o : $(ACPICA_CORE)/namespace/nsload.c
$(COMPILE)
 
nsnames.o : $(ACPICA_CORE)/namespace/nsnames.c
$(COMPILE)
 
nsobject.o : $(ACPICA_CORE)/namespace/nsobject.c
$(COMPILE)
 
nsparse.o : $(ACPICA_CORE)/namespace/nsparse.c
$(COMPILE)
 
nspredef.o : $(ACPICA_CORE)/namespace/nspredef.c
$(COMPILE)
 
nsrepair.o : $(ACPICA_CORE)/namespace/nsrepair.c
$(COMPILE)
 
nsrepair2.o : $(ACPICA_CORE)/namespace/nsrepair2.c
$(COMPILE)
 
nssearch.o : $(ACPICA_CORE)/namespace/nssearch.c
$(COMPILE)
 
nsutils.o : $(ACPICA_CORE)/namespace/nsutils.c
$(COMPILE)
 
nswalk.o : $(ACPICA_CORE)/namespace/nswalk.c
$(COMPILE)
 
nsxfeval.o : $(ACPICA_CORE)/namespace/nsxfeval.c
$(COMPILE)
 
nsxfname.o : $(ACPICA_CORE)/namespace/nsxfname.c
$(COMPILE)
 
nsxfobj.o : $(ACPICA_CORE)/namespace/nsxfobj.c
$(COMPILE)
 
psargs.o : $(ACPICA_CORE)/parser/psargs.c
$(COMPILE)
 
psloop.o : $(ACPICA_CORE)/parser/psloop.c
$(COMPILE)
 
psopcode.o : $(ACPICA_CORE)/parser/psopcode.c
$(COMPILE)
 
psparse.o : $(ACPICA_CORE)/parser/psparse.c
$(COMPILE)
 
psscope.o : $(ACPICA_CORE)/parser/psscope.c
$(COMPILE)
 
pstree.o : $(ACPICA_CORE)/parser/pstree.c
$(COMPILE)
 
psutils.o : $(ACPICA_CORE)/parser/psutils.c
$(COMPILE)
 
pswalk.o : $(ACPICA_CORE)/parser/pswalk.c
$(COMPILE)
 
psxface.o : $(ACPICA_CORE)/parser/psxface.c
$(COMPILE)
 
rsaddr.o : $(ACPICA_CORE)/resources/rsaddr.c
$(COMPILE)
 
rscalc.o : $(ACPICA_CORE)/resources/rscalc.c
$(COMPILE)
 
rscreate.o : $(ACPICA_CORE)/resources/rscreate.c
$(COMPILE)
 
rsdump.o : $(ACPICA_CORE)/resources/rsdump.c
$(COMPILE)
 
rsio.o : $(ACPICA_CORE)/resources/rsio.c
$(COMPILE)
 
rsinfo.o : $(ACPICA_CORE)/resources/rsinfo.c
$(COMPILE)
 
rsirq.o : $(ACPICA_CORE)/resources/rsirq.c
$(COMPILE)
 
rslist.o : $(ACPICA_CORE)/resources/rslist.c
$(COMPILE)
 
rsmemory.o : $(ACPICA_CORE)/resources/rsmemory.c
$(COMPILE)
 
rsmisc.o : $(ACPICA_CORE)/resources/rsmisc.c
$(COMPILE)
 
rsutils.o : $(ACPICA_CORE)/resources/rsutils.c
$(COMPILE)
 
rsxface.o : $(ACPICA_CORE)/resources/rsxface.c
$(COMPILE)
 
tbfadt.o : $(ACPICA_CORE)/tables/tbfadt.c
$(COMPILE)
 
tbfind.o : $(ACPICA_CORE)/tables/tbfind.c
$(COMPILE)
 
tbinstal.o : $(ACPICA_CORE)/tables/tbinstal.c
$(COMPILE)
 
tbutils.o : $(ACPICA_CORE)/tables/tbutils.c
$(COMPILE)
 
tbxface.o : $(ACPICA_CORE)/tables/tbxface.c
$(COMPILE)
 
tbxfroot.o : $(ACPICA_CORE)/tables/tbxfroot.c
$(COMPILE)
 
utalloc.o : $(ACPICA_CORE)/utilities/utalloc.c
$(COMPILE)
 
utcache.o : $(ACPICA_CORE)/utilities/utcache.c
$(COMPILE)
 
utcopy.o : $(ACPICA_CORE)/utilities/utcopy.c
$(COMPILE)
 
utdebug.o : $(ACPICA_CORE)/utilities/utdebug.c
$(COMPILE)
 
utdecode.o : $(ACPICA_CORE)/utilities/utdecode.c
$(COMPILE)
 
utdelete.o : $(ACPICA_CORE)/utilities/utdelete.c
$(COMPILE)
 
uteval.o : $(ACPICA_CORE)/utilities/uteval.c
$(COMPILE)
 
utglobal.o : $(ACPICA_CORE)/utilities/utglobal.c
$(COMPILE)
 
utids.o : $(ACPICA_CORE)/utilities/utids.c
$(COMPILE)
 
utinit.o : $(ACPICA_CORE)/utilities/utinit.c
$(COMPILE)
 
utlock.o : $(ACPICA_CORE)/utilities/utlock.c
$(COMPILE)
 
utmath.o : $(ACPICA_CORE)/utilities/utmath.c
$(COMPILE)
 
utmisc.o : $(ACPICA_CORE)/utilities/utmisc.c
$(COMPILE)
 
utmutex.o : $(ACPICA_CORE)/utilities/utmutex.c
$(COMPILE)
 
utobject.o : $(ACPICA_CORE)/utilities/utobject.c
$(COMPILE)
 
utresrc.o : $(ACPICA_CORE)/utilities/utresrc.c
$(COMPILE)
 
utstate.o : $(ACPICA_CORE)/utilities/utstate.c
$(COMPILE)
 
uttrack.o : $(ACPICA_CORE)/utilities/uttrack.c
$(COMPILE)
 
utosi.o : $(ACPICA_CORE)/utilities/utosi.c
$(COMPILE)
 
utxferror.o : $(ACPICA_CORE)/utilities/utxferror.c
$(COMPILE)
 
utxface.o : $(ACPICA_CORE)/utilities/utxface.c
$(COMPILE)
 
#
# Unix OS services layer (OSL)
#
osunixxf.o : $(ACPICA_OSL)/osunixxf.c
$(COMPILE)
 
 
clean :
rm -f $(PROG) $(PROG).exe $(OBJS)
 
install :
$(INSTALLPROG)
/drivers/devman/acpica/generate/unix/acpiexec
Property changes:
Added: bugtraq:number
+true
\ No newline at end of property
/drivers/devman/acpica/generate/unix/acpihelp/Makefile
0,0 → 1,72
#
# acpihelp - ACPI Help utility. Displays ASL operator syntax and
# information about ACPI predefined names.
#
 
#
# Note: This makefile is intended to be used from within the native
# ACPICA directory structure, from under generate/unix. It specifically
# places all object files in a generate/unix subdirectory, not within
# the various ACPICA source directories. This prevents collisions
# between different compilations of the same source file with different
# compile options, and prevents pollution of the source code.
#
include ../Makefile.config
PROG = acpihelp
 
#
# Flags specific to acpihelp
#
CFLAGS+= \
-DACPI_HELP_APP \
-I$(ACPICA_TOOLS)/acpihelp
 
OBJS = \
ahamlops.o \
ahaslkey.o \
ahaslops.o \
ahdecode.o \
ahpredef.o \
ahmain.o \
getopt.o
 
#
# Root rule
#
$(PROG) : $(OBJS)
$(CC) $(LDFLAGS) $(OBJS) -o $(PROG)
$(COPYPROG)
 
#
# acpihelp source
#
ahamlops.o : $(ACPICA_TOOLS)/acpihelp/ahamlops.c
$(COMPILE)
 
ahaslkey.o : $(ACPICA_TOOLS)/acpihelp/ahaslkey.c
$(COMPILE)
 
ahaslops.o : $(ACPICA_TOOLS)/acpihelp/ahaslops.c
$(COMPILE)
 
ahdecode.o : $(ACPICA_TOOLS)/acpihelp/ahdecode.c
$(COMPILE)
 
ahpredef.o : $(ACPICA_TOOLS)/acpihelp/ahpredef.c
$(COMPILE)
 
ahmain.o : $(ACPICA_TOOLS)/acpihelp/ahmain.c
$(COMPILE)
 
#
# ACPICA core source - common
#
getopt.o : $(ACPICA_COMMON)/getopt.c
$(COMPILE)
 
 
clean :
rm -f $(PROG) $(PROG).exe $(OBJS)
 
install :
$(INSTALLPROG)
/drivers/devman/acpica/generate/unix/acpihelp
Property changes:
Added: bugtraq:number
+true
\ No newline at end of property
/drivers/devman/acpica/generate/unix/acpinames/Makefile
0,0 → 1,303
#
# acpinames - Load ACPI table and dump namespace. This is a subset
# of the AcpiExec functionality, it is intended to demonstrate
# the configurability of ACPICA.
#
 
#
# Note: This makefile is intended to be used from within the native
# ACPICA directory structure, from under generate/unix. It specifically
# places all object files in a generate/unix subdirectory, not within
# the various ACPICA source directories. This prevents collisions
# between different compilations of the same source file with different
# compile options, and prevents pollution of the source code.
#
include ../Makefile.config
PROG = acpinames
 
#
# Flags specific to acpinames utility
#
CFLAGS+= \
-DACPI_NAMES_APP \
-I$(ACPICA_TOOLS)/acpinames
 
OBJS = \
anmain.o \
anstubs.o \
antables.o \
dbfileio.o \
dsfield.o \
dsmthdat.o \
dsobject.o \
dsutils.o \
dswload.o \
dswload2.o \
dswscope.o \
dswstate.o \
excreate.o \
exnames.o \
exresnte.o \
exresolv.o \
exutils.o \
getopt.o \
nsaccess.o \
nsalloc.o \
nsdump.o \
nsinit.o \
nsload.o \
nsnames.o \
nsobject.o \
nsparse.o \
nssearch.o \
nsutils.o \
nswalk.o \
nsxfeval.o \
nsxfname.o \
nsxfobj.o \
osunixxf.o \
psargs.o \
psloop.o \
psopcode.o \
psparse.o \
psscope.o \
pstree.o \
psutils.o \
pswalk.o \
psxface.o \
tbfadt.o \
tbfind.o \
tbinstal.o \
tbutils.o \
tbxface.o \
tbxfroot.o \
utalloc.o \
utcache.o \
utdebug.o \
utdecode.o \
utdelete.o \
utglobal.o \
utlock.o \
utmath.o \
utmisc.o \
utmutex.o \
utobject.o \
utstate.o \
utosi.o \
utxferror.o \
utxface.o
 
#
# Root rule
#
$(PROG) : $(OBJS)
$(CC) $(LDFLAGS) $(OBJS) -o $(PROG)
$(COPYPROG)
 
#
# acpinames source
#
anmain.o : $(ACPICA_TOOLS)/acpinames/anmain.c
$(COMPILE)
 
anstubs.o : $(ACPICA_TOOLS)/acpinames/anstubs.c
$(COMPILE)
 
antables.o : $(ACPICA_TOOLS)/acpinames/antables.c
$(COMPILE)
 
#
# ACPICA core source - common
#
getopt.o : $(ACPICA_COMMON)/getopt.c
$(COMPILE)
 
#
# ACPICA core source
#
dbfileio.o : $(ACPICA_CORE)/debugger/dbfileio.c
$(COMPILE)
 
dsfield.o : $(ACPICA_CORE)/dispatcher/dsfield.c
$(COMPILE)
 
dsmthdat.o : $(ACPICA_CORE)/dispatcher/dsmthdat.c
$(COMPILE)
 
dsobject.o : $(ACPICA_CORE)/dispatcher/dsobject.c
$(COMPILE)
 
dsutils.o : $(ACPICA_CORE)/dispatcher/dsutils.c
$(COMPILE)
 
dswload.o : $(ACPICA_CORE)/dispatcher/dswload.c
$(COMPILE)
 
dswload2.o : $(ACPICA_CORE)/dispatcher/dswload2.c
$(COMPILE)
 
dswscope.o : $(ACPICA_CORE)/dispatcher/dswscope.c
$(COMPILE)
 
dswstate.o : $(ACPICA_CORE)/dispatcher/dswstate.c
$(COMPILE)
 
excreate.o : $(ACPICA_CORE)/executer/excreate.c
$(COMPILE)
 
exnames.o : $(ACPICA_CORE)/executer/exnames.c
$(COMPILE)
 
exresnte.o : $(ACPICA_CORE)/executer/exresnte.c
$(COMPILE)
 
exresolv.o : $(ACPICA_CORE)/executer/exresolv.c
$(COMPILE)
 
exutils.o : $(ACPICA_CORE)/executer/exutils.c
$(COMPILE)
 
nsaccess.o : $(ACPICA_CORE)/namespace/nsaccess.c
$(COMPILE)
 
nsalloc.o : $(ACPICA_CORE)/namespace/nsalloc.c
$(COMPILE)
 
nsdump.o : $(ACPICA_CORE)/namespace/nsdump.c
$(COMPILE)
 
nsinit.o : $(ACPICA_CORE)/namespace/nsinit.c
$(COMPILE)
 
nsload.o : $(ACPICA_CORE)/namespace/nsload.c
$(COMPILE)
 
nsnames.o : $(ACPICA_CORE)/namespace/nsnames.c
$(COMPILE)
 
nsobject.o : $(ACPICA_CORE)/namespace/nsobject.c
$(COMPILE)
 
nsparse.o : $(ACPICA_CORE)/namespace/nsparse.c
$(COMPILE)
 
nssearch.o : $(ACPICA_CORE)/namespace/nssearch.c
$(COMPILE)
 
nsutils.o : $(ACPICA_CORE)/namespace/nsutils.c
$(COMPILE)
 
nswalk.o : $(ACPICA_CORE)/namespace/nswalk.c
$(COMPILE)
 
nsxfeval.o : $(ACPICA_CORE)/namespace/nsxfeval.c
$(COMPILE)
 
nsxfname.o : $(ACPICA_CORE)/namespace/nsxfname.c
$(COMPILE)
 
nsxfobj.o : $(ACPICA_CORE)/namespace/nsxfobj.c
$(COMPILE)
 
psargs.o : $(ACPICA_CORE)/parser/psargs.c
$(COMPILE)
 
psloop.o : $(ACPICA_CORE)/parser/psloop.c
$(COMPILE)
 
psopcode.o : $(ACPICA_CORE)/parser/psopcode.c
$(COMPILE)
 
psparse.o : $(ACPICA_CORE)/parser/psparse.c
$(COMPILE)
 
psscope.o : $(ACPICA_CORE)/parser/psscope.c
$(COMPILE)
 
pstree.o : $(ACPICA_CORE)/parser/pstree.c
$(COMPILE)
 
psutils.o : $(ACPICA_CORE)/parser/psutils.c
$(COMPILE)
 
pswalk.o : $(ACPICA_CORE)/parser/pswalk.c
$(COMPILE)
 
psxface.o : $(ACPICA_CORE)/parser/psxface.c
$(COMPILE)
 
tbfadt.o : $(ACPICA_CORE)/tables/tbfadt.c
$(COMPILE)
 
tbfind.o : $(ACPICA_CORE)/tables/tbfind.c
$(COMPILE)
 
tbinstal.o : $(ACPICA_CORE)/tables/tbinstal.c
$(COMPILE)
 
tbutils.o : $(ACPICA_CORE)/tables/tbutils.c
$(COMPILE)
 
tbxface.o : $(ACPICA_CORE)/tables/tbxface.c
$(COMPILE)
 
tbxfroot.o : $(ACPICA_CORE)/tables/tbxfroot.c
$(COMPILE)
 
utalloc.o : $(ACPICA_CORE)/utilities/utalloc.c
$(COMPILE)
 
utcache.o : $(ACPICA_CORE)/utilities/utcache.c
$(COMPILE)
 
utdebug.o : $(ACPICA_CORE)/utilities/utdebug.c
$(COMPILE)
 
utdecode.o : $(ACPICA_CORE)/utilities/utdecode.c
$(COMPILE)
 
utdelete.o : $(ACPICA_CORE)/utilities/utdelete.c
$(COMPILE)
 
utglobal.o : $(ACPICA_CORE)/utilities/utglobal.c
$(COMPILE)
 
utlock.o : $(ACPICA_CORE)/utilities/utlock.c
$(COMPILE)
 
utmath.o : $(ACPICA_CORE)/utilities/utmath.c
$(COMPILE)
 
utmisc.o : $(ACPICA_CORE)/utilities/utmisc.c
$(COMPILE)
 
utmutex.o : $(ACPICA_CORE)/utilities/utmutex.c
$(COMPILE)
 
utobject.o : $(ACPICA_CORE)/utilities/utobject.c
$(COMPILE)
 
utstate.o : $(ACPICA_CORE)/utilities/utstate.c
$(COMPILE)
 
utosi.o : $(ACPICA_CORE)/utilities/utosi.c
$(COMPILE)
 
utxferror.o : $(ACPICA_CORE)/utilities/utxferror.c
$(COMPILE)
 
utxface.o : $(ACPICA_CORE)/utilities/utxface.c
$(COMPILE)
 
#
# Unix OS services layer (OSL)
#
osunixxf.o : $(ACPICA_OSL)/osunixxf.c
$(COMPILE)
 
 
clean :
rm -f $(PROG) $(PROG).exe $(OBJS)
 
install :
$(INSTALLPROG)
/drivers/devman/acpica/generate/unix/acpinames
Property changes:
Added: bugtraq:number
+true
\ No newline at end of property
/drivers/devman/acpica/generate/unix/acpisrc/Makefile
0,0 → 1,82
#
# acpisrc - ACPICA source code conversion utility
#
 
#
# Note: This makefile is intended to be used from within the native
# ACPICA directory structure, from under generate/unix. It specifically
# places all object files in a generate/unix subdirectory, not within
# the various ACPICA source directories. This prevents collisions
# between different compilations of the same source file with different
# compile options, and prevents pollution of the source code.
#
include ../Makefile.config
PROG = acpisrc
 
#
# Flags specific to acpisrc
#
CFLAGS+= \
-DACPI_SRC_APP \
-I$(ACPICA_TOOLS)/acpisrc
 
OBJS = \
ascase.o \
asconvrt.o \
asfile.o \
asmain.o \
asremove.o \
astable.o \
asutils.o \
getopt.o \
osunixdir.o
 
#
# Root rule
#
$(PROG) : $(OBJS)
$(CC) $(LDFLAGS) $(OBJS) -o $(PROG)
$(COPYPROG)
 
#
# acpisrc source
#
ascase.o : $(ACPICA_TOOLS)/acpisrc/ascase.c
$(COMPILE)
 
asconvrt.o : $(ACPICA_TOOLS)/acpisrc/asconvrt.c
$(COMPILE)
 
asfile.o : $(ACPICA_TOOLS)/acpisrc/asfile.c
$(COMPILE)
 
asmain.o : $(ACPICA_TOOLS)/acpisrc/asmain.c
$(COMPILE)
 
asremove.o : $(ACPICA_TOOLS)/acpisrc/asremove.c
$(COMPILE)
 
astable.o : $(ACPICA_TOOLS)/acpisrc/astable.c
$(COMPILE)
 
asutils.o : $(ACPICA_TOOLS)/acpisrc/asutils.c
$(COMPILE)
 
#
# ACPICA core source - common
#
getopt.o : $(ACPICA_COMMON)/getopt.c
$(COMPILE)
 
#
# Unix OS services layer (OSL)
#
osunixdir.o : $(ACPICA_OSL)/osunixdir.c
$(COMPILE)
 
 
clean :
rm -f $(PROG) $(PROG).exe $(OBJS)
 
install :
$(INSTALLPROG)
/drivers/devman/acpica/generate/unix/acpisrc
Property changes:
Added: bugtraq:number
+true
\ No newline at end of property
/drivers/devman/acpica/generate/unix/acpixtract/Makefile
0,0 → 1,36
#
# acpixtract - extract binary ACPI tables from acpidump text output
#
 
#
# Note: This makefile is intended to be used from within the native
# ACPICA directory structure, from under generate/unix. It specifically
# places all object files in a generate/unix subdirectory, not within
# the various ACPICA source directories. This prevents collisions
# between different compilations of the same source file with different
# compile options, and prevents pollution of the source code.
#
include ../Makefile.config
PROG = acpixtract
 
OBJS = \
acpixtract.o
 
#
# Root rule
#
$(PROG) : $(OBJS)
$(CC) $(LDFLAGS) $(OBJS) -o $(PROG)
 
#
# acpixtract source
#
acpixtract.o : $(ACPICA_TOOLS)/acpixtract/acpixtract.c
$(COMPILE)
 
 
clean :
rm -f $(PROG) $(PROG).exe
 
install :
$(INSTALLPROG)
/drivers/devman/acpica/generate/unix/acpixtract
Property changes:
Added: bugtraq:number
+true
\ No newline at end of property
/drivers/devman/acpica/generate/unix/bin
Property changes:
Added: bugtraq:number
+true
\ No newline at end of property
/drivers/devman/acpica/generate/unix/iasl/Makefile
0,0 → 1,624
#
# iASL compiler/disassembler
#
 
#
# Note: This makefile is intended to be used from within the native
# ACPICA directory structure, from under generate/unix. It specifically
# places all object files in a generate/unix subdirectory, not within
# the various ACPICA source directories. This prevents collisions
# between different compilations of the same source file with different
# compile options, and prevents pollution of the source code.
#
include ../Makefile.config
PROG = iasl
 
#
# Flags specific to iASL compiler
#
CFLAGS+= \
-DACPI_ASL_COMPILER \
-I$(ASL_COMPILER) \
-I.
 
OBJS = \
adfile.o \
adisasm.o \
adwalk.o \
aslanalyze.o \
aslbtypes.o \
aslcodegen.o \
aslcompile.o \
aslcompilerlex.o \
aslcompilerparse.o \
aslerror.o \
aslfiles.o \
aslfold.o \
asllength.o \
asllisting.o \
aslload.o \
asllookup.o \
aslmain.o \
aslmap.o \
aslopcodes.o \
asloperands.o \
aslopt.o \
aslpredef.o \
aslresource.o \
aslrestype1.o \
aslrestype1i.o \
aslrestype2.o \
aslrestype2d.o \
aslrestype2e.o \
aslrestype2q.o \
aslrestype2w.o \
aslstartup.o \
aslstubs.o \
asltransform.o \
asltree.o \
aslutils.o \
asluuid.o \
aslwalks.o \
dtcompile.o \
dtexpress.o \
dtfield.o \
dtio.o \
dtparserlex.o \
dtparserparse.o \
dtsubtable.o \
dttable.o \
dttemplate.o \
dtutils.o \
dbfileio.o \
dmbuffer.o \
dmextern.o \
dmnames.o \
dmobject.o \
dmopcode.o \
dmresrc.o \
dmresrcl.o \
dmresrcs.o \
dmrestag.o \
dmtable.o \
dmtbdump.o \
dmtbinfo.o \
dmutils.o \
dmwalk.o \
dsargs.o \
dscontrol.o \
dsfield.o \
dsobject.o \
dsopcode.o \
dsutils.o \
dswexec.o \
dswload.o \
dswload2.o \
dswscope.o \
dswstate.o \
exconvrt.o \
excreate.o \
exdump.o \
exmisc.o \
exmutex.o \
exnames.o \
exoparg1.o \
exoparg2.o \
exoparg3.o \
exoparg6.o \
exprep.o \
exregion.o \
exresnte.o \
exresolv.o \
exresop.o \
exstore.o \
exstoren.o \
exstorob.o \
exsystem.o \
exutils.o \
getopt.o \
nsaccess.o \
nsalloc.o \
nsdump.o \
nsnames.o \
nsobject.o \
nsparse.o \
nssearch.o \
nsutils.o \
nswalk.o \
nsxfobj.o \
osunixxf.o \
psargs.o \
psloop.o \
psopcode.o \
psparse.o \
psscope.o \
pstree.o \
psutils.o \
pswalk.o \
tbfadt.o \
tbinstal.o \
tbutils.o \
tbxface.o \
utalloc.o \
utcache.o \
utcopy.o \
utdebug.o \
utdecode.o \
utdelete.o \
utglobal.o \
utinit.o \
utlock.o \
utmath.o \
utmisc.o \
utmutex.o \
utobject.o \
utresrc.o \
utstate.o \
utxferror.o \
utxface.o
 
INTERMEDIATES = \
aslcompilerlex.c \
aslcompilerparse.c \
dtparserlex.c \
dtparserparse.c
 
MISC = \
aslcompiler.y.h \
aslcompilerparse.output \
dtparser.y.h \
dtparserparse.output
 
#
# Root rule
#
$(PROG) : $(INTERMEDIATES) $(OBJS)
$(CC) $(LDFLAGS) $(OBJS) -o $(PROG)
$(COPYPROG)
 
#
# Parser and Lexer - intermediate C files
#
aslcompilerlex.c : $(ASL_COMPILER)/aslcompiler.l
${LEX} ${LFLAGS} -PAslCompiler -o$@ $?
 
aslcompilerparse.c : $(ASL_COMPILER)/aslcompiler.y
${YACC} ${YFLAGS} -pAslCompiler -o$@ $?
@mv -f aslcompilerparse.h aslcompiler.y.h
 
dtparserlex.c : $(ASL_COMPILER)/dtparser.l
${LEX} ${LFLAGS} -PDtParser -o$@ $?
 
dtparserparse.c : $(ASL_COMPILER)/dtparser.y
${YACC} ${YFLAGS} -pDtParser -o$@ $?
@mv -f dtparserparse.h dtparser.y.h
 
#
# Parsers and Lexers - final object files
#
# Cannot use the common compile warning flags since the C files are created
# by the utilities above and they are not necessarily ANSI C, etc.
#
aslcompilerlex.o : aslcompilerlex.c
$(CC) -c $(CFLAGS) -Wall -Werror -o$@ $?
 
aslcompilerparse.o : aslcompilerparse.c
$(CC) -c $(CFLAGS) -Wall -Werror -o$@ $?
 
dtparserlex.o : dtparserlex.c
$(CC) -c $(CFLAGS) -Wall -Werror -o$@ $?
 
dtparserparse.o : dtparserparse.c
$(CC) -c $(CFLAGS) -Wall -Werror -o$@ $?
 
#
# Compiler source
#
aslanalyze.o : $(ASL_COMPILER)/aslanalyze.c
$(COMPILE)
 
aslbtypes.o : $(ASL_COMPILER)/aslbtypes.c
$(COMPILE)
 
aslcodegen.o : $(ASL_COMPILER)/aslcodegen.c
$(COMPILE)
 
aslcompile.o : $(ASL_COMPILER)/aslcompile.c
$(COMPILE)
 
aslerror.o : $(ASL_COMPILER)/aslerror.c
$(COMPILE)
 
aslfiles.o : $(ASL_COMPILER)/aslfiles.c
$(COMPILE)
 
aslfold.o : $(ASL_COMPILER)/aslfold.c
$(COMPILE)
 
asllength.o : $(ASL_COMPILER)/asllength.c
$(COMPILE)
 
asllisting.o : $(ASL_COMPILER)/asllisting.c
$(COMPILE)
 
aslload.o : $(ASL_COMPILER)/aslload.c
$(COMPILE)
 
asllookup.o : $(ASL_COMPILER)/asllookup.c
$(COMPILE)
 
aslmain.o : $(ASL_COMPILER)/aslmain.c
$(COMPILE)
 
aslmap.o : $(ASL_COMPILER)/aslmap.c
$(COMPILE)
 
aslopcodes.o : $(ASL_COMPILER)/aslopcodes.c
$(COMPILE)
 
asloperands.o : $(ASL_COMPILER)/asloperands.c
$(COMPILE)
 
aslopt.o : $(ASL_COMPILER)/aslopt.c
$(COMPILE)
 
aslpredef.o : $(ASL_COMPILER)/aslpredef.c
$(COMPILE)
 
aslresource.o : $(ASL_COMPILER)/aslresource.c
$(COMPILE)
 
aslrestype1.o : $(ASL_COMPILER)/aslrestype1.c
$(COMPILE)
 
aslrestype1i.o : $(ASL_COMPILER)/aslrestype1i.c
$(COMPILE)
 
aslrestype2.o : $(ASL_COMPILER)/aslrestype2.c
$(COMPILE)
 
aslrestype2d.o : $(ASL_COMPILER)/aslrestype2d.c
$(COMPILE)
 
aslrestype2e.o : $(ASL_COMPILER)/aslrestype2e.c
$(COMPILE)
 
aslrestype2q.o : $(ASL_COMPILER)/aslrestype2q.c
$(COMPILE)
 
aslrestype2w.o : $(ASL_COMPILER)/aslrestype2w.c
$(COMPILE)
 
aslstartup.o : $(ASL_COMPILER)/aslstartup.c
$(COMPILE)
 
aslstubs.o : $(ASL_COMPILER)/aslstubs.c
$(COMPILE)
 
asltransform.o : $(ASL_COMPILER)/asltransform.c
$(COMPILE)
 
asltree.o : $(ASL_COMPILER)/asltree.c
$(COMPILE)
 
aslutils.o : $(ASL_COMPILER)/aslutils.c
$(COMPILE)
 
asluuid.o : $(ASL_COMPILER)/asluuid.c
$(COMPILE)
 
aslwalks.o : $(ASL_COMPILER)/aslwalks.c
$(COMPILE)
 
#
# Data Table Compiler
#
dtcompile.o : $(ASL_COMPILER)/dtcompile.c
$(COMPILE)
 
dtexpress.o : $(ASL_COMPILER)/dtexpress.c
$(COMPILE)
 
dtfield.o : $(ASL_COMPILER)/dtfield.c
$(COMPILE)
 
dtio.o : $(ASL_COMPILER)/dtio.c
$(COMPILE)
 
dtsubtable.o : $(ASL_COMPILER)/dtsubtable.c
$(COMPILE)
 
dttable.o : $(ASL_COMPILER)/dttable.c
$(COMPILE)
 
dttemplate.o : $(ASL_COMPILER)/dttemplate.c
$(COMPILE)
 
dtutils.o : $(ASL_COMPILER)/dtutils.c
$(COMPILE)
 
#
# ACPICA core source - common
#
adfile.o : $(ACPICA_COMMON)/adfile.c
$(COMPILE)
 
adisasm.o : $(ACPICA_COMMON)/adisasm.c
$(COMPILE)
 
adwalk.o : $(ACPICA_COMMON)/adwalk.c
$(COMPILE)
 
dmextern.o : $(ACPICA_COMMON)/dmextern.c
$(COMPILE)
 
dmrestag.o : $(ACPICA_COMMON)/dmrestag.c
$(COMPILE)
 
dmtable.o : $(ACPICA_COMMON)/dmtable.c
$(COMPILE)
 
dmtbdump.o : $(ACPICA_COMMON)/dmtbdump.c
$(COMPILE)
 
dmtbinfo.o : $(ACPICA_COMMON)/dmtbinfo.c
$(COMPILE)
 
getopt.o : $(ACPICA_COMMON)/getopt.c
$(COMPILE)
 
#
# ACPICA core source
#
dbfileio.o : $(ACPICA_CORE)/debugger/dbfileio.c
$(COMPILE)
 
dmbuffer.o : $(ACPICA_CORE)/disassembler/dmbuffer.c
$(COMPILE)
 
dmnames.o : $(ACPICA_CORE)/disassembler/dmnames.c
$(COMPILE)
 
dmobject.o : $(ACPICA_CORE)/disassembler/dmobject.c
$(COMPILE)
 
dmopcode.o : $(ACPICA_CORE)/disassembler/dmopcode.c
$(COMPILE)
 
dmresrc.o : $(ACPICA_CORE)/disassembler/dmresrc.c
$(COMPILE)
 
dmresrcl.o : $(ACPICA_CORE)/disassembler/dmresrcl.c
$(COMPILE)
 
dmresrcs.o : $(ACPICA_CORE)/disassembler/dmresrcs.c
$(COMPILE)
 
dmutils.o : $(ACPICA_CORE)/disassembler/dmutils.c
$(COMPILE)
 
dmwalk.o : $(ACPICA_CORE)/disassembler/dmwalk.c
$(COMPILE)
 
dsargs.o : $(ACPICA_CORE)/dispatcher/dsargs.c
$(COMPILE)
 
dscontrol.o : $(ACPICA_CORE)/dispatcher/dscontrol.c
$(COMPILE)
 
dsfield.o : $(ACPICA_CORE)/dispatcher/dsfield.c
$(COMPILE)
 
dsobject.o : $(ACPICA_CORE)/dispatcher/dsobject.c
$(COMPILE)
 
dsopcode.o : $(ACPICA_CORE)/dispatcher/dsopcode.c
$(COMPILE)
 
dsutils.o : $(ACPICA_CORE)/dispatcher/dsutils.c
$(COMPILE)
 
dswexec.o : $(ACPICA_CORE)/dispatcher/dswexec.c
$(COMPILE)
 
dswload.o : $(ACPICA_CORE)/dispatcher/dswload.c
$(COMPILE)
 
dswload2.o : $(ACPICA_CORE)/dispatcher/dswload2.c
$(COMPILE)
 
dswscope.o : $(ACPICA_CORE)/dispatcher/dswscope.c
$(COMPILE)
 
dswstate.o : $(ACPICA_CORE)/dispatcher/dswstate.c
$(COMPILE)
 
exconvrt.o : $(ACPICA_CORE)/executer/exconvrt.c
$(COMPILE)
 
excreate.o : $(ACPICA_CORE)/executer/excreate.c
$(COMPILE)
 
exdump.o : $(ACPICA_CORE)/executer/exdump.c
$(COMPILE)
 
exmisc.o : $(ACPICA_CORE)/executer/exmisc.c
$(COMPILE)
 
exmutex.o : $(ACPICA_CORE)/executer/exmutex.c
$(COMPILE)
 
exnames.o : $(ACPICA_CORE)/executer/exnames.c
$(COMPILE)
 
exoparg1.o : $(ACPICA_CORE)/executer/exoparg1.c
$(COMPILE)
 
exoparg2.o : $(ACPICA_CORE)/executer/exoparg2.c
$(COMPILE)
 
exoparg3.o : $(ACPICA_CORE)/executer/exoparg3.c
$(COMPILE)
 
exoparg6.o : $(ACPICA_CORE)/executer/exoparg6.c
$(COMPILE)
 
exprep.o : $(ACPICA_CORE)/executer/exprep.c
$(COMPILE)
 
exregion.o : $(ACPICA_CORE)/executer/exregion.c
$(COMPILE)
 
exresnte.o : $(ACPICA_CORE)/executer/exresnte.c
$(COMPILE)
 
exresolv.o : $(ACPICA_CORE)/executer/exresolv.c
$(COMPILE)
 
exresop.o : $(ACPICA_CORE)/executer/exresop.c
$(COMPILE)
 
exstore.o : $(ACPICA_CORE)/executer/exstore.c
$(COMPILE)
 
exstoren.o : $(ACPICA_CORE)/executer/exstoren.c
$(COMPILE)
 
exstorob.o : $(ACPICA_CORE)/executer/exstorob.c
$(COMPILE)
 
exsystem.o : $(ACPICA_CORE)/executer/exsystem.c
$(COMPILE)
 
exutils.o : $(ACPICA_CORE)/executer/exutils.c
$(COMPILE)
 
nsaccess.o : $(ACPICA_CORE)/namespace/nsaccess.c
$(COMPILE)
 
nsalloc.o : $(ACPICA_CORE)/namespace/nsalloc.c
$(COMPILE)
 
nsdump.o : $(ACPICA_CORE)/namespace/nsdump.c
$(COMPILE)
 
nsnames.o : $(ACPICA_CORE)/namespace/nsnames.c
$(COMPILE)
 
nsobject.o : $(ACPICA_CORE)/namespace/nsobject.c
$(COMPILE)
 
nsparse.o : $(ACPICA_CORE)/namespace/nsparse.c
$(COMPILE)
 
nssearch.o : $(ACPICA_CORE)/namespace/nssearch.c
$(COMPILE)
 
nsutils.o : $(ACPICA_CORE)/namespace/nsutils.c
$(COMPILE)
 
nswalk.o : $(ACPICA_CORE)/namespace/nswalk.c
$(COMPILE)
 
nsxfobj.o : $(ACPICA_CORE)/namespace/nsxfobj.c
$(COMPILE)
 
psargs.o : $(ACPICA_CORE)/parser/psargs.c
$(COMPILE)
 
psloop.o : $(ACPICA_CORE)/parser/psloop.c
$(COMPILE)
 
psopcode.o : $(ACPICA_CORE)/parser/psopcode.c
$(COMPILE)
 
psparse.o : $(ACPICA_CORE)/parser/psparse.c
$(COMPILE)
 
psscope.o : $(ACPICA_CORE)/parser/psscope.c
$(COMPILE)
 
pstree.o : $(ACPICA_CORE)/parser/pstree.c
$(COMPILE)
 
psutils.o : $(ACPICA_CORE)/parser/psutils.c
$(COMPILE)
 
pswalk.o : $(ACPICA_CORE)/parser/pswalk.c
$(COMPILE)
 
tbfadt.o : $(ACPICA_CORE)/tables/tbfadt.c
$(COMPILE)
 
tbinstal.o : $(ACPICA_CORE)/tables/tbinstal.c
$(COMPILE)
 
tbutils.o : $(ACPICA_CORE)/tables/tbutils.c
$(COMPILE)
 
tbxface.o : $(ACPICA_CORE)/tables/tbxface.c
$(COMPILE)
 
utalloc.o : $(ACPICA_CORE)/utilities/utalloc.c
$(COMPILE)
 
utcache.o : $(ACPICA_CORE)/utilities/utcache.c
$(COMPILE)
 
utcopy.o : $(ACPICA_CORE)/utilities/utcopy.c
$(COMPILE)
 
utdebug.o : $(ACPICA_CORE)/utilities/utdebug.c
$(COMPILE)
 
utdecode.o : $(ACPICA_CORE)/utilities/utdecode.c
$(COMPILE)
 
utdelete.o : $(ACPICA_CORE)/utilities/utdelete.c
$(COMPILE)
 
utglobal.o : $(ACPICA_CORE)/utilities/utglobal.c
$(COMPILE)
 
utinit.o : $(ACPICA_CORE)/utilities/utinit.c
$(COMPILE)
 
utlock.o : $(ACPICA_CORE)/utilities/utlock.c
$(COMPILE)
 
utmath.o : $(ACPICA_CORE)/utilities/utmath.c
$(COMPILE)
 
utmisc.o : $(ACPICA_CORE)/utilities/utmisc.c
$(COMPILE)
 
utmutex.o : $(ACPICA_CORE)/utilities/utmutex.c
$(COMPILE)
 
utobject.o : $(ACPICA_CORE)/utilities/utobject.c
$(COMPILE)
 
utresrc.o : $(ACPICA_CORE)/utilities/utresrc.c
$(COMPILE)
 
utstate.o : $(ACPICA_CORE)/utilities/utstate.c
$(COMPILE)
 
utxferror.o : $(ACPICA_CORE)/utilities/utxferror.c
$(COMPILE)
 
utxface.o : $(ACPICA_CORE)/utilities/utxface.c
$(COMPILE)
 
#
# Unix OS services layer (OSL)
#
osunixxf.o : $(ACPICA_OSL)/osunixxf.c
$(COMPILE)
 
 
clean :
rm -f $(PROG) $(PROG).exe $(OBJS) $(INTERMEDIATES) $(MISC)
 
install :
$(INSTALLPROG)
/drivers/devman/acpica/generate/unix/iasl
Property changes:
Added: bugtraq:number
+true
\ No newline at end of property
/drivers/devman/acpica/generate/unix/readme.txt
0,0 → 1,120
Generic Unix ACPICA makefiles
-----------------------------
 
These makefiles are intended to generate the ACPICA utilities in
a Unix-like environment, with the original ACPICA code (not linuxized),
and in the original (git tree) ACPICA directory structure.
 
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 top level makefile will generate the following utilities:
Note: These utilities are tested and supported as 32-bit versions
only.
 
acpibin
acpiexec
acpihelp
acpinames
acpisrc
acpixtract
iasl
 
To generate all utilities:
 
cd acpica/generate/unix
make
make install /* install all binaries to /usr/bin */
 
 
Requirements
------------
 
make
gcc compiler (4+)
bison or yacc
flex or lex
 
 
Configuration
-------------
 
The Makefile.config file contains the configuration information:
 
HOST = _CYGWIN /* Host system, must appear in acenv.h */
CC = gcc /* C compiler */
ACPICA_SRC = ../../../source /* Location of acpica source tree */
 
 
Intermediate Files
------------------
 
The intermediate files for each utility (.o, etc.) are placed in the
subdirectory corresponding to each utility, not in the source code
tree itself. This prevents collisions when different utilities compile
the same source modules with different options.
 
 
Output
------
 
The executable utilities are copied to the local bin directory.
 
"make install" will install the binaries to /usr/bin
 
 
 
1) acpibin, an AML file tool
 
acpibin compares AML files, dumps AML binary files to text files,
extracts binary AML from text files, and other AML file
manipulation.
 
 
2) acpiexec, a user-space AML interpreter
 
acpiexec allows the loading of ACPI tables and execution of control
methods from user space. Useful for debugging AML code and testing
the AML interpreter. Hardware access is simulated.
 
 
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.)
 
 
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.
 
 
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.
 
 
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.)
 
 
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.
/drivers/devman/acpica/generate/unix
Property changes:
Added: bugtraq:number
+true
\ No newline at end of property
/drivers/devman/acpica/hardware/hwacpi.c
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
/drivers/devman/acpica/hardware/hwgpe.c
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
132,25 → 132,56
 
/******************************************************************************
*
* FUNCTION: AcpiHwLowDisableGpe
* FUNCTION: AcpiHwGetGpeRegisterBit
*
* PARAMETERS: GpeEventInfo - Info block for the GPE
* GpeRegisterInfo - Info block for the GPE register
*
* RETURN: Register mask with a one in the GPE bit position
*
* DESCRIPTION: Compute the register mask for this GPE. One bit is set in the
* correct position for the input GPE.
*
******************************************************************************/
 
UINT32
AcpiHwGetGpeRegisterBit (
ACPI_GPE_EVENT_INFO *GpeEventInfo,
ACPI_GPE_REGISTER_INFO *GpeRegisterInfo)
{
 
return ((UINT32) 1 <<
(GpeEventInfo->GpeNumber - GpeRegisterInfo->BaseGpeNumber));
}
 
 
/******************************************************************************
*
* FUNCTION: AcpiHwLowSetGpe
*
* PARAMETERS: GpeEventInfo - Info block for the GPE to be disabled
* Action - Enable or disable
*
* RETURN: Status
*
* DESCRIPTION: Disable a single GPE in the enable register.
* DESCRIPTION: Enable or disable a single GPE in the parent enable register.
*
******************************************************************************/
 
ACPI_STATUS
AcpiHwLowDisableGpe (
ACPI_GPE_EVENT_INFO *GpeEventInfo)
AcpiHwLowSetGpe (
ACPI_GPE_EVENT_INFO *GpeEventInfo,
UINT32 Action)
{
ACPI_GPE_REGISTER_INFO *GpeRegisterInfo;
ACPI_STATUS Status;
UINT32 EnableMask;
UINT32 RegisterBit;
 
 
ACPI_FUNCTION_ENTRY ();
 
 
/* Get the info block for the entire GPE register */
 
GpeRegisterInfo = GpeEventInfo->RegisterInfo;
167,57 → 198,38
return (Status);
}
 
/* Clear just the bit that corresponds to this GPE */
/* Set or clear just the bit that corresponds to this GPE */
 
ACPI_CLEAR_BIT (EnableMask, ((UINT32) 1 <<
(GpeEventInfo->GpeNumber - GpeRegisterInfo->BaseGpeNumber)));
RegisterBit = AcpiHwGetGpeRegisterBit (GpeEventInfo, GpeRegisterInfo);
switch (Action)
{
case ACPI_GPE_CONDITIONAL_ENABLE:
 
/* Only enable if the EnableForRun bit is set */
 
/* Write the updated enable mask */
 
Status = AcpiHwWrite (EnableMask, &GpeRegisterInfo->EnableAddress);
return (Status);
if (!(RegisterBit & GpeRegisterInfo->EnableForRun))
{
return (AE_BAD_PARAMETER);
}
 
/*lint -fallthrough */
 
/******************************************************************************
*
* FUNCTION: AcpiHwWriteGpeEnableReg
*
* PARAMETERS: GpeEventInfo - Info block for the GPE to be enabled
*
* RETURN: Status
*
* DESCRIPTION: Write a GPE enable register. Note: The bit for this GPE must
* already be cleared or set in the parent register
* EnableForRun mask.
*
******************************************************************************/
case ACPI_GPE_ENABLE:
ACPI_SET_BIT (EnableMask, RegisterBit);
break;
 
ACPI_STATUS
AcpiHwWriteGpeEnableReg (
ACPI_GPE_EVENT_INFO *GpeEventInfo)
{
ACPI_GPE_REGISTER_INFO *GpeRegisterInfo;
ACPI_STATUS Status;
case ACPI_GPE_DISABLE:
ACPI_CLEAR_BIT (EnableMask, RegisterBit);
break;
 
 
ACPI_FUNCTION_ENTRY ();
 
 
/* Get the info block for the entire GPE register */
 
GpeRegisterInfo = GpeEventInfo->RegisterInfo;
if (!GpeRegisterInfo)
{
return (AE_NOT_EXIST);
default:
ACPI_ERROR ((AE_INFO, "Invalid GPE Action, %u\n", Action));
return (AE_BAD_PARAMETER);
}
 
/* Write the entire GPE (runtime) enable register */
/* Write the updated enable mask */
 
Status = AcpiHwWrite (GpeRegisterInfo->EnableForRun,
&GpeRegisterInfo->EnableAddress);
 
Status = AcpiHwWrite (EnableMask, &GpeRegisterInfo->EnableAddress);
return (Status);
}
 
238,22 → 250,29
AcpiHwClearGpe (
ACPI_GPE_EVENT_INFO *GpeEventInfo)
{
ACPI_GPE_REGISTER_INFO *GpeRegisterInfo;
ACPI_STATUS Status;
UINT8 RegisterBit;
UINT32 RegisterBit;
 
 
ACPI_FUNCTION_ENTRY ();
 
/* Get the info block for the entire GPE register */
 
RegisterBit = (UINT8) (1 <<
(GpeEventInfo->GpeNumber - GpeEventInfo->RegisterInfo->BaseGpeNumber));
GpeRegisterInfo = GpeEventInfo->RegisterInfo;
if (!GpeRegisterInfo)
{
return (AE_NOT_EXIST);
}
 
/*
* Write a one to the appropriate bit in the status register to
* clear this GPE.
*/
RegisterBit = AcpiHwGetGpeRegisterBit (GpeEventInfo, GpeRegisterInfo);
 
Status = AcpiHwWrite (RegisterBit,
&GpeEventInfo->RegisterInfo->StatusAddress);
&GpeRegisterInfo->StatusAddress);
 
return (Status);
}
278,10 → 297,10
ACPI_EVENT_STATUS *EventStatus)
{
UINT32 InByte;
UINT8 RegisterBit;
UINT32 RegisterBit;
ACPI_GPE_REGISTER_INFO *GpeRegisterInfo;
ACPI_EVENT_STATUS LocalEventStatus = 0;
ACPI_STATUS Status;
ACPI_EVENT_STATUS LocalEventStatus = 0;
 
 
ACPI_FUNCTION_ENTRY ();
298,8 → 317,7
 
/* Get the register bitmask for this GPE */
 
RegisterBit = (UINT8) (1 <<
(GpeEventInfo->GpeNumber - GpeEventInfo->RegisterInfo->BaseGpeNumber));
RegisterBit = AcpiHwGetGpeRegisterBit (GpeEventInfo, GpeRegisterInfo);
 
/* GPE currently enabled? (enabled for runtime?) */
 
/drivers/devman/acpica/hardware/hwpci.c
0,0 → 1,531
/*******************************************************************************
*
* Module Name: hwpci - Obtain PCI bus, device, and function numbers
*
******************************************************************************/
 
/******************************************************************************
*
* 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 __HWPCI_C__
 
#include "acpi.h"
#include "accommon.h"
 
 
#define _COMPONENT ACPI_NAMESPACE
ACPI_MODULE_NAME ("hwpci")
 
 
/* PCI configuration space values */
 
#define PCI_CFG_HEADER_TYPE_REG 0x0E
#define PCI_CFG_PRIMARY_BUS_NUMBER_REG 0x18
#define PCI_CFG_SECONDARY_BUS_NUMBER_REG 0x19
 
/* PCI header values */
 
#define PCI_HEADER_TYPE_MASK 0x7F
#define PCI_TYPE_BRIDGE 0x01
#define PCI_TYPE_CARDBUS_BRIDGE 0x02
 
typedef struct acpi_pci_device
{
ACPI_HANDLE Device;
struct acpi_pci_device *Next;
 
} ACPI_PCI_DEVICE;
 
 
/* Local prototypes */
 
static ACPI_STATUS
AcpiHwBuildPciList (
ACPI_HANDLE RootPciDevice,
ACPI_HANDLE PciRegion,
ACPI_PCI_DEVICE **ReturnListHead);
 
static ACPI_STATUS
AcpiHwProcessPciList (
ACPI_PCI_ID *PciId,
ACPI_PCI_DEVICE *ListHead);
 
static void
AcpiHwDeletePciList (
ACPI_PCI_DEVICE *ListHead);
 
static ACPI_STATUS
AcpiHwGetPciDeviceInfo (
ACPI_PCI_ID *PciId,
ACPI_HANDLE PciDevice,
UINT16 *BusNumber,
BOOLEAN *IsBridge);
 
 
/*******************************************************************************
*
* FUNCTION: AcpiHwDerivePciId
*
* PARAMETERS: PciId - Initial values for the PCI ID. May be
* modified by this function.
* RootPciDevice - A handle to a PCI device object. This
* object must be a PCI Root Bridge having a
* _HID value of either PNP0A03 or PNP0A08
* PciRegion - A handle to a PCI configuration space
* Operation Region being initialized
*
* RETURN: Status
*
* DESCRIPTION: This function derives a full PCI ID for a PCI device,
* consisting of a Segment number, Bus number, Device number,
* and function code.
*
* The PCI hardware dynamically configures PCI bus numbers
* depending on the bus topology discovered during system
* initialization. This function is invoked during configuration
* of a PCI_Config Operation Region in order to (possibly) update
* the Bus/Device/Function numbers in the PciId with the actual
* values as determined by the hardware and operating system
* configuration.
*
* The PciId parameter is initially populated during the Operation
* Region initialization. This function is then called, and is
* will make any necessary modifications to the Bus, Device, or
* Function number PCI ID subfields as appropriate for the
* current hardware and OS configuration.
*
* NOTE: Created 08/2010. Replaces the previous OSL AcpiOsDerivePciId
* interface since this feature is OS-independent. This module
* specifically avoids any use of recursion by building a local
* temporary device list.
*
******************************************************************************/
 
ACPI_STATUS
AcpiHwDerivePciId (
ACPI_PCI_ID *PciId,
ACPI_HANDLE RootPciDevice,
ACPI_HANDLE PciRegion)
{
ACPI_STATUS Status;
ACPI_PCI_DEVICE *ListHead = NULL;
 
 
ACPI_FUNCTION_TRACE (HwDerivePciId);
 
 
if (!PciId)
{
return_ACPI_STATUS (AE_BAD_PARAMETER);
}
 
/* Build a list of PCI devices, from PciRegion up to RootPciDevice */
 
Status = AcpiHwBuildPciList (RootPciDevice, PciRegion, &ListHead);
if (ACPI_SUCCESS (Status))
{
/* Walk the list, updating the PCI device/function/bus numbers */
 
Status = AcpiHwProcessPciList (PciId, ListHead);
}
 
/* Always delete the list */
 
AcpiHwDeletePciList (ListHead);
return_ACPI_STATUS (Status);
}
 
 
/*******************************************************************************
*
* FUNCTION: AcpiHwBuildPciList
*
* PARAMETERS: RootPciDevice - A handle to a PCI device object. This
* object is guaranteed to be a PCI Root
* Bridge having a _HID value of either
* PNP0A03 or PNP0A08
* PciRegion - A handle to the PCI configuration space
* Operation Region
* ReturnListHead - Where the PCI device list is returned
*
* RETURN: Status
*
* DESCRIPTION: Builds a list of devices from the input PCI region up to the
* Root PCI device for this namespace subtree.
*
******************************************************************************/
 
static ACPI_STATUS
AcpiHwBuildPciList (
ACPI_HANDLE RootPciDevice,
ACPI_HANDLE PciRegion,
ACPI_PCI_DEVICE **ReturnListHead)
{
ACPI_HANDLE CurrentDevice;
ACPI_HANDLE ParentDevice;
ACPI_STATUS Status;
ACPI_PCI_DEVICE *ListElement;
ACPI_PCI_DEVICE *ListHead = NULL;
 
 
/*
* Ascend namespace branch until the RootPciDevice is reached, building
* a list of device nodes. Loop will exit when either the PCI device is
* found, or the root of the namespace is reached.
*/
CurrentDevice = PciRegion;
while (1)
{
Status = AcpiGetParent (CurrentDevice, &ParentDevice);
if (ACPI_FAILURE (Status))
{
return (Status);
}
 
/* Finished when we reach the PCI root device (PNP0A03 or PNP0A08) */
 
if (ParentDevice == RootPciDevice)
{
*ReturnListHead = ListHead;
return (AE_OK);
}
 
ListElement = ACPI_ALLOCATE (sizeof (ACPI_PCI_DEVICE));
if (!ListElement)
{
return (AE_NO_MEMORY);
}
 
/* Put new element at the head of the list */
 
ListElement->Next = ListHead;
ListElement->Device = ParentDevice;
ListHead = ListElement;
 
CurrentDevice = ParentDevice;
}
}
 
 
/*******************************************************************************
*
* FUNCTION: AcpiHwProcessPciList
*
* PARAMETERS: PciId - Initial values for the PCI ID. May be
* modified by this function.
* ListHead - Device list created by
* AcpiHwBuildPciList
*
* RETURN: Status
*
* DESCRIPTION: Walk downward through the PCI device list, getting the device
* info for each, via the PCI configuration space and updating
* the PCI ID as necessary. Deletes the list during traversal.
*
******************************************************************************/
 
static ACPI_STATUS
AcpiHwProcessPciList (
ACPI_PCI_ID *PciId,
ACPI_PCI_DEVICE *ListHead)
{
ACPI_STATUS Status = AE_OK;
ACPI_PCI_DEVICE *Info;
UINT16 BusNumber;
BOOLEAN IsBridge = TRUE;
 
 
ACPI_FUNCTION_NAME (HwProcessPciList);
 
 
ACPI_DEBUG_PRINT ((ACPI_DB_OPREGION,
"Input PciId: Seg %4.4X Bus %4.4X Dev %4.4X Func %4.4X\n",
PciId->Segment, PciId->Bus, PciId->Device, PciId->Function));
 
BusNumber = PciId->Bus;
 
/*
* Descend down the namespace tree, collecting PCI device, function,
* and bus numbers. BusNumber is only important for PCI bridges.
* Algorithm: As we descend the tree, use the last valid PCI device,
* function, and bus numbers that are discovered, and assign them
* to the PCI ID for the target device.
*/
Info = ListHead;
while (Info)
{
Status = AcpiHwGetPciDeviceInfo (PciId, Info->Device,
&BusNumber, &IsBridge);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
}
 
Info = Info->Next;
}
 
ACPI_DEBUG_PRINT ((ACPI_DB_OPREGION,
"Output PciId: Seg %4.4X Bus %4.4X Dev %4.4X Func %4.4X "
"Status %X BusNumber %X IsBridge %X\n",
PciId->Segment, PciId->Bus, PciId->Device, PciId->Function,
Status, BusNumber, IsBridge));
 
return_ACPI_STATUS (AE_OK);
}
 
 
/*******************************************************************************
*
* FUNCTION: AcpiHwDeletePciList
*
* PARAMETERS: ListHead - Device list created by
* AcpiHwBuildPciList
*
* RETURN: None
*
* DESCRIPTION: Free the entire PCI list.
*
******************************************************************************/
 
static void
AcpiHwDeletePciList (
ACPI_PCI_DEVICE *ListHead)
{
ACPI_PCI_DEVICE *Next;
ACPI_PCI_DEVICE *Previous;
 
 
Next = ListHead;
while (Next)
{
Previous = Next;
Next = Previous->Next;
ACPI_FREE (Previous);
}
}
 
 
/*******************************************************************************
*
* FUNCTION: AcpiHwGetPciDeviceInfo
*
* PARAMETERS: PciId - Initial values for the PCI ID. May be
* modified by this function.
* PciDevice - Handle for the PCI device object
* BusNumber - Where a PCI bridge bus number is returned
* IsBridge - Return value, indicates if this PCI
* device is a PCI bridge
*
* RETURN: Status
*
* DESCRIPTION: Get the device info for a single PCI device object. Get the
* _ADR (contains PCI device and function numbers), and for PCI
* bridge devices, get the bus number from PCI configuration
* space.
*
******************************************************************************/
 
static ACPI_STATUS
AcpiHwGetPciDeviceInfo (
ACPI_PCI_ID *PciId,
ACPI_HANDLE PciDevice,
UINT16 *BusNumber,
BOOLEAN *IsBridge)
{
ACPI_STATUS Status;
ACPI_OBJECT_TYPE ObjectType;
UINT64 ReturnValue;
UINT64 PciValue;
 
 
/* We only care about objects of type Device */
 
Status = AcpiGetType (PciDevice, &ObjectType);
if (ACPI_FAILURE (Status))
{
return (Status);
}
 
if (ObjectType != ACPI_TYPE_DEVICE)
{
return (AE_OK);
}
 
/* We need an _ADR. Ignore device if not present */
 
Status = AcpiUtEvaluateNumericObject (METHOD_NAME__ADR,
PciDevice, &ReturnValue);
if (ACPI_FAILURE (Status))
{
return (AE_OK);
}
 
/*
* From _ADR, get the PCI Device and Function and
* update the PCI ID.
*/
PciId->Device = ACPI_HIWORD (ACPI_LODWORD (ReturnValue));
PciId->Function = ACPI_LOWORD (ACPI_LODWORD (ReturnValue));
 
/*
* If the previous device was a bridge, use the previous
* device bus number
*/
if (*IsBridge)
{
PciId->Bus = *BusNumber;
}
 
/*
* Get the bus numbers from PCI Config space:
*
* First, get the PCI HeaderType
*/
*IsBridge = FALSE;
Status = AcpiOsReadPciConfiguration (PciId,
PCI_CFG_HEADER_TYPE_REG, &PciValue, 8);
if (ACPI_FAILURE (Status))
{
return (Status);
}
 
/* We only care about bridges (1=PciBridge, 2=CardBusBridge) */
 
PciValue &= PCI_HEADER_TYPE_MASK;
 
if ((PciValue != PCI_TYPE_BRIDGE) &&
(PciValue != PCI_TYPE_CARDBUS_BRIDGE))
{
return (AE_OK);
}
 
/* Bridge: Get the Primary BusNumber */
 
Status = AcpiOsReadPciConfiguration (PciId,
PCI_CFG_PRIMARY_BUS_NUMBER_REG, &PciValue, 8);
if (ACPI_FAILURE (Status))
{
return (Status);
}
 
*IsBridge = TRUE;
PciId->Bus = (UINT16) PciValue;
 
/* Bridge: Get the Secondary BusNumber */
 
Status = AcpiOsReadPciConfiguration (PciId,
PCI_CFG_SECONDARY_BUS_NUMBER_REG, &PciValue, 8);
if (ACPI_FAILURE (Status))
{
return (Status);
}
 
*BusNumber = (UINT16) PciValue;
return (AE_OK);
}
/drivers/devman/acpica/hardware/hwregs.c
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
/drivers/devman/acpica/hardware/hwsleep.c
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
/drivers/devman/acpica/hardware/hwtimer.c
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
/drivers/devman/acpica/hardware/hwvalid.c
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
/drivers/devman/acpica/hardware/hwxface.c
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
/drivers/devman/acpica/include/acapps.h
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
121,6 → 121,38
#pragma warning(disable:4100) /* warning C4100: unreferenced formal parameter */
#endif
 
/* Common info for tool signons */
 
#define ACPICA_NAME "Intel ACPI Component Architecture"
#define ACPICA_COPYRIGHT "Copyright (c) 2000 - 2011 Intel Corporation"
 
#if ACPI_MACHINE_WIDTH == 64
#define ACPI_WIDTH "-64"
 
#elif ACPI_MACHINE_WIDTH == 32
#define ACPI_WIDTH "-32"
 
#else
#error unknown ACPI_MACHINE_WIDTH
#define ACPI_WIDTH "-??"
 
#endif
 
/* Macros for signons and file headers */
 
#define ACPI_COMMON_SIGNON(UtilityName) \
"\n%s\n%s version %8.8X%s [%s]\n%s\n\n", \
ACPICA_NAME, \
UtilityName, ((UINT32) ACPI_CA_VERSION), ACPI_WIDTH, __DATE__, \
ACPICA_COPYRIGHT
 
#define ACPI_COMMON_HEADER(UtilityName, Prefix) \
"%s%s\n%s%s version %8.8X%s [%s]\n%s%s\n%s\n", \
Prefix, ACPICA_NAME, \
Prefix, UtilityName, ((UINT32) ACPI_CA_VERSION), ACPI_WIDTH, __DATE__, \
Prefix, ACPICA_COPYRIGHT, \
Prefix
 
#define FILE_SUFFIX_DISASSEMBLY "dsl"
#define ACPI_TABLE_FILE_SUFFIX ".dat"
 
/drivers/devman/acpica/include/accommon.h
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
/drivers/devman/acpica/include/acconfig.h
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
240,7 → 240,6
 
/* Operation regions */
 
#define ACPI_NUM_PREDEFINED_REGIONS 9
#define ACPI_USER_REGION_BEGIN 0x80
 
/* Maximum SpaceIds for Operation Regions */
273,7 → 272,8
*
*****************************************************************************/
 
#define ACPI_DEBUGGER_MAX_ARGS 8 /* Must be max method args + 1 */
#define ACPI_DEBUGGER_MAX_ARGS ACPI_METHOD_NUM_ARGS + 2 /* Max command line arguments */
#define ACPI_DB_LINE_BUFFER_SIZE 512
 
#define ACPI_DEBUGGER_COMMAND_PROMPT '-'
#define ACPI_DEBUGGER_EXECUTE_PROMPT '%'
/drivers/devman/acpica/include/acdebug.h
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,7
#define __ACDEBUG_H__
 
 
#define ACPI_DEBUG_BUFFER_SIZE 4196
#define ACPI_DEBUG_BUFFER_SIZE 0x4000 /* 16K buffer for return objects */
 
typedef struct CommandInfo
{
170,9 → 170,9
/*
* dbcmds - debug commands and output routines
*/
ACPI_STATUS
AcpiDbDisassembleMethod (
char *Name);
ACPI_NAMESPACE_NODE *
AcpiDbConvertToNode (
char *InString);
 
void
AcpiDbDisplayTableInfo (
184,40 → 184,55
char *InstanceArg);
 
void
AcpiDbSetMethodBreakpoint (
char *Location,
ACPI_WALK_STATE *WalkState,
ACPI_PARSE_OBJECT *Op);
AcpiDbSendNotify (
char *Name,
UINT32 Value);
 
void
AcpiDbSetMethodCallBreakpoint (
ACPI_PARSE_OBJECT *Op);
AcpiDbDisplayInterfaces (
char *ActionArg,
char *InterfaceNameArg);
 
ACPI_STATUS
AcpiDbSleep (
char *ObjectArg);
 
void
AcpiDbGetBusInfo (
AcpiDbDisplayLocks (
void);
 
void
AcpiDbDisassembleAml (
char *Statements,
ACPI_PARSE_OBJECT *Op);
AcpiDbDisplayResources (
char *ObjectArg);
 
void
AcpiDbDumpNamespace (
char *StartArg,
char *DepthArg);
AcpiDbDisplayGpes (
void);
 
void
AcpiDbDumpNamespaceByOwner (
char *OwnerArg,
char *DepthArg);
AcpiDbDisplayHandlers (
void);
 
void
AcpiDbSendNotify (
char *Name,
UINT32 Value);
AcpiDbGenerateGpe (
char *GpeArg,
char *BlockArg);
 
 
/*
* dbmethod - control method commands
*/
void
AcpiDbSetMethodBreakpoint (
char *Location,
ACPI_WALK_STATE *WalkState,
ACPI_PARSE_OBJECT *Op);
 
void
AcpiDbSetMethodCallBreakpoint (
ACPI_PARSE_OBJECT *Op);
 
void
AcpiDbSetMethodData (
char *TypeArg,
char *IndexArg,
224,54 → 239,61
char *ValueArg);
 
ACPI_STATUS
AcpiDbDisplayObjects (
char *ObjTypeArg,
char *DisplayCountArg);
AcpiDbDisassembleMethod (
char *Name);
 
ACPI_STATUS
AcpiDbFindNameInNamespace (
char *NameArg);
void
AcpiDbDisassembleAml (
char *Statements,
ACPI_PARSE_OBJECT *Op);
 
void
AcpiDbSetScope (
char *Name);
AcpiDbBatchExecute (
char *CountArg);
 
ACPI_STATUS
AcpiDbSleep (
char *ObjectArg);
 
/*
* dbnames - namespace commands
*/
void
AcpiDbFindReferences (
char *ObjectArg);
AcpiDbSetScope (
char *Name);
 
void
AcpiDbDisplayLocks (
void);
AcpiDbDumpNamespace (
char *StartArg,
char *DepthArg);
 
void
AcpiDbDisplayResources (
char *ObjectArg);
AcpiDbDumpNamespaceByOwner (
char *OwnerArg,
char *DepthArg);
 
ACPI_STATUS
AcpiDbFindNameInNamespace (
char *NameArg);
 
void
AcpiDbDisplayGpes (
AcpiDbCheckPredefinedNames (
void);
 
ACPI_STATUS
AcpiDbDisplayObjects (
char *ObjTypeArg,
char *DisplayCountArg);
 
void
AcpiDbCheckIntegrity (
void);
 
void
AcpiDbGenerateGpe (
char *GpeArg,
char *BlockArg);
AcpiDbFindReferences (
char *ObjectArg);
 
void
AcpiDbCheckPredefinedNames (
AcpiDbGetBusInfo (
void);
 
void
AcpiDbBatchExecute (
char *CountArg);
 
/*
* dbdisply - debug display commands
327,6 → 349,7
AcpiDbExecute (
char *Name,
char **Args,
ACPI_OBJECT_TYPE *Types,
UINT32 Flags);
 
void
407,7 → 430,13
char Prompt,
ACPI_PARSE_OBJECT *Op);
 
char *
AcpiDbGetNextToken (
char *String,
char **Next,
ACPI_OBJECT_TYPE *ReturnType);
 
 
/*
* dbstats - Generation and display of ACPI table statistics
*/
/drivers/devman/acpica/include/acdisasm.h
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,13
#define BLOCK_COMMA_LIST 4
#define ACPI_DEFAULT_RESNAME *(UINT32 *) "__RD"
 
/*
* Raw table data header. Used by disassembler and data table compiler.
* Do not change.
*/
#define ACPI_RAW_TABLE_DATA_HEADER "Raw Table Data"
 
 
typedef const struct acpi_dmtable_info
{
UINT8 Opcode;
185,8 → 191,19
#define ACPI_DMT_IVRS 34
#define ACPI_DMT_BUFFER 35
#define ACPI_DMT_PCI_PATH 36
#define ACPI_DMT_EINJACT 37
#define ACPI_DMT_EINJINST 38
#define ACPI_DMT_ERSTACT 39
#define ACPI_DMT_ERSTINST 40
#define ACPI_DMT_ACCWIDTH 41
#define ACPI_DMT_UNICODE 42
#define ACPI_DMT_UUID 43
#define ACPI_DMT_DEVICE_PATH 44
#define ACPI_DMT_LABEL 45
#define ACPI_DMT_BUF7 46
#define ACPI_DMT_BUF128 47
#define ACPI_DMT_SLIC 48
 
 
typedef
void (*ACPI_DMTABLE_HANDLER) (
ACPI_TABLE_HEADER *Table);
201,6 → 218,7
ACPI_DMTABLE_INFO *TableInfo;
ACPI_DMTABLE_HANDLER TableHandler;
ACPI_CMTABLE_HANDLER CmTableHandler;
const unsigned char *Template;
char *Name;
 
} ACPI_DMTABLE_DATA;
270,6 → 288,7
extern ACPI_DMTABLE_INFO AcpiDmTableInfoEinj[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoEinj0[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoErst[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoErst0[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoFacs[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoFadt1[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoFadt2[];
316,7 → 335,9
extern ACPI_DMTABLE_INFO AcpiDmTableInfoRsdp1[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoRsdp2[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoSbst[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoSlic[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoSlicHdr[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoSlic0[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoSlic1[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoSlit[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoSpcr[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoSpmi[];
330,13 → 351,23
extern ACPI_DMTABLE_INFO AcpiDmTableInfoWaet[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoWdat[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoWdat0[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoWddt[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoWdrt[];
 
extern ACPI_DMTABLE_INFO AcpiDmTableInfoGeneric[][2];
 
 
/*
* dmtable
*/
extern ACPI_DMTABLE_DATA AcpiDmTableData[];
 
UINT8
AcpiDmGenerateChecksum (
void *Table,
UINT32 Length,
UINT8 OriginalChecksum);
 
ACPI_DMTABLE_DATA *
AcpiDmGetTableData (
char *Signature);
423,6 → 454,10
ACPI_TABLE_HEADER *Table);
 
void
AcpiDmDumpSlic (
ACPI_TABLE_HEADER *Table);
 
void
AcpiDmDumpSlit (
ACPI_TABLE_HEADER *Table);
 
568,7 → 603,16
/*
* dmextern
*/
 
ACPI_STATUS
AcpiDmAddToExternalFileList (
char *PathList);
 
void
AcpiDmClearExternalFileList (
void);
 
void
AcpiDmAddToExternalList (
ACPI_PARSE_OBJECT *Op,
char *Path,
784,4 → 828,13
ACPI_PARSE_OBJECT *Op,
ACPI_WALK_STATE *WalkState);
 
 
/*
* acdisasm
*/
void
AdDisassemblerHeader (
char *Filename);
 
 
#endif /* __ACDISASM_H__ */
/drivers/devman/acpica/include/acdispat.h
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
123,7 → 123,7
 
 
/*
* dsopcode - support for late evaluation
* dsargs - execution of dynamic arguments for static objects
*/
ACPI_STATUS
AcpiDsGetBufferFieldArguments (
145,7 → 145,25
AcpiDsGetPackageArguments (
ACPI_OPERAND_OBJECT *ObjDesc);
 
 
/*
* dscontrol - support for execution control opcodes
*/
ACPI_STATUS
AcpiDsExecBeginControlOp (
ACPI_WALK_STATE *WalkState,
ACPI_PARSE_OBJECT *Op);
 
ACPI_STATUS
AcpiDsExecEndControlOp (
ACPI_WALK_STATE *WalkState,
ACPI_PARSE_OBJECT *Op);
 
 
/*
* dsopcode - support for late operand evaluation
*/
ACPI_STATUS
AcpiDsEvalBufferFieldOperands (
ACPI_WALK_STATE *WalkState,
ACPI_PARSE_OBJECT *Op);
177,20 → 195,6
 
 
/*
* dsctrl - Parser/Interpreter interface, control stack routines
*/
ACPI_STATUS
AcpiDsExecBeginControlOp (
ACPI_WALK_STATE *WalkState,
ACPI_PARSE_OBJECT *Op);
 
ACPI_STATUS
AcpiDsExecEndControlOp (
ACPI_WALK_STATE *WalkState,
ACPI_PARSE_OBJECT *Op);
 
 
/*
* dsexec - Parser/Interpreter interface, method execution callbacks
*/
ACPI_STATUS
241,9 → 245,14
 
 
/*
* dsload - Parser/Interpreter interface, namespace load callbacks
* dsload - Parser/Interpreter interface, pass 1 namespace load callbacks
*/
ACPI_STATUS
AcpiDsInitCallbacks (
ACPI_WALK_STATE *WalkState,
UINT32 PassNumber);
 
ACPI_STATUS
AcpiDsLoad1BeginOp (
ACPI_WALK_STATE *WalkState,
ACPI_PARSE_OBJECT **OutOp);
252,6 → 261,10
AcpiDsLoad1EndOp (
ACPI_WALK_STATE *WalkState);
 
 
/*
* dsload - Parser/Interpreter interface, pass 2 namespace load callbacks
*/
ACPI_STATUS
AcpiDsLoad2BeginOp (
ACPI_WALK_STATE *WalkState,
261,12 → 274,7
AcpiDsLoad2EndOp (
ACPI_WALK_STATE *WalkState);
 
ACPI_STATUS
AcpiDsInitCallbacks (
ACPI_WALK_STATE *WalkState,
UINT32 PassNumber);
 
 
/*
* dsmthdat - method data (locals/args)
*/
/drivers/devman/acpica/include/acevents.h
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
128,10 → 128,6
AcpiEvInstallXruptHandlers (
void);
 
ACPI_STATUS
AcpiEvInstallFadtGpes (
void);
 
UINT32
AcpiEvFixedEventDetect (
void);
144,7 → 140,24
AcpiEvIsNotifyObject (
ACPI_NAMESPACE_NODE *Node);
 
UINT32
AcpiEvGetGpeNumberIndex (
UINT32 GpeNumber);
 
ACPI_STATUS
AcpiEvQueueNotifyRequest (
ACPI_NAMESPACE_NODE *Node,
UINT32 NotifyValue);
 
 
/*
* evglock - Global Lock support
*/
ACPI_STATUS
AcpiEvInitGlobalLockHandler (
void);
 
ACPI_STATUS
AcpiEvAcquireGlobalLock(
UINT16 Timeout);
 
153,19 → 166,10
void);
 
ACPI_STATUS
AcpiEvInitGlobalLockHandler (
AcpiEvRemoveGlobalLockHandler (
void);
 
UINT32
AcpiEvGetGpeNumberIndex (
UINT32 GpeNumber);
 
ACPI_STATUS
AcpiEvQueueNotifyRequest (
ACPI_NAMESPACE_NODE *Node,
UINT32 NotifyValue);
 
 
/*
* evgpe - Low-level GPE support
*/
174,7 → 178,7
ACPI_GPE_XRUPT_INFO *GpeXruptList);
 
ACPI_STATUS
AcpiEvUpdateGpeEnableMasks (
AcpiEvUpdateGpeEnableMask (
ACPI_GPE_EVENT_INFO *GpeEventInfo);
 
ACPI_STATUS
182,9 → 186,13
ACPI_GPE_EVENT_INFO *GpeEventInfo);
 
ACPI_STATUS
AcpiEvDisableGpe (
AcpiEvAddGpeReference (
ACPI_GPE_EVENT_INFO *GpeEventInfo);
 
ACPI_STATUS
AcpiEvRemoveGpeReference (
ACPI_GPE_EVENT_INFO *GpeEventInfo);
 
ACPI_GPE_EVENT_INFO *
AcpiEvGetGpeEventInfo (
ACPI_HANDLE GpeDevice,
195,7 → 203,11
UINT32 GpeNumber,
ACPI_GPE_BLOCK_INFO *GpeBlock);
 
ACPI_STATUS
AcpiEvFinishGpe (
ACPI_GPE_EVENT_INFO *GpeEventInfo);
 
 
/*
* evgpeblk - Upper-level GPE block support
*/
210,8 → 222,9
 
ACPI_STATUS
AcpiEvInitializeGpeBlock (
ACPI_NAMESPACE_NODE *GpeDevice,
ACPI_GPE_BLOCK_INFO *GpeBlock);
ACPI_GPE_XRUPT_INFO *GpeXruptInfo,
ACPI_GPE_BLOCK_INFO *GpeBlock,
void *Context);
 
ACPI_STATUS
AcpiEvDeleteGpeBlock (
219,6 → 232,7
 
UINT32
AcpiEvGpeDispatch (
ACPI_NAMESPACE_NODE *GpeDevice,
ACPI_GPE_EVENT_INFO *GpeEventInfo,
UINT32 GpeNumber);
 
240,13 → 254,6
void *Context,
void **ReturnValue);
 
ACPI_STATUS
AcpiEvMatchPrwAndGpe (
ACPI_HANDLE ObjHandle,
UINT32 Level,
void *Context,
void **ReturnValue);
 
/*
* evgpeutil - GPE utilities
*/
259,6 → 266,12
AcpiEvValidGpeEvent (
ACPI_GPE_EVENT_INFO *GpeEventInfo);
 
ACPI_STATUS
AcpiEvGetGpeDevice (
ACPI_GPE_XRUPT_INFO *GpeXruptInfo,
ACPI_GPE_BLOCK_INFO *GpeBlock,
void *Context);
 
ACPI_GPE_XRUPT_INFO *
AcpiEvGetGpeXruptBlock (
UINT32 InterruptNumber);
/drivers/devman/acpica/include/acexcep.h
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
/drivers/devman/acpica/include/acglobal.h
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
174,13 → 174,6
UINT8 ACPI_INIT_GLOBAL (AcpiGbl_CreateOsiMethod, TRUE);
 
/*
* Disable wakeup GPEs during runtime? Default is TRUE because WAKE and
* RUNTIME GPEs should never be shared, and WAKE GPEs should typically only
* be enabled just before going to sleep.
*/
UINT8 ACPI_INIT_GLOBAL (AcpiGbl_LeaveWakeGpesDisabled, TRUE);
 
/*
* Optionally use default values for the ACPI register widths. Set this to
* TRUE to use the defaults, if an FADT contains incorrect widths/lengths.
*/
207,7 → 200,13
*/
UINT8 ACPI_INIT_GLOBAL (AcpiGbl_TruncateIoAddresses, FALSE);
 
/*
* Disable runtime checking and repair of values returned by control methods.
* Use only if the repair is causing a problem on a particular machine.
*/
UINT8 ACPI_INIT_GLOBAL (AcpiGbl_DisableAutoRepair, FALSE);
 
 
/* AcpiGbl_FADT is a local copy of the FADT, converted to a common format. */
 
ACPI_TABLE_FADT AcpiGbl_FADT;
214,6 → 213,7
UINT32 AcpiCurrentGpeCount;
UINT32 AcpiGbl_TraceFlags;
ACPI_NAME AcpiGbl_TraceMethodName;
BOOLEAN AcpiGbl_SystemAwakeAndRunning;
 
#endif
 
268,13 → 268,16
 
/*
* Global lock mutex is an actual AML mutex object
* Global lock semaphore works in conjunction with the HW global lock
* Global lock semaphore works in conjunction with the actual global lock
* Global lock spinlock is used for "pending" handshake
*/
ACPI_EXTERN ACPI_OPERAND_OBJECT *AcpiGbl_GlobalLockMutex;
ACPI_EXTERN ACPI_SEMAPHORE AcpiGbl_GlobalLockSemaphore;
ACPI_EXTERN ACPI_SPINLOCK AcpiGbl_GlobalLockPendingLock;
ACPI_EXTERN UINT16 AcpiGbl_GlobalLockHandle;
ACPI_EXTERN BOOLEAN AcpiGbl_GlobalLockAcquired;
ACPI_EXTERN BOOLEAN AcpiGbl_GlobalLockPresent;
ACPI_EXTERN BOOLEAN AcpiGbl_GlobalLockPending;
 
/*
* Spinlocks are used for interfaces that can be possibly called at
283,6 → 286,10
ACPI_EXTERN ACPI_SPINLOCK AcpiGbl_GpeLock; /* For GPE data structs and registers */
ACPI_EXTERN ACPI_SPINLOCK AcpiGbl_HardwareLock; /* For ACPI H/W except GPE registers */
 
/* Mutex for _OSI support */
 
ACPI_EXTERN ACPI_MUTEX AcpiGbl_OsiMutex;
 
/* Reader/Writer lock is used for namespace walk and dynamic table unload */
 
ACPI_EXTERN ACPI_RW_LOCK AcpiGbl_NamespaceRwLock;
311,8 → 318,8
ACPI_EXTERN ACPI_TABLE_HANDLER AcpiGbl_TableHandler;
ACPI_EXTERN void *AcpiGbl_TableHandlerContext;
ACPI_EXTERN ACPI_WALK_STATE *AcpiGbl_BreakpointWalk;
ACPI_EXTERN ACPI_INTERFACE_HANDLER AcpiGbl_InterfaceHandler;
 
 
/* Owner ID support */
 
ACPI_EXTERN UINT32 AcpiGbl_OwnerIdMask[ACPI_NUM_OWNERID_MASKS];
319,6 → 326,10
ACPI_EXTERN UINT8 AcpiGbl_LastOwnerIdIndex;
ACPI_EXTERN UINT8 AcpiGbl_NextOwnerIdOffset;
 
/* Initialization sequencing */
 
ACPI_EXTERN BOOLEAN AcpiGbl_RegMethodsExecuted;
 
/* Misc */
 
ACPI_EXTERN UINT32 AcpiGbl_OriginalMode;
330,8 → 341,8
ACPI_EXTERN BOOLEAN AcpiGbl_StepToNextCall;
ACPI_EXTERN BOOLEAN AcpiGbl_AcpiHardwarePresent;
ACPI_EXTERN BOOLEAN AcpiGbl_EventsInitialized;
ACPI_EXTERN BOOLEAN AcpiGbl_SystemAwakeAndRunning;
ACPI_EXTERN UINT8 AcpiGbl_OsiData;
ACPI_EXTERN ACPI_INTERFACE_INFO *AcpiGbl_SupportedInterfaces;
 
 
#ifndef DEFINE_ACPI_GLOBALS
429,10 → 440,13
*
****************************************************************************/
 
extern ACPI_FIXED_EVENT_INFO AcpiGbl_FixedEventInfo[ACPI_NUM_FIXED_EVENTS];
ACPI_EXTERN ACPI_FIXED_EVENT_HANDLER AcpiGbl_FixedEventHandlers[ACPI_NUM_FIXED_EVENTS];
ACPI_EXTERN UINT8 AcpiGbl_AllGpesInitialized;
ACPI_EXTERN ACPI_GPE_XRUPT_INFO *AcpiGbl_GpeXruptListHead;
ACPI_EXTERN ACPI_GPE_BLOCK_INFO *AcpiGbl_GpeFadtBlocks[ACPI_MAX_GPE_BLOCKS];
ACPI_EXTERN ACPI_GBL_EVENT_HANDLER AcpiGbl_GlobalEventHandler;
ACPI_EXTERN void *AcpiGbl_GlobalEventHandlerContext;
ACPI_EXTERN ACPI_FIXED_EVENT_HANDLER AcpiGbl_FixedEventHandlers[ACPI_NUM_FIXED_EVENTS];
extern ACPI_FIXED_EVENT_INFO AcpiGbl_FixedEventInfo[ACPI_NUM_FIXED_EVENTS];
 
 
/*****************************************************************************
473,6 → 487,7
ACPI_EXTERN BOOLEAN AcpiGbl_DbOpt_disasm;
ACPI_EXTERN BOOLEAN AcpiGbl_DbOpt_verbose;
ACPI_EXTERN ACPI_EXTERNAL_LIST *AcpiGbl_ExternalList;
ACPI_EXTERN ACPI_EXTERNAL_FILE *AcpiGbl_ExternalFileList;
#endif
 
 
488,10 → 503,11
ACPI_EXTERN BOOLEAN AcpiGbl_DbOpt_NoRegionSupport;
 
ACPI_EXTERN char *AcpiGbl_DbArgs[ACPI_DEBUGGER_MAX_ARGS];
ACPI_EXTERN char AcpiGbl_DbLineBuf[80];
ACPI_EXTERN char AcpiGbl_DbParsedBuf[80];
ACPI_EXTERN char AcpiGbl_DbScopeBuf[40];
ACPI_EXTERN char AcpiGbl_DbDebugFilename[40];
ACPI_EXTERN ACPI_OBJECT_TYPE AcpiGbl_DbArgTypes[ACPI_DEBUGGER_MAX_ARGS];
ACPI_EXTERN char AcpiGbl_DbLineBuf[ACPI_DB_LINE_BUFFER_SIZE];
ACPI_EXTERN char AcpiGbl_DbParsedBuf[ACPI_DB_LINE_BUFFER_SIZE];
ACPI_EXTERN char AcpiGbl_DbScopeBuf[80];
ACPI_EXTERN char AcpiGbl_DbDebugFilename[80];
ACPI_EXTERN BOOLEAN AcpiGbl_DbOutputToFile;
ACPI_EXTERN char *AcpiGbl_DbBuffer;
ACPI_EXTERN char *AcpiGbl_DbFilename;
/drivers/devman/acpica/include/achware.h
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
200,13 → 200,15
/*
* hwgpe - GPE support
*/
ACPI_STATUS
AcpiHwLowDisableGpe (
ACPI_GPE_EVENT_INFO *GpeEventInfo);
UINT32
AcpiHwGetGpeRegisterBit (
ACPI_GPE_EVENT_INFO *GpeEventInfo,
ACPI_GPE_REGISTER_INFO *GpeRegisterInfo);
 
ACPI_STATUS
AcpiHwWriteGpeEnableReg (
ACPI_GPE_EVENT_INFO *GpeEventInfo);
AcpiHwLowSetGpe (
ACPI_GPE_EVENT_INFO *GpeEventInfo,
UINT32 Action);
 
ACPI_STATUS
AcpiHwDisableGpeBlock (
249,6 → 251,16
 
 
/*
* hwpci - PCI configuration support
*/
ACPI_STATUS
AcpiHwDerivePciId (
ACPI_PCI_ID *PciId,
ACPI_HANDLE RootPciDevice,
ACPI_HANDLE PciRegion);
 
 
/*
* hwtimer - ACPI Timer prototypes
*/
ACPI_STATUS
/drivers/devman/acpica/include/acinterp.h
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
/drivers/devman/acpica/include/aclocal.h
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
165,26 → 165,7
#define ACPI_MAX_MUTEX 7
#define ACPI_NUM_MUTEX ACPI_MAX_MUTEX+1
 
#if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER)
#ifdef DEFINE_ACPI_GLOBALS
 
/* Debug names for the mutexes above */
 
static char *AcpiGbl_MutexNames[ACPI_NUM_MUTEX] =
{
"ACPI_MTX_Interpreter",
"ACPI_MTX_Namespace",
"ACPI_MTX_Tables",
"ACPI_MTX_Events",
"ACPI_MTX_Caches",
"ACPI_MTX_Memory",
"ACPI_MTX_CommandComplete",
"ACPI_MTX_CommandReady"
};
 
#endif
#endif
 
/* Lock structure for reader/writer interfaces */
 
typedef struct acpi_rw_lock
502,6 → 483,7
char *Pathname;
const ACPI_PREDEFINED_INFO *Predefined;
union acpi_operand_object *ParentPackage;
ACPI_NAMESPACE_NODE *Node;
UINT32 Flags;
UINT8 NodeFlags;
 
537,18 → 519,25
 
/* Dispatch info for each GPE -- either a method or handler, cannot be both */
 
typedef struct acpi_handler_info
typedef struct acpi_gpe_handler_info
{
ACPI_EVENT_HANDLER Address; /* Address of handler, if any */
ACPI_GPE_HANDLER Address; /* Address of handler, if any */
void *Context; /* Context to be passed to handler */
ACPI_NAMESPACE_NODE *MethodNode; /* Method node for this GPE level (saved) */
UINT8 OriginalFlags; /* Original (pre-handler) GPE info */
BOOLEAN OriginallyEnabled; /* True if GPE was originally enabled */
 
} ACPI_HANDLER_INFO;
} ACPI_GPE_HANDLER_INFO;
 
/*
* GPE dispatch info. At any time, the GPE can have at most one type
* of dispatch - Method, Handler, or Implicit Notify.
*/
typedef union acpi_gpe_dispatch_info
{
ACPI_NAMESPACE_NODE *MethodNode; /* Method node for this GPE level */
struct acpi_handler_info *Handler;
struct acpi_gpe_handler_info *Handler; /* Installed GPE handler */
ACPI_NAMESPACE_NODE *DeviceNode; /* Parent _PRW device for implicit notify */
 
} ACPI_GPE_DISPATCH_INFO;
 
563,7 → 552,6
UINT8 Flags; /* Misc info about this GPE */
UINT8 GpeNumber; /* This GPE */
UINT8 RuntimeCount; /* References to a run GPE */
UINT8 WakeupCount; /* References to a wake GPE */
 
} ACPI_GPE_EVENT_INFO;
 
595,6 → 583,7
UINT32 RegisterCount; /* Number of register pairs in block */
UINT16 GpeCount; /* Number of individual GPEs in block */
UINT8 BlockBaseNumber;/* Base GPE number for this block */
BOOLEAN Initialized; /* TRUE if this block is initialized */
 
} ACPI_GPE_BLOCK_INFO;
 
615,7 → 604,6
ACPI_GPE_BLOCK_INFO *GpeBlock;
UINT16 Count;
ACPI_OWNER_ID OwnerId;
BOOLEAN EnableThisGpe;
BOOLEAN ExecuteByOwnerId;
 
} ACPI_GPE_WALK_INFO;
1081,6 → 1069,7
ACPI_BITMASK_POWER_BUTTON_STATUS | \
ACPI_BITMASK_SLEEP_BUTTON_STATUS | \
ACPI_BITMASK_RT_CLOCK_STATUS | \
ACPI_BITMASK_PCIEXP_WAKE_STATUS | \
ACPI_BITMASK_WAKE_STATUS)
 
#define ACPI_BITMASK_TIMER_ENABLE 0x0001
1137,7 → 1126,8
#define ACPI_OSI_WIN_VISTA 0x07
#define ACPI_OSI_WINSRV_2008 0x08
#define ACPI_OSI_WIN_VISTA_SP1 0x09
#define ACPI_OSI_WIN_7 0x0A
#define ACPI_OSI_WIN_VISTA_SP2 0x0A
#define ACPI_OSI_WIN_7 0x0B
 
#define ACPI_ALWAYS_ILLEGAL 0x00
 
1144,10 → 1134,15
typedef struct acpi_interface_info
{
char *Name;
struct acpi_interface_info *Next;
UINT8 Flags;
UINT8 Value;
 
} ACPI_INTERFACE_INFO;
 
#define ACPI_OSI_INVALID 0x01
#define ACPI_OSI_DYNAMIC 0x02
 
typedef struct acpi_port_info
{
char *Name;
1247,6 → 1242,14
#define ACPI_IPATH_ALLOCATED 0x01
 
 
typedef struct acpi_external_file
{
char *Path;
struct acpi_external_file *Next;
 
} ACPI_EXTERNAL_FILE;
 
 
/*****************************************************************************
*
* Debugger
1258,7 → 1261,7
ACPI_HANDLE MainThreadGate;
ACPI_HANDLE ThreadCompleteGate;
ACPI_HANDLE InfoGate;
UINT32 *Threads;
ACPI_THREAD_ID *Threads;
UINT32 NumThreads;
UINT32 NumCreated;
UINT32 NumCompleted;
1268,6 → 1271,7
UINT32 NumLoops;
char Pathname[128];
char **Args;
ACPI_OBJECT_TYPE *Types;
 
/*
* Arguments to be passed to method for the command
1276,6 → 1280,7
* Index of current thread inside all them created.
*/
char InitArgs;
ACPI_OBJECT_TYPE ArgTypes[4];
char *Arguments[4];
char NumThreadsStr[11];
char IdOfThreadStr[11];
/drivers/devman/acpica/include/acmacros.h
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
400,8 → 400,8
* the plist contains a set of parens to allow variable-length lists.
* These macros are used for both the debug and non-debug versions of the code.
*/
#define ACPI_ERROR_NAMESPACE(s, e) AcpiNsReportError (AE_INFO, s, e);
#define ACPI_ERROR_METHOD(s, n, p, e) AcpiNsReportMethodError (AE_INFO, s, n, p, e);
#define ACPI_ERROR_NAMESPACE(s, e) AcpiUtNamespaceError (AE_INFO, s, e);
#define ACPI_ERROR_METHOD(s, n, p, e) AcpiUtMethodError (AE_INFO, s, n, p, e);
#define ACPI_WARN_PREDEFINED(plist) AcpiUtPredefinedWarning plist
#define ACPI_INFO_PREDEFINED(plist) AcpiUtPredefinedInfo plist
 
/drivers/devman/acpica/include/acnames.h
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
/drivers/devman/acpica/include/acnamesp.h
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
514,22 → 514,6
ACPI_OBJECT_TYPE Type);
 
void
AcpiNsReportError (
const char *ModuleName,
UINT32 LineNumber,
const char *InternalName,
ACPI_STATUS LookupStatus);
 
void
AcpiNsReportMethodError (
const char *ModuleName,
UINT32 LineNumber,
const char *Message,
ACPI_NAMESPACE_NODE *Node,
const char *Path,
ACPI_STATUS LookupStatus);
 
void
AcpiNsPrintNodePathname (
ACPI_NAMESPACE_NODE *Node,
const char *Msg);
/drivers/devman/acpica/include/acobject.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
170,8 → 170,6
#define AOPOBJ_OBJECT_INITIALIZED 0x08 /* Region is initialized, _REG was run */
#define AOPOBJ_SETUP_COMPLETE 0x10 /* Region setup is complete */
#define AOPOBJ_INVALID 0x20 /* Host OS won't allow a Region address */
#define AOPOBJ_MODULE_LEVEL 0x40 /* Method is actually module-level code */
#define AOPOBJ_MODIFIED_NAMESPACE 0x80 /* Method modified the namespace */
 
 
/******************************************************************************
284,7 → 282,7
typedef struct acpi_object_method
{
ACPI_OBJECT_COMMON_HEADER
UINT8 MethodFlags;
UINT8 InfoFlags;
UINT8 ParamCount;
UINT8 SyncLevel;
union acpi_operand_object *Mutex;
293,7 → 291,7
{
ACPI_INTERNAL_METHOD Implementation;
union acpi_operand_object *Handler;
} Extra;
} Dispatch;
 
UINT32 AmlLength;
UINT8 ThreadCount;
301,7 → 299,15
 
} ACPI_OBJECT_METHOD;
 
/* Flags for InfoFlags field above */
 
#define ACPI_METHOD_MODULE_LEVEL 0x01 /* Method is actually module-level code */
#define ACPI_METHOD_INTERNAL_ONLY 0x02 /* Method is implemented internally (_OSI) */
#define ACPI_METHOD_SERIALIZED 0x04 /* Method is serialized */
#define ACPI_METHOD_SERIALIZED_PENDING 0x08 /* Method is to be marked serialized */
#define ACPI_METHOD_MODIFIED_NAMESPACE 0x10 /* Method modified the namespace */
 
 
/******************************************************************************
*
* Objects that can be notified. All share a common NotifyInfo area.
/drivers/devman/acpica/include/acopcode.h
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
/drivers/devman/acpica/include/acoutput.h
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
143,8 → 143,9
#define ACPI_TOOLS 0x00002000
#define ACPI_EXAMPLE 0x00004000
#define ACPI_DRIVER 0x00008000
#define DT_COMPILER 0x00010000
 
#define ACPI_ALL_COMPONENTS 0x0000FFFF
#define ACPI_ALL_COMPONENTS 0x0001FFFF
#define ACPI_COMPONENT_DEFAULT (ACPI_ALL_COMPONENTS)
 
/* Component IDs reserved for ACPI drivers */
257,13 → 258,19
 
#if defined (ACPI_DEBUG_OUTPUT) || !defined (ACPI_NO_ERROR_MESSAGES)
/*
* Module name is included in both debug and non-debug versions primarily for
* error messages. The __FILE__ macro is not very useful for this, because it
* often includes the entire pathname to the module
* The module name is used primarily for error and debug messages.
* The __FILE__ macro is not very useful for this, because it
* usually includes the entire pathname to the module making the
* debug output difficult to read.
*/
#define ACPI_MODULE_NAME(Name) static const char ACPI_UNUSED_VAR _AcpiModuleName[] = Name;
#else
/*
* For the no-debug and no-error-msg cases, we must at least define
* a null module name.
*/
#define ACPI_MODULE_NAME(Name)
#define _AcpiModuleName ""
#endif
 
/*
/drivers/devman/acpica/include/acparser.h
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
/drivers/devman/acpica/include/acpi.h
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
/drivers/devman/acpica/include/acpiosxf.h
12,7 → 12,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
394,7 → 394,7
AcpiOsReadPciConfiguration (
ACPI_PCI_ID *PciId,
UINT32 Reg,
void *Value,
UINT64 *Value,
UINT32 Width);
 
ACPI_STATUS
406,22 → 406,8
 
 
/*
* Interim function needed for PCI IRQ routing
*/
void
AcpiOsDerivePciId(
ACPI_HANDLE Device,
ACPI_HANDLE Region,
ACPI_PCI_ID **PciId);
 
 
/*
* Miscellaneous
*/
ACPI_STATUS
AcpiOsValidateInterface (
char *Interface);
 
BOOLEAN
AcpiOsReadable (
void *Pointer,
463,9 → 449,11
/*
* Debug input
*/
UINT32
ACPI_STATUS
AcpiOsGetLine (
char *Buffer);
char *Buffer,
UINT32 BufferLength,
UINT32 *BytesRead);
 
 
/*
/drivers/devman/acpica/include/acpixf.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
120,7 → 120,7
 
/* Current ACPICA subsystem version in YYYYMMDD format */
 
#define ACPI_CA_VERSION 0x20100528
#define ACPI_CA_VERSION 0x20110623
 
#include "actypes.h"
#include "actbl.h"
130,6 → 130,7
*/
extern UINT32 AcpiCurrentGpeCount;
extern ACPI_TABLE_FADT AcpiGbl_FADT;
extern BOOLEAN AcpiGbl_SystemAwakeAndRunning;
 
/* Runtime configuration of debug print levels */
 
141,7 → 142,6
extern UINT8 AcpiGbl_EnableInterpreterSlack;
extern UINT8 AcpiGbl_AllMethodsSerialized;
extern UINT8 AcpiGbl_CreateOsiMethod;
extern UINT8 AcpiGbl_LeaveWakeGpesDisabled;
extern UINT8 AcpiGbl_UseDefaultRegisterWidths;
extern ACPI_NAME AcpiGbl_TraceMethodName;
extern UINT32 AcpiGbl_TraceFlags;
148,10 → 148,11
extern UINT8 AcpiGbl_EnableAmlDebugObject;
extern UINT8 AcpiGbl_CopyDsdtLocally;
extern UINT8 AcpiGbl_TruncateIoAddresses;
extern UINT8 AcpiGbl_DisableAutoRepair;
 
 
/*
* Global interfaces
* Initialization
*/
ACPI_STATUS
AcpiInitializeTables (
175,10 → 176,10
AcpiTerminate (
void);
 
ACPI_STATUS
AcpiSubsystemStatus (
void);
 
/*
* Miscellaneous global interfaces
*/
ACPI_STATUS
AcpiEnable (
void);
188,6 → 189,10
void);
 
ACPI_STATUS
AcpiSubsystemStatus (
void);
 
ACPI_STATUS
AcpiGetSystemInfo (
ACPI_BUFFER *RetBuffer);
 
203,9 → 208,17
AcpiPurgeCachedObjects (
void);
 
ACPI_STATUS
AcpiInstallInterface (
ACPI_STRING InterfaceName);
 
ACPI_STATUS
AcpiRemoveInterface (
ACPI_STRING InterfaceName);
 
 
/*
* ACPI Memory managment
* ACPI Memory management
*/
void *
AcpiAllocate (
373,6 → 386,11
UINT32 Function);
 
ACPI_STATUS
AcpiInstallGlobalEventHandler (
ACPI_GBL_EVENT_HANDLER Handler,
void *Context);
 
ACPI_STATUS
AcpiInstallFixedEventHandler (
UINT32 AcpiEvent,
ACPI_EVENT_HANDLER Handler,
384,6 → 402,20
ACPI_EVENT_HANDLER Handler);
 
ACPI_STATUS
AcpiInstallGpeHandler (
ACPI_HANDLE GpeDevice,
UINT32 GpeNumber,
UINT32 Type,
ACPI_GPE_HANDLER Address,
void *Context);
 
ACPI_STATUS
AcpiRemoveGpeHandler (
ACPI_HANDLE GpeDevice,
UINT32 GpeNumber,
ACPI_GPE_HANDLER Address);
 
ACPI_STATUS
AcpiInstallNotifyHandler (
ACPI_HANDLE Device,
UINT32 HandlerType,
411,26 → 443,16
ACPI_ADR_SPACE_HANDLER Handler);
 
ACPI_STATUS
AcpiInstallGpeHandler (
ACPI_HANDLE GpeDevice,
UINT32 GpeNumber,
UINT32 Type,
ACPI_EVENT_HANDLER Address,
void *Context);
AcpiInstallExceptionHandler (
ACPI_EXCEPTION_HANDLER Handler);
 
ACPI_STATUS
AcpiRemoveGpeHandler (
ACPI_HANDLE GpeDevice,
UINT32 GpeNumber,
ACPI_EVENT_HANDLER Address);
AcpiInstallInterfaceHandler (
ACPI_INTERFACE_HANDLER Handler);
 
ACPI_STATUS
AcpiInstallExceptionHandler (
ACPI_EXCEPTION_HANDLER Handler);
 
 
/*
* Event interfaces
* Global Lock interfaces
*/
ACPI_STATUS
AcpiAcquireGlobalLock (
441,6 → 463,10
AcpiReleaseGlobalLock (
UINT32 Handle);
 
 
/*
* Fixed Event interfaces
*/
ACPI_STATUS
AcpiEnableEvent (
UINT32 Event,
462,25 → 488,21
 
 
/*
* GPE Interfaces
* General Purpose Event (GPE) Interfaces
*/
ACPI_STATUS
AcpiSetGpe (
ACPI_HANDLE GpeDevice,
UINT32 GpeNumber,
UINT8 Action);
AcpiUpdateAllGpes (
void);
 
ACPI_STATUS
AcpiEnableGpe (
ACPI_HANDLE GpeDevice,
UINT32 GpeNumber,
UINT8 GpeType);
UINT32 GpeNumber);
 
ACPI_STATUS
AcpiDisableGpe (
ACPI_HANDLE GpeDevice,
UINT32 GpeNumber,
UINT8 GpeType);
UINT32 GpeNumber);
 
ACPI_STATUS
AcpiClearGpe (
488,6 → 510,29
UINT32 GpeNumber);
 
ACPI_STATUS
AcpiSetGpe (
ACPI_HANDLE GpeDevice,
UINT32 GpeNumber,
UINT8 Action);
 
ACPI_STATUS
AcpiFinishGpe (
ACPI_HANDLE GpeDevice,
UINT32 GpeNumber);
 
ACPI_STATUS
AcpiSetupGpeForWake (
ACPI_HANDLE ParentDevice,
ACPI_HANDLE GpeDevice,
UINT32 GpeNumber);
 
ACPI_STATUS
AcpiSetGpeWakeMask (
ACPI_HANDLE GpeDevice,
UINT32 GpeNumber,
UINT8 Action);
 
ACPI_STATUS
AcpiGetGpeStatus (
ACPI_HANDLE GpeDevice,
UINT32 GpeNumber,
/drivers/devman/acpica/include/acpredef.h
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
542,6 → 542,7
{{"_SWS", 0, ACPI_RTYPE_INTEGER}},
{{"_TC1", 0, ACPI_RTYPE_INTEGER}},
{{"_TC2", 0, ACPI_RTYPE_INTEGER}},
{{"_TDL", 0, ACPI_RTYPE_INTEGER}},
{{"_TIP", 1, ACPI_RTYPE_INTEGER}},
{{"_TIV", 1, ACPI_RTYPE_INTEGER}},
{{"_TMP", 0, ACPI_RTYPE_INTEGER}},
/drivers/devman/acpica/include/acresrc.h
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
/drivers/devman/acpica/include/acrestyp.h
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
/drivers/devman/acpica/include/acstruct.h
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
/drivers/devman/acpica/include/actables.h
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
/drivers/devman/acpica/include/actbl.h
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
224,9 → 224,30
 
} ACPI_TABLE_RSDP;
 
#define ACPI_RSDP_REV0_SIZE 20 /* Size of original ACPI 1.0 RSDP */
/* Standalone struct for the ACPI 1.0 RSDP */
 
typedef struct acpi_rsdp_common
{
char Signature[8];
UINT8 Checksum;
char OemId[ACPI_OEM_ID_SIZE];
UINT8 Revision;
UINT32 RsdtPhysicalAddress;
 
} ACPI_RSDP_COMMON;
 
/* Standalone struct for the extended part of the RSDP (ACPI 2.0+) */
 
typedef struct acpi_rsdp_extension
{
UINT32 Length;
UINT64 XsdtPhysicalAddress;
UINT8 ExtendedChecksum;
UINT8 Reserved[3];
 
} ACPI_RSDP_EXTENSION;
 
 
/*******************************************************************************
*
* RSDT/XSDT - Root System Description Tables
448,4 → 469,20
 
#define ACPI_FADT_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_FADT, f)
 
/*
* Sizes of the various flavors of FADT. We need to look closely
* at the FADT length because the version number essentially tells
* us nothing because of many BIOS bugs where the version does not
* match the expected length. In other words, the length of the
* FADT is the bottom line as to what the version really is.
*
* For reference, the values below are as follows:
* FADT V1 size: 0x74
* FADT V2 size: 0x84
* FADT V3+ size: 0xF4
*/
#define ACPI_FADT_V1_SIZE (UINT32) (ACPI_FADT_OFFSET (Flags) + 4)
#define ACPI_FADT_V2_SIZE (UINT32) (ACPI_FADT_OFFSET (Reserved4[0]) + 3)
#define ACPI_FADT_V3_SIZE (UINT32) (sizeof (ACPI_TABLE_FADT))
 
#endif /* __ACTBL_H__ */
/drivers/devman/acpica/include/actbl1.h
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
/drivers/devman/acpica/include/actbl2.h
1,6 → 1,6
/******************************************************************************
*
* Name: actbl2.h - ACPI Specification Revision 2.0 Tables
* Name: actbl2.h - ACPI Table Definitions (tables not in ACPI spec)
*
*****************************************************************************/
 
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
151,6 → 151,7
#define ACPI_SIG_UEFI "UEFI" /* Uefi Boot Optimization Table */
#define ACPI_SIG_WAET "WAET" /* Windows ACPI Emulated devices Table */
#define ACPI_SIG_WDAT "WDAT" /* Watchdog Action Table */
#define ACPI_SIG_WDDT "WDDT" /* Watchdog Timer Description Table */
#define ACPI_SIG_WDRT "WDRT" /* Watchdog Resource Table */
 
#ifdef ACPI_UNDEFINED_TABLES
902,6 → 903,81
 
/*******************************************************************************
*
* SLIC - Software Licensing Description Table
* Version 1
*
* Conforms to "OEM Activation 2.0 for Windows Vista Operating Systems",
* Copyright 2006
*
******************************************************************************/
 
/* Basic SLIC table is only the common ACPI header */
 
typedef struct acpi_table_slic
{
ACPI_TABLE_HEADER Header; /* Common ACPI table header */
 
} ACPI_TABLE_SLIC;
 
 
/* Common SLIC subtable header */
 
typedef struct acpi_slic_header
{
UINT32 Type;
UINT32 Length;
 
} ACPI_SLIC_HEADER;
 
/* Values for Type field above */
 
enum AcpiSlicType
{
ACPI_SLIC_TYPE_PUBLIC_KEY = 0,
ACPI_SLIC_TYPE_WINDOWS_MARKER = 1,
ACPI_SLIC_TYPE_RESERVED = 2 /* 2 and greater are reserved */
};
 
 
/*
* SLIC Sub-tables, correspond to Type in ACPI_SLIC_HEADER
*/
 
/* 0: Public Key Structure */
 
typedef struct acpi_slic_key
{
ACPI_SLIC_HEADER Header;
UINT8 KeyType;
UINT8 Version;
UINT16 Reserved;
UINT32 Algorithm;
char Magic[4];
UINT32 BitLength;
UINT32 Exponent;
UINT8 Modulus[128];
 
} ACPI_SLIC_KEY;
 
 
/* 1: Windows Marker Structure */
 
typedef struct acpi_slic_marker
{
ACPI_SLIC_HEADER Header;
UINT32 Version;
char OemId[ACPI_OEM_ID_SIZE]; /* ASCII OEM identification */
char OemTableId[ACPI_OEM_TABLE_ID_SIZE]; /* ASCII OEM table identification */
char WindowsFlag[8];
UINT32 SlicVersion;
UINT8 Reserved[16];
UINT8 Signature[128];
 
} ACPI_SLIC_MARKER;
 
 
/*******************************************************************************
*
* SPCR - Serial Port Console Redirection table
* Version 1
*
1129,6 → 1205,47
 
/*******************************************************************************
*
* WDDT - Watchdog Descriptor Table
* Version 1
*
* Conforms to "Using the Intel ICH Family Watchdog Timer (WDT)",
* Version 001, September 2002
*
******************************************************************************/
 
typedef struct acpi_table_wddt
{
ACPI_TABLE_HEADER Header; /* Common ACPI table header */
UINT16 SpecVersion;
UINT16 TableVersion;
UINT16 PciVendorId;
ACPI_GENERIC_ADDRESS Address;
UINT16 MaxCount; /* Maximum counter value supported */
UINT16 MinCount; /* Minimum counter value supported */
UINT16 Period;
UINT16 Status;
UINT16 Capability;
 
} ACPI_TABLE_WDDT;
 
/* Flags for Status field above */
 
#define ACPI_WDDT_AVAILABLE (1)
#define ACPI_WDDT_ACTIVE (1<<1)
#define ACPI_WDDT_TCO_OS_OWNED (1<<2)
#define ACPI_WDDT_USER_RESET (1<<11)
#define ACPI_WDDT_WDT_RESET (1<<12)
#define ACPI_WDDT_POWER_FAIL (1<<13)
#define ACPI_WDDT_UNKNOWN_RESET (1<<14)
 
/* Flags for Capability field above */
 
#define ACPI_WDDT_AUTO_RESET (1)
#define ACPI_WDDT_ALERT_SUPPORT (1<<1)
 
 
/*******************************************************************************
*
* WDRT - Watchdog Resource Table
* Version 1
*
/drivers/devman/acpica/include/actypes.h
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
188,7 → 188,6
*
* ACPI_SIZE 16/32/64-bit unsigned value
* ACPI_NATIVE_INT 16/32/64-bit signed value
*
*/
 
/*******************************************************************************
205,7 → 204,17
 
/*! [End] no source code translation !*/
 
/*
* Value returned by AcpiOsGetThreadId. There is no standard "thread_id"
* across operating systems or even the various UNIX systems. Since ACPICA
* only needs the thread ID as a unique thread identifier, we use a UINT64
* as the only common data type - it will accommodate any type of pointer or
* any type of integer. It is up to the host-dependent OSL to cast the
* native thread ID type to a UINT64 (in AcpiOsGetThreadId).
*/
#define ACPI_THREAD_ID UINT64
 
 
/*******************************************************************************
*
* Types specific to 64-bit targets
286,12 → 295,6
*
******************************************************************************/
 
/* Value returned by AcpiOsGetThreadId */
 
#ifndef ACPI_THREAD_ID
#define ACPI_THREAD_ID ACPI_SIZE
#endif
 
/* Flags for AcpiOsAcquireLock/AcpiOsReleaseLock */
 
#ifndef ACPI_CPU_FLAGS
456,21 → 459,6
#define ACPI_OWNER_ID_MAX 0xFF
 
 
typedef struct uint64_struct
{
UINT32 Lo;
UINT32 Hi;
 
} UINT64_STRUCT;
 
typedef union uint64_overlay
{
UINT64 Full;
UINT64_STRUCT Part;
 
} UINT64_OVERLAY;
 
 
#define ACPI_INTEGER_BIT_SIZE 64
#define ACPI_MAX_DECIMAL_DIGITS 20 /* 2^64 = 18,446,744,073,709,551,616 */
#define ACPI_MAX64_DECIMAL_DIGITS 20
742,39 → 730,35
#define ACPI_GPE_MAX 0xFF
#define ACPI_NUM_GPE 256
 
/* Actions for AcpiSetGpe */
/* Actions for AcpiSetGpe, AcpiGpeWakeup, AcpiHwLowSetGpe */
 
#define ACPI_GPE_ENABLE 0
#define ACPI_GPE_DISABLE 1
#define ACPI_GPE_CONDITIONAL_ENABLE 2
 
/* GpeTypes for AcpiEnableGpe and AcpiDisableGpe */
 
#define ACPI_GPE_TYPE_WAKE (UINT8) 0x01
#define ACPI_GPE_TYPE_RUNTIME (UINT8) 0x02
#define ACPI_GPE_TYPE_WAKE_RUN (UINT8) 0x03
 
/*
* GPE info flags - Per GPE
* +-------+---+-+-+
* | 7:4 |3:2|1|0|
* +-------+---+-+-+
* +-------+-+-+---+
* | 7:4 |3|2|1:0|
* +-------+-+-+---+
* | | | |
* | | | +--- Interrupt type: edge or level triggered
* | | +----- GPE can wake the system
* | +-------- Type of dispatch:to method, handler, or none
* +-------------- <Reserved>
* | | | +-- Type of dispatch:to method, handler, notify, or none
* | | +----- Interrupt type: edge or level triggered
* | +------- Is a Wake GPE
* +------------ <Reserved>
*/
#define ACPI_GPE_XRUPT_TYPE_MASK (UINT8) 0x01
#define ACPI_GPE_LEVEL_TRIGGERED (UINT8) 0x01
#define ACPI_GPE_DISPATCH_NONE (UINT8) 0x00
#define ACPI_GPE_DISPATCH_METHOD (UINT8) 0x01
#define ACPI_GPE_DISPATCH_HANDLER (UINT8) 0x02
#define ACPI_GPE_DISPATCH_NOTIFY (UINT8) 0x03
#define ACPI_GPE_DISPATCH_MASK (UINT8) 0x03
 
#define ACPI_GPE_LEVEL_TRIGGERED (UINT8) 0x04
#define ACPI_GPE_EDGE_TRIGGERED (UINT8) 0x00
#define ACPI_GPE_XRUPT_TYPE_MASK (UINT8) 0x04
 
#define ACPI_GPE_CAN_WAKE (UINT8) 0x02
#define ACPI_GPE_CAN_WAKE (UINT8) 0x08
 
#define ACPI_GPE_DISPATCH_MASK (UINT8) 0x0C
#define ACPI_GPE_DISPATCH_HANDLER (UINT8) 0x04
#define ACPI_GPE_DISPATCH_METHOD (UINT8) 0x08
#define ACPI_GPE_DISPATCH_NOT_USED (UINT8) 0x00
 
/*
* Flags for GPE and Lock interfaces
*/
804,11 → 788,26
#define ACPI_ADR_SPACE_CMOS (ACPI_ADR_SPACE_TYPE) 5
#define ACPI_ADR_SPACE_PCI_BAR_TARGET (ACPI_ADR_SPACE_TYPE) 6
#define ACPI_ADR_SPACE_IPMI (ACPI_ADR_SPACE_TYPE) 7
#define ACPI_ADR_SPACE_DATA_TABLE (ACPI_ADR_SPACE_TYPE) 8
#define ACPI_ADR_SPACE_FIXED_HARDWARE (ACPI_ADR_SPACE_TYPE) 127
 
#define ACPI_NUM_PREDEFINED_REGIONS 8
 
/*
* Special Address Spaces
*
* Note: A Data Table region is a special type of operation region
* that has its own AML opcode. However, internally, the AML
* interpreter simply creates an operation region with an an address
* space type of ACPI_ADR_SPACE_DATA_TABLE.
*/
#define ACPI_ADR_SPACE_DATA_TABLE (ACPI_ADR_SPACE_TYPE) 0x7E /* Internal to ACPICA only */
#define ACPI_ADR_SPACE_FIXED_HARDWARE (ACPI_ADR_SPACE_TYPE) 0x7F
 
/* Values for _REG connection code */
 
#define ACPI_REG_DISCONNECT 0
#define ACPI_REG_CONNECT 1
 
/*
* BitRegister IDs
*
* These values are intended to be used by the hardware interfaces
1032,10 → 1031,26
* Various handlers and callback procedures
*/
typedef
void (*ACPI_GBL_EVENT_HANDLER) (
UINT32 EventType,
ACPI_HANDLE Device,
UINT32 EventNumber,
void *Context);
 
#define ACPI_EVENT_TYPE_GPE 0
#define ACPI_EVENT_TYPE_FIXED 1
 
typedef
UINT32 (*ACPI_EVENT_HANDLER) (
void *Context);
 
typedef
UINT32 (*ACPI_GPE_HANDLER) (
ACPI_HANDLE GpeDevice,
UINT32 GpeNumber,
void *Context);
 
typedef
void (*ACPI_NOTIFY_HANDLER) (
ACPI_HANDLE Device,
UINT32 Value,
1104,12 → 1119,22
void *Context,
void **ReturnValue);
 
typedef
UINT32 (*ACPI_INTERFACE_HANDLER) (
ACPI_STRING InterfaceName,
UINT32 Supported);
 
 
/* Interrupt handler return values */
 
#define ACPI_INTERRUPT_NOT_HANDLED 0x00
#define ACPI_INTERRUPT_HANDLED 0x01
 
/* GPE handler return values */
 
#define ACPI_REENABLE_GPE 0x80
 
 
/* Length of 32-bit EISAID values when converted back to a string */
 
#define ACPI_EISAID_STRING_SIZE 8 /* Includes null terminator */
/drivers/devman/acpica/include/acutils.h
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
536,10 → 536,6
* uteval - object evaluation
*/
ACPI_STATUS
AcpiUtOsiImplementation (
ACPI_WALK_STATE *WalkState);
 
ACPI_STATUS
AcpiUtEvaluateObject (
ACPI_NAMESPACE_NODE *PrefixNode,
char *Path,
662,6 → 658,34
 
 
/*
* utosi - Support for the _OSI predefined control method
*/
ACPI_STATUS
AcpiUtInitializeInterfaces (
void);
 
void
AcpiUtInterfaceTerminate (
void);
 
ACPI_STATUS
AcpiUtInstallInterface (
ACPI_STRING InterfaceName);
 
ACPI_STATUS
AcpiUtRemoveInterface (
ACPI_STRING InterfaceName);
 
ACPI_INTERFACE_INFO *
AcpiUtGetInterface (
ACPI_STRING InterfaceName);
 
ACPI_STATUS
AcpiUtOsiImplementation (
ACPI_WALK_STATE *WalkState);
 
 
/*
* utstate - Generic state creation/cache routines
*/
void
767,6 → 791,10
char *SrcString);
 
void
AcpiUtStrlwr (
char *SrcString);
 
void
AcpiUtPrintString (
char *String,
UINT8 MaxLength);
790,24 → 818,6
UINT32 Base,
UINT64 *RetInteger);
 
void ACPI_INTERNAL_VAR_XFACE
AcpiUtPredefinedWarning (
const char *ModuleName,
UINT32 LineNumber,
char *Pathname,
UINT8 NodeFlags,
const char *Format,
...);
 
void ACPI_INTERNAL_VAR_XFACE
AcpiUtPredefinedInfo (
const char *ModuleName,
UINT32 LineNumber,
char *Pathname,
UINT8 NodeFlags,
const char *Format,
...);
 
/* Values for Base above (16=Hex, 10=Decimal) */
 
#define ACPI_ANY_BASE 0
957,7 → 967,44
UINT16 ObjectSize,
ACPI_MEMORY_LIST **ReturnCache);
 
#endif /* ACPI_DBG_TRACK_ALLOCATIONS */
 
#endif
 
/*
* utxferror - various error/warning output functions
*/
void ACPI_INTERNAL_VAR_XFACE
AcpiUtPredefinedWarning (
const char *ModuleName,
UINT32 LineNumber,
char *Pathname,
UINT8 NodeFlags,
const char *Format,
...);
 
void ACPI_INTERNAL_VAR_XFACE
AcpiUtPredefinedInfo (
const char *ModuleName,
UINT32 LineNumber,
char *Pathname,
UINT8 NodeFlags,
const char *Format,
...);
 
void
AcpiUtNamespaceError (
const char *ModuleName,
UINT32 LineNumber,
const char *InternalName,
ACPI_STATUS LookupStatus);
 
void
AcpiUtMethodError (
const char *ModuleName,
UINT32 LineNumber,
const char *Message,
ACPI_NAMESPACE_NODE *Node,
const char *Path,
ACPI_STATUS LookupStatus);
 
#endif /* _ACUTILS_H */
/drivers/devman/acpica/include/amlcode.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
474,24 → 474,6
#define AML_CLASS_UNKNOWN 0x0A
 
 
/* Predefined Operation Region SpaceIDs */
 
typedef enum
{
REGION_MEMORY = 0,
REGION_IO,
REGION_PCI_CONFIG,
REGION_EC,
REGION_SMBUS,
REGION_CMOS,
REGION_PCI_BAR,
REGION_IPMI,
REGION_DATA_TABLE, /* Internal use only */
REGION_FIXED_HW = 0x7F
 
} AML_REGION_TYPES;
 
 
/* Comparison operation codes for MatchOp operator */
 
typedef enum
579,17 → 561,11
} AML_ACCESS_ATTRIBUTE;
 
 
/* Bit fields in MethodFlags byte */
/* Bit fields in the AML MethodFlags byte */
 
#define AML_METHOD_ARG_COUNT 0x07
#define AML_METHOD_SERIALIZED 0x08
#define AML_METHOD_SYNC_LEVEL 0xF0
 
/* METHOD_FLAGS_ARG_COUNT is not used internally, define additional flags */
 
#define AML_METHOD_INTERNAL_ONLY 0x01
#define AML_METHOD_RESERVED1 0x02
#define AML_METHOD_RESERVED2 0x04
 
 
#endif /* __AMLCODE_H__ */
/drivers/devman/acpica/include/amlresrc.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
/drivers/devman/acpica/include/platform/accygwin.h
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
121,7 → 121,6
*/
#define ACPI_USE_SYSTEM_CLIBRARY
#define ACPI_USE_DO_WHILE_0
#define ACPI_THREAD_ID pthread_t
#define ACPI_FLUSH_CPU_CACHE()
/*
* This is needed since sem_timedwait does not appear to work properly
151,14 → 150,13
#define __cdecl
#endif
 
#ifdef _ANSI
#define inline
#endif
 
#define ACPI_ACQUIRE_GLOBAL_LOCK(GLptr, Acq) if (GLptr) Acq=1; else Acq=0;
#define ACPI_RELEASE_GLOBAL_LOCK(GLptr, Pending) Pending = 1
 
/* On Cygwin, pthread_t is a pointer */
 
#define ACPI_CAST_PTHREAD_T(pthread) ((ACPI_THREAD_ID) ACPI_TO_INTEGER (pthread))
 
/* Cygwin uses GCC */
 
#include "acgcc.h"
/drivers/devman/acpica/include/platform/acefi.h
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
/drivers/devman/acpica/include/platform/acenv.h
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
148,9 → 148,10
#define ACPI_CONSTANT_EVAL_ONLY
#define ACPI_LARGE_NAMESPACE_NODE
#define ACPI_DATA_TABLE_DISASSEMBLY
#define ACPI_SINGLE_THREADED
#endif
 
/* AcpiExec configuration */
/* AcpiExec configuration. Multithreaded with full AML debugger */
 
#ifdef ACPI_EXEC_APP
#define ACPI_APPLICATION
159,6 → 160,30
#define ACPI_DBG_TRACK_ALLOCATIONS
#endif
 
/* AcpiNames configuration. Single threaded with debugger output enabled. */
 
#ifdef ACPI_NAMES_APP
#define ACPI_DEBUGGER
#define ACPI_APPLICATION
#define ACPI_SINGLE_THREADED
#endif
 
/*
* AcpiBin/AcpiHelp/AcpiSrc configuration. All single threaded, with
* no debug output.
*/
#if (defined ACPI_BIN_APP) || \
(defined ACPI_SRC_APP)
#define ACPI_APPLICATION
#define ACPI_SINGLE_THREADED
#endif
 
#ifdef ACPI_HELP_APP
#define ACPI_DEBUG_OUTPUT
#define ACPI_APPLICATION
#define ACPI_SINGLE_THREADED
#endif
 
/* Linkable ACPICA library */
 
#ifdef ACPI_LIBRARY
235,6 → 260,12
#define ACPI_FLUSH_CPU_CACHE()
#endif
 
/* "inline" keywords - configurable since inline is not standardized */
 
#ifndef ACPI_INLINE
#define ACPI_INLINE
#endif
 
/*
* Configurable calling conventions:
*
/drivers/devman/acpica/include/platform/acfreebsd.h
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
139,7 → 139,6
 
#include "opt_acpi.h"
 
#define ACPI_THREAD_ID lwpid_t
#define ACPI_MUTEX_TYPE ACPI_OSL_MUTEX
 
#ifdef ACPI_DEBUG
166,7 → 165,7
#include <ctype.h>
#endif
 
#define ACPI_THREAD_ID pthread_t
#define ACPI_CAST_PTHREAD_T(pthread) ((ACPI_THREAD_ID) ACPI_TO_INTEGER (pthread))
 
#define ACPI_USE_STANDARD_HEADERS
 
/drivers/devman/acpica/include/platform/acgcc.h
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
116,6 → 116,8
#ifndef __ACGCC_H__
#define __ACGCC_H__
 
#define ACPI_INLINE __inline__
 
/* Function name is used for debug output. Non-ANSI, compiler-dependent */
 
#define ACPI_GET_FUNCTION_NAME __FUNCTION__
/drivers/devman/acpica/include/platform/acintel.h
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
116,12 → 116,12
#ifndef __ACINTEL_H__
#define __ACINTEL_H__
 
/* Configuration specific to Intel 64-bit C compiler */
 
#define COMPILER_DEPENDENT_INT64 __int64
#define COMPILER_DEPENDENT_UINT64 unsigned __int64
#define ACPI_INLINE __inline
 
#define inline __inline
 
/*
* Calling conventions:
*
135,20 → 135,6
#define ACPI_INTERNAL_XFACE
#define ACPI_INTERNAL_VAR_XFACE
 
/*
* Math helper functions
*/
#define ACPI_DIV_64_BY_32(n, n_hi, n_lo, d32, q32, r32) \
{ \
q32 = n / d32; \
r32 = n % d32; \
}
 
#define ACPI_SHIFT_RIGHT_64(n, n_hi, n_lo) \
{ \
n <<= 1; \
}
 
/* remark 981 - operands evaluated in no particular order */
#pragma warning(disable:981)
 
/drivers/devman/acpica/include/platform/ackolibri.h
1,7 → 1,5
/******************************************************************************
*
* Name: achaiku.h - OS specific defines, etc.
* $Revision: 1.1 $
*
*****************************************************************************/
 
134,7 → 132,6
#define asm __asm__
 
#define ACPI_USE_DO_WHILE_0
#define ACPI_THREAD_ID UINT32
 
#define ACPI_USE_NATIVE_DIVIDE
 
/drivers/devman/acpica/include/platform/aclinux.h
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
147,7 → 147,6
#define ACPI_CACHE_T struct kmem_cache
#define ACPI_SPINLOCK spinlock_t *
#define ACPI_CPU_FLAGS unsigned long
#define ACPI_THREAD_ID struct task_struct *
 
#else /* !__KERNEL__ */
 
160,17 → 159,18
/* Host-dependent types and defines for user-space ACPICA */
 
#define ACPI_FLUSH_CPU_CACHE()
#define ACPI_THREAD_ID pthread_t
 
#if defined(__ia64__) || defined(__x86_64__)
#define ACPI_MACHINE_WIDTH 64
#define COMPILER_DEPENDENT_INT64 long
#define COMPILER_DEPENDENT_UINT64 unsigned long
#define ACPI_CAST_PTHREAD_T(pthread) ((ACPI_THREAD_ID) (pthread))
#else
#define ACPI_MACHINE_WIDTH 32
#define COMPILER_DEPENDENT_INT64 long long
#define COMPILER_DEPENDENT_UINT64 unsigned long long
#define ACPI_USE_NATIVE_DIVIDE
#define ACPI_CAST_PTHREAD_T(pthread) ((ACPI_THREAD_ID) (UINT32) (void *) (pthread))
#endif
 
#ifndef __cdecl
/drivers/devman/acpica/include/platform/acmsvc.h
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
116,8 → 116,43
#ifndef __ACMSVC_H__
#define __ACMSVC_H__
 
 
/*
* Map low I/O functions for MS. This allows us to disable MS language
* extensions for maximum portability.
*/
#define open _open
#define read _read
#define write _write
#define close _close
#define stat _stat
#define fstat _fstat
#define mkdir _mkdir
#define strlwr _strlwr
#define O_RDONLY _O_RDONLY
#define O_BINARY _O_BINARY
#define O_CREAT _O_CREAT
#define O_WRONLY _O_WRONLY
#define O_TRUNC _O_TRUNC
#define S_IREAD _S_IREAD
#define S_IWRITE _S_IWRITE
#define S_IFDIR _S_IFDIR
 
/* Eliminate warnings for "old" (non-secure) versions of clib functions */
 
#ifndef _CRT_SECURE_NO_WARNINGS
#define _CRT_SECURE_NO_WARNINGS
#endif
 
/* Eliminate warnings for POSIX clib function names (open, write, etc.) */
 
#ifndef _CRT_NONSTDC_NO_DEPRECATE
#define _CRT_NONSTDC_NO_DEPRECATE
#endif
 
#define COMPILER_DEPENDENT_INT64 __int64
#define COMPILER_DEPENDENT_UINT64 unsigned __int64
#define ACPI_INLINE __inline
 
/*
* Calling conventions:
179,5 → 214,8
/* warn C4131: uses old-style declarator (iASL compiler only) */
#pragma warning(disable:4131)
 
#if _MSC_VER > 1200 /* Versions above VC++ 6 */
#pragma warning( disable : 4295 ) /* needed for acpredef.h array */
#endif
 
#endif /* __ACMSVC_H__ */
/drivers/devman/acpica/include/platform/acnetbsd.h
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
/drivers/devman/acpica/include/platform/acos2.h
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
158,12 → 158,6
n_lo = (unsigned long)(val & 0xffffffff); \
}
 
/* IBM VAC does not have inline */
 
#if __IBMC__ || __IBMCPP__
#define inline
#endif
 
#ifndef ACPI_ASL_COMPILER
#define ACPI_USE_LOCAL_CACHE
#undef ACPI_DEBUGGER
/drivers/devman/acpica/include/platform/acwin.h
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,8 → 126,6
 
#define ACPI_MACHINE_WIDTH 32
 
#define inline __inline
 
#define ACPI_USE_STANDARD_HEADERS
 
#ifdef ACPI_DEFINE_ALTERNATE_TYPES
/drivers/devman/acpica/include/platform/acwin64.h
1,6 → 1,6
/******************************************************************************
*
* Name: acwin.h - OS specific defines, etc.
* Name: acwin64.h - OS specific defines, etc.
*
*****************************************************************************/
 
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
/drivers/devman/acpica/namespace/nsaccess.c
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
250,8 → 250,8
#else
/* Mark this as a very SPECIAL method */
 
ObjDesc->Method.MethodFlags = AML_METHOD_INTERNAL_ONLY;
ObjDesc->Method.Extra.Implementation = AcpiUtOsiImplementation;
ObjDesc->Method.InfoFlags = ACPI_METHOD_INTERNAL_ONLY;
ObjDesc->Method.Dispatch.Implementation = AcpiUtOsiImplementation;
#endif
break;
 
/drivers/devman/acpica/namespace/nsalloc.c
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
341,7 → 341,7
* modified the namespace. This is used for cleanup when the
* method exits.
*/
WalkState->MethodDesc->Method.Flags |= AOPOBJ_MODIFIED_NAMESPACE;
WalkState->MethodDesc->Method.InfoFlags |= ACPI_METHOD_MODIFIED_NAMESPACE;
}
}
 
459,6 → 459,7
{
ACPI_NAMESPACE_NODE *ChildNode = NULL;
UINT32 Level = 1;
ACPI_STATUS Status;
 
 
ACPI_FUNCTION_TRACE (NsDeleteNamespaceSubtree);
469,6 → 470,14
return_VOID;
}
 
/* Lock namespace for possible update */
 
Status = AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE);
if (ACPI_FAILURE (Status))
{
return_VOID;
}
 
/*
* Traverse the tree of objects until we bubble back up
* to where we started.
521,6 → 530,7
}
}
 
(void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE);
return_VOID;
}
 
/drivers/devman/acpica/namespace/nsdump.c
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
725,11 → 725,25
ACPI_HANDLE StartHandle)
{
ACPI_WALK_INFO Info;
ACPI_STATUS Status;
 
 
ACPI_FUNCTION_ENTRY ();
 
 
/*
* Just lock the entire namespace for the duration of the dump.
* We don't want any changes to the namespace during this time,
* especially the temporary nodes since we are going to display
* them also.
*/
Status = AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE);
if (ACPI_FAILURE (Status))
{
AcpiOsPrintf ("Could not acquire namespace mutex\n");
return;
}
 
Info.DebugLevel = ACPI_LV_TABLES;
Info.OwnerId = OwnerId;
Info.DisplayType = DisplayType;
737,6 → 751,8
(void) AcpiNsWalkNamespace (Type, StartHandle, MaxDepth,
ACPI_NS_WALK_NO_UNLOCK | ACPI_NS_WALK_TEMP_NODES,
AcpiNsDumpOneObject, NULL, (void *) &Info, NULL);
 
(void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE);
}
 
 
/drivers/devman/acpica/namespace/nsdumpdv.c
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
/drivers/devman/acpica/namespace/nseval.c
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
486,7 → 486,7
*/
if ((Type == ACPI_TYPE_DEVICE) && ParentNode->Object)
{
MethodObj->Method.Extra.Handler =
MethodObj->Method.Dispatch.Handler =
ParentNode->Object->Device.Handler;
}
 
/drivers/devman/acpica/namespace/nsinit.c
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
/drivers/devman/acpica/namespace/nsload.c
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
/drivers/devman/acpica/namespace/nsnames.c
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
/drivers/devman/acpica/namespace/nsobject.c
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
/drivers/devman/acpica/namespace/nsparse.c
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
/drivers/devman/acpica/namespace/nspredef.c
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
288,14 → 288,20
}
 
/*
* 1) We have a return value, but if one wasn't expected, just exit, this is
* not a problem. For example, if the "Implicit Return" feature is
* enabled, methods will always return a value.
* Return value validation and possible repair.
*
* 2) If the return value can be of any type, then we cannot perform any
* validation, exit.
* 1) Don't perform return value validation/repair if this feature
* has been disabled via a global option.
*
* 2) We have a return value, but if one wasn't expected, just exit,
* this is not a problem. For example, if the "Implicit Return"
* feature is enabled, methods will always return a value.
*
* 3) If the return value can be of any type, then we cannot perform
* any validation, just exit.
*/
if ((!Predefined->Info.ExpectedBtypes) ||
if (AcpiGbl_DisableAutoRepair ||
(!Predefined->Info.ExpectedBtypes) ||
(Predefined->Info.ExpectedBtypes == ACPI_RTYPE_ALL))
{
goto Cleanup;
309,6 → 315,7
goto Cleanup;
}
Data->Predefined = Predefined;
Data->Node = Node;
Data->NodeFlags = Node->Flags;
Data->Pathname = Pathname;
 
/drivers/devman/acpica/namespace/nsrepair.c
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
149,7 → 149,6
*
* Additional possible repairs:
*
* Optional/unnecessary NULL package elements removed
* Required package elements that are NULL replaced by Integer/String/Buffer
* Incorrect standalone package wrapped with required outer package
*
683,7 → 682,7
{
/* Need an Integer - create a zero-value integer */
 
NewObject = AcpiUtCreateIntegerObject (0);
NewObject = AcpiUtCreateIntegerObject ((UINT64) 0);
}
else if (ExpectedBtypes & ACPI_RTYPE_STRING)
{
756,17 → 755,13
 
 
/*
* PTYPE1 packages contain no subpackages.
* PTYPE2 packages contain a variable number of sub-packages. We can
* safely remove all NULL elements from the PTYPE2 packages.
* We can safely remove all NULL elements from these package types:
* PTYPE1_VAR packages contain a variable number of simple data types.
* PTYPE2 packages contain a variable number of sub-packages.
*/
switch (PackageType)
{
case ACPI_PTYPE1_FIXED:
case ACPI_PTYPE1_VAR:
case ACPI_PTYPE1_OPTION:
return;
 
case ACPI_PTYPE2:
case ACPI_PTYPE2_COUNT:
case ACPI_PTYPE2_PKG_COUNT:
776,6 → 771,8
break;
 
default:
case ACPI_PTYPE1_FIXED:
case ACPI_PTYPE1_OPTION:
return;
}
 
/drivers/devman/acpica/namespace/nsrepair2.c
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
153,11 → 153,21
ACPI_OPERAND_OBJECT **ReturnObjectPtr);
 
static ACPI_STATUS
AcpiNsRepair_CID (
ACPI_PREDEFINED_DATA *Data,
ACPI_OPERAND_OBJECT **ReturnObjectPtr);
 
static ACPI_STATUS
AcpiNsRepair_FDE (
ACPI_PREDEFINED_DATA *Data,
ACPI_OPERAND_OBJECT **ReturnObjectPtr);
 
static ACPI_STATUS
AcpiNsRepair_HID (
ACPI_PREDEFINED_DATA *Data,
ACPI_OPERAND_OBJECT **ReturnObjectPtr);
 
static ACPI_STATUS
AcpiNsRepair_PSS (
ACPI_PREDEFINED_DATA *Data,
ACPI_OPERAND_OBJECT **ReturnObjectPtr);
196,8 → 206,10
* As necessary:
*
* _ALR: Sort the list ascending by AmbientIlluminance
* _CID: Strings: uppercase all, remove any leading asterisk
* _FDE: Convert Buffer of BYTEs to a Buffer of DWORDs
* _GTM: Convert Buffer of BYTEs to a Buffer of DWORDs
* _HID: Strings: uppercase all, remove any leading asterisk
* _PSS: Sort the list descending by Power
* _TSS: Sort the list descending by Power
*
211,8 → 223,10
static const ACPI_REPAIR_INFO AcpiNsRepairableNames[] =
{
{"_ALR", AcpiNsRepair_ALR},
{"_CID", AcpiNsRepair_CID},
{"_FDE", AcpiNsRepair_FDE},
{"_GTM", AcpiNsRepair_FDE}, /* _GTM has same repair as _FDE */
{"_HID", AcpiNsRepair_HID},
{"_PSS", AcpiNsRepair_PSS},
{"_TSS", AcpiNsRepair_TSS},
{{0,0,0,0}, NULL} /* Table terminator */
427,6 → 441,172
 
/******************************************************************************
*
* FUNCTION: AcpiNsRepair_CID
*
* PARAMETERS: Data - Pointer to validation data structure
* ReturnObjectPtr - Pointer to the object returned from the
* evaluation of a method or object
*
* RETURN: Status. AE_OK if object is OK or was repaired successfully
*
* DESCRIPTION: Repair for the _CID object. If a string, ensure that all
* letters are uppercase and that there is no leading asterisk.
* If a Package, ensure same for all string elements.
*
*****************************************************************************/
 
static ACPI_STATUS
AcpiNsRepair_CID (
ACPI_PREDEFINED_DATA *Data,
ACPI_OPERAND_OBJECT **ReturnObjectPtr)
{
ACPI_STATUS Status;
ACPI_OPERAND_OBJECT *ReturnObject = *ReturnObjectPtr;
ACPI_OPERAND_OBJECT **ElementPtr;
ACPI_OPERAND_OBJECT *OriginalElement;
UINT16 OriginalRefCount;
UINT32 i;
 
 
/* Check for _CID as a simple string */
 
if (ReturnObject->Common.Type == ACPI_TYPE_STRING)
{
Status = AcpiNsRepair_HID (Data, ReturnObjectPtr);
return (Status);
}
 
/* Exit if not a Package */
 
if (ReturnObject->Common.Type != ACPI_TYPE_PACKAGE)
{
return (AE_OK);
}
 
/* Examine each element of the _CID package */
 
ElementPtr = ReturnObject->Package.Elements;
for (i = 0; i < ReturnObject->Package.Count; i++)
{
OriginalElement = *ElementPtr;
OriginalRefCount = OriginalElement->Common.ReferenceCount;
 
Status = AcpiNsRepair_HID (Data, ElementPtr);
if (ACPI_FAILURE (Status))
{
return (Status);
}
 
/* Take care with reference counts */
 
if (OriginalElement != *ElementPtr)
{
/* Element was replaced */
 
(*ElementPtr)->Common.ReferenceCount =
OriginalRefCount;
 
AcpiUtRemoveReference (OriginalElement);
}
 
ElementPtr++;
}
 
return (AE_OK);
}
 
 
/******************************************************************************
*
* FUNCTION: AcpiNsRepair_HID
*
* PARAMETERS: Data - Pointer to validation data structure
* ReturnObjectPtr - Pointer to the object returned from the
* evaluation of a method or object
*
* RETURN: Status. AE_OK if object is OK or was repaired successfully
*
* DESCRIPTION: Repair for the _HID object. If a string, ensure that all
* letters are uppercase and that there is no leading asterisk.
*
*****************************************************************************/
 
static ACPI_STATUS
AcpiNsRepair_HID (
ACPI_PREDEFINED_DATA *Data,
ACPI_OPERAND_OBJECT **ReturnObjectPtr)
{
ACPI_OPERAND_OBJECT *ReturnObject = *ReturnObjectPtr;
ACPI_OPERAND_OBJECT *NewString;
char *Source;
char *Dest;
 
 
ACPI_FUNCTION_NAME (NsRepair_HID);
 
 
/* We only care about string _HID objects (not integers) */
 
if (ReturnObject->Common.Type != ACPI_TYPE_STRING)
{
return (AE_OK);
}
 
if (ReturnObject->String.Length == 0)
{
ACPI_WARN_PREDEFINED ((AE_INFO, Data->Pathname, Data->NodeFlags,
"Invalid zero-length _HID or _CID string"));
 
/* Return AE_OK anyway, let driver handle it */
 
Data->Flags |= ACPI_OBJECT_REPAIRED;
return (AE_OK);
}
 
/* It is simplest to always create a new string object */
 
NewString = AcpiUtCreateStringObject (ReturnObject->String.Length);
if (!NewString)
{
return (AE_NO_MEMORY);
}
 
/*
* Remove a leading asterisk if present. For some unknown reason, there
* are many machines in the field that contains IDs like this.
*
* Examples: "*PNP0C03", "*ACPI0003"
*/
Source = ReturnObject->String.Pointer;
if (*Source == '*')
{
Source++;
NewString->String.Length--;
 
ACPI_DEBUG_PRINT ((ACPI_DB_REPAIR,
"%s: Removed invalid leading asterisk\n", Data->Pathname));
}
 
/*
* Copy and uppercase the string. From the ACPI specification:
*
* A valid PNP ID must be of the form "AAA####" where A is an uppercase
* letter and # is a hex digit. A valid ACPI ID must be of the form
* "ACPI####" where # is a hex digit.
*/
for (Dest = NewString->String.Pointer; *Source; Dest++, Source++)
{
*Dest = (char) ACPI_TOUPPER (*Source);
}
 
AcpiUtRemoveReference (ReturnObject);
*ReturnObjectPtr = NewString;
return (AE_OK);
}
 
 
/******************************************************************************
*
* FUNCTION: AcpiNsRepair_TSS
*
* PARAMETERS: Data - Pointer to validation data structure
447,8 → 627,23
{
ACPI_OPERAND_OBJECT *ReturnObject = *ReturnObjectPtr;
ACPI_STATUS Status;
ACPI_NAMESPACE_NODE *Node;
 
 
/*
* We can only sort the _TSS return package if there is no _PSS in 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.
* (May, 2011)
*/
Status = AcpiNsGetNode (Data->Node, "^_PSS", ACPI_NS_NO_UPSEARCH, &Node);
if (ACPI_SUCCESS (Status))
{
return (AE_OK);
}
 
Status = AcpiNsCheckSortedList (Data, ReturnObject, 5, 1,
ACPI_SORT_DESCENDING, "PowerDissipation");
 
/drivers/devman/acpica/namespace/nssearch.c
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
/drivers/devman/acpica/namespace/nsutils.c
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,118 → 139,6
 
/*******************************************************************************
*
* FUNCTION: AcpiNsReportError
*
* PARAMETERS: ModuleName - Caller's module name (for error output)
* LineNumber - Caller's line number (for error output)
* InternalName - Name or path of the namespace node
* LookupStatus - Exception code from NS lookup
*
* RETURN: None
*
* DESCRIPTION: Print warning message with full pathname
*
******************************************************************************/
 
void
AcpiNsReportError (
const char *ModuleName,
UINT32 LineNumber,
const char *InternalName,
ACPI_STATUS LookupStatus)
{
ACPI_STATUS Status;
UINT32 BadName;
char *Name = NULL;
 
 
AcpiOsPrintf ("ACPI Error (%s-%04d): ", ModuleName, LineNumber);
 
if (LookupStatus == AE_BAD_CHARACTER)
{
/* There is a non-ascii character in the name */
 
ACPI_MOVE_32_TO_32 (&BadName, ACPI_CAST_PTR (UINT32, InternalName));
AcpiOsPrintf ("[0x%4.4X] (NON-ASCII)", BadName);
}
else
{
/* Convert path to external format */
 
Status = AcpiNsExternalizeName (ACPI_UINT32_MAX,
InternalName, NULL, &Name);
 
/* Print target name */
 
if (ACPI_SUCCESS (Status))
{
AcpiOsPrintf ("[%s]", Name);
}
else
{
AcpiOsPrintf ("[COULD NOT EXTERNALIZE NAME]");
}
 
if (Name)
{
ACPI_FREE (Name);
}
}
 
AcpiOsPrintf (" Namespace lookup failure, %s\n",
AcpiFormatException (LookupStatus));
}
 
 
/*******************************************************************************
*
* FUNCTION: AcpiNsReportMethodError
*
* PARAMETERS: ModuleName - Caller's module name (for error output)
* LineNumber - Caller's line number (for error output)
* Message - Error message to use on failure
* PrefixNode - Prefix relative to the path
* Path - Path to the node (optional)
* MethodStatus - Execution status
*
* RETURN: None
*
* DESCRIPTION: Print warning message with full pathname
*
******************************************************************************/
 
void
AcpiNsReportMethodError (
const char *ModuleName,
UINT32 LineNumber,
const char *Message,
ACPI_NAMESPACE_NODE *PrefixNode,
const char *Path,
ACPI_STATUS MethodStatus)
{
ACPI_STATUS Status;
ACPI_NAMESPACE_NODE *Node = PrefixNode;
 
 
AcpiOsPrintf ("ACPI Error (%s-%04d): ", ModuleName, LineNumber);
 
if (Path)
{
Status = AcpiNsGetNode (PrefixNode, Path, ACPI_NS_NO_UPSEARCH,
&Node);
if (ACPI_FAILURE (Status))
{
AcpiOsPrintf ("[Could not get node by pathname]");
}
}
 
AcpiNsPrintNodePathname (Node, Message);
AcpiOsPrintf (", %s\n", AcpiFormatException (MethodStatus));
}
 
 
/*******************************************************************************
*
* FUNCTION: AcpiNsPrintNodePathname
*
* PARAMETERS: Node - Object
/drivers/devman/acpica/namespace/nswalk.c
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
/drivers/devman/acpica/namespace/nsxfeval.c
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
/drivers/devman/acpica/namespace/nsxfname.c
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
738,11 → 738,10
MethodObj->Method.ParamCount = (UINT8)
(MethodFlags & AML_METHOD_ARG_COUNT);
 
MethodObj->Method.MethodFlags = (UINT8)
(MethodFlags & ~AML_METHOD_ARG_COUNT);
 
if (MethodFlags & AML_METHOD_SERIALIZED)
{
MethodObj->Method.InfoFlags = ACPI_METHOD_SERIALIZED;
 
MethodObj->Method.SyncLevel = (UINT8)
((MethodFlags & AML_METHOD_SYNC_LEVEL) >> 4);
}
751,8 → 750,7
* Now that it is complete, we can attach the new method object to
* the method Node (detaches/deletes any existing object)
*/
Status = AcpiNsAttachObject (Node, MethodObj,
ACPI_TYPE_METHOD);
Status = AcpiNsAttachObject (Node, MethodObj, ACPI_TYPE_METHOD);
 
/*
* Flag indicates AML buffer is dynamic, must be deleted later.
/drivers/devman/acpica/namespace/nsxfobj.c
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
/drivers/devman/acpica/os_specific/service_layers/osunixdir.c
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
125,6 → 125,9
 
#include "acpisrc.h"
 
/*
* Allocated structure returned from OsOpenDirectory
*/
typedef struct ExternalFindInfo
{
char *DirPathname;
217,7 → 220,9
if (!fnmatch (ExternalInfo->WildcardSpec, dir_entry->d_name, 0))
{
if (dir_entry->d_name[0] == '.')
{
continue;
}
 
str_len = strlen (dir_entry->d_name) +
strlen (ExternalInfo->DirPathname) + 2;
226,7 → 231,7
if (!temp_str)
{
printf ("Could not allocate buffer for temporary string\n");
return NULL;
return (NULL);
}
 
strcpy (temp_str, ExternalInfo->DirPathname);
238,7 → 243,7
if (err == -1)
{
printf ("stat() error - should not happen\n");
return NULL;
return (NULL);
}
 
if ((S_ISDIR (temp_stat.st_mode)
255,7 → 260,7
}
}
 
return NULL;
return (NULL);
}
 
 
284,9 → 289,21
free (DirHandle);
}
 
 
/* Other functions acpisrc uses but that aren't standard on Unix */
 
/* lowercase a string */
/*******************************************************************************
*
* FUNCTION: strlwr
*
* PARAMETERS: str - String to be lowercased.
*
* RETURN: str.
*
* DESCRIPTION: Lowercase a string in-place.
*
******************************************************************************/
 
char*
strlwr (
char *str)
/drivers/devman/acpica/os_specific/service_layers/osunixxf.c
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
115,9 → 115,16
 
 
/*
* These interfaces are required in order to compile the ASL compiler under
* Linux or other Unix-like system.
* These interfaces are required in order to compile the ASL compiler and the
* various ACPICA tools under Linux or other Unix-like system.
*
* Note: Use #define __APPLE__ for OS X generation.
*/
#include "acpi.h"
#include "accommon.h"
#include "amlcode.h"
#include "acparser.h"
#include "acdebug.h"
 
#include <stdio.h>
#include <stdlib.h>
126,13 → 133,8
#include <sys/time.h>
#include <semaphore.h>
#include <pthread.h>
#include <errno.h>
 
#include "acpi.h"
#include "accommon.h"
#include "amlcode.h"
#include "acparser.h"
#include "acdebug.h"
 
#define _COMPONENT ACPI_OS_SERVICES
ACPI_MODULE_NAME ("osunixxf")
 
154,7 → 156,13
 
typedef void* (*PTHREAD_CALLBACK) (void *);
 
/* Apple-specific */
 
#ifdef __APPLE__
#define sem_destroy sem_close
#endif
 
 
/******************************************************************************
*
* FUNCTION: AcpiOsInitialize, AcpiOsTerminate
192,7 → 200,7
*
* RETURN: RSDP physical address
*
* DESCRIPTION: Gets the root pointer (RSDP)
* DESCRIPTION: Gets the ACPI root pointer (RSDP)
*
*****************************************************************************/
 
239,7 → 247,8
*
* FUNCTION: AcpiOsTableOverride
*
* PARAMETERS: ExistingTable - Header of current table (probably firmware)
* PARAMETERS: ExistingTable - Header of current table (probably
* firmware)
* NewTable - Where an entire new table is returned.
*
* RETURN: Status, pointer to new table. Null pointer returned if no
298,7 → 307,7
*
* FUNCTION: AcpiOsPrintf
*
* PARAMETERS: fmt, ... Standard printf format
* PARAMETERS: fmt, ... - Standard printf format
*
* RETURN: None
*
324,8 → 333,8
*
* FUNCTION: AcpiOsVprintf
*
* PARAMETERS: fmt Standard printf format
* args Argument list
* PARAMETERS: fmt - Standard printf format
* args - Argument list
*
* RETURN: None
*
372,18 → 381,21
*
* FUNCTION: AcpiOsGetLine
*
* PARAMETERS: fmt Standard printf format
* args Argument list
* PARAMETERS: Buffer - Where to return the command line
* BufferLength - Maximum length of Buffer
* BytesRead - Where the actual byte count is returned
*
* RETURN: Actual bytes read
* RETURN: Status and actual bytes read
*
* DESCRIPTION: Formatted input with argument list pointer
*
*****************************************************************************/
 
UINT32
ACPI_STATUS
AcpiOsGetLine (
char *Buffer)
char *Buffer,
UINT32 BufferLength,
UINT32 *BytesRead)
{
UINT8 Temp;
UINT32 i;
391,6 → 403,11
 
for (i = 0; ; i++)
{
if (i >= BufferLength)
{
return (AE_BUFFER_OVERFLOW);
}
 
scanf ("%1c", &Temp);
if (!Temp || Temp == '\n')
{
406,15 → 423,20
 
/* Return the number of bytes in the string */
 
return (i);
if (BytesRead)
{
*BytesRead = i;
}
return (AE_OK);
}
 
 
/******************************************************************************
*
* FUNCTION: AcpiOsMapMemory
*
* PARAMETERS: where Physical address of memory to be mapped
* length How much memory to map
* PARAMETERS: where - Physical address of memory to be mapped
* length - How much memory to map
*
* RETURN: Pointer to mapped memory. Null on error.
*
436,8 → 458,8
*
* FUNCTION: AcpiOsUnmapMemory
*
* PARAMETERS: where Logical address of memory to be unmapped
* length How much memory to unmap
* PARAMETERS: where - Logical address of memory to be unmapped
* length - How much memory to unmap
*
* RETURN: None.
*
460,7 → 482,7
*
* FUNCTION: AcpiOsAllocate
*
* PARAMETERS: Size Amount to allocate, in bytes
* PARAMETERS: Size - Amount to allocate, in bytes
*
* RETURN: Pointer to the new allocation. Null on error.
*
484,7 → 506,7
*
* FUNCTION: AcpiOsFree
*
* PARAMETERS: mem Pointer to previously allocated memory
* PARAMETERS: mem - Pointer to previously allocated memory
*
* RETURN: None.
*
529,7 → 551,6
}
 
Sem = AcpiOsAllocate (sizeof (sem_t));
 
if (!Sem)
{
return (AE_NO_MEMORY);
756,9 → 777,9
*
* FUNCTION: AcpiOsInstallInterruptHandler
*
* PARAMETERS: InterruptNumber Level handler should respond to.
* Isr Address of the ACPI interrupt handler
* ExceptPtr Where status is returned
* PARAMETERS: InterruptNumber - Level handler should respond to.
* Isr - Address of the ACPI interrupt handler
* ExceptPtr - Where status is returned
*
* RETURN: Handle to the newly installed handler.
*
782,7 → 803,7
*
* FUNCTION: AcpiOsRemoveInterruptHandler
*
* PARAMETERS: Handle Returned when handler was installed
* PARAMETERS: Handle - Returned when handler was installed
*
* RETURN: Status
*
802,42 → 823,9
 
/******************************************************************************
*
* FUNCTION: AcpiOsExecute
*
* PARAMETERS: Type - Type of execution
* Function - Address of the function to execute
* Context - Passed as a parameter to the function
*
* RETURN: Status.
*
* DESCRIPTION: Execute a new thread
*
*****************************************************************************/
 
ACPI_STATUS
AcpiOsExecute (
ACPI_EXECUTE_TYPE Type,
ACPI_OSD_EXEC_CALLBACK Function,
void *Context)
{
pthread_t thread;
int ret;
 
 
ret = pthread_create (&thread, NULL, (PTHREAD_CALLBACK) Function, Context);
if (ret)
{
AcpiOsPrintf("Create thread failed");
}
return (0);
}
 
 
/******************************************************************************
*
* FUNCTION: AcpiOsStall
*
* PARAMETERS: microseconds To sleep
* PARAMETERS: microseconds - Time to sleep
*
* RETURN: Blocks until sleep is completed.
*
861,7 → 849,7
*
* FUNCTION: AcpiOsSleep
*
* PARAMETERS: milliseconds To sleep
* PARAMETERS: milliseconds - Time to sleep
*
* RETURN: Blocks until sleep is completed.
*
882,6 → 870,7
usleep ((milliseconds % 1000) * 1000); /* Sleep for remaining usecs */
}
 
 
/******************************************************************************
*
* FUNCTION: AcpiOsGetTimer
895,7 → 884,8
*****************************************************************************/
 
UINT64
AcpiOsGetTimer (void)
AcpiOsGetTimer (
void)
{
struct timeval time;
 
910,34 → 900,12
 
/******************************************************************************
*
* FUNCTION: AcpiOsValidateInterface
*
* PARAMETERS: Interface - Requested interface to be validated
*
* RETURN: AE_OK if interface is supported, AE_SUPPORT otherwise
*
* DESCRIPTION: Match an interface string to the interfaces supported by the
* host. Strings originate from an AML call to the _OSI method.
*
*****************************************************************************/
 
ACPI_STATUS
AcpiOsValidateInterface (
char *Interface)
{
 
return (AE_SUPPORT);
}
 
 
/******************************************************************************
*
* FUNCTION: AcpiOsReadPciConfiguration
*
* PARAMETERS: PciId Seg/Bus/Dev
* Register Device Register
* Value Buffer where value is placed
* Width Number of bits
* PARAMETERS: PciId - Seg/Bus/Dev
* Register - Device Register
* Value - Buffer where value is placed
* Width - Number of bits
*
* RETURN: Status
*
949,7 → 917,7
AcpiOsReadPciConfiguration (
ACPI_PCI_ID *PciId,
UINT32 Register,
void *Value,
UINT64 *Value,
UINT32 Width)
{
 
961,10 → 929,10
*
* FUNCTION: AcpiOsWritePciConfiguration
*
* PARAMETERS: PciId Seg/Bus/Dev
* Register Device Register
* Value Value to be written
* Width Number of bits
* PARAMETERS: PciId - Seg/Bus/Dev
* Register - Device Register
* Value - Value to be written
* Width - Number of bits
*
* RETURN: Status.
*
983,24 → 951,14
return (AE_OK);
}
 
/* TEMPORARY STUB FUNCTION */
void
AcpiOsDerivePciId(
ACPI_HANDLE Device,
ACPI_HANDLE Region,
ACPI_PCI_ID **PciId)
{
 
}
 
 
/******************************************************************************
*
* FUNCTION: AcpiOsReadPort
*
* PARAMETERS: Address Address of I/O port/register to read
* Value Where value is placed
* Width Number of bits
* PARAMETERS: Address - Address of I/O port/register to read
* Value - Where value is placed
* Width - Number of bits
*
* RETURN: Value read from port
*
1041,9 → 999,9
*
* FUNCTION: AcpiOsWritePort
*
* PARAMETERS: Address Address of I/O port/register to write
* Value Value to write
* Width Number of bits
* PARAMETERS: Address - Address of I/O port/register to write
* Value - Value to write
* Width - Number of bits
*
* RETURN: None
*
1066,9 → 1024,9
*
* FUNCTION: AcpiOsReadMemory
*
* PARAMETERS: Address Physical Memory Address to read
* Value Where value is placed
* Width Number of bits
* PARAMETERS: Address - Physical Memory Address to read
* Value - Where value is placed
* Width - Number of bits
*
* RETURN: Value read from physical memory address
*
1102,9 → 1060,9
*
* FUNCTION: AcpiOsWriteMemory
*
* PARAMETERS: Address Physical Memory Address to write
* Value Value to write
* Width Number of bits
* PARAMETERS: Address - Physical Memory Address to write
* Value - Value to write
* Width - Number of bits
*
* RETURN: None
*
1171,33 → 1129,10
 
/******************************************************************************
*
* FUNCTION: AcpiOsGetThreadId
*
* PARAMETERS: None
*
* RETURN: Id of the running thread
*
* DESCRIPTION: Get the Id of the current (running) thread
*
* NOTE: The environment header should contain this line:
* #define ACPI_THREAD_ID pthread_t
*
*****************************************************************************/
 
ACPI_THREAD_ID
AcpiOsGetThreadId (void)
{
 
return (pthread_self ());
}
 
 
/******************************************************************************
*
* FUNCTION: AcpiOsSignal
*
* PARAMETERS: Function ACPI CA signal function code
* Info Pointer to function-dependent structure
* PARAMETERS: Function - ACPI CA signal function code
* Info - Pointer to function-dependent structure
*
* RETURN: Status
*
/drivers/devman/acpica/os_specific/service_layers/oswindir.c
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,6 → 114,7
*
*****************************************************************************/
 
#include <acpi.h>
 
#include <stdio.h>
#include <stdlib.h>
120,8 → 121,6
#include <string.h>
#include <io.h>
 
#include <acpi.h>
 
typedef struct ExternalFindInfo
{
struct _finddata_t DosInfo;
171,7 → 170,7
SearchInfo = calloc (sizeof (EXTERNAL_FIND_INFO), 1);
if (!SearchInfo)
{
return NULL;
return (NULL);
}
 
/* Allocate space for the full wildcard path */
180,7 → 179,7
if (!FullWildcardSpec)
{
printf ("Could not allocate buffer for wildcard pathname\n");
return NULL;
return (NULL);
}
 
/* Create the full wildcard path */
198,7 → 197,7
 
free (FullWildcardSpec);
free (SearchInfo);
return NULL;
return (NULL);
}
 
/* Save the info in the return structure */
254,7 → 253,7
Status = _findnext (SearchInfo->FindHandle, &SearchInfo->DosInfo);
if (Status != 0)
{
return NULL;
return (NULL);
}
}
 
288,7 → 287,7
break;
 
default:
return NULL;
return (NULL);
}
}
 
302,7 → 301,7
*
* PARAMETERS: DirHandle - Created via AcpiOsOpenDirectory
*
* RETURN: None.
* RETURN: None
*
* DESCRIPTION: Close the open directory and cleanup.
*
/drivers/devman/acpica/os_specific/service_layers/oswintbl.c
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
114,19 → 114,16
*****************************************************************************/
 
 
#include "acpi.h"
 
#ifdef WIN32
#pragma warning(disable:4115) /* warning C4115: (caused by rpcasync.h) */
 
#include <windows.h>
#include <winbase.h>
 
#elif WIN64
#include <windowsx.h>
#endif
 
#include "acpi.h"
#include "accommon.h"
 
#define _COMPONENT ACPI_OS_SERVICES
ACPI_MODULE_NAME ("oswintbl")
 
/drivers/devman/acpica/os_specific/service_layers/oswinxf.c
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
113,6 → 113,8
*
*****************************************************************************/
 
#include "acpi.h"
#include "accommon.h"
 
#ifdef WIN32
#pragma warning(disable:4115) /* warning C4115: named type definition in parentheses (caused by rpcasync.h> */
130,32 → 132,22
#include <process.h>
#include <time.h>
 
#include "acpi.h"
#include "accommon.h"
 
#define _COMPONENT ACPI_OS_SERVICES
ACPI_MODULE_NAME ("oswinxf")
 
 
/* Semaphore information structure */
extern FILE *AcpiGbl_DebugFile;
extern BOOLEAN AcpiGbl_DebugTimeout;
 
typedef struct acpi_os_semaphore_info
{
UINT16 MaxUnits;
UINT16 CurrentUnits;
void *OsHandle;
FILE *AcpiGbl_OutputFile;
UINT64 TimerFrequency;
char TableName[ACPI_NAME_SIZE + 1];
 
} ACPI_OS_SEMAPHORE_INFO;
#define ACPI_OS_DEBUG_TIMEOUT 30000 /* 30 seconds */
 
/* Need enough semaphores to run the large aslts suite */
 
#define ACPI_OS_MAX_SEMAPHORES 256
/* Upcalls to application */
 
ACPI_OS_SEMAPHORE_INFO AcpiGbl_Semaphores[ACPI_OS_MAX_SEMAPHORES];
 
 
/* Upcalls to AcpiExec */
 
ACPI_PHYSICAL_ADDRESS
AeLocalGetRootPointer (
void);
170,16 → 162,30
char *Signature);
 
 
extern FILE *AcpiGbl_DebugFile;
extern BOOLEAN AcpiGbl_DebugTimeout;
/*
* Real semaphores are only used for a multi-threaded application
*/
#ifndef ACPI_SINGLE_THREADED
 
FILE *AcpiGbl_OutputFile;
UINT64 TimerFrequency;
char TableName[ACPI_NAME_SIZE + 1];
/* Semaphore information structure */
 
#define ACPI_OS_DEBUG_TIMEOUT 30000 /* 30 seconds */
typedef struct acpi_os_semaphore_info
{
UINT16 MaxUnits;
UINT16 CurrentUnits;
void *OsHandle;
 
} ACPI_OS_SEMAPHORE_INFO;
 
/* Need enough semaphores to run the large aslts suite */
 
#define ACPI_OS_MAX_SEMAPHORES 256
 
ACPI_OS_SEMAPHORE_INFO AcpiGbl_Semaphores[ACPI_OS_MAX_SEMAPHORES];
 
#endif /* ACPI_SINGLE_THREADED */
 
 
/******************************************************************************
*
* FUNCTION: AcpiOsTerminate
186,7 → 192,7
*
* PARAMETERS: None
*
* RETURN: None
* RETURN: Status
*
* DESCRIPTION: Nothing to do for windows
*
193,9 → 199,10
*****************************************************************************/
 
ACPI_STATUS
AcpiOsTerminate (void)
AcpiOsTerminate (
void)
{
return AE_OK;
return (AE_OK);
}
 
 
212,17 → 219,20
*****************************************************************************/
 
ACPI_STATUS
AcpiOsInitialize (void)
AcpiOsInitialize (
void)
{
LARGE_INTEGER LocalTimerFrequency;
 
 
AcpiGbl_OutputFile = stdout;
 
#ifndef ACPI_SINGLE_THREADED
/* Clear the semaphore info array */
 
memset (AcpiGbl_Semaphores, 0x00, sizeof (AcpiGbl_Semaphores));
#endif
 
AcpiGbl_OutputFile = stdout;
 
/* Get the timer frequency for use in AcpiOsGetTimer */
 
TimerFrequency = 0;
233,7 → 243,7
TimerFrequency = LocalTimerFrequency.QuadPart;
}
 
return AE_OK;
return (AE_OK);
}
 
 
460,7 → 470,7
*
* FUNCTION: AcpiOsPrintf
*
* PARAMETERS: fmt, ... Standard printf format
* PARAMETERS: Fmt, ... - Standard printf format
*
* RETURN: None
*
489,8 → 499,8
*
* FUNCTION: AcpiOsVprintf
*
* PARAMETERS: fmt Standard printf format
* args Argument list
* PARAMETERS: Fmt - Standard printf format
* Args - Argument list
*
* RETURN: None
*
539,18 → 549,21
*
* FUNCTION: AcpiOsGetLine
*
* PARAMETERS: fmt Standard printf format
* args Argument list
* PARAMETERS: Buffer - Where to return the command line
* BufferLength - Maximum length of Buffer
* BytesRead - Where the actual byte count is returned
*
* RETURN: Actual bytes read
* RETURN: Status and actual bytes read
*
* DESCRIPTION: Formatted input with argument list pointer
*
*****************************************************************************/
 
UINT32
ACPI_STATUS
AcpiOsGetLine (
char *Buffer)
char *Buffer,
UINT32 BufferLength,
UINT32 *BytesRead)
{
char Temp;
UINT32 i;
558,6 → 571,11
 
for (i = 0; ; i++)
{
if (i >= BufferLength)
{
return (AE_BUFFER_OVERFLOW);
}
 
scanf ("%1c", &Temp);
if (!Temp || Temp == '\n')
{
573,8 → 591,12
 
/* Return the number of bytes in the string */
 
return (i);
if (BytesRead)
{
*BytesRead = i;
}
return (AE_OK);
}
 
 
/******************************************************************************
581,8 → 603,8
*
* FUNCTION: AcpiOsMapMemory
*
* PARAMETERS: where Physical address of memory to be mapped
* length How much memory to map
* PARAMETERS: Where - Physical address of memory to be mapped
* Length - How much memory to map
*
* RETURN: Pointer to mapped memory. Null on error.
*
592,11 → 614,11
 
void *
AcpiOsMapMemory (
ACPI_PHYSICAL_ADDRESS where,
ACPI_SIZE length)
ACPI_PHYSICAL_ADDRESS Where,
ACPI_SIZE Length)
{
 
return (ACPI_TO_POINTER ((ACPI_SIZE) where));
return (ACPI_TO_POINTER ((ACPI_SIZE) Where));
}
 
 
604,8 → 626,8
*
* FUNCTION: AcpiOsUnmapMemory
*
* PARAMETERS: where Logical address of memory to be unmapped
* length How much memory to unmap
* PARAMETERS: Where - Logical address of memory to be unmapped
* Length - How much memory to unmap
*
* RETURN: None.
*
616,8 → 638,8
 
void
AcpiOsUnmapMemory (
void *where,
ACPI_SIZE length)
void *Where,
ACPI_SIZE Length)
{
 
return;
628,7 → 650,7
*
* FUNCTION: AcpiOsAllocate
*
* PARAMETERS: Size Amount to allocate, in bytes
* PARAMETERS: Size - Amount to allocate, in bytes
*
* RETURN: Pointer to the new allocation. Null on error.
*
638,14 → 660,14
 
void *
AcpiOsAllocate (
ACPI_SIZE size)
ACPI_SIZE Size)
{
void *Mem;
 
 
Mem = (void *) malloc ((size_t) size);
Mem = (void *) malloc ((size_t) Size);
 
return Mem;
return (Mem);
}
 
 
653,7 → 675,7
*
* FUNCTION: AcpiOsFree
*
* PARAMETERS: mem Pointer to previously allocated memory
* PARAMETERS: Mem - Pointer to previously allocated memory
*
* RETURN: None.
*
670,8 → 692,54
}
 
 
#ifdef ACPI_SINGLE_THREADED
/******************************************************************************
*
* FUNCTION: Semaphore stub functions
*
* DESCRIPTION: Stub functions used for single-thread applications that do
* not require semaphore synchronization. Full implementations
* of these functions appear after the stubs.
*
*****************************************************************************/
 
ACPI_STATUS
AcpiOsCreateSemaphore (
UINT32 MaxUnits,
UINT32 InitialUnits,
ACPI_HANDLE *OutHandle)
{
*OutHandle = (ACPI_HANDLE) 1;
return (AE_OK);
}
 
ACPI_STATUS
AcpiOsDeleteSemaphore (
ACPI_HANDLE Handle)
{
return (AE_OK);
}
 
ACPI_STATUS
AcpiOsWaitSemaphore (
ACPI_HANDLE Handle,
UINT32 Units,
UINT16 Timeout)
{
return (AE_OK);
}
 
ACPI_STATUS
AcpiOsSignalSemaphore (
ACPI_HANDLE Handle,
UINT32 Units)
{
return (AE_OK);
}
 
#else
/******************************************************************************
*
* FUNCTION: AcpiOsCreateSemaphore
*
* PARAMETERS: MaxUnits - Maximum units that can be sent
690,12 → 758,10
UINT32 InitialUnits,
ACPI_SEMAPHORE *OutHandle)
{
#ifdef _MULTI_THREADED
void *Mutex;
UINT32 i;
 
ACPI_FUNCTION_NAME (OsCreateSemaphore);
#endif
 
 
if (MaxUnits == ACPI_UINT32_MAX)
710,11 → 776,9
 
if (InitialUnits > MaxUnits)
{
return AE_BAD_PARAMETER;
return (AE_BAD_PARAMETER);
}
 
#ifdef _MULTI_THREADED
 
/* Find an empty slot */
 
for (i = 0; i < ACPI_OS_MAX_SEMAPHORES; i++)
728,7 → 792,7
{
ACPI_EXCEPTION ((AE_INFO, AE_LIMIT,
"Reached max semaphores (%u), could not create", ACPI_OS_MAX_SEMAPHORES));
return AE_LIMIT;
return (AE_LIMIT);
}
 
/* Create an OS semaphore */
737,7 → 801,7
if (!Mutex)
{
ACPI_ERROR ((AE_INFO, "Could not create semaphore"));
return AE_NO_MEMORY;
return (AE_NO_MEMORY);
}
 
AcpiGbl_Semaphores[i].MaxUnits = (UINT16) MaxUnits;
748,9 → 812,7
i, MaxUnits, InitialUnits, Mutex));
 
*OutHandle = (void *) i;
#endif
 
return AE_OK;
return (AE_OK);
}
 
 
776,17 → 838,12
if ((Index >= ACPI_OS_MAX_SEMAPHORES) ||
!AcpiGbl_Semaphores[Index].OsHandle)
{
return AE_BAD_PARAMETER;
return (AE_BAD_PARAMETER);
}
 
 
#ifdef _MULTI_THREADED
 
CloseHandle (AcpiGbl_Semaphores[Index].OsHandle);
AcpiGbl_Semaphores[Index].OsHandle = NULL;
#endif
 
return AE_OK;
return (AE_OK);
}
 
 
810,7 → 867,6
UINT32 Units,
UINT16 Timeout)
{
#ifdef _MULTI_THREADED
UINT32 Index = (UINT32) Handle;
UINT32 WaitStatus;
UINT32 OsTimeout = Timeout;
822,13 → 878,13
if ((Index >= ACPI_OS_MAX_SEMAPHORES) ||
!AcpiGbl_Semaphores[Index].OsHandle)
{
return AE_BAD_PARAMETER;
return (AE_BAD_PARAMETER);
}
 
if (Units > 1)
{
printf ("WaitSemaphore: Attempt to receive %u units\n", Units);
return AE_NOT_IMPLEMENTED;
return (AE_NOT_IMPLEMENTED);
}
 
if (Timeout == ACPI_WAIT_FOREVER)
857,7 → 913,7
"Debug timeout on semaphore 0x%04X (%ums)\n",
Index, ACPI_OS_DEBUG_TIMEOUT));
}
return AE_TIME;
return (AE_TIME);
}
 
if (AcpiGbl_Semaphores[Index].CurrentUnits == 0)
865,13 → 921,11
ACPI_ERROR ((AE_INFO, "%s - No unit received. Timeout 0x%X, OS_Status 0x%X",
AcpiUtGetMutexName (Index), Timeout, WaitStatus));
 
return AE_OK;
return (AE_OK);
}
 
AcpiGbl_Semaphores[Index].CurrentUnits--;
#endif
 
return AE_OK;
return (AE_OK);
}
 
 
893,8 → 947,6
ACPI_SEMAPHORE Handle,
UINT32 Units)
{
#ifdef _MULTI_THREADED
 
UINT32 Index = (UINT32) Handle;
 
 
904,19 → 956,19
if (Index >= ACPI_OS_MAX_SEMAPHORES)
{
printf ("SignalSemaphore: Index/Handle out of range: %2.2X\n", Index);
return AE_BAD_PARAMETER;
return (AE_BAD_PARAMETER);
}
 
if (!AcpiGbl_Semaphores[Index].OsHandle)
{
printf ("SignalSemaphore: Null OS handle, Index %2.2X\n", Index);
return AE_BAD_PARAMETER;
return (AE_BAD_PARAMETER);
}
 
if (Units > 1)
{
printf ("SignalSemaphore: Attempt to signal %u units, Index %2.2X\n", Units, Index);
return AE_NOT_IMPLEMENTED;
return (AE_NOT_IMPLEMENTED);
}
 
if ((AcpiGbl_Semaphores[Index].CurrentUnits + 1) >
933,14 → 985,20
AcpiGbl_Semaphores[Index].CurrentUnits++;
ReleaseSemaphore (AcpiGbl_Semaphores[Index].OsHandle, Units, NULL);
 
#endif
 
return (AE_OK);
}
 
#endif /* ACPI_SINGLE_THREADED */
 
/* Spinlock interfaces, just implement with a semaphore */
 
/******************************************************************************
*
* FUNCTION: Spinlock interfaces
*
* DESCRIPTION: Map these interfaces to semaphore interfaces
*
*****************************************************************************/
 
ACPI_STATUS
AcpiOsCreateLock (
ACPI_SPINLOCK *OutHandle)
1012,9 → 1070,9
*
* FUNCTION: AcpiOsInstallInterruptHandler
*
* PARAMETERS: InterruptNumber Level handler should respond to.
* Isr Address of the ACPI interrupt handler
* ExceptPtr Where status is returned
* PARAMETERS: InterruptNumber - Level handler should respond to.
* ServiceRoutine - Address of the ACPI interrupt handler
* Context - User context
*
* RETURN: Handle to the newly installed handler.
*
1030,7 → 1088,7
void *Context)
{
 
return AE_OK;
return (AE_OK);
}
 
 
1038,7 → 1096,7
*
* FUNCTION: AcpiOsRemoveInterruptHandler
*
* PARAMETERS: Handle Returned when handler was installed
* PARAMETERS: Handle - Returned when handler was installed
*
* RETURN: Status
*
1052,71 → 1110,17
ACPI_OSD_HANDLER ServiceRoutine)
{
 
return AE_OK;
return (AE_OK);
}
 
 
/******************************************************************************
*
* FUNCTION: AcpiOsGetThreadId
*
* PARAMETERS: None
*
* RETURN: Id of the running thread
*
* DESCRIPTION: Get the Id of the current (running) thread
*
*****************************************************************************/
 
ACPI_THREAD_ID
AcpiOsGetThreadId (
void)
{
DWORD ThreadId;
 
/* Ensure ID is never 0 */
 
ThreadId = GetCurrentThreadId ();
return (ThreadId + 1);
}
 
 
/******************************************************************************
*
* FUNCTION: AcpiOsExecute
*
* PARAMETERS: Type - Type of execution
* Function - Address of the function to execute
* Context - Passed as a parameter to the function
*
* RETURN: Status
*
* DESCRIPTION: Execute a new thread
*
*****************************************************************************/
 
ACPI_STATUS
AcpiOsExecute (
ACPI_EXECUTE_TYPE Type,
ACPI_OSD_EXEC_CALLBACK Function,
void *Context)
{
 
#ifdef _MULTI_THREADED
_beginthread (Function, (unsigned) 0, Context);
#endif
 
return 0;
}
 
 
/******************************************************************************
*
* FUNCTION: AcpiOsStall
*
* PARAMETERS: microseconds To sleep
* PARAMETERS: Microseconds - Time to stall
*
* RETURN: Blocks until sleep is completed.
* RETURN: None. Blocks until stall is completed.
*
* DESCRIPTION: Sleep at microsecond granularity
*
1124,10 → 1128,10
 
void
AcpiOsStall (
UINT32 microseconds)
UINT32 Microseconds)
{
 
Sleep ((microseconds / 1000) + 1);
Sleep ((Microseconds / 1000) + 1);
return;
}
 
1136,9 → 1140,9
*
* FUNCTION: AcpiOsSleep
*
* PARAMETERS: milliseconds To sleep
* PARAMETERS: Milliseconds - Time to sleep
*
* RETURN: Blocks until sleep is completed.
* RETURN: None. Blocks until sleep is completed.
*
* DESCRIPTION: Sleep at millisecond granularity
*
1146,12 → 1150,12
 
void
AcpiOsSleep (
UINT64 milliseconds)
UINT64 Milliseconds)
{
 
/* Add 10ms to account for clock tick granularity */
 
Sleep (((unsigned long) milliseconds) + 10);
Sleep (((unsigned long) Milliseconds) + 10);
return;
}
 
1158,34 → 1162,12
 
/******************************************************************************
*
* FUNCTION: AcpiOsValidateInterface
*
* PARAMETERS: Interface - Requested interface to be validated
*
* RETURN: AE_OK if interface is supported, AE_SUPPORT otherwise
*
* DESCRIPTION: Match an interface string to the interfaces supported by the
* host. Strings originate from an AML call to the _OSI method.
*
*****************************************************************************/
 
ACPI_STATUS
AcpiOsValidateInterface (
char *Interface)
{
 
return (AE_SUPPORT);
}
 
 
/******************************************************************************
*
* FUNCTION: AcpiOsReadPciConfiguration
*
* PARAMETERS: PciId Seg/Bus/Dev
* Register Device Register
* Value Buffer where value is placed
* Width Number of bits
* PARAMETERS: PciId - Seg/Bus/Dev
* Register - Device Register
* Value - Buffer where value is placed
* Width - Number of bits
*
* RETURN: Status
*
1197,7 → 1179,7
AcpiOsReadPciConfiguration (
ACPI_PCI_ID *PciId,
UINT32 Register,
void *Value,
UINT64 *Value,
UINT32 Width)
{
 
1209,12 → 1191,12
*
* FUNCTION: AcpiOsWritePciConfiguration
*
* PARAMETERS: PciId Seg/Bus/Dev
* Register Device Register
* Value Value to be written
* Width Number of bits
* PARAMETERS: PciId - Seg/Bus/Dev
* Register - Device Register
* Value - Value to be written
* Width - Number of bits
*
* RETURN: Status.
* RETURN: Status
*
* DESCRIPTION: Write data to PCI configuration space
*
1231,25 → 1213,14
return (AE_OK);
}
 
/* TEMPORARY STUB FUNCTION */
void
AcpiOsDerivePciId(
ACPI_HANDLE Device,
ACPI_HANDLE Region,
ACPI_PCI_ID **PciId)
{
 
return;
}
 
 
/******************************************************************************
*
* FUNCTION: AcpiOsReadPort
*
* PARAMETERS: Address Address of I/O port/register to read
* Value Where value is placed
* Width Number of bits
* PARAMETERS: Address - Address of I/O port/register to read
* Value - Where value is placed
* Width - Number of bits
*
* RETURN: Value read from port
*
1290,9 → 1261,9
*
* FUNCTION: AcpiOsWritePort
*
* PARAMETERS: Address Address of I/O port/register to write
* Value Value to write
* Width Number of bits
* PARAMETERS: Address - Address of I/O port/register to write
* Value - Value to write
* Width - Number of bits
*
* RETURN: None
*
1315,9 → 1286,9
*
* FUNCTION: AcpiOsReadMemory
*
* PARAMETERS: Address Physical Memory Address to read
* Value Where value is placed
* Width Number of bits
* PARAMETERS: Address - Physical Memory Address to read
* Value - Where value is placed
* Width - Number of bits
*
* RETURN: Value read from physical memory address. Always returned
* as a 32-bit integer, regardless of the read width.
1354,9 → 1325,9
*
* FUNCTION: AcpiOsWriteMemory
*
* PARAMETERS: Address Physical Memory Address to write
* Value Value to write
* Width Number of bits
* PARAMETERS: Address - Physical Memory Address to write
* Value - Value to write
* Width - Number of bits
*
* RETURN: None
*
1379,8 → 1350,8
*
* FUNCTION: AcpiOsSignal
*
* PARAMETERS: Function ACPI CA signal function code
* Info Pointer to function-dependent structure
* PARAMETERS: Function - ACPI CA signal function code
* Info - Pointer to function-dependent structure
*
* RETURN: Status
*
1483,4 → 1454,61
return (AE_OK);
}
 
#endif
#endif /* ACPI_USE_LOCAL_CACHE */
 
 
/* Optional multi-thread support */
 
#ifndef ACPI_SINGLE_THREADED
/******************************************************************************
*
* FUNCTION: AcpiOsGetThreadId
*
* PARAMETERS: None
*
* RETURN: Id of the running thread
*
* DESCRIPTION: Get the Id of the current (running) thread
*
*****************************************************************************/
 
ACPI_THREAD_ID
AcpiOsGetThreadId (
void)
{
DWORD ThreadId;
 
/* Ensure ID is never 0 */
 
ThreadId = GetCurrentThreadId ();
return ((ACPI_THREAD_ID) (ThreadId + 1));
}
 
 
/******************************************************************************
*
* FUNCTION: AcpiOsExecute
*
* PARAMETERS: Type - Type of execution
* Function - Address of the function to execute
* Context - Passed as a parameter to the function
*
* RETURN: Status
*
* DESCRIPTION: Execute a new thread
*
*****************************************************************************/
 
ACPI_STATUS
AcpiOsExecute (
ACPI_EXECUTE_TYPE Type,
ACPI_OSD_EXEC_CALLBACK Function,
void *Context)
{
 
_beginthread (Function, (unsigned) 0, Context);
return (0);
}
 
#endif /* ACPI_SINGLE_THREADED */
 
/drivers/devman/acpica/osunixxf.c
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
246,7 → 246,8
*
* FUNCTION: AcpiOsTableOverride
*
* PARAMETERS: ExistingTable - Header of current table (probably firmware)
* PARAMETERS: ExistingTable - Header of current table (probably
* firmware)
* NewTable - Where an entire new table is returned.
*
* RETURN: Status, pointer to new table. Null pointer returned if no
305,7 → 306,7
*
* FUNCTION: AcpiOsPrintf
*
* PARAMETERS: fmt, ... Standard printf format
* PARAMETERS: fmt, ... - Standard printf format
*
* RETURN: None
*
331,8 → 332,8
*
* FUNCTION: AcpiOsVprintf
*
* PARAMETERS: fmt Standard printf format
* args Argument list
* PARAMETERS: fmt - Standard printf format
* args - Argument list
*
* RETURN: None
*
358,8 → 359,8
*
* FUNCTION: AcpiOsMapMemory
*
* PARAMETERS: where Physical address of memory to be mapped
* length How much memory to map
* PARAMETERS: where - Physical address of memory to be mapped
* length - How much memory to map
*
* RETURN: Pointer to mapped memory. Null on error.
*
374,10 → 375,14
{
 
 
void* retval;
void* retval=NULL;
 
retval = (void*)MapIoMem((UINT32)where, (UINT32)length, 0x03);
if( (UINT64)where+length <= 0x100000000ULL)
retval = (void*)MapIoMem(where, 4096+(UINT32)length, 0x07);
 
// dbgprintf("%s %x-> %x %x\n",__FUNCTION__,
// where, retval, length);
 
return retval;
}
 
386,8 → 391,8
*
* FUNCTION: AcpiOsUnmapMemory
*
* PARAMETERS: where Logical address of memory to be unmapped
* length How much memory to unmap
* PARAMETERS: where - Logical address of memory to be unmapped
* length - How much memory to unmap
*
* RETURN: None.
*
401,7 → 406,7
void *where,
ACPI_SIZE length)
{
 
FreeKernelSpace( 0xFFFFF000 & (UINT32)where);
return;
}
 
410,7 → 415,7
*
* FUNCTION: AcpiOsAllocate
*
* PARAMETERS: Size Amount to allocate, in bytes
* PARAMETERS: Size - Amount to allocate, in bytes
*
* RETURN: Pointer to the new allocation. Null on error.
*
434,7 → 439,7
*
* FUNCTION: AcpiOsFree
*
* PARAMETERS: mem Pointer to previously allocated memory
* PARAMETERS: mem - Pointer to previously allocated memory
*
* RETURN: None.
*
766,7 → 771,7
*
* FUNCTION: AcpiOsStall
*
* PARAMETERS: microseconds To sleep
* PARAMETERS: microseconds - Time to sleep
*
* RETURN: Blocks until sleep is completed.
*
790,7 → 795,7
*
* FUNCTION: AcpiOsSleep
*
* PARAMETERS: milliseconds To sleep
* PARAMETERS: milliseconds - Time to sleep
*
* RETURN: Blocks until sleep is completed.
*
835,34 → 840,12
 
/******************************************************************************
*
* FUNCTION: AcpiOsValidateInterface
*
* PARAMETERS: Interface - Requested interface to be validated
*
* RETURN: AE_OK if interface is supported, AE_SUPPORT otherwise
*
* DESCRIPTION: Match an interface string to the interfaces supported by the
* host. Strings originate from an AML call to the _OSI method.
*
*****************************************************************************/
 
ACPI_STATUS
AcpiOsValidateInterface (
char *Interface)
{
 
return (AE_SUPPORT);
}
 
 
/******************************************************************************
*
* FUNCTION: AcpiOsReadPciConfiguration
*
* PARAMETERS: PciId Seg/Bus/Dev
* Register Device Register
* Value Buffer where value is placed
* Width Number of bits
* PARAMETERS: PciId - Seg/Bus/Dev
* Register - Device Register
* Value - Buffer where value is placed
* Width - Number of bits
*
* RETURN: Status
*
874,7 → 857,7
AcpiOsReadPciConfiguration (
ACPI_PCI_ID *PciId,
UINT32 Register,
void *Value,
UINT64 *Value,
UINT32 Width)
{
UINT32 devfn = ((PciId->Device & 0x1f)<<3)|(PciId->Function & 0x07);
897,7 → 880,6
}
 
return (AE_OK);
 
}
 
 
905,10 → 887,10
*
* FUNCTION: AcpiOsWritePciConfiguration
*
* PARAMETERS: PciId Seg/Bus/Dev
* Register Device Register
* Value Value to be written
* Width Number of bits
* PARAMETERS: PciId - Seg/Bus/Dev
* Register - Device Register
* Value - Value to be written
* Width - Number of bits
*
* RETURN: Status.
*
960,9 → 942,9
*
* FUNCTION: AcpiOsReadPort
*
* PARAMETERS: Address Address of I/O port/register to read
* Value Where value is placed
* Width Number of bits
* PARAMETERS: Address - Address of I/O port/register to read
* Value - Where value is placed
* Width - Number of bits
*
* RETURN: Value read from port
*
995,7 → 977,7
return (AE_BAD_PARAMETER);
}
 
dbgprintf("%s %x, %x\n",__FUNCTION__, Address, *Value);
// dbgprintf("%s %x, %x\n",__FUNCTION__, Address, *Value);
 
return (AE_OK);
}
1005,9 → 987,9
*
* FUNCTION: AcpiOsWritePort
*
* PARAMETERS: Address Address of I/O port/register to write
* Value Value to write
* Width Number of bits
* PARAMETERS: Address - Address of I/O port/register to write
* Value - Value to write
* Width - Number of bits
*
* RETURN: None
*
1039,7 → 1021,7
return (AE_ERROR);
}
 
dbgprintf("%s %x, %x\n",__FUNCTION__, Address, Value);
// dbgprintf("%s %x, %x\n",__FUNCTION__, Address, Value);
 
return (AE_OK);
};
1048,9 → 1030,9
*
* FUNCTION: AcpiOsReadMemory
*
* PARAMETERS: Address Physical Memory Address to read
* Value Where value is placed
* Width Number of bits
* PARAMETERS: Address - Physical Memory Address to read
* Value - Where value is placed
* Width - Number of bits
*
* RETURN: Value read from physical memory address
*
1067,8 → 1049,11
void *memptr;
ACPI_STATUS status = AE_ERROR;
 
dbgprintf("%s %x\n",__FUNCTION__, Address);
// dbgprintf("%s %x\n",__FUNCTION__, Address);
 
if( (UINT64)Address+Width > 0x100000000ULL)
return (AE_BAD_PARAMETER);
 
if( Address >= 0x400000)
{
memptr = AcpiOsMapMemory(Address, Width);
1126,9 → 1111,9
*
* FUNCTION: AcpiOsWriteMemory
*
* PARAMETERS: Address Physical Memory Address to write
* Value Value to write
* Width Number of bits
* PARAMETERS: Address - Physical Memory Address to write
* Value - Value to write
* Width - Number of bits
*
* RETURN: None
*
1146,8 → 1131,11
void *memptr;
ACPI_STATUS status = AE_ERROR;
 
dbgprintf("%s %x, %x\n",__FUNCTION__, Address, Value);
// dbgprintf("%s %x, %x\n",__FUNCTION__, Address, Value);
 
if( (UINT64)Address+Width > 0x100000000ULL)
return (AE_BAD_PARAMETER);
 
if( Address >= 0x400000)
{
memptr = AcpiOsMapMemory(Address, Width);
1276,8 → 1264,8
*
* FUNCTION: AcpiOsSignal
*
* PARAMETERS: Function ACPI CA signal function code
* Info Pointer to function-dependent structure
* PARAMETERS: Function - ACPI CA signal function code
* Info - Pointer to function-dependent structure
*
* RETURN: Status
*
/drivers/devman/acpica/parser/psargs.c
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
/drivers/devman/acpica/parser/psloop.c
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
767,7 → 767,7
MethodObj->Method.AmlStart = AmlStart;
MethodObj->Method.AmlLength = AmlLength;
MethodObj->Method.OwnerId = OwnerId;
MethodObj->Method.Flags |= AOPOBJ_MODULE_LEVEL;
MethodObj->Method.InfoFlags |= ACPI_METHOD_MODULE_LEVEL;
 
/*
* Save the parent node in NextObject. This is cheating, but we
/drivers/devman/acpica/parser/psopcode.c
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
/drivers/devman/acpica/parser/psparse.c
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
128,7 → 128,6
#include "acparser.h"
#include "acdispat.h"
#include "amlcode.h"
#include "acnamesp.h"
#include "acinterp.h"
 
#define _COMPONENT ACPI_PARSER
635,23 → 634,16
/* Check for possible multi-thread reentrancy problem */
 
if ((Status == AE_ALREADY_EXISTS) &&
(!WalkState->MethodDesc->Method.Mutex))
(!(WalkState->MethodDesc->Method.InfoFlags & ACPI_METHOD_SERIALIZED)))
{
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. The probable cause is
* that the method cannot handle reentrancy.
*
* The method is marked NotSerialized, but it tried to create
* a named object, causing the second thread entrance to fail.
* Workaround this problem by marking the method permanently
* as Serialized.
* Method is not serialized and tried to create an object
* twice. The probable cause is that the method cannot
* handle reentrancy. Mark as "pending serialized" now, and
* then mark "serialized" when the last thread exits.
*/
WalkState->MethodDesc->Method.MethodFlags |= AML_METHOD_SERIALIZED;
WalkState->MethodDesc->Method.SyncLevel = 0;
WalkState->MethodDesc->Method.InfoFlags |=
ACPI_METHOD_SERIALIZED_PENDING;
}
}
 
/drivers/devman/acpica/parser/psscope.c
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
/drivers/devman/acpica/parser/pstree.c
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
/drivers/devman/acpica/parser/psutils.c
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
/drivers/devman/acpica/parser/pswalk.c
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
/drivers/devman/acpica/parser/psxface.c
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
121,7 → 121,6
#include "acdispat.h"
#include "acinterp.h"
#include "actables.h"
#include "amlcode.h"
 
 
#define _COMPONENT ACPI_PARSER
399,7 → 398,7
goto Cleanup;
}
 
if (Info->ObjDesc->Method.Flags & AOPOBJ_MODULE_LEVEL)
if (Info->ObjDesc->Method.InfoFlags & ACPI_METHOD_MODULE_LEVEL)
{
WalkState->ParseFlags |= ACPI_PARSE_MODULE_LEVEL;
}
406,9 → 405,9
 
/* Invoke an internal method if necessary */
 
if (Info->ObjDesc->Method.MethodFlags & AML_METHOD_INTERNAL_ONLY)
if (Info->ObjDesc->Method.InfoFlags & ACPI_METHOD_INTERNAL_ONLY)
{
Status = Info->ObjDesc->Method.Extra.Implementation (WalkState);
Status = Info->ObjDesc->Method.Dispatch.Implementation (WalkState);
Info->ReturnObject = WalkState->ReturnDesc;
 
/* Cleanup states */
/drivers/devman/acpica/resources/rsaddr.c
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
/drivers/devman/acpica/resources/rscalc.c
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
/drivers/devman/acpica/resources/rscreate.c
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
/drivers/devman/acpica/resources/rsdump.c
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
/drivers/devman/acpica/resources/rsinfo.c
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
/drivers/devman/acpica/resources/rsio.c
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
/drivers/devman/acpica/resources/rsirq.c
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
/drivers/devman/acpica/resources/rslist.c
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
/drivers/devman/acpica/resources/rsmemory.c
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
/drivers/devman/acpica/resources/rsmisc.c
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
/drivers/devman/acpica/resources/rsutils.c
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
/drivers/devman/acpica/resources/rsxface.c
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
/drivers/devman/acpica/tables/tbfadt.c
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,7 → 124,7
 
/* Local prototypes */
 
static inline void
static ACPI_INLINE void
AcpiTbInitGenericAddress (
ACPI_GENERIC_ADDRESS *GenericAddress,
UINT8 SpaceId,
273,7 → 273,7
*
******************************************************************************/
 
static inline void
static ACPI_INLINE void
AcpiTbInitGenericAddress (
ACPI_GENERIC_ADDRESS *GenericAddress,
UINT8 SpaceId,
482,8 → 482,11
*
* The ACPI 1.0 reserved fields that will be zeroed are the bytes located
* at offset 45, 55, 95, and the word located at offset 109, 110.
*
* Note: The FADT revision value is unreliable. Only the length can be
* trusted.
*/
if (AcpiGbl_FADT.Header.Revision < 3)
if (AcpiGbl_FADT.Header.Length <= ACPI_FADT_V2_SIZE)
{
AcpiGbl_FADT.PreferredProfile = 0;
AcpiGbl_FADT.PstateControl = 0;
/drivers/devman/acpica/tables/tbfind.c
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
/drivers/devman/acpica/tables/tbinstal.c
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
216,13 → 216,29
}
 
/*
* Originally, we checked the table signature for "SSDT" or "PSDT" here.
* Next, we added support for OEMx tables, signature "OEM".
* Valid tables were encountered with a null signature, so we've just
* given up on validating the signature, since it seems to be a waste
* of code. The original code was removed (05/2008).
* Validate the incoming table signature.
*
* 1) Originally, we checked the table signature for "SSDT" or "PSDT".
* 2) We added support for OEMx tables, signature "OEM".
* 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).
*/
if ((TableDesc->Pointer->Signature[0] != 0x00) &&
(!ACPI_COMPARE_NAME (TableDesc->Pointer->Signature, ACPI_SIG_SSDT)) &&
(ACPI_STRNCMP (TableDesc->Pointer->Signature, "OEM", 3)))
{
ACPI_ERROR ((AE_INFO,
"Table has invalid signature [%4.4s] (0x%8.8X), must be SSDT or OEMx",
AcpiUtValidAcpiName (*(UINT32 *) TableDesc->Pointer->Signature) ?
TableDesc->Pointer->Signature : "????",
*(UINT32 *) TableDesc->Pointer->Signature));
 
return_ACPI_STATUS (AE_BAD_SIGNATURE);
}
 
(void) AcpiUtAcquireMutex (ACPI_MTX_TABLES);
 
/* Check if table is already registered */
/drivers/devman/acpica/tables/tbutils.c
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
/drivers/devman/acpica/tables/tbxface.c
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
/drivers/devman/acpica/tables/tbxfroot.c
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
/drivers/devman/acpica/tests/misc/badcode.asl
116,10 → 116,39
Store (MTH2 (), Local0)
}
 
// Invalid _HID value
// Method MTH4 does not explicitly return a value
 
Name (_HID, "*PNP0C0A")
Method (MTH4) {Return}
Method (MTH5) {Store (MTH4(), Local0)}
 
// Invalid _HID values
 
Device (H1)
{
Name (_HID, "*PNP0C0A") // Illegal leading asterisk
}
Device (H2)
{
Name (_HID, "PNP") // Too short, must be 7 or 8 chars
}
Device (H3)
{
Name (_HID, "MYDEVICE01") // Too long, must be 7 or 8 chars
}
Device (H4)
{
Name (_HID, "acpi0001") // non-hex chars must be uppercase
}
Device (H5)
{
Name (_HID, "PNP-123") // HID must be alphanumeric
}
Device (H6)
{
Name (_HID, "") // Illegal Null HID
Name (_CID, "") // Illegal Null CID
}
 
// Predefined Name typechecking
 
Name (_PRW, 4)
141,6 → 170,39
Name (_INI, 1)
Name (_PTP, 2)
 
// GPE methods that cause type collision (L vs. E)
 
Scope (\_GPE)
{
Method (_L1D)
{
}
Method (_E1D)
{
}
}
 
// Predefined names that should not have a return value
 
Method (_FDM, 1)
{
Return (Buffer(1){0x33})
}
Method (_Q22)
{
Return ("Unexpected Return Value")
}
 
// _REG must have a corresponding Operation Region declaration
// within the same scope
 
Device (EC)
{
Method (_REG, 2)
{
}
}
 
/*
* Resource Descriptor error checking
*/
287,6 → 349,16
0x00001000, // Length
,, )
 
// Null descriptor (intended to be modified at runtime) must
// have a resource tag (to allow it to be modified at runtime)
DWordIO (ResourceProducer, MinFixed, MaxFixed, PosDecode, EntireRange,
0x00000000, // Granularity
0x00000000, // Range Minimum
0x00000000, // Range Maximum
0x00000000, // Translation Offset
0x00000000, // Length
,, )
 
// Missing StartDependentFn macro
 
EndDependentFn ()
/drivers/devman/acpica/tests/misc/grammar.asl
1,5 → 1,5
/*
* Some or all of this work - Copyright (c) 2006 - 2010, Intel Corp.
* Some or all of this work - Copyright (c) 2006 - 2011, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
/drivers/devman/acpica/tools/acpiexec/Makefile
1,152 → 1,690
#
# acpiexec: ACPI execution simulator. Runs ACPICA code in user
# space. Loads ACPI tables, displays the namespace, and allows
# execution of control methods.
#
# NOTE: This makefile is intended to be used in the Linux environment,
# with the Linux directory structure. It will not work directly
# on the native ACPICA source tree.
#
 
#
# Configuration
# Notes:
# gcc should be version 4 or greater, otherwise some of the options
# used will not be recognized.
# Global optimization flags (such as -O2, -Os) are not used, since
# they cause issues on some compilers.
# The _GNU_SOURCE symbol is required for many hosts.
#
PROG= acpiexec
SRCS= aetables.c aehandlers.c aeexec.c aemain.c \
../../common/getopt.c \
../../debugger/dbcmds.c \
../../debugger/dbdisply.c \
../../debugger/dbexec.c \
../../debugger/dbfileio.c \
../../debugger/dbhistry.c \
../../debugger/dbinput.c \
../../debugger/dbstats.c \
../../debugger/dbutils.c \
../../debugger/dbxface.c \
../../disassembler/dmbuffer.c \
../../disassembler/dmnames.c \
../../disassembler/dmobject.c \
../../disassembler/dmopcode.c \
../../disassembler/dmresrc.c \
../../disassembler/dmresrcl.c \
../../disassembler/dmresrcs.c \
../../disassembler/dmutils.c \
../../disassembler/dmwalk.c \
../../events/evevent.c \
../../events/evgpe.c \
../../events/evgpeblk.c \
../../events/evgpeinit.c \
../../events/evgpeutil.c \
../../events/evmisc.c \
../../events/evregion.c \
../../events/evrgnini.c \
../../events/evsci.c \
../../events/evxface.c \
../../events/evxfevnt.c \
../../events/evxfregn.c \
../../hardware/hwacpi.c \
../../hardware/hwgpe.c \
../../hardware/hwregs.c \
../../hardware/hwsleep.c \
../../hardware/hwvalid.c \
../../hardware/hwxface.c \
../../dispatcher/dsfield.c \
../../dispatcher/dsinit.c \
../../dispatcher/dsmethod.c \
../../dispatcher/dsmthdat.c \
../../dispatcher/dsobject.c \
../../dispatcher/dsopcode.c \
../../dispatcher/dsutils.c \
../../dispatcher/dswexec.c \
../../dispatcher/dswload.c \
../../dispatcher/dswscope.c \
../../dispatcher/dswstate.c \
../../executer/exconfig.c \
../../executer/exconvrt.c \
../../executer/excreate.c \
../../executer/exdebug.c \
../../executer/exdump.c \
../../executer/exfield.c \
../../executer/exfldio.c \
../../executer/exmisc.c \
../../executer/exmutex.c \
../../executer/exnames.c \
../../executer/exoparg1.c \
../../executer/exoparg2.c \
../../executer/exoparg3.c \
../../executer/exoparg6.c \
../../executer/exprep.c \
../../executer/exregion.c \
../../executer/exresnte.c \
../../executer/exresolv.c \
../../executer/exresop.c \
../../executer/exstore.c \
../../executer/exstoren.c \
../../executer/exstorob.c \
../../executer/exsystem.c \
../../executer/exutils.c \
../../parser/psargs.c \
../../parser/psloop.c \
../../parser/psopcode.c \
../../parser/psparse.c \
../../parser/psscope.c \
../../parser/pstree.c \
../../parser/psutils.c \
../../parser/pswalk.c \
../../parser/psxface.c \
../../namespace/nsaccess.c \
../../namespace/nsalloc.c \
../../namespace/nsdump.c \
../../namespace/nsdumpdv.c \
../../namespace/nseval.c \
../../namespace/nsinit.c \
../../namespace/nsload.c \
../../namespace/nsnames.c \
../../namespace/nsobject.c \
../../namespace/nsparse.c \
../../namespace/nspredef.c \
../../namespace/nsrepair.c \
../../namespace/nsrepair2.c \
../../namespace/nssearch.c \
../../namespace/nsutils.c \
../../namespace/nswalk.c \
../../namespace/nsxfeval.c \
../../namespace/nsxfname.c \
../../namespace/nsxfobj.c \
../../resources/rsaddr.c \
../../resources/rscalc.c \
../../resources/rscreate.c \
../../resources/rsdump.c \
../../resources/rsio.c \
../../resources/rsinfo.c \
../../resources/rsirq.c \
../../resources/rslist.c \
../../resources/rsmemory.c \
../../resources/rsmisc.c \
../../resources/rsutils.c \
../../resources/rsxface.c \
../../tables/tbfadt.c \
../../tables/tbfind.c \
../../tables/tbinstal.c \
../../tables/tbutils.c \
../../tables/tbxface.c \
../../tables/tbxfroot.c \
../../utilities/utalloc.c \
../../utilities/utcache.c \
../../utilities/utcopy.c \
../../utilities/utdebug.c \
../../utilities/utdelete.c \
../../utilities/uteval.c \
../../utilities/utglobal.c \
../../utilities/utids.c \
../../utilities/utinit.c \
../../utilities/utlock.c \
../../utilities/utmath.c \
../../utilities/utmisc.c \
../../utilities/utmutex.c \
../../utilities/utobject.c \
../../utilities/utresrc.c \
../../utilities/utstate.c \
../../utilities/uttrack.c \
../../utilities/utxface.c \
../../osunixxf.c
 
HOST = _LINUX
NOMAN = YES
COMPILE = $(CC) -c $(CFLAGS) $(CWARNINGFLAGS) -o$@ $?
LDFLAGS += -lpthread -lrt
 
CFLAGS+= -Wall -g -D_LINUX -DNDEBUG -D_CONSOLE -DACPI_EXEC_APP -D_MULTI_THREADED -Wstrict-prototypes -I../../include
ACPICA_COMPONENTS =
ACPICA_SRC = ../..
ACPICA_COMMON = $(ACPICA_SRC)/common
ACPICA_CORE = $(ACPICA_SRC)$(ACPICA_COMPONENTS)
ACPICA_TOOLS = $(ACPICA_SRC)/tools
ACPICA_OSL = $(ACPICA_SRC)/os_specific/service_layers
INSTALLDIR = /usr/bin
INSTALLPROG = cp --remove-destination $(PROG) $(INSTALLDIR)
 
CFLAGS+= \
-D$(HOST) \
-D_GNU_SOURCE \
-DACPI_EXEC_APP \
-I$(ACPICA_SRC)/include
 
acpiexec : $(patsubst %.c,%.o, $(SRCS))
$(CC) $(LDFLAGS) $(patsubst %.c,%.o, $(SRCS)) -lrt -lpthread -o $(PROG)
CWARNINGFLAGS = \
-ansi \
-Wall \
-Wbad-function-cast \
-Wdeclaration-after-statement \
-Werror \
-Wformat=2 \
-Wmissing-declarations \
-Wmissing-prototypes \
-Wstrict-aliasing=0 \
-Wstrict-prototypes \
-Wswitch-default \
-Wpointer-arith \
-Wundef
 
CLEANFILES= $(PROG)
OBJS = \
aeexec.o \
aehandlers.o \
aemain.o \
aetables.o \
dbcmds.o \
dbdisply.o \
dbexec.o \
dbfileio.o \
dbhistry.o \
dbinput.o \
dbmethod.o \
dbnames.o \
dbstats.o \
dbutils.o \
dbxface.o \
dmbuffer.o \
dmnames.o \
dmobject.o \
dmopcode.o \
dmresrc.o \
dmresrcl.o \
dmresrcs.o \
dmutils.o \
dmwalk.o \
dsargs.o \
dscontrol.o \
dsfield.o \
dsinit.o \
dsmethod.o \
dsmthdat.o \
dsobject.o \
dsopcode.o \
dsutils.o \
dswexec.o \
dswload.o \
dswload2.o \
dswscope.o \
dswstate.o \
evevent.o \
evglock.o \
evgpe.o \
evgpeblk.o \
evgpeinit.o \
evgpeutil.o \
evmisc.o \
evregion.o \
evrgnini.o \
evsci.o \
evxface.o \
evxfevnt.o \
evxfgpe.o \
evxfregn.o \
exconfig.o \
exconvrt.o \
excreate.o \
exdebug.o \
exdump.o \
exfield.o \
exfldio.o \
exmisc.o \
exmutex.o \
exnames.o \
exoparg1.o \
exoparg2.o \
exoparg3.o \
exoparg6.o \
exprep.o \
exregion.o \
exresnte.o \
exresolv.o \
exresop.o \
exstore.o \
exstoren.o \
exstorob.o \
exsystem.o \
exutils.o \
getopt.o \
hwacpi.o \
hwgpe.o \
hwpci.o \
hwregs.o \
hwsleep.o \
hwvalid.o \
hwxface.o \
nsaccess.o \
nsalloc.o \
nsdump.o \
nsdumpdv.o \
nseval.o \
nsinit.o \
nsload.o \
nsnames.o \
nsobject.o \
nsparse.o \
nspredef.o \
nsrepair.o \
nsrepair2.o \
nssearch.o \
nsutils.o \
nswalk.o \
nsxfeval.o \
nsxfname.o \
nsxfobj.o \
osunixxf.o \
psargs.o \
psloop.o \
psopcode.o \
psparse.o \
psscope.o \
pstree.o \
psutils.o \
pswalk.o \
psxface.o \
rsaddr.o \
rscalc.o \
rscreate.o \
rsdump.o \
rsinfo.o \
rsio.o \
rsirq.o \
rslist.o \
rsmemory.o \
rsmisc.o \
rsutils.o \
rsxface.o \
tbfadt.o \
tbfind.o \
tbinstal.o \
tbutils.o \
tbxface.o \
tbxfroot.o \
utalloc.o \
utcache.o \
utcopy.o \
utdebug.o \
utdecode.o \
utdelete.o \
uteval.o \
utglobal.o \
utids.o \
utinit.o \
utlock.o \
utmath.o \
utmisc.o \
utmutex.o \
utobject.o \
utresrc.o \
utstate.o \
uttrack.o \
utosi.o \
utxferror.o \
utxface.o
 
#
# Root rule
#
$(PROG) : $(OBJS)
$(CC) $(LDFLAGS) $(OBJS) -o $(PROG)
 
#
# acpiexec source
#
aeexec.o : $(ACPICA_TOOLS)/acpiexec/aeexec.c
$(COMPILE)
 
aehandlers.o : $(ACPICA_TOOLS)/acpiexec/aehandlers.c
$(COMPILE)
 
aemain.o : $(ACPICA_TOOLS)/acpiexec/aemain.c
$(COMPILE)
 
aetables.o : $(ACPICA_TOOLS)/acpiexec/aetables.c
$(COMPILE)
 
#
# ACPICA core source - common
#
getopt.o : $(ACPICA_COMMON)/getopt.c
$(COMPILE)
 
#
# ACPICA core source
#
dbcmds.o : $(ACPICA_CORE)/debugger/dbcmds.c
$(COMPILE)
 
dbdisply.o : $(ACPICA_CORE)/debugger/dbdisply.c
$(COMPILE)
 
dbexec.o : $(ACPICA_CORE)/debugger/dbexec.c
$(COMPILE)
 
dbfileio.o : $(ACPICA_CORE)/debugger/dbfileio.c
$(COMPILE)
 
dbhistry.o : $(ACPICA_CORE)/debugger/dbhistry.c
$(COMPILE)
 
dbinput.o : $(ACPICA_CORE)/debugger/dbinput.c
$(COMPILE)
 
dbmethod.o : $(ACPICA_CORE)/debugger/dbmethod.c
$(COMPILE)
 
dbnames.o : $(ACPICA_CORE)/debugger/dbnames.c
$(COMPILE)
 
dbstats.o : $(ACPICA_CORE)/debugger/dbstats.c
$(COMPILE)
 
dbutils.o : $(ACPICA_CORE)/debugger/dbutils.c
$(COMPILE)
 
dbxface.o : $(ACPICA_CORE)/debugger/dbxface.c
$(COMPILE)
 
dmbuffer.o : $(ACPICA_CORE)/disassembler/dmbuffer.c
$(COMPILE)
 
dmnames.o : $(ACPICA_CORE)/disassembler/dmnames.c
$(COMPILE)
 
dmobject.o : $(ACPICA_CORE)/disassembler/dmobject.c
$(COMPILE)
 
dmopcode.o : $(ACPICA_CORE)/disassembler/dmopcode.c
$(COMPILE)
 
dmresrc.o : $(ACPICA_CORE)/disassembler/dmresrc.c
$(COMPILE)
 
dmresrcl.o : $(ACPICA_CORE)/disassembler/dmresrcl.c
$(COMPILE)
 
dmresrcs.o : $(ACPICA_CORE)/disassembler/dmresrcs.c
$(COMPILE)
 
dmutils.o : $(ACPICA_CORE)/disassembler/dmutils.c
$(COMPILE)
 
dmwalk.o : $(ACPICA_CORE)/disassembler/dmwalk.c
$(COMPILE)
 
dsargs.o : $(ACPICA_CORE)/dispatcher/dsargs.c
$(COMPILE)
 
dscontrol.o : $(ACPICA_CORE)/dispatcher/dscontrol.c
$(COMPILE)
 
dsfield.o : $(ACPICA_CORE)/dispatcher/dsfield.c
$(COMPILE)
 
dsinit.o : $(ACPICA_CORE)/dispatcher/dsinit.c
$(COMPILE)
 
dsmethod.o : $(ACPICA_CORE)/dispatcher/dsmethod.c
$(COMPILE)
 
dsmthdat.o : $(ACPICA_CORE)/dispatcher/dsmthdat.c
$(COMPILE)
 
dsobject.o : $(ACPICA_CORE)/dispatcher/dsobject.c
$(COMPILE)
 
dsopcode.o : $(ACPICA_CORE)/dispatcher/dsopcode.c
$(COMPILE)
 
dsutils.o : $(ACPICA_CORE)/dispatcher/dsutils.c
$(COMPILE)
 
dswexec.o : $(ACPICA_CORE)/dispatcher/dswexec.c
$(COMPILE)
 
dswload.o : $(ACPICA_CORE)/dispatcher/dswload.c
$(COMPILE)
 
dswload2.o : $(ACPICA_CORE)/dispatcher/dswload2.c
$(COMPILE)
 
dswscope.o : $(ACPICA_CORE)/dispatcher/dswscope.c
$(COMPILE)
 
dswstate.o : $(ACPICA_CORE)/dispatcher/dswstate.c
$(COMPILE)
 
evevent.o : $(ACPICA_CORE)/events/evevent.c
$(COMPILE)
 
evglock.o : $(ACPICA_CORE)/events/evglock.c
$(COMPILE)
 
evgpe.o : $(ACPICA_CORE)/events/evgpe.c
$(COMPILE)
 
evgpeblk.o : $(ACPICA_CORE)/events/evgpeblk.c
$(COMPILE)
 
evgpeinit.o : $(ACPICA_CORE)/events/evgpeinit.c
$(COMPILE)
 
evgpeutil.o : $(ACPICA_CORE)/events/evgpeutil.c
$(COMPILE)
 
evmisc.o : $(ACPICA_CORE)/events/evmisc.c
$(COMPILE)
 
evregion.o : $(ACPICA_CORE)/events/evregion.c
$(COMPILE)
 
evrgnini.o : $(ACPICA_CORE)/events/evrgnini.c
$(COMPILE)
 
evsci.o : $(ACPICA_CORE)/events/evsci.c
$(COMPILE)
 
evxface.o : $(ACPICA_CORE)/events/evxface.c
$(COMPILE)
 
evxfevnt.o : $(ACPICA_CORE)/events/evxfevnt.c
$(COMPILE)
 
evxfgpe.o : $(ACPICA_CORE)/events/evxfgpe.c
$(COMPILE)
 
evxfregn.o : $(ACPICA_CORE)/events/evxfregn.c
$(COMPILE)
 
exconfig.o : $(ACPICA_CORE)/executer/exconfig.c
$(COMPILE)
 
exconvrt.o : $(ACPICA_CORE)/executer/exconvrt.c
$(COMPILE)
 
excreate.o : $(ACPICA_CORE)/executer/excreate.c
$(COMPILE)
 
exdebug.o : $(ACPICA_CORE)/executer/exdebug.c
$(COMPILE)
 
exdump.o : $(ACPICA_CORE)/executer/exdump.c
$(COMPILE)
 
exfield.o : $(ACPICA_CORE)/executer/exfield.c
$(COMPILE)
 
exfldio.o : $(ACPICA_CORE)/executer/exfldio.c
$(COMPILE)
 
exmisc.o : $(ACPICA_CORE)/executer/exmisc.c
$(COMPILE)
 
exmutex.o : $(ACPICA_CORE)/executer/exmutex.c
$(COMPILE)
 
exnames.o : $(ACPICA_CORE)/executer/exnames.c
$(COMPILE)
 
exoparg1.o : $(ACPICA_CORE)/executer/exoparg1.c
$(COMPILE)
 
exoparg2.o : $(ACPICA_CORE)/executer/exoparg2.c
$(COMPILE)
 
exoparg3.o : $(ACPICA_CORE)/executer/exoparg3.c
$(COMPILE)
 
exoparg6.o : $(ACPICA_CORE)/executer/exoparg6.c
$(COMPILE)
 
exprep.o : $(ACPICA_CORE)/executer/exprep.c
$(COMPILE)
 
exregion.o : $(ACPICA_CORE)/executer/exregion.c
$(COMPILE)
 
exresnte.o : $(ACPICA_CORE)/executer/exresnte.c
$(COMPILE)
 
exresolv.o : $(ACPICA_CORE)/executer/exresolv.c
$(COMPILE)
 
exresop.o : $(ACPICA_CORE)/executer/exresop.c
$(COMPILE)
 
exstore.o : $(ACPICA_CORE)/executer/exstore.c
$(COMPILE)
 
exstoren.o : $(ACPICA_CORE)/executer/exstoren.c
$(COMPILE)
 
exstorob.o : $(ACPICA_CORE)/executer/exstorob.c
$(COMPILE)
 
exsystem.o : $(ACPICA_CORE)/executer/exsystem.c
$(COMPILE)
 
exutils.o : $(ACPICA_CORE)/executer/exutils.c
$(COMPILE)
 
hwacpi.o : $(ACPICA_CORE)/hardware/hwacpi.c
$(COMPILE)
 
hwgpe.o : $(ACPICA_CORE)/hardware/hwgpe.c
$(COMPILE)
 
hwpci.o : $(ACPICA_CORE)/hardware/hwpci.c
$(COMPILE)
 
hwregs.o : $(ACPICA_CORE)/hardware/hwregs.c
$(COMPILE)
 
hwsleep.o : $(ACPICA_CORE)/hardware/hwsleep.c
$(COMPILE)
 
hwvalid.o : $(ACPICA_CORE)/hardware/hwvalid.c
$(COMPILE)
 
hwxface.o : $(ACPICA_CORE)/hardware/hwxface.c
$(COMPILE)
 
nsaccess.o : $(ACPICA_CORE)/namespace/nsaccess.c
$(COMPILE)
 
nsalloc.o : $(ACPICA_CORE)/namespace/nsalloc.c
$(COMPILE)
 
nsdump.o : $(ACPICA_CORE)/namespace/nsdump.c
$(COMPILE)
 
nsdumpdv.o : $(ACPICA_CORE)/namespace/nsdumpdv.c
$(COMPILE)
 
nseval.o : $(ACPICA_CORE)/namespace/nseval.c
$(COMPILE)
 
nsinit.o : $(ACPICA_CORE)/namespace/nsinit.c
$(COMPILE)
 
nsload.o : $(ACPICA_CORE)/namespace/nsload.c
$(COMPILE)
 
nsnames.o : $(ACPICA_CORE)/namespace/nsnames.c
$(COMPILE)
 
nsobject.o : $(ACPICA_CORE)/namespace/nsobject.c
$(COMPILE)
 
nsparse.o : $(ACPICA_CORE)/namespace/nsparse.c
$(COMPILE)
 
nspredef.o : $(ACPICA_CORE)/namespace/nspredef.c
$(COMPILE)
 
nsrepair.o : $(ACPICA_CORE)/namespace/nsrepair.c
$(COMPILE)
 
nsrepair2.o : $(ACPICA_CORE)/namespace/nsrepair2.c
$(COMPILE)
 
nssearch.o : $(ACPICA_CORE)/namespace/nssearch.c
$(COMPILE)
 
nsutils.o : $(ACPICA_CORE)/namespace/nsutils.c
$(COMPILE)
 
nswalk.o : $(ACPICA_CORE)/namespace/nswalk.c
$(COMPILE)
 
nsxfeval.o : $(ACPICA_CORE)/namespace/nsxfeval.c
$(COMPILE)
 
nsxfname.o : $(ACPICA_CORE)/namespace/nsxfname.c
$(COMPILE)
 
nsxfobj.o : $(ACPICA_CORE)/namespace/nsxfobj.c
$(COMPILE)
 
psargs.o : $(ACPICA_CORE)/parser/psargs.c
$(COMPILE)
 
psloop.o : $(ACPICA_CORE)/parser/psloop.c
$(COMPILE)
 
psopcode.o : $(ACPICA_CORE)/parser/psopcode.c
$(COMPILE)
 
psparse.o : $(ACPICA_CORE)/parser/psparse.c
$(COMPILE)
 
psscope.o : $(ACPICA_CORE)/parser/psscope.c
$(COMPILE)
 
pstree.o : $(ACPICA_CORE)/parser/pstree.c
$(COMPILE)
 
psutils.o : $(ACPICA_CORE)/parser/psutils.c
$(COMPILE)
 
pswalk.o : $(ACPICA_CORE)/parser/pswalk.c
$(COMPILE)
 
psxface.o : $(ACPICA_CORE)/parser/psxface.c
$(COMPILE)
 
rsaddr.o : $(ACPICA_CORE)/resources/rsaddr.c
$(COMPILE)
 
rscalc.o : $(ACPICA_CORE)/resources/rscalc.c
$(COMPILE)
 
rscreate.o : $(ACPICA_CORE)/resources/rscreate.c
$(COMPILE)
 
rsdump.o : $(ACPICA_CORE)/resources/rsdump.c
$(COMPILE)
 
rsio.o : $(ACPICA_CORE)/resources/rsio.c
$(COMPILE)
 
rsinfo.o : $(ACPICA_CORE)/resources/rsinfo.c
$(COMPILE)
 
rsirq.o : $(ACPICA_CORE)/resources/rsirq.c
$(COMPILE)
 
rslist.o : $(ACPICA_CORE)/resources/rslist.c
$(COMPILE)
 
rsmemory.o : $(ACPICA_CORE)/resources/rsmemory.c
$(COMPILE)
 
rsmisc.o : $(ACPICA_CORE)/resources/rsmisc.c
$(COMPILE)
 
rsutils.o : $(ACPICA_CORE)/resources/rsutils.c
$(COMPILE)
 
rsxface.o : $(ACPICA_CORE)/resources/rsxface.c
$(COMPILE)
 
tbfadt.o : $(ACPICA_CORE)/tables/tbfadt.c
$(COMPILE)
 
tbfind.o : $(ACPICA_CORE)/tables/tbfind.c
$(COMPILE)
 
tbinstal.o : $(ACPICA_CORE)/tables/tbinstal.c
$(COMPILE)
 
tbutils.o : $(ACPICA_CORE)/tables/tbutils.c
$(COMPILE)
 
tbxface.o : $(ACPICA_CORE)/tables/tbxface.c
$(COMPILE)
 
tbxfroot.o : $(ACPICA_CORE)/tables/tbxfroot.c
$(COMPILE)
 
utalloc.o : $(ACPICA_CORE)/utilities/utalloc.c
$(COMPILE)
 
utcache.o : $(ACPICA_CORE)/utilities/utcache.c
$(COMPILE)
 
utcopy.o : $(ACPICA_CORE)/utilities/utcopy.c
$(COMPILE)
 
utdebug.o : $(ACPICA_CORE)/utilities/utdebug.c
$(COMPILE)
 
utdecode.o : $(ACPICA_CORE)/utilities/utdecode.c
$(COMPILE)
 
utdelete.o : $(ACPICA_CORE)/utilities/utdelete.c
$(COMPILE)
 
uteval.o : $(ACPICA_CORE)/utilities/uteval.c
$(COMPILE)
 
utglobal.o : $(ACPICA_CORE)/utilities/utglobal.c
$(COMPILE)
 
utids.o : $(ACPICA_CORE)/utilities/utids.c
$(COMPILE)
 
utinit.o : $(ACPICA_CORE)/utilities/utinit.c
$(COMPILE)
 
utlock.o : $(ACPICA_CORE)/utilities/utlock.c
$(COMPILE)
 
utmath.o : $(ACPICA_CORE)/utilities/utmath.c
$(COMPILE)
 
utmisc.o : $(ACPICA_CORE)/utilities/utmisc.c
$(COMPILE)
 
utmutex.o : $(ACPICA_CORE)/utilities/utmutex.c
$(COMPILE)
 
utobject.o : $(ACPICA_CORE)/utilities/utobject.c
$(COMPILE)
 
utresrc.o : $(ACPICA_CORE)/utilities/utresrc.c
$(COMPILE)
 
utstate.o : $(ACPICA_CORE)/utilities/utstate.c
$(COMPILE)
 
uttrack.o : $(ACPICA_CORE)/utilities/uttrack.c
$(COMPILE)
 
utosi.o : $(ACPICA_CORE)/utilities/utosi.c
$(COMPILE)
 
utxferror.o : $(ACPICA_CORE)/utilities/utxferror.c
$(COMPILE)
 
utxface.o : $(ACPICA_CORE)/utilities/utxface.c
$(COMPILE)
 
#
# Unix OS services layer (OSL)
#
osunixxf.o : $(ACPICA_OSL)/osunixxf.c
$(COMPILE)
 
 
clean :
rm -f $(CLEANFILES) $(patsubst %.c,%.o, $(SRCS))
rm -f $(PROG) $(PROG).exe $(OBJS)
 
install :
$(INSTALLPROG)
/drivers/devman/acpica/tools/acpiexec/aecommon.h
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
120,11 → 120,6
#pragma warning(disable:4100) /* warning C4100: unreferenced formal parameter */
#endif
 
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <signal.h>
 
#include "acpi.h"
#include "accommon.h"
#include "acparser.h"
135,11 → 130,28
#include "acinterp.h"
#include "acapps.h"
 
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <signal.h>
 
extern FILE *AcpiGbl_DebugFile;
extern BOOLEAN AcpiGbl_IgnoreErrors;
extern UINT8 AcpiGbl_RegionFillValue;
 
/* Check for unexpected exceptions */
 
#define AE_CHECK_STATUS(Name, Status, Expected) \
if (Status != Expected) \
{ \
AcpiOsPrintf ("Unexpected %s from %s (%s-%d)\n", \
AcpiFormatException (Status), #Name, _AcpiModuleName, __LINE__); \
}
 
/* Check for unexpected non-AE_OK errors */
 
#define AE_CHECK_OK(Name, Status) AE_CHECK_STATUS (Name, Status, AE_OK);
 
typedef struct ae_table_desc
{
ACPI_TABLE_HEADER *Table;
173,7 → 185,7
#define OSD_PRINT(lvl,fp) TEST_OUTPUT_LEVEL(lvl) {\
AcpiOsPrintf PARAM_LIST(fp);}
 
void __cdecl
void ACPI_SYSTEM_XFACE
AeCtrlCHandler (
int Sig);
 
220,9 → 232,13
UINT32 DisplayCount);
 
ACPI_STATUS
AeInstallHandlers (
AeInstallEarlyHandlers (
void);
 
ACPI_STATUS
AeInstallLateHandlers (
void);
 
void
AeMiscellaneousTests (
void);
238,7 → 254,16
 
UINT32
AeGpeHandler (
ACPI_HANDLE GpeDevice,
UINT32 GpeNumber,
void *Context);
 
void
AeGlobalEventHandler (
UINT32 Type,
ACPI_HANDLE GpeDevice,
UINT32 EventNumber,
void *Context);
 
#endif /* _AECOMMON */
 
/drivers/devman/acpica/tools/acpiexec/aeexec.c
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
120,23 → 120,23
 
/* Local prototypes */
 
ACPI_STATUS
static ACPI_STATUS
AeSetupConfiguration (
void *RegionAddr);
 
void
static void
AfInstallGpeBlock (
void);
 
void
static void
AeTestBufferArgument (
void);
 
void
static void
AeTestPackageArgument (
void);
 
ACPI_STATUS
static ACPI_STATUS
AeGetDevices (
ACPI_HANDLE ObjHandle,
UINT32 NestingLevel,
143,16 → 143,16
void *Context,
void **ReturnValue);
 
ACPI_STATUS
static ACPI_STATUS
ExecuteOSI (
char *OsiString,
UINT32 ExpectedResult);
 
void
static void
AeHardwareInterfaces (
void);
 
void
static void
AeGenericRegisters (
void);
 
172,11 → 172,10
*
*****************************************************************************/
 
ACPI_STATUS
static ACPI_STATUS
AeSetupConfiguration (
void *RegionAddr)
{
ACPI_STATUS Status;
ACPI_OBJECT_LIST ArgList;
ACPI_OBJECT Arg[3];
 
190,8 → 189,7
Arg[0].Type = ACPI_TYPE_INTEGER;
Arg[0].Integer.Value = ACPI_TO_INTEGER (RegionAddr);
 
Status = AcpiEvaluateObject (NULL, "\\_CFG", &ArgList, NULL);
 
(void) AcpiEvaluateObject (NULL, "\\_CFG", &ArgList, NULL);
return (AE_OK);
}
 
209,7 → 207,7
*
*****************************************************************************/
 
void
static void
AfInstallGpeBlock (
void)
{
235,16 → 233,29
if (ACPI_SUCCESS (Status))
{
Status = AcpiInstallGpeBlock (Handle2, &BlockAddress, 7, 8);
AE_CHECK_OK (AcpiInstallGpeBlock, Status);
 
AcpiInstallGpeHandler (Handle2, 8, ACPI_GPE_LEVEL_TRIGGERED, AeGpeHandler, NULL);
AcpiEnableGpe (Handle2, 8, ACPI_GPE_TYPE_RUNTIME);
Status = AcpiInstallGpeHandler (Handle2, 8,
ACPI_GPE_LEVEL_TRIGGERED, AeGpeHandler, NULL);
AE_CHECK_OK (AcpiInstallGpeHandler, Status);
 
Status = AcpiEnableGpe (Handle2, 8);
AE_CHECK_OK (AcpiEnableGpe, Status);
 
Status = AcpiGetGpeDevice (0x30, &GpeDevice);
AE_CHECK_OK (AcpiGetGpeDevice, Status);
 
Status = AcpiGetGpeDevice (0x42, &GpeDevice);
AE_CHECK_OK (AcpiGetGpeDevice, Status);
 
Status = AcpiGetGpeDevice (AcpiCurrentGpeCount-1, &GpeDevice);
AE_CHECK_OK (AcpiGetGpeDevice, Status);
 
Status = AcpiGetGpeDevice (AcpiCurrentGpeCount, &GpeDevice);
AE_CHECK_STATUS (AcpiGetGpeDevice, Status, AE_NOT_EXIST);
 
AcpiRemoveGpeHandler (Handle2, 8, AeGpeHandler);
Status = AcpiRemoveGpeHandler (Handle2, 8, AeGpeHandler);
AE_CHECK_OK (AcpiRemoveGpeHandler, Status);
}
 
Status = AcpiGetHandle (NULL, "\\GPE3", &Handle3);
251,6 → 262,7
if (ACPI_SUCCESS (Status))
{
Status = AcpiInstallGpeBlock (Handle3, &BlockAddress, 8, 11);
AE_CHECK_OK (AcpiInstallGpeBlock, Status);
}
}
 
257,11 → 269,10
 
/* Test using a Buffer object as a method argument */
 
void
static void
AeTestBufferArgument (
void)
{
ACPI_STATUS Status;
ACPI_OBJECT_LIST Params;
ACPI_OBJECT BufArg;
UINT8 Buffer[] = {
277,27 → 288,24
Params.Count = 1;
Params.Pointer = &BufArg;
 
 
Status = AcpiEvaluateObject (NULL, "\\BUF", &Params, NULL);
(void) AcpiEvaluateObject (NULL, "\\BUF", &Params, NULL);
}
 
 
ACPI_OBJECT PkgArg;
ACPI_OBJECT PkgElements[5];
ACPI_OBJECT Pkg2Elements[5];
ACPI_OBJECT_LIST Params;
static ACPI_OBJECT PkgArg;
static ACPI_OBJECT PkgElements[5];
static ACPI_OBJECT Pkg2Elements[5];
static ACPI_OBJECT_LIST Params;
 
 
/*
* Test using a Package object as an method argument
*/
void
static void
AeTestPackageArgument (
void)
{
ACPI_STATUS Status;
 
 
/* Main package */
 
PkgArg.Type = ACPI_TYPE_PACKAGE;
335,11 → 343,11
Params.Count = 1;
Params.Pointer = &PkgArg;
 
Status = AcpiEvaluateObject (NULL, "\\_PKG", &Params, NULL);
(void) AcpiEvaluateObject (NULL, "\\_PKG", &Params, NULL);
}
 
 
ACPI_STATUS
static ACPI_STATUS
AeGetDevices (
ACPI_HANDLE ObjHandle,
UINT32 NestingLevel,
364,7 → 372,7
*
*****************************************************************************/
 
ACPI_STATUS
static ACPI_STATUS
ExecuteOSI (
char *OsiString,
UINT32 ExpectedResult)
434,9 → 442,9
*
*****************************************************************************/
 
ACPI_GENERIC_ADDRESS GenericRegister;
static ACPI_GENERIC_ADDRESS GenericRegister;
 
void
static void
AeGenericRegisters (
void)
{
450,7 → 458,10
GenericRegister.SpaceId = ACPI_ADR_SPACE_SYSTEM_IO;
 
Status = AcpiRead (&Value, &GenericRegister);
AE_CHECK_OK (AcpiRead, Status);
 
Status = AcpiWrite (Value, &GenericRegister);
AE_CHECK_OK (AcpiWrite, Status);
 
GenericRegister.Address = 0x12345678;
GenericRegister.BitOffset = 0;
457,7 → 468,10
GenericRegister.SpaceId = ACPI_ADR_SPACE_SYSTEM_MEMORY;
 
Status = AcpiRead (&Value, &GenericRegister);
AE_CHECK_OK (AcpiRead, Status);
 
Status = AcpiWrite (Value, &GenericRegister);
AE_CHECK_OK (AcpiWrite, Status);
}
 
 
469,7 → 483,7
*
*****************************************************************************/
 
void
static void
AeHardwareInterfaces (
void)
{
478,14 → 492,29
 
 
Status = AcpiWriteBitRegister (ACPI_BITREG_WAKE_STATUS, 1);
AE_CHECK_OK (AcpiWriteBitRegister, Status);
 
Status = AcpiWriteBitRegister (ACPI_BITREG_GLOBAL_LOCK_ENABLE, 1);
AE_CHECK_OK (AcpiWriteBitRegister, Status);
 
Status = AcpiWriteBitRegister (ACPI_BITREG_SLEEP_ENABLE, 1);
AE_CHECK_OK (AcpiWriteBitRegister, Status);
 
Status = AcpiWriteBitRegister (ACPI_BITREG_ARB_DISABLE, 1);
AE_CHECK_OK (AcpiWriteBitRegister, Status);
 
 
Status = AcpiReadBitRegister (ACPI_BITREG_WAKE_STATUS, &Value);
AE_CHECK_OK (AcpiReadBitRegister, Status);
 
Status = AcpiReadBitRegister (ACPI_BITREG_GLOBAL_LOCK_ENABLE, &Value);
AE_CHECK_OK (AcpiReadBitRegister, Status);
 
Status = AcpiReadBitRegister (ACPI_BITREG_SLEEP_ENABLE, &Value);
AE_CHECK_OK (AcpiReadBitRegister, Status);
 
Status = AcpiReadBitRegister (ACPI_BITREG_ARB_DISABLE, &Value);
AE_CHECK_OK (AcpiReadBitRegister, Status);
}
 
 
517,48 → 546,135
 
AeTestBufferArgument();
AeTestPackageArgument ();
ExecuteOSI ("Windows 2001", 0xFFFFFFFF);
ExecuteOSI ("MichiganTerminalSystem", 0);
 
 
Status = AcpiInstallInterface ("");
AE_CHECK_STATUS (AcpiInstallInterface, Status, AE_BAD_PARAMETER);
 
Status = AcpiInstallInterface ("TestString");
AE_CHECK_OK (AcpiInstallInterface, Status);
 
Status = AcpiInstallInterface ("TestString");
AE_CHECK_STATUS (AcpiInstallInterface, Status, AE_ALREADY_EXISTS);
 
Status = AcpiRemoveInterface ("Windows 2006");
AE_CHECK_OK (AcpiRemoveInterface, Status);
 
Status = AcpiRemoveInterface ("TestString");
AE_CHECK_OK (AcpiRemoveInterface, Status);
 
Status = AcpiRemoveInterface ("XXXXXX");
AE_CHECK_STATUS (AcpiRemoveInterface, Status, AE_NOT_EXIST);
 
Status = AcpiInstallInterface ("AnotherTestString");
AE_CHECK_OK (AcpiInstallInterface, Status);
 
 
Status = ExecuteOSI ("Windows 2001", 0xFFFFFFFF);
AE_CHECK_OK (ExecuteOSI, Status);
 
Status = ExecuteOSI ("MichiganTerminalSystem", 0);
AE_CHECK_OK (ExecuteOSI, Status);
 
 
ReturnBuf.Length = 32;
ReturnBuf.Pointer = Buffer;
 
AcpiGetName (AcpiGbl_RootNode, ACPI_FULL_PATHNAME, &ReturnBuf);
AcpiEnableEvent (ACPI_EVENT_GLOBAL, 0);
Status = AcpiGetName (AcpiGbl_RootNode, ACPI_FULL_PATHNAME, &ReturnBuf);
AE_CHECK_OK (AcpiGetName, Status);
 
Status = AcpiEnableEvent (ACPI_EVENT_GLOBAL, 0);
AE_CHECK_OK (AcpiEnableEvent, Status);
 
Status = AcpiInstallGlobalEventHandler (AeGlobalEventHandler, NULL);
AE_CHECK_OK (AcpiInstallGlobalEventHandler, Status);
 
/*
* GPEs: Handlers, enable/disable, etc.
*/
AcpiInstallGpeHandler (NULL, 0, ACPI_GPE_LEVEL_TRIGGERED, AeGpeHandler, NULL);
AcpiEnableGpe (NULL, 0, ACPI_GPE_TYPE_RUNTIME);
AcpiRemoveGpeHandler (NULL, 0, AeGpeHandler);
Status = AcpiInstallGpeHandler (NULL, 0, ACPI_GPE_LEVEL_TRIGGERED, AeGpeHandler, NULL);
AE_CHECK_OK (AcpiInstallGpeHandler, Status);
 
AcpiInstallGpeHandler (NULL, 0, ACPI_GPE_LEVEL_TRIGGERED, AeGpeHandler, NULL);
AcpiEnableGpe (NULL, 0, ACPI_GPE_TYPE_RUNTIME);
AcpiSetGpe (NULL, 0, ACPI_GPE_DISABLE);
AcpiSetGpe (NULL, 0, ACPI_GPE_ENABLE);
Status = AcpiEnableGpe (NULL, 0);
AE_CHECK_OK (AcpiEnableGpe, Status);
 
AcpiInstallGpeHandler (NULL, 1, ACPI_GPE_EDGE_TRIGGERED, AeGpeHandler, NULL);
AcpiEnableGpe (NULL, 1, ACPI_GPE_TYPE_RUNTIME);
Status = AcpiRemoveGpeHandler (NULL, 0, AeGpeHandler);
AE_CHECK_OK (AcpiRemoveGpeHandler, Status);
 
AcpiInstallGpeHandler (NULL, 2, ACPI_GPE_LEVEL_TRIGGERED, AeGpeHandler, NULL);
AcpiEnableGpe (NULL, 2, ACPI_GPE_TYPE_RUNTIME);
Status = AcpiInstallGpeHandler (NULL, 0, ACPI_GPE_LEVEL_TRIGGERED, AeGpeHandler, NULL);
AE_CHECK_OK (AcpiInstallGpeHandler, Status);
 
AcpiInstallGpeHandler (NULL, 3, ACPI_GPE_EDGE_TRIGGERED, AeGpeHandler, NULL);
AcpiInstallGpeHandler (NULL, 4, ACPI_GPE_LEVEL_TRIGGERED, AeGpeHandler, NULL);
AcpiInstallGpeHandler (NULL, 5, ACPI_GPE_EDGE_TRIGGERED, AeGpeHandler, NULL);
Status = AcpiEnableGpe (NULL, 0);
AE_CHECK_OK (AcpiEnableGpe, Status);
 
AcpiInstallGpeHandler (NULL, 0x19, ACPI_GPE_LEVEL_TRIGGERED, AeGpeHandler, NULL);
AcpiEnableGpe (NULL, 0x19, ACPI_GPE_TYPE_RUNTIME);
Status = AcpiSetGpe (NULL, 0, ACPI_GPE_DISABLE);
AE_CHECK_OK (AcpiSetGpe, Status);
 
AcpiInstallGpeHandler (NULL, 0x62, ACPI_GPE_LEVEL_TRIGGERED, AeGpeHandler, NULL);
AcpiEnableGpe (NULL, 0x62, ACPI_GPE_TYPE_RUNTIME);
AcpiDisableGpe (NULL, 0x62, ACPI_GPE_TYPE_RUNTIME);
Status = AcpiSetGpe (NULL, 0, ACPI_GPE_ENABLE);
AE_CHECK_OK (AcpiSetGpe, Status);
 
 
Status = AcpiInstallGpeHandler (NULL, 1, ACPI_GPE_EDGE_TRIGGERED, AeGpeHandler, NULL);
AE_CHECK_OK (AcpiInstallGpeHandler, Status);
 
Status = AcpiEnableGpe (NULL, 1);
AE_CHECK_OK (AcpiEnableGpe, Status);
 
 
Status = AcpiInstallGpeHandler (NULL, 2, ACPI_GPE_LEVEL_TRIGGERED, AeGpeHandler, NULL);
AE_CHECK_OK (AcpiInstallGpeHandler, Status);
 
Status = AcpiEnableGpe (NULL, 2);
AE_CHECK_OK (AcpiEnableGpe, Status);
 
 
Status = AcpiInstallGpeHandler (NULL, 3, ACPI_GPE_EDGE_TRIGGERED, AeGpeHandler, NULL);
AE_CHECK_OK (AcpiInstallGpeHandler, Status);
 
Status = AcpiInstallGpeHandler (NULL, 4, ACPI_GPE_LEVEL_TRIGGERED, AeGpeHandler, NULL);
AE_CHECK_OK (AcpiInstallGpeHandler, Status);
 
Status = AcpiInstallGpeHandler (NULL, 5, ACPI_GPE_EDGE_TRIGGERED, AeGpeHandler, NULL);
AE_CHECK_OK (AcpiInstallGpeHandler, Status);
 
Status = AcpiGetHandle (NULL, "\\_SB", &Handle);
AE_CHECK_OK (AcpiGetHandle, Status);
 
Status = AcpiSetupGpeForWake (Handle, NULL, 5);
AE_CHECK_OK (AcpiSetupGpeForWake, Status);
 
Status = AcpiSetGpeWakeMask (NULL, 5, ACPI_GPE_ENABLE);
AE_CHECK_OK (AcpiGpeWakeup, Status);
 
Status = AcpiSetupGpeForWake (Handle, NULL, 6);
AE_CHECK_OK (AcpiSetupGpeForWake, Status);
 
Status = AcpiSetupGpeForWake (Handle, NULL, 9);
AE_CHECK_OK (AcpiSetupGpeForWake, Status);
 
Status = AcpiInstallGpeHandler (NULL, 0x19, ACPI_GPE_LEVEL_TRIGGERED, AeGpeHandler, NULL);
AE_CHECK_OK (AcpiInstallGpeHandler, Status);
 
Status = AcpiEnableGpe (NULL, 0x19);
AE_CHECK_OK (AcpiEnableGpe, Status);
 
 
Status = AcpiInstallGpeHandler (NULL, 0x62, ACPI_GPE_LEVEL_TRIGGERED, AeGpeHandler, NULL);
AE_CHECK_OK (AcpiInstallGpeHandler, Status);
 
Status = AcpiEnableGpe (NULL, 0x62);
AE_CHECK_OK (AcpiEnableGpe, Status);
 
Status = AcpiDisableGpe (NULL, 0x62);
AE_CHECK_OK (AcpiDisableGpe, Status);
 
AfInstallGpeBlock ();
 
/* Here is where the GPEs are actually "enabled" */
 
Status = AcpiUpdateAllGpes ();
AE_CHECK_OK (AcpiUpdateAllGpes, Status);
 
Status = AcpiGetHandle (NULL, "RSRC", &Handle);
if (ACPI_SUCCESS (Status))
{
574,41 → 690,23
/* Test global lock */
 
Status = AcpiAcquireGlobalLock (0xFFFF, &LockHandle1);
if (ACPI_FAILURE (Status))
{
AcpiOsPrintf ("Could not get GlobalLock, %X\n", Status);
}
AE_CHECK_OK (AcpiAcquireGlobalLock, Status);
 
Status = AcpiAcquireGlobalLock (0x5, &LockHandle2);
if (ACPI_FAILURE (Status))
{
AcpiOsPrintf ("Could not get GlobalLock, %X\n", Status);
}
AE_CHECK_OK (AcpiAcquireGlobalLock, Status);
 
Status = AcpiReleaseGlobalLock (LockHandle1);
if (ACPI_FAILURE (Status))
{
AcpiOsPrintf ("Could not release GlobalLock, %X\n", Status);
}
AE_CHECK_OK (AcpiReleaseGlobalLock, Status);
 
Status = AcpiReleaseGlobalLock (LockHandle2);
if (ACPI_FAILURE (Status))
{
AcpiOsPrintf ("Could not release GlobalLock, %X\n", Status);
}
AE_CHECK_OK (AcpiReleaseGlobalLock, Status);
 
/* Get Devices */
 
Status = AcpiGetDevices (NULL, AeGetDevices, NULL, NULL);
if (ACPI_FAILURE (Status))
{
AcpiOsPrintf ("Could not AcpiGetDevices, %X\n", Status);
}
AE_CHECK_OK (AcpiGetDevices, Status);
 
Status = AcpiGetStatistics (&Stats);
if (ACPI_FAILURE (Status))
{
AcpiOsPrintf ("Could not AcpiGetStatistics, %X\n", Status);
AE_CHECK_OK (AcpiGetStatistics, Status);
}
}
 
/drivers/devman/acpica/tools/acpiexec/aehandlers.c
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
120,19 → 120,19
 
/* Local prototypes */
 
void
static void
AeNotifyHandler (
ACPI_HANDLE Device,
UINT32 Value,
void *Context);
 
void
static void
AeDeviceNotifyHandler (
ACPI_HANDLE Device,
UINT32 Value,
void *Context);
 
ACPI_STATUS
static ACPI_STATUS
AeExceptionHandler (
ACPI_STATUS AmlStatus,
ACPI_NAME Name,
140,13 → 140,13
UINT32 AmlOffset,
void *Context);
 
ACPI_STATUS
static ACPI_STATUS
AeTableHandler (
UINT32 Event,
void *Table,
void *Context);
 
ACPI_STATUS
static ACPI_STATUS
AeRegionInit (
ACPI_HANDLE RegionHandle,
UINT32 Function,
153,15 → 153,54
void *HandlerContext,
void **RegionContext);
 
void
static void
AeAttachedDataHandler (
ACPI_HANDLE Object,
void *Data);
 
UINT32 SigintCount = 0;
AE_DEBUG_REGIONS AeRegions;
static UINT32
AeInterfaceHandler (
ACPI_STRING InterfaceName,
UINT32 Supported);
 
static UINT32
AeEventHandler (
void *Context);
 
static UINT32 SigintCount = 0;
static AE_DEBUG_REGIONS AeRegions;
 
 
/*
* We will override some of the default region handlers, especially the
* SystemMemory handler, which must be implemented locally. Do not override
* the PCI_Config handler since we would like to exercise the default handler
* code. These handlers are installed "early" - before any _REG methods
* are executed - since they are special in the sense that tha ACPI spec
* declares that they must "always be available". Cannot override the
* DataTable region handler either -- needed for test execution.
*/
static ACPI_ADR_SPACE_TYPE DefaultSpaceIdList[] = {
ACPI_ADR_SPACE_SYSTEM_MEMORY,
ACPI_ADR_SPACE_SYSTEM_IO
};
 
/*
* We will install handlers for some of the various address space IDs
* Test one user-defined address space (used by aslts.)
*/
#define ACPI_ADR_SPACE_USER_DEFINED 0x80
 
static ACPI_ADR_SPACE_TYPE SpaceIdList[] = {
ACPI_ADR_SPACE_EC,
ACPI_ADR_SPACE_SMBUS,
ACPI_ADR_SPACE_PCI_BAR_TARGET,
ACPI_ADR_SPACE_IPMI,
ACPI_ADR_SPACE_FIXED_HARDWARE,
ACPI_ADR_SPACE_USER_DEFINED
};
 
 
/******************************************************************************
*
* FUNCTION: AeCtrlCHandler
174,7 → 213,7
*
*****************************************************************************/
 
void __cdecl
void ACPI_SYSTEM_XFACE
AeCtrlCHandler (
int Sig)
{
213,7 → 252,7
*
*****************************************************************************/
 
void
static void
AeNotifyHandler (
ACPI_HANDLE Device,
UINT32 Value,
263,7 → 302,6
(void) AcpiEvaluateObject (Device, "_NOT", NULL, NULL);
break;
}
 
}
 
 
281,7 → 319,7
*
*****************************************************************************/
 
void
static void
AeDeviceNotifyHandler (
ACPI_HANDLE Device,
UINT32 Value,
312,7 → 350,7
*
*****************************************************************************/
 
ACPI_STATUS
static ACPI_STATUS
AeExceptionHandler (
ACPI_STATUS AmlStatus,
ACPI_NAME Name,
356,7 → 394,7
Arg[1].String.Length = ACPI_STRLEN (Exception);
 
Arg[2].Type = ACPI_TYPE_INTEGER;
Arg[2].Integer.Value = ACPI_TO_INTEGER (AcpiOsGetThreadId());
Arg[2].Integer.Value = AcpiOsGetThreadId();
 
/* Setup return buffer */
 
411,7 → 449,7
*
*****************************************************************************/
 
char *TableEvents[] =
static char *TableEvents[] =
{
"LOAD",
"UNLOAD",
418,20 → 456,25
"UNKNOWN"
};
 
ACPI_STATUS
static ACPI_STATUS
AeTableHandler (
UINT32 Event,
void *Table,
void *Context)
{
ACPI_STATUS Status;
 
 
if (Event > ACPI_NUM_TABLE_EVENTS)
{
Event = ACPI_NUM_TABLE_EVENTS;
}
 
/* TBD: could dump entire table header, need a header dump routine */
/* Enable any GPEs associated with newly-loaded GPE methods */
 
Status = AcpiUpdateAllGpes ();
AE_CHECK_OK (AcpiUpdateAllGpes, Status);
 
printf ("[AcpiExec] Table Event %s, [%4.4s] %p\n",
TableEvents[Event], ((ACPI_TABLE_HEADER *) Table)->Signature, Table);
return (AE_OK);
442,21 → 485,66
*
* FUNCTION: AeGpeHandler
*
* DESCRIPTION: GPE handler for acpiexec
* DESCRIPTION: Common GPE handler for acpiexec
*
*****************************************************************************/
 
UINT32
AeGpeHandler (
ACPI_HANDLE GpeDevice,
UINT32 GpeNumber,
void *Context)
{
AcpiOsPrintf ("Received a GPE at handler\n");
return (0);
ACPI_NAMESPACE_NODE *DeviceNode = (ACPI_NAMESPACE_NODE *) GpeDevice;
 
 
AcpiOsPrintf ("[AcpiExec] GPE Handler received GPE%02X (GPE block %4.4s)\n",
GpeNumber, GpeDevice ? DeviceNode->Name.Ascii : "FADT");
 
return (ACPI_REENABLE_GPE);
}
 
 
/******************************************************************************
*
* FUNCTION: AeGlobalEventHandler
*
* DESCRIPTION: Global GPE/Fixed event handler
*
*****************************************************************************/
 
void
AeGlobalEventHandler (
UINT32 Type,
ACPI_HANDLE Device,
UINT32 EventNumber,
void *Context)
{
char *TypeName;
 
 
switch (Type)
{
case ACPI_EVENT_TYPE_GPE:
TypeName = "GPE";
break;
 
case ACPI_EVENT_TYPE_FIXED:
TypeName = "FixedEvent";
break;
 
default:
TypeName = "UNKNOWN";
break;
}
 
AcpiOsPrintf ("[AcpiExec] Global Event Handler received: Type %s Number %.2X Dev %p\n",
TypeName, EventNumber, Device);
}
 
 
/******************************************************************************
*
* FUNCTION: AeAttachedDataHandler
*
* DESCRIPTION: Handler for deletion of nodes with attached data (attached via
464,7 → 552,7
*
*****************************************************************************/
 
void
static void
AeAttachedDataHandler (
ACPI_HANDLE Object,
void *Data)
479,6 → 567,46
 
/******************************************************************************
*
* FUNCTION: AeInterfaceHandler
*
* DESCRIPTION: Handler for _OSI invocations
*
*****************************************************************************/
 
static UINT32
AeInterfaceHandler (
ACPI_STRING InterfaceName,
UINT32 Supported)
{
ACPI_FUNCTION_NAME (AeInterfaceHandler);
 
 
ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
"Received _OSI (\"%s\"), is %ssupported\n",
InterfaceName, Supported == 0 ? "not " : ""));
 
return (Supported);
}
 
 
/******************************************************************************
*
* FUNCTION: AeEventHandler
*
* DESCRIPTION: Handler for Fixed Events
*
*****************************************************************************/
 
static UINT32
AeEventHandler (
void *Context)
{
return (0);
}
 
 
/******************************************************************************
*
* FUNCTION: AeRegionInit
*
* PARAMETERS: None
489,7 → 617,7
*
*****************************************************************************/
 
ACPI_STATUS
static ACPI_STATUS
AeRegionInit (
ACPI_HANDLE RegionHandle,
UINT32 Function,
501,13 → 629,13
*/
*RegionContext = RegionHandle;
 
return AE_OK;
return (AE_OK);
}
 
 
/******************************************************************************
*
* FUNCTION: AeInstallHandlers
* FUNCTION: AeInstallLateHandlers
*
* PARAMETERS: None
*
517,11 → 645,63
*
*****************************************************************************/
 
ACPI_ADR_SPACE_TYPE SpaceId[] = {0, 1, 2, 3, 4, 5, 6, 7, 0x80};
#define AEXEC_NUM_REGIONS 9
ACPI_STATUS
AeInstallLateHandlers (
void)
{
ACPI_STATUS Status;
UINT32 i;
 
 
/* Install some fixed event handlers */
 
Status = AcpiInstallFixedEventHandler (ACPI_EVENT_GLOBAL, AeEventHandler, NULL);
AE_CHECK_OK (AcpiInstallFixedEventHandler, Status);
 
Status = AcpiInstallFixedEventHandler (ACPI_EVENT_RTC, AeEventHandler, NULL);
AE_CHECK_OK (AcpiInstallFixedEventHandler, Status);
 
/*
* Install handlers for some of the "device driver" address spaces
* such as EC, SMBus, etc.
*/
for (i = 0; i < ACPI_ARRAY_LENGTH (SpaceIdList); i++)
{
/* Install handler at the root object */
 
Status = AcpiInstallAddressSpaceHandler (AcpiGbl_RootNode,
SpaceIdList[i], AeRegionHandler, AeRegionInit, NULL);
if (ACPI_FAILURE (Status))
{
ACPI_EXCEPTION ((AE_INFO, Status,
"Could not install an OpRegion handler for %s space(%u)",
AcpiUtGetRegionName((UINT8) SpaceIdList[i]), SpaceIdList[i]));
return (Status);
}
}
 
return (AE_OK);
}
 
 
/******************************************************************************
*
* FUNCTION: AeInstallEarlyHandlers
*
* PARAMETERS: None
*
* RETURN: Status
*
* DESCRIPTION: Install handlers for the AcpiExec utility.
*
* Notes: Don't install handler for PCI_Config, we want to use the
* default handler to exercise that code.
*
*****************************************************************************/
 
ACPI_STATUS
AeInstallHandlers (void)
AeInstallEarlyHandlers (
void)
{
ACPI_STATUS Status;
UINT32 i;
531,6 → 711,13
ACPI_FUNCTION_ENTRY ();
 
 
Status = AcpiInstallInterfaceHandler (AeInterfaceHandler);
if (ACPI_FAILURE (Status))
{
printf ("Could not install interface handler, %s\n",
AcpiFormatException (Status));
}
 
Status = AcpiInstallTableHandler (AeTableHandler, NULL);
if (ACPI_FAILURE (Status))
{
584,8 → 771,12
 
Status = AcpiInstallNotifyHandler (Handle, ACPI_ALL_NOTIFY,
AeNotifyHandler, NULL);
AE_CHECK_OK (AcpiInstallNotifyHandler, Status);
 
Status = AcpiRemoveNotifyHandler (Handle, ACPI_ALL_NOTIFY,
AeNotifyHandler);
AE_CHECK_OK (AcpiRemoveNotifyHandler, Status);
 
Status = AcpiInstallNotifyHandler (Handle, ACPI_ALL_NOTIFY,
AeNotifyHandler, NULL);
if (ACPI_FAILURE (Status))
595,8 → 786,13
}
 
Status = AcpiAttachData (Handle, AeAttachedDataHandler, Handle);
AE_CHECK_OK (AcpiAttachData, Status);
 
Status = AcpiDetachData (Handle, AeAttachedDataHandler);
AE_CHECK_OK (AcpiDetachData, Status);
 
Status = AcpiAttachData (Handle, AeAttachedDataHandler, Handle);
AE_CHECK_OK (AcpiAttachData, Status);
}
else
{
603,23 → 799,24
printf ("No _SB_ found, %s\n", AcpiFormatException (Status));
}
 
/* Set a handler for all supported operation regions */
 
for (i = 0; i < AEXEC_NUM_REGIONS; i++)
/*
* Install handlers that will override the default handlers for some of
* the space IDs.
*/
for (i = 0; i < ACPI_ARRAY_LENGTH (DefaultSpaceIdList); i++)
{
Status = AcpiRemoveAddressSpaceHandler (AcpiGbl_RootNode,
SpaceId[i], AeRegionHandler);
/* Install handler at the root object */
 
/* Install handler at the root object.
* TBD: all default handlers should be installed here!
*/
Status = AcpiInstallAddressSpaceHandler (AcpiGbl_RootNode,
SpaceId[i], AeRegionHandler, AeRegionInit, NULL);
DefaultSpaceIdList[i], AeRegionHandler,
AeRegionInit, NULL);
if (ACPI_FAILURE (Status))
{
ACPI_EXCEPTION ((AE_INFO, Status,
"Could not install an OpRegion handler for %s space(%u)",
AcpiUtGetRegionName((UINT8) SpaceId[i]), SpaceId[i]));
"Could not install a default OpRegion handler for %s space(%u)",
AcpiUtGetRegionName ((UINT8) DefaultSpaceIdList[i]),
DefaultSpaceIdList[i]));
return (Status);
}
}
630,8 → 827,7
*/
AeRegions.NumberOfRegions = 0;
AeRegions.RegionList = NULL;
 
return Status;
return (Status);
}
 
 
678,7 → 874,7
*/
if (RegionObject->Region.Type != ACPI_TYPE_REGION)
{
return AE_OK;
return (AE_OK);
}
 
/*
720,10 → 916,12
{
case ACPI_READ:
Status = AcpiHwReadPort (Address, (UINT32 *) Value, BitWidth);
AE_CHECK_OK (AcpiHwReadPort, Status);
break;
 
case ACPI_WRITE:
Status = AcpiHwWritePort (Address, (UINT32) *Value, BitWidth);
AE_CHECK_OK (AcpiHwWritePort, Status);
break;
 
default:
867,7 → 1065,7
RegionElement = AcpiOsAllocate (sizeof (AE_REGION));
if (!RegionElement)
{
return AE_NO_MEMORY;
return (AE_NO_MEMORY);
}
 
RegionElement->Buffer = AcpiOsAllocate (Length);
874,7 → 1072,7
if (!RegionElement->Buffer)
{
AcpiOsFree (RegionElement);
return AE_NO_MEMORY;
return (AE_NO_MEMORY);
}
 
/* Initialize the region with the default fill value */
927,7 → 1125,7
ByteWidth, (UINT32)(RegionElement->Address),
RegionElement->Length));
 
return AE_AML_REGION_LIMIT;
return (AE_AML_REGION_LIMIT);
}
 
/*
958,9 → 1156,10
break;
 
default:
return AE_BAD_PARAMETER;
return (AE_BAD_PARAMETER);
}
return AE_OK;
 
return (AE_OK);
}
 
 
/drivers/devman/acpica/tools/acpiexec/aemain.c
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,17 → 122,18
#define _COMPONENT PARSER
ACPI_MODULE_NAME ("aemain")
 
UINT8 AcpiGbl_BatchMode = 0;
 
UINT8 AcpiGbl_RegionFillValue = 0;
BOOLEAN AcpiGbl_IgnoreErrors = FALSE;
BOOLEAN AcpiGbl_DbOpt_NoRegionSupport = FALSE;
BOOLEAN AcpiGbl_DebugTimeout = FALSE;
char BatchBuffer[128];
AE_TABLE_DESC *AeTableListHead = NULL;
 
static UINT8 AcpiGbl_BatchMode = 0;
static char BatchBuffer[128];
static AE_TABLE_DESC *AeTableListHead = NULL;
 
#define ASL_MAX_FILES 256
char *FileList[ASL_MAX_FILES];
int FileCount;
static char *FileList[ASL_MAX_FILES];
 
 
#define AE_SUPPORTED_OPTIONS "?b:d:e:f:gm^ovx:"
164,6 → 165,7
printf (" -da Disable method abort on error\n");
printf (" -di Disable execution of STA/INI methods during init\n");
printf (" -do Disable Operation Region address simulation\n");
printf (" -dr Disable repair of method return values\n");
printf (" -dt Disable allocation tracking (performance)\n");
printf ("\n");
 
203,6 → 205,7
char *Cmd = Ptr;
UINT8 Run = 0;
 
 
AcpiGbl_MethodExecuting = FALSE;
AcpiGbl_StepToNextCall = FALSE;
 
360,6 → 363,7
#ifdef WIN32
void *DirInfo;
char *Filename;
int FileCount;
 
 
FileCount = 0;
441,7 → 445,7
ACPI_TABLE_HEADER *Table = NULL;
UINT32 TableCount;
AE_TABLE_DESC *TableDesc;
char **FileList;
char **WildcardList;
char *Filename;
char *Directory;
char *FullPathname;
452,14 → 456,12
_CrtSetDbgFlag(_CRTDBG_REPORT_FLAG));
#endif
 
printf ("\nIntel ACPI Component Architecture\nAML Execution/Debug Utility");
printf (" version %8.8X", ((UINT32) ACPI_CA_VERSION));
printf (" [%s]\n\n", __DATE__);
printf (ACPI_COMMON_SIGNON ("AML Execution/Debug Utility"));
 
if (argc < 2)
{
usage ();
return 0;
return (0);
}
 
signal (SIGINT, AeCtrlCHandler);
471,7 → 473,8
 
/* Init ACPI and start debugger thread */
 
AcpiInitializeSubsystem ();
Status = AcpiInitializeSubsystem ();
AE_CHECK_OK (AcpiInitializeSubsystem, Status);
 
/* Get the command line options */
 
482,7 → 485,7
{
printf ("**** The length of command line (%u) exceeded maximum (127)\n",
(UINT32) strlen (AcpiGbl_Optarg));
return -1;
return (-1);
}
AcpiGbl_BatchMode = 1;
strcpy (BatchBuffer, AcpiGbl_Optarg);
503,6 → 506,10
AcpiGbl_DbOpt_NoRegionSupport = TRUE;
break;
 
case 'r':
AcpiGbl_DisableAutoRepair = TRUE;
break;
 
case 't':
#ifdef ACPI_DBG_TRACK_ALLOCATIONS
AcpiGbl_DisableMemTracking = TRUE;
586,7 → 593,7
case 'h':
default:
usage();
return -1;
return (-1);
}
 
 
617,21 → 624,21
 
/* Expand wildcards (Windows only) */
 
FileList = AsDoWildcard (Directory, Filename);
if (!FileList)
WildcardList = AsDoWildcard (Directory, Filename);
if (!WildcardList)
{
return -1;
return (-1);
}
 
while (*FileList)
while (*WildcardList)
{
FullPathname = AcpiOsAllocate (
strlen (Directory) + strlen (*FileList) + 1);
strlen (Directory) + strlen (*WildcardList) + 1);
 
/* Construct a full path to the file */
 
strcpy (FullPathname, Directory);
strcat (FullPathname, *FileList);
strcat (FullPathname, *WildcardList);
 
/* Get one table */
 
644,9 → 651,9
}
 
AcpiOsFree (FullPathname);
AcpiOsFree (*FileList);
*FileList = NULL;
FileList++;
AcpiOsFree (*WildcardList);
*WildcardList = NULL;
WildcardList++;
 
/*
* Ignore an FACS or RSDT, we can't use them.
676,7 → 683,7
Status = AeBuildLocalTables (TableCount, AeTableListHead);
if (ACPI_FAILURE (Status))
{
return -1;
return (-1);
}
 
Status = AeInstallTables ();
686,7 → 693,11
goto enterloop;
}
 
Status = AeInstallHandlers ();
/*
* Install most of the handlers.
* Override some default region handlers, especially SystemMemory
*/
Status = AeInstallEarlyHandlers ();
if (ACPI_FAILURE (Status))
{
goto enterloop;
693,8 → 704,7
}
 
/*
* TBD:
* Need a way to call this after the "LOAD" command
* TBD: Need a way to call this after the "LOAD" command
*/
Status = AcpiEnableSubsystem (InitFlags);
if (ACPI_FAILURE (Status))
710,6 → 720,11
goto enterloop;
}
 
/*
* Install handlers for "device driver" space IDs (EC,SMBus, etc.)
* and fixed event handlers
*/
AeInstallLateHandlers ();
AeMiscellaneousTests ();
}
 
721,7 → 736,7
}
else if (AcpiGbl_BatchMode == 2)
{
AcpiDbExecute (BatchBuffer, NULL, EX_NO_SINGLE_STEP);
AcpiDbExecute (BatchBuffer, NULL, NULL, EX_NO_SINGLE_STEP);
}
else
{
730,6 → 745,6
AcpiDbUserCommands (ACPI_DEBUGGER_COMMAND_PROMPT, NULL);
}
 
return 0;
return (0);
}
 
/drivers/devman/acpica/tools/acpiexec/aetables.c
1,6 → 1,6
/******************************************************************************
*
* Module Name: aetables - Miscellaneous ACPI tables for acpiexec utility
* Module Name: aetables - ACPI table setup/install for acpiexec utility
*
*****************************************************************************/
 
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
114,6 → 114,7
*****************************************************************************/
 
#include "aecommon.h"
#include "aetables.h"
 
#define _COMPONENT ACPI_TOOLS
ACPI_MODULE_NAME ("aetables")
129,149 → 130,32
AeLocalGetRootPointer (
void);
 
/*
* Misc ACPI tables to be installed
*/
/* User table (DSDT) */
 
/* Default DSDT. This will be replaced with the input DSDT */
static ACPI_TABLE_HEADER *DsdtToInstallOverride;
 
unsigned char DsdtCode[] =
{
0x44,0x53,0x44,0x54,0x24,0x00,0x00,0x00, /* 00000000 "DSDT$..." */
0x02,0x6F,0x49,0x6E,0x74,0x65,0x6C,0x00, /* 00000008 ".oIntel." */
0x4E,0x75,0x6C,0x6C,0x44,0x53,0x44,0x54, /* 00000010 "NullDSDT" */
0x01,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */
0x04,0x12,0x08,0x20,
};
/* Non-AML tables that are constructed locally and installed */
 
unsigned char LocalDsdtCode[] =
{
0x44,0x53,0x44,0x54,0x24,0x00,0x00,0x00, /* 00000000 "DSDT$..." */
0x02,0x2C,0x49,0x6E,0x74,0x65,0x6C,0x00, /* 00000008 ".,Intel." */
0x4C,0x6F,0x63,0x61,0x6C,0x00,0x00,0x00, /* 00000010 "Local..." */
0x01,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */
0x30,0x07,0x09,0x20,
};
static ACPI_TABLE_RSDP LocalRSDP;
static ACPI_TABLE_FACS LocalFACS;
static ACPI_TABLE_HEADER LocalTEST;
static ACPI_TABLE_HEADER LocalBADTABLE;
 
/* Several example SSDTs */
 
unsigned char Ssdt1Code[] = /* Has method _T98 */
{
0x53,0x53,0x44,0x54,0x30,0x00,0x00,0x00, /* 00000000 "SSDT0..." */
0x01,0xB8,0x49,0x6E,0x74,0x65,0x6C,0x00, /* 00000008 "..Intel." */
0x4D,0x61,0x6E,0x79,0x00,0x00,0x00,0x00, /* 00000010 "Many...." */
0x01,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */
0x24,0x04,0x03,0x20,0x14,0x0B,0x5F,0x54, /* 00000020 "$.. .._T" */
0x39,0x38,0x00,0x70,0x0A,0x04,0x60,0xA4, /* 00000028 "98.p..`." */
};
 
unsigned char Ssdt2Code[] = /* Has method _T99 */
{
0x53,0x53,0x44,0x54,0x30,0x00,0x00,0x00, /* 00000000 "SSDT0..." */
0x01,0xB7,0x49,0x6E,0x74,0x65,0x6C,0x00, /* 00000008 "..Intel." */
0x4D,0x61,0x6E,0x79,0x00,0x00,0x00,0x00, /* 00000010 "Many...." */
0x01,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */
0x24,0x04,0x03,0x20,0x14,0x0B,0x5F,0x54, /* 00000020 "$.. .._T" */
0x39,0x39,0x00,0x70,0x0A,0x04,0x60,0xA4, /* 00000028 "99.p..`." */
};
 
unsigned char Ssdt3Code[] = /* Has method _T97 */
{
0x54,0x53,0x44,0x54,0x30,0x00,0x00,0x00, /* 00000000 "TSDT0..." */
0x01,0xB8,0x49,0x6E,0x74,0x65,0x6C,0x00, /* 00000008 "..Intel." */
0x4D,0x61,0x6E,0x79,0x00,0x00,0x00,0x00, /* 00000010 "Many...." */
0x01,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */
0x24,0x04,0x03,0x20,0x14,0x0B,0x5F,0x54, /* 00000020 "$.. .._T" */
0x39,0x37,0x00,0x70,0x0A,0x04,0x60,0xA4, /* 00000028 "97.p..`." */
};
 
/* Example OEM table */
 
unsigned char Oem1Code[] =
{
0x4F,0x45,0x4D,0x31,0x38,0x00,0x00,0x00, /* 00000000 "OEM18..." */
0x01,0x4B,0x49,0x6E,0x74,0x65,0x6C,0x00, /* 00000008 ".KIntel." */
0x4D,0x61,0x6E,0x79,0x00,0x00,0x00,0x00, /* 00000010 "Many...." */
0x01,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */
0x18,0x09,0x03,0x20,0x08,0x5F,0x58,0x54, /* 00000020 "... ._XT" */
0x32,0x0A,0x04,0x14,0x0C,0x5F,0x58,0x54, /* 00000028 "2...._XT" */
0x31,0x00,0x70,0x01,0x5F,0x58,0x54,0x32, /* 00000030 "1.p._XT2" */
};
 
/* ASL source for this table is at the end of this file */
 
unsigned char OemxCode[] =
{
0x4F,0x45,0x4D,0x58,0xB0,0x00,0x00,0x00, /* 00000000 "OEMX...." */
0x02,0x54,0x4D,0x79,0x4F,0x45,0x4D,0x00, /* 00000008 ".TMyOEM." */
0x54,0x65,0x73,0x74,0x00,0x00,0x00,0x00, /* 00000010 "Test...." */
0x32,0x04,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "2...INTL" */
0x31,0x03,0x10,0x20,0x14,0x1D,0x5F,0x49, /* 00000020 "1.. .._I" */
0x4E,0x49,0x00,0x70,0x0D,0x54,0x61,0x62, /* 00000028 "NI.p.Tab" */
0x6C,0x65,0x20,0x4F,0x45,0x4D,0x58,0x20, /* 00000030 "le OEMX " */
0x72,0x75,0x6E,0x6E,0x69,0x6E,0x67,0x00, /* 00000038 "running." */
0x5B,0x31,0x10,0x22,0x5C,0x5F,0x47,0x50, /* 00000040 "[1."\_GP" */
0x45,0x14,0x06,0x5F,0x45,0x30,0x37,0x00, /* 00000048 "E.._E07." */
0x14,0x06,0x5F,0x45,0x32,0x32,0x00,0x14, /* 00000050 ".._E22.." */
0x06,0x5F,0x4C,0x33,0x31,0x00,0x14,0x06, /* 00000058 "._L31..." */
0x5F,0x4C,0x36,0x36,0x00,0x5B,0x82,0x10, /* 00000060 "_L66.[.." */
0x4F,0x45,0x4D,0x31,0x08,0x5F,0x50,0x52, /* 00000068 "OEM1._PR" */
0x57,0x12,0x05,0x02,0x0A,0x07,0x00,0x5B, /* 00000070 "W......[" */
0x82,0x10,0x4F,0x45,0x4D,0x32,0x08,0x5F, /* 00000078 "..OEM2._" */
0x50,0x52,0x57,0x12,0x05,0x02,0x0A,0x66, /* 00000080 "PRW....f" */
0x00,0x10,0x26,0x5C,0x47,0x50,0x45,0x32, /* 00000088 "..&\GPE2" */
0x14,0x06,0x5F,0x4C,0x30,0x31,0x00,0x14, /* 00000090 ".._L01.." */
0x06,0x5F,0x45,0x30,0x37,0x00,0x08,0x5F, /* 00000098 "._E07.._" */
0x50,0x52,0x57,0x12,0x0C,0x02,0x12,0x08, /* 000000A0 "PRW....." */
0x02,0x5C,0x47,0x50,0x45,0x32,0x01,0x00 /* 000000A8 ".\GPE2.." */
};
 
/*
* Example installable control method
*
* DefinitionBlock ("", "DSDT", 2, "Intel", "MTHDTEST", 0x20090512)
* {
* Method (\_SI_._T97, 1, Serialized)
* {
* Store ("Example installed method", Debug)
* Store (Arg0, Debug)
* Return ()
* }
* }
*
* Compiled byte code below.
* We need a local FADT so that the hardware subcomponent will function,
* even though the underlying OSD HW access functions don't do anything.
*/
unsigned char MethodCode[] =
{
0x44,0x53,0x44,0x54,0x53,0x00,0x00,0x00, /* 00000000 "DSDTS..." */
0x02,0xF9,0x49,0x6E,0x74,0x65,0x6C,0x00, /* 00000008 "..Intel." */
0x4D,0x54,0x48,0x44,0x54,0x45,0x53,0x54, /* 00000010 "MTHDTEST" */
0x12,0x05,0x09,0x20,0x49,0x4E,0x54,0x4C, /* 00000018 "... INTL" */
0x22,0x04,0x09,0x20,0x14,0x2E,0x2E,0x5F, /* 00000020 "".. ..._" */
0x54,0x49,0x5F,0x5F,0x54,0x39,0x37,0x09, /* 00000028 "SI__T97." */
0x70,0x0D,0x45,0x78,0x61,0x6D,0x70,0x6C, /* 00000030 "p.Exampl" */
0x65,0x20,0x69,0x6E,0x73,0x74,0x61,0x6C, /* 00000038 "e instal" */
0x6C,0x65,0x64,0x20,0x6D,0x65,0x74,0x68, /* 00000040 "led meth" */
0x6F,0x64,0x00,0x5B,0x31,0x70,0x68,0x5B, /* 00000048 "od.[1ph[" */
0x31,0xA4,0x00,
};
static ACPI_TABLE_FADT LocalFADT;
 
 
/*
* We need a local FADT so that the hardware subcomponent will function,
* even though the underlying OSD HW access functions don't do
* anything.
* Use XSDT so that both 32- and 64-bit versions of this utility will
* function automatically.
*/
ACPI_TABLE_HEADER *DsdtToInstallOverride;
ACPI_TABLE_RSDP LocalRSDP;
ACPI_TABLE_FADT LocalFADT;
ACPI_TABLE_FACS LocalFACS;
ACPI_TABLE_HEADER LocalTEST;
ACPI_TABLE_HEADER LocalBADTABLE;
ACPI_TABLE_RSDT *LocalRSDT;
static ACPI_TABLE_XSDT *LocalXSDT;
 
#define BASE_RSDT_TABLES 7
#define BASE_RSDT_SIZE (sizeof (ACPI_TABLE_RSDT) + ((BASE_RSDT_TABLES -1) * sizeof (UINT32)))
#define BASE_XSDT_TABLES 8
#define BASE_XSDT_SIZE (sizeof (ACPI_TABLE_XSDT) + \
((BASE_XSDT_TABLES -1) * sizeof (UINT64)))
 
#define ACPI_MAX_INIT_TABLES (32)
static ACPI_TABLE_DESC Tables[ACPI_MAX_INIT_TABLES];
317,7 → 201,7
*
* RETURN: Status
*
* DESCRIPTION: Build a complete ACPI table chain, with a local RSDP, RSDT,
* DESCRIPTION: Build a complete ACPI table chain, with a local RSDP, XSDT,
* FADT, and several other test tables.
*
*****************************************************************************/
328,7 → 212,7
AE_TABLE_DESC *TableList)
{
ACPI_PHYSICAL_ADDRESS DsdtAddress = 0;
UINT32 RsdtSize;
UINT32 XsdtSize;
AE_TABLE_DESC *NextTable;
UINT32 NextIndex;
ACPI_TABLE_FADT *ExternalFadt = NULL;
335,7 → 219,7
 
 
/*
* Update the table count. For DSDT, it is not put into the RSDT. For
* Update the table count. For DSDT, it is not put into the XSDT. For
* FADT, this is already accounted for since we usually install a
* local FADT.
*/
350,48 → 234,53
NextTable = NextTable->Next;
}
 
RsdtSize = BASE_RSDT_SIZE + (TableCount * sizeof (UINT32));
XsdtSize = BASE_XSDT_SIZE + (TableCount * sizeof (UINT64));
 
/* Build an RSDT */
/* Build an XSDT */
 
LocalRSDT = AcpiOsAllocate (RsdtSize);
if (!LocalRSDT)
LocalXSDT = AcpiOsAllocate (XsdtSize);
if (!LocalXSDT)
{
return AE_NO_MEMORY;
return (AE_NO_MEMORY);
}
 
ACPI_MEMSET (LocalRSDT, 0, RsdtSize);
ACPI_STRNCPY (LocalRSDT->Header.Signature, ACPI_SIG_RSDT, 4);
LocalRSDT->Header.Length = RsdtSize;
ACPI_MEMSET (LocalXSDT, 0, XsdtSize);
ACPI_STRNCPY (LocalXSDT->Header.Signature, ACPI_SIG_XSDT, 4);
LocalXSDT->Header.Length = XsdtSize;
LocalXSDT->Header.Revision = 1;
 
LocalRSDT->TableOffsetEntry[0] = ACPI_PTR_TO_PHYSADDR (&LocalTEST);
LocalRSDT->TableOffsetEntry[1] = ACPI_PTR_TO_PHYSADDR (&LocalBADTABLE);
LocalRSDT->TableOffsetEntry[2] = ACPI_PTR_TO_PHYSADDR (&LocalFADT);
LocalXSDT->TableOffsetEntry[0] = ACPI_PTR_TO_PHYSADDR (&LocalTEST);
LocalXSDT->TableOffsetEntry[1] = ACPI_PTR_TO_PHYSADDR (&LocalBADTABLE);
LocalXSDT->TableOffsetEntry[2] = ACPI_PTR_TO_PHYSADDR (&LocalFADT);
 
/* Install two SSDTs to test multiple table support */
 
LocalRSDT->TableOffsetEntry[3] = ACPI_PTR_TO_PHYSADDR (&Ssdt1Code);
LocalRSDT->TableOffsetEntry[4] = ACPI_PTR_TO_PHYSADDR (&Ssdt2Code);
LocalXSDT->TableOffsetEntry[3] = ACPI_PTR_TO_PHYSADDR (&Ssdt1Code);
LocalXSDT->TableOffsetEntry[4] = ACPI_PTR_TO_PHYSADDR (&Ssdt2Code);
 
/* Install the OEM1 table to test LoadTable */
 
LocalRSDT->TableOffsetEntry[5] = ACPI_PTR_TO_PHYSADDR (&Oem1Code);
LocalXSDT->TableOffsetEntry[5] = ACPI_PTR_TO_PHYSADDR (&Oem1Code);
 
/* Install the OEMx table to test LoadTable */
 
LocalRSDT->TableOffsetEntry[6] = ACPI_PTR_TO_PHYSADDR (&OemxCode);
LocalXSDT->TableOffsetEntry[6] = ACPI_PTR_TO_PHYSADDR (&OemxCode);
 
/* Install the ECDT table to test _REG */
 
LocalXSDT->TableOffsetEntry[7] = ACPI_PTR_TO_PHYSADDR (&EcdtCode);
 
/*
* Install the user tables. The DSDT must be installed in the FADT.
* All other tables are installed directly into the RSDT.
* All other tables are installed directly into the XSDT.
*/
NextIndex = BASE_RSDT_TABLES;
NextIndex = BASE_XSDT_TABLES;
NextTable = TableList;
while (NextTable)
{
/*
* Incoming DSDT or FADT are special cases. All other tables are
* just immediately installed into the RSDT.
* just immediately installed into the XSDT.
*/
if (ACPI_COMPARE_NAME (NextTable->Table->Signature, ACPI_SIG_DSDT))
{
398,7 → 287,7
if (DsdtAddress)
{
printf ("Already found a DSDT, only one allowed\n");
return AE_ALREADY_EXISTS;
return (AE_ALREADY_EXISTS);
}
 
/* The incoming user table is a DSDT */
409,13 → 298,13
else if (ACPI_COMPARE_NAME (NextTable->Table->Signature, ACPI_SIG_FADT))
{
ExternalFadt = ACPI_CAST_PTR (ACPI_TABLE_FADT, NextTable->Table);
LocalRSDT->TableOffsetEntry[2] = ACPI_PTR_TO_PHYSADDR (NextTable->Table);
LocalXSDT->TableOffsetEntry[2] = ACPI_PTR_TO_PHYSADDR (NextTable->Table);
}
else
{
/* Install the table in the RSDT */
/* Install the table in the XSDT */
 
LocalRSDT->TableOffsetEntry[NextIndex] = ACPI_PTR_TO_PHYSADDR (NextTable->Table);
LocalXSDT->TableOffsetEntry[NextIndex] = ACPI_PTR_TO_PHYSADDR (NextTable->Table);
NextIndex++;
}
 
427,14 → 316,14
ACPI_MEMSET (&LocalRSDP, 0, sizeof (ACPI_TABLE_RSDP));
ACPI_MEMCPY (LocalRSDP.Signature, ACPI_SIG_RSDP, 8);
ACPI_MEMCPY (LocalRSDP.OemId, "I_TEST", 6);
LocalRSDP.Revision = 1;
LocalRSDP.RsdtPhysicalAddress = ACPI_PTR_TO_PHYSADDR (LocalRSDT);
LocalRSDP.Length = sizeof (ACPI_TABLE_RSDT);
LocalRSDP.Revision = 2;
LocalRSDP.XsdtPhysicalAddress = ACPI_PTR_TO_PHYSADDR (LocalXSDT);
LocalRSDP.Length = sizeof (ACPI_TABLE_XSDT);
 
/* Set checksums for both RSDT and RSDP */
/* Set checksums for both XSDT and RSDP */
 
LocalRSDT->Header.Checksum = (UINT8) -AcpiTbChecksum (
(void *) LocalRSDT, LocalRSDT->Header.Length);
LocalXSDT->Header.Checksum = (UINT8) -AcpiTbChecksum (
(void *) LocalXSDT, LocalXSDT->Header.Length);
LocalRSDP.Checksum = (UINT8) -AcpiTbChecksum (
(void *) &LocalRSDP, ACPI_RSDP_CHECKSUM_LENGTH);
 
476,8 → 365,8
 
/* Setup FADT header and DSDT/FACS addresses */
 
LocalFADT.Dsdt = DsdtAddress;
LocalFADT.Facs = ACPI_PTR_TO_PHYSADDR (&LocalFACS);
LocalFADT.Dsdt = 0;
LocalFADT.Facs = 0;
 
LocalFADT.XDsdt = DsdtAddress;
LocalFADT.XFacs = ACPI_PTR_TO_PHYSADDR (&LocalFACS);
488,21 → 377,25
/* Miscellaneous FADT fields */
 
LocalFADT.Gpe0BlockLength = 16;
LocalFADT.Gpe0Block = 0x00001234;
 
LocalFADT.Gpe1BlockLength = 6;
LocalFADT.Gpe1Block = 0x00005678;
LocalFADT.Gpe1Base = 96;
 
LocalFADT.Pm1EventLength = 4;
LocalFADT.Pm1aEventBlock = 0x00001aaa;
LocalFADT.Pm1bEventBlock = 0x00001bbb;
 
LocalFADT.Pm1ControlLength = 2;
LocalFADT.Pm1aControlBlock = 0xB0;
 
LocalFADT.PmTimerLength = 4;
LocalFADT.PmTimerBlock = 0xA0;
 
LocalFADT.Gpe0Block = 0x00001234;
LocalFADT.Gpe1Block = 0x00005678;
LocalFADT.Pm2ControlBlock = 0xC0;
LocalFADT.Pm2ControlLength = 1;
 
LocalFADT.Pm1aEventBlock = 0x00001aaa;
LocalFADT.Pm1bEventBlock = 0x00001bbb;
LocalFADT.PmTimerBlock = 0xA0;
LocalFADT.Pm1aControlBlock = 0xB0;
 
/* Setup one example X-64 field */
 
LocalFADT.XPm1bEventBlock.SpaceId = ACPI_ADR_SPACE_SYSTEM_IO;
524,8 → 417,10
LocalFACS.Length = sizeof (ACPI_TABLE_FACS);
LocalFACS.GlobalLock = 0x11AA0011;
 
/* Build a fake table [TEST] so that we make sure that the CA core ignores it */
 
/*
* Build a fake table [TEST] so that we make sure that the
* ACPICA core ignores it
*/
ACPI_MEMSET (&LocalTEST, 0, sizeof (ACPI_TABLE_HEADER));
ACPI_STRNCPY (LocalTEST.Signature, "TEST", 4);
 
534,8 → 429,10
LocalTEST.Checksum = (UINT8) -AcpiTbChecksum (
(void *) &LocalTEST, LocalTEST.Length);
 
/* Build a fake table with a bad signature [BAD!] so that we make sure that the CA core ignores it */
 
/*
* Build a fake table with a bad signature [BAD!] so that we make
* sure that the ACPICA core ignores it
*/
ACPI_MEMSET (&LocalBADTABLE, 0, sizeof (ACPI_TABLE_HEADER));
ACPI_STRNCPY (LocalBADTABLE.Signature, "BAD!", 4);
 
566,9 → 463,15
{
ACPI_STATUS Status;
 
 
Status = AcpiInitializeTables (Tables, ACPI_MAX_INIT_TABLES, TRUE);
AE_CHECK_OK (AcpiInitializeTables, Status);
 
Status = AcpiReallocateRootTable ();
AE_CHECK_OK (AcpiReallocateRootTable, Status);
 
Status = AcpiLoadTables ();
AE_CHECK_OK (AcpiLoadTables, Status);
 
/*
* Test run-time control method installation. Do it twice to test code
613,112 → 516,3
 
return ((ACPI_PHYSICAL_ADDRESS) &LocalRSDP);
}
 
 
#if 0
/******************************************************************************
*
* DESCRIPTION: ASL tables that are used in RSDT/XSDT, also used to test
* Load/LoadTable operators.
*
*****************************************************************************/
 
DefinitionBlock ("", "OEMX", 2, "MyOEM", "Test", 0x00000432)
{
External (GPE2, DeviceObj)
 
Method (_INI)
{
Store ("Table OEMX running", Debug)
}
 
Scope (\_GPE)
{
Method (_E07) {}
Method (_E22) {}
Method (_L31) {}
Method (_L66) {}
}
 
Device (OEM1)
{
Name (_PRW, Package(){7,0})
}
Device (OEM2)
{
Name (_PRW, Package(){0x66,0})
}
 
Scope (\GPE2)
{
Method (_L01) {}
Method (_E07) {}
 
Name (_PRW, Package() {Package() {\GPE2, 1}, 0})
}
}
 
/* Parent gr.asl file */
 
DefinitionBlock ("", "DSDT", 2, "Intel", "Many", 0x00000001)
{
Name (BUF1, Buffer()
{
0x4F,0x45,0x4D,0x58,0xB0,0x00,0x00,0x00, /* 00000000 "OEMX...." */
0x02,0x54,0x4D,0x79,0x4F,0x45,0x4D,0x00, /* 00000008 ".TMyOEM." */
0x54,0x65,0x73,0x74,0x00,0x00,0x00,0x00, /* 00000010 "Test...." */
0x32,0x04,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "2...INTL" */
0x31,0x03,0x10,0x20,0x14,0x1D,0x5F,0x49, /* 00000020 "1.. .._I" */
0x4E,0x49,0x00,0x70,0x0D,0x54,0x61,0x62, /* 00000028 "NI.p.Tab" */
0x6C,0x65,0x20,0x4F,0x45,0x4D,0x58,0x20, /* 00000030 "le OEMX " */
0x72,0x75,0x6E,0x6E,0x69,0x6E,0x67,0x00, /* 00000038 "running." */
0x5B,0x31,0x10,0x22,0x5C,0x5F,0x47,0x50, /* 00000040 "[1."\_GP" */
0x45,0x14,0x06,0x5F,0x45,0x30,0x37,0x00, /* 00000048 "E.._E07." */
0x14,0x06,0x5F,0x45,0x32,0x32,0x00,0x14, /* 00000050 ".._E22.." */
0x06,0x5F,0x4C,0x33,0x31,0x00,0x14,0x06, /* 00000058 "._L31..." */
0x5F,0x4C,0x36,0x36,0x00,0x5B,0x82,0x10, /* 00000060 "_L66.[.." */
0x4F,0x45,0x4D,0x31,0x08,0x5F,0x50,0x52, /* 00000068 "OEM1._PR" */
0x57,0x12,0x05,0x02,0x0A,0x07,0x00,0x5B, /* 00000070 "W......[" */
0x82,0x10,0x4F,0x45,0x4D,0x32,0x08,0x5F, /* 00000078 "..OEM2._" */
0x50,0x52,0x57,0x12,0x05,0x02,0x0A,0x66, /* 00000080 "PRW....f" */
0x00,0x10,0x26,0x5C,0x47,0x50,0x45,0x32, /* 00000088 "..&\GPE2" */
0x14,0x06,0x5F,0x4C,0x30,0x31,0x00,0x14, /* 00000090 ".._L01.." */
0x06,0x5F,0x45,0x30,0x37,0x00,0x08,0x5F, /* 00000098 "._E07.._" */
0x50,0x52,0x57,0x12,0x0C,0x02,0x12,0x08, /* 000000A0 "PRW....." */
0x02,0x5C,0x47,0x50,0x45,0x32,0x01,0x00 /* 000000A8 ".\GPE2.." */
})
 
Name (HNDL, 0)
Method (LD)
{
Load (BUF1, HNDL)
Store ("Load operator, handle:", Debug)
Store (HNDL, Debug)
}
 
Method (MAIN, 0, NotSerialized)
{
Store ("Loading OEMX table", Debug)
Store (LoadTable ("OEMX", "MyOEM", "Test"), Debug)
}
 
Scope (\_GPE)
{
Method (_L08) {}
Method (_E08) {}
Method (_L0B) {}
}
 
Device (DEV0)
{
Name (_PRW, Package() {0x11, 0})
}
 
Device (\GPE2)
{
Method (_L00) {}
}
}
 
#endif
 
/drivers/devman/acpica/tools/acpisrc/Makefile
1,17 → 1,113
#
# acpisrc - ACPICA source code conversion utility
#
# NOTE: This makefile is intended to be used in the Linux environment,
# with the Linux directory structure. It will not work directly
# on the native ACPICA source tree.
#
 
#
# Configuration
# Notes:
# gcc should be version 4 or greater, otherwise some of the options
# used will not be recognized.
# Global optimization flags (such as -O2, -Os) are not used, since
# they cause issues on some compilers.
# The _GNU_SOURCE symbol is required for many hosts.
#
PROG= acpisrc
SRCS= ascase.c asconvrt.c asfile.c asmain.c asremove.c astable.c \
asutils.c osunixdir.c ../../common/getopt.c
 
CFLAGS+= -Wall -O2 -D_LINUX -DACPI_APPLICATION -Wstrict-prototypes -I../../include
HOST = _LINUX
NOMAN = YES
COMPILE = $(CC) -c $(CFLAGS) $(CWARNINGFLAGS) -o$@ $?
 
ACPICA_COMPONENTS =
ACPICA_SRC = ../..
ACPICA_COMMON = $(ACPICA_SRC)/common
ACPICA_CORE = $(ACPICA_SRC)$(ACPICA_COMPONENTS)
ACPICA_TOOLS = $(ACPICA_SRC)/tools
ACPICA_OSL = $(ACPICA_SRC)/os_specific/service_layers
INSTALLDIR = /usr/bin
INSTALLPROG = cp --remove-destination $(PROG) $(INSTALLDIR)
 
aslmain : $(patsubst %.c,%.o, $(SRCS))
$(CC) $(LDFLAGS) $(patsubst %.c,%.o, $(SRCS)) -o $(PROG)
CFLAGS+= \
-D$(HOST) \
-D_GNU_SOURCE \
-DACPI_SRC_APP \
-I$(ACPICA_SRC)/include \
-I.
 
CLEANFILES= $(PROG)
CWARNINGFLAGS = \
-ansi \
-Wall \
-Wbad-function-cast \
-Wdeclaration-after-statement \
-Werror \
-Wformat=2 \
-Wmissing-declarations \
-Wmissing-prototypes \
-Wstrict-aliasing=0 \
-Wstrict-prototypes \
-Wswitch-default \
-Wpointer-arith \
-Wundef
 
OBJS = \
ascase.o \
asconvrt.o \
asfile.o \
asmain.o \
asremove.o \
astable.o \
asutils.o \
osunixdir.o \
getopt.o
 
#
# Root rule
#
$(PROG) : $(OBJS)
$(CC) $(LDFLAGS) $(OBJS) -o $(PROG)
 
#
# acpisrc source
#
ascase.o : $(ACPICA_TOOLS)/acpisrc/ascase.c
$(COMPILE)
 
asconvrt.o : $(ACPICA_TOOLS)/acpisrc/asconvrt.c
$(COMPILE)
 
asfile.o : $(ACPICA_TOOLS)/acpisrc/asfile.c
$(COMPILE)
 
asmain.o : $(ACPICA_TOOLS)/acpisrc/asmain.c
$(COMPILE)
 
asremove.o : $(ACPICA_TOOLS)/acpisrc/asremove.c
$(COMPILE)
 
astable.o : $(ACPICA_TOOLS)/acpisrc/astable.c
$(COMPILE)
 
asutils.o : $(ACPICA_TOOLS)/acpisrc/asutils.c
$(COMPILE)
 
#
# ACPICA core source - common
#
getopt.o : $(ACPICA_COMMON)/getopt.c
$(COMPILE)
 
#
# Unix OS services layer (OSL)
#
osunixdir.o : $(ACPICA_OSL)/osunixdir.c
$(COMPILE)
 
 
clean :
rm -f $(CLEANFILES) $(patsubst %.c,%.o, $(SRCS))
rm -f $(PROG) $(PROG) $(OBJS)
 
install :
$(INSTALLPROG)
/drivers/devman/acpica/tools/acpisrc/acpisrc.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
121,6 → 121,9
#define LINUX_HEADER_SIGNATURE " * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS"
#define LINES_IN_ASL_HEADER 29 /* Header as output from disassembler */
 
#include "acpi.h"
#include "accommon.h"
 
#include <stdio.h>
#include <sys/stat.h>
#include <sys/types.h>
132,16 → 135,14
#endif
#include <errno.h>
 
#include "acpi.h"
#include "accommon.h"
 
 
/* Fixups for non-Win32 compilation */
#ifndef WIN32
/* O_BINARY is not always defined */
#ifndef O_BINARY
#define O_BINARY 0x0
#endif
 
/* Fixups for non-Win32 compilation */
#ifndef WIN32
#define mkdir(x) mkdir(x, 0770)
char * strlwr(char* str);
#endif
278,6 → 279,7
extern ACPI_CONVERSION_TABLE CleanupConversionTable;
extern ACPI_CONVERSION_TABLE StatsConversionTable;
extern ACPI_CONVERSION_TABLE CustomConversionTable;
extern ACPI_CONVERSION_TABLE LicenseConversionTable;
 
 
/* Prototypes */
/drivers/devman/acpica/tools/acpisrc/ascase.c
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
/drivers/devman/acpica/tools/acpisrc/asconvrt.c
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
/drivers/devman/acpica/tools/acpisrc/asfile.c
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
132,7 → 132,7
char *Filename,
char *Buffer);
 
static inline int
static ACPI_INLINE int
AsMaxInt (int a, int b)
{
return (a > b ? a : b);
409,7 → 409,8
 
Gbl_StructDefs = strstr (FileBuffer, "/* acpisrc:StructDefs");
Gbl_Files++;
VERBOSE_PRINT (("Processing %u bytes\n", strlen (FileBuffer)));
VERBOSE_PRINT (("Processing %u bytes\n",
(unsigned int) strlen (FileBuffer)));
 
if (ConversionTable->LowerCaseTable)
{
/drivers/devman/acpica/tools/acpisrc/asmain.c
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
340,6 → 340,7
printf ("\n");
printf ("Usage: acpisrc [-c|l|u] [-dsvy] <SourceDir> <DestinationDir>\n\n");
printf ("Where: -c Generate cleaned version of the source\n");
printf (" -h Insert dual-license header into all modules\n");
printf (" -l Generate Linux version of the source\n");
printf (" -u Generate Custom source translation\n");
printf ("\n");
372,9 → 373,7
UINT32 FileType;
 
 
printf ("ACPI Source Code Conversion Utility");
printf (" version %8.8X", ((UINT32) ACPI_CA_VERSION));
printf (" [%s]\n\n", __DATE__);
printf (ACPI_COMMON_SIGNON ("ACPI Source Code Conversion Utility"));
 
if (argc < 2)
{
384,7 → 383,7
 
/* Command line options */
 
while ((j = AcpiGetopt (argc, argv, "cdlqsuvy")) != EOF) switch(j)
while ((j = AcpiGetopt (argc, argv, "cdhlqsuvy")) != EOF) switch(j)
{
case 'l':
/* Linux code generation */
402,6 → 401,13
ConversionTable = &CleanupConversionTable;
break;
 
case 'h':
/* Inject Dual-license header */
 
printf ("Inserting Dual-license header to all modules\n");
ConversionTable = &LicenseConversionTable;
break;
 
case 's':
/* Statistics only */
 
/drivers/devman/acpica/tools/acpisrc/asremove.c
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
/drivers/devman/acpica/tools/acpisrc/astable.c
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
161,9 → 161,9
*
******************************************************************************/
 
char LinuxHeader[] =
char DualLicenseHeader[] =
"/*\n"
" * Copyright (C) 2000 - 2010, Intel Corp.\n"
" * Copyright (C) 2000 - 2011, Intel Corp.\n"
" * All rights reserved.\n"
" *\n"
" * Redistribution and use in source and binary forms, with or without\n"
241,7 → 241,11
{"INT16", "s16", REPLACE_WHOLE_WORD},
{"INT8", "s8", REPLACE_WHOLE_WORD},
 
{NULL, NULL, 0},
/* Include file paths */
 
{"\"acpi.h\"", "<acpi/acpi.h>", REPLACE_WHOLE_WORD},
 
{NULL, NULL, 0}
};
 
ACPI_TYPED_IDENTIFIER_TABLE AcpiIdentifiers[] = {
283,6 → 287,7
{"ACPI_EXECUTE_TYPE", SRC_TYPE_SIMPLE},
{"ACPI_EXECUTE_WALK", SRC_TYPE_STRUCT},
{"ACPI_EXTERNAL_LIST", SRC_TYPE_STRUCT},
{"ACPI_EXTERNAL_FILE", SRC_TYPE_STRUCT},
{"ACPI_FADT_INFO", SRC_TYPE_STRUCT},
{"ACPI_FADT_PM_INFO", SRC_TYPE_STRUCT},
{"ACPI_FIELD_INFO", SRC_TYPE_STRUCT},
297,6 → 302,7
{"ACPI_GPE_DEVICE_INFO", SRC_TYPE_STRUCT},
{"ACPI_GPE_EVENT_INFO", SRC_TYPE_STRUCT},
{"ACPI_GPE_HANDLER", SRC_TYPE_SIMPLE},
{"ACPI_GPE_HANDLER_INFO", SRC_TYPE_STRUCT},
{"ACPI_GPE_INDEX_INFO", SRC_TYPE_STRUCT},
{"ACPI_GPE_REGISTER_INFO", SRC_TYPE_STRUCT},
{"ACPI_GPE_WALK_INFO", SRC_TYPE_STRUCT},
377,6 → 383,7
{"ACPI_PARSE_STATE", SRC_TYPE_STRUCT},
{"ACPI_PARSE_UPWARDS", SRC_TYPE_SIMPLE},
{"ACPI_PARSE_VALUE", SRC_TYPE_UNION},
{"ACPI_PCI_DEVICE", SRC_TYPE_STRUCT},
{"ACPI_PCI_ID", SRC_TYPE_STRUCT},
{"ACPI_PCI_ROUTING_TABLE", SRC_TYPE_STRUCT},
{"ACPI_PHYSICAL_ADDRESS", SRC_TYPE_SIMPLE},
600,6 → 607,8
{"ACPI_MADT_PROCESSOR_APIC", SRC_TYPE_STRUCT},
{"ACPI_MCFG_ALLOCATION", SRC_TYPE_STRUCT},
{"ACPI_MSCT_PROXIMITY", SRC_TYPE_STRUCT},
{"ACPI_RSDP_COMMON", SRC_TYPE_STRUCT},
{"ACPI_RSDP_EXTENSION", SRC_TYPE_STRUCT},
{"ACPI_SRAT_CPU_AFFINITY", SRC_TYPE_STRUCT},
{"ACPI_SRAT_HEADER", SRC_TYPE_STRUCT},
{"ACPI_SRAT_MEM_AFFINITY", SRC_TYPE_STRUCT},
606,33 → 615,11
{"ACPI_SRAT_X2APIC_CPU_AFFINITY", SRC_TYPE_STRUCT},
{"ACPI_WDAT_ENTRY", SRC_TYPE_STRUCT},
 
/* Data Table compiler */
 
/* Legacy names, should be removed */
{"DT_FIELD", SRC_TYPE_STRUCT},
{"DT_SUBTABLE", SRC_TYPE_STRUCT},
 
{"EC_BOOT_RESOURCES", SRC_TYPE_STRUCT},
{"HPET_TABLE", SRC_TYPE_STRUCT},
{"MADT_ADDRESS_OVERRIDE", SRC_TYPE_STRUCT},
{"MADT_INTERRUPT_OVERRIDE", SRC_TYPE_STRUCT},
{"MADT_INTERRUPT_SOURCE", SRC_TYPE_STRUCT},
{"MADT_IO_APIC", SRC_TYPE_STRUCT},
{"MADT_IO_SAPIC", SRC_TYPE_STRUCT},
{"MADT_LOCAL_APIC_NMI", SRC_TYPE_STRUCT},
{"MADT_LOCAL_SAPIC", SRC_TYPE_STRUCT},
{"MADT_NMI_SOURCE", SRC_TYPE_STRUCT},
{"MADT_PROCESSOR_APIC", SRC_TYPE_STRUCT},
{"MEMORY_AFFINITY", SRC_TYPE_STRUCT},
{"MULTIPLE_APIC_TABLE", SRC_TYPE_STRUCT},
{"SMART_BATTERY_TABLE", SRC_TYPE_STRUCT},
{"STATIC_RESOURCE_ALLOC", SRC_TYPE_STRUCT},
{"SYSTEM_RESOURCE_AFFINITY", SRC_TYPE_STRUCT},
{"SYSTEM_LOCALITY_INFO", SRC_TYPE_STRUCT},
{"FACS_DESCRIPTOR", SRC_TYPE_STRUCT},
{"FADT_DESCRIPTOR_REV1", SRC_TYPE_STRUCT},
{"FADT_DESCRIPTOR", SRC_TYPE_STRUCT},
{"FADT_DESCRIPTOR_REV2_MINUS", SRC_TYPE_STRUCT},
{"RSDP_DESCRIPTOR", SRC_TYPE_STRUCT},
{"RSDT_DESCRIPTOR", SRC_TYPE_STRUCT},
{"XSDT_DESCRIPTOR", SRC_TYPE_STRUCT},
{NULL, 0}
};
 
677,7 → 664,7
 
ACPI_CONVERSION_TABLE LinuxConversionTable = {
 
LinuxHeader,
DualLicenseHeader,
FLG_NO_CARRIAGE_RETURNS | FLG_LOWERCASE_DIRNAMES,
 
AcpiIdentifiers,
715,7 → 702,6
*
******************************************************************************/
 
 
ACPI_CONVERSION_TABLE CleanupConversionTable = {
 
NULL,
773,6 → 759,40
 
/******************************************************************************
*
* Dual License injection translation table
*
******************************************************************************/
 
ACPI_CONVERSION_TABLE LicenseConversionTable = {
 
DualLicenseHeader,
FLG_DEFAULT_FLAGS,
NULL,
 
/* C source files */
 
NULL,
NULL,
NULL,
NULL,
NULL,
(CVT_COUNT_TABS | CVT_COUNT_NON_ANSI_COMMENTS | CVT_COUNT_LINES |
CVT_COUNT_SHORTMULTILINE_COMMENTS),
 
/* C header files */
 
NULL,
NULL,
NULL,
NULL,
NULL,
(CVT_COUNT_TABS | CVT_COUNT_NON_ANSI_COMMENTS | CVT_COUNT_LINES |
CVT_COUNT_SHORTMULTILINE_COMMENTS),
};
 
 
/******************************************************************************
*
* Customizable translation tables
*
******************************************************************************/
780,14 → 800,14
ACPI_STRING_TABLE CustomReplacements[] = {
 
 
{"ACPI_INTEGER_MAX", "ACPI_UINT64_MAX", REPLACE_WHOLE_WORD},
{"(c) 1999 - 2010", "(c) 1999 - 2011", REPLACE_WHOLE_WORD}, /* Main ACPICA source */
{"(c) 2006 - 2010", "(c) 2006 - 2011", REPLACE_WHOLE_WORD}, /* Test suites */
 
#if 0
{"(ACPI_INTEGER)", "(UINT64)", REPLACE_WHOLE_WORD},
{"ACPI_INTEGER ", "UINT64 ", REPLACE_WHOLE_WORD},
{"ACPI_INTEGER", "UINT64", REPLACE_WHOLE_WORD},
{"(c) 1999 - 2009", "(c) 1999 - 2010", REPLACE_WHOLE_WORD}, /* Main ACPICA source */
{"(c) 2006 - 2009", "(c) 2006 - 2010", REPLACE_WHOLE_WORD}, /* Test suites */
{"ACPI_INTEGER_MAX", "ACPI_UINT64_MAX", REPLACE_WHOLE_WORD},
{"#include \"acpi.h\"", "#include \"acpi.h\"\n#include \"accommon.h\"", REPLACE_SUBSTRINGS},
{"AcpiTbSumTable", "AcpiTbSumTable", REPLACE_WHOLE_WORD},
{"ACPI_SIG_BOOT", "ACPI_SIG_BOOT", REPLACE_WHOLE_WORD},
/drivers/devman/acpica/tools/acpisrc/asutils.c
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
/drivers/devman/acpica/tools/acpixtract/Makefile
1,16 → 1,73
#
# acpixtract - extract binary ACPI tables from acpidump text output
#
# NOTE: This makefile is intended to be used in the Linux environment,
# with the Linux directory structure. It will not work directly
# on the native ACPICA source tree.
#
 
#
# Configuration
# Notes:
# gcc should be version 4 or greater, otherwise some of the options
# used will not be recognized.
# Global optimization flags (such as -O2, -Os) are not used, since
# they cause issues on some compilers.
# The _GNU_SOURCE symbol is required for many hosts.
#
PROG= acpixtract
SRCS= acpixtract.c
 
CFLAGS+= -Wall -O2 -D_LINUX -DACPI_APPLICATION -Wstrict-prototypes -I../../include
HOST = _LINUX
NOMAN = YES
COMPILE = $(CC) -c $(CFLAGS) $(CWARNINGFLAGS) -o$@ $?
 
ACPICA_COMPONENTS =
ACPICA_SRC = ../..
ACPICA_COMMON = $(ACPICA_SRC)/common
ACPICA_CORE = $(ACPICA_SRC)$(ACPICA_COMPONENTS)
ACPICA_TOOLS = $(ACPICA_SRC)/tools
ACPICA_OSL = $(ACPICA_SRC)/os_specific/service_layers
INSTALLDIR = /usr/bin
INSTALLPROG = cp --remove-destination $(PROG) $(INSTALLDIR)
 
acpixtract : $(patsubst %.c,%.o, $(SRCS))
$(CC) $(LDFLAGS) $(patsubst %.c,%.o, $(SRCS)) -o $(PROG)
CFLAGS+= \
-D$(HOST) \
-D_GNU_SOURCE \
-I$(ACPICA_SRC)/include
 
CLEANFILES= $(PROG)
CWARNINGFLAGS = \
-ansi \
-Wall \
-Wbad-function-cast \
-Wdeclaration-after-statement \
-Werror \
-Wformat=2 \
-Wmissing-declarations \
-Wmissing-prototypes \
-Wstrict-aliasing=0 \
-Wstrict-prototypes \
-Wswitch-default \
-Wpointer-arith \
-Wundef
 
OBJS = \
acpixtract.o
 
#
# Root rule
#
$(PROG) : $(OBJS)
$(CC) $(LDFLAGS) $(OBJS) -o $(PROG)
 
#
# acpixtract source
#
acpixtract.o : $(ACPICA_TOOLS)/acpixtract/acpixtract.c
$(COMPILE)
 
 
clean :
rm -f $(CLEANFILES) $(patsubst %.c,%.o, $(SRCS))
rm -f $(PROG) $(PROG).exe $(OBJS)
 
install :
$(INSTALLPROG)
/drivers/devman/acpica/tools/acpixtract/acpixtract.c
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,54 → 122,54
 
/* Note: This is a 32-bit program only */
 
#define VERSION 0x20100107
#define VERSION 0x20110330
#define FIND_HEADER 0
#define EXTRACT_DATA 1
#define BUFFER_SIZE 256
#define MIN_HEADER_LENGTH 6 /* strlen ("DSDT @") */
 
 
/* Local prototypes */
 
void
static void
CheckAscii (
char *Name,
int Count);
 
void
static void
NormalizeSignature (
char *Signature);
 
unsigned int
static unsigned int
GetNextInstance (
char *InputPathname,
char *Signature);
 
int
static int
ExtractTables (
char *InputPathname,
char *Signature,
unsigned int MinimumInstances);
 
size_t
static size_t
GetTableHeader (
FILE *InputFile,
unsigned char *OutputData);
 
unsigned int
static unsigned int
CountTableInstances (
char *InputPathname,
char *Signature);
 
int
static int
ListTables (
char *InputPathname);
 
size_t
static size_t
ConvertLine (
char *InputLine,
unsigned char *OutputData);
 
void
static void
DisplayUsage (
void);
 
196,9 → 196,9
struct TableInfo *Next;
};
 
struct TableInfo *ListHead = NULL;
char Filename[16];
unsigned char Data[16];
static struct TableInfo *ListHead = NULL;
static char Filename[16];
static unsigned char Data[16];
 
 
/******************************************************************************
209,7 → 209,7
*
******************************************************************************/
 
void
static void
DisplayUsage (
void)
{
240,7 → 240,7
*
******************************************************************************/
 
void
static void
CheckAscii (
char *Name,
int Count)
270,7 → 270,7
*
******************************************************************************/
 
void
static void
NormalizeSignature (
char *Signature)
{
295,7 → 295,7
*
******************************************************************************/
 
size_t
static size_t
ConvertLine (
char *InputLine,
unsigned char *OutputData)
353,7 → 353,7
*
******************************************************************************/
 
size_t
static size_t
GetTableHeader (
FILE *InputFile,
unsigned char *OutputData)
401,7 → 401,7
*
******************************************************************************/
 
unsigned int
static unsigned int
CountTableInstances (
char *InputPathname,
char *Signature)
459,7 → 459,7
*
******************************************************************************/
 
unsigned int
static unsigned int
GetNextInstance (
char *InputPathname,
char *Signature)
520,7 → 520,7
*
******************************************************************************/
 
int
static int
ExtractTables (
char *InputPathname,
char *Signature,
577,6 → 577,13
{
case FIND_HEADER:
 
/* Ignore lines that are too short to be header lines */
 
if (strlen (Buffer) < MIN_HEADER_LENGTH)
{
continue;
}
 
/* Ignore empty lines and lines that start with a space */
 
if ((Buffer[0] == ' ') ||
585,6 → 592,19
continue;
}
 
/*
* Ignore lines that are not of the form <sig> @ <addr>. Examples:
*
* DSDT @ 0x737e4000
* XSDT @ 0x737f2fff
* RSD PTR @ 0xf6cd0
* SSDT @ (nil)
*/
if (!strstr (Buffer, " @ "))
{
continue;
}
 
NormalizeSignature (Buffer);
strncpy (ThisSignature, Buffer, 4);
 
639,8 → 659,8
OutputFile = NULL;
State = FIND_HEADER;
 
printf ("Acpi table [%4.4s] - % 7d bytes written to %s\n",
ThisSignature, TotalBytesWritten, Filename);
printf ("Acpi table [%4.4s] - %u bytes written to %s\n",
ThisSignature, (unsigned int) TotalBytesWritten, Filename);
continue;
}
 
684,8 → 704,8
{
/* Received an EOF while extracting data */
 
printf ("Acpi table [%4.4s] - % 7d bytes written to %s\n",
ThisSignature, TotalBytesWritten, Filename);
printf ("Acpi table [%4.4s] - %u bytes written to %s\n",
ThisSignature, (unsigned int) TotalBytesWritten, Filename);
}
}
 
707,7 → 727,7
*
******************************************************************************/
 
int
static int
ListTables (
char *InputPathname)
{
/drivers/devman/acpica/tools/examples/examples.c
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
504,3 → 504,18
return (0);
}
 
ACPI_THREAD_ID
AcpiOsGetThreadId (
void)
{
return (0xFFFF);
}
 
ACPI_STATUS
AcpiOsExecute (
ACPI_EXECUTE_TYPE Type,
ACPI_OSD_EXEC_CALLBACK Function,
void *Context)
{
return (AE_SUPPORT);
}
/drivers/devman/acpica/utilities/utalloc.c
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
/drivers/devman/acpica/utilities/utcache.c
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
/drivers/devman/acpica/utilities/utclib.c
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
/drivers/devman/acpica/utilities/utcopy.c
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
/drivers/devman/acpica/utilities/utdebug.c
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
279,9 → 279,8
if (ACPI_LV_THREADS & AcpiDbgLevel)
{
AcpiOsPrintf (
"\n**** Context Switch from TID %p to TID %p ****\n\n",
ACPI_CAST_PTR (void, AcpiGbl_PrevThreadId),
ACPI_CAST_PTR (void, ThreadId));
"\n**** Context Switch from TID %u to TID %u ****\n\n",
(UINT32) AcpiGbl_PrevThreadId, (UINT32) ThreadId);
}
 
AcpiGbl_PrevThreadId = ThreadId;
295,7 → 294,7
 
if (ACPI_LV_THREADS & AcpiDbgLevel)
{
AcpiOsPrintf ("[%p] ", ACPI_CAST_PTR (void, ThreadId));
AcpiOsPrintf ("[%u] ", (UINT32) ThreadId);
}
 
AcpiOsPrintf ("[%02ld] %-22.22s: ",
/drivers/devman/acpica/utilities/utdecode.c
0,0 → 1,702
/******************************************************************************
*
* Module Name: utdecode - Utility decoding routines (value-to-string)
*
*****************************************************************************/
 
/******************************************************************************
*
* 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 __UTDECODE_C__
 
#include "acpi.h"
#include "accommon.h"
#include "acnamesp.h"
 
#define _COMPONENT ACPI_UTILITIES
ACPI_MODULE_NAME ("utdecode")
 
 
/*******************************************************************************
*
* FUNCTION: AcpiFormatException
*
* PARAMETERS: Status - The ACPI_STATUS code to be formatted
*
* RETURN: A string containing the exception text. A valid pointer is
* always returned.
*
* DESCRIPTION: This function translates an ACPI exception into an ASCII string
* It is here instead of utxface.c so it is always present.
*
******************************************************************************/
 
const char *
AcpiFormatException (
ACPI_STATUS Status)
{
const char *Exception = NULL;
 
 
ACPI_FUNCTION_ENTRY ();
 
 
Exception = AcpiUtValidateException (Status);
if (!Exception)
{
/* Exception code was not recognized */
 
ACPI_ERROR ((AE_INFO,
"Unknown exception code: 0x%8.8X", Status));
 
Exception = "UNKNOWN_STATUS_CODE";
}
 
return (ACPI_CAST_PTR (const char, Exception));
}
 
ACPI_EXPORT_SYMBOL (AcpiFormatException)
 
 
/*
* Properties of the ACPI Object Types, both internal and external.
* The table is indexed by values of ACPI_OBJECT_TYPE
*/
const UINT8 AcpiGbl_NsProperties[ACPI_NUM_NS_TYPES] =
{
ACPI_NS_NORMAL, /* 00 Any */
ACPI_NS_NORMAL, /* 01 Number */
ACPI_NS_NORMAL, /* 02 String */
ACPI_NS_NORMAL, /* 03 Buffer */
ACPI_NS_NORMAL, /* 04 Package */
ACPI_NS_NORMAL, /* 05 FieldUnit */
ACPI_NS_NEWSCOPE, /* 06 Device */
ACPI_NS_NORMAL, /* 07 Event */
ACPI_NS_NEWSCOPE, /* 08 Method */
ACPI_NS_NORMAL, /* 09 Mutex */
ACPI_NS_NORMAL, /* 10 Region */
ACPI_NS_NEWSCOPE, /* 11 Power */
ACPI_NS_NEWSCOPE, /* 12 Processor */
ACPI_NS_NEWSCOPE, /* 13 Thermal */
ACPI_NS_NORMAL, /* 14 BufferField */
ACPI_NS_NORMAL, /* 15 DdbHandle */
ACPI_NS_NORMAL, /* 16 Debug Object */
ACPI_NS_NORMAL, /* 17 DefField */
ACPI_NS_NORMAL, /* 18 BankField */
ACPI_NS_NORMAL, /* 19 IndexField */
ACPI_NS_NORMAL, /* 20 Reference */
ACPI_NS_NORMAL, /* 21 Alias */
ACPI_NS_NORMAL, /* 22 MethodAlias */
ACPI_NS_NORMAL, /* 23 Notify */
ACPI_NS_NORMAL, /* 24 Address Handler */
ACPI_NS_NEWSCOPE | ACPI_NS_LOCAL, /* 25 Resource Desc */
ACPI_NS_NEWSCOPE | ACPI_NS_LOCAL, /* 26 Resource Field */
ACPI_NS_NEWSCOPE, /* 27 Scope */
ACPI_NS_NORMAL, /* 28 Extra */
ACPI_NS_NORMAL, /* 29 Data */
ACPI_NS_NORMAL /* 30 Invalid */
};
 
 
/*******************************************************************************
*
* FUNCTION: AcpiUtHexToAsciiChar
*
* PARAMETERS: Integer - Contains the hex digit
* Position - bit position of the digit within the
* integer (multiple of 4)
*
* RETURN: The converted Ascii character
*
* DESCRIPTION: Convert a hex digit to an Ascii character
*
******************************************************************************/
 
/* Hex to ASCII conversion table */
 
static const char AcpiGbl_HexToAscii[] =
{
'0','1','2','3','4','5','6','7',
'8','9','A','B','C','D','E','F'
};
 
char
AcpiUtHexToAsciiChar (
UINT64 Integer,
UINT32 Position)
{
 
return (AcpiGbl_HexToAscii[(Integer >> Position) & 0xF]);
}
 
 
/*******************************************************************************
*
* FUNCTION: AcpiUtGetRegionName
*
* PARAMETERS: Space ID - ID for the region
*
* RETURN: Decoded region SpaceId name
*
* DESCRIPTION: Translate a Space ID into a name string (Debug only)
*
******************************************************************************/
 
/* Region type decoding */
 
const char *AcpiGbl_RegionTypes[ACPI_NUM_PREDEFINED_REGIONS] =
{
"SystemMemory",
"SystemIO",
"PCI_Config",
"EmbeddedControl",
"SMBus",
"SystemCMOS",
"PCIBARTarget",
"IPMI"
};
 
 
char *
AcpiUtGetRegionName (
UINT8 SpaceId)
{
 
if (SpaceId >= ACPI_USER_REGION_BEGIN)
{
return ("UserDefinedRegion");
}
else if (SpaceId == ACPI_ADR_SPACE_DATA_TABLE)
{
return ("DataTable");
}
else if (SpaceId == ACPI_ADR_SPACE_FIXED_HARDWARE)
{
return ("FunctionalFixedHW");
}
else if (SpaceId >= ACPI_NUM_PREDEFINED_REGIONS)
{
return ("InvalidSpaceId");
}
 
return (ACPI_CAST_PTR (char, AcpiGbl_RegionTypes[SpaceId]));
}
 
 
/*******************************************************************************
*
* FUNCTION: AcpiUtGetEventName
*
* PARAMETERS: EventId - Fixed event ID
*
* RETURN: Decoded event ID name
*
* DESCRIPTION: Translate a Event ID into a name string (Debug only)
*
******************************************************************************/
 
/* Event type decoding */
 
static const char *AcpiGbl_EventTypes[ACPI_NUM_FIXED_EVENTS] =
{
"PM_Timer",
"GlobalLock",
"PowerButton",
"SleepButton",
"RealTimeClock",
};
 
 
char *
AcpiUtGetEventName (
UINT32 EventId)
{
 
if (EventId > ACPI_EVENT_MAX)
{
return ("InvalidEventID");
}
 
return (ACPI_CAST_PTR (char, AcpiGbl_EventTypes[EventId]));
}
 
 
/*******************************************************************************
*
* FUNCTION: AcpiUtGetTypeName
*
* PARAMETERS: Type - An ACPI object type
*
* RETURN: Decoded ACPI object type name
*
* DESCRIPTION: Translate a Type ID into a name string (Debug only)
*
******************************************************************************/
 
/*
* Elements of AcpiGbl_NsTypeNames below must match
* one-to-one with values of ACPI_OBJECT_TYPE
*
* The type ACPI_TYPE_ANY (Untyped) is used as a "don't care" when searching;
* when stored in a table it really means that we have thus far seen no
* evidence to indicate what type is actually going to be stored for this entry.
*/
static const char AcpiGbl_BadType[] = "UNDEFINED";
 
/* Printable names of the ACPI object types */
 
static const char *AcpiGbl_NsTypeNames[] =
{
/* 00 */ "Untyped",
/* 01 */ "Integer",
/* 02 */ "String",
/* 03 */ "Buffer",
/* 04 */ "Package",
/* 05 */ "FieldUnit",
/* 06 */ "Device",
/* 07 */ "Event",
/* 08 */ "Method",
/* 09 */ "Mutex",
/* 10 */ "Region",
/* 11 */ "Power",
/* 12 */ "Processor",
/* 13 */ "Thermal",
/* 14 */ "BufferField",
/* 15 */ "DdbHandle",
/* 16 */ "DebugObject",
/* 17 */ "RegionField",
/* 18 */ "BankField",
/* 19 */ "IndexField",
/* 20 */ "Reference",
/* 21 */ "Alias",
/* 22 */ "MethodAlias",
/* 23 */ "Notify",
/* 24 */ "AddrHandler",
/* 25 */ "ResourceDesc",
/* 26 */ "ResourceFld",
/* 27 */ "Scope",
/* 28 */ "Extra",
/* 29 */ "Data",
/* 30 */ "Invalid"
};
 
 
char *
AcpiUtGetTypeName (
ACPI_OBJECT_TYPE Type)
{
 
if (Type > ACPI_TYPE_INVALID)
{
return (ACPI_CAST_PTR (char, AcpiGbl_BadType));
}
 
return (ACPI_CAST_PTR (char, AcpiGbl_NsTypeNames[Type]));
}
 
 
char *
AcpiUtGetObjectTypeName (
ACPI_OPERAND_OBJECT *ObjDesc)
{
 
if (!ObjDesc)
{
return ("[NULL Object Descriptor]");
}
 
return (AcpiUtGetTypeName (ObjDesc->Common.Type));
}
 
 
/*******************************************************************************
*
* FUNCTION: AcpiUtGetNodeName
*
* PARAMETERS: Object - A namespace node
*
* RETURN: ASCII name of the node
*
* DESCRIPTION: Validate the node and return the node's ACPI name.
*
******************************************************************************/
 
char *
AcpiUtGetNodeName (
void *Object)
{
ACPI_NAMESPACE_NODE *Node = (ACPI_NAMESPACE_NODE *) Object;
 
 
/* Must return a string of exactly 4 characters == ACPI_NAME_SIZE */
 
if (!Object)
{
return ("NULL");
}
 
/* Check for Root node */
 
if ((Object == ACPI_ROOT_OBJECT) ||
(Object == AcpiGbl_RootNode))
{
return ("\"\\\" ");
}
 
/* Descriptor must be a namespace node */
 
if (ACPI_GET_DESCRIPTOR_TYPE (Node) != ACPI_DESC_TYPE_NAMED)
{
return ("####");
}
 
/*
* Ensure name is valid. The name was validated/repaired when the node
* was created, but make sure it has not been corrupted.
*/
AcpiUtRepairName (Node->Name.Ascii);
 
/* Return the name */
 
return (Node->Name.Ascii);
}
 
 
/*******************************************************************************
*
* FUNCTION: AcpiUtGetDescriptorName
*
* PARAMETERS: Object - An ACPI object
*
* RETURN: Decoded name of the descriptor type
*
* DESCRIPTION: Validate object and return the descriptor type
*
******************************************************************************/
 
/* Printable names of object descriptor types */
 
static const char *AcpiGbl_DescTypeNames[] =
{
/* 00 */ "Not a Descriptor",
/* 01 */ "Cached",
/* 02 */ "State-Generic",
/* 03 */ "State-Update",
/* 04 */ "State-Package",
/* 05 */ "State-Control",
/* 06 */ "State-RootParseScope",
/* 07 */ "State-ParseScope",
/* 08 */ "State-WalkScope",
/* 09 */ "State-Result",
/* 10 */ "State-Notify",
/* 11 */ "State-Thread",
/* 12 */ "Walk",
/* 13 */ "Parser",
/* 14 */ "Operand",
/* 15 */ "Node"
};
 
 
char *
AcpiUtGetDescriptorName (
void *Object)
{
 
if (!Object)
{
return ("NULL OBJECT");
}
 
if (ACPI_GET_DESCRIPTOR_TYPE (Object) > ACPI_DESC_TYPE_MAX)
{
return ("Not a Descriptor");
}
 
return (ACPI_CAST_PTR (char,
AcpiGbl_DescTypeNames[ACPI_GET_DESCRIPTOR_TYPE (Object)]));
 
}
 
 
/*******************************************************************************
*
* FUNCTION: AcpiUtGetReferenceName
*
* PARAMETERS: Object - An ACPI reference object
*
* RETURN: Decoded name of the type of reference
*
* DESCRIPTION: Decode a reference object sub-type to a string.
*
******************************************************************************/
 
/* Printable names of reference object sub-types */
 
static const char *AcpiGbl_RefClassNames[] =
{
/* 00 */ "Local",
/* 01 */ "Argument",
/* 02 */ "RefOf",
/* 03 */ "Index",
/* 04 */ "DdbHandle",
/* 05 */ "Named Object",
/* 06 */ "Debug"
};
 
const char *
AcpiUtGetReferenceName (
ACPI_OPERAND_OBJECT *Object)
{
 
if (!Object)
{
return ("NULL Object");
}
 
if (ACPI_GET_DESCRIPTOR_TYPE (Object) != ACPI_DESC_TYPE_OPERAND)
{
return ("Not an Operand object");
}
 
if (Object->Common.Type != ACPI_TYPE_LOCAL_REFERENCE)
{
return ("Not a Reference object");
}
 
if (Object->Reference.Class > ACPI_REFCLASS_MAX)
{
return ("Unknown Reference class");
}
 
return (AcpiGbl_RefClassNames[Object->Reference.Class]);
}
 
 
#if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER)
/*
* Strings and procedures used for debug only
*/
 
/*******************************************************************************
*
* FUNCTION: AcpiUtGetMutexName
*
* PARAMETERS: MutexId - The predefined ID for this mutex.
*
* RETURN: Decoded name of the internal mutex
*
* DESCRIPTION: Translate a mutex ID into a name string (Debug only)
*
******************************************************************************/
 
/* Names for internal mutex objects, used for debug output */
 
static char *AcpiGbl_MutexNames[ACPI_NUM_MUTEX] =
{
"ACPI_MTX_Interpreter",
"ACPI_MTX_Namespace",
"ACPI_MTX_Tables",
"ACPI_MTX_Events",
"ACPI_MTX_Caches",
"ACPI_MTX_Memory",
"ACPI_MTX_CommandComplete",
"ACPI_MTX_CommandReady"
};
 
char *
AcpiUtGetMutexName (
UINT32 MutexId)
{
 
if (MutexId > ACPI_MAX_MUTEX)
{
return ("Invalid Mutex ID");
}
 
return (AcpiGbl_MutexNames[MutexId]);
}
 
 
/*******************************************************************************
*
* FUNCTION: AcpiUtGetNotifyName
*
* PARAMETERS: NotifyValue - Value from the Notify() request
*
* RETURN: Decoded name for the notify value
*
* DESCRIPTION: Translate a Notify Value to a notify namestring.
*
******************************************************************************/
 
/* Names for Notify() values, used for debug output */
 
static const char *AcpiGbl_NotifyValueNames[] =
{
"Bus Check",
"Device Check",
"Device Wake",
"Eject Request",
"Device Check Light",
"Frequency Mismatch",
"Bus Mode Mismatch",
"Power Fault",
"Capabilities Check",
"Device PLD Check",
"Reserved",
"System Locality Update"
};
 
const char *
AcpiUtGetNotifyName (
UINT32 NotifyValue)
{
 
if (NotifyValue <= ACPI_NOTIFY_MAX)
{
return (AcpiGbl_NotifyValueNames[NotifyValue]);
}
else if (NotifyValue <= ACPI_MAX_SYS_NOTIFY)
{
return ("Reserved");
}
else /* Greater or equal to 0x80 */
{
return ("**Device Specific**");
}
}
#endif
 
 
/*******************************************************************************
*
* FUNCTION: AcpiUtValidObjectType
*
* PARAMETERS: Type - Object type to be validated
*
* RETURN: TRUE if valid object type, FALSE otherwise
*
* DESCRIPTION: Validate an object type
*
******************************************************************************/
 
BOOLEAN
AcpiUtValidObjectType (
ACPI_OBJECT_TYPE Type)
{
 
if (Type > ACPI_TYPE_LOCAL_MAX)
{
/* Note: Assumes all TYPEs are contiguous (external/local) */
 
return (FALSE);
}
 
return (TRUE);
}
/drivers/devman/acpica/utilities/utdelete.c
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
/drivers/devman/acpica/utilities/uteval.c
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,141 → 124,8
ACPI_MODULE_NAME ("uteval")
 
 
/*
* Strings supported by the _OSI predefined (internal) method.
*
* March 2009: Removed "Linux" as this host no longer wants to respond true
* for this string. Basically, the only safe OS strings are windows-related
* and in many or most cases represent the only test path within the
* BIOS-provided ASL code.
*
* The second element of each entry is used to track the newest version of
* Windows that the BIOS has requested.
*/
static const ACPI_INTERFACE_INFO AcpiInterfacesSupported[] =
{
/* Operating System Vendor Strings */
 
{"Windows 2000", ACPI_OSI_WIN_2000}, /* Windows 2000 */
{"Windows 2001", ACPI_OSI_WIN_XP}, /* Windows XP */
{"Windows 2001 SP1", ACPI_OSI_WIN_XP_SP1}, /* Windows XP SP1 */
{"Windows 2001.1", ACPI_OSI_WINSRV_2003}, /* Windows Server 2003 */
{"Windows 2001 SP2", ACPI_OSI_WIN_XP_SP2}, /* Windows XP SP2 */
{"Windows 2001.1 SP1", ACPI_OSI_WINSRV_2003_SP1}, /* Windows Server 2003 SP1 - Added 03/2006 */
{"Windows 2006", ACPI_OSI_WIN_VISTA}, /* Windows Vista - Added 03/2006 */
{"Windows 2006.1", ACPI_OSI_WINSRV_2008}, /* Windows Server 2008 - Added 09/2009 */
{"Windows 2006 SP1", ACPI_OSI_WIN_VISTA_SP1}, /* Windows Vista SP1 - Added 09/2009 */
{"Windows 2009", ACPI_OSI_WIN_7}, /* Windows 7 and Server 2008 R2 - Added 09/2009 */
 
/* Feature Group Strings */
 
{"Extended Address Space Descriptor", 0}
 
/*
* All "optional" feature group strings (features that are implemented
* by the host) should be implemented in the host version of
* AcpiOsValidateInterface and should not be added here.
*/
};
 
 
/*******************************************************************************
*
* FUNCTION: AcpiUtOsiImplementation
*
* PARAMETERS: WalkState - Current walk state
*
* RETURN: Status
*
* DESCRIPTION: Implementation of the _OSI predefined control method
*
******************************************************************************/
 
ACPI_STATUS
AcpiUtOsiImplementation (
ACPI_WALK_STATE *WalkState)
{
ACPI_STATUS Status;
ACPI_OPERAND_OBJECT *StringDesc;
ACPI_OPERAND_OBJECT *ReturnDesc;
UINT32 ReturnValue;
UINT32 i;
 
 
ACPI_FUNCTION_TRACE (UtOsiImplementation);
 
 
/* Validate the string input argument */
 
StringDesc = WalkState->Arguments[0].Object;
if (!StringDesc || (StringDesc->Common.Type != ACPI_TYPE_STRING))
{
return_ACPI_STATUS (AE_TYPE);
}
 
/* Create a return object */
 
ReturnDesc = AcpiUtCreateInternalObject (ACPI_TYPE_INTEGER);
if (!ReturnDesc)
{
return_ACPI_STATUS (AE_NO_MEMORY);
}
 
/* Default return value is 0, NOT SUPPORTED */
 
ReturnValue = 0;
 
/* Compare input string to static table of supported interfaces */
 
for (i = 0; i < ACPI_ARRAY_LENGTH (AcpiInterfacesSupported); i++)
{
if (!ACPI_STRCMP (StringDesc->String.Pointer,
AcpiInterfacesSupported[i].Name))
{
/*
* The interface is supported.
* Update the OsiData if necessary. We keep track of the latest
* version of Windows that has been requested by the BIOS.
*/
if (AcpiInterfacesSupported[i].Value > AcpiGbl_OsiData)
{
AcpiGbl_OsiData = AcpiInterfacesSupported[i].Value;
}
 
ReturnValue = ACPI_UINT32_MAX;
goto Exit;
}
}
 
/*
* Did not match the string in the static table, call the host OSL to
* check for a match with one of the optional strings (such as
* "Module Device", "3.0 Thermal Model", etc.)
*/
Status = AcpiOsValidateInterface (StringDesc->String.Pointer);
if (ACPI_SUCCESS (Status))
{
/* The interface is supported */
 
ReturnValue = ACPI_UINT32_MAX;
}
 
 
Exit:
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO,
"ACPI: BIOS _OSI(%s) is %ssupported\n",
StringDesc->String.Pointer, ReturnValue == 0 ? "not " : ""));
 
/* Complete the return value */
 
ReturnDesc->Integer.Value = ReturnValue;
WalkState->ReturnDesc = ReturnDesc;
return_ACPI_STATUS (AE_OK);
}
 
 
/*******************************************************************************
*
* FUNCTION: AcpiUtEvaluateObject
*
* PARAMETERS: PrefixNode - Starting node
/drivers/devman/acpica/utilities/utglobal.c
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
118,7 → 118,6
 
#include "acpi.h"
#include "accommon.h"
#include "acnamesp.h"
 
#define _COMPONENT ACPI_UTILITIES
ACPI_MODULE_NAME ("utglobal")
192,47 → 191,6
 
/*******************************************************************************
*
* FUNCTION: AcpiFormatException
*
* PARAMETERS: Status - The ACPI_STATUS code to be formatted
*
* RETURN: A string containing the exception text. A valid pointer is
* always returned.
*
* DESCRIPTION: This function translates an ACPI exception into an ASCII string
* It is here instead of utxface.c so it is always present.
*
******************************************************************************/
 
const char *
AcpiFormatException (
ACPI_STATUS Status)
{
const char *Exception = NULL;
 
 
ACPI_FUNCTION_ENTRY ();
 
 
Exception = AcpiUtValidateException (Status);
if (!Exception)
{
/* Exception code was not recognized */
 
ACPI_ERROR ((AE_INFO,
"Unknown exception code: 0x%8.8X", Status));
 
Exception = "UNKNOWN_STATUS_CODE";
}
 
return (ACPI_CAST_PTR (const char, Exception));
}
 
ACPI_EXPORT_SYMBOL (AcpiFormatException)
 
 
/*******************************************************************************
*
* Namespace globals
*
******************************************************************************/
244,7 → 202,9
* 1) _SB_ is defined to be a device to allow \_SB_._INI to be run
* during the initialization sequence.
* 2) _TZ_ is defined to be a thermal zone in order to allow ASL code to
* perform a Notify() operation on it.
* perform a Notify() operation on it. 09/2010: Changed to type Device.
* This still allows notifies, but does not confuse host code that
* searches for valid ThermalZone objects.
*/
const ACPI_PREDEFINED_NAMES AcpiGbl_PreDefinedNames[] =
{
252,7 → 212,7
{"_PR_", ACPI_TYPE_LOCAL_SCOPE, NULL},
{"_SB_", ACPI_TYPE_DEVICE, NULL},
{"_SI_", ACPI_TYPE_LOCAL_SCOPE, NULL},
{"_TZ_", ACPI_TYPE_THERMAL, NULL},
{"_TZ_", ACPI_TYPE_DEVICE, NULL},
{"_REV", ACPI_TYPE_INTEGER, (char *) ACPI_CA_SUPPORT_LEVEL},
{"_OS_", ACPI_TYPE_STRING, ACPI_OS_NAME},
{"_GL_", ACPI_TYPE_MUTEX, (char *) 1},
266,79 → 226,7
{NULL, ACPI_TYPE_ANY, NULL}
};
 
/*
* Properties of the ACPI Object Types, both internal and external.
* The table is indexed by values of ACPI_OBJECT_TYPE
*/
const UINT8 AcpiGbl_NsProperties[ACPI_NUM_NS_TYPES] =
{
ACPI_NS_NORMAL, /* 00 Any */
ACPI_NS_NORMAL, /* 01 Number */
ACPI_NS_NORMAL, /* 02 String */
ACPI_NS_NORMAL, /* 03 Buffer */
ACPI_NS_NORMAL, /* 04 Package */
ACPI_NS_NORMAL, /* 05 FieldUnit */
ACPI_NS_NEWSCOPE, /* 06 Device */
ACPI_NS_NORMAL, /* 07 Event */
ACPI_NS_NEWSCOPE, /* 08 Method */
ACPI_NS_NORMAL, /* 09 Mutex */
ACPI_NS_NORMAL, /* 10 Region */
ACPI_NS_NEWSCOPE, /* 11 Power */
ACPI_NS_NEWSCOPE, /* 12 Processor */
ACPI_NS_NEWSCOPE, /* 13 Thermal */
ACPI_NS_NORMAL, /* 14 BufferField */
ACPI_NS_NORMAL, /* 15 DdbHandle */
ACPI_NS_NORMAL, /* 16 Debug Object */
ACPI_NS_NORMAL, /* 17 DefField */
ACPI_NS_NORMAL, /* 18 BankField */
ACPI_NS_NORMAL, /* 19 IndexField */
ACPI_NS_NORMAL, /* 20 Reference */
ACPI_NS_NORMAL, /* 21 Alias */
ACPI_NS_NORMAL, /* 22 MethodAlias */
ACPI_NS_NORMAL, /* 23 Notify */
ACPI_NS_NORMAL, /* 24 Address Handler */
ACPI_NS_NEWSCOPE | ACPI_NS_LOCAL, /* 25 Resource Desc */
ACPI_NS_NEWSCOPE | ACPI_NS_LOCAL, /* 26 Resource Field */
ACPI_NS_NEWSCOPE, /* 27 Scope */
ACPI_NS_NORMAL, /* 28 Extra */
ACPI_NS_NORMAL, /* 29 Data */
ACPI_NS_NORMAL /* 30 Invalid */
};
 
 
/* Hex to ASCII conversion table */
 
static const char AcpiGbl_HexToAscii[] =
{
'0','1','2','3','4','5','6','7',
'8','9','A','B','C','D','E','F'
};
 
 
/*******************************************************************************
*
* FUNCTION: AcpiUtHexToAsciiChar
*
* PARAMETERS: Integer - Contains the hex digit
* Position - bit position of the digit within the
* integer (multiple of 4)
*
* RETURN: The converted Ascii character
*
* DESCRIPTION: Convert a hex digit to an Ascii character
*
******************************************************************************/
 
char
AcpiUtHexToAsciiChar (
UINT64 Integer,
UINT32 Position)
{
 
return (AcpiGbl_HexToAscii[(Integer >> Position) & 0xF]);
}
 
 
/******************************************************************************
*
* Event and Hardware globals
384,454 → 272,9
/* ACPI_EVENT_RTC */ {ACPI_BITREG_RT_CLOCK_STATUS, ACPI_BITREG_RT_CLOCK_ENABLE, ACPI_BITMASK_RT_CLOCK_STATUS, ACPI_BITMASK_RT_CLOCK_ENABLE},
};
 
/*******************************************************************************
*
* FUNCTION: AcpiUtGetRegionName
*
* PARAMETERS: None.
*
* RETURN: Status
*
* DESCRIPTION: Translate a Space ID into a name string (Debug only)
*
******************************************************************************/
 
/* Region type decoding */
 
const char *AcpiGbl_RegionTypes[ACPI_NUM_PREDEFINED_REGIONS] =
{
"SystemMemory",
"SystemIO",
"PCI_Config",
"EmbeddedControl",
"SMBus",
"SystemCMOS",
"PCIBARTarget",
"IPMI",
"DataTable"
};
 
 
char *
AcpiUtGetRegionName (
UINT8 SpaceId)
{
 
if (SpaceId >= ACPI_USER_REGION_BEGIN)
{
return ("UserDefinedRegion");
}
else if (SpaceId >= ACPI_NUM_PREDEFINED_REGIONS)
{
return ("InvalidSpaceId");
}
 
return (ACPI_CAST_PTR (char, AcpiGbl_RegionTypes[SpaceId]));
}
 
 
/*******************************************************************************
*
* FUNCTION: AcpiUtGetEventName
*
* PARAMETERS: None.
*
* RETURN: Status
*
* DESCRIPTION: Translate a Event ID into a name string (Debug only)
*
******************************************************************************/
 
/* Event type decoding */
 
static const char *AcpiGbl_EventTypes[ACPI_NUM_FIXED_EVENTS] =
{
"PM_Timer",
"GlobalLock",
"PowerButton",
"SleepButton",
"RealTimeClock",
};
 
 
char *
AcpiUtGetEventName (
UINT32 EventId)
{
 
if (EventId > ACPI_EVENT_MAX)
{
return ("InvalidEventID");
}
 
return (ACPI_CAST_PTR (char, AcpiGbl_EventTypes[EventId]));
}
 
 
/*******************************************************************************
*
* FUNCTION: AcpiUtGetTypeName
*
* PARAMETERS: None.
*
* RETURN: Status
*
* DESCRIPTION: Translate a Type ID into a name string (Debug only)
*
******************************************************************************/
 
/*
* Elements of AcpiGbl_NsTypeNames below must match
* one-to-one with values of ACPI_OBJECT_TYPE
*
* The type ACPI_TYPE_ANY (Untyped) is used as a "don't care" when searching;
* when stored in a table it really means that we have thus far seen no
* evidence to indicate what type is actually going to be stored for this entry.
*/
static const char AcpiGbl_BadType[] = "UNDEFINED";
 
/* Printable names of the ACPI object types */
 
static const char *AcpiGbl_NsTypeNames[] =
{
/* 00 */ "Untyped",
/* 01 */ "Integer",
/* 02 */ "String",
/* 03 */ "Buffer",
/* 04 */ "Package",
/* 05 */ "FieldUnit",
/* 06 */ "Device",
/* 07 */ "Event",
/* 08 */ "Method",
/* 09 */ "Mutex",
/* 10 */ "Region",
/* 11 */ "Power",
/* 12 */ "Processor",
/* 13 */ "Thermal",
/* 14 */ "BufferField",
/* 15 */ "DdbHandle",
/* 16 */ "DebugObject",
/* 17 */ "RegionField",
/* 18 */ "BankField",
/* 19 */ "IndexField",
/* 20 */ "Reference",
/* 21 */ "Alias",
/* 22 */ "MethodAlias",
/* 23 */ "Notify",
/* 24 */ "AddrHandler",
/* 25 */ "ResourceDesc",
/* 26 */ "ResourceFld",
/* 27 */ "Scope",
/* 28 */ "Extra",
/* 29 */ "Data",
/* 30 */ "Invalid"
};
 
 
char *
AcpiUtGetTypeName (
ACPI_OBJECT_TYPE Type)
{
 
if (Type > ACPI_TYPE_INVALID)
{
return (ACPI_CAST_PTR (char, AcpiGbl_BadType));
}
 
return (ACPI_CAST_PTR (char, AcpiGbl_NsTypeNames[Type]));
}
 
 
char *
AcpiUtGetObjectTypeName (
ACPI_OPERAND_OBJECT *ObjDesc)
{
 
if (!ObjDesc)
{
return ("[NULL Object Descriptor]");
}
 
return (AcpiUtGetTypeName (ObjDesc->Common.Type));
}
 
 
/*******************************************************************************
*
* FUNCTION: AcpiUtGetNodeName
*
* PARAMETERS: Object - A namespace node
*
* RETURN: Pointer to a string
*
* DESCRIPTION: Validate the node and return the node's ACPI name.
*
******************************************************************************/
 
char *
AcpiUtGetNodeName (
void *Object)
{
ACPI_NAMESPACE_NODE *Node = (ACPI_NAMESPACE_NODE *) Object;
 
 
/* Must return a string of exactly 4 characters == ACPI_NAME_SIZE */
 
if (!Object)
{
return ("NULL");
}
 
/* Check for Root node */
 
if ((Object == ACPI_ROOT_OBJECT) ||
(Object == AcpiGbl_RootNode))
{
return ("\"\\\" ");
}
 
/* Descriptor must be a namespace node */
 
if (ACPI_GET_DESCRIPTOR_TYPE (Node) != ACPI_DESC_TYPE_NAMED)
{
return ("####");
}
 
/*
* Ensure name is valid. The name was validated/repaired when the node
* was created, but make sure it has not been corrupted.
*/
AcpiUtRepairName (Node->Name.Ascii);
 
/* Return the name */
 
return (Node->Name.Ascii);
}
 
 
/*******************************************************************************
*
* FUNCTION: AcpiUtGetDescriptorName
*
* PARAMETERS: Object - An ACPI object
*
* RETURN: Pointer to a string
*
* DESCRIPTION: Validate object and return the descriptor type
*
******************************************************************************/
 
/* Printable names of object descriptor types */
 
static const char *AcpiGbl_DescTypeNames[] =
{
/* 00 */ "Not a Descriptor",
/* 01 */ "Cached",
/* 02 */ "State-Generic",
/* 03 */ "State-Update",
/* 04 */ "State-Package",
/* 05 */ "State-Control",
/* 06 */ "State-RootParseScope",
/* 07 */ "State-ParseScope",
/* 08 */ "State-WalkScope",
/* 09 */ "State-Result",
/* 10 */ "State-Notify",
/* 11 */ "State-Thread",
/* 12 */ "Walk",
/* 13 */ "Parser",
/* 14 */ "Operand",
/* 15 */ "Node"
};
 
 
char *
AcpiUtGetDescriptorName (
void *Object)
{
 
if (!Object)
{
return ("NULL OBJECT");
}
 
if (ACPI_GET_DESCRIPTOR_TYPE (Object) > ACPI_DESC_TYPE_MAX)
{
return ("Not a Descriptor");
}
 
return (ACPI_CAST_PTR (char,
AcpiGbl_DescTypeNames[ACPI_GET_DESCRIPTOR_TYPE (Object)]));
 
}
 
 
/*******************************************************************************
*
* FUNCTION: AcpiUtGetReferenceName
*
* PARAMETERS: Object - An ACPI reference object
*
* RETURN: Pointer to a string
*
* DESCRIPTION: Decode a reference object sub-type to a string.
*
******************************************************************************/
 
/* Printable names of reference object sub-types */
 
static const char *AcpiGbl_RefClassNames[] =
{
/* 00 */ "Local",
/* 01 */ "Argument",
/* 02 */ "RefOf",
/* 03 */ "Index",
/* 04 */ "DdbHandle",
/* 05 */ "Named Object",
/* 06 */ "Debug"
};
 
const char *
AcpiUtGetReferenceName (
ACPI_OPERAND_OBJECT *Object)
{
 
if (!Object)
{
return ("NULL Object");
}
 
if (ACPI_GET_DESCRIPTOR_TYPE (Object) != ACPI_DESC_TYPE_OPERAND)
{
return ("Not an Operand object");
}
 
if (Object->Common.Type != ACPI_TYPE_LOCAL_REFERENCE)
{
return ("Not a Reference object");
}
 
if (Object->Reference.Class > ACPI_REFCLASS_MAX)
{
return ("Unknown Reference class");
}
 
return (AcpiGbl_RefClassNames[Object->Reference.Class]);
}
 
 
#if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER)
/*
* Strings and procedures used for debug only
*/
 
/*******************************************************************************
*
* FUNCTION: AcpiUtGetMutexName
*
* PARAMETERS: MutexId - The predefined ID for this mutex.
*
* RETURN: String containing the name of the mutex. Always returns a valid
* pointer.
*
* DESCRIPTION: Translate a mutex ID into a name string (Debug only)
*
******************************************************************************/
 
char *
AcpiUtGetMutexName (
UINT32 MutexId)
{
 
if (MutexId > ACPI_MAX_MUTEX)
{
return ("Invalid Mutex ID");
}
 
return (AcpiGbl_MutexNames[MutexId]);
}
 
 
/*******************************************************************************
*
* FUNCTION: AcpiUtGetNotifyName
*
* PARAMETERS: NotifyValue - Value from the Notify() request
*
* RETURN: String corresponding to the Notify Value.
*
* DESCRIPTION: Translate a Notify Value to a notify namestring.
*
******************************************************************************/
 
/* Names for Notify() values, used for debug output */
 
static const char *AcpiGbl_NotifyValueNames[] =
{
"Bus Check",
"Device Check",
"Device Wake",
"Eject Request",
"Device Check Light",
"Frequency Mismatch",
"Bus Mode Mismatch",
"Power Fault",
"Capabilities Check",
"Device PLD Check",
"Reserved",
"System Locality Update"
};
 
const char *
AcpiUtGetNotifyName (
UINT32 NotifyValue)
{
 
if (NotifyValue <= ACPI_NOTIFY_MAX)
{
return (AcpiGbl_NotifyValueNames[NotifyValue]);
}
else if (NotifyValue <= ACPI_MAX_SYS_NOTIFY)
{
return ("Reserved");
}
else /* Greater or equal to 0x80 */
{
return ("**Device Specific**");
}
}
#endif
 
 
/*******************************************************************************
*
* FUNCTION: AcpiUtValidObjectType
*
* PARAMETERS: Type - Object type to be validated
*
* RETURN: TRUE if valid object type, FALSE otherwise
*
* DESCRIPTION: Validate an object type
*
******************************************************************************/
 
BOOLEAN
AcpiUtValidObjectType (
ACPI_OBJECT_TYPE Type)
{
 
if (Type > ACPI_TYPE_LOCAL_MAX)
{
/* Note: Assumes all TYPEs are contiguous (external/local) */
 
return (FALSE);
}
 
return (TRUE);
}
 
 
/*******************************************************************************
*
* FUNCTION: AcpiUtInitGlobals
*
* PARAMETERS: None
838,7 → 281,7
*
* RETURN: Status
*
* DESCRIPTION: Init library globals. All globals that require specific
* DESCRIPTION: Init ACPICA globals. All globals that require specific
* initialization should be initialized here!
*
******************************************************************************/
893,6 → 336,7
 
/* GPE support */
 
AcpiGbl_AllGpesInitialized = FALSE;
AcpiGbl_GpeXruptListHead = NULL;
AcpiGbl_GpeFadtBlocks[0] = NULL;
AcpiGbl_GpeFadtBlocks[1] = NULL;
905,6 → 349,8
AcpiGbl_ExceptionHandler = NULL;
AcpiGbl_InitHandler = NULL;
AcpiGbl_TableHandler = NULL;
AcpiGbl_InterfaceHandler = NULL;
AcpiGbl_GlobalEventHandler = NULL;
 
/* Global Lock support */
 
931,6 → 377,8
AcpiGbl_DebuggerConfiguration = DEBUGGER_THREADING;
AcpiGbl_DbOutputFlags = ACPI_DB_CONSOLE_OUTPUT;
AcpiGbl_OsiData = 0;
AcpiGbl_OsiMutex = NULL;
AcpiGbl_RegMethodsExecuted = FALSE;
 
/* Hardware oriented */
 
973,5 → 421,3
ACPI_EXPORT_SYMBOL (AcpiDbgLayer)
ACPI_EXPORT_SYMBOL (AcpiGpeCount)
ACPI_EXPORT_SYMBOL (AcpiCurrentGpeCount)
 
 
/drivers/devman/acpica/utilities/utids.c
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
123,54 → 123,9
#define _COMPONENT ACPI_UTILITIES
ACPI_MODULE_NAME ("utids")
 
/* Local prototypes */
 
static void
AcpiUtCopyIdString (
char *Destination,
char *Source);
 
 
/*******************************************************************************
*
* FUNCTION: AcpiUtCopyIdString
*
* PARAMETERS: Destination - Where to copy the string
* Source - Source string
*
* RETURN: None
*
* DESCRIPTION: Copies an ID string for the _HID, _CID, and _UID methods.
* Performs removal of a leading asterisk if present -- workaround
* for a known issue on a bunch of machines.
*
******************************************************************************/
 
static void
AcpiUtCopyIdString (
char *Destination,
char *Source)
{
 
/*
* Workaround for ID strings that have a leading asterisk. This construct
* is not allowed by the ACPI specification (ID strings must be
* alphanumeric), but enough existing machines have this embedded in their
* ID strings that the following code is useful.
*/
if (*Source == '*')
{
Source++;
}
 
/* Do the actual copy */
 
ACPI_STRCPY (Destination, Source);
}
 
 
/*******************************************************************************
*
* FUNCTION: AcpiUtExecute_HID
*
* PARAMETERS: DeviceNode - Node for the device
240,7 → 195,7
}
else
{
AcpiUtCopyIdString (Hid->String, ObjDesc->String.Pointer);
ACPI_STRCPY (Hid->String, ObjDesc->String.Pointer);
}
 
Hid->Length = Length;
327,7 → 282,7
}
else
{
AcpiUtCopyIdString (Uid->String, ObjDesc->String.Pointer);
ACPI_STRCPY (Uid->String, ObjDesc->String.Pointer);
}
 
Uid->Length = Length;
471,7 → 426,7
{
/* Copy the String CID from the returned object */
 
AcpiUtCopyIdString (NextIdString, CidObjects[i]->String.Pointer);
ACPI_STRCPY (NextIdString, CidObjects[i]->String.Pointer);
Length = CidObjects[i]->String.Length + 1;
}
 
/drivers/devman/acpica/utilities/utinit.c
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
205,6 → 205,10
/* Close the AcpiEvent Handling */
 
AcpiEvTerminate ();
 
/* Delete any dynamic _OSI interfaces */
 
AcpiUtInterfaceTerminate ();
#endif
 
/* Close the Namespace */
/drivers/devman/acpica/utilities/utlock.c
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
/drivers/devman/acpica/utilities/utmath.c
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,12 → 124,32
ACPI_MODULE_NAME ("utmath")
 
/*
* Support for double-precision integer divide. This code is included here
* in order to support kernel environments where the double-precision math
* library is not available.
* Optional support for 64-bit double-precision integer divide. This code
* is configurable and is implemented in order to support 32-bit kernel
* environments where a 64-bit double-precision math library is not available.
*
* Support for a more normal 64-bit divide/modulo (with check for a divide-
* by-zero) appears after this optional section of code.
*/
#ifndef ACPI_USE_NATIVE_DIVIDE
 
#ifndef ACPI_USE_NATIVE_DIVIDE
/* Structures used only for 64-bit divide */
 
typedef struct uint64_struct
{
UINT32 Lo;
UINT32 Hi;
 
} UINT64_STRUCT;
 
typedef union uint64_overlay
{
UINT64 Full;
UINT64_STRUCT Part;
 
} UINT64_OVERLAY;
 
 
/*******************************************************************************
*
* FUNCTION: AcpiUtShortDivide
/drivers/devman/acpica/utilities/utmisc.c
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,7
#define _COMPONENT ACPI_UTILITIES
ACPI_MODULE_NAME ("utmisc")
 
/*
* Common suffix for messages
*/
#define ACPI_COMMON_MSG_SUFFIX \
AcpiOsPrintf (" (%8.8X/%s-%u)\n", ACPI_CA_VERSION, ModuleName, LineNumber)
 
 
/*******************************************************************************
*
* FUNCTION: AcpiUtValidateException
505,8 → 499,50
}
 
 
#ifdef ACPI_ASL_COMPILER
/*******************************************************************************
*
* FUNCTION: AcpiUtStrlwr (strlwr)
*
* PARAMETERS: SrcString - The source string to convert
*
* RETURN: None
*
* DESCRIPTION: Convert string to lowercase
*
* NOTE: This is not a POSIX function, so it appears here, not in utclib.c
*
******************************************************************************/
 
void
AcpiUtStrlwr (
char *SrcString)
{
char *String;
 
 
ACPI_FUNCTION_ENTRY ();
 
 
if (!SrcString)
{
return;
}
 
/* Walk entire string, lowercasing the letters */
 
for (String = SrcString; *String; String++)
{
*String = (char) ACPI_TOLOWER (*String);
}
 
return;
}
#endif
 
 
/*******************************************************************************
*
* FUNCTION: AcpiUtPrintString
*
* PARAMETERS: String - Null terminated ASCII string
1295,191 → 1331,3
}
 
 
/*******************************************************************************
*
* FUNCTION: AcpiError, AcpiException, AcpiWarning, AcpiInfo
*
* PARAMETERS: ModuleName - Caller's module name (for error output)
* LineNumber - Caller's line number (for error output)
* Format - Printf format string + additional args
*
* RETURN: None
*
* DESCRIPTION: Print message with module/line/version info
*
******************************************************************************/
 
void ACPI_INTERNAL_VAR_XFACE
AcpiError (
const char *ModuleName,
UINT32 LineNumber,
const char *Format,
...)
{
va_list args;
 
 
AcpiOsPrintf ("ACPI Error: ");
 
va_start (args, Format);
AcpiOsVprintf (Format, args);
ACPI_COMMON_MSG_SUFFIX;
va_end (args);
}
 
void ACPI_INTERNAL_VAR_XFACE
AcpiException (
const char *ModuleName,
UINT32 LineNumber,
ACPI_STATUS Status,
const char *Format,
...)
{
va_list args;
 
 
AcpiOsPrintf ("ACPI Exception: %s, ", AcpiFormatException (Status));
 
va_start (args, Format);
AcpiOsVprintf (Format, args);
ACPI_COMMON_MSG_SUFFIX;
va_end (args);
}
 
void ACPI_INTERNAL_VAR_XFACE
AcpiWarning (
const char *ModuleName,
UINT32 LineNumber,
const char *Format,
...)
{
va_list args;
 
 
AcpiOsPrintf ("ACPI Warning: ");
 
va_start (args, Format);
AcpiOsVprintf (Format, args);
ACPI_COMMON_MSG_SUFFIX;
va_end (args);
}
 
void ACPI_INTERNAL_VAR_XFACE
AcpiInfo (
const char *ModuleName,
UINT32 LineNumber,
const char *Format,
...)
{
va_list args;
 
 
AcpiOsPrintf ("ACPI: ");
 
va_start (args, Format);
AcpiOsVprintf (Format, args);
AcpiOsPrintf ("\n");
va_end (args);
}
 
ACPI_EXPORT_SYMBOL (AcpiError)
ACPI_EXPORT_SYMBOL (AcpiException)
ACPI_EXPORT_SYMBOL (AcpiWarning)
ACPI_EXPORT_SYMBOL (AcpiInfo)
 
 
/*******************************************************************************
*
* FUNCTION: AcpiUtPredefinedWarning
*
* PARAMETERS: ModuleName - Caller's module name (for error output)
* LineNumber - Caller's line number (for error output)
* Pathname - Full pathname to the node
* NodeFlags - From Namespace node for the method/object
* Format - Printf format string + additional args
*
* RETURN: None
*
* DESCRIPTION: Warnings for the predefined validation module. Messages are
* only emitted the first time a problem with a particular
* method/object is detected. This prevents a flood of error
* messages for methods that are repeatedly evaluated.
*
******************************************************************************/
 
void ACPI_INTERNAL_VAR_XFACE
AcpiUtPredefinedWarning (
const char *ModuleName,
UINT32 LineNumber,
char *Pathname,
UINT8 NodeFlags,
const char *Format,
...)
{
va_list args;
 
 
/*
* Warning messages for this method/object will be disabled after the
* first time a validation fails or an object is successfully repaired.
*/
if (NodeFlags & ANOBJ_EVALUATED)
{
return;
}
 
AcpiOsPrintf ("ACPI Warning for %s: ", Pathname);
 
va_start (args, Format);
AcpiOsVprintf (Format, args);
ACPI_COMMON_MSG_SUFFIX;
va_end (args);
}
 
/*******************************************************************************
*
* FUNCTION: AcpiUtPredefinedInfo
*
* PARAMETERS: ModuleName - Caller's module name (for error output)
* LineNumber - Caller's line number (for error output)
* Pathname - Full pathname to the node
* NodeFlags - From Namespace node for the method/object
* Format - Printf format string + additional args
*
* RETURN: None
*
* DESCRIPTION: Info messages for the predefined validation module. Messages
* are only emitted the first time a problem with a particular
* method/object is detected. This prevents a flood of
* messages for methods that are repeatedly evaluated.
*
******************************************************************************/
 
void ACPI_INTERNAL_VAR_XFACE
AcpiUtPredefinedInfo (
const char *ModuleName,
UINT32 LineNumber,
char *Pathname,
UINT8 NodeFlags,
const char *Format,
...)
{
va_list args;
 
 
/*
* Warning messages for this method/object will be disabled after the
* first time a validation fails or an object is successfully repaired.
*/
if (NodeFlags & ANOBJ_EVALUATED)
{
return;
}
 
AcpiOsPrintf ("ACPI Info for %s: ", Pathname);
 
va_start (args, Format);
AcpiOsVprintf (Format, args);
ACPI_COMMON_MSG_SUFFIX;
va_end (args);
}
/drivers/devman/acpica/utilities/utmutex.c
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
182,6 → 182,13
return_ACPI_STATUS (Status);
}
 
/* Mutex for _OSI support */
Status = AcpiOsCreateMutex (&AcpiGbl_OsiMutex);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
}
 
/* Create the reader/writer lock for namespace access */
 
Status = AcpiUtCreateRwLock (&AcpiGbl_NamespaceRwLock);
219,6 → 226,8
AcpiUtDeleteMutex (i);
}
 
AcpiOsDeleteMutex (AcpiGbl_OsiMutex);
 
/* Delete the spinlocks */
 
AcpiOsDeleteLock (AcpiGbl_GpeLock);
339,16 → 348,16
if (i == MutexId)
{
ACPI_ERROR ((AE_INFO,
"Mutex [%s] already acquired by this thread [%p]",
"Mutex [%s] already acquired by this thread [%u]",
AcpiUtGetMutexName (MutexId),
ACPI_CAST_PTR (void, ThisThreadId)));
(UINT32) ThisThreadId));
 
return (AE_ALREADY_ACQUIRED);
}
 
ACPI_ERROR ((AE_INFO,
"Invalid acquire order: Thread %p owns [%s], wants [%s]",
ACPI_CAST_PTR (void, ThisThreadId), AcpiUtGetMutexName (i),
"Invalid acquire order: Thread %u owns [%s], wants [%s]",
(UINT32) ThisThreadId, AcpiUtGetMutexName (i),
AcpiUtGetMutexName (MutexId)));
 
return (AE_ACQUIRE_DEADLOCK);
358,15 → 367,15
#endif
 
ACPI_DEBUG_PRINT ((ACPI_DB_MUTEX,
"Thread %p attempting to acquire Mutex [%s]\n",
ACPI_CAST_PTR (void, ThisThreadId), AcpiUtGetMutexName (MutexId)));
"Thread %u attempting to acquire Mutex [%s]\n",
(UINT32) ThisThreadId, AcpiUtGetMutexName (MutexId)));
 
Status = AcpiOsAcquireMutex (AcpiGbl_MutexInfo[MutexId].Mutex,
ACPI_WAIT_FOREVER);
if (ACPI_SUCCESS (Status))
{
ACPI_DEBUG_PRINT ((ACPI_DB_MUTEX, "Thread %p acquired Mutex [%s]\n",
ACPI_CAST_PTR (void, ThisThreadId), AcpiUtGetMutexName (MutexId)));
ACPI_DEBUG_PRINT ((ACPI_DB_MUTEX, "Thread %u acquired Mutex [%s]\n",
(UINT32) ThisThreadId, AcpiUtGetMutexName (MutexId)));
 
AcpiGbl_MutexInfo[MutexId].UseCount++;
AcpiGbl_MutexInfo[MutexId].ThreadId = ThisThreadId;
374,8 → 383,8
else
{
ACPI_EXCEPTION ((AE_INFO, Status,
"Thread %p could not acquire Mutex [0x%X]",
ACPI_CAST_PTR (void, ThisThreadId), MutexId));
"Thread %u could not acquire Mutex [0x%X]",
(UINT32) ThisThreadId, MutexId));
}
 
return (Status);
405,8 → 414,8
 
 
ThisThreadId = AcpiOsGetThreadId ();
ACPI_DEBUG_PRINT ((ACPI_DB_MUTEX, "Thread %p releasing Mutex [%s]\n",
ACPI_CAST_PTR (void, ThisThreadId), AcpiUtGetMutexName (MutexId)));
ACPI_DEBUG_PRINT ((ACPI_DB_MUTEX, "Thread %u releasing Mutex [%s]\n",
(UINT32) ThisThreadId, AcpiUtGetMutexName (MutexId)));
 
if (MutexId > ACPI_MAX_MUTEX)
{
/drivers/devman/acpica/utilities/utobject.c
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
/drivers/devman/acpica/utilities/utosi.c
0,0 → 1,494
/******************************************************************************
*
* Module Name: utosi - Support for the _OSI predefined control method
*
*****************************************************************************/
 
/******************************************************************************
*
* 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 __UTOSI_C__
 
#include "acpi.h"
#include "accommon.h"
 
 
#define _COMPONENT ACPI_UTILITIES
ACPI_MODULE_NAME ("utosi")
 
/*
* Strings supported by the _OSI predefined control method (which is
* implemented internally within this module.)
*
* March 2009: Removed "Linux" as this host no longer wants to respond true
* for this string. Basically, the only safe OS strings are windows-related
* and in many or most cases represent the only test path within the
* BIOS-provided ASL code.
*
* The last element of each entry is used to track the newest version of
* Windows that the BIOS has requested.
*/
static ACPI_INTERFACE_INFO AcpiDefaultSupportedInterfaces[] =
{
/* Operating System Vendor Strings */
 
{"Windows 2000", NULL, 0, ACPI_OSI_WIN_2000}, /* Windows 2000 */
{"Windows 2001", NULL, 0, ACPI_OSI_WIN_XP}, /* Windows XP */
{"Windows 2001 SP1", NULL, 0, ACPI_OSI_WIN_XP_SP1}, /* Windows XP SP1 */
{"Windows 2001.1", NULL, 0, ACPI_OSI_WINSRV_2003}, /* Windows Server 2003 */
{"Windows 2001 SP2", NULL, 0, ACPI_OSI_WIN_XP_SP2}, /* Windows XP SP2 */
{"Windows 2001.1 SP1", NULL, 0, ACPI_OSI_WINSRV_2003_SP1}, /* Windows Server 2003 SP1 - Added 03/2006 */
{"Windows 2006", NULL, 0, ACPI_OSI_WIN_VISTA}, /* Windows Vista - Added 03/2006 */
{"Windows 2006.1", NULL, 0, ACPI_OSI_WINSRV_2008}, /* Windows Server 2008 - Added 09/2009 */
{"Windows 2006 SP1", NULL, 0, ACPI_OSI_WIN_VISTA_SP1}, /* Windows Vista SP1 - Added 09/2009 */
{"Windows 2006 SP2", NULL, 0, ACPI_OSI_WIN_VISTA_SP2}, /* Windows Vista SP2 - Added 09/2010 */
{"Windows 2009", NULL, 0, ACPI_OSI_WIN_7}, /* Windows 7 and Server 2008 R2 - Added 09/2009 */
 
/* Feature Group Strings */
 
{"Extended Address Space Descriptor", NULL, 0, 0}
 
/*
* All "optional" feature group strings (features that are implemented
* by the host) should be dynamically added by the host via
* AcpiInstallInterface and should not be manually added here.
*
* Examples of optional feature group strings:
*
* "Module Device"
* "Processor Device"
* "3.0 Thermal Model"
* "3.0 _SCP Extensions"
* "Processor Aggregator Device"
*/
};
 
 
/*******************************************************************************
*
* FUNCTION: AcpiUtInitializeInterfaces
*
* PARAMETERS: None
*
* RETURN: Status
*
* DESCRIPTION: Initialize the global _OSI supported interfaces list
*
******************************************************************************/
 
ACPI_STATUS
AcpiUtInitializeInterfaces (
void)
{
UINT32 i;
 
 
(void) AcpiOsAcquireMutex (AcpiGbl_OsiMutex, ACPI_WAIT_FOREVER);
AcpiGbl_SupportedInterfaces = AcpiDefaultSupportedInterfaces;
 
/* Link the static list of supported interfaces */
 
for (i = 0; i < (ACPI_ARRAY_LENGTH (AcpiDefaultSupportedInterfaces) - 1); i++)
{
AcpiDefaultSupportedInterfaces[i].Next =
&AcpiDefaultSupportedInterfaces[(ACPI_SIZE) i + 1];
}
 
AcpiOsReleaseMutex (AcpiGbl_OsiMutex);
return (AE_OK);
}
 
 
/*******************************************************************************
*
* FUNCTION: AcpiUtInterfaceTerminate
*
* PARAMETERS: None
*
* RETURN: None
*
* DESCRIPTION: Delete all interfaces in the global list. Sets
* AcpiGbl_SupportedInterfaces to NULL.
*
******************************************************************************/
 
void
AcpiUtInterfaceTerminate (
void)
{
ACPI_INTERFACE_INFO *NextInterface;
 
 
(void) AcpiOsAcquireMutex (AcpiGbl_OsiMutex, ACPI_WAIT_FOREVER);
NextInterface = AcpiGbl_SupportedInterfaces;
 
while (NextInterface)
{
AcpiGbl_SupportedInterfaces = NextInterface->Next;
 
/* Only interfaces added at runtime can be freed */
 
if (NextInterface->Flags & ACPI_OSI_DYNAMIC)
{
ACPI_FREE (NextInterface->Name);
ACPI_FREE (NextInterface);
}
 
NextInterface = AcpiGbl_SupportedInterfaces;
}
 
AcpiOsReleaseMutex (AcpiGbl_OsiMutex);
}
 
 
/*******************************************************************************
*
* FUNCTION: AcpiUtInstallInterface
*
* PARAMETERS: InterfaceName - The interface to install
*
* RETURN: Status
*
* DESCRIPTION: Install the interface into the global interface list.
* Caller MUST hold AcpiGbl_OsiMutex
*
******************************************************************************/
 
ACPI_STATUS
AcpiUtInstallInterface (
ACPI_STRING InterfaceName)
{
ACPI_INTERFACE_INFO *InterfaceInfo;
 
 
/* Allocate info block and space for the name string */
 
InterfaceInfo = ACPI_ALLOCATE_ZEROED (sizeof (ACPI_INTERFACE_INFO));
if (!InterfaceInfo)
{
return (AE_NO_MEMORY);
}
 
InterfaceInfo->Name = ACPI_ALLOCATE_ZEROED (ACPI_STRLEN (InterfaceName) + 1);
if (!InterfaceInfo->Name)
{
ACPI_FREE (InterfaceInfo);
return (AE_NO_MEMORY);
}
 
/* Initialize new info and insert at the head of the global list */
 
ACPI_STRCPY (InterfaceInfo->Name, InterfaceName);
InterfaceInfo->Flags = ACPI_OSI_DYNAMIC;
InterfaceInfo->Next = AcpiGbl_SupportedInterfaces;
 
AcpiGbl_SupportedInterfaces = InterfaceInfo;
return (AE_OK);
}
 
 
/*******************************************************************************
*
* FUNCTION: AcpiUtRemoveInterface
*
* PARAMETERS: InterfaceName - The interface to remove
*
* RETURN: Status
*
* DESCRIPTION: Remove the interface from the global interface list.
* Caller MUST hold AcpiGbl_OsiMutex
*
******************************************************************************/
 
ACPI_STATUS
AcpiUtRemoveInterface (
ACPI_STRING InterfaceName)
{
ACPI_INTERFACE_INFO *PreviousInterface;
ACPI_INTERFACE_INFO *NextInterface;
 
 
PreviousInterface = NextInterface = AcpiGbl_SupportedInterfaces;
while (NextInterface)
{
if (!ACPI_STRCMP (InterfaceName, NextInterface->Name))
{
/* Found: name is in either the static list or was added at runtime */
 
if (NextInterface->Flags & ACPI_OSI_DYNAMIC)
{
/* Interface was added dynamically, remove and free it */
 
if (PreviousInterface == NextInterface)
{
AcpiGbl_SupportedInterfaces = NextInterface->Next;
}
else
{
PreviousInterface->Next = NextInterface->Next;
}
 
ACPI_FREE (NextInterface->Name);
ACPI_FREE (NextInterface);
}
else
{
/*
* Interface is in static list. If marked invalid, then it
* does not actually exist. Else, mark it invalid.
*/
if (NextInterface->Flags & ACPI_OSI_INVALID)
{
return (AE_NOT_EXIST);
}
 
NextInterface->Flags |= ACPI_OSI_INVALID;
}
 
return (AE_OK);
}
 
PreviousInterface = NextInterface;
NextInterface = NextInterface->Next;
}
 
/* Interface was not found */
 
return (AE_NOT_EXIST);
}
 
 
/*******************************************************************************
*
* FUNCTION: AcpiUtGetInterface
*
* PARAMETERS: InterfaceName - The interface to find
*
* RETURN: ACPI_INTERFACE_INFO if found. NULL if not found.
*
* DESCRIPTION: Search for the specified interface name in the global list.
* Caller MUST hold AcpiGbl_OsiMutex
*
******************************************************************************/
 
ACPI_INTERFACE_INFO *
AcpiUtGetInterface (
ACPI_STRING InterfaceName)
{
ACPI_INTERFACE_INFO *NextInterface;
 
 
NextInterface = AcpiGbl_SupportedInterfaces;
while (NextInterface)
{
if (!ACPI_STRCMP (InterfaceName, NextInterface->Name))
{
return (NextInterface);
}
 
NextInterface = NextInterface->Next;
}
 
return (NULL);
}
 
 
/*******************************************************************************
*
* FUNCTION: AcpiUtOsiImplementation
*
* PARAMETERS: WalkState - Current walk state
*
* RETURN: Status
*
* DESCRIPTION: Implementation of the _OSI predefined control method. When
* an invocation of _OSI is encountered in the system AML,
* control is transferred to this function.
*
******************************************************************************/
 
ACPI_STATUS
AcpiUtOsiImplementation (
ACPI_WALK_STATE *WalkState)
{
ACPI_OPERAND_OBJECT *StringDesc;
ACPI_OPERAND_OBJECT *ReturnDesc;
ACPI_INTERFACE_INFO *InterfaceInfo;
ACPI_INTERFACE_HANDLER InterfaceHandler;
UINT32 ReturnValue;
 
 
ACPI_FUNCTION_TRACE (UtOsiImplementation);
 
 
/* Validate the string input argument (from the AML caller) */
 
StringDesc = WalkState->Arguments[0].Object;
if (!StringDesc ||
(StringDesc->Common.Type != ACPI_TYPE_STRING))
{
return_ACPI_STATUS (AE_TYPE);
}
 
/* Create a return object */
 
ReturnDesc = AcpiUtCreateInternalObject (ACPI_TYPE_INTEGER);
if (!ReturnDesc)
{
return_ACPI_STATUS (AE_NO_MEMORY);
}
 
/* Default return value is 0, NOT SUPPORTED */
 
ReturnValue = 0;
(void) AcpiOsAcquireMutex (AcpiGbl_OsiMutex, ACPI_WAIT_FOREVER);
 
/* Lookup the interface in the global _OSI list */
 
InterfaceInfo = AcpiUtGetInterface (StringDesc->String.Pointer);
if (InterfaceInfo &&
!(InterfaceInfo->Flags & ACPI_OSI_INVALID))
{
/*
* The interface is supported.
* Update the OsiData if necessary. We keep track of the latest
* version of Windows that has been requested by the BIOS.
*/
if (InterfaceInfo->Value > AcpiGbl_OsiData)
{
AcpiGbl_OsiData = InterfaceInfo->Value;
}
 
ReturnValue = ACPI_UINT32_MAX;
}
 
AcpiOsReleaseMutex (AcpiGbl_OsiMutex);
 
/*
* Invoke an optional _OSI interface handler. The host OS may wish
* to do some interface-specific handling. For example, warn about
* certain interfaces or override the true/false support value.
*/
InterfaceHandler = AcpiGbl_InterfaceHandler;
if (InterfaceHandler)
{
ReturnValue = InterfaceHandler (
StringDesc->String.Pointer, ReturnValue);
}
 
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO,
"ACPI: BIOS _OSI(\"%s\") is %ssupported\n",
StringDesc->String.Pointer, ReturnValue == 0 ? "not " : ""));
 
/* Complete the return object */
 
ReturnDesc->Integer.Value = ReturnValue;
WalkState->ReturnDesc = ReturnDesc;
return_ACPI_STATUS (AE_OK);
}
/drivers/devman/acpica/utilities/utresrc.c
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
/drivers/devman/acpica/utilities/utstate.c
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
/drivers/devman/acpica/utilities/uttrack.c
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
/drivers/devman/acpica/utilities/utxface.c
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
193,6 → 193,15
return_ACPI_STATUS (Status);
}
 
/* Initialize the global OSI interfaces list with the static names */
 
Status = AcpiUtInitializeInterfaces ();
if (ACPI_FAILURE (Status))
{
ACPI_EXCEPTION ((AE_INFO, Status, "During OSI interfaces initialization"));
return_ACPI_STATUS (Status);
}
 
/* If configured, initialize the AML debugger */
 
ACPI_DEBUGGER_EXEC (Status = AcpiDbInitialize ());
403,27 → 412,6
}
 
/*
* Initialize the GPE blocks defined in the FADT (GPE block 0 and 1).
* The runtime GPEs are enabled here.
*
* This is where the _PRW methods are executed for the GPEs. These
* methods can only be executed after the SCI and Global Lock handlers are
* installed and initialized.
*
* GPEs can only be enabled after the _REG, _STA, and _INI methods have
* been run. This ensures that all Operation Regions and all Devices have
* been initialized and are ready.
*/
if (!(Flags & ACPI_NO_EVENT_INIT))
{
Status = AcpiEvInstallFadtGpes ();
if (ACPI_FAILURE (Status))
{
return (Status);
}
}
 
/*
* Empty the caches (delete the cached objects) on the assumption that
* the table load filled them up more than they will be at runtime --
* thus wasting non-paged memory.
730,5 → 718,144
 
ACPI_EXPORT_SYMBOL (AcpiPurgeCachedObjects)
 
#endif /* ACPI_ASL_COMPILER */
 
/*****************************************************************************
*
* FUNCTION: AcpiInstallInterface
*
* PARAMETERS: InterfaceName - The interface to install
*
* RETURN: Status
*
* DESCRIPTION: Install an _OSI interface to the global list
*
****************************************************************************/
 
ACPI_STATUS
AcpiInstallInterface (
ACPI_STRING InterfaceName)
{
ACPI_STATUS Status;
ACPI_INTERFACE_INFO *InterfaceInfo;
 
 
/* Parameter validation */
 
if (!InterfaceName || (ACPI_STRLEN (InterfaceName) == 0))
{
return (AE_BAD_PARAMETER);
}
 
(void) AcpiOsAcquireMutex (AcpiGbl_OsiMutex, ACPI_WAIT_FOREVER);
 
/* Check if the interface name is already in the global list */
 
InterfaceInfo = AcpiUtGetInterface (InterfaceName);
if (InterfaceInfo)
{
/*
* The interface already exists in the list. This is OK if the
* interface has been marked invalid -- just clear the bit.
*/
if (InterfaceInfo->Flags & ACPI_OSI_INVALID)
{
InterfaceInfo->Flags &= ~ACPI_OSI_INVALID;
Status = AE_OK;
}
else
{
Status = AE_ALREADY_EXISTS;
}
}
else
{
/* New interface name, install into the global list */
 
Status = AcpiUtInstallInterface (InterfaceName);
}
 
AcpiOsReleaseMutex (AcpiGbl_OsiMutex);
return (Status);
}
 
ACPI_EXPORT_SYMBOL (AcpiInstallInterface)
 
 
/*****************************************************************************
*
* FUNCTION: AcpiRemoveInterface
*
* PARAMETERS: InterfaceName - The interface to remove
*
* RETURN: Status
*
* DESCRIPTION: Remove an _OSI interface from the global list
*
****************************************************************************/
 
ACPI_STATUS
AcpiRemoveInterface (
ACPI_STRING InterfaceName)
{
ACPI_STATUS Status;
 
 
/* Parameter validation */
 
if (!InterfaceName || (ACPI_STRLEN (InterfaceName) == 0))
{
return (AE_BAD_PARAMETER);
}
 
(void) AcpiOsAcquireMutex (AcpiGbl_OsiMutex, ACPI_WAIT_FOREVER);
 
Status = AcpiUtRemoveInterface (InterfaceName);
 
AcpiOsReleaseMutex (AcpiGbl_OsiMutex);
return (Status);
}
 
ACPI_EXPORT_SYMBOL (AcpiRemoveInterface)
 
 
/*****************************************************************************
*
* FUNCTION: AcpiInstallInterfaceHandler
*
* PARAMETERS: Handler - The _OSI interface handler to install
* NULL means "remove existing handler"
*
* RETURN: Status
*
* DESCRIPTION: Install a handler for the predefined _OSI ACPI method.
* invoked during execution of the internal implementation of
* _OSI. A NULL handler simply removes any existing handler.
*
****************************************************************************/
 
ACPI_STATUS
AcpiInstallInterfaceHandler (
ACPI_INTERFACE_HANDLER Handler)
{
ACPI_STATUS Status = AE_OK;
 
 
(void) AcpiOsAcquireMutex (AcpiGbl_OsiMutex, ACPI_WAIT_FOREVER);
 
if (Handler && AcpiGbl_InterfaceHandler)
{
Status = AE_ALREADY_EXISTS;
}
else
{
AcpiGbl_InterfaceHandler = Handler;
}
 
AcpiOsReleaseMutex (AcpiGbl_OsiMutex);
return (Status);
}
 
ACPI_EXPORT_SYMBOL (AcpiInstallInterfaceHandler)
 
#endif /* !ACPI_ASL_COMPILER */
 
/drivers/devman/acpica/utilities/utxferror.c
0,0 → 1,550
/*******************************************************************************
*
* Module Name: utxferror - Various error/warning output functions
*
******************************************************************************/
 
/******************************************************************************
*
* 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 __UTXFERROR_C__
 
#include "acpi.h"
#include "accommon.h"
#include "acnamesp.h"
 
 
#define _COMPONENT ACPI_UTILITIES
ACPI_MODULE_NAME ("utxferror")
 
/*
* This module is used for the in-kernel ACPICA as well as the ACPICA
* tools/applications.
*
* For the iASL compiler case, the output is redirected to stderr so that
* any of the various ACPI errors and warnings do not appear in the output
* files, for either the compiler or disassembler portions of the tool.
*/
#ifdef ACPI_ASL_COMPILER
#include <stdio.h>
 
extern FILE *AcpiGbl_OutputFile;
 
#define ACPI_MSG_REDIRECT_BEGIN \
FILE *OutputFile = AcpiGbl_OutputFile; \
AcpiOsRedirectOutput (stderr);
 
#define ACPI_MSG_REDIRECT_END \
AcpiOsRedirectOutput (OutputFile);
 
#else
/*
* non-iASL case - no redirection, nothing to do
*/
#define ACPI_MSG_REDIRECT_BEGIN
#define ACPI_MSG_REDIRECT_END
#endif
 
/*
* Common message prefixes
*/
#define ACPI_MSG_ERROR "ACPI Error: "
#define ACPI_MSG_EXCEPTION "ACPI Exception: "
#define ACPI_MSG_WARNING "ACPI Warning: "
#define ACPI_MSG_INFO "ACPI: "
 
/*
* Common message suffix
*/
#define ACPI_MSG_SUFFIX \
AcpiOsPrintf (" (%8.8X/%s-%u)\n", ACPI_CA_VERSION, ModuleName, LineNumber)
 
 
/*******************************************************************************
*
* FUNCTION: AcpiError
*
* PARAMETERS: ModuleName - Caller's module name (for error output)
* LineNumber - Caller's line number (for error output)
* Format - Printf format string + additional args
*
* RETURN: None
*
* DESCRIPTION: Print "ACPI Error" message with module/line/version info
*
******************************************************************************/
 
void ACPI_INTERNAL_VAR_XFACE
AcpiError (
const char *ModuleName,
UINT32 LineNumber,
const char *Format,
...)
{
va_list ArgList;
 
 
ACPI_MSG_REDIRECT_BEGIN;
AcpiOsPrintf (ACPI_MSG_ERROR);
 
va_start (ArgList, Format);
AcpiOsVprintf (Format, ArgList);
ACPI_MSG_SUFFIX;
va_end (ArgList);
 
ACPI_MSG_REDIRECT_END;
}
 
ACPI_EXPORT_SYMBOL (AcpiError)
 
 
/*******************************************************************************
*
* FUNCTION: AcpiException
*
* PARAMETERS: ModuleName - Caller's module name (for error output)
* LineNumber - Caller's line number (for error output)
* Status - Status to be formatted
* Format - Printf format string + additional args
*
* RETURN: None
*
* DESCRIPTION: Print "ACPI Exception" message with module/line/version info
* and decoded ACPI_STATUS.
*
******************************************************************************/
 
void ACPI_INTERNAL_VAR_XFACE
AcpiException (
const char *ModuleName,
UINT32 LineNumber,
ACPI_STATUS Status,
const char *Format,
...)
{
va_list ArgList;
 
 
ACPI_MSG_REDIRECT_BEGIN;
AcpiOsPrintf (ACPI_MSG_EXCEPTION "%s, ", AcpiFormatException (Status));
 
va_start (ArgList, Format);
AcpiOsVprintf (Format, ArgList);
ACPI_MSG_SUFFIX;
va_end (ArgList);
 
ACPI_MSG_REDIRECT_END;
}
 
ACPI_EXPORT_SYMBOL (AcpiException)
 
 
/*******************************************************************************
*
* FUNCTION: AcpiWarning
*
* PARAMETERS: ModuleName - Caller's module name (for error output)
* LineNumber - Caller's line number (for error output)
* Format - Printf format string + additional args
*
* RETURN: None
*
* DESCRIPTION: Print "ACPI Warning" message with module/line/version info
*
******************************************************************************/
 
void ACPI_INTERNAL_VAR_XFACE
AcpiWarning (
const char *ModuleName,
UINT32 LineNumber,
const char *Format,
...)
{
va_list ArgList;
 
 
ACPI_MSG_REDIRECT_BEGIN;
AcpiOsPrintf (ACPI_MSG_WARNING);
 
va_start (ArgList, Format);
AcpiOsVprintf (Format, ArgList);
ACPI_MSG_SUFFIX;
va_end (ArgList);
 
ACPI_MSG_REDIRECT_END;
}
 
ACPI_EXPORT_SYMBOL (AcpiWarning)
 
 
/*******************************************************************************
*
* FUNCTION: AcpiInfo
*
* PARAMETERS: ModuleName - Caller's module name (for error output)
* LineNumber - Caller's line number (for error output)
* Format - Printf format string + additional args
*
* RETURN: None
*
* DESCRIPTION: Print generic "ACPI:" information message. There is no
* module/line/version info in order to keep the message simple.
*
* TBD: ModuleName and LineNumber args are not needed, should be removed.
*
******************************************************************************/
 
void ACPI_INTERNAL_VAR_XFACE
AcpiInfo (
const char *ModuleName,
UINT32 LineNumber,
const char *Format,
...)
{
va_list ArgList;
 
 
ACPI_MSG_REDIRECT_BEGIN;
AcpiOsPrintf (ACPI_MSG_INFO);
 
va_start (ArgList, Format);
AcpiOsVprintf (Format, ArgList);
AcpiOsPrintf ("\n");
va_end (ArgList);
 
ACPI_MSG_REDIRECT_END;
}
 
ACPI_EXPORT_SYMBOL (AcpiInfo)
 
 
/*
* The remainder of this module contains internal error functions that may
* be configured out.
*/
#if !defined (ACPI_NO_ERROR_MESSAGES) && !defined (ACPI_BIN_APP)
 
/*******************************************************************************
*
* FUNCTION: AcpiUtPredefinedWarning
*
* PARAMETERS: ModuleName - Caller's module name (for error output)
* LineNumber - Caller's line number (for error output)
* Pathname - Full pathname to the node
* NodeFlags - From Namespace node for the method/object
* Format - Printf format string + additional args
*
* RETURN: None
*
* DESCRIPTION: Warnings for the predefined validation module. Messages are
* only emitted the first time a problem with a particular
* method/object is detected. This prevents a flood of error
* messages for methods that are repeatedly evaluated.
*
******************************************************************************/
 
void ACPI_INTERNAL_VAR_XFACE
AcpiUtPredefinedWarning (
const char *ModuleName,
UINT32 LineNumber,
char *Pathname,
UINT8 NodeFlags,
const char *Format,
...)
{
va_list ArgList;
 
 
/*
* Warning messages for this method/object will be disabled after the
* first time a validation fails or an object is successfully repaired.
*/
if (NodeFlags & ANOBJ_EVALUATED)
{
return;
}
 
AcpiOsPrintf (ACPI_MSG_WARNING "For %s: ", Pathname);
 
va_start (ArgList, Format);
AcpiOsVprintf (Format, ArgList);
ACPI_MSG_SUFFIX;
va_end (ArgList);
}
 
 
/*******************************************************************************
*
* FUNCTION: AcpiUtPredefinedInfo
*
* PARAMETERS: ModuleName - Caller's module name (for error output)
* LineNumber - Caller's line number (for error output)
* Pathname - Full pathname to the node
* NodeFlags - From Namespace node for the method/object
* Format - Printf format string + additional args
*
* RETURN: None
*
* DESCRIPTION: Info messages for the predefined validation module. Messages
* are only emitted the first time a problem with a particular
* method/object is detected. This prevents a flood of
* messages for methods that are repeatedly evaluated.
*
******************************************************************************/
 
void ACPI_INTERNAL_VAR_XFACE
AcpiUtPredefinedInfo (
const char *ModuleName,
UINT32 LineNumber,
char *Pathname,
UINT8 NodeFlags,
const char *Format,
...)
{
va_list ArgList;
 
 
/*
* Warning messages for this method/object will be disabled after the
* first time a validation fails or an object is successfully repaired.
*/
if (NodeFlags & ANOBJ_EVALUATED)
{
return;
}
 
AcpiOsPrintf (ACPI_MSG_INFO "For %s: ", Pathname);
 
va_start (ArgList, Format);
AcpiOsVprintf (Format, ArgList);
ACPI_MSG_SUFFIX;
va_end (ArgList);
}
 
 
/*******************************************************************************
*
* FUNCTION: AcpiUtNamespaceError
*
* PARAMETERS: ModuleName - Caller's module name (for error output)
* LineNumber - Caller's line number (for error output)
* InternalName - Name or path of the namespace node
* LookupStatus - Exception code from NS lookup
*
* RETURN: None
*
* DESCRIPTION: Print error message with the full pathname for the NS node.
*
******************************************************************************/
 
void
AcpiUtNamespaceError (
const char *ModuleName,
UINT32 LineNumber,
const char *InternalName,
ACPI_STATUS LookupStatus)
{
ACPI_STATUS Status;
UINT32 BadName;
char *Name = NULL;
 
 
ACPI_MSG_REDIRECT_BEGIN;
AcpiOsPrintf (ACPI_MSG_ERROR);
 
if (LookupStatus == AE_BAD_CHARACTER)
{
/* There is a non-ascii character in the name */
 
ACPI_MOVE_32_TO_32 (&BadName, ACPI_CAST_PTR (UINT32, InternalName));
AcpiOsPrintf ("[0x%4.4X] (NON-ASCII)", BadName);
}
else
{
/* Convert path to external format */
 
Status = AcpiNsExternalizeName (ACPI_UINT32_MAX,
InternalName, NULL, &Name);
 
/* Print target name */
 
if (ACPI_SUCCESS (Status))
{
AcpiOsPrintf ("[%s]", Name);
}
else
{
AcpiOsPrintf ("[COULD NOT EXTERNALIZE NAME]");
}
 
if (Name)
{
ACPI_FREE (Name);
}
}
 
AcpiOsPrintf (" Namespace lookup failure, %s",
AcpiFormatException (LookupStatus));
 
ACPI_MSG_SUFFIX;
ACPI_MSG_REDIRECT_END;
}
 
 
/*******************************************************************************
*
* FUNCTION: AcpiUtMethodError
*
* PARAMETERS: ModuleName - Caller's module name (for error output)
* LineNumber - Caller's line number (for error output)
* Message - Error message to use on failure
* PrefixNode - Prefix relative to the path
* Path - Path to the node (optional)
* MethodStatus - Execution status
*
* RETURN: None
*
* DESCRIPTION: Print error message with the full pathname for the method.
*
******************************************************************************/
 
void
AcpiUtMethodError (
const char *ModuleName,
UINT32 LineNumber,
const char *Message,
ACPI_NAMESPACE_NODE *PrefixNode,
const char *Path,
ACPI_STATUS MethodStatus)
{
ACPI_STATUS Status;
ACPI_NAMESPACE_NODE *Node = PrefixNode;
 
 
ACPI_MSG_REDIRECT_BEGIN;
AcpiOsPrintf (ACPI_MSG_ERROR);
 
if (Path)
{
Status = AcpiNsGetNode (PrefixNode, Path, ACPI_NS_NO_UPSEARCH,
&Node);
if (ACPI_FAILURE (Status))
{
AcpiOsPrintf ("[Could not get node by pathname]");
}
}
 
AcpiNsPrintNodePathname (Node, Message);
AcpiOsPrintf (", %s", AcpiFormatException (MethodStatus));
 
ACPI_MSG_SUFFIX;
ACPI_MSG_REDIRECT_END;
}
 
#endif /* ACPI_NO_ERROR_MESSAGES */