From e2f7a7772880458edff1b1cc5a988947229fac26 Mon Sep 17 00:00:00 2001 From: Len Brown Date: Fri, 9 Jan 2009 00:30:03 -0500 Subject: ACPICA: hide private headers Signed-off-by: Len Brown --- drivers/acpi/acpica/accommon.h | 63 +++ drivers/acpi/acpica/acconfig.h | 217 +++++++++ drivers/acpi/acpica/acdebug.h | 231 ++++++++++ drivers/acpi/acpica/acdispat.h | 345 ++++++++++++++ drivers/acpi/acpica/acevents.h | 218 +++++++++ drivers/acpi/acpica/acglobal.h | 394 ++++++++++++++++ drivers/acpi/acpica/achware.h | 119 +++++ drivers/acpi/acpica/acinterp.h | 529 ++++++++++++++++++++++ drivers/acpi/acpica/aclocal.h | 990 +++++++++++++++++++++++++++++++++++++++++ drivers/acpi/acpica/acmacros.h | 577 ++++++++++++++++++++++++ drivers/acpi/acpica/acnamesp.h | 324 ++++++++++++++ drivers/acpi/acpica/acobject.h | 446 +++++++++++++++++++ drivers/acpi/acpica/acopcode.h | 323 ++++++++++++++ drivers/acpi/acpica/acparser.h | 234 ++++++++++ drivers/acpi/acpica/acpredef.h | 371 +++++++++++++++ drivers/acpi/acpica/acresrc.h | 336 ++++++++++++++ drivers/acpi/acpica/acstruct.h | 228 ++++++++++ drivers/acpi/acpica/actables.h | 117 +++++ drivers/acpi/acpica/acutils.h | 549 +++++++++++++++++++++++ drivers/acpi/acpica/amlcode.h | 494 ++++++++++++++++++++ drivers/acpi/acpica/amlresrc.h | 311 +++++++++++++ drivers/acpi/acpica/dsfield.c | 12 +- drivers/acpi/acpica/dsinit.c | 8 +- drivers/acpi/acpica/dsmethod.c | 10 +- drivers/acpi/acpica/dsmthdat.c | 8 +- drivers/acpi/acpica/dsobject.c | 12 +- drivers/acpi/acpica/dsopcode.c | 16 +- drivers/acpi/acpica/dsutils.c | 14 +- drivers/acpi/acpica/dswexec.c | 14 +- drivers/acpi/acpica/dswload.c | 14 +- drivers/acpi/acpica/dswscope.c | 4 +- drivers/acpi/acpica/dswstate.c | 8 +- drivers/acpi/acpica/evevent.c | 4 +- drivers/acpi/acpica/evgpe.c | 6 +- drivers/acpi/acpica/evgpeblk.c | 6 +- drivers/acpi/acpica/evmisc.c | 8 +- drivers/acpi/acpica/evregion.c | 8 +- drivers/acpi/acpica/evrgnini.c | 6 +- drivers/acpi/acpica/evsci.c | 4 +- drivers/acpi/acpica/evxface.c | 8 +- drivers/acpi/acpica/evxfevnt.c | 8 +- drivers/acpi/acpica/evxfregn.c | 6 +- drivers/acpi/acpica/exconfig.c | 10 +- drivers/acpi/acpica/exconvrt.c | 6 +- drivers/acpi/acpica/excreate.c | 8 +- drivers/acpi/acpica/exdump.c | 8 +- drivers/acpi/acpica/exfield.c | 6 +- drivers/acpi/acpica/exfldio.c | 10 +- drivers/acpi/acpica/exmisc.c | 8 +- drivers/acpi/acpica/exmutex.c | 6 +- drivers/acpi/acpica/exnames.c | 6 +- drivers/acpi/acpica/exoparg1.c | 12 +- drivers/acpi/acpica/exoparg2.c | 10 +- drivers/acpi/acpica/exoparg3.c | 8 +- drivers/acpi/acpica/exoparg6.c | 8 +- drivers/acpi/acpica/exprep.c | 8 +- drivers/acpi/acpica/exregion.c | 4 +- drivers/acpi/acpica/exresnte.c | 8 +- drivers/acpi/acpica/exresolv.c | 10 +- drivers/acpi/acpica/exresop.c | 10 +- drivers/acpi/acpica/exstore.c | 10 +- drivers/acpi/acpica/exstoren.c | 6 +- drivers/acpi/acpica/exstorob.c | 4 +- drivers/acpi/acpica/exsystem.c | 4 +- drivers/acpi/acpica/exutils.c | 6 +- drivers/acpi/acpica/hwacpi.c | 2 +- drivers/acpi/acpica/hwgpe.c | 4 +- drivers/acpi/acpica/hwregs.c | 6 +- drivers/acpi/acpica/hwsleep.c | 4 +- drivers/acpi/acpica/hwtimer.c | 2 +- drivers/acpi/acpica/hwxface.c | 4 +- drivers/acpi/acpica/nsaccess.c | 8 +- drivers/acpi/acpica/nsalloc.c | 4 +- drivers/acpi/acpica/nsdump.c | 4 +- drivers/acpi/acpica/nsdumpdv.c | 4 +- drivers/acpi/acpica/nseval.c | 8 +- drivers/acpi/acpica/nsinit.c | 8 +- drivers/acpi/acpica/nsload.c | 8 +- drivers/acpi/acpica/nsnames.c | 6 +- drivers/acpi/acpica/nsobject.c | 4 +- drivers/acpi/acpica/nsparse.c | 10 +- drivers/acpi/acpica/nspredef.c | 6 +- drivers/acpi/acpica/nssearch.c | 4 +- drivers/acpi/acpica/nsutils.c | 8 +- drivers/acpi/acpica/nswalk.c | 4 +- drivers/acpi/acpica/nsxfeval.c | 6 +- drivers/acpi/acpica/nsxfname.c | 4 +- drivers/acpi/acpica/nsxfobj.c | 4 +- drivers/acpi/acpica/psargs.c | 10 +- drivers/acpi/acpica/psloop.c | 8 +- drivers/acpi/acpica/psopcode.c | 8 +- drivers/acpi/acpica/psparse.c | 12 +- drivers/acpi/acpica/psscope.c | 4 +- drivers/acpi/acpica/pstree.c | 6 +- drivers/acpi/acpica/psutils.c | 6 +- drivers/acpi/acpica/pswalk.c | 4 +- drivers/acpi/acpica/psxface.c | 10 +- drivers/acpi/acpica/rsaddr.c | 4 +- drivers/acpi/acpica/rscalc.c | 6 +- drivers/acpi/acpica/rscreate.c | 6 +- drivers/acpi/acpica/rsdump.c | 4 +- drivers/acpi/acpica/rsinfo.c | 4 +- drivers/acpi/acpica/rsio.c | 4 +- drivers/acpi/acpica/rsirq.c | 4 +- drivers/acpi/acpica/rslist.c | 4 +- drivers/acpi/acpica/rsmemory.c | 4 +- drivers/acpi/acpica/rsmisc.c | 4 +- drivers/acpi/acpica/rsutils.c | 6 +- drivers/acpi/acpica/rsxface.c | 6 +- drivers/acpi/acpica/tbfadt.c | 4 +- drivers/acpi/acpica/tbfind.c | 4 +- drivers/acpi/acpica/tbinstal.c | 6 +- drivers/acpi/acpica/tbutils.c | 4 +- drivers/acpi/acpica/tbxface.c | 6 +- drivers/acpi/acpica/tbxfroot.c | 4 +- drivers/acpi/acpica/utalloc.c | 4 +- drivers/acpi/acpica/utcopy.c | 4 +- drivers/acpi/acpica/utdebug.c | 2 +- drivers/acpi/acpica/utdelete.c | 8 +- drivers/acpi/acpica/uteval.c | 6 +- drivers/acpi/acpica/utglobal.c | 4 +- drivers/acpi/acpica/utinit.c | 8 +- drivers/acpi/acpica/utmath.c | 2 +- drivers/acpi/acpica/utmisc.c | 4 +- drivers/acpi/acpica/utmutex.c | 2 +- drivers/acpi/acpica/utobject.c | 4 +- drivers/acpi/acpica/utresrc.c | 4 +- drivers/acpi/acpica/utstate.c | 2 +- drivers/acpi/acpica/utxface.c | 10 +- include/acpi/accommon.h | 63 --- include/acpi/acconfig.h | 217 --------- include/acpi/acdebug.h | 231 ---------- include/acpi/acdispat.h | 345 -------------- include/acpi/acevents.h | 218 --------- include/acpi/acglobal.h | 394 ---------------- include/acpi/achware.h | 119 ----- include/acpi/acinterp.h | 529 ---------------------- include/acpi/aclocal.h | 990 ----------------------------------------- include/acpi/acmacros.h | 577 ------------------------ include/acpi/acnamesp.h | 324 -------------- include/acpi/acobject.h | 446 ------------------- include/acpi/acopcode.h | 323 -------------- include/acpi/acparser.h | 234 ---------- include/acpi/acpredef.h | 371 --------------- include/acpi/acresrc.h | 336 -------------- include/acpi/acstruct.h | 228 ---------- include/acpi/actables.h | 117 ----- include/acpi/acutils.h | 549 ----------------------- include/acpi/amlcode.h | 494 -------------------- include/acpi/amlresrc.h | 311 ------------- 150 files changed, 7765 insertions(+), 7765 deletions(-) create mode 100644 drivers/acpi/acpica/accommon.h create mode 100644 drivers/acpi/acpica/acconfig.h create mode 100644 drivers/acpi/acpica/acdebug.h create mode 100644 drivers/acpi/acpica/acdispat.h create mode 100644 drivers/acpi/acpica/acevents.h create mode 100644 drivers/acpi/acpica/acglobal.h create mode 100644 drivers/acpi/acpica/achware.h create mode 100644 drivers/acpi/acpica/acinterp.h create mode 100644 drivers/acpi/acpica/aclocal.h create mode 100644 drivers/acpi/acpica/acmacros.h create mode 100644 drivers/acpi/acpica/acnamesp.h create mode 100644 drivers/acpi/acpica/acobject.h create mode 100644 drivers/acpi/acpica/acopcode.h create mode 100644 drivers/acpi/acpica/acparser.h create mode 100644 drivers/acpi/acpica/acpredef.h create mode 100644 drivers/acpi/acpica/acresrc.h create mode 100644 drivers/acpi/acpica/acstruct.h create mode 100644 drivers/acpi/acpica/actables.h create mode 100644 drivers/acpi/acpica/acutils.h create mode 100644 drivers/acpi/acpica/amlcode.h create mode 100644 drivers/acpi/acpica/amlresrc.h delete mode 100644 include/acpi/accommon.h delete mode 100644 include/acpi/acconfig.h delete mode 100644 include/acpi/acdebug.h delete mode 100644 include/acpi/acdispat.h delete mode 100644 include/acpi/acevents.h delete mode 100644 include/acpi/acglobal.h delete mode 100644 include/acpi/achware.h delete mode 100644 include/acpi/acinterp.h delete mode 100644 include/acpi/aclocal.h delete mode 100644 include/acpi/acmacros.h delete mode 100644 include/acpi/acnamesp.h delete mode 100644 include/acpi/acobject.h delete mode 100644 include/acpi/acopcode.h delete mode 100644 include/acpi/acparser.h delete mode 100644 include/acpi/acpredef.h delete mode 100644 include/acpi/acresrc.h delete mode 100644 include/acpi/acstruct.h delete mode 100644 include/acpi/actables.h delete mode 100644 include/acpi/acutils.h delete mode 100644 include/acpi/amlcode.h delete mode 100644 include/acpi/amlresrc.h diff --git a/drivers/acpi/acpica/accommon.h b/drivers/acpi/acpica/accommon.h new file mode 100644 index 000000000000..3b20786cbb0d --- /dev/null +++ b/drivers/acpi/acpica/accommon.h @@ -0,0 +1,63 @@ +/****************************************************************************** + * + * Name: accommon.h - Common include files for generation of ACPICA source + * + *****************************************************************************/ + +/* + * Copyright (C) 2000 - 2008, Intel Corp. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions, and the following disclaimer, + * without modification. + * 2. Redistributions in binary form must reproduce at minimum a disclaimer + * substantially similar to the "NO WARRANTY" disclaimer below + * ("Disclaimer") and any redistribution must be conditioned upon + * including a substantially similar Disclaimer requirement for further + * binary redistribution. + * 3. Neither the names of the above-listed copyright holders nor the names + * of any contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * Alternatively, this software may be distributed under the terms of the + * GNU General Public License ("GPL") version 2 as published by the Free + * Software Foundation. + * + * NO WARRANTY + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGES. + */ + +#ifndef __ACCOMMON_H__ +#define __ACCOMMON_H__ + +/* + * Common set of includes for all ACPICA source files. + * We put them here because we don't want to duplicate them + * in the the source code again and again. + * + * Note: The order of these include files is important. + */ +#include "acconfig.h" /* Global configuration constants */ +#include "acmacros.h" /* C macros */ +#include "aclocal.h" /* Internal data types */ +#include "acobject.h" /* ACPI internal object */ +#include "acstruct.h" /* Common structures */ +#include "acglobal.h" /* All global variables */ +#include "achware.h" /* Hardware defines and interfaces */ +#include "acutils.h" /* Utility interfaces */ + +#endif /* __ACCOMMON_H__ */ diff --git a/drivers/acpi/acpica/acconfig.h b/drivers/acpi/acpica/acconfig.h new file mode 100644 index 000000000000..e6777fb883d2 --- /dev/null +++ b/drivers/acpi/acpica/acconfig.h @@ -0,0 +1,217 @@ +/****************************************************************************** + * + * Name: acconfig.h - Global configuration constants + * + *****************************************************************************/ + +/* + * Copyright (C) 2000 - 2008, Intel Corp. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions, and the following disclaimer, + * without modification. + * 2. Redistributions in binary form must reproduce at minimum a disclaimer + * substantially similar to the "NO WARRANTY" disclaimer below + * ("Disclaimer") and any redistribution must be conditioned upon + * including a substantially similar Disclaimer requirement for further + * binary redistribution. + * 3. Neither the names of the above-listed copyright holders nor the names + * of any contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * Alternatively, this software may be distributed under the terms of the + * GNU General Public License ("GPL") version 2 as published by the Free + * Software Foundation. + * + * NO WARRANTY + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGES. + */ + +#ifndef _ACCONFIG_H +#define _ACCONFIG_H + +/****************************************************************************** + * + * Configuration options + * + *****************************************************************************/ + +/* + * ACPI_DEBUG_OUTPUT - This switch enables all the debug facilities of the + * ACPI subsystem. This includes the DEBUG_PRINT output + * statements. When disabled, all DEBUG_PRINT + * statements are compiled out. + * + * ACPI_APPLICATION - Use this switch if the subsystem is going to be run + * at the application level. + * + */ + +/* + * OS name, used for the _OS object. The _OS object is essentially obsolete, + * but there is a large base of ASL/AML code in existing machines that check + * for the string below. The use of this string usually guarantees that + * the ASL will execute down the most tested code path. Also, there is some + * code that will not execute the _OSI method unless _OS matches the string + * below. Therefore, change this string at your own risk. + */ +#define ACPI_OS_NAME "Microsoft Windows NT" + +/* Maximum objects in the various object caches */ + +#define ACPI_MAX_STATE_CACHE_DEPTH 96 /* State objects */ +#define ACPI_MAX_PARSE_CACHE_DEPTH 96 /* Parse tree objects */ +#define ACPI_MAX_EXTPARSE_CACHE_DEPTH 96 /* Parse tree objects */ +#define ACPI_MAX_OBJECT_CACHE_DEPTH 96 /* Interpreter operand objects */ +#define ACPI_MAX_NAMESPACE_CACHE_DEPTH 96 /* Namespace objects */ + +/* + * Should the subsystem abort the loading of an ACPI table if the + * table checksum is incorrect? + */ +#define ACPI_CHECKSUM_ABORT FALSE + +/****************************************************************************** + * + * Subsystem Constants + * + *****************************************************************************/ + +/* Version of ACPI supported */ + +#define ACPI_CA_SUPPORT_LEVEL 3 + +/* Maximum count for a semaphore object */ + +#define ACPI_MAX_SEMAPHORE_COUNT 256 + +/* Maximum object reference count (detects object deletion issues) */ + +#define ACPI_MAX_REFERENCE_COUNT 0x1000 + +/* Size of cached memory mapping for system memory operation region */ + +#define ACPI_SYSMEM_REGION_WINDOW_SIZE 4096 + +/* owner_id tracking. 8 entries allows for 255 owner_ids */ + +#define ACPI_NUM_OWNERID_MASKS 8 + +/* Size of the root table array is increased by this increment */ + +#define ACPI_ROOT_TABLE_SIZE_INCREMENT 4 + +/* Maximum number of While() loop iterations before forced abort */ + +#define ACPI_MAX_LOOP_ITERATIONS 0xFFFF + +/****************************************************************************** + * + * ACPI Specification constants (Do not change unless the specification changes) + * + *****************************************************************************/ + +/* Number of distinct GPE register blocks and register width */ + +#define ACPI_MAX_GPE_BLOCKS 2 +#define ACPI_GPE_REGISTER_WIDTH 8 + +/* Method info (in WALK_STATE), containing local variables and argumetns */ + +#define ACPI_METHOD_NUM_LOCALS 8 +#define ACPI_METHOD_MAX_LOCAL 7 + +#define ACPI_METHOD_NUM_ARGS 7 +#define ACPI_METHOD_MAX_ARG 6 + +/* Length of _HID, _UID, _CID, and UUID values */ + +#define ACPI_DEVICE_ID_LENGTH 0x09 +#define ACPI_MAX_CID_LENGTH 48 +#define ACPI_UUID_LENGTH 16 + +/* + * Operand Stack (in WALK_STATE), Must be large enough to contain METHOD_MAX_ARG + */ +#define ACPI_OBJ_NUM_OPERANDS 8 +#define ACPI_OBJ_MAX_OPERAND 7 + +/* Number of elements in the Result Stack frame, can be an arbitrary value */ + +#define ACPI_RESULTS_FRAME_OBJ_NUM 8 + +/* + * Maximal number of elements the Result Stack can contain, + * it may be an arbitray value not exceeding the types of + * result_size and result_count (now u8). + */ +#define ACPI_RESULTS_OBJ_NUM_MAX 255 + +/* Names within the namespace are 4 bytes long */ + +#define ACPI_NAME_SIZE 4 +#define ACPI_PATH_SEGMENT_LENGTH 5 /* 4 chars for name + 1 char for separator */ +#define ACPI_PATH_SEPARATOR '.' + +/* Sizes for ACPI table headers */ + +#define ACPI_OEM_ID_SIZE 6 +#define ACPI_OEM_TABLE_ID_SIZE 8 + +/* Constants used in searching for the RSDP in low memory */ + +#define ACPI_EBDA_PTR_LOCATION 0x0000040E /* Physical Address */ +#define ACPI_EBDA_PTR_LENGTH 2 +#define ACPI_EBDA_WINDOW_SIZE 1024 +#define ACPI_HI_RSDP_WINDOW_BASE 0x000E0000 /* Physical Address */ +#define ACPI_HI_RSDP_WINDOW_SIZE 0x00020000 +#define ACPI_RSDP_SCAN_STEP 16 + +/* Operation regions */ + +#define ACPI_NUM_PREDEFINED_REGIONS 8 +#define ACPI_USER_REGION_BEGIN 0x80 + +/* Maximum space_ids for Operation Regions */ + +#define ACPI_MAX_ADDRESS_SPACE 255 + +/* Array sizes. Used for range checking also */ + +#define ACPI_MAX_MATCH_OPCODE 5 + +/* RSDP checksums */ + +#define ACPI_RSDP_CHECKSUM_LENGTH 20 +#define ACPI_RSDP_XCHECKSUM_LENGTH 36 + +/* SMBus bidirectional buffer size */ + +#define ACPI_SMBUS_BUFFER_SIZE 34 + +/****************************************************************************** + * + * ACPI AML Debugger + * + *****************************************************************************/ + +#define ACPI_DEBUGGER_MAX_ARGS 8 /* Must be max method args + 1 */ + +#define ACPI_DEBUGGER_COMMAND_PROMPT '-' +#define ACPI_DEBUGGER_EXECUTE_PROMPT '%' + +#endif /* _ACCONFIG_H */ diff --git a/drivers/acpi/acpica/acdebug.h b/drivers/acpi/acpica/acdebug.h new file mode 100644 index 000000000000..62c59df3b86c --- /dev/null +++ b/drivers/acpi/acpica/acdebug.h @@ -0,0 +1,231 @@ +/****************************************************************************** + * + * Name: acdebug.h - ACPI/AML debugger + * + *****************************************************************************/ + +/* + * Copyright (C) 2000 - 2008, Intel Corp. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions, and the following disclaimer, + * without modification. + * 2. Redistributions in binary form must reproduce at minimum a disclaimer + * substantially similar to the "NO WARRANTY" disclaimer below + * ("Disclaimer") and any redistribution must be conditioned upon + * including a substantially similar Disclaimer requirement for further + * binary redistribution. + * 3. Neither the names of the above-listed copyright holders nor the names + * of any contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * Alternatively, this software may be distributed under the terms of the + * GNU General Public License ("GPL") version 2 as published by the Free + * Software Foundation. + * + * NO WARRANTY + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGES. + */ + +#ifndef __ACDEBUG_H__ +#define __ACDEBUG_H__ + +#define ACPI_DEBUG_BUFFER_SIZE 4196 + +struct command_info { + char *name; /* Command Name */ + u8 min_args; /* Minimum arguments required */ +}; + +struct argument_info { + char *name; /* Argument Name */ +}; + +#define PARAM_LIST(pl) pl +#define DBTEST_OUTPUT_LEVEL(lvl) if (acpi_gbl_db_opt_verbose) +#define VERBOSE_PRINT(fp) DBTEST_OUTPUT_LEVEL(lvl) {\ + acpi_os_printf PARAM_LIST(fp);} + +#define EX_NO_SINGLE_STEP 1 +#define EX_SINGLE_STEP 2 + +/* + * dbxface - external debugger interfaces + */ +acpi_status acpi_db_initialize(void); + +void acpi_db_terminate(void); + +acpi_status +acpi_db_single_step(struct acpi_walk_state *walk_state, + union acpi_parse_object *op, u32 op_type); + +/* + * dbcmds - debug commands and output routines + */ +acpi_status acpi_db_disassemble_method(char *name); + +void acpi_db_display_table_info(char *table_arg); + +void acpi_db_unload_acpi_table(char *table_arg, char *instance_arg); + +void +acpi_db_set_method_breakpoint(char *location, + struct acpi_walk_state *walk_state, + union acpi_parse_object *op); + +void acpi_db_set_method_call_breakpoint(union acpi_parse_object *op); + +void acpi_db_get_bus_info(void); + +void acpi_db_disassemble_aml(char *statements, union acpi_parse_object *op); + +void acpi_db_dump_namespace(char *start_arg, char *depth_arg); + +void acpi_db_dump_namespace_by_owner(char *owner_arg, char *depth_arg); + +void acpi_db_send_notify(char *name, u32 value); + +void acpi_db_set_method_data(char *type_arg, char *index_arg, char *value_arg); + +acpi_status +acpi_db_display_objects(char *obj_type_arg, char *display_count_arg); + +acpi_status acpi_db_find_name_in_namespace(char *name_arg); + +void acpi_db_set_scope(char *name); + +acpi_status acpi_db_sleep(char *object_arg); + +void acpi_db_find_references(char *object_arg); + +void acpi_db_display_locks(void); + +void acpi_db_display_resources(char *object_arg); + +void acpi_db_display_gpes(void); + +void acpi_db_check_integrity(void); + +void acpi_db_generate_gpe(char *gpe_arg, char *block_arg); + +void acpi_db_check_predefined_names(void); + +void acpi_db_batch_execute(void); + +/* + * dbdisply - debug display commands + */ +void acpi_db_display_method_info(union acpi_parse_object *op); + +void acpi_db_decode_and_display_object(char *target, char *output_type); + +void +acpi_db_display_result_object(union acpi_operand_object *obj_desc, + struct acpi_walk_state *walk_state); + +acpi_status acpi_db_display_all_methods(char *display_count_arg); + +void acpi_db_display_arguments(void); + +void acpi_db_display_locals(void); + +void acpi_db_display_results(void); + +void acpi_db_display_calling_tree(void); + +void acpi_db_display_object_type(char *object_arg); + +void +acpi_db_display_argument_object(union acpi_operand_object *obj_desc, + struct acpi_walk_state *walk_state); + +void acpi_db_check_predefined_names(void); + +void acpi_db_batch_execute(void); + +/* + * dbexec - debugger control method execution + */ +void acpi_db_execute(char *name, char **args, u32 flags); + +void +acpi_db_create_execution_threads(char *num_threads_arg, + char *num_loops_arg, char *method_name_arg); + +#ifdef ACPI_DBG_TRACK_ALLOCATIONS +u32 acpi_db_get_cache_info(struct acpi_memory_list *cache); +#endif + +/* + * dbfileio - Debugger file I/O commands + */ +acpi_object_type +acpi_db_match_argument(char *user_argument, struct argument_info *arguments); + +void acpi_db_close_debug_file(void); + +void acpi_db_open_debug_file(char *name); + +acpi_status acpi_db_load_acpi_table(char *filename); + +acpi_status +acpi_db_get_table_from_file(char *filename, struct acpi_table_header **table); + +acpi_status +acpi_db_read_table_from_file(char *filename, struct acpi_table_header **table); + +/* + * dbhistry - debugger HISTORY command + */ +void acpi_db_add_to_history(char *command_line); + +void acpi_db_display_history(void); + +char *acpi_db_get_from_history(char *command_num_arg); + +/* + * dbinput - user front-end to the AML debugger + */ +acpi_status +acpi_db_command_dispatch(char *input_buffer, + struct acpi_walk_state *walk_state, + union acpi_parse_object *op); + +void ACPI_SYSTEM_XFACE acpi_db_execute_thread(void *context); + +/* + * dbstats - Generation and display of ACPI table statistics + */ +void acpi_db_generate_statistics(union acpi_parse_object *root, u8 is_method); + +acpi_status acpi_db_display_statistics(char *type_arg); + +/* + * dbutils - AML debugger utilities + */ +void acpi_db_set_output_destination(u32 where); + +void acpi_db_dump_external_object(union acpi_object *obj_desc, u32 level); + +void acpi_db_prep_namestring(char *name); + +struct acpi_namespace_node *acpi_db_local_ns_lookup(char *name); + +void acpi_db_uint32_to_hex_string(u32 value, char *buffer); + +#endif /* __ACDEBUG_H__ */ diff --git a/drivers/acpi/acpica/acdispat.h b/drivers/acpi/acpica/acdispat.h new file mode 100644 index 000000000000..6291904be01e --- /dev/null +++ b/drivers/acpi/acpica/acdispat.h @@ -0,0 +1,345 @@ +/****************************************************************************** + * + * Name: acdispat.h - dispatcher (parser to interpreter interface) + * + *****************************************************************************/ + +/* + * Copyright (C) 2000 - 2008, Intel Corp. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions, and the following disclaimer, + * without modification. + * 2. Redistributions in binary form must reproduce at minimum a disclaimer + * substantially similar to the "NO WARRANTY" disclaimer below + * ("Disclaimer") and any redistribution must be conditioned upon + * including a substantially similar Disclaimer requirement for further + * binary redistribution. + * 3. Neither the names of the above-listed copyright holders nor the names + * of any contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * Alternatively, this software may be distributed under the terms of the + * GNU General Public License ("GPL") version 2 as published by the Free + * Software Foundation. + * + * NO WARRANTY + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGES. + */ + +#ifndef _ACDISPAT_H_ +#define _ACDISPAT_H_ + +#define NAMEOF_LOCAL_NTE "__L0" +#define NAMEOF_ARG_NTE "__A0" + +/* + * dsopcode - support for late evaluation + */ +acpi_status +acpi_ds_get_buffer_field_arguments(union acpi_operand_object *obj_desc); + +acpi_status +acpi_ds_get_bank_field_arguments(union acpi_operand_object *obj_desc); + +acpi_status acpi_ds_get_region_arguments(union acpi_operand_object *rgn_desc); + +acpi_status acpi_ds_get_buffer_arguments(union acpi_operand_object *obj_desc); + +acpi_status acpi_ds_get_package_arguments(union acpi_operand_object *obj_desc); + +acpi_status +acpi_ds_eval_buffer_field_operands(struct acpi_walk_state *walk_state, + union acpi_parse_object *op); + +acpi_status +acpi_ds_eval_region_operands(struct acpi_walk_state *walk_state, + union acpi_parse_object *op); + +acpi_status +acpi_ds_eval_table_region_operands(struct acpi_walk_state *walk_state, + union acpi_parse_object *op); + +acpi_status +acpi_ds_eval_data_object_operands(struct acpi_walk_state *walk_state, + union acpi_parse_object *op, + union acpi_operand_object *obj_desc); + +acpi_status +acpi_ds_eval_bank_field_operands(struct acpi_walk_state *walk_state, + union acpi_parse_object *op); + +acpi_status acpi_ds_initialize_region(acpi_handle obj_handle); + +/* + * dsctrl - Parser/Interpreter interface, control stack routines + */ +acpi_status +acpi_ds_exec_begin_control_op(struct acpi_walk_state *walk_state, + union acpi_parse_object *op); + +acpi_status +acpi_ds_exec_end_control_op(struct acpi_walk_state *walk_state, + union acpi_parse_object *op); + +/* + * dsexec - Parser/Interpreter interface, method execution callbacks + */ +acpi_status +acpi_ds_get_predicate_value(struct acpi_walk_state *walk_state, + union acpi_operand_object *result_obj); + +acpi_status +acpi_ds_exec_begin_op(struct acpi_walk_state *walk_state, + union acpi_parse_object **out_op); + +acpi_status acpi_ds_exec_end_op(struct acpi_walk_state *state); + +/* + * dsfield - Parser/Interpreter interface for AML fields + */ +acpi_status +acpi_ds_create_field(union acpi_parse_object *op, + struct acpi_namespace_node *region_node, + struct acpi_walk_state *walk_state); + +acpi_status +acpi_ds_create_bank_field(union acpi_parse_object *op, + struct acpi_namespace_node *region_node, + struct acpi_walk_state *walk_state); + +acpi_status +acpi_ds_create_index_field(union acpi_parse_object *op, + struct acpi_namespace_node *region_node, + struct acpi_walk_state *walk_state); + +acpi_status +acpi_ds_create_buffer_field(union acpi_parse_object *op, + struct acpi_walk_state *walk_state); + +acpi_status +acpi_ds_init_field_objects(union acpi_parse_object *op, + struct acpi_walk_state *walk_state); + +/* + * dsload - Parser/Interpreter interface, namespace load callbacks + */ +acpi_status +acpi_ds_load1_begin_op(struct acpi_walk_state *walk_state, + union acpi_parse_object **out_op); + +acpi_status acpi_ds_load1_end_op(struct acpi_walk_state *walk_state); + +acpi_status +acpi_ds_load2_begin_op(struct acpi_walk_state *walk_state, + union acpi_parse_object **out_op); + +acpi_status acpi_ds_load2_end_op(struct acpi_walk_state *walk_state); + +acpi_status +acpi_ds_init_callbacks(struct acpi_walk_state *walk_state, u32 pass_number); + +/* + * dsmthdat - method data (locals/args) + */ +acpi_status +acpi_ds_store_object_to_local(u8 type, + u32 index, + union acpi_operand_object *src_desc, + struct acpi_walk_state *walk_state); + +acpi_status +acpi_ds_method_data_get_entry(u16 opcode, + u32 index, + struct acpi_walk_state *walk_state, + union acpi_operand_object ***node); + +void acpi_ds_method_data_delete_all(struct acpi_walk_state *walk_state); + +u8 acpi_ds_is_method_value(union acpi_operand_object *obj_desc); + +acpi_status +acpi_ds_method_data_get_value(u8 type, + u32 index, + struct acpi_walk_state *walk_state, + union acpi_operand_object **dest_desc); + +acpi_status +acpi_ds_method_data_init_args(union acpi_operand_object **params, + u32 max_param_count, + struct acpi_walk_state *walk_state); + +acpi_status +acpi_ds_method_data_get_node(u8 type, + u32 index, + struct acpi_walk_state *walk_state, + struct acpi_namespace_node **node); + +void acpi_ds_method_data_init(struct acpi_walk_state *walk_state); + +/* + * dsmethod - Parser/Interpreter interface - control method parsing + */ +acpi_status acpi_ds_parse_method(struct acpi_namespace_node *node); + +acpi_status +acpi_ds_call_control_method(struct acpi_thread_state *thread, + struct acpi_walk_state *walk_state, + union acpi_parse_object *op); + +acpi_status +acpi_ds_restart_control_method(struct acpi_walk_state *walk_state, + union acpi_operand_object *return_desc); + +void +acpi_ds_terminate_control_method(union acpi_operand_object *method_desc, + struct acpi_walk_state *walk_state); + +acpi_status +acpi_ds_begin_method_execution(struct acpi_namespace_node *method_node, + union acpi_operand_object *obj_desc, + struct acpi_walk_state *walk_state); + +acpi_status +acpi_ds_method_error(acpi_status status, struct acpi_walk_state *walk_state); + +/* + * dsinit + */ +acpi_status +acpi_ds_initialize_objects(u32 table_index, + struct acpi_namespace_node *start_node); + +/* + * dsobject - Parser/Interpreter interface - object initialization and conversion + */ +acpi_status +acpi_ds_build_internal_buffer_obj(struct acpi_walk_state *walk_state, + union acpi_parse_object *op, + u32 buffer_length, + union acpi_operand_object **obj_desc_ptr); + +acpi_status +acpi_ds_build_internal_package_obj(struct acpi_walk_state *walk_state, + union acpi_parse_object *op, + u32 package_length, + union acpi_operand_object **obj_desc); + +acpi_status +acpi_ds_init_object_from_op(struct acpi_walk_state *walk_state, + union acpi_parse_object *op, + u16 opcode, union acpi_operand_object **obj_desc); + +acpi_status +acpi_ds_create_node(struct acpi_walk_state *walk_state, + struct acpi_namespace_node *node, + union acpi_parse_object *op); + +/* + * dsutils - Parser/Interpreter interface utility routines + */ +void acpi_ds_clear_implicit_return(struct acpi_walk_state *walk_state); + +u8 +acpi_ds_do_implicit_return(union acpi_operand_object *return_desc, + struct acpi_walk_state *walk_state, + u8 add_reference); + +u8 +acpi_ds_is_result_used(union acpi_parse_object *op, + struct acpi_walk_state *walk_state); + +void +acpi_ds_delete_result_if_not_used(union acpi_parse_object *op, + union acpi_operand_object *result_obj, + struct acpi_walk_state *walk_state); + +acpi_status +acpi_ds_create_operand(struct acpi_walk_state *walk_state, + union acpi_parse_object *arg, u32 args_remaining); + +acpi_status +acpi_ds_create_operands(struct acpi_walk_state *walk_state, + union acpi_parse_object *first_arg); + +acpi_status acpi_ds_resolve_operands(struct acpi_walk_state *walk_state); + +void acpi_ds_clear_operands(struct acpi_walk_state *walk_state); + +acpi_status acpi_ds_evaluate_name_path(struct acpi_walk_state *walk_state); + +/* + * dswscope - Scope Stack manipulation + */ +acpi_status +acpi_ds_scope_stack_push(struct acpi_namespace_node *node, + acpi_object_type type, + struct acpi_walk_state *walk_state); + +acpi_status acpi_ds_scope_stack_pop(struct acpi_walk_state *walk_state); + +void acpi_ds_scope_stack_clear(struct acpi_walk_state *walk_state); + +/* + * dswstate - parser WALK_STATE management routines + */ +acpi_status +acpi_ds_obj_stack_push(void *object, struct acpi_walk_state *walk_state); + +acpi_status +acpi_ds_obj_stack_pop(u32 pop_count, struct acpi_walk_state *walk_state); + +struct acpi_walk_state *acpi_ds_create_walk_state(acpi_owner_id owner_id, union acpi_parse_object + *origin, union acpi_operand_object + *mth_desc, struct acpi_thread_state + *thread); + +acpi_status +acpi_ds_init_aml_walk(struct acpi_walk_state *walk_state, + union acpi_parse_object *op, + struct acpi_namespace_node *method_node, + u8 * aml_start, + u32 aml_length, + struct acpi_evaluate_info *info, u8 pass_number); + +void +acpi_ds_obj_stack_pop_and_delete(u32 pop_count, + struct acpi_walk_state *walk_state); + +void acpi_ds_delete_walk_state(struct acpi_walk_state *walk_state); + +struct acpi_walk_state *acpi_ds_pop_walk_state(struct acpi_thread_state + *thread); + +void +acpi_ds_push_walk_state(struct acpi_walk_state *walk_state, + struct acpi_thread_state *thread); + +acpi_status acpi_ds_result_stack_clear(struct acpi_walk_state *walk_state); + +struct acpi_walk_state *acpi_ds_get_current_walk_state(struct acpi_thread_state + *thread); + +acpi_status +acpi_ds_result_pop(union acpi_operand_object **object, + struct acpi_walk_state *walk_state); + +acpi_status +acpi_ds_result_push(union acpi_operand_object *object, + struct acpi_walk_state *walk_state); + +#endif /* _ACDISPAT_H_ */ diff --git a/drivers/acpi/acpica/acevents.h b/drivers/acpi/acpica/acevents.h new file mode 100644 index 000000000000..07e20135f01b --- /dev/null +++ b/drivers/acpi/acpica/acevents.h @@ -0,0 +1,218 @@ +/****************************************************************************** + * + * Name: acevents.h - Event subcomponent prototypes and defines + * + *****************************************************************************/ + +/* + * Copyright (C) 2000 - 2008, Intel Corp. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions, and the following disclaimer, + * without modification. + * 2. Redistributions in binary form must reproduce at minimum a disclaimer + * substantially similar to the "NO WARRANTY" disclaimer below + * ("Disclaimer") and any redistribution must be conditioned upon + * including a substantially similar Disclaimer requirement for further + * binary redistribution. + * 3. Neither the names of the above-listed copyright holders nor the names + * of any contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * Alternatively, this software may be distributed under the terms of the + * GNU General Public License ("GPL") version 2 as published by the Free + * Software Foundation. + * + * NO WARRANTY + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGES. + */ + +#ifndef __ACEVENTS_H__ +#define __ACEVENTS_H__ + +/* + * evevent + */ +acpi_status acpi_ev_initialize_events(void); + +acpi_status acpi_ev_install_xrupt_handlers(void); + +acpi_status acpi_ev_install_fadt_gpes(void); + +u32 acpi_ev_fixed_event_detect(void); + +/* + * evmisc + */ +u8 acpi_ev_is_notify_object(struct acpi_namespace_node *node); + +acpi_status acpi_ev_acquire_global_lock(u16 timeout); + +acpi_status acpi_ev_release_global_lock(void); + +acpi_status acpi_ev_init_global_lock_handler(void); + +u32 acpi_ev_get_gpe_number_index(u32 gpe_number); + +acpi_status +acpi_ev_queue_notify_request(struct acpi_namespace_node *node, + u32 notify_value); + +/* + * evgpe - GPE handling and dispatch + */ +acpi_status +acpi_ev_update_gpe_enable_masks(struct acpi_gpe_event_info *gpe_event_info, + u8 type); + +acpi_status +acpi_ev_enable_gpe(struct acpi_gpe_event_info *gpe_event_info, + u8 write_to_hardware); + +acpi_status acpi_ev_disable_gpe(struct acpi_gpe_event_info *gpe_event_info); + +struct acpi_gpe_event_info *acpi_ev_get_gpe_event_info(acpi_handle gpe_device, + u32 gpe_number); + +/* + * evgpeblk + */ +u8 acpi_ev_valid_gpe_event(struct acpi_gpe_event_info *gpe_event_info); + +acpi_status +acpi_ev_walk_gpe_list(acpi_gpe_callback gpe_walk_callback, void *context); + +acpi_status +acpi_ev_delete_gpe_handlers(struct acpi_gpe_xrupt_info *gpe_xrupt_info, + struct acpi_gpe_block_info *gpe_block, + void *context); + +acpi_status +acpi_ev_create_gpe_block(struct acpi_namespace_node *gpe_device, + struct acpi_generic_address *gpe_block_address, + u32 register_count, + u8 gpe_block_base_number, + u32 interrupt_number, + struct acpi_gpe_block_info **return_gpe_block); + +acpi_status +acpi_ev_initialize_gpe_block(struct acpi_namespace_node *gpe_device, + struct acpi_gpe_block_info *gpe_block); + +acpi_status acpi_ev_delete_gpe_block(struct acpi_gpe_block_info *gpe_block); + +u32 +acpi_ev_gpe_dispatch(struct acpi_gpe_event_info *gpe_event_info, + u32 gpe_number); + +u32 acpi_ev_gpe_detect(struct acpi_gpe_xrupt_info *gpe_xrupt_list); + +acpi_status +acpi_ev_set_gpe_type(struct acpi_gpe_event_info *gpe_event_info, u8 type); + +acpi_status +acpi_ev_check_for_wake_only_gpe(struct acpi_gpe_event_info *gpe_event_info); + +acpi_status acpi_ev_gpe_initialize(void); + +/* + * evregion - Address Space handling + */ +acpi_status acpi_ev_install_region_handlers(void); + +acpi_status acpi_ev_initialize_op_regions(void); + +acpi_status +acpi_ev_address_space_dispatch(union acpi_operand_object *region_obj, + u32 function, + acpi_physical_address address, + u32 bit_width, acpi_integer * value); + +acpi_status +acpi_ev_attach_region(union acpi_operand_object *handler_obj, + union acpi_operand_object *region_obj, + u8 acpi_ns_is_locked); + +void +acpi_ev_detach_region(union acpi_operand_object *region_obj, + u8 acpi_ns_is_locked); + +acpi_status +acpi_ev_install_space_handler(struct acpi_namespace_node *node, + acpi_adr_space_type space_id, + acpi_adr_space_handler handler, + acpi_adr_space_setup setup, void *context); + +acpi_status +acpi_ev_execute_reg_methods(struct acpi_namespace_node *node, + acpi_adr_space_type space_id); + +acpi_status +acpi_ev_execute_reg_method(union acpi_operand_object *region_obj, u32 function); + +/* + * evregini - Region initialization and setup + */ +acpi_status +acpi_ev_system_memory_region_setup(acpi_handle handle, + u32 function, + void *handler_context, + void **region_context); + +acpi_status +acpi_ev_io_space_region_setup(acpi_handle handle, + u32 function, + void *handler_context, void **region_context); + +acpi_status +acpi_ev_pci_config_region_setup(acpi_handle handle, + u32 function, + void *handler_context, void **region_context); + +acpi_status +acpi_ev_cmos_region_setup(acpi_handle handle, + u32 function, + void *handler_context, void **region_context); + +acpi_status +acpi_ev_pci_bar_region_setup(acpi_handle handle, + u32 function, + void *handler_context, void **region_context); + +acpi_status +acpi_ev_default_region_setup(acpi_handle handle, + u32 function, + void *handler_context, void **region_context); + +acpi_status +acpi_ev_initialize_region(union acpi_operand_object *region_obj, + u8 acpi_ns_locked); + +/* + * evsci - SCI (System Control Interrupt) handling/dispatch + */ +u32 ACPI_SYSTEM_XFACE acpi_ev_gpe_xrupt_handler(void *context); + +u32 acpi_ev_install_sci_handler(void); + +acpi_status acpi_ev_remove_sci_handler(void); + +u32 acpi_ev_initialize_sCI(u32 program_sCI); + +void acpi_ev_terminate(void); + +#endif /* __ACEVENTS_H__ */ diff --git a/drivers/acpi/acpica/acglobal.h b/drivers/acpi/acpica/acglobal.h new file mode 100644 index 000000000000..ddb40f5c68fc --- /dev/null +++ b/drivers/acpi/acpica/acglobal.h @@ -0,0 +1,394 @@ +/****************************************************************************** + * + * Name: acglobal.h - Declarations for global variables + * + *****************************************************************************/ + +/* + * Copyright (C) 2000 - 2008, Intel Corp. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions, and the following disclaimer, + * without modification. + * 2. Redistributions in binary form must reproduce at minimum a disclaimer + * substantially similar to the "NO WARRANTY" disclaimer below + * ("Disclaimer") and any redistribution must be conditioned upon + * including a substantially similar Disclaimer requirement for further + * binary redistribution. + * 3. Neither the names of the above-listed copyright holders nor the names + * of any contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * Alternatively, this software may be distributed under the terms of the + * GNU General Public License ("GPL") version 2 as published by the Free + * Software Foundation. + * + * NO WARRANTY + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGES. + */ + +#ifndef __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 + * allows the interpreter to ignore certain errors and/or bad AML constructs. + * + * Currently, these features are enabled by this flag: + * + * 1) Allow "implicit return" of last value in a control method + * 2) Allow access beyond the end of an operation region + * 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 + * 5) Allow unresolved references (invalid target name) in package objects + * 6) Enable warning messages for behavior that is not ACPI spec compliant + */ +ACPI_EXTERN u8 ACPI_INIT_GLOBAL(acpi_gbl_enable_interpreter_slack, FALSE); + +/* + * 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 + * reentrancy even though methods are marked "NotSerialized". + */ +ACPI_EXTERN u8 ACPI_INIT_GLOBAL(acpi_gbl_all_methods_serialized, FALSE); + +/* + * 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. + */ +ACPI_EXTERN u8 ACPI_INIT_GLOBAL(acpi_gbl_create_osi_method, 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. + */ +ACPI_EXTERN u8 ACPI_INIT_GLOBAL(acpi_gbl_leave_wake_gpes_disabled, 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. + */ +ACPI_EXTERN u8 ACPI_INIT_GLOBAL(acpi_gbl_use_default_register_widths, TRUE); + +/***************************************************************************** + * + * 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; + +/***************************************************************************** + * + * ACPI Table globals + * + ****************************************************************************/ + +/* + * acpi_gbl_root_table_list is the master list of ACPI tables found in the + * RSDT/XSDT. + * + * acpi_gbl_FADT is a local copy of the FADT, converted to a common format. + */ +ACPI_EXTERN struct acpi_internal_rsdt acpi_gbl_root_table_list; +ACPI_EXTERN struct acpi_table_fadt acpi_gbl_FADT; +ACPI_EXTERN struct acpi_table_facs *acpi_gbl_FACS; + +/* 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; + +/* + * 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. + */ +ACPI_EXTERN u8 acpi_gbl_integer_bit_width; +ACPI_EXTERN u8 acpi_gbl_integer_byte_width; +ACPI_EXTERN u8 acpi_gbl_integer_nybble_width; + +/***************************************************************************** + * + * Mutual exlusion within ACPICA subsystem + * + ****************************************************************************/ + +/* + * Predefined mutex objects. This array contains the + * actual OS mutex handles, indexed by the local ACPI_MUTEX_HANDLEs. + * (The table maps local handles to the real OS handles) + */ +ACPI_EXTERN struct acpi_mutex_info acpi_gbl_mutex_info[ACPI_NUM_MUTEX]; + +/* + * Global lock mutex is an actual AML mutex object + * Global lock semaphore works in conjunction with the HW global lock + */ +ACPI_EXTERN union acpi_operand_object *acpi_gbl_global_lock_mutex; +ACPI_EXTERN acpi_semaphore acpi_gbl_global_lock_semaphore; +ACPI_EXTERN u16 acpi_gbl_global_lock_handle; +ACPI_EXTERN u8 acpi_gbl_global_lock_acquired; +ACPI_EXTERN u8 acpi_gbl_global_lock_present; + +/* + * 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 + +/***************************************************************************** + * + * Miscellaneous globals + * + ****************************************************************************/ + +#ifdef ACPI_DBG_TRACK_ALLOCATIONS + +/* Lists for tracking memory allocations */ + +ACPI_EXTERN struct acpi_memory_list *acpi_gbl_global_list; +ACPI_EXTERN struct acpi_memory_list *acpi_gbl_ns_node_list; +ACPI_EXTERN u8 acpi_gbl_display_final_mem_stats; +#endif + +/* Object caches */ + +ACPI_EXTERN acpi_cache_t *acpi_gbl_namespace_cache; +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; + +/* Global handlers */ + +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; +ACPI_EXTERN acpi_tbl_handler acpi_gbl_table_handler; +ACPI_EXTERN void *acpi_gbl_table_handler_context; +ACPI_EXTERN struct acpi_walk_state *acpi_gbl_breakpoint_walk; + +/* 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; + +/* Misc */ + +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; + +#ifndef DEFINE_ACPI_GLOBALS + +/* Other miscellaneous */ + +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]; + +#endif + +/* 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[]; + +/***************************************************************************** + * + * 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 + +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; + +extern const u8 acpi_gbl_ns_properties[ACPI_NUM_NS_TYPES]; +extern const struct acpi_predefined_names + acpi_gbl_pre_defined_names[NUM_PREDEFINED_NAMES]; + +#ifdef ACPI_DEBUG_OUTPUT +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; +ACPI_EXTERN acpi_size *acpi_gbl_entry_stack_pointer; +ACPI_EXTERN acpi_size *acpi_gbl_lowest_stack_pointer; +ACPI_EXTERN u32 acpi_gbl_deepest_nesting; +#endif + +/***************************************************************************** + * + * Interpreter globals + * + ****************************************************************************/ + +ACPI_EXTERN struct acpi_thread_state *acpi_gbl_current_walk_list; + +/* Control method single step flag */ + +ACPI_EXTERN u8 acpi_gbl_cm_single_step; + +/***************************************************************************** + * + * Hardware globals + * + ****************************************************************************/ + +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; + +/***************************************************************************** + * + * Event and GPE globals + * + ****************************************************************************/ + +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 +*acpi_gbl_gpe_fadt_blocks[ACPI_MAX_GPE_BLOCKS]; +ACPI_EXTERN u32 acpi_current_gpe_count; + +/***************************************************************************** + * + * Debugger globals + * + ****************************************************************************/ + +ACPI_EXTERN u8 acpi_gbl_db_output_flags; + +#ifdef ACPI_DISASSEMBLER + +ACPI_EXTERN u8 acpi_gbl_db_opt_disasm; +ACPI_EXTERN u8 acpi_gbl_db_opt_verbose; +#endif + +#ifdef ACPI_DEBUGGER + +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; + +/* + * Statistic globals + */ +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; + +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; + +#endif /* ACPI_DEBUGGER */ + +#endif /* __ACGLOBAL_H__ */ diff --git a/drivers/acpi/acpica/achware.h b/drivers/acpi/acpica/achware.h new file mode 100644 index 000000000000..58c69dc49ab4 --- /dev/null +++ b/drivers/acpi/acpica/achware.h @@ -0,0 +1,119 @@ +/****************************************************************************** + * + * Name: achware.h -- hardware specific interfaces + * + *****************************************************************************/ + +/* + * Copyright (C) 2000 - 2008, Intel Corp. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions, and the following disclaimer, + * without modification. + * 2. Redistributions in binary form must reproduce at minimum a disclaimer + * substantially similar to the "NO WARRANTY" disclaimer below + * ("Disclaimer") and any redistribution must be conditioned upon + * including a substantially similar Disclaimer requirement for further + * binary redistribution. + * 3. Neither the names of the above-listed copyright holders nor the names + * of any contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * Alternatively, this software may be distributed under the terms of the + * GNU General Public License ("GPL") version 2 as published by the Free + * Software Foundation. + * + * NO WARRANTY + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGES. + */ + +#ifndef __ACHWARE_H__ +#define __ACHWARE_H__ + +/* Values for the _SST predefined method */ + +#define ACPI_SST_INDICATOR_OFF 0 +#define ACPI_SST_WORKING 1 +#define ACPI_SST_WAKING 2 +#define ACPI_SST_SLEEPING 3 +#define ACPI_SST_SLEEP_CONTEXT 4 + +/* + * hwacpi - high level functions + */ +acpi_status acpi_hw_set_mode(u32 mode); + +u32 acpi_hw_get_mode(void); + +/* + * hwregs - ACPI Register I/O + */ +struct acpi_bit_register_info *acpi_hw_get_bit_register_info(u32 register_id); + +acpi_status +acpi_hw_register_read(u32 register_id, u32 * return_value); + +acpi_status acpi_hw_register_write(u32 register_id, u32 value); + +acpi_status acpi_hw_clear_acpi_status(void); + +/* + * hwgpe - GPE support + */ +acpi_status acpi_hw_low_disable_gpe(struct acpi_gpe_event_info *gpe_event_info); + +acpi_status +acpi_hw_write_gpe_enable_reg(struct acpi_gpe_event_info *gpe_event_info); + +acpi_status +acpi_hw_disable_gpe_block(struct acpi_gpe_xrupt_info *gpe_xrupt_info, + struct acpi_gpe_block_info *gpe_block, void *context); + +acpi_status acpi_hw_clear_gpe(struct acpi_gpe_event_info *gpe_event_info); + +acpi_status +acpi_hw_clear_gpe_block(struct acpi_gpe_xrupt_info *gpe_xrupt_info, + struct acpi_gpe_block_info *gpe_block, void *context); + +acpi_status +acpi_hw_get_gpe_status(struct acpi_gpe_event_info *gpe_event_info, + acpi_event_status * event_status); + +acpi_status acpi_hw_disable_all_gpes(void); + +acpi_status acpi_hw_enable_all_runtime_gpes(void); + +acpi_status acpi_hw_enable_all_wakeup_gpes(void); + +acpi_status +acpi_hw_enable_runtime_gpe_block(struct acpi_gpe_xrupt_info *gpe_xrupt_info, + struct acpi_gpe_block_info *gpe_block, + void *context); + +#ifdef ACPI_FUTURE_USAGE +/* + * hwtimer - ACPI Timer prototypes + */ +acpi_status acpi_get_timer_resolution(u32 * resolution); + +acpi_status acpi_get_timer(u32 * ticks); + +acpi_status +acpi_get_timer_duration(