2005-04-17 00:20:36 +02:00
|
|
|
/******************************************************************************
|
|
|
|
*
|
2012-12-19 06:36:49 +01:00
|
|
|
* Name: acenv.h - Host and compiler configuration
|
2005-04-17 00:20:36 +02:00
|
|
|
*
|
|
|
|
*****************************************************************************/
|
|
|
|
|
|
|
|
/*
|
2013-01-25 06:38:56 +01:00
|
|
|
* Copyright (C) 2000 - 2013, Intel Corp.
|
2005-04-17 00:20:36 +02:00
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
|
* modification, are permitted provided that the following conditions
|
|
|
|
* are met:
|
|
|
|
* 1. Redistributions of source code must retain the above copyright
|
|
|
|
* notice, this list of conditions, and the following disclaimer,
|
|
|
|
* without modification.
|
|
|
|
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
|
|
|
|
* substantially similar to the "NO WARRANTY" disclaimer below
|
|
|
|
* ("Disclaimer") and any redistribution must be conditioned upon
|
|
|
|
* including a substantially similar Disclaimer requirement for further
|
|
|
|
* binary redistribution.
|
|
|
|
* 3. Neither the names of the above-listed copyright holders nor the names
|
|
|
|
* of any contributors may be used to endorse or promote products derived
|
|
|
|
* from this software without specific prior written permission.
|
|
|
|
*
|
|
|
|
* Alternatively, this software may be distributed under the terms of the
|
|
|
|
* GNU General Public License ("GPL") version 2 as published by the Free
|
|
|
|
* Software Foundation.
|
|
|
|
*
|
|
|
|
* NO WARRANTY
|
|
|
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
|
|
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
|
|
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
|
|
|
|
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
|
|
* HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
|
|
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
|
|
|
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
|
|
|
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
|
|
|
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
|
|
|
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
|
|
|
* POSSIBILITY OF SUCH DAMAGES.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __ACENV_H__
|
|
|
|
#define __ACENV_H__
|
|
|
|
|
2012-12-20 02:07:15 +01:00
|
|
|
/*
|
|
|
|
* Environment configuration. The purpose of this file is to interface ACPICA
|
|
|
|
* to the local environment. This includes compiler-specific, OS-specific,
|
|
|
|
* and machine-specific configuration.
|
|
|
|
*/
|
2012-12-19 06:37:15 +01:00
|
|
|
|
2008-12-30 20:03:29 +01:00
|
|
|
/* Types for ACPI_MUTEX_TYPE */
|
|
|
|
|
|
|
|
#define ACPI_BINARY_SEMAPHORE 0
|
|
|
|
#define ACPI_OSL_MUTEX 1
|
|
|
|
|
|
|
|
/* Types for DEBUGGER_THREADING */
|
|
|
|
|
|
|
|
#define DEBUGGER_SINGLE_THREADED 0
|
|
|
|
#define DEBUGGER_MULTI_THREADED 1
|
|
|
|
|
|
|
|
/******************************************************************************
|
|
|
|
*
|
2005-04-17 00:20:36 +02:00
|
|
|
* Configuration for ACPI tools and utilities
|
2008-12-30 20:03:29 +01:00
|
|
|
*
|
|
|
|
*****************************************************************************/
|
|
|
|
|
2012-12-19 06:36:49 +01:00
|
|
|
/* iASL configuration */
|
2012-12-19 06:37:15 +01:00
|
|
|
|
ACPI: ACPICA 20060421
Removed a device initialization optimization introduced in
20051216 where the _STA method was not run unless an _INI
was also present for the same device. This optimization
could cause problems because it could allow _INI methods
to be run within a not-present device subtree (If a
not-present device had no _INI, _STA would not be run,
the not-present status would not be discovered, and the
children of the device would be incorrectly traversed.)
Implemented a new _STA optimization where namespace
subtrees that do not contain _INI are identified and
ignored during device initialization. Selectively running
_STA can significantly improve boot time on large machines
(with assistance from Len Brown.)
Implemented support for the device initialization case
where the returned _STA flags indicate a device not-present
but functioning. In this case, _INI is not run, but the
device children are examined for presence, as per the
ACPI specification.
Implemented an additional change to the IndexField support
in order to conform to MS behavior. The value written to
the Index Register is not simply a byte offset, it is a
byte offset in units of the access width of the parent
Index Field. (Fiodor Suietov)
Defined and deployed a new OSL interface,
acpi_os_validate_address(). This interface is called during
the creation of all AML operation regions, and allows
the host OS to exert control over what addresses it will
allow the AML code to access. Operation Regions whose
addresses are disallowed will cause a runtime exception
when they are actually accessed (will not affect or abort
table loading.)
Defined and deployed a new OSL interface,
acpi_os_validate_interface(). This interface allows the host OS
to match the various "optional" interface/behavior strings
for the _OSI predefined control method as appropriate
(with assistance from Bjorn Helgaas.)
Restructured and corrected various problems in the
exception handling code paths within DsCallControlMethod
and DsTerminateControlMethod in dsmethod (with assistance
from Takayoshi Kochi.)
Modified the Linux source converter to ignore quoted string
literals while converting identifiers from mixed to lower
case. This will correct problems with the disassembler
and other areas where such strings must not be modified.
The ACPI_FUNCTION_* macros no longer require quotes around
the function name. This allows the Linux source converter
to convert the names, now that the converter ignores
quoted strings.
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2006-04-21 23:15:00 +02:00
|
|
|
#ifdef ACPI_ASL_COMPILER
|
2005-04-17 00:20:36 +02:00
|
|
|
#define ACPI_APPLICATION
|
|
|
|
#define ACPI_DISASSEMBLER
|
2012-12-19 06:37:03 +01:00
|
|
|
#define ACPI_DEBUG_OUTPUT
|
ACPI: ACPICA 20060421
Removed a device initialization optimization introduced in
20051216 where the _STA method was not run unless an _INI
was also present for the same device. This optimization
could cause problems because it could allow _INI methods
to be run within a not-present device subtree (If a
not-present device had no _INI, _STA would not be run,
the not-present status would not be discovered, and the
children of the device would be incorrectly traversed.)
Implemented a new _STA optimization where namespace
subtrees that do not contain _INI are identified and
ignored during device initialization. Selectively running
_STA can significantly improve boot time on large machines
(with assistance from Len Brown.)
Implemented support for the device initialization case
where the returned _STA flags indicate a device not-present
but functioning. In this case, _INI is not run, but the
device children are examined for presence, as per the
ACPI specification.
Implemented an additional change to the IndexField support
in order to conform to MS behavior. The value written to
the Index Register is not simply a byte offset, it is a
byte offset in units of the access width of the parent
Index Field. (Fiodor Suietov)
Defined and deployed a new OSL interface,
acpi_os_validate_address(). This interface is called during
the creation of all AML operation regions, and allows
the host OS to exert control over what addresses it will
allow the AML code to access. Operation Regions whose
addresses are disallowed will cause a runtime exception
when they are actually accessed (will not affect or abort
table loading.)
Defined and deployed a new OSL interface,
acpi_os_validate_interface(). This interface allows the host OS
to match the various "optional" interface/behavior strings
for the _OSI predefined control method as appropriate
(with assistance from Bjorn Helgaas.)
Restructured and corrected various problems in the
exception handling code paths within DsCallControlMethod
and DsTerminateControlMethod in dsmethod (with assistance
from Takayoshi Kochi.)
Modified the Linux source converter to ignore quoted string
literals while converting identifiers from mixed to lower
case. This will correct problems with the disassembler
and other areas where such strings must not be modified.
The ACPI_FUNCTION_* macros no longer require quotes around
the function name. This allows the Linux source converter
to convert the names, now that the converter ignores
quoted strings.
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2006-04-21 23:15:00 +02:00
|
|
|
#define ACPI_CONSTANT_EVAL_ONLY
|
2006-10-03 06:00:00 +02:00
|
|
|
#define ACPI_LARGE_NAMESPACE_NODE
|
ACPI: ACPICA 20060331
Implemented header file support for the following
additional ACPI tables: ASF!, BOOT, CPEP, DBGP, MCFG, SPCR,
SPMI, TCPA, and WDRT. With this support, all current and
known ACPI tables are now defined in the ACPICA headers and
are available for use by device drivers and other software.
Implemented support to allow tables that contain ACPI
names with invalid characters to be loaded. Previously,
this would cause the table load to fail, but since
there are several known cases of such tables on
existing machines, this change was made to enable
ACPI support for them. Also, this matches the
behavior of the Microsoft ACPI implementation.
https://bugzilla.novell.com/show_bug.cgi?id=147621
Fixed a couple regressions introduced during the memory
optimization in the 20060317 release. The namespace
node definition required additional reorganization and
an internal datatype that had been changed to 8-bit was
restored to 32-bit. (Valery Podrezov)
Fixed a problem where a null pointer passed to
acpi_ut_delete_generic_state() could be passed through
to acpi_os_release_object which is unexpected. Such
null pointers are now trapped and ignored, matching
the behavior of the previous implementation before the
deployment of acpi_os_release_object(). (Valery Podrezov,
Fiodor Suietov)
Fixed a memory mapping leak during the deletion of
a SystemMemory operation region where a cached memory
mapping was not deleted. This became a noticeable problem
for operation regions that are defined within frequently
used control methods. (Dana Meyers)
Reorganized the ACPI table header files into two main
files: one for the ACPI tables consumed by the ACPICA core,
and another for the miscellaneous ACPI tables that are
consumed by the drivers and other software. The various
FADT definitions were merged into one common section and
three different tables (ACPI 1.0, 1.0+, and 2.0)
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2006-03-31 07:00:00 +02:00
|
|
|
#define ACPI_DATA_TABLE_DISASSEMBLY
|
2012-12-19 06:37:03 +01:00
|
|
|
#define ACPI_SINGLE_THREADED
|
2005-04-17 00:20:36 +02:00
|
|
|
#endif
|
|
|
|
|
2012-12-19 06:36:49 +01:00
|
|
|
/* acpi_exec configuration. Multithreaded with full AML debugger */
|
2012-12-19 06:37:15 +01:00
|
|
|
|
ACPICA 20050617-0624 from Bob Moore <robert.moore@intel.com>
ACPICA 20050617:
Moved the object cache operations into the OS interface
layer (OSL) to allow the host OS to handle these operations
if desired (for example, the Linux OSL will invoke the
slab allocator). This support is optional; the compile
time define ACPI_USE_LOCAL_CACHE may be used to utilize
the original cache code in the ACPI CA core. The new OSL
interfaces are shown below. See utalloc.c for an example
implementation, and acpiosxf.h for the exact interface
definitions. Thanks to Alexey Starikovskiy.
acpi_os_create_cache
acpi_os_delete_cache
acpi_os_purge_cache
acpi_os_acquire_object
acpi_os_release_object
Modified the interfaces to acpi_os_acquire_lock and
acpi_os_release_lock to return and restore a flags
parameter. This fits better with many OS lock models.
Note: the current execution state (interrupt handler
or not) is no longer passed to these interfaces. If
necessary, the OSL must determine this state by itself, a
simple and fast operation. Thanks to Alexey Starikovskiy.
Fixed a problem in the ACPI table handling where a valid
XSDT was assumed present if the revision of the RSDP
was 2 or greater. According to the ACPI specification,
the XSDT is optional in all cases, and the table manager
therefore now checks for both an RSDP >=2 and a valid
XSDT pointer. Otherwise, the RSDT pointer is used.
Some ACPI 2.0 compliant BIOSs contain only the RSDT.
Fixed an interpreter problem with the Mid() operator in the
case of an input string where the resulting output string
is of zero length. It now correctly returns a valid,
null terminated string object instead of a string object
with a null pointer.
Fixed a problem with the control method argument handling
to allow a store to an Arg object that already contains an
object of type Device. The Device object is now correctly
overwritten. Previously, an error was returned.
ACPICA 20050624:
Modified the new OSL cache interfaces to use ACPI_CACHE_T
as the type for the host-defined cache object. This allows
the OSL implementation to define and type this object in
any manner desired, simplifying the OSL implementation.
For example, ACPI_CACHE_T is defined as kmem_cache_t for
Linux, and should be defined in the OS-specific header
file for other operating systems as required.
Changed the interface to AcpiOsAcquireObject to directly
return the requested object as the function return (instead
of ACPI_STATUS.) This change was made for performance
reasons, since this is the purpose of the interface in the
first place. acpi_os_acquire_object is now similar to the
acpi_os_allocate interface. Thanks to Alexey Starikovskiy.
Modified the initialization sequence in
acpi_initialize_subsystem to call the OSL interface
acpi_osl_initialize first, before any local initialization.
This change was required because the global initialization
now calls OSL interfaces.
Restructured the code base to split some files because
of size and/or because the code logically belonged in a
separate file. New files are listed below.
utilities/utcache.c /* Local cache interfaces */
utilities/utmutex.c /* Local mutex support */
utilities/utstate.c /* State object support */
parser/psloop.c /* Main AML parse loop */
Signed-off-by: Len Brown <len.brown@intel.com>
2005-06-24 06:00:00 +02:00
|
|
|
#ifdef ACPI_EXEC_APP
|
2005-04-17 00:20:36 +02:00
|
|
|
#define ACPI_APPLICATION
|
2012-12-19 06:37:03 +01:00
|
|
|
#define ACPI_FULL_DEBUG
|
2005-09-16 22:51:15 +02:00
|
|
|
#define ACPI_MUTEX_DEBUG
|
2006-03-17 22:44:00 +01:00
|
|
|
#define ACPI_DBG_TRACK_ALLOCATIONS
|
2005-04-17 00:20:36 +02:00
|
|
|
#endif
|
|
|
|
|
2012-12-19 06:37:03 +01:00
|
|
|
/* acpi_names configuration. Single threaded with debugger output enabled. */
|
|
|
|
|
|
|
|
#ifdef ACPI_NAMES_APP
|
|
|
|
#define ACPI_DEBUGGER
|
|
|
|
#define ACPI_APPLICATION
|
|
|
|
#define ACPI_SINGLE_THREADED
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/*
|
|
|
|
* acpi_bin/acpi_help/acpi_src configuration. All single threaded, with
|
|
|
|
* no debug output.
|
|
|
|
*/
|
|
|
|
#if (defined ACPI_BIN_APP) || \
|
|
|
|
(defined ACPI_SRC_APP) || \
|
|
|
|
(defined ACPI_XTRACT_APP)
|
|
|
|
#define ACPI_APPLICATION
|
|
|
|
#define ACPI_SINGLE_THREADED
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef ACPI_HELP_APP
|
|
|
|
#define ACPI_APPLICATION
|
|
|
|
#define ACPI_SINGLE_THREADED
|
|
|
|
#define ACPI_NO_ERROR_MESSAGES
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/* Linkable ACPICA library */
|
|
|
|
|
|
|
|
#ifdef ACPI_LIBRARY
|
|
|
|
#define ACPI_USE_LOCAL_CACHE
|
|
|
|
#define ACPI_FUTURE_USAGE
|
|
|
|
#endif
|
|
|
|
|
2012-12-19 06:36:49 +01:00
|
|
|
/* Common for all ACPICA applications */
|
2012-12-19 06:37:15 +01:00
|
|
|
|
ACPICA 20050617-0624 from Bob Moore <robert.moore@intel.com>
ACPICA 20050617:
Moved the object cache operations into the OS interface
layer (OSL) to allow the host OS to handle these operations
if desired (for example, the Linux OSL will invoke the
slab allocator). This support is optional; the compile
time define ACPI_USE_LOCAL_CACHE may be used to utilize
the original cache code in the ACPI CA core. The new OSL
interfaces are shown below. See utalloc.c for an example
implementation, and acpiosxf.h for the exact interface
definitions. Thanks to Alexey Starikovskiy.
acpi_os_create_cache
acpi_os_delete_cache
acpi_os_purge_cache
acpi_os_acquire_object
acpi_os_release_object
Modified the interfaces to acpi_os_acquire_lock and
acpi_os_release_lock to return and restore a flags
parameter. This fits better with many OS lock models.
Note: the current execution state (interrupt handler
or not) is no longer passed to these interfaces. If
necessary, the OSL must determine this state by itself, a
simple and fast operation. Thanks to Alexey Starikovskiy.
Fixed a problem in the ACPI table handling where a valid
XSDT was assumed present if the revision of the RSDP
was 2 or greater. According to the ACPI specification,
the XSDT is optional in all cases, and the table manager
therefore now checks for both an RSDP >=2 and a valid
XSDT pointer. Otherwise, the RSDT pointer is used.
Some ACPI 2.0 compliant BIOSs contain only the RSDT.
Fixed an interpreter problem with the Mid() operator in the
case of an input string where the resulting output string
is of zero length. It now correctly returns a valid,
null terminated string object instead of a string object
with a null pointer.
Fixed a problem with the control method argument handling
to allow a store to an Arg object that already contains an
object of type Device. The Device object is now correctly
overwritten. Previously, an error was returned.
ACPICA 20050624:
Modified the new OSL cache interfaces to use ACPI_CACHE_T
as the type for the host-defined cache object. This allows
the OSL implementation to define and type this object in
any manner desired, simplifying the OSL implementation.
For example, ACPI_CACHE_T is defined as kmem_cache_t for
Linux, and should be defined in the OS-specific header
file for other operating systems as required.
Changed the interface to AcpiOsAcquireObject to directly
return the requested object as the function return (instead
of ACPI_STATUS.) This change was made for performance
reasons, since this is the purpose of the interface in the
first place. acpi_os_acquire_object is now similar to the
acpi_os_allocate interface. Thanks to Alexey Starikovskiy.
Modified the initialization sequence in
acpi_initialize_subsystem to call the OSL interface
acpi_osl_initialize first, before any local initialization.
This change was required because the global initialization
now calls OSL interfaces.
Restructured the code base to split some files because
of size and/or because the code logically belonged in a
separate file. New files are listed below.
utilities/utcache.c /* Local cache interfaces */
utilities/utmutex.c /* Local mutex support */
utilities/utstate.c /* State object support */
parser/psloop.c /* Main AML parse loop */
Signed-off-by: Len Brown <len.brown@intel.com>
2005-06-24 06:00:00 +02:00
|
|
|
#ifdef ACPI_APPLICATION
|
2005-04-17 00:20:36 +02:00
|
|
|
#define ACPI_USE_SYSTEM_CLIBRARY
|
ACPICA 20050617-0624 from Bob Moore <robert.moore@intel.com>
ACPICA 20050617:
Moved the object cache operations into the OS interface
layer (OSL) to allow the host OS to handle these operations
if desired (for example, the Linux OSL will invoke the
slab allocator). This support is optional; the compile
time define ACPI_USE_LOCAL_CACHE may be used to utilize
the original cache code in the ACPI CA core. The new OSL
interfaces are shown below. See utalloc.c for an example
implementation, and acpiosxf.h for the exact interface
definitions. Thanks to Alexey Starikovskiy.
acpi_os_create_cache
acpi_os_delete_cache
acpi_os_purge_cache
acpi_os_acquire_object
acpi_os_release_object
Modified the interfaces to acpi_os_acquire_lock and
acpi_os_release_lock to return and restore a flags
parameter. This fits better with many OS lock models.
Note: the current execution state (interrupt handler
or not) is no longer passed to these interfaces. If
necessary, the OSL must determine this state by itself, a
simple and fast operation. Thanks to Alexey Starikovskiy.
Fixed a problem in the ACPI table handling where a valid
XSDT was assumed present if the revision of the RSDP
was 2 or greater. According to the ACPI specification,
the XSDT is optional in all cases, and the table manager
therefore now checks for both an RSDP >=2 and a valid
XSDT pointer. Otherwise, the RSDT pointer is used.
Some ACPI 2.0 compliant BIOSs contain only the RSDT.
Fixed an interpreter problem with the Mid() operator in the
case of an input string where the resulting output string
is of zero length. It now correctly returns a valid,
null terminated string object instead of a string object
with a null pointer.
Fixed a problem with the control method argument handling
to allow a store to an Arg object that already contains an
object of type Device. The Device object is now correctly
overwritten. Previously, an error was returned.
ACPICA 20050624:
Modified the new OSL cache interfaces to use ACPI_CACHE_T
as the type for the host-defined cache object. This allows
the OSL implementation to define and type this object in
any manner desired, simplifying the OSL implementation.
For example, ACPI_CACHE_T is defined as kmem_cache_t for
Linux, and should be defined in the OS-specific header
file for other operating systems as required.
Changed the interface to AcpiOsAcquireObject to directly
return the requested object as the function return (instead
of ACPI_STATUS.) This change was made for performance
reasons, since this is the purpose of the interface in the
first place. acpi_os_acquire_object is now similar to the
acpi_os_allocate interface. Thanks to Alexey Starikovskiy.
Modified the initialization sequence in
acpi_initialize_subsystem to call the OSL interface
acpi_osl_initialize first, before any local initialization.
This change was required because the global initialization
now calls OSL interfaces.
Restructured the code base to split some files because
of size and/or because the code logically belonged in a
separate file. New files are listed below.
utilities/utcache.c /* Local cache interfaces */
utilities/utmutex.c /* Local mutex support */
utilities/utstate.c /* State object support */
parser/psloop.c /* Main AML parse loop */
Signed-off-by: Len Brown <len.brown@intel.com>
2005-06-24 06:00:00 +02:00
|
|
|
#define ACPI_USE_LOCAL_CACHE
|
2005-04-17 00:20:36 +02:00
|
|
|
#endif
|
|
|
|
|
2012-12-19 06:36:49 +01:00
|
|
|
/* Common debug support */
|
2012-12-19 06:37:15 +01:00
|
|
|
|
ACPI: ACPICA 20060421
Removed a device initialization optimization introduced in
20051216 where the _STA method was not run unless an _INI
was also present for the same device. This optimization
could cause problems because it could allow _INI methods
to be run within a not-present device subtree (If a
not-present device had no _INI, _STA would not be run,
the not-present status would not be discovered, and the
children of the device would be incorrectly traversed.)
Implemented a new _STA optimization where namespace
subtrees that do not contain _INI are identified and
ignored during device initialization. Selectively running
_STA can significantly improve boot time on large machines
(with assistance from Len Brown.)
Implemented support for the device initialization case
where the returned _STA flags indicate a device not-present
but functioning. In this case, _INI is not run, but the
device children are examined for presence, as per the
ACPI specification.
Implemented an additional change to the IndexField support
in order to conform to MS behavior. The value written to
the Index Register is not simply a byte offset, it is a
byte offset in units of the access width of the parent
Index Field. (Fiodor Suietov)
Defined and deployed a new OSL interface,
acpi_os_validate_address(). This interface is called during
the creation of all AML operation regions, and allows
the host OS to exert control over what addresses it will
allow the AML code to access. Operation Regions whose
addresses are disallowed will cause a runtime exception
when they are actually accessed (will not affect or abort
table loading.)
Defined and deployed a new OSL interface,
acpi_os_validate_interface(). This interface allows the host OS
to match the various "optional" interface/behavior strings
for the _OSI predefined control method as appropriate
(with assistance from Bjorn Helgaas.)
Restructured and corrected various problems in the
exception handling code paths within DsCallControlMethod
and DsTerminateControlMethod in dsmethod (with assistance
from Takayoshi Kochi.)
Modified the Linux source converter to ignore quoted string
literals while converting identifiers from mixed to lower
case. This will correct problems with the disassembler
and other areas where such strings must not be modified.
The ACPI_FUNCTION_* macros no longer require quotes around
the function name. This allows the Linux source converter
to convert the names, now that the converter ignores
quoted strings.
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2006-04-21 23:15:00 +02:00
|
|
|
#ifdef ACPI_FULL_DEBUG
|
|
|
|
#define ACPI_DEBUGGER
|
|
|
|
#define ACPI_DEBUG_OUTPUT
|
|
|
|
#define ACPI_DISASSEMBLER
|
|
|
|
#endif
|
|
|
|
|
2005-04-17 00:20:36 +02:00
|
|
|
|
|
|
|
/*! [Begin] no source code translation */
|
|
|
|
|
2012-12-20 02:07:15 +01:00
|
|
|
/******************************************************************************
|
|
|
|
*
|
|
|
|
* Host configuration files. The compiler configuration files are included
|
|
|
|
* by the host files.
|
|
|
|
*
|
|
|
|
*****************************************************************************/
|
2012-12-19 06:37:15 +01:00
|
|
|
|
2007-03-28 02:25:46 +02:00
|
|
|
#if defined(_LINUX) || defined(__linux__)
|
2012-10-02 19:01:25 +02:00
|
|
|
#include <acpi/platform/aclinux.h>
|
2005-04-17 00:20:36 +02:00
|
|
|
|
ACPI: ACPICA 20060331
Implemented header file support for the following
additional ACPI tables: ASF!, BOOT, CPEP, DBGP, MCFG, SPCR,
SPMI, TCPA, and WDRT. With this support, all current and
known ACPI tables are now defined in the ACPICA headers and
are available for use by device drivers and other software.
Implemented support to allow tables that contain ACPI
names with invalid characters to be loaded. Previously,
this would cause the table load to fail, but since
there are several known cases of such tables on
existing machines, this change was made to enable
ACPI support for them. Also, this matches the
behavior of the Microsoft ACPI implementation.
https://bugzilla.novell.com/show_bug.cgi?id=147621
Fixed a couple regressions introduced during the memory
optimization in the 20060317 release. The namespace
node definition required additional reorganization and
an internal datatype that had been changed to 8-bit was
restored to 32-bit. (Valery Podrezov)
Fixed a problem where a null pointer passed to
acpi_ut_delete_generic_state() could be passed through
to acpi_os_release_object which is unexpected. Such
null pointers are now trapped and ignored, matching
the behavior of the previous implementation before the
deployment of acpi_os_release_object(). (Valery Podrezov,
Fiodor Suietov)
Fixed a memory mapping leak during the deletion of
a SystemMemory operation region where a cached memory
mapping was not deleted. This became a noticeable problem
for operation regions that are defined within frequently
used control methods. (Dana Meyers)
Reorganized the ACPI table header files into two main
files: one for the ACPI tables consumed by the ACPICA core,
and another for the miscellaneous ACPI tables that are
consumed by the drivers and other software. The various
FADT definitions were merged into one common section and
three different tables (ACPI 1.0, 1.0+, and 2.0)
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2006-03-31 07:00:00 +02:00
|
|
|
#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
|
2005-04-17 00:20:36 +02:00
|
|
|
#include "acfreebsd.h"
|
|
|
|
|
|
|
|
#elif defined(__NetBSD__)
|
|
|
|
#include "acnetbsd.h"
|
|
|
|
|
2012-12-20 02:07:15 +01:00
|
|
|
#elif defined(__sun)
|
|
|
|
#include "acsolaris.h"
|
|
|
|
|
2005-04-17 00:20:36 +02:00
|
|
|
#elif defined(MODESTO)
|
|
|
|
#include "acmodesto.h"
|
|
|
|
|
|
|
|
#elif defined(NETWARE)
|
|
|
|
#include "acnetware.h"
|
|
|
|
|
2012-12-20 02:07:15 +01:00
|
|
|
#elif defined(_CYGWIN)
|
|
|
|
#include "accygwin.h"
|
2006-01-27 22:43:00 +01:00
|
|
|
|
2012-12-20 02:07:15 +01:00
|
|
|
#elif defined(WIN32)
|
|
|
|
#include "acwin.h"
|
|
|
|
|
|
|
|
#elif defined(WIN64)
|
|
|
|
#include "acwin64.h"
|
2005-04-17 00:20:36 +02:00
|
|
|
|
2012-12-20 02:07:15 +01:00
|
|
|
#elif defined(_WRS_LIB_BUILD)
|
|
|
|
#include "acvxworks.h"
|
2005-04-17 00:20:36 +02:00
|
|
|
|
2012-12-20 02:07:15 +01:00
|
|
|
#elif defined(__OS2__)
|
|
|
|
#include "acos2.h"
|
2005-04-17 00:20:36 +02:00
|
|
|
|
2012-12-20 02:07:15 +01:00
|
|
|
#elif defined(_AED_EFI)
|
|
|
|
#include "acefi.h"
|
|
|
|
|
|
|
|
#elif defined(__HAIKU__)
|
|
|
|
#include "achaiku.h"
|
|
|
|
|
|
|
|
#else
|
|
|
|
|
|
|
|
/* Unknown environment */
|
2005-04-17 00:20:36 +02:00
|
|
|
|
2012-12-20 02:07:15 +01:00
|
|
|
#error Unknown target environment
|
2005-04-17 00:20:36 +02:00
|
|
|
#endif
|
|
|
|
|
|
|
|
/*! [End] no source code translation !*/
|
|
|
|
|
2008-12-30 20:03:29 +01:00
|
|
|
/******************************************************************************
|
|
|
|
*
|
2012-12-20 02:07:15 +01:00
|
|
|
* Setup defaults for the required symbols that were not defined in one of
|
|
|
|
* the host/compiler files above.
|
2008-12-30 20:03:29 +01:00
|
|
|
*
|
|
|
|
*****************************************************************************/
|
|
|
|
|
2012-12-20 02:07:15 +01:00
|
|
|
/* 64-bit data types */
|
|
|
|
|
|
|
|
#ifndef COMPILER_DEPENDENT_INT64
|
|
|
|
#define COMPILER_DEPENDENT_INT64 long long
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef COMPILER_DEPENDENT_UINT64
|
|
|
|
#define COMPILER_DEPENDENT_UINT64 unsigned long long
|
|
|
|
#endif
|
|
|
|
|
2012-12-19 06:36:49 +01:00
|
|
|
/* Type of mutex supported by host. Default is binary semaphores. */
|
2008-12-30 20:03:29 +01:00
|
|
|
#ifndef ACPI_MUTEX_TYPE
|
|
|
|
#define ACPI_MUTEX_TYPE ACPI_BINARY_SEMAPHORE
|
|
|
|
#endif
|
|
|
|
|
2012-12-20 02:07:15 +01:00
|
|
|
/* Global Lock acquire/release */
|
|
|
|
|
|
|
|
#ifndef ACPI_ACQUIRE_GLOBAL_LOCK
|
|
|
|
#define ACPI_ACQUIRE_GLOBAL_LOCK(Glptr, acquired) acquired = 1
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef ACPI_RELEASE_GLOBAL_LOCK
|
|
|
|
#define ACPI_RELEASE_GLOBAL_LOCK(Glptr, pending) pending = 0
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/* Flush CPU cache - used when going to sleep. Wbinvd or similar. */
|
|
|
|
|
|
|
|
#ifndef ACPI_FLUSH_CPU_CACHE
|
|
|
|
#define ACPI_FLUSH_CPU_CACHE()
|
|
|
|
#endif
|
|
|
|
|
2010-09-15 07:36:55 +02:00
|
|
|
/* "inline" keywords - configurable since inline is not standardized */
|
|
|
|
|
|
|
|
#ifndef ACPI_INLINE
|
|
|
|
#define ACPI_INLINE
|
|
|
|
#endif
|
|
|
|
|
2012-12-20 02:07:15 +01:00
|
|
|
/*
|
|
|
|
* Configurable calling conventions:
|
|
|
|
*
|
|
|
|
* ACPI_SYSTEM_XFACE - Interfaces to host OS (handlers, threads)
|
|
|
|
* ACPI_EXTERNAL_XFACE - External ACPI interfaces
|
|
|
|
* ACPI_INTERNAL_XFACE - Internal ACPI interfaces
|
|
|
|
* ACPI_INTERNAL_VAR_XFACE - Internal variable-parameter list interfaces
|
|
|
|
*/
|
|
|
|
#ifndef ACPI_SYSTEM_XFACE
|
|
|
|
#define ACPI_SYSTEM_XFACE
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef ACPI_EXTERNAL_XFACE
|
|
|
|
#define ACPI_EXTERNAL_XFACE
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef ACPI_INTERNAL_XFACE
|
|
|
|
#define ACPI_INTERNAL_XFACE
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef ACPI_INTERNAL_VAR_XFACE
|
|
|
|
#define ACPI_INTERNAL_VAR_XFACE
|
|
|
|
#endif
|
|
|
|
|
2005-04-17 00:20:36 +02:00
|
|
|
/*
|
|
|
|
* Debugger threading model
|
|
|
|
* Use single threaded if the entire subsystem is contained in an application
|
|
|
|
* Use multiple threaded when the subsystem is running in the kernel.
|
|
|
|
*
|
|
|
|
* By default the model is single threaded if ACPI_APPLICATION is set,
|
|
|
|
* multi-threaded if ACPI_APPLICATION is not set.
|
|
|
|
*/
|
|
|
|
#ifndef DEBUGGER_THREADING
|
|
|
|
#ifdef ACPI_APPLICATION
|
|
|
|
#define DEBUGGER_THREADING DEBUGGER_SINGLE_THREADED
|
|
|
|
|
|
|
|
#else
|
|
|
|
#define DEBUGGER_THREADING DEBUGGER_MULTI_THREADED
|
|
|
|
#endif
|
2005-08-05 06:44:28 +02:00
|
|
|
#endif /* !DEBUGGER_THREADING */
|
2005-04-19 04:49:35 +02:00
|
|
|
|
2005-04-17 00:20:36 +02:00
|
|
|
/******************************************************************************
|
|
|
|
*
|
|
|
|
* C library configuration
|
|
|
|
*
|
|
|
|
*****************************************************************************/
|
|
|
|
|
|
|
|
/*
|
2012-12-20 02:07:15 +01:00
|
|
|
* ACPI_USE_SYSTEM_CLIBRARY - Define this if linking to an actual C library.
|
|
|
|
* Otherwise, local versions of string/memory functions will be used.
|
|
|
|
* ACPI_USE_STANDARD_HEADERS - Define this if linking to a C library and
|
|
|
|
* the standard header files may be used.
|
|
|
|
*
|
|
|
|
* The ACPICA subsystem only uses low level C library functions that do not call
|
|
|
|
* operating system services and may therefore be inlined in the code.
|
|
|
|
*
|
|
|
|
* It may be necessary to tailor these include files to the target
|
|
|
|
* generation environment.
|
2005-04-17 00:20:36 +02:00
|
|
|
*/
|
2012-12-20 02:07:15 +01:00
|
|
|
#ifdef ACPI_USE_SYSTEM_CLIBRARY
|
|
|
|
|
|
|
|
/* Use the standard C library headers. We want to keep these to a minimum. */
|
|
|
|
|
2005-04-17 00:20:36 +02:00
|
|
|
#ifdef ACPI_USE_STANDARD_HEADERS
|
2012-12-19 06:37:15 +01:00
|
|
|
|
2012-12-19 06:36:49 +01:00
|
|
|
/* Use the standard headers from the standard locations */
|
2012-12-19 06:37:15 +01:00
|
|
|
|
2005-04-17 00:20:36 +02:00
|
|
|
#include <stdarg.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <string.h>
|
|
|
|
#include <ctype.h>
|
|
|
|
|
2005-08-05 06:44:28 +02:00
|
|
|
#endif /* ACPI_USE_STANDARD_HEADERS */
|
2005-04-17 00:20:36 +02:00
|
|
|
|
2012-12-19 06:36:49 +01:00
|
|
|
/* We will be linking to the standard Clib functions */
|
2012-12-19 06:37:15 +01:00
|
|
|
|
2005-04-17 00:20:36 +02:00
|
|
|
#define ACPI_STRSTR(s1,s2) strstr((s1), (s2))
|
|
|
|
#define ACPI_STRCHR(s1,c) strchr((s1), (c))
|
|
|
|
#define ACPI_STRLEN(s) (acpi_size) strlen((s))
|
|
|
|
#define ACPI_STRCPY(d,s) (void) strcpy((d), (s))
|
|
|
|
#define ACPI_STRNCPY(d,s,n) (void) strncpy((d), (s), (acpi_size)(n))
|
|
|
|
#define ACPI_STRNCMP(d,s,n) strncmp((d), (s), (acpi_size)(n))
|
|
|
|
#define ACPI_STRCMP(d,s) strcmp((d), (s))
|
|
|
|
#define ACPI_STRCAT(d,s) (void) strcat((d), (s))
|
|
|
|
#define ACPI_STRNCAT(d,s,n) strncat((d), (s), (acpi_size)(n))
|
|
|
|
#define ACPI_STRTOUL(d,s,n) strtoul((d), (s), (acpi_size)(n))
|
2005-10-21 06:00:00 +02:00
|
|
|
#define ACPI_MEMCMP(s1,s2,n) memcmp((const char *)(s1), (const char *)(s2), (acpi_size)(n))
|
2005-04-17 00:20:36 +02:00
|
|
|
#define ACPI_MEMCPY(d,s,n) (void) memcpy((d), (s), (acpi_size)(n))
|
|
|
|
#define ACPI_MEMSET(d,s,n) (void) memset((d), (s), (acpi_size)(n))
|
|
|
|
|
2005-07-30 00:15:00 +02:00
|
|
|
#define ACPI_TOUPPER(i) toupper((int) (i))
|
|
|
|
#define ACPI_TOLOWER(i) tolower((int) (i))
|
|
|
|
#define ACPI_IS_XDIGIT(i) isxdigit((int) (i))
|
|
|
|
#define ACPI_IS_DIGIT(i) isdigit((int) (i))
|
|
|
|
#define ACPI_IS_SPACE(i) isspace((int) (i))
|
|
|
|
#define ACPI_IS_UPPER(i) isupper((int) (i))
|
|
|
|
#define ACPI_IS_PRINT(i) isprint((int) (i))
|
|
|
|
#define ACPI_IS_ALPHA(i) isalpha((int) (i))
|
2005-04-17 00:20:36 +02:00
|
|
|
|
2005-04-19 04:49:35 +02:00
|
|
|
#else
|
|
|
|
|
2005-04-17 00:20:36 +02:00
|
|
|
/******************************************************************************
|
|
|
|
*
|
|
|
|
* Not using native C library, use local implementations
|
|
|
|
*
|
|
|
|
*****************************************************************************/
|
|
|
|
|
2012-12-19 06:36:49 +01:00
|
|
|
/*
|
|
|
|
* Use local definitions of C library macros and functions. These function
|
|
|
|
* implementations may not be as efficient as an inline or assembly code
|
|
|
|
* implementation provided by a native C library, but they are functionally
|
|
|
|
* equivalent.
|
|
|
|
*/
|
2005-04-17 00:20:36 +02:00
|
|
|
#ifndef va_arg
|
|
|
|
|
|
|
|
#ifndef _VALIST
|
|
|
|
#define _VALIST
|
|
|
|
typedef char *va_list;
|
2005-08-05 06:44:28 +02:00
|
|
|
#endif /* _VALIST */
|
2005-04-17 00:20:36 +02:00
|
|
|
|
2012-12-19 06:36:49 +01:00
|
|
|
/* Storage alignment properties */
|
2012-12-19 06:37:15 +01:00
|
|
|
|
2006-10-03 06:00:00 +02:00
|
|
|
#define _AUPBND (sizeof (acpi_native_int) - 1)
|
|
|
|
#define _ADNBND (sizeof (acpi_native_int) - 1)
|
2005-04-17 00:20:36 +02:00
|
|
|
|
2012-12-19 06:36:49 +01:00
|
|
|
/* Variable argument list macro definitions */
|
2012-12-19 06:37:15 +01:00
|
|
|
|
2005-04-17 00:20:36 +02:00
|
|
|
#define _bnd(X, bnd) (((sizeof (X)) + (bnd)) & (~(bnd)))
|
|
|
|
#define va_arg(ap, T) (*(T *)(((ap) += (_bnd (T, _AUPBND))) - (_bnd (T,_ADNBND))))
|
2012-12-20 02:07:15 +01:00
|
|
|
#define va_end(ap) (ap = (va_list) NULL)
|
2005-04-17 00:20:36 +02:00
|
|
|
#define va_start(ap, A) (void) ((ap) = (((char *) &(A)) + (_bnd (A,_AUPBND))))
|
|
|
|
|
2005-08-05 06:44:28 +02:00
|
|
|
#endif /* va_arg */
|
2005-04-17 00:20:36 +02:00
|
|
|
|
2012-12-19 06:36:49 +01:00
|
|
|
/* Use the local (ACPICA) definitions of the clib functions */
|
2012-12-19 06:37:15 +01:00
|
|
|
|
2005-04-17 00:20:36 +02:00
|
|
|
#define ACPI_STRSTR(s1,s2) acpi_ut_strstr ((s1), (s2))
|
|
|
|
#define ACPI_STRCHR(s1,c) acpi_ut_strchr ((s1), (c))
|
|
|
|
#define ACPI_STRLEN(s) (acpi_size) acpi_ut_strlen ((s))
|
|
|
|
#define ACPI_STRCPY(d,s) (void) acpi_ut_strcpy ((d), (s))
|
|
|
|
#define ACPI_STRNCPY(d,s,n) (void) acpi_ut_strncpy ((d), (s), (acpi_size)(n))
|
|
|
|
#define ACPI_STRNCMP(d,s,n) acpi_ut_strncmp ((d), (s), (acpi_size)(n))
|
|
|
|
#define ACPI_STRCMP(d,s) acpi_ut_strcmp ((d), (s))
|
|
|
|
#define ACPI_STRCAT(d,s) (void) acpi_ut_strcat ((d), (s))
|
|
|
|
#define ACPI_STRNCAT(d,s,n) acpi_ut_strncat ((d), (s), (acpi_size)(n))
|
|
|
|
#define ACPI_STRTOUL(d,s,n) acpi_ut_strtoul ((d), (s), (acpi_size)(n))
|
2005-10-21 06:00:00 +02:00
|
|
|
#define ACPI_MEMCMP(s1,s2,n) acpi_ut_memcmp((const char *)(s1), (const char *)(s2), (acpi_size)(n))
|
2005-04-17 00:20:36 +02:00
|
|
|
#define ACPI_MEMCPY(d,s,n) (void) acpi_ut_memcpy ((d), (s), (acpi_size)(n))
|
|
|
|
#define ACPI_MEMSET(d,v,n) (void) acpi_ut_memset ((d), (v), (acpi_size)(n))
|
2010-01-21 02:08:31 +01:00
|
|
|
#define ACPI_TOUPPER(c) acpi_ut_to_upper ((int) (c))
|
|
|
|
#define ACPI_TOLOWER(c) acpi_ut_to_lower ((int) (c))
|
2005-04-17 00:20:36 +02:00
|
|
|
|
2005-08-05 06:44:28 +02:00
|
|
|
#endif /* ACPI_USE_SYSTEM_CLIBRARY */
|
2005-04-17 00:20:36 +02:00
|
|
|
|
2005-08-05 06:44:28 +02:00
|
|
|
#endif /* __ACENV_H__ */
|