2005-04-16 22:20:36 +00:00
|
|
|
/******************************************************************************
|
|
|
|
*
|
|
|
|
* Name: acglobal.h - Declarations for global variables
|
|
|
|
*
|
|
|
|
*****************************************************************************/
|
|
|
|
|
|
|
|
/*
|
2008-04-24 03:00:13 +00:00
|
|
|
* Copyright (C) 2000 - 2008, Intel Corp.
|
2005-04-16 22:20:36 +00: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 __ACGLOBAL_H__
|
|
|
|
#define __ACGLOBAL_H__
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Ensure that the globals are actually defined and initialized only once.
|
|
|
|
*
|
|
|
|
* The use of these macros allows a single list of globals (here) in order
|
|
|
|
* to simplify maintenance of the code.
|
|
|
|
*/
|
|
|
|
#ifdef DEFINE_ACPI_GLOBALS
|
|
|
|
#define ACPI_EXTERN
|
|
|
|
#define ACPI_INIT_GLOBAL(a,b) a=b
|
|
|
|
#else
|
|
|
|
#define ACPI_EXTERN extern
|
|
|
|
#define ACPI_INIT_GLOBAL(a,b) a
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/*****************************************************************************
|
|
|
|
*
|
|
|
|
* Runtime configuration (static defaults that can be overriden at runtime)
|
|
|
|
*
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Enable "slack" in the AML interpreter? Default is FALSE, and the
|
|
|
|
* interpreter strictly follows the ACPI specification. Setting to TRUE
|
2005-12-16 22:05:00 +00:00
|
|
|
* allows the interpreter to ignore certain errors and/or bad AML constructs.
|
|
|
|
*
|
|
|
|
* Currently, these features are enabled by this flag:
|
|
|
|
*
|
2005-04-16 22:20:36 +00:00
|
|
|
* 1) Allow "implicit return" of last value in a control method
|
2005-12-16 22:05:00 +00:00
|
|
|
* 2) Allow access beyond the end of an operation region
|
2005-04-16 22:20:36 +00:00
|
|
|
* 3) Allow access to uninitialized locals/args (auto-init to integer 0)
|
|
|
|
* 4) Allow ANY object type to be a source operand for the Store() operator
|
2005-12-16 22:05:00 +00:00
|
|
|
* 5) Allow unresolved references (invalid target name) in package objects
|
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 05:00:00 +00:00
|
|
|
* 6) Enable warning messages for behavior that is not ACPI spec compliant
|
2005-04-16 22:20:36 +00:00
|
|
|
*/
|
2005-08-05 04:44:28 +00:00
|
|
|
ACPI_EXTERN u8 ACPI_INIT_GLOBAL(acpi_gbl_enable_interpreter_slack, FALSE);
|
2005-04-16 22:20:36 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Automatically serialize ALL control methods? Default is FALSE, meaning
|
|
|
|
* to use the Serialized/not_serialized method flags on a per method basis.
|
|
|
|
* Only change this if the ASL code is poorly written and cannot handle
|
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 21:15:00 +00:00
|
|
|
* reentrancy even though methods are marked "NotSerialized".
|
2005-04-16 22:20:36 +00:00
|
|
|
*/
|
2005-08-05 04:44:28 +00:00
|
|
|
ACPI_EXTERN u8 ACPI_INIT_GLOBAL(acpi_gbl_all_methods_serialized, FALSE);
|
2005-04-16 22:20:36 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Create the predefined _OSI method in the namespace? Default is TRUE
|
|
|
|
* because ACPI CA is fully compatible with other ACPI implementations.
|
|
|
|
* Changing this will revert ACPI CA (and machine ASL) to pre-OSI behavior.
|
|
|
|
*/
|
2005-08-05 04:44:28 +00:00
|
|
|
ACPI_EXTERN u8 ACPI_INIT_GLOBAL(acpi_gbl_create_osi_method, TRUE);
|
2005-04-16 22:20:36 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* 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.
|
|
|
|
*/
|
2005-08-05 04:44:28 +00:00
|
|
|
ACPI_EXTERN u8 ACPI_INIT_GLOBAL(acpi_gbl_leave_wake_gpes_disabled, TRUE);
|
2005-04-16 22:20:36 +00:00
|
|
|
|
2007-02-02 16:48:19 +00:00
|
|
|
/*****************************************************************************
|
|
|
|
*
|
|
|
|
* Debug support
|
|
|
|
*
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
/* Runtime configuration of debug print levels */
|
|
|
|
|
|
|
|
extern u32 acpi_dbg_level;
|
|
|
|
extern u32 acpi_dbg_layer;
|
|
|
|
|
|
|
|
/* Procedure nesting level for debug output */
|
|
|
|
|
|
|
|
extern u32 acpi_gbl_nesting_level;
|
|
|
|
|
|
|
|
/* Support for dynamic control method tracing mechanism */
|
|
|
|
|
|
|
|
ACPI_EXTERN u32 acpi_gbl_original_dbg_level;
|
|
|
|
ACPI_EXTERN u32 acpi_gbl_original_dbg_layer;
|
|
|
|
ACPI_EXTERN acpi_name acpi_gbl_trace_method_name;
|
|
|
|
ACPI_EXTERN u32 acpi_gbl_trace_dbg_level;
|
|
|
|
ACPI_EXTERN u32 acpi_gbl_trace_dbg_layer;
|
|
|
|
ACPI_EXTERN u32 acpi_gbl_trace_flags;
|
|
|
|
|
2005-04-16 22:20:36 +00:00
|
|
|
/*****************************************************************************
|
|
|
|
*
|
|
|
|
* ACPI Table globals
|
|
|
|
*
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
/*
|
2007-02-02 16:48:18 +00:00
|
|
|
* acpi_gbl_root_table_list is the master list of ACPI tables found in the
|
|
|
|
* RSDT/XSDT.
|
2005-04-16 22:20:36 +00:00
|
|
|
*
|
2007-02-02 16:48:18 +00:00
|
|
|
* acpi_gbl_FADT is a local copy of the FADT, converted to a common format.
|
2005-04-16 22:20:36 +00:00
|
|
|
*/
|
2007-02-02 16:48:18 +00:00
|
|
|
ACPI_EXTERN struct acpi_internal_rsdt acpi_gbl_root_table_list;
|
|
|
|
ACPI_EXTERN struct acpi_table_fadt acpi_gbl_FADT;
|
2008-06-10 05:42:13 +00:00
|
|
|
extern u8 acpi_gbl_permanent_mmap;
|
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 04:00:00 +00:00
|
|
|
|
2007-02-02 16:48:19 +00:00
|
|
|
/* These addresses are calculated from FADT address values */
|
|
|
|
|
|
|
|
ACPI_EXTERN struct acpi_generic_address acpi_gbl_xpm1a_enable;
|
|
|
|
ACPI_EXTERN struct acpi_generic_address acpi_gbl_xpm1b_enable;
|
|
|
|
|
2005-04-16 22:20:36 +00:00
|
|
|
/*
|
2007-02-02 16:48:18 +00:00
|
|
|
* Handle both ACPI 1.0 and ACPI 2.0 Integer widths. The integer width is
|
|
|
|
* determined by the revision of the DSDT: If the DSDT revision is less than
|
|
|
|
* 2, use only the lower 32 bits of the internal 64-bit Integer.
|
2005-04-16 22:20:36 +00:00
|
|
|
*/
|
2005-08-05 04:44:28 +00:00
|
|
|
ACPI_EXTERN u8 acpi_gbl_integer_bit_width;
|
|
|
|
ACPI_EXTERN u8 acpi_gbl_integer_byte_width;
|
|
|
|
ACPI_EXTERN u8 acpi_gbl_integer_nybble_width;
|
2005-04-16 22:20:36 +00:00
|
|
|
|
2006-06-23 21:04:00 +00:00
|
|
|
/*****************************************************************************
|
|
|
|
*
|
|
|
|
* Mutual exlusion within ACPICA subsystem
|
|
|
|
*
|
|
|
|
****************************************************************************/
|
|
|
|
|
2005-04-16 22:20:36 +00:00
|
|
|
/*
|
2007-02-02 16:48:18 +00:00
|
|
|
* Predefined mutex objects. This array contains the
|
2005-04-16 22:20:36 +00:00
|
|
|
* actual OS mutex handles, indexed by the local ACPI_MUTEX_HANDLEs.
|
|
|
|
* (The table maps local handles to the real OS handles)
|
|
|
|
*/
|
2006-06-08 20:29:00 +00:00
|
|
|
ACPI_EXTERN struct acpi_mutex_info acpi_gbl_mutex_info[ACPI_NUM_MUTEX];
|
2005-04-16 22:20:36 +00:00
|
|
|
|
2006-06-23 21:04:00 +00:00
|
|
|
/*
|
2008-04-10 15:06:37 +00:00
|
|
|
* Global lock mutex is an actual AML mutex object
|
|
|
|
* Global lock semaphore works in conjunction with the HW global lock
|
2006-06-23 21:04:00 +00:00
|
|
|
*/
|
2008-04-10 15:06:37 +00:00
|
|
|
ACPI_EXTERN union acpi_operand_object *acpi_gbl_global_lock_mutex;
|
2006-06-23 21:04:00 +00:00
|
|
|
ACPI_EXTERN acpi_semaphore acpi_gbl_global_lock_semaphore;
|
2008-04-10 15:06:37 +00:00
|
|
|
ACPI_EXTERN u16 acpi_gbl_global_lock_handle;
|
|
|
|
ACPI_EXTERN u8 acpi_gbl_global_lock_acquired;
|
|
|
|
ACPI_EXTERN u8 acpi_gbl_global_lock_present;
|
2006-06-23 21:04:00 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Spinlocks are used for interfaces that can be possibly called at
|
|
|
|
* interrupt level
|
|
|
|
*/
|
|
|
|
ACPI_EXTERN spinlock_t _acpi_gbl_gpe_lock; /* For GPE data structs and registers */
|
|
|
|
ACPI_EXTERN spinlock_t _acpi_gbl_hardware_lock; /* For ACPI H/W except GPE registers */
|
|
|
|
#define acpi_gbl_gpe_lock &_acpi_gbl_gpe_lock
|
|
|
|
#define acpi_gbl_hardware_lock &_acpi_gbl_hardware_lock
|
|
|
|
|
2005-04-16 22:20:36 +00:00
|
|
|
/*****************************************************************************
|
|
|
|
*
|
|
|
|
* Miscellaneous globals
|
|
|
|
*
|
|
|
|
****************************************************************************/
|
|
|
|
|
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 04:00:00 +00:00
|
|
|
#ifdef ACPI_DBG_TRACK_ALLOCATIONS
|
|
|
|
|
|
|
|
/* Lists for tracking memory allocations */
|
|
|
|
|
2005-08-05 04:44:28 +00:00
|
|
|
ACPI_EXTERN struct acpi_memory_list *acpi_gbl_global_list;
|
|
|
|
ACPI_EXTERN struct acpi_memory_list *acpi_gbl_ns_node_list;
|
2007-02-02 16:48:23 +00:00
|
|
|
ACPI_EXTERN u8 acpi_gbl_display_final_mem_stats;
|
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 04:00:00 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
/* Object caches */
|
|
|
|
|
2006-03-17 21:44:00 +00:00
|
|
|
ACPI_EXTERN acpi_cache_t *acpi_gbl_namespace_cache;
|
2005-08-05 04:44:28 +00:00
|
|
|
ACPI_EXTERN acpi_cache_t *acpi_gbl_state_cache;
|
|
|
|
ACPI_EXTERN acpi_cache_t *acpi_gbl_ps_node_cache;
|
|
|
|
ACPI_EXTERN acpi_cache_t *acpi_gbl_ps_node_ext_cache;
|
|
|
|
ACPI_EXTERN acpi_cache_t *acpi_gbl_operand_cache;
|
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 04:00:00 +00:00
|
|
|
|
|
|
|
/* Global handlers */
|
2005-04-16 22:20:36 +00:00
|
|
|
|
2005-08-05 04:44:28 +00:00
|
|
|
ACPI_EXTERN struct acpi_object_notify_handler acpi_gbl_device_notify;
|
|
|
|
ACPI_EXTERN struct acpi_object_notify_handler acpi_gbl_system_notify;
|
|
|
|
ACPI_EXTERN acpi_exception_handler acpi_gbl_exception_handler;
|
|
|
|
ACPI_EXTERN acpi_init_handler acpi_gbl_init_handler;
|
2008-04-10 15:06:38 +00:00
|
|
|
ACPI_EXTERN acpi_tbl_handler acpi_gbl_table_handler;
|
|
|
|
ACPI_EXTERN void *acpi_gbl_table_handler_context;
|
2005-08-05 04:44:28 +00:00
|
|
|
ACPI_EXTERN struct acpi_walk_state *acpi_gbl_breakpoint_walk;
|
2005-04-16 22:20:36 +00:00
|
|
|
|
2008-04-10 15:06:37 +00:00
|
|
|
/* Owner ID support */
|
|
|
|
|
|
|
|
ACPI_EXTERN u32 acpi_gbl_owner_id_mask[ACPI_NUM_OWNERID_MASKS];
|
|
|
|
ACPI_EXTERN u8 acpi_gbl_last_owner_id_index;
|
|
|
|
ACPI_EXTERN u8 acpi_gbl_next_owner_id_offset;
|
|
|
|
|
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 04:00:00 +00:00
|
|
|
/* Misc */
|
|
|
|
|
2005-08-05 04:44:28 +00:00
|
|
|
ACPI_EXTERN u32 acpi_gbl_original_mode;
|
|
|
|
ACPI_EXTERN u32 acpi_gbl_rsdp_original_location;
|
|
|
|
ACPI_EXTERN u32 acpi_gbl_ns_lookup_count;
|
|
|
|
ACPI_EXTERN u32 acpi_gbl_ps_find_count;
|
|
|
|
ACPI_EXTERN u16 acpi_gbl_pm1_enable_register_save;
|
|
|
|
ACPI_EXTERN u8 acpi_gbl_debugger_configuration;
|
|
|
|
ACPI_EXTERN u8 acpi_gbl_step_to_next_call;
|
|
|
|
ACPI_EXTERN u8 acpi_gbl_acpi_hardware_present;
|
|
|
|
ACPI_EXTERN u8 acpi_gbl_events_initialized;
|
|
|
|
ACPI_EXTERN u8 acpi_gbl_system_awake_and_running;
|
|
|
|
|
2008-04-10 15:06:37 +00:00
|
|
|
#ifndef DEFINE_ACPI_GLOBALS
|
|
|
|
|
|
|
|
/* Other miscellaneous */
|
|
|
|
|
2005-08-05 04:44:28 +00:00
|
|
|
extern u8 acpi_gbl_shutdown;
|
|
|
|
extern u32 acpi_gbl_startup_flags;
|
|
|
|
extern const char *acpi_gbl_sleep_state_names[ACPI_S_STATE_COUNT];
|
|
|
|
extern const char *acpi_gbl_highest_dstate_names[4];
|
|
|
|
extern const struct acpi_opcode_info acpi_gbl_aml_op_info[AML_NUM_OPCODES];
|
|
|
|
extern const char *acpi_gbl_region_types[ACPI_NUM_PREDEFINED_REGIONS];
|
2005-04-16 22:20:36 +00:00
|
|
|
|
2008-04-10 15:06:37 +00:00
|
|
|
#endif
|
|
|
|
|
2007-02-02 16:48:19 +00:00
|
|
|
/* Exception codes */
|
|
|
|
|
|
|
|
extern char const *acpi_gbl_exception_names_env[];
|
|
|
|
extern char const *acpi_gbl_exception_names_pgm[];
|
|
|
|
extern char const *acpi_gbl_exception_names_tbl[];
|
|
|
|
extern char const *acpi_gbl_exception_names_aml[];
|
|
|
|
extern char const *acpi_gbl_exception_names_ctrl[];
|
|
|
|
|
2005-04-16 22:20:36 +00:00
|
|
|
/*****************************************************************************
|
|
|
|
*
|
|
|
|
* Namespace globals
|
|
|
|
*
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
#if !defined (ACPI_NO_METHOD_EXECUTION) || defined (ACPI_CONSTANT_EVAL_ONLY)
|
|
|
|
#define NUM_PREDEFINED_NAMES 10
|
|
|
|
#else
|
|
|
|
#define NUM_PREDEFINED_NAMES 9
|
|
|
|
#endif
|
|
|
|
|
2005-08-05 04:44:28 +00:00
|
|
|
ACPI_EXTERN struct acpi_namespace_node acpi_gbl_root_node_struct;
|
|
|
|
ACPI_EXTERN struct acpi_namespace_node *acpi_gbl_root_node;
|
|
|
|
ACPI_EXTERN struct acpi_namespace_node *acpi_gbl_fadt_gpe_device;
|
2005-04-16 22:20:36 +00:00
|
|
|
|
2008-04-10 15:06:40 +00:00
|
|
|
extern const u8 acpi_gbl_ns_properties[ACPI_NUM_NS_TYPES];
|
2005-08-05 04:44:28 +00:00
|
|
|
extern const struct acpi_predefined_names
|
|
|
|
acpi_gbl_pre_defined_names[NUM_PREDEFINED_NAMES];
|
2005-04-16 22:20:36 +00:00
|
|
|
|
|
|
|
#ifdef ACPI_DEBUG_OUTPUT
|
2005-08-05 04:44:28 +00:00
|
|
|
ACPI_EXTERN u32 acpi_gbl_current_node_count;
|
|
|
|
ACPI_EXTERN u32 acpi_gbl_current_node_size;
|
|
|
|
ACPI_EXTERN u32 acpi_gbl_max_concurrent_node_count;
|
2008-04-10 15:06:40 +00:00
|
|
|
ACPI_EXTERN acpi_size *acpi_gbl_entry_stack_pointer;
|
|
|
|
ACPI_EXTERN acpi_size *acpi_gbl_lowest_stack_pointer;
|
2005-08-05 04:44:28 +00:00
|
|
|
ACPI_EXTERN u32 acpi_gbl_deepest_nesting;
|
2005-04-16 22:20:36 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
/*****************************************************************************
|
|
|
|
*
|
|
|
|
* Interpreter globals
|
|
|
|
*
|
|
|
|
****************************************************************************/
|
|
|
|
|
2005-08-05 04:44:28 +00:00
|
|
|
ACPI_EXTERN struct acpi_thread_state *acpi_gbl_current_walk_list;
|
2005-04-16 22:20:36 +00:00
|
|
|
|
|
|
|
/* Control method single step flag */
|
|
|
|
|
2005-08-05 04:44:28 +00:00
|
|
|
ACPI_EXTERN u8 acpi_gbl_cm_single_step;
|
2005-04-16 22:20:36 +00:00
|
|
|
|
|
|
|
/*****************************************************************************
|
|
|
|
*
|
|
|
|
* Hardware globals
|
|
|
|
*
|
|
|
|
****************************************************************************/
|
|
|
|
|
2005-08-05 04:44:28 +00:00
|
|
|
extern struct acpi_bit_register_info
|
|
|
|
acpi_gbl_bit_register_info[ACPI_NUM_BITREG];
|
|
|
|
ACPI_EXTERN u8 acpi_gbl_sleep_type_a;
|
|
|
|
ACPI_EXTERN u8 acpi_gbl_sleep_type_b;
|
2005-04-16 22:20:36 +00:00
|
|
|
|
|
|
|
/*****************************************************************************
|
|
|
|
*
|
|
|
|
* Event and GPE globals
|
|
|
|
*
|
|
|
|
****************************************************************************/
|
|
|
|
|
2005-08-05 04:44:28 +00:00
|
|
|
extern struct acpi_fixed_event_info
|
|
|
|
acpi_gbl_fixed_event_info[ACPI_NUM_FIXED_EVENTS];
|
|
|
|
ACPI_EXTERN struct acpi_fixed_event_handler
|
|
|
|
acpi_gbl_fixed_event_handlers[ACPI_NUM_FIXED_EVENTS];
|
|
|
|
ACPI_EXTERN struct acpi_gpe_xrupt_info *acpi_gbl_gpe_xrupt_list_head;
|
|
|
|
ACPI_EXTERN struct acpi_gpe_block_info
|
2007-05-10 03:34:35 +00:00
|
|
|
*acpi_gbl_gpe_fadt_blocks[ACPI_MAX_GPE_BLOCKS];
|
2006-06-08 20:29:00 +00:00
|
|
|
|
2005-04-16 22:20:36 +00:00
|
|
|
/*****************************************************************************
|
|
|
|
*
|
|
|
|
* Debugger globals
|
|
|
|
*
|
|
|
|
****************************************************************************/
|
|
|
|
|
2005-08-05 04:44:28 +00:00
|
|
|
ACPI_EXTERN u8 acpi_gbl_db_output_flags;
|
2005-04-16 22:20:36 +00:00
|
|
|
|
|
|
|
#ifdef ACPI_DISASSEMBLER
|
|
|
|
|
2005-08-05 04:44:28 +00:00
|
|
|
ACPI_EXTERN u8 acpi_gbl_db_opt_disasm;
|
|
|
|
ACPI_EXTERN u8 acpi_gbl_db_opt_verbose;
|
2005-04-16 22:20:36 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef ACPI_DEBUGGER
|
|
|
|
|
2005-08-05 04:44:28 +00:00
|
|
|
extern u8 acpi_gbl_method_executing;
|
|
|
|
extern u8 acpi_gbl_abort_method;
|
|
|
|
extern u8 acpi_gbl_db_terminate_threads;
|
|
|
|
|
|
|
|
ACPI_EXTERN int optind;
|
|
|
|
ACPI_EXTERN char *optarg;
|
|
|
|
|
|
|
|
ACPI_EXTERN u8 acpi_gbl_db_opt_tables;
|
|
|
|
ACPI_EXTERN u8 acpi_gbl_db_opt_stats;
|
|
|
|
ACPI_EXTERN u8 acpi_gbl_db_opt_ini_methods;
|
|
|
|
|
|
|
|
ACPI_EXTERN char *acpi_gbl_db_args[ACPI_DEBUGGER_MAX_ARGS];
|
|
|
|
ACPI_EXTERN char acpi_gbl_db_line_buf[80];
|
|
|
|
ACPI_EXTERN char acpi_gbl_db_parsed_buf[80];
|
|
|
|
ACPI_EXTERN char acpi_gbl_db_scope_buf[40];
|
|
|
|
ACPI_EXTERN char acpi_gbl_db_debug_filename[40];
|
|
|
|
ACPI_EXTERN u8 acpi_gbl_db_output_to_file;
|
|
|
|
ACPI_EXTERN char *acpi_gbl_db_buffer;
|
|
|
|
ACPI_EXTERN char *acpi_gbl_db_filename;
|
|
|
|
ACPI_EXTERN u32 acpi_gbl_db_debug_level;
|
|
|
|
ACPI_EXTERN u32 acpi_gbl_db_console_debug_level;
|
|
|
|
ACPI_EXTERN struct acpi_table_header *acpi_gbl_db_table_ptr;
|
|
|
|
ACPI_EXTERN struct acpi_namespace_node *acpi_gbl_db_scope_node;
|
2005-04-16 22:20:36 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Statistic globals
|
|
|
|
*/
|
2005-08-05 04:44:28 +00:00
|
|
|
ACPI_EXTERN u16 acpi_gbl_obj_type_count[ACPI_TYPE_NS_NODE_MAX + 1];
|
|
|
|
ACPI_EXTERN u16 acpi_gbl_node_type_count[ACPI_TYPE_NS_NODE_MAX + 1];
|
|
|
|
ACPI_EXTERN u16 acpi_gbl_obj_type_count_misc;
|
|
|
|
ACPI_EXTERN u16 acpi_gbl_node_type_count_misc;
|
|
|
|
ACPI_EXTERN u32 acpi_gbl_num_nodes;
|
|
|
|
ACPI_EXTERN u32 acpi_gbl_num_objects;
|
2005-04-16 22:20:36 +00:00
|
|
|
|
2005-08-05 04:44:28 +00:00
|
|
|
ACPI_EXTERN u32 acpi_gbl_size_of_parse_tree;
|
|
|
|
ACPI_EXTERN u32 acpi_gbl_size_of_method_trees;
|
|
|
|
ACPI_EXTERN u32 acpi_gbl_size_of_node_entries;
|
|
|
|
ACPI_EXTERN u32 acpi_gbl_size_of_acpi_objects;
|
2005-04-16 22:20:36 +00:00
|
|
|
|
2005-08-05 04:44:28 +00:00
|
|
|
#endif /* ACPI_DEBUGGER */
|
2005-04-16 22:20:36 +00:00
|
|
|
|
2005-08-05 04:44:28 +00:00
|
|
|
#endif /* __ACGLOBAL_H__ */
|