Commit c957f976 authored by Linus Torvalds's avatar Linus Torvalds

Merge http://linux-acpi.bkbits.net/linux-acpi

into penguin.transmeta.com:/home/penguin/torvalds/repositories/kernel/linux
parents 0c152879 8b9d280c
......@@ -72,6 +72,11 @@ CONFIG_ACPI_PROCESSOR
ACPI C2 and C3 processor states to save power, on systems that
support it.
CONFIG_ACPI_PROCESSOR_PERF
This driver adds support for CPU frequency scaling, if this is supported
by the hardware and the BIOS. If you are compiling for a mobile system,
say Y.
CONFIG_ACPI_THERMAL
This driver adds support for ACPI thermal zones. Most mobile and
some desktop systems support ACPI thermal zones. It is HIGHLY
......
......@@ -21,6 +21,12 @@ if [ "$CONFIG_X86" = "y" ]; then
tristate ' Button' CONFIG_ACPI_BUTTON
tristate ' Fan' CONFIG_ACPI_FAN
tristate ' Processor' CONFIG_ACPI_PROCESSOR
if [ "$CONFIG_ACPI_PROCESSOR" != "n" ]; then
bool ' Processor Performance States' CONFIG_ACPI_PROCESSOR_PERF
if [ "$CONFIG_CPU_FREQ" != "y" ]; then
define_bool CONFIG_CPU_FREQ $CONFIG_ACPI_PROCESSOR_PERF
fi
fi
dep_tristate ' Thermal Zone' CONFIG_ACPI_THERMAL $CONFIG_ACPI_PROCESSOR
if [ "$CONFIG_NUMA" = "y" ]; then
dep_bool ' NUMA support' CONFIG_ACPI_NUMA $CONFIG_NUMA
......
......@@ -86,6 +86,7 @@ EXPORT_SYMBOL(acpi_get_register);
EXPORT_SYMBOL(acpi_set_register);
EXPORT_SYMBOL(acpi_enter_sleep_state);
EXPORT_SYMBOL(acpi_get_system_info);
EXPORT_SYMBOL(acpi_get_devices);
/* ACPI OS Services Layer (acpi_osl.c) */
......@@ -100,6 +101,8 @@ EXPORT_SYMBOL(acpi_os_create_semaphore);
EXPORT_SYMBOL(acpi_os_delete_semaphore);
EXPORT_SYMBOL(acpi_os_wait_semaphore);
EXPORT_SYMBOL(acpi_os_read_pci_configuration);
/* ACPI Utilities (acpi_utils.c) */
EXPORT_SYMBOL(acpi_extract_package);
......@@ -126,3 +129,15 @@ EXPORT_SYMBOL(acpi_bus_register_driver);
EXPORT_SYMBOL(acpi_bus_unregister_driver);
#endif /*CONFIG_ACPI_BUS*/
/* ACPI PCI Driver (pci_irq.c) */
#ifdef CONFIG_ACPI_PCI
#include <linux/pci.h>
extern int acpi_pci_irq_enable(struct pci_dev *dev);
EXPORT_SYMBOL(acpi_pci_irq_enable);
extern int acpi_pci_irq_lookup (int segment, int bus, int device, int pin);
EXPORT_SYMBOL(acpi_pci_irq_lookup);
#endif /*CONFIG_ACPI_PCI */
......@@ -78,9 +78,7 @@ static struct acpi_blacklist_item acpi_blacklist[] __initdata =
{"INT440", "SYSFexxx", 0x00001001, ACPI_DSDT, less_than_or_equal, "Does not use _REG to protect EC OpRegions", 1},
/* IBM 600E - _ADR should return 7, but it returns 1 */
{"IBM ", "TP600E ", 0x00000105, ACPI_DSDT, less_than_or_equal, "Incorrect _ADR", 1},
{"VIA694", "AWRDACPI", 0, ACPI_DSDT, all_versions, "Bogus table", 1},
{"ASUS\0\0", "P2B-S ", 0, ACPI_DSDT, all_versions, "Bogus PCI routing", 1},
{"COMPAQ", "DSDT", 0, ACPI_DSDT, all_versions, "Bogus PCI routing", 1},
{""}
};
......
/******************************************************************************
*
* Module Name: dsfield - Dispatcher field routines
* $Revision: 68 $
* $Revision: 69 $
*
*****************************************************************************/
......@@ -103,7 +103,7 @@ acpi_ds_create_buffer_field (
* Enter the Name_string into the namespace
*/
status = acpi_ns_lookup (walk_state->scope_info, arg->common.value.string,
INTERNAL_TYPE_DEF_ANY, ACPI_IMODE_LOAD_PASS1,
ACPI_TYPE_ANY, ACPI_IMODE_LOAD_PASS1,
flags, walk_state, &(node));
if (ACPI_FAILURE (status)) {
ACPI_REPORT_NSERROR (arg->common.value.string, status);
......@@ -343,7 +343,7 @@ acpi_ds_create_field (
/* Each remaining arg is a Named Field */
info.field_type = INTERNAL_TYPE_REGION_FIELD;
info.field_type = ACPI_TYPE_LOCAL_REGION_FIELD;
info.region_node = region_node;
status = acpi_ds_get_field_names (&info, walk_state, arg->common.next);
......@@ -384,17 +384,17 @@ acpi_ds_init_field_objects (
switch (walk_state->opcode) {
case AML_FIELD_OP:
arg = acpi_ps_get_arg (op, 2);
type = INTERNAL_TYPE_REGION_FIELD;
type = ACPI_TYPE_LOCAL_REGION_FIELD;
break;
case AML_BANK_FIELD_OP:
arg = acpi_ps_get_arg (op, 4);
type = INTERNAL_TYPE_BANK_FIELD;
type = ACPI_TYPE_LOCAL_BANK_FIELD;
break;
case AML_INDEX_FIELD_OP:
arg = acpi_ps_get_arg (op, 3);
type = INTERNAL_TYPE_INDEX_FIELD;
type = ACPI_TYPE_LOCAL_INDEX_FIELD;
break;
default:
......@@ -477,11 +477,11 @@ acpi_ds_create_bank_field (
}
}
/* Second arg is the Bank Register (must already exist) */
/* Second arg is the Bank Register (Field) (must already exist) */
arg = arg->common.next;
status = acpi_ns_lookup (walk_state->scope_info, arg->common.value.string,
INTERNAL_TYPE_BANK_FIELD_DEFN, ACPI_IMODE_EXECUTE,
ACPI_TYPE_ANY, ACPI_IMODE_EXECUTE,
ACPI_NS_SEARCH_PARENT, walk_state, &info.register_node);
if (ACPI_FAILURE (status)) {
ACPI_REPORT_NSERROR (arg->common.value.string, status);
......@@ -500,7 +500,7 @@ acpi_ds_create_bank_field (
/* Each remaining arg is a Named Field */
info.field_type = INTERNAL_TYPE_BANK_FIELD;
info.field_type = ACPI_TYPE_LOCAL_BANK_FIELD;
info.region_node = region_node;
status = acpi_ds_get_field_names (&info, walk_state, arg->common.next);
......@@ -552,7 +552,7 @@ acpi_ds_create_index_field (
arg = arg->common.next;
status = acpi_ns_lookup (walk_state->scope_info, arg->common.value.string,
INTERNAL_TYPE_INDEX_FIELD_DEFN, ACPI_IMODE_EXECUTE,
ACPI_TYPE_ANY, ACPI_IMODE_EXECUTE,
ACPI_NS_SEARCH_PARENT, walk_state, &info.data_register_node);
if (ACPI_FAILURE (status)) {
ACPI_REPORT_NSERROR (arg->common.value.string, status);
......@@ -566,7 +566,7 @@ acpi_ds_create_index_field (
/* Each remaining arg is a Named Field */
info.field_type = INTERNAL_TYPE_INDEX_FIELD;
info.field_type = ACPI_TYPE_LOCAL_INDEX_FIELD;
info.region_node = region_node;
status = acpi_ds_get_field_names (&info, walk_state, arg->common.next);
......
/*******************************************************************************
*
* Module Name: dsmthdat - control method arguments and local variables
* $Revision: 63 $
* $Revision: 64 $
*
******************************************************************************/
......@@ -603,7 +603,7 @@ acpi_ds_store_object_to_local (
* If we have a valid reference object that came from Ref_of(), do the
* indirect store
*/
if ((current_obj_desc->common.type == INTERNAL_TYPE_REFERENCE) &&
if ((current_obj_desc->common.type == ACPI_TYPE_LOCAL_REFERENCE) &&
(current_obj_desc->reference.opcode == AML_REF_OF_OP)) {
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
"Arg (%p) is an Obj_ref(Node), storing in node %p\n",
......
/******************************************************************************
*
* Module Name: dsobject - Dispatcher object management routines
* $Revision: 108 $
* $Revision: 110 $
*
*****************************************************************************/
......@@ -707,7 +707,7 @@ acpi_ds_init_object_from_op (
case ACPI_TYPE_STRING:
obj_desc->string.pointer = op->common.value.string;
obj_desc->string.length = ACPI_STRLEN (op->common.value.string);
obj_desc->string.length = (u32) ACPI_STRLEN (op->common.value.string);
/*
* The string is contained in the ACPI table, don't ever try
......@@ -721,7 +721,7 @@ acpi_ds_init_object_from_op (
break;
case INTERNAL_TYPE_REFERENCE:
case ACPI_TYPE_LOCAL_REFERENCE:
switch (op_info->type) {
case AML_TYPE_LOCAL_VARIABLE:
......
......@@ -2,7 +2,7 @@
*
* Module Name: dsopcode - Dispatcher Op Region support and handling of
* "control" opcodes
* $Revision: 82 $
* $Revision: 83 $
*
*****************************************************************************/
......@@ -1021,7 +1021,7 @@ acpi_ds_exec_end_control_op (
* Allow references created by the Index operator to return unchanged.
*/
if ((ACPI_GET_DESCRIPTOR_TYPE (walk_state->results->results.obj_desc[0]) == ACPI_DESC_TYPE_OPERAND) &&
(ACPI_GET_OBJECT_TYPE (walk_state->results->results.obj_desc [0]) == INTERNAL_TYPE_REFERENCE) &&
(ACPI_GET_OBJECT_TYPE (walk_state->results->results.obj_desc [0]) == ACPI_TYPE_LOCAL_REFERENCE) &&
((walk_state->results->results.obj_desc [0])->reference.opcode != AML_INDEX_OP)) {
status = acpi_ex_resolve_to_value (&walk_state->results->results.obj_desc [0], walk_state);
if (ACPI_FAILURE (status)) {
......
/*******************************************************************************
*
* Module Name: dsutils - Dispatcher utilities
* $Revision: 95 $
* $Revision: 96 $
*
******************************************************************************/
......@@ -431,7 +431,7 @@ acpi_ds_create_operand (
/* Get the object type of the argument */
op_info = acpi_ps_get_opcode_info (opcode);
if (op_info->object_type == INTERNAL_TYPE_INVALID) {
if (op_info->object_type == ACPI_TYPE_INVALID) {
return_ACPI_STATUS (AE_NOT_IMPLEMENTED);
}
......
/******************************************************************************
*
* Module Name: dswload - Dispatcher namespace load callbacks
* $Revision: 75 $
* $Revision: 78 $
*
*****************************************************************************/
......@@ -151,49 +151,27 @@ acpi_ds_load1_begin_op (
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
"State=%p Op=%p [%s] ", walk_state, op, acpi_ut_get_type_name (object_type)));
/*
* Setup the search flags.
*
* Since we are entering a name into the namespace, we do not want to
* enable the search-to-root upsearch.
*
* There are only two conditions where it is acceptable that the name
* already exists:
* 1) the Scope() operator can reopen a scoping object that was
* previously defined (Scope, Method, Device, etc.)
* 2) Whenever we are parsing a deferred opcode (Op_region, Buffer,
* Buffer_field, or Package), the name of the object is already
* in the namespace.
*/
flags = ACPI_NS_NO_UPSEARCH;
if ((walk_state->opcode != AML_SCOPE_OP) &&
(!(walk_state->parse_flags & ACPI_PARSE_DEFERRED_OP))) {
flags |= ACPI_NS_ERROR_IF_FOUND;
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_DISPATCH, "Cannot already exist\n"));
}
else {
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_DISPATCH, "Both Find or Create allowed\n"));
}
switch (walk_state->opcode) {
case AML_SCOPE_OP:
/*
* Enter the named type into the internal namespace. We enter the name
* as we go downward in the parse tree. Any necessary subobjects that involve
* arguments to the opcode must be created as we go back up the parse tree later.
*/
status = acpi_ns_lookup (walk_state->scope_info, path, object_type,
ACPI_IMODE_LOAD_PASS1, flags, walk_state, &(node));
if (ACPI_FAILURE (status)) {
ACPI_REPORT_NSERROR (path, status);
return (status);
}
/*
* The target name of the Scope() operator must exist at this point so
* that we can actually open the scope to enter new names underneath it.
* Allow search-to-root for single namesegs.
*/
status = acpi_ns_lookup (walk_state->scope_info, path, object_type,
ACPI_IMODE_EXECUTE, ACPI_NS_SEARCH_PARENT, walk_state, &(node));
if (ACPI_FAILURE (status)) {
ACPI_REPORT_NSERROR (path, status);
return (status);
}
/*
* For the scope op, we must check to make sure that the target is
* one of the opcodes that actually opens a scope
*/
if (walk_state->opcode == AML_SCOPE_OP) {
/*
* Check to make sure that the target is
* one of the opcodes that actually opens a scope
*/
switch (node->type) {
case ACPI_TYPE_ANY: /* Scope nodes are untyped (ANY) */
case ACPI_TYPE_LOCAL_SCOPE: /* Scope */
case ACPI_TYPE_DEVICE:
case ACPI_TYPE_POWER:
case ACPI_TYPE_PROCESSOR:
......@@ -223,7 +201,7 @@ acpi_ds_load1_begin_op (
walk_state->scope_info->common.value = ACPI_TYPE_ANY;
break;
default:
default:
/* All other types are an error */
......@@ -232,8 +210,53 @@ acpi_ds_load1_begin_op (
return (AE_AML_OPERAND_TYPE);
}
break;
default:
/*
* For all other named opcodes, we will enter the name into the namespace.
*
* Setup the search flags.
* Since we are entering a name into the namespace, we do not want to
* enable the search-to-root upsearch.
*
* There are only two conditions where it is acceptable that the name
* already exists:
* 1) the Scope() operator can reopen a scoping object that was
* previously defined (Scope, Method, Device, etc.)
* 2) Whenever we are parsing a deferred opcode (Op_region, Buffer,
* Buffer_field, or Package), the name of the object is already
* in the namespace.
*/
flags = ACPI_NS_NO_UPSEARCH;
if ((walk_state->opcode != AML_SCOPE_OP) &&
(!(walk_state->parse_flags & ACPI_PARSE_DEFERRED_OP))) {
flags |= ACPI_NS_ERROR_IF_FOUND;
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_DISPATCH, "Cannot already exist\n"));
}
else {
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_DISPATCH, "Both Find or Create allowed\n"));
}
/*
* Enter the named type into the internal namespace. We enter the name
* as we go downward in the parse tree. Any necessary subobjects that involve
* arguments to the opcode must be created as we go back up the parse tree later.
*/
status = acpi_ns_lookup (walk_state->scope_info, path, object_type,
ACPI_IMODE_LOAD_PASS1, flags, walk_state, &(node));
if (ACPI_FAILURE (status)) {
ACPI_REPORT_NSERROR (path, status);
return (status);
}
break;
}
/* Common exit */
if (!op) {
/* Create a new op */
......@@ -419,59 +442,43 @@ acpi_ds_load2_begin_op (
"State=%p Op=%p Type=%X\n", walk_state, op, object_type));
if (walk_state->opcode == AML_FIELD_OP ||
walk_state->opcode == AML_BANK_FIELD_OP ||
walk_state->opcode == AML_INDEX_FIELD_OP) {
switch (walk_state->opcode) {
case AML_FIELD_OP:
case AML_BANK_FIELD_OP:
case AML_INDEX_FIELD_OP:
node = NULL;
status = AE_OK;
}
else if (walk_state->opcode == AML_INT_NAMEPATH_OP) {
break;
case AML_INT_NAMEPATH_OP:
/*
* The Name_path is an object reference to an existing object. Don't enter the
* name into the namespace, but look it up for use later
*/
status = acpi_ns_lookup (walk_state->scope_info, buffer_ptr, object_type,
ACPI_IMODE_EXECUTE, ACPI_NS_SEARCH_PARENT, walk_state, &(node));
}
else {
/* All other opcodes */
if (op && op->common.node) {
/* This op/node was previously entered into the namespace */
node = op->common.node;
if (acpi_ns_opens_scope (object_type)) {
status = acpi_ds_scope_stack_push (node, object_type, walk_state);
if (ACPI_FAILURE (status)) {
return_ACPI_STATUS (status);
}
break;
}
return_ACPI_STATUS (AE_OK);
}
case AML_SCOPE_OP:
/*
* Enter the named type into the internal namespace. We enter the name
* as we go downward in the parse tree. Any necessary subobjects that involve
* arguments to the opcode must be created as we go back up the parse tree later.
* The Path is an object reference to an existing object. Don't enter the
* name into the namespace, but look it up for use later
*/
status = acpi_ns_lookup (walk_state->scope_info, buffer_ptr, object_type,
ACPI_IMODE_EXECUTE, ACPI_NS_NO_UPSEARCH, walk_state, &(node));
}
if (ACPI_FAILURE (status)) {
ACPI_REPORT_NSERROR (buffer_ptr, status);
return_ACPI_STATUS (status);
}
/*
* For the scope op, we must check to make sure that the target is
* one of the opcodes that actually opens a scope
*/
if (walk_state->opcode == AML_SCOPE_OP) {
ACPI_IMODE_EXECUTE, ACPI_NS_SEARCH_PARENT, walk_state, &(node));
if (ACPI_FAILURE (status)) {
ACPI_REPORT_NSERROR (buffer_ptr, status);
return_ACPI_STATUS (status);
}
/*
* We must check to make sure that the target is
* one of the opcodes that actually opens a scope
*/
switch (node->type) {
case ACPI_TYPE_ANY: /* Scope nodes are untyped (ANY) */
case ACPI_TYPE_LOCAL_SCOPE: /* Scope */
case ACPI_TYPE_DEVICE:
case ACPI_TYPE_POWER:
case ACPI_TYPE_PROCESSOR:
......@@ -499,7 +506,7 @@ acpi_ds_load2_begin_op (
walk_state->scope_info->common.value = ACPI_TYPE_ANY;
break;
default:
default:
/* All other types are an error */
......@@ -508,8 +515,43 @@ acpi_ds_load2_begin_op (
return (AE_AML_OPERAND_TYPE);
}
break;
default:
/* All other opcodes */
if (op && op->common.node) {
/* This op/node was previously entered into the namespace */
node = op->common.node;
if (acpi_ns_opens_scope (object_type)) {
status = acpi_ds_scope_stack_push (node, object_type, walk_state);
if (ACPI_FAILURE (status)) {
return_ACPI_STATUS (status);
}
}
return_ACPI_STATUS (AE_OK);
}
/*
* Enter the named type into the internal namespace. We enter the name
* as we go downward in the parse tree. Any necessary subobjects that involve
* arguments to the opcode must be created as we go back up the parse tree later.
*/
status = acpi_ns_lookup (walk_state->scope_info, buffer_ptr, object_type,
ACPI_IMODE_EXECUTE, ACPI_NS_NO_UPSEARCH, walk_state, &(node));
break;
}
if (ACPI_FAILURE (status)) {
ACPI_REPORT_NSERROR (buffer_ptr, status);
return_ACPI_STATUS (status);
}
if (!op) {
/* Create a new op */
......
/******************************************************************************
*
* Module Name: dswscope - Scope stack manipulation
* $Revision: 53 $
* $Revision: 56 $
*
*****************************************************************************/
......@@ -25,7 +25,6 @@
#include "acpi.h"
#include "acinterp.h"
#include "acdispat.h"
......@@ -88,6 +87,7 @@ acpi_ds_scope_stack_push (
acpi_walk_state *walk_state)
{
acpi_generic_state *scope_info;
acpi_generic_state *old_scope_info;
ACPI_FUNCTION_TRACE ("Ds_scope_stack_push");
......@@ -102,7 +102,7 @@ acpi_ds_scope_stack_push (
/* Make sure object type is valid */
if (!acpi_ex_validate_object_type (type)) {
if (!acpi_ut_valid_object_type (type)) {
ACPI_REPORT_WARNING (("Ds_scope_stack_push: type code out of range\n"));
}
......@@ -120,6 +120,28 @@ acpi_ds_scope_stack_push (
scope_info->scope.node = node;
scope_info->common.value = (u16) type;
walk_state->scope_depth++;
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
"[%.2d] Pushed scope ", (u32) walk_state->scope_depth));
old_scope_info = walk_state->scope_info;
if (old_scope_info) {
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_EXEC,
"[%4.4s] (%10s)",
old_scope_info->scope.node->name.ascii,
acpi_ut_get_type_name (old_scope_info->common.value)));
}
else {
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_EXEC,
"[\\___] (%10s)", "ROOT"));
}
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_EXEC,
", New scope -> [%4.4s] (%s)\n",
scope_info->scope.node->name.ascii,
acpi_ut_get_type_name (scope_info->common.value)));
/* Push new scope object onto stack */
acpi_ut_push_generic_state (&walk_state->scope_info, scope_info);
......@@ -150,6 +172,7 @@ acpi_ds_scope_stack_pop (
acpi_walk_state *walk_state)
{
acpi_generic_state *scope_info;
acpi_generic_state *new_scope_info;
ACPI_FUNCTION_TRACE ("Ds_scope_stack_pop");
......@@ -163,8 +186,25 @@ acpi_ds_scope_stack_pop (
return_ACPI_STATUS (AE_STACK_UNDERFLOW);
}
walk_state->scope_depth--;
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
"Popped object type (%s)\n", acpi_ut_get_type_name (scope_info->common.value)));
"[%.2d] Popped scope [%4.4s] (%10s), New scope -> ",
(u32) walk_state->scope_depth,
scope_info->scope.node->name.ascii,
acpi_ut_get_type_name (scope_info->common.value)));
new_scope_info = walk_state->scope_info;
if (new_scope_info) {
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_EXEC,
"[%4.4s] (%s)\n",
new_scope_info->scope.node->name.ascii,
acpi_ut_get_type_name (new_scope_info->common.value)));
}
else {
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_EXEC,
"[\\___] (ROOT)\n"));
}
acpi_ut_delete_generic_state (scope_info);
......
/******************************************************************************
*
* Module Name: dswstate - Dispatcher parse tree walk management routines
* $Revision: 68 $
* $Revision: 69 $
*
*****************************************************************************/
......@@ -174,7 +174,7 @@ acpi_ds_result_pop (
acpi_operand_object **object,
acpi_walk_state *walk_state)
{
u32 index;
NATIVE_UINT index;
acpi_generic_state *state;
......@@ -205,7 +205,7 @@ acpi_ds_result_pop (
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Obj=%p [%s] Index=%X State=%p Num=%X\n",
*object, (*object) ? acpi_ut_get_object_type_name (*object) : "NULL",
index -1, walk_state, state->results.num_results));
(u32) index -1, walk_state, state->results.num_results));
return (AE_OK);
}
......
......@@ -80,6 +80,7 @@ static struct acpi_driver acpi_ec_driver = {
struct acpi_ec {
acpi_handle handle;
unsigned long uid;
unsigned long gpe_bit;
acpi_generic_address status_addr;
acpi_generic_address command_addr;
......@@ -90,9 +91,6 @@ struct acpi_ec {
/* If we find an EC via the ECDT, we need to keep a ptr to its context */
static struct acpi_ec *ec_ecdt;
/* compare this against UIDs in properly enumerated ECs to determine if we
have a dupe */
static unsigned long ecdt_uid = 0xFFFFFFFF;
/* --------------------------------------------------------------------------
Transaction Management
......@@ -297,80 +295,65 @@ struct acpi_ec_query_data {
u8 data;
};
static void
acpi_ec_gpe_query (
void *data)
void *ec_cxt)
{
struct acpi_ec_query_data *query_data = NULL;
struct acpi_ec *ec = (struct acpi_ec *) ec_cxt;
u32 value = 0;
unsigned long flags = 0;
static char object_name[5] = {'_','Q','0','0','\0'};
const char hex[] = {'0','1','2','3','4','5','6','7',
'8','9','A','B','C','D','E','F'};
ACPI_FUNCTION_TRACE("acpi_ec_gpe_query");
if (!data)
return;
if (!ec_cxt)
goto end;
query_data = (struct acpi_ec_query_data *) data;
spin_lock_irqsave(&ec->lock, flags);
acpi_hw_low_level_read(8, &value, &ec->command_addr, 0);
spin_unlock_irqrestore(&ec->lock, flags);
object_name[2] = hex[((query_data->data >> 4) & 0x0F)];
object_name[3] = hex[(query_data->data & 0x0F)];
/* TBD: Implement asynch events!
* NOTE: All we care about are EC-SCI's. Other EC events are
* handled via polling (yuck!). This is because some systems
* treat EC-SCIs as level (versus EDGE!) triggered, preventing
* a purely interrupt-driven approach (grumble, grumble).
*/
if (!(value & ACPI_EC_FLAG_SCI))
goto end;
ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Evaluating %s\n", object_name));
if (acpi_ec_query(ec, &value))
goto end;
object_name[2] = hex[((value >> 4) & 0x0F)];
object_name[3] = hex[(value & 0x0F)];
acpi_evaluate_object(query_data->handle, object_name, NULL, NULL);
ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Evaluating %s\n", object_name));
kfree(query_data);
acpi_evaluate_object(ec->handle, object_name, NULL, NULL);
return;
end:
acpi_enable_event(ec->gpe_bit, ACPI_EVENT_GPE, 0);
}
static void
acpi_ec_gpe_handler (
void *data)
{
acpi_status status = AE_OK;
struct acpi_ec *ec = (struct acpi_ec *) data;
u32 value = 0;
unsigned long flags = 0;
struct acpi_ec_query_data *query_data = NULL;
if (!ec)
return;
spin_lock_irqsave(&ec->lock, flags);
acpi_hw_low_level_read(8, &value, &ec->command_addr, 0);
spin_unlock_irqrestore(&ec->lock, flags);
/* TBD: Implement asynch events!
* NOTE: All we care about are EC-SCI's. Other EC events are
* handled via polling (yuck!). This is because some systems
* treat EC-SCIs as level (versus EDGE!) triggered, preventing
* a purely interrupt-driven approach (grumble, grumble).
*/
if (!(value & ACPI_EC_FLAG_SCI))
return;
if (acpi_ec_query(ec, &value))
return;
query_data = kmalloc(sizeof(struct acpi_ec_query_data), GFP_ATOMIC);
if (!query_data)
return;
query_data->handle = ec->handle;
query_data->data = value;
acpi_disable_event(ec->gpe_bit, ACPI_EVENT_GPE, 0);
status = acpi_os_queue_for_execution(OSD_PRIORITY_GPE,
acpi_ec_gpe_query, query_data);
if (ACPI_FAILURE(status))
kfree(query_data);
return;
acpi_ec_gpe_query, ec);
}
/* --------------------------------------------------------------------------
Address Space Management
-------------------------------------------------------------------------- */
......@@ -559,6 +542,7 @@ acpi_ec_add (
memset(ec, 0, sizeof(struct acpi_ec));
ec->handle = device->handle;
ec->uid = -1;
ec->lock = SPIN_LOCK_UNLOCKED;
sprintf(acpi_device_name(device), "%s", ACPI_EC_DEVICE_NAME);
sprintf(acpi_device_class(device), "%s", ACPI_EC_CLASS);
......@@ -567,10 +551,10 @@ acpi_ec_add (
/* Use the global lock for all EC transactions? */
acpi_evaluate_integer(ec->handle, "_GLK", NULL, &ec->global_lock);
/* If our UID matches ecdt_uid, we already found this EC via the
ECDT. Abort. */
/* If our UID matches the UID for the ECDT-enumerated EC,
we already found this EC, so abort. */
acpi_evaluate_integer(ec->handle, "_UID", NULL, &uid);
if (ecdt_uid == uid) {
if (ec_ecdt && ec_ecdt->uid == uid) {
result = -ENODEV;
goto end;
}
......@@ -758,7 +742,12 @@ acpi_ec_ecdt_probe (void)
ec_ecdt->lock = SPIN_LOCK_UNLOCKED;
/* use the GL just to be safe */
ec_ecdt->global_lock = TRUE;
ecdt_uid = ecdt_ptr->uid;
ec_ecdt->uid = ecdt_ptr->uid;
status = acpi_get_handle(NULL, ecdt_ptr->ec_id, &ec_ecdt->handle);
if (ACPI_FAILURE(status)) {
goto error;
}
/*
* Install GPE handler
......@@ -783,7 +772,9 @@ acpi_ec_ecdt_probe (void)
return 0;
error:
printk(KERN_ERR PREFIX "Could not use ECDT\n");
kfree(ec_ecdt);
ec_ecdt = NULL;
return -ENODEV;
}
......@@ -835,3 +826,4 @@ acpi_ec_exit (void)
return_VOID;
}
/******************************************************************************
*
* Module Name: evevent - Fixed and General Purpose Even handling and dispatch
* $Revision: 92 $
* $Revision: 95 $
*
*****************************************************************************/
......@@ -343,40 +343,58 @@ acpi_ev_gpe_initialize (void)
acpi_gbl_gpe_block_info[0].block_base_number = 0;
acpi_gbl_gpe_block_info[1].block_base_number = acpi_gbl_FADT->gpe1_base;
/* Warn and exit if there are no GPE registers */
acpi_gbl_gpe_register_count = acpi_gbl_gpe_block_info[0].register_count +
acpi_gbl_gpe_block_info[1].register_count;
if (!acpi_gbl_gpe_register_count) {
ACPI_REPORT_WARNING (("Zero GPEs are defined in the FADT\n"));
ACPI_REPORT_WARNING (("There are no GPE blocks defined in the FADT\n"));
return_ACPI_STATUS (AE_OK);
}
/* Determine the maximum GPE number for this machine */
/*
* Determine the maximum GPE number for this machine.
* Note: both GPE0 and GPE1 are optional, and either can exist without
* the other
*/
if (acpi_gbl_gpe_block_info[0].register_count) {
/* GPE block 0 exists */
acpi_gbl_gpe_number_max = ACPI_MUL_8 (acpi_gbl_gpe_block_info[0].register_count) - 1;
acpi_gbl_gpe_number_max = ACPI_MUL_8 (acpi_gbl_gpe_block_info[0].register_count) - 1;
}
if (acpi_gbl_gpe_block_info[1].register_count) {
/* Check for GPE0/GPE1 overlap */
/* GPE block 1 exists */
/* Check for GPE0/GPE1 overlap (if both banks exist) */
if (acpi_gbl_gpe_number_max >= acpi_gbl_FADT->gpe1_base) {
ACPI_REPORT_ERROR (("GPE0 block overlaps the GPE1 block\n"));
if ((acpi_gbl_gpe_block_info[0].register_count) &&
(acpi_gbl_gpe_number_max >= acpi_gbl_FADT->gpe1_base)) {
ACPI_REPORT_ERROR ((
"GPE0 block (GPE 0 to %d) overlaps the GPE1 block (GPE %d to %d)\n",
acpi_gbl_gpe_number_max, acpi_gbl_FADT->gpe1_base,
acpi_gbl_FADT->gpe1_base + (ACPI_MUL_8 (acpi_gbl_gpe_block_info[1].register_count) - 1)));
return_ACPI_STATUS (AE_BAD_VALUE);
}
/* GPE0 and GPE1 do not have to be contiguous in the GPE number space */
acpi_gbl_gpe_number_max = acpi_gbl_FADT->gpe1_base + (ACPI_MUL_8 (acpi_gbl_gpe_block_info[1].register_count) - 1);
/*
* GPE0 and GPE1 do not have to be contiguous in the GPE number space,
* But, GPE0 always starts at zero.
*/
acpi_gbl_gpe_number_max = acpi_gbl_FADT->gpe1_base +
(ACPI_MUL_8 (acpi_gbl_gpe_block_info[1].register_count) - 1);
}
/* Check for Max GPE number out-of-range */
if (acpi_gbl_gpe_number_max > ACPI_GPE_MAX) {
ACPI_REPORT_ERROR (("Maximum GPE number from FADT is too large: 0x%X\n", acpi_gbl_gpe_number_max));
ACPI_REPORT_ERROR (("Maximum GPE number from FADT is too large: 0x%X\n",
acpi_gbl_gpe_number_max));
return_ACPI_STATUS (AE_BAD_VALUE);
}
/*
* Allocate the GPE number-to-index translation table
*/
/* Allocate the GPE number-to-index translation table */
acpi_gbl_gpe_number_to_index = ACPI_MEM_CALLOCATE (
sizeof (ACPI_GPE_INDEX_INFO) *
((ACPI_SIZE) acpi_gbl_gpe_number_max + 1));
......@@ -391,9 +409,8 @@ acpi_ev_gpe_initialize (void)
ACPI_MEMSET (acpi_gbl_gpe_number_to_index, (int) ACPI_GPE_INVALID,
sizeof (ACPI_GPE_INDEX_INFO) * ((ACPI_SIZE) acpi_gbl_gpe_number_max + 1));
/*
* Allocate the GPE register information block
*/
/* Allocate the GPE register information block */
acpi_gbl_gpe_register_info = ACPI_MEM_CALLOCATE (
(ACPI_SIZE) acpi_gbl_gpe_register_count *
sizeof (ACPI_GPE_REGISTER_INFO));
......@@ -465,7 +482,6 @@ acpi_ev_gpe_initialize (void)
* are cleared by writing a '1', while enable registers are cleared
* by writing a '0'.
*/
status = acpi_hw_low_level_write (8, 0x00, &gpe_register_info->enable_address, 0);
if (ACPI_FAILURE (status)) {
return_ACPI_STATUS (status);
......@@ -479,16 +495,18 @@ acpi_ev_gpe_initialize (void)
gpe_register++;
}
ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "GPE Block%d: %X registers at %8.8X%8.8X\n",
(s32) gpe_block, acpi_gbl_gpe_block_info[0].register_count,
ACPI_HIDWORD (ACPI_GET_ADDRESS (acpi_gbl_gpe_block_info[gpe_block].block_address->address)),
ACPI_LODWORD (ACPI_GET_ADDRESS (acpi_gbl_gpe_block_info[gpe_block].block_address->address))));
ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "GPE Block%d Range GPE #%2.2X to GPE #%2.2X\n",
(s32) gpe_block,
acpi_gbl_gpe_block_info[gpe_block].block_base_number,
acpi_gbl_gpe_block_info[gpe_block].block_base_number +
((acpi_gbl_gpe_block_info[gpe_block].register_count * 8) -1)));
if (i) {
ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "GPE Block%d: %X registers at %8.8X%8.8X\n",
(s32) gpe_block, acpi_gbl_gpe_block_info[0].register_count,
ACPI_HIDWORD (ACPI_GET_ADDRESS (acpi_gbl_gpe_block_info[gpe_block].block_address->address)),
ACPI_LODWORD (ACPI_GET_ADDRESS (acpi_gbl_gpe_block_info[gpe_block].block_address->address))));
ACPI_REPORT_INFO (("GPE Block%d defined as GPE%d to GPE%d\n",
(s32) gpe_block,
acpi_gbl_gpe_block_info[gpe_block].block_base_number,
acpi_gbl_gpe_block_info[gpe_block].block_base_number +
((acpi_gbl_gpe_block_info[gpe_block].register_count * 8) -1)));
}
}
return_ACPI_STATUS (AE_OK);
......@@ -794,7 +812,7 @@ acpi_ev_asynch_execute_gpe_method (
*/
status = acpi_ns_evaluate_by_handle (gpe_info.method_handle, NULL, NULL);
if (ACPI_FAILURE (status)) {
ACPI_REPORT_ERROR (("%s while evaluated GPE%X method\n",
ACPI_REPORT_ERROR (("%s while evaluating GPE%X method\n",
acpi_format_exception (status), gpe_number));
}
}
......@@ -846,7 +864,7 @@ acpi_ev_gpe_dispatch (
gpe_number_index = acpi_ev_get_gpe_number_index (gpe_number);
if (gpe_number_index == ACPI_GPE_INVALID) {
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Invalid event, GPE[%X].\n", gpe_number));
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "GPE[%X] is not a valid event\n", gpe_number));
return_VALUE (ACPI_INTERRUPT_NOT_HANDLED);
}
......
/******************************************************************************
*
* Module Name: evxface - External interfaces for ACPI events
* $Revision: 130 $
* $Revision: 131 $
*
*****************************************************************************/
......@@ -294,7 +294,7 @@ acpi_install_notify_handler (
/* Install the handler */
notify_obj = acpi_ut_create_internal_object (INTERNAL_TYPE_NOTIFY);
notify_obj = acpi_ut_create_internal_object (ACPI_TYPE_LOCAL_NOTIFY);
if (!notify_obj) {
status = AE_NO_MEMORY;
goto unlock_and_exit;
......
......@@ -2,7 +2,7 @@
*
* Module Name: evxfregn - External Interfaces, ACPI Operation Regions and
* Address Spaces.
* $Revision: 50 $
* $Revision: 51 $
*
*****************************************************************************/
......@@ -220,7 +220,7 @@ acpi_install_address_space_handler (
* So, we just allocate the object for the handler and link it
* into the list.
*/
handler_obj = acpi_ut_create_internal_object (INTERNAL_TYPE_ADDRESS_HANDLER);
handler_obj = acpi_ut_create_internal_object (ACPI_TYPE_LOCAL_ADDRESS_HANDLER);
if (!handler_obj) {
status = AE_NO_MEMORY;
goto unlock_and_exit;
......
/******************************************************************************
*
* Module Name: exconfig - Namespace reconfiguration (Load/Unload opcodes)
* $Revision: 67 $
* $Revision: 69 $
*
*****************************************************************************/
......@@ -67,7 +67,7 @@ acpi_ex_add_table (
/* Create an object to be the table handle */
obj_desc = acpi_ut_create_internal_object (INTERNAL_TYPE_REFERENCE);
obj_desc = acpi_ut_create_internal_object (ACPI_TYPE_LOCAL_REFERENCE);
if (!obj_desc) {
return_ACPI_STATUS (AE_NO_MEMORY);
}
......@@ -77,7 +77,6 @@ acpi_ex_add_table (
table_info.pointer = table;
table_info.length = (ACPI_SIZE) table->length;
table_info.allocation = ACPI_MEM_ALLOCATED;
table_info.base_pointer = table;
status = acpi_tb_install_table (&table_info);
if (ACPI_FAILURE (status)) {
......@@ -316,9 +315,9 @@ acpi_ex_load_op (
case ACPI_TYPE_BUFFER_FIELD:
case INTERNAL_TYPE_REGION_FIELD:
case INTERNAL_TYPE_BANK_FIELD:
case INTERNAL_TYPE_INDEX_FIELD:
case ACPI_TYPE_LOCAL_REGION_FIELD:
case ACPI_TYPE_LOCAL_BANK_FIELD:
case ACPI_TYPE_LOCAL_INDEX_FIELD:
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Load from Field %p %s\n",
obj_desc, acpi_ut_get_object_type_name (obj_desc)));
......@@ -417,7 +416,7 @@ acpi_ex_unload_table (
*/
if ((!ddb_handle) ||
(ACPI_GET_DESCRIPTOR_TYPE (ddb_handle) != ACPI_DESC_TYPE_OPERAND) ||
(ACPI_GET_OBJECT_TYPE (ddb_handle) != INTERNAL_TYPE_REFERENCE)) {
(ACPI_GET_OBJECT_TYPE (ddb_handle) != ACPI_TYPE_LOCAL_REFERENCE)) {
return_ACPI_STATUS (AE_BAD_PARAMETER);
}
......
/******************************************************************************
*
* Module Name: exconvrt - Object conversion routines
* $Revision: 39 $
* $Revision: 41 $
*
*****************************************************************************/
......@@ -510,7 +510,7 @@ acpi_ex_convert_to_string (
new_buf [index-1] = 0;
ret_desc->buffer.pointer = new_buf;
ret_desc->string.length = ACPI_STRLEN ((char *) new_buf);
ret_desc->string.length = (u32) ACPI_STRLEN ((char *) new_buf);
/* Return the new buffer descriptor */
......@@ -587,7 +587,7 @@ acpi_ex_convert_to_target_type (
case ARGI_INTEGER_REF: /* Handles Increment, Decrement cases */
switch (destination_type) {
case INTERNAL_TYPE_REGION_FIELD:
case ACPI_TYPE_LOCAL_REGION_FIELD:
/*
* Named field can always handle conversions
*/
......@@ -612,8 +612,8 @@ acpi_ex_convert_to_target_type (
switch (destination_type) {
case ACPI_TYPE_INTEGER:
case ACPI_TYPE_BUFFER_FIELD:
case INTERNAL_TYPE_BANK_FIELD:
case INTERNAL_TYPE_INDEX_FIELD:
case ACPI_TYPE_LOCAL_BANK_FIELD:
case ACPI_TYPE_LOCAL_INDEX_FIELD:
/*
* These types require an Integer operand. We can convert
* a Buffer or a String to an Integer if necessary.
......
/******************************************************************************
*
* Module Name: excreate - Named object creation
* $Revision: 94 $
* $Revision: 97 $
*
*****************************************************************************/
......@@ -55,7 +55,7 @@ acpi_ex_create_alias (
{
acpi_namespace_node *target_node;
acpi_namespace_node *alias_node;
acpi_status status;
acpi_status status = AE_OK;
ACPI_FUNCTION_TRACE ("Ex_create_alias");
......@@ -66,7 +66,7 @@ acpi_ex_create_alias (
alias_node = (acpi_namespace_node *) walk_state->operands[0];
target_node = (acpi_namespace_node *) walk_state->operands[1];
if (target_node->type == INTERNAL_TYPE_ALIAS) {
if (target_node->type == ACPI_TYPE_LOCAL_ALIAS) {
/*
* Dereference an existing alias so that we don't create a chain
* of aliases. With this code, we guarantee that an alias is
......@@ -95,8 +95,8 @@ acpi_ex_create_alias (
* NS node, not the object itself. This is because for these
* types, the object can change dynamically via a Store.
*/
alias_node->type = INTERNAL_TYPE_ALIAS;
alias_node->object = (acpi_operand_object *) target_node;
alias_node->type = ACPI_TYPE_LOCAL_ALIAS;
alias_node->object = ACPI_CAST_PTR (acpi_operand_object, target_node);
break;
default:
......@@ -117,7 +117,7 @@ acpi_ex_create_alias (
/* Since both operands are Nodes, we don't need to delete them */
return_ACPI_STATUS (AE_OK);
return_ACPI_STATUS (status);
}
......@@ -221,9 +221,10 @@ acpi_ex_create_mutex (
/* Init object and attach to NS node */
obj_desc->mutex.sync_level = (u8) walk_state->operands[1]->integer.value;
obj_desc->mutex.node = (acpi_namespace_node *) walk_state->operands[0];
status = acpi_ns_attach_object ((acpi_namespace_node *) walk_state->operands[0],
obj_desc, ACPI_TYPE_MUTEX);
status = acpi_ns_attach_object (obj_desc->mutex.node,
obj_desc, ACPI_TYPE_MUTEX);
cleanup:
......
/******************************************************************************
*
* Module Name: exdump - Interpreter debug output routines
* $Revision: 160 $
* $Revision: 162 $
*
*****************************************************************************/
......@@ -58,7 +58,6 @@ acpi_ex_dump_operand (
{
u8 *buf = NULL;
u32 length;
u32 i;
acpi_operand_object **element;
u16 element_index;
......@@ -97,7 +96,7 @@ acpi_ex_dump_operand (
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "%p ", obj_desc));
switch (ACPI_GET_OBJECT_TYPE (obj_desc)) {
case INTERNAL_TYPE_REFERENCE:
case ACPI_TYPE_LOCAL_REFERENCE:
switch (obj_desc->reference.opcode) {
case AML_DEBUG_OP:
......@@ -217,22 +216,6 @@ acpi_ex_dump_operand (
break;
case INTERNAL_TYPE_IF:
acpi_os_printf ("If [Integer] %8.8X%8.8X\n",
ACPI_HIDWORD (obj_desc->integer.value),
ACPI_LODWORD (obj_desc->integer.value));
break;
case INTERNAL_TYPE_WHILE:
acpi_os_printf ("While [Integer] %8.8X%8.8X\n",
ACPI_HIDWORD (obj_desc->integer.value),
ACPI_LODWORD (obj_desc->integer.value));
break;
case ACPI_TYPE_PACKAGE:
acpi_os_printf ("Package count %X @ %p\n",
......@@ -279,24 +262,20 @@ acpi_ex_dump_operand (
case ACPI_TYPE_STRING:
acpi_os_printf ("String length %X @ %p \"",
acpi_os_printf ("String length %X @ %p ",
obj_desc->string.length, obj_desc->string.pointer);
for (i = 0; i < obj_desc->string.length; i++) {
acpi_os_printf ("%c",
obj_desc->string.pointer[i]);
}
acpi_os_printf ("\"\n");
acpi_ut_print_string (obj_desc->string.pointer, ACPI_UINT8_MAX);
acpi_os_printf ("\n");
break;
case INTERNAL_TYPE_BANK_FIELD:
case ACPI_TYPE_LOCAL_BANK_FIELD:
acpi_os_printf ("Bank_field\n");
break;
case INTERNAL_TYPE_REGION_FIELD:
case ACPI_TYPE_LOCAL_REGION_FIELD:
acpi_os_printf (
"Region_field: Bits=%X Acc_width=%X Lock=%X Update=%X at byte=%X bit=%X of below:\n",
......@@ -308,7 +287,7 @@ acpi_ex_dump_operand (
break;
case INTERNAL_TYPE_INDEX_FIELD:
case ACPI_TYPE_LOCAL_INDEX_FIELD:
acpi_os_printf ("Index_field\n");
break;
......@@ -321,16 +300,13 @@ acpi_ex_dump_operand (
obj_desc->buffer_field.bit_length, obj_desc->buffer_field.base_byte_offset,
obj_desc->buffer_field.start_field_bit_offset);
if (!obj_desc->buffer_field.buffer_obj)
{
if (!obj_desc->buffer_field.buffer_obj) {
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "*NULL* \n"));
}
else if (ACPI_GET_OBJECT_TYPE (obj_desc->buffer_field.buffer_obj) != ACPI_TYPE_BUFFER)
{
else if (ACPI_GET_OBJECT_TYPE (obj_desc->buffer_field.buffer_obj) != ACPI_TYPE_BUFFER) {
acpi_os_printf ("*not a Buffer* \n");
}
else
{
else {
ACPI_DUMP_STACK_ENTRY (obj_desc->buffer_field.buffer_obj);
}
......@@ -423,13 +399,11 @@ acpi_ex_dump_operands (
ACPI_FUNCTION_NAME ("Ex_dump_operands");
if (!ident)
{
if (!ident) {
ident = "?";
}
if (!note)
{
if (!note) {
note = "?";
}
......@@ -437,15 +411,13 @@ acpi_ex_dump_operands (
"************* Operand Stack Contents (Opcode [%s], %d Operands)\n",
ident, num_levels));
if (num_levels == 0)
{
if (num_levels == 0) {
num_levels = 1;
}
/* Dump the operand stack starting at the top */
for (i = 0; num_levels > 0; i--, num_levels--)
{
for (i = 0; num_levels > 0; i--, num_levels--) {
obj_desc = &operands[i];
acpi_ex_dump_operand (*obj_desc);
}
......@@ -529,10 +501,8 @@ acpi_ex_dump_node (
ACPI_FUNCTION_ENTRY ();
if (!flags)
{
if (!((ACPI_LV_OBJECTS & acpi_dbg_level) && (_COMPONENT & acpi_dbg_layer)))
{
if (!flags) {
if (!((ACPI_LV_OBJECTS & acpi_dbg_level) && (_COMPONENT & acpi_dbg_layer))) {
return;
}
}
......@@ -571,24 +541,20 @@ acpi_ex_dump_object_descriptor (
ACPI_FUNCTION_TRACE ("Ex_dump_object_descriptor");
if (!flags)
{
if (!((ACPI_LV_OBJECTS & acpi_dbg_level) && (_COMPONENT & acpi_dbg_layer)))
{
if (!flags) {
if (!((ACPI_LV_OBJECTS & acpi_dbg_level) && (_COMPONENT & acpi_dbg_layer))) {
return_VOID;
}
}
if (ACPI_GET_DESCRIPTOR_TYPE (obj_desc) == ACPI_DESC_TYPE_NAMED)
{
if (ACPI_GET_DESCRIPTOR_TYPE (obj_desc) == ACPI_DESC_TYPE_NAMED) {
acpi_ex_dump_node ((acpi_namespace_node *) obj_desc, flags);
acpi_os_printf ("\nAttached Object (%p):\n", ((acpi_namespace_node *) obj_desc)->object);
acpi_ex_dump_object_descriptor (((acpi_namespace_node *) obj_desc)->object, flags);
return;
}
if (ACPI_GET_DESCRIPTOR_TYPE (obj_desc) != ACPI_DESC_TYPE_OPERAND)
{
if (ACPI_GET_DESCRIPTOR_TYPE (obj_desc) != ACPI_DESC_TYPE_OPERAND) {
acpi_os_printf ("Ex_dump_object_descriptor: %p is not a valid ACPI object\n", obj_desc);
return_VOID;
}
......@@ -601,8 +567,7 @@ acpi_ex_dump_object_descriptor (
/* Object-specific Fields */
switch (ACPI_GET_OBJECT_TYPE (obj_desc))
{
switch (ACPI_GET_OBJECT_TYPE (obj_desc)) {
case ACPI_TYPE_INTEGER:
acpi_os_printf ("%20s : %8.8X%8.8X\n", "Value",
......@@ -614,7 +579,10 @@ acpi_ex_dump_object_descriptor (
case ACPI_TYPE_STRING:
acpi_ex_out_integer ("Length", obj_desc->string.length);
acpi_ex_out_pointer ("Pointer", obj_desc->string.pointer);
acpi_os_printf ("%20s : %p ", "Pointer", obj_desc->string.pointer);
acpi_ut_print_string (obj_desc->string.pointer, ACPI_UINT8_MAX);
acpi_os_printf ("\n");
break;
......@@ -633,14 +601,11 @@ acpi_ex_dump_object_descriptor (
/* Dump the package contents */
if (obj_desc->package.count > 0)
{
if (obj_desc->package.count > 0) {
acpi_os_printf ("\nPackage Contents:\n");
for (i = 0; i < obj_desc->package.count; i++)
{
for (i = 0; i < obj_desc->package.count; i++) {
acpi_os_printf ("[%.3d] %p", i, obj_desc->package.elements[i]);
if (obj_desc->package.elements[i])
{
if (obj_desc->package.elements[i]) {
acpi_os_printf (" %s", acpi_ut_get_object_type_name (obj_desc->package.elements[i]));
}
acpi_os_printf ("\n");
......@@ -723,9 +688,9 @@ acpi_ex_dump_object_descriptor (
case ACPI_TYPE_BUFFER_FIELD:
case INTERNAL_TYPE_REGION_FIELD:
case INTERNAL_TYPE_BANK_FIELD:
case INTERNAL_TYPE_INDEX_FIELD:
case ACPI_TYPE_LOCAL_REGION_FIELD:
case ACPI_TYPE_LOCAL_BANK_FIELD:
case ACPI_TYPE_LOCAL_INDEX_FIELD:
acpi_ex_out_integer ("Field_flags", obj_desc->common_field.field_flags);
acpi_ex_out_integer ("Access_byte_width", obj_desc->common_field.access_byte_width);
......@@ -737,23 +702,22 @@ acpi_ex_dump_object_descriptor (
acpi_ex_out_integer ("End_buf_valid_bits", obj_desc->common_field.end_buffer_valid_bits);
acpi_ex_out_pointer ("Parent_node", obj_desc->common_field.node);
switch (ACPI_GET_OBJECT_TYPE (obj_desc))
{
switch (ACPI_GET_OBJECT_TYPE (obj_desc)) {
case ACPI_TYPE_BUFFER_FIELD:
acpi_ex_out_pointer ("Buffer_obj", obj_desc->buffer_field.buffer_obj);
break;
case INTERNAL_TYPE_REGION_FIELD:
case ACPI_TYPE_LOCAL_REGION_FIELD:
acpi_ex_out_pointer ("Region_obj", obj_desc->field.region_obj);
break;
case INTERNAL_TYPE_BANK_FIELD:
case ACPI_TYPE_LOCAL_BANK_FIELD:
acpi_ex_out_integer ("Value", obj_desc->bank_field.value);
acpi_ex_out_pointer ("Region_obj", obj_desc->bank_field.region_obj);
acpi_ex_out_pointer ("Bank_obj", obj_desc->bank_field.bank_obj);
break;
case INTERNAL_TYPE_INDEX_FIELD:
case ACPI_TYPE_LOCAL_INDEX_FIELD:
acpi_ex_out_integer ("Value", obj_desc->index_field.value);
acpi_ex_out_pointer ("Index", obj_desc->index_field.index_obj);
acpi_ex_out_pointer ("Data", obj_desc->index_field.data_obj);
......@@ -766,7 +730,7 @@ acpi_ex_dump_object_descriptor (
break;
case INTERNAL_TYPE_REFERENCE:
case ACPI_TYPE_LOCAL_REFERENCE:
acpi_ex_out_integer ("Target_type", obj_desc->reference.target_type);
acpi_ex_out_string ("Opcode", (acpi_ps_get_opcode_info (obj_desc->reference.opcode))->name);
......@@ -777,7 +741,7 @@ acpi_ex_dump_object_descriptor (
break;
case INTERNAL_TYPE_ADDRESS_HANDLER:
case ACPI_TYPE_LOCAL_ADDRESS_HANDLER:
acpi_ex_out_integer ("Space_id", obj_desc->addr_handler.space_id);
acpi_ex_out_pointer ("Next", obj_desc->addr_handler.next);
......@@ -787,24 +751,16 @@ acpi_ex_dump_object_descriptor (
break;
case INTERNAL_TYPE_NOTIFY:
case ACPI_TYPE_LOCAL_NOTIFY:
acpi_ex_out_pointer ("Node", obj_desc->notify_handler.node);
acpi_ex_out_pointer ("Context", obj_desc->notify_handler.context);
break;
case INTERNAL_TYPE_ALIAS:
case INTERNAL_TYPE_FIELD_DEFN:
case INTERNAL_TYPE_BANK_FIELD_DEFN:
case INTERNAL_TYPE_INDEX_FIELD_DEFN:
case INTERNAL_TYPE_IF:
case INTERNAL_TYPE_ELSE:
case INTERNAL_TYPE_WHILE:
case INTERNAL_TYPE_SCOPE:
case INTERNAL_TYPE_DEF_ANY:
case INTERNAL_TYPE_EXTRA:
case INTERNAL_TYPE_DATA:
case ACPI_TYPE_LOCAL_ALIAS:
case ACPI_TYPE_LOCAL_EXTRA:
case ACPI_TYPE_LOCAL_DATA:
default:
acpi_os_printf ("Ex_dump_object_descriptor: Display not implemented for object type %s\n",
......
/******************************************************************************
*
* Module Name: exfldio - Aml Field I/O
* $Revision: 88 $
* $Revision: 89 $
*
*****************************************************************************/
......@@ -338,7 +338,7 @@ acpi_ex_field_datum_io (
break;
case INTERNAL_TYPE_BANK_FIELD:
case ACPI_TYPE_LOCAL_BANK_FIELD:
/* Ensure that the Bank_value is not beyond the capacity of the register */
......@@ -366,7 +366,7 @@ acpi_ex_field_datum_io (
/*lint -fallthrough */
case INTERNAL_TYPE_REGION_FIELD:
case ACPI_TYPE_LOCAL_REGION_FIELD:
/*
* For simple Region_fields, we just directly access the owning
* Operation Region.
......@@ -381,7 +381,7 @@ acpi_ex_field_datum_io (
break;
case INTERNAL_TYPE_INDEX_FIELD:
case ACPI_TYPE_LOCAL_INDEX_FIELD:
/* Ensure that the Index_value is not beyond the capacity of the register */
......
......@@ -2,7 +2,7 @@
/******************************************************************************
*
* Module Name: exmisc - ACPI AML (p-code) execution - specific opcodes
* $Revision: 109 $
* $Revision: 110 $
*
*****************************************************************************/
......@@ -67,7 +67,7 @@ acpi_ex_get_object_reference (
switch (ACPI_GET_DESCRIPTOR_TYPE (obj_desc)) {
case ACPI_DESC_TYPE_OPERAND:
if (ACPI_GET_OBJECT_TYPE (obj_desc) != INTERNAL_TYPE_REFERENCE) {
if (ACPI_GET_OBJECT_TYPE (obj_desc) != ACPI_TYPE_LOCAL_REFERENCE) {
return_ACPI_STATUS (AE_AML_OPERAND_TYPE);
}
......@@ -111,7 +111,7 @@ acpi_ex_get_object_reference (
/* Create a new reference object */
reference_obj = acpi_ut_create_internal_object (INTERNAL_TYPE_REFERENCE);
reference_obj = acpi_ut_create_internal_object (ACPI_TYPE_LOCAL_REFERENCE);
if (!reference_obj) {
return_ACPI_STATUS (AE_NO_MEMORY);
}
......
......@@ -2,7 +2,7 @@
/******************************************************************************
*
* Module Name: exmutex - ASL Mutex Acquire/Release functions
* $Revision: 13 $
* $Revision: 16 $
*
*****************************************************************************/
......@@ -132,22 +132,35 @@ acpi_ex_acquire_mutex (
ACPI_FUNCTION_TRACE_PTR ("Ex_acquire_mutex", obj_desc);
if (!obj_desc) {
return_ACPI_STATUS (AE_BAD_PARAMETER);
}
/* Sanity check -- we must have a valid thread ID */
if (!walk_state->thread) {
ACPI_REPORT_ERROR (("Cannot acquire Mutex [%4.4s], null thread info\n",
obj_desc->mutex.node->name.ascii));
return_ACPI_STATUS (AE_AML_INTERNAL);
}
/*
* Current Sync must be less than or equal to the sync level of the
* mutex. This mechanism provides some deadlock prevention
*/
if (walk_state->thread->current_sync_level > obj_desc->mutex.sync_level) {
ACPI_REPORT_ERROR (("Cannot acquire Mutex [%4.4s], incorrect Sync_level\n",
obj_desc->mutex.node->name.ascii));
return_ACPI_STATUS (AE_AML_MUTEX_ORDER);
}
/*
* Support for multiple acquires by the owning thread
*/
if (obj_desc->mutex.owner_thread == walk_state->thread) {
if ((obj_desc->mutex.owner_thread) &&
(obj_desc->mutex.owner_thread->thread_id == walk_state->thread->thread_id)) {
/*
* The mutex is already owned by this thread,
* just increment the acquisition depth
......@@ -210,12 +223,27 @@ acpi_ex_release_mutex (
/* The mutex must have been previously acquired in order to release it */
if (!obj_desc->mutex.owner_thread) {
ACPI_REPORT_ERROR (("Cannot release Mutex [%4.4s], not acquired\n",
obj_desc->mutex.node->name.ascii));
return_ACPI_STATUS (AE_AML_MUTEX_NOT_ACQUIRED);
}
/* Sanity check -- we must have a valid thread ID */
if (!walk_state->thread) {
ACPI_REPORT_ERROR (("Cannot release Mutex [%4.4s], null thread info\n",
obj_desc->mutex.node->name.ascii));
return_ACPI_STATUS (AE_AML_INTERNAL);
}
/* The Mutex is owned, but this thread must be the owner */
if (obj_desc->mutex.owner_thread != walk_state->thread) {
if (obj_desc->mutex.owner_thread->thread_id != walk_state->thread->thread_id) {
ACPI_REPORT_ERROR ((
"Thread %X cannot release Mutex [%4.4s] acquired by thread %X\n",
walk_state->thread->thread_id,
obj_desc->mutex.node->name.ascii,
obj_desc->mutex.owner_thread->thread_id));
return_ACPI_STATUS (AE_AML_NOT_OWNER);
}
......@@ -224,6 +252,8 @@ acpi_ex_release_mutex (
* equal to the current sync level
*/
if (obj_desc->mutex.sync_level > walk_state->thread->current_sync_level) {
ACPI_REPORT_ERROR (("Cannot release Mutex [%4.4s], incorrect Sync_level\n",
obj_desc->mutex.node->name.ascii));
return_ACPI_STATUS (AE_AML_MUTEX_ORDER);
}
......
......@@ -2,7 +2,7 @@
/******************************************************************************
*
* Module Name: exnames - interpreter/scanner name load/execute
* $Revision: 91 $
* $Revision: 92 $
*
*****************************************************************************/
......@@ -247,9 +247,9 @@ acpi_ex_get_name_string (
ACPI_FUNCTION_TRACE_PTR ("Ex_get_name_string", aml_address);
if (INTERNAL_TYPE_REGION_FIELD == data_type ||
INTERNAL_TYPE_BANK_FIELD == data_type ||
INTERNAL_TYPE_INDEX_FIELD == data_type) {
if (ACPI_TYPE_LOCAL_REGION_FIELD == data_type ||
ACPI_TYPE_LOCAL_BANK_FIELD == data_type ||
ACPI_TYPE_LOCAL_INDEX_FIELD == data_type) {
/* Disallow prefixes for types associated with Field_unit names */
name_string = acpi_ex_allocate_name_string (0, 1);
......
......@@ -2,7 +2,7 @@
/******************************************************************************
*
* Module Name: exoparg1 - AML execution - opcodes with 1 argument
* $Revision: 143 $
* $Revision: 144 $
*
*****************************************************************************/
......@@ -642,7 +642,7 @@ acpi_ex_opcode_1A_0T_1R (
if (ACPI_GET_DESCRIPTOR_TYPE (operand[0]) != ACPI_DESC_TYPE_NAMED) {
switch (ACPI_GET_OBJECT_TYPE (operand[0])) {
case INTERNAL_TYPE_REFERENCE:
case ACPI_TYPE_LOCAL_REFERENCE:
/*
* This is a Deref_of (Local_x | Arg_x)
*
......
/******************************************************************************
*
* Module Name: exoparg2 - AML execution - opcodes with 2 arguments
* $Revision: 111 $
* $Revision: 113 $
*
*****************************************************************************/
......@@ -242,11 +242,11 @@ acpi_status
acpi_ex_opcode_2A_1T_1R (
acpi_walk_state *walk_state)
{
acpi_operand_object **operand = &walk_state->operands[0];
acpi_operand_object **operand = &walk_state->operands[0];
acpi_operand_object *return_desc = NULL;
acpi_operand_object *temp_desc = NULL;
u32 index;
acpi_status status = AE_OK;
acpi_status status = AE_OK;
ACPI_SIZE length;
......@@ -379,7 +379,7 @@ acpi_ex_opcode_2A_1T_1R (
/* Set the string length */
return_desc->string.length = length;
return_desc->string.length = (u32) length;
break;
......@@ -393,7 +393,7 @@ acpi_ex_opcode_2A_1T_1R (
/* Create the internal return object */
return_desc = acpi_ut_create_internal_object (INTERNAL_TYPE_REFERENCE);
return_desc = acpi_ut_create_internal_object (ACPI_TYPE_LOCAL_REFERENCE);
if (!return_desc) {
status = AE_NO_MEMORY;
goto cleanup;
......
......@@ -2,7 +2,7 @@
/******************************************************************************
*
* Module Name: exprep - ACPI AML (p-code) execution - field prep utilities
* $Revision: 119 $
* $Revision: 120 $
*
*****************************************************************************/
......@@ -313,7 +313,7 @@ acpi_ex_prep_field_value (
/* Parameter validation */
if (info->field_type != INTERNAL_TYPE_INDEX_FIELD) {
if (info->field_type != ACPI_TYPE_LOCAL_INDEX_FIELD) {
if (!info->region_node) {
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Null Region_node\n"));
return_ACPI_STATUS (AE_AML_NO_OPERAND);
......@@ -349,7 +349,7 @@ acpi_ex_prep_field_value (
/* Initialize areas of the object that are specific to the field type */
switch (info->field_type) {
case INTERNAL_TYPE_REGION_FIELD:
case ACPI_TYPE_LOCAL_REGION_FIELD:
obj_desc->field.region_obj = acpi_ns_get_attached_object (info->region_node);
......@@ -364,7 +364,7 @@ acpi_ex_prep_field_value (
break;
case INTERNAL_TYPE_BANK_FIELD:
case ACPI_TYPE_LOCAL_BANK_FIELD:
obj_desc->bank_field.value = info->bank_value;
obj_desc->bank_field.region_obj = acpi_ns_get_attached_object (info->region_node);
......@@ -385,7 +385,7 @@ acpi_ex_prep_field_value (
break;
case INTERNAL_TYPE_INDEX_FIELD:
case ACPI_TYPE_LOCAL_INDEX_FIELD:
obj_desc->index_field.index_obj = acpi_ns_get_attached_object (info->register_node);
obj_desc->index_field.data_obj = acpi_ns_get_attached_object (info->data_register_node);
......
......@@ -2,7 +2,7 @@
/******************************************************************************
*
* Module Name: exresnte - AML Interpreter object resolution
* $Revision: 59 $
* $Revision: 60 $
*
*****************************************************************************/
......@@ -88,7 +88,7 @@ acpi_ex_resolve_node_to_value (
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Entry=%p Source_desc=%p Type=%X\n",
node, source_desc, entry_type));
if (entry_type == INTERNAL_TYPE_ALIAS) {
if (entry_type == ACPI_TYPE_LOCAL_ALIAS) {
/* There is always exactly one level of indirection */
node = (acpi_namespace_node *) node->object;
......@@ -185,9 +185,9 @@ acpi_ex_resolve_node_to_value (
case ACPI_TYPE_BUFFER_FIELD:
case INTERNAL_TYPE_REGION_FIELD:
case INTERNAL_TYPE_BANK_FIELD:
case INTERNAL_TYPE_INDEX_FIELD:
case ACPI_TYPE_LOCAL_REGION_FIELD:
case ACPI_TYPE_LOCAL_BANK_FIELD:
case ACPI_TYPE_LOCAL_INDEX_FIELD:
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Field_read Node=%p Source_desc=%p Type=%X\n",
node, source_desc, entry_type));
......@@ -223,7 +223,7 @@ acpi_ex_resolve_node_to_value (
return_ACPI_STATUS (AE_AML_OPERAND_TYPE); /* Cannot be AE_TYPE */
case INTERNAL_TYPE_REFERENCE:
case ACPI_TYPE_LOCAL_REFERENCE:
/* No named references are allowed here */
......
......@@ -2,7 +2,7 @@
/******************************************************************************
*
* Module Name: exresolv - AML Interpreter object resolution
* $Revision: 116 $
* $Revision: 117 $
*
*****************************************************************************/
......@@ -132,7 +132,7 @@ acpi_ex_resolve_object_to_value (
/* This is an acpi_operand_object */
switch (ACPI_GET_OBJECT_TYPE (stack_desc)) {
case INTERNAL_TYPE_REFERENCE:
case ACPI_TYPE_LOCAL_REFERENCE:
opcode = stack_desc->reference.opcode;
......@@ -262,9 +262,9 @@ acpi_ex_resolve_object_to_value (
* These cases may never happen here, but just in case..
*/
case ACPI_TYPE_BUFFER_FIELD:
case INTERNAL_TYPE_REGION_FIELD:
case INTERNAL_TYPE_BANK_FIELD:
case INTERNAL_TYPE_INDEX_FIELD:
case ACPI_TYPE_LOCAL_REGION_FIELD:
case ACPI_TYPE_LOCAL_BANK_FIELD:
case ACPI_TYPE_LOCAL_INDEX_FIELD:
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Field_read Source_desc=%p Type=%X\n",
stack_desc, ACPI_GET_OBJECT_TYPE (stack_desc)));
......@@ -309,7 +309,7 @@ acpi_ex_resolve_multiple (
acpi_object_type type;
ACPI_FUNCTION_TRACE ("Ex_get_object_type");
ACPI_FUNCTION_TRACE ("Acpi_ex_resolve_multiple");
/*
......@@ -318,7 +318,7 @@ acpi_ex_resolve_multiple (
* of the Object_type and Size_of operators). This means traversing
* the list of possibly many nested references.
*/
while (ACPI_GET_OBJECT_TYPE (obj_desc) == INTERNAL_TYPE_REFERENCE) {
while (ACPI_GET_OBJECT_TYPE (obj_desc) == ACPI_TYPE_LOCAL_REFERENCE) {
switch (obj_desc->reference.opcode) {
case AML_REF_OF_OP:
......@@ -427,13 +427,20 @@ acpi_ex_resolve_multiple (
/* Convert internal types to external types */
switch (type) {
case INTERNAL_TYPE_REGION_FIELD:
case INTERNAL_TYPE_BANK_FIELD:
case INTERNAL_TYPE_INDEX_FIELD:
case ACPI_TYPE_LOCAL_REGION_FIELD:
case ACPI_TYPE_LOCAL_BANK_FIELD:
case ACPI_TYPE_LOCAL_INDEX_FIELD:
type = ACPI_TYPE_FIELD_UNIT;
break;
case ACPI_TYPE_LOCAL_SCOPE:
/* Per ACPI Specification, Scope is untyped */
type = ACPI_TYPE_ANY;
break;
default:
/* No change to Type required */
break;
......
......@@ -2,7 +2,7 @@
/******************************************************************************
*
* Module Name: exresop - AML Interpreter operand/object resolution
* $Revision: 58 $
* $Revision: 59 $
*
*****************************************************************************/
......@@ -64,7 +64,7 @@ acpi_ex_check_object_type (
return (AE_OK);
}
if (type_needed == INTERNAL_TYPE_REFERENCE) {
if (type_needed == ACPI_TYPE_LOCAL_REFERENCE) {
/*
* Allow the AML "Constant" opcodes (Zero, One, etc.) to be reference
* objects and thus allow them to be targets. (As per the ACPI
......@@ -183,14 +183,14 @@ acpi_ex_resolve_operands (
/* Check for bad acpi_object_type */
if (!acpi_ex_validate_object_type (object_type)) {
if (!acpi_ut_valid_object_type (object_type)) {
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Bad operand object type [%X]\n",
object_type));
return_ACPI_STATUS (AE_AML_OPERAND_TYPE);
}
if (object_type == (u8) INTERNAL_TYPE_REFERENCE) {
if (object_type == (u8) ACPI_TYPE_LOCAL_REFERENCE) {
/*
* Decode the Reference
*/
......@@ -267,13 +267,13 @@ acpi_ex_resolve_operands (
case ARGI_FIXED_TARGET: /* No implicit conversion before store to target */
case ARGI_SIMPLE_TARGET: /* Name, Local, or Arg - no implicit conversion */
/* Need an operand of type INTERNAL_TYPE_REFERENCE */
/* Need an operand of type ACPI_TYPE_LOCAL_REFERENCE */
if (ACPI_GET_DESCRIPTOR_TYPE (obj_desc) == ACPI_DESC_TYPE_NAMED) /* Node (name) ptr OK as-is */ {
goto next_operand;
}
status = acpi_ex_check_object_type (INTERNAL_TYPE_REFERENCE,
status = acpi_ex_check_object_type (ACPI_TYPE_LOCAL_REFERENCE,
object_type, obj_desc);
if (ACPI_FAILURE (status)) {
return_ACPI_STATUS (status);
......@@ -300,7 +300,7 @@ acpi_ex_resolve_operands (
* -- All others must be resolved below.
*/
if ((opcode == AML_STORE_OP) &&
(ACPI_GET_OBJECT_TYPE (*stack_ptr) == INTERNAL_TYPE_REFERENCE) &&
(ACPI_GET_OBJECT_TYPE (*stack_ptr) == ACPI_TYPE_LOCAL_REFERENCE) &&
((*stack_ptr)->reference.opcode == AML_INDEX_OP)) {
goto next_operand;
}
......@@ -353,13 +353,6 @@ acpi_ex_resolve_operands (
type_needed = ACPI_TYPE_REGION;
break;
case ARGI_IF: /* If */
/* Need an operand of type INTERNAL_TYPE_IF */
type_needed = INTERNAL_TYPE_IF;
break;
case ARGI_PACKAGE: /* Package */
/* Need an operand of type ACPI_TYPE_PACKAGE */
......@@ -502,7 +495,7 @@ acpi_ex_resolve_operands (
case ACPI_TYPE_PACKAGE:
case ACPI_TYPE_STRING:
case ACPI_TYPE_BUFFER:
case INTERNAL_TYPE_REFERENCE:
case ACPI_TYPE_LOCAL_REFERENCE:
/* Valid operand */
break;
......
......@@ -2,7 +2,7 @@
/******************************************************************************
*
* Module Name: exstore - AML Interpreter object store support
* $Revision: 172 $
* $Revision: 173 $
*
*****************************************************************************/
......@@ -92,7 +92,7 @@ acpi_ex_store (
/* Destination object must be a Reference or a Constant object */
switch (ACPI_GET_OBJECT_TYPE (dest_desc)) {
case INTERNAL_TYPE_REFERENCE:
case ACPI_TYPE_LOCAL_REFERENCE:
break;
case ACPI_TYPE_INTEGER:
......@@ -428,9 +428,9 @@ acpi_ex_store_object_to_node (
*/
switch (target_type) {
case ACPI_TYPE_BUFFER_FIELD:
case INTERNAL_TYPE_REGION_FIELD:
case INTERNAL_TYPE_BANK_FIELD:
case INTERNAL_TYPE_INDEX_FIELD:
case ACPI_TYPE_LOCAL_REGION_FIELD:
case ACPI_TYPE_LOCAL_BANK_FIELD:
case ACPI_TYPE_LOCAL_INDEX_FIELD:
/*
* For fields, copy the source data to the target field.
......
......@@ -3,7 +3,7 @@
*
* Module Name: exstoren - AML Interpreter object store support,
* Store to Node (namespace object)
* $Revision: 51 $
* $Revision: 52 $
*
*****************************************************************************/
......@@ -67,9 +67,9 @@ acpi_ex_resolve_object (
*/
switch (target_type) {
case ACPI_TYPE_BUFFER_FIELD:
case INTERNAL_TYPE_REGION_FIELD:
case INTERNAL_TYPE_BANK_FIELD:
case INTERNAL_TYPE_INDEX_FIELD:
case ACPI_TYPE_LOCAL_REGION_FIELD:
case ACPI_TYPE_LOCAL_BANK_FIELD:
case ACPI_TYPE_LOCAL_INDEX_FIELD:
/*
* These cases all require only Integers or values that
* can be converted to Integers (Strings or Buffers)
......@@ -84,7 +84,7 @@ acpi_ex_resolve_object (
* are all essentially the same. This case handles the
* "interchangeable" types Integer, String, and Buffer.
*/
if (ACPI_GET_OBJECT_TYPE (source_desc) == INTERNAL_TYPE_REFERENCE) {
if (ACPI_GET_OBJECT_TYPE (source_desc) == ACPI_TYPE_LOCAL_REFERENCE) {
/* Resolve a reference object first */
status = acpi_ex_resolve_to_value (source_desc_ptr, walk_state);
......@@ -111,7 +111,7 @@ acpi_ex_resolve_object (
break;
case INTERNAL_TYPE_ALIAS:
case ACPI_TYPE_LOCAL_ALIAS:
/*
* Aliases are resolved by Acpi_ex_prep_operands
......
......@@ -2,7 +2,7 @@
/******************************************************************************
*
* Module Name: exstorob - AML Interpreter object store support, store to object
* $Revision: 45 $
* $Revision: 46 $
*
*****************************************************************************/
......@@ -144,7 +144,7 @@ acpi_ex_store_string_to_string (
* String will fit in existing buffer.
* Clear old string and copy in the new one
*/
ACPI_MEMSET (target_desc->string.pointer, 0, target_desc->string.length + 1);
ACPI_MEMSET (target_desc->string.pointer, 0, (ACPI_SIZE) target_desc->string.length + 1);
ACPI_MEMCPY (target_desc->string.pointer, buffer, length);
}
else {
......
......@@ -2,7 +2,7 @@
/******************************************************************************
*
* Module Name: exutils - interpreter/scanner utilities
* $Revision: 103 $
* $Revision: 105 $
*
*****************************************************************************/
......@@ -50,32 +50,6 @@
ACPI_MODULE_NAME ("exutils")
/*******************************************************************************
*
* FUNCTION: Acpi_ex_validate_object_type
*
* PARAMETERS: Type Object type to validate
*
* DESCRIPTION: Determine if a type is a valid ACPI object type
*
******************************************************************************/
u8
acpi_ex_validate_object_type (
acpi_object_type type)
{
ACPI_FUNCTION_ENTRY ();
if ((type > ACPI_TYPE_MAX && type < INTERNAL_TYPE_BEGIN) ||
(type > INTERNAL_TYPE_MAX)) {
return (FALSE);
}
return (TRUE);
}
#ifndef ACPI_NO_METHOD_EXECUTION
/*******************************************************************************
......@@ -336,7 +310,7 @@ acpi_ex_eisa_id_to_string (
eisa_id = acpi_ut_dword_byte_swap (numeric_id);
out_string[0] = (char) ('@' + ((eisa_id >> 26) & 0x1f));
out_string[0] = (char) ('@' + (((unsigned long) eisa_id >> 26) & 0x1f));
out_string[1] = (char) ('@' + ((eisa_id >> 21) & 0x1f));
out_string[2] = (char) ('@' + ((eisa_id >> 16) & 0x1f));
out_string[3] = acpi_ut_hex_to_ascii_char ((acpi_integer) eisa_id, 12);
......
......@@ -2,7 +2,7 @@
/******************************************************************************
*
* Name: hwsleep.c - ACPI Hardware Sleep/Wake Interface
* $Revision: 46 $
* $Revision: 47 $
*
*****************************************************************************/
......@@ -309,6 +309,11 @@ acpi_enter_sleep_state (
} while (!in_value);
status = acpi_set_register (ACPI_BITREG_ARB_DISABLE, 0, ACPI_MTX_LOCK);
if (ACPI_FAILURE (status)) {
return_ACPI_STATUS (status);
}
return_ACPI_STATUS (AE_OK);
}
......
/******************************************************************************
*
* Name: acconfig.h - Global configuration constants
* $Revision: 112 $
* $Revision: 114 $
*
*****************************************************************************/
......@@ -54,7 +54,7 @@
/* Version string */
#define ACPI_CA_VERSION 0x20021002
#define ACPI_CA_VERSION 0x20021022
/* Version of ACPI supported */
......
/******************************************************************************
*
* Name: acdisasm.h - AML disassembler
* $Revision: 3 $
* $Revision: 4 $
*
*****************************************************************************/
......@@ -107,10 +107,6 @@ u32
acpi_dm_dump_name (
char *name);
void
acpi_dm_string (
char *string);
void
acpi_dm_unicode (
acpi_parse_object *op);
......
/******************************************************************************
*
* Name: acglobal.h - Declarations for global variables
* $Revision: 131 $
* $Revision: 132 $
*
*****************************************************************************/
......@@ -152,7 +152,7 @@ extern const NATIVE_CHAR *acpi_gbl_region_types[ACPI_NUM_PREDEFINE
*
****************************************************************************/
#define NUM_NS_TYPES INTERNAL_TYPE_INVALID+1
#define NUM_NS_TYPES ACPI_TYPE_INVALID+1
#if defined (ACPI_NO_METHOD_EXECUTION) || defined (ACPI_CONSTANT_EVAL_ONLY)
#define NUM_PREDEFINED_NAMES 10
......@@ -279,8 +279,8 @@ ACPI_EXTERN acpi_namespace_node *acpi_gbl_db_scope_node;
/*
* Statistic globals
*/
ACPI_EXTERN u16 acpi_gbl_obj_type_count[INTERNAL_TYPE_NODE_MAX+1];
ACPI_EXTERN u16 acpi_gbl_node_type_count[INTERNAL_TYPE_NODE_MAX+1];
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;
......
/******************************************************************************
*
* Name: acinterp.h - Interpreter subcomponent prototypes and defines
* $Revision: 139 $
* $Revision: 140 $
*
*****************************************************************************/
......@@ -612,10 +612,6 @@ void
acpi_ex_truncate_for32bit_table (
acpi_operand_object *obj_desc);
u8
acpi_ex_validate_object_type (
acpi_object_type type);
u8
acpi_ex_acquire_global_lock (
u32 rule);
......
/******************************************************************************
*
* Name: aclocal.h - Internal data types used across the ACPI subsystem
* $Revision: 176 $
* $Revision: 178 $
*
*****************************************************************************/
......@@ -212,7 +212,6 @@ typedef struct acpi_table_desc
struct acpi_table_desc *next;
struct acpi_table_desc *installed_desc;
acpi_table_header *pointer;
void *base_pointer;
u8 *aml_start;
u64 physical_address;
u32 aml_length;
......@@ -655,6 +654,7 @@ typedef struct acpi_parseobj_asl
char *filename;
char *external_name;
char *namepath;
char name_seg[4];
u32 extra_value;
u32 column;
u32 line_number;
......
/******************************************************************************
*
* Name: acnamesp.h - Namespace subcomponent prototypes and defines
* $Revision: 127 $
* $Revision: 129 $
*
*****************************************************************************/
......@@ -178,6 +178,10 @@ void
acpi_ns_delete_children (
acpi_namespace_node *parent);
int
acpi_ns_compare_names (
char *name1,
char *name2);
/*
* Namespace modification - nsmodify
......@@ -281,17 +285,13 @@ acpi_ns_get_object_value (
/*
* Parent/Child/Peer utility functions - nsfamily
* Parent/Child/Peer utility functions
*/
acpi_name
acpi_ns_find_parent_name (
acpi_namespace_node *node_to_search);
u8
acpi_ns_exist_downstream_sibling (
acpi_namespace_node *this_node);
/*
* Name and Scope manipulation - nsnames
......@@ -397,8 +397,8 @@ acpi_ns_search_node (
void
acpi_ns_install_node (
acpi_walk_state *walk_state,
acpi_namespace_node *parent_node, /* Parent */
acpi_namespace_node *node, /* New Child*/
acpi_namespace_node *parent_node,
acpi_namespace_node *node,
acpi_object_type type);
......
......@@ -2,7 +2,7 @@
/******************************************************************************
*
* Name: acobject.h - Definition of acpi_operand_object (Internal object only)
* $Revision: 113 $
* $Revision: 114 $
*
*****************************************************************************/
......@@ -199,6 +199,7 @@ typedef struct acpi_object_mutex
void *semaphore;
union acpi_operand_obj *prev; /* Link for list of acquired mutexes */
union acpi_operand_obj *next; /* Link for list of acquired mutexes */
acpi_namespace_node *node; /* containing object */
} ACPI_OBJECT_MUTEX;
......
/******************************************************************************
*
* Name: acstruct.h - Internal structs
* $Revision: 19 $
* $Revision: 20 $
*
*****************************************************************************/
......@@ -59,6 +59,8 @@ typedef struct acpi_walk_state
u8 return_used;
u8 walk_type;
u16 opcode; /* Current AML opcode */
u8 scope_depth;
u8 reserved1;
u32 arg_count; /* push for fixed or var args */
u32 aml_offset;
u32 arg_types;
......
/******************************************************************************
*
* Name: actypes.h - Common data types for the entire ACPI subsystem
* $Revision: 239 $
* $Revision: 240 $
*
*****************************************************************************/
......@@ -42,7 +42,7 @@
/*
* Data types - Fixed across all compilation models
* Data types - Fixed across all compilation models (16/32/64)
*
* BOOLEAN Logical Boolean.
* INT8 8-bit (1 byte) signed value
......@@ -91,6 +91,7 @@ typedef UINT64 ACPI_SIZE;
#elif ACPI_MACHINE_WIDTH == 16
/*
* 16-bit type definitions
*/
......@@ -133,6 +134,7 @@ typedef UINT16 ACPI_SIZE;
#elif ACPI_MACHINE_WIDTH == 32
/*
* 32-bit type definitions (default)
*/
......@@ -168,7 +170,6 @@ typedef UINT32 ACPI_SIZE;
/*
* Miscellaneous common types
*/
typedef UINT32 UINT32_BIT;
typedef NATIVE_UINT ACPI_PTRDIFF;
typedef char NATIVE_CHAR;
......@@ -226,7 +227,6 @@ typedef struct acpi_pointer
/*
* Useful defines
*/
#ifdef FALSE
#undef FALSE
#endif
......@@ -245,7 +245,6 @@ typedef struct acpi_pointer
/*
* Local datatypes
*/
typedef u32 acpi_status; /* All ACPI Exceptions */
typedef u32 acpi_name; /* 4-byte ACPI name */
typedef char* acpi_string; /* Null terminated ASCII string */
......@@ -314,7 +313,6 @@ typedef u64 acpi_integer;
/*
* Constants with special meanings
*/
#define ACPI_ROOT_OBJECT (acpi_handle) ACPI_PTR_ADD (char, NULL, ACPI_MAX_PTR)
......@@ -386,7 +384,6 @@ typedef u64 acpi_integer;
/*
* Table types. These values are passed to the table related APIs
*/
typedef u32 acpi_table_type;
#define ACPI_TABLE_RSDP (acpi_table_type) 0
......@@ -401,15 +398,14 @@ typedef u32 acpi_table_type;
/*
* Types associated with names. The first group of
* values correspond to the definition of the ACPI
* Object_type operator (See the ACPI Spec). Therefore,
* Types associated with ACPI names and objects. The first group of
* values (up to ACPI_TYPE_EXTERNAL_MAX) correspond to the definition
* of the ACPI Object_type() operator (See the ACPI Spec). Therefore,
* only add to the first group if the spec changes.
*
* Types must be kept in sync with the Acpi_ns_properties
* and Acpi_ns_type_names arrays
* Types must be kept in sync with the global Acpi_ns_properties
* and Acpi_ns_type_names arrays.
*/
typedef u32 acpi_object_type;
#define ACPI_TYPE_ANY 0x00
......@@ -430,52 +426,45 @@ typedef u32 acpi_object_type;
#define ACPI_TYPE_DDB_HANDLE 0x0F
#define ACPI_TYPE_DEBUG_OBJECT 0x10
#define ACPI_TYPE_MAX 0x10
#define ACPI_TYPE_EXTERNAL_MAX 0x10
/*
* This section contains object types that do not relate to the ACPI Object_type operator.
* They are used for various internal purposes only. If new predefined ACPI_TYPEs are
* added (via the ACPI specification), these internal types must move upwards.
* Also, values exceeding the largest official ACPI Object_type must not overlap with
* defined AML opcodes.
* These are object types that do not map directly to the ACPI
* Object_type() operator. They are used for various internal purposes only.
* If new predefined ACPI_TYPEs are added (via the ACPI specification), these
* internal types must move upwards. (There is code that depends on these
* values being contiguous with the external types above.)
*/
#define INTERNAL_TYPE_BEGIN 0x11
#define INTERNAL_TYPE_REGION_FIELD 0x11
#define INTERNAL_TYPE_BANK_FIELD 0x12
#define INTERNAL_TYPE_INDEX_FIELD 0x13
#define INTERNAL_TYPE_REFERENCE 0x14 /* Arg#, Local#, Name, Debug; used only in descriptors */
#define INTERNAL_TYPE_ALIAS 0x15
#define INTERNAL_TYPE_NOTIFY 0x16
#define INTERNAL_TYPE_ADDRESS_HANDLER 0x17
#define INTERNAL_TYPE_RESOURCE 0x18
#define INTERNAL_TYPE_RESOURCE_FIELD 0x19
#define ACPI_TYPE_LOCAL_REGION_FIELD 0x11
#define ACPI_TYPE_LOCAL_BANK_FIELD 0x12
#define ACPI_TYPE_LOCAL_INDEX_FIELD 0x13
#define ACPI_TYPE_LOCAL_REFERENCE 0x14 /* Arg#, Local#, Name, Debug, Ref_of, Index */
#define ACPI_TYPE_LOCAL_ALIAS 0x15
#define ACPI_TYPE_LOCAL_NOTIFY 0x16
#define ACPI_TYPE_LOCAL_ADDRESS_HANDLER 0x17
#define ACPI_TYPE_LOCAL_RESOURCE 0x18
#define ACPI_TYPE_LOCAL_RESOURCE_FIELD 0x19
#define ACPI_TYPE_LOCAL_SCOPE 0x1A /* 1 Name, multiple Object_list Nodes */
#define ACPI_TYPE_NS_NODE_MAX 0x1A /* Last typecode used within a NS Node */
#define INTERNAL_TYPE_NODE_MAX 0x19
/* These are pseudo-types because there are never any namespace nodes with these types */
/*
* These are special object types that never appear in
* a Namespace node, only in an acpi_operand_object
*/
#define ACPI_TYPE_LOCAL_EXTRA 0x1B
#define ACPI_TYPE_LOCAL_DATA 0x1C
#define INTERNAL_TYPE_FIELD_DEFN 0x1A /* Name, Byte_const, multiple Field_element */
#define INTERNAL_TYPE_BANK_FIELD_DEFN 0x1B /* 2 Name,DWord_const,Byte_const,multi Field_element */
#define INTERNAL_TYPE_INDEX_FIELD_DEFN 0x1C /* 2 Name, Byte_const, multiple Field_element */
#define INTERNAL_TYPE_IF 0x1D
#define INTERNAL_TYPE_ELSE 0x1E
#define INTERNAL_TYPE_WHILE 0x1F
#define INTERNAL_TYPE_SCOPE 0x20 /* Name, multiple Node */
#define INTERNAL_TYPE_DEF_ANY 0x21 /* type is Any, suppress search of enclosing scopes */
#define INTERNAL_TYPE_EXTRA 0x22
#define INTERNAL_TYPE_DATA 0x23
#define ACPI_TYPE_LOCAL_MAX 0x1C
#define INTERNAL_TYPE_MAX 0x23
/* All types above here are invalid */
#define INTERNAL_TYPE_INVALID 0x24
#define ACPI_TYPE_INVALID 0x1D
#define ACPI_TYPE_NOT_FOUND 0xFF
/*
* Bitmapped ACPI types
* Used internally only
* Bitmapped ACPI types. Used internally only
*/
#define ACPI_BTYPE_ANY 0x00000000
#define ACPI_BTYPE_INTEGER 0x00000001
......@@ -515,7 +504,6 @@ typedef u32 acpi_object_type;
/*
* Acpi_event Types: Fixed & General Purpose
*/
typedef u32 acpi_event_type;
#define ACPI_EVENT_FIXED 0
......@@ -524,7 +512,6 @@ typedef u32 acpi_event_type;
/*
* Fixed events
*/
#define ACPI_EVENT_PMTIMER 0
#define ACPI_EVENT_GLOBAL 1
#define ACPI_EVENT_POWER_BUTTON 2
......@@ -543,9 +530,7 @@ typedef u32 acpi_event_type;
/*
* GPEs
*/
#define ACPI_EVENT_WAKE_ENABLE 0x1
#define ACPI_EVENT_WAKE_DISABLE 0x1
......@@ -578,7 +563,7 @@ typedef u32 acpi_event_status;
#define ACPI_DEVICE_NOTIFY 1
#define ACPI_MAX_NOTIFY_HANDLER_TYPE 1
#define ACPI_MAX_SYS_NOTIFY 0x7f
#define ACPI_MAX_SYS_NOTIFY 0x7f
/* Address Space (Operation Region) Types */
......@@ -626,10 +611,10 @@ typedef u8 ACPI_ADR_SPACE_TYPE;
#define ACPI_BITREG_MAX 0x13
#define ACPI_NUM_BITREG ACPI_BITREG_MAX + 1
/*
* External ACPI object definition
*/
typedef union acpi_obj
{
acpi_object_type type; /* See definition of Acpi_ns_type for values */
......@@ -688,7 +673,6 @@ typedef union acpi_obj
/*
* List of objects, used as a parameter list for control method evaluation
*/
typedef struct acpi_obj_list
{
u32 count;
......@@ -700,7 +684,6 @@ typedef struct acpi_obj_list
/*
* Miscellaneous common Data Structures used by the interfaces
*/
#define ACPI_NO_BUFFER 0
#define ACPI_ALLOCATE_BUFFER (ACPI_SIZE) (-1)
#define ACPI_ALLOCATE_LOCAL_BUFFER (ACPI_SIZE) (-2)
......@@ -716,7 +699,6 @@ typedef struct
/*
* Name_type for Acpi_get_name
*/
#define ACPI_FULL_PATHNAME 0
#define ACPI_SINGLE_NAME 1
#define ACPI_NAME_TYPE_MAX 1
......@@ -725,7 +707,6 @@ typedef struct
/*
* Structure and flags for Acpi_get_system_info
*/
#define ACPI_SYS_MODE_UNKNOWN 0x0000
#define ACPI_SYS_MODE_ACPI 0x0001
#define ACPI_SYS_MODE_LEGACY 0x0002
......@@ -745,7 +726,6 @@ typedef struct acpi_table_info
/*
* System info returned by Acpi_get_system_info()
*/
typedef struct _acpi_sys_info
{
u32 acpi_ca_version;
......@@ -764,7 +744,6 @@ typedef struct _acpi_sys_info
/*
* Various handlers and callback procedures
*/
typedef
u32 (*acpi_event_handler) (
void *context);
......@@ -1001,7 +980,7 @@ typedef struct
/*
* END_DEPENDENT_FUNCTIONS_RESOURCE struct is not
* needed because it has no fields
* needed because it has no fields
*/
typedef struct
......
/******************************************************************************
*
* Name: acutils.h -- prototypes for the common (subsystem-wide) procedures
* $Revision: 146 $
* $Revision: 147 $
*
*****************************************************************************/
......@@ -637,6 +637,11 @@ acpi_ut_delete_object_cache (
* utmisc
*/
void
acpi_ut_print_string (
char *string,
u8 max_length);
acpi_status
acpi_ut_divide (
acpi_integer *in_dividend,
......
/*******************************************************************************
*
* Module Name: nsaccess - Top-level functions for accessing ACPI namespace
* $Revision: 161 $
* $Revision: 165 $
*
******************************************************************************/
......@@ -142,7 +142,7 @@ acpi_ns_root_initialize (void)
/*
* Build an object around the static string
*/
obj_desc->string.length = ACPI_STRLEN (init_val->val);
obj_desc->string.length = (u32) ACPI_STRLEN (init_val->val);
obj_desc->string.pointer = init_val->val;
obj_desc->common.flags |= AOPOBJ_STATIC_POINTER;
break;
......@@ -150,6 +150,7 @@ acpi_ns_root_initialize (void)
case ACPI_TYPE_MUTEX:
obj_desc->mutex.node = new_node;
obj_desc->mutex.sync_level =
(u16) ACPI_STRTOUL (init_val->val, NULL, 10);
......@@ -246,6 +247,7 @@ acpi_ns_lookup (
acpi_namespace_node *current_node = NULL;
acpi_namespace_node *this_node = NULL;
u32 num_segments;
u32 num_carats;
acpi_name simple_name;
acpi_object_type type_to_check_for;
acpi_object_type this_search_type;
......@@ -299,26 +301,9 @@ acpi_ns_lookup (
}
}
/*
* This check is explicitly split to relax the Type_to_check_for
* conditions for Bank_field_defn. Originally, both Bank_field_defn and
* Def_field_defn caused Type_to_check_for to be set to ACPI_TYPE_REGION,
* but the Bank_field_defn may also check for a Field definition as well
* as an Operation_region.
*/
if (INTERNAL_TYPE_FIELD_DEFN == type) {
/* Def_field_defn defines fields in a Region */
/* Save type TBD: may be no longer necessary */
type_to_check_for = ACPI_TYPE_REGION;
}
else if (INTERNAL_TYPE_BANK_FIELD_DEFN == type) {
/* Bank_field_defn defines data fields in a Field Object */
type_to_check_for = ACPI_TYPE_ANY;
}
else {
type_to_check_for = type;
}
type_to_check_for = type;
/*
* Begin examination of the actual pathname
......@@ -364,14 +349,15 @@ acpi_ns_lookup (
/* Pathname is relative to current scope, start there */
ACPI_DEBUG_PRINT ((ACPI_DB_NAMES,
"Searching relative to prefix scope [%p]\n",
prefix_node));
"Searching relative to prefix scope [%4.4s] (%p)\n",
prefix_node->name.ascii, prefix_node));
/*
* Handle multiple Parent Prefixes (carat) by just getting
* the parent node for each prefix instance.
*/
this_node = prefix_node;
num_carats = 0;
while (*path == (u8) AML_PARENT_PREFIX) {
/* Name is fully qualified, no search rules apply */
......@@ -384,6 +370,7 @@ acpi_ns_lookup (
/* Backup to the parent node */
num_carats++;
this_node = acpi_ns_get_parent_node (this_node);
if (!this_node) {
/* Current scope has no parent scope */
......@@ -396,7 +383,8 @@ acpi_ns_lookup (
if (search_parent_flag == ACPI_NS_NO_UPSEARCH) {
ACPI_DEBUG_PRINT ((ACPI_DB_NAMES,
"Path is absolute with one or more carats\n"));
"Search scope is [%4.4s], path has %d carat(s)\n",
this_node->name.ascii, num_carats));
}
}
......@@ -420,6 +408,7 @@ acpi_ns_lookup (
* have the correct target node and there are no name segments.
*/
num_segments = 0;
type = this_node->type;
ACPI_DEBUG_PRINT ((ACPI_DB_NAMES,
"Prefix-only Pathname (Zero name segments), Flags=%X\n", flags));
......@@ -525,6 +514,7 @@ acpi_ns_lookup (
current_node));
}
*return_node = this_node;
return_ACPI_STATUS (status);
}
......@@ -535,27 +525,24 @@ acpi_ns_lookup (
* 2) And we are looking for a specific type
* (Not checking for TYPE_ANY)
* 3) Which is not an alias
* 4) Which is not a local type (TYPE_DEF_ANY)
* 5) Which is not a local type (TYPE_SCOPE)
* 6) Which is not a local type (TYPE_INDEX_FIELD_DEFN)
* 7) And the type of target object is known (not TYPE_ANY)
* 8) And target object does not match what we are looking for
* 4) Which is not a local type (TYPE_SCOPE)
* 5) And the type of target object is known (not TYPE_ANY)
* 6) And target object does not match what we are looking for
*
* Then we have a type mismatch. Just warn and ignore it.
*/
if ((num_segments == 0) &&
(type_to_check_for != ACPI_TYPE_ANY) &&
(type_to_check_for != INTERNAL_TYPE_ALIAS) &&
(type_to_check_for != INTERNAL_TYPE_DEF_ANY) &&
(type_to_check_for != INTERNAL_TYPE_SCOPE) &&
(type_to_check_for != INTERNAL_TYPE_INDEX_FIELD_DEFN) &&
(type_to_check_for != ACPI_TYPE_LOCAL_ALIAS) &&
(type_to_check_for != ACPI_TYPE_LOCAL_SCOPE) &&
(this_node->type != ACPI_TYPE_ANY) &&
(this_node->type != type_to_check_for)) {
/* Complain about a type mismatch */
ACPI_REPORT_WARNING (
("Ns_lookup: %4.4s, type %X, checking for type %X\n",
(char *) &simple_name, this_node->type, type_to_check_for));
("Ns_lookup: Type mismatch on %4.4s (%s), searching for (%s)\n",
(char *) &simple_name, acpi_ut_get_type_name (this_node->type),
acpi_ut_get_type_name (type_to_check_for)));
}
/*
......@@ -581,15 +568,11 @@ acpi_ns_lookup (
* If entry is a type which opens a scope, push the new scope on the
* scope stack.
*/
if (acpi_ns_opens_scope (type_to_check_for)) {
if (acpi_ns_opens_scope (type)) {
status = acpi_ds_scope_stack_push (this_node, type, walk_state);
if (ACPI_FAILURE (status)) {
return_ACPI_STATUS (status);
}
ACPI_DEBUG_PRINT ((ACPI_DB_NAMES,
"Setting current scope to [%4.4s] (%p)\n",
this_node->name.ascii, this_node));
}
}
......
/*******************************************************************************
*
* Module Name: nsalloc - Namespace allocation and deletion utilities
* $Revision: 74 $
* $Revision: 75 $
*
******************************************************************************/
......@@ -125,6 +125,55 @@ acpi_ns_delete_node (
}
/*******************************************************************************
*
* FUNCTION: Acpi_ns_compare_names
*
* PARAMETERS: Name1 - First name to compare
* Name2 - Second name to compare
*
* RETURN: value from strncmp
*
* DESCRIPTION: Compare two ACPI names. Names that are prefixed with an
* underscore are forced to be alphabetically first.
*
******************************************************************************/
int
acpi_ns_compare_names (
char *name1,
char *name2)
{
char reversed_name1[ACPI_NAME_SIZE];
char reversed_name2[ACPI_NAME_SIZE];
u32 i;
u32 j;
/*
* Replace all instances of "underscore" with a value that is smaller so
* that all names that are prefixed with underscore(s) are alphabetically
* first.
*
* Reverse the name bytewise so we can just do a 32-bit compare instead
* of a strncmp.
*/
for (i = 0, j= (ACPI_NAME_SIZE - 1); i < ACPI_NAME_SIZE; i++, j--) {
reversed_name1[j] = name1[i];
if (name1[i] == '_') {
reversed_name1[j] = '*';
}
reversed_name2[j] = name2[i];
if (name2[i] == '_') {
reversed_name2[j] = '*';
}
}
return (*(s32 *) reversed_name1 - *(s32 *) reversed_name2);
}
/*******************************************************************************
*
* FUNCTION: Acpi_ns_install_node
......@@ -139,8 +188,10 @@ acpi_ns_delete_node (
* DESCRIPTION: Initialize a new namespace node and install it amongst
* its peers.
*
* Note: Current namespace lookup is linear search, so the nodes
* are not linked in any particular order.
* Note: Current namespace lookup is linear search. However, the
* nodes are linked in alphabetical order to 1) put all reserved
* names (start with underscore) first, and to 2) make a readable
* namespace dump.
*
******************************************************************************/
......@@ -153,6 +204,7 @@ acpi_ns_install_node (
{
u16 owner_id = TABLE_ID_DSDT;
acpi_namespace_node *child_node;
acpi_namespace_node *previous_child_node;
ACPI_FUNCTION_TRACE ("Ns_install_node");
......@@ -172,66 +224,68 @@ acpi_ns_install_node (
child_node = parent_node->child;
if (!child_node) {
parent_node->child = node;
node->flags |= ANOBJ_END_OF_PEER_LIST;
node->peer = parent_node;
}
else {
while (!(child_node->flags & ANOBJ_END_OF_PEER_LIST)) {
child_node = child_node->peer;
}
/*
* Walk the list whilst searching for the the correct
* alphabetic placement.
*/
previous_child_node = NULL;
while (acpi_ns_compare_names (child_node->name.ascii, node->name.ascii) < 0) {
if (child_node->flags & ANOBJ_END_OF_PEER_LIST) {
/* Last peer; Clear end-of-list flag */
child_node->peer = node;
child_node->flags &= ~ANOBJ_END_OF_PEER_LIST;
/* Clear end-of-list flag */
/* This node is the new peer to the child node */
child_node->flags &= ~ANOBJ_END_OF_PEER_LIST;
}
child_node->peer = node;
/* Init the new entry */
/* This node is the new end-of-list */
node->owner_id = owner_id;
node->flags |= ANOBJ_END_OF_PEER_LIST;
node->peer = parent_node;
node->flags |= ANOBJ_END_OF_PEER_LIST;
node->peer = parent_node;
break;
}
/* Get next peer */
/*
* If adding a name with unknown type, or having to
* add the region in order to define fields in it, we
* have a forward reference.
*/
if ((ACPI_TYPE_ANY == type) ||
(INTERNAL_TYPE_FIELD_DEFN == type) ||
(INTERNAL_TYPE_BANK_FIELD_DEFN == type)) {
/*
* We don't want to abort here, however!
* We will fill in the actual type when the
* real definition is found later.
*/
ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, "[%4.4s] is a forward reference\n",
node->name.ascii));
}
previous_child_node = child_node;
child_node = child_node->peer;
}
/*
* The Def_field_defn and Bank_field_defn cases are actually
* looking up the Region in which the field will be defined
*/
if ((INTERNAL_TYPE_FIELD_DEFN == type) ||
(INTERNAL_TYPE_BANK_FIELD_DEFN == type)) {
type = ACPI_TYPE_REGION;
}
/* Did the node get inserted at the end-of-list? */
/*
* Scope, Def_any, and Index_field_defn are bogus "types" which do
* not actually have anything to do with the type of the name
* being looked up. Save any other value of Type as the type of
* the entry.
*/
if ((type != INTERNAL_TYPE_SCOPE) &&
(type != INTERNAL_TYPE_DEF_ANY) &&
(type != INTERNAL_TYPE_INDEX_FIELD_DEFN)) {
node->type = (u8) type;
if (!(node->flags & ANOBJ_END_OF_PEER_LIST)) {
/*
* Loop above terminated without reaching the end-of-list.
* Insert the new node at the current location
*/
if (previous_child_node) {
/* Insert node alphabetically */
node->peer = child_node;
previous_child_node->peer = node;
}
else {
/* Insert node alphabetically at start of list */
node->peer = child_node;
parent_node->child = node;
}
}
}
ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, "%4.4s added to %p at %p\n",
node->name.ascii, parent_node, node));
/* Init the new entry */
node->owner_id = owner_id;
node->type = (u8) type;
ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, "%4.4s (%s) added to %4.4s (%s) %p at %p\n",
node->name.ascii, acpi_ut_get_type_name (node->type),
parent_node->name.ascii, acpi_ut_get_type_name (parent_node->type), parent_node, node));
/*
* Increment the reference count(s) of all parents up to
......
/******************************************************************************
*
* Module Name: nsdump - table dumping routines for debug
* $Revision: 141 $
* $Revision: 145 $
*
*****************************************************************************/
......@@ -150,22 +150,14 @@ acpi_ns_dump_one_object (
acpi_object_type obj_type;
acpi_object_type type;
u32 bytes_to_dump;
u32 downstream_sibling_mask = 0;
u32 level_tmp;
u32 which_bit;
u32 i;
u32 dbg_level;
u32 i;
ACPI_FUNCTION_NAME ("Ns_dump_one_object");
this_node = acpi_ns_map_handle_to_node (obj_handle);
level_tmp = level;
type = this_node->type;
which_bit = 1;
/* Is output enabled? */
if (!(acpi_dbg_level & info->debug_level)) {
return (AE_OK);
......@@ -176,6 +168,9 @@ acpi_ns_dump_one_object (
return (AE_OK);
}
this_node = acpi_ns_map_handle_to_node (obj_handle);
type = this_node->type;
/* Check if the owner matches */
if ((info->owner_id != ACPI_UINT32_MAX) &&
......@@ -185,45 +180,12 @@ acpi_ns_dump_one_object (
/* Indent the object according to the level */
while (level_tmp--) {
/* Print appropriate characters to form tree structure */
if (level_tmp) {
if (downstream_sibling_mask & which_bit) {
acpi_os_printf ("|");
}
else {
acpi_os_printf (" ");
}
which_bit <<= 1;
}
else {
if (acpi_ns_exist_downstream_sibling (this_node + 1)) {
downstream_sibling_mask |= ((u32) 1 << (level - 1));
acpi_os_printf ("+");
}
else {
downstream_sibling_mask &= ACPI_UINT32_MAX ^ ((u32) 1 << (level - 1));
acpi_os_printf ("+");
}
if (this_node->child == NULL) {
acpi_os_printf ("-");
}
else if (acpi_ns_exist_downstream_sibling (this_node->child)) {
acpi_os_printf ("+");
}
else {
acpi_os_printf ("-");
}
}
}
acpi_os_printf ("%2d%*s", level - 1, level * 2, " ");
/* Check the integrity of our data */
/* Check the node type and name */
if (type > INTERNAL_TYPE_MAX) {
type = INTERNAL_TYPE_DEF_ANY; /* prints as *ERROR* */
if (type > ACPI_TYPE_LOCAL_MAX) {
ACPI_REPORT_WARNING (("Invalid ACPI Type %08X\n", type));
}
if (!acpi_ut_valid_acpi_name (this_node->name.integer)) {
......@@ -233,7 +195,7 @@ acpi_ns_dump_one_object (
/*
* Now we can print out the pertinent information
*/
acpi_os_printf (" %4.4s %-12s %p",
acpi_os_printf ("%4.4s %-12s %p ",
this_node->name.ascii, acpi_ut_get_type_name (type), this_node);
dbg_level = acpi_dbg_level;
......@@ -254,7 +216,7 @@ acpi_ns_dump_one_object (
switch (type) {
case ACPI_TYPE_PROCESSOR:
acpi_os_printf (" ID %X Len %.4X Addr %p\n",
acpi_os_printf ("ID %X Len %.4X Addr %p\n",
obj_desc->processor.proc_id,
obj_desc->processor.length,
(char *) obj_desc->processor.address);
......@@ -263,13 +225,13 @@ acpi_ns_dump_one_object (
case ACPI_TYPE_DEVICE:
acpi_os_printf (" Notification object: %p", obj_desc);
acpi_os_printf ("Notify object: %p", obj_desc);
break;
case ACPI_TYPE_METHOD:
acpi_os_printf (" Args %X Len %.4X Aml %p\n",
acpi_os_printf ("Args %X Len %.4X Aml %p\n",
(u32) obj_desc->method.param_count,
obj_desc->method.aml_length,
obj_desc->method.aml_start);
......@@ -278,7 +240,7 @@ acpi_ns_dump_one_object (
case ACPI_TYPE_INTEGER:
acpi_os_printf (" = %8.8X%8.8X\n",
acpi_os_printf ("= %8.8X%8.8X\n",
ACPI_HIDWORD (obj_desc->integer.value),
ACPI_LODWORD (obj_desc->integer.value));
break;
......@@ -287,11 +249,11 @@ acpi_ns_dump_one_object (
case ACPI_TYPE_PACKAGE:
if (obj_desc->common.flags & AOPOBJ_DATA_VALID) {
acpi_os_printf (" Elements %.2X\n",
acpi_os_printf ("Elements %.2X\n",
obj_desc->package.count);
}
else {
acpi_os_printf (" [Length not yet evaluated]\n");
acpi_os_printf ("[Length not yet evaluated]\n");
}
break;
......@@ -299,7 +261,7 @@ acpi_ns_dump_one_object (
case ACPI_TYPE_BUFFER:
if (obj_desc->common.flags & AOPOBJ_DATA_VALID) {
acpi_os_printf (" Len %.2X",
acpi_os_printf ("Len %.2X",
obj_desc->buffer.length);
/* Dump some of the buffer */
......@@ -313,28 +275,22 @@ acpi_ns_dump_one_object (
acpi_os_printf ("\n");
}
else {
acpi_os_printf (" [Length not yet evaluated]\n");
acpi_os_printf ("[Length not yet evaluated]\n");
}
break;
case ACPI_TYPE_STRING:
acpi_os_printf (" Len %.2X", obj_desc->string.length);
if (obj_desc->string.length > 0) {
acpi_os_printf (" = \"%.32s\"", obj_desc->string.pointer);
if (obj_desc->string.length > 32) {
acpi_os_printf ("...");
}
}
acpi_os_printf ("Len %.2X ", obj_desc->string.length);
acpi_ut_print_string (obj_desc->string.pointer, 32);
acpi_os_printf ("\n");
break;
case ACPI_TYPE_REGION:
acpi_os_printf (" [%s]", acpi_ut_get_region_name (obj_desc->region.space_id));
acpi_os_printf ("[%s]", acpi_ut_get_region_name (obj_desc->region.space_id));
if (obj_desc->region.flags & AOPOBJ_DATA_VALID) {
acpi_os_printf (" Addr %8.8X%8.8X Len %.4X\n",
ACPI_HIDWORD (obj_desc->region.address),
......@@ -347,9 +303,9 @@ acpi_ns_dump_one_object (
break;
case INTERNAL_TYPE_REFERENCE:
case ACPI_TYPE_LOCAL_REFERENCE:
acpi_os_printf (" [%s]\n",
acpi_os_printf ("[%s]\n",
acpi_ps_get_opcode_name (obj_desc->reference.opcode));
break;
......@@ -358,43 +314,43 @@ acpi_ns_dump_one_object (
if (obj_desc->buffer_field.buffer_obj &&
obj_desc->buffer_field.buffer_obj->buffer.node) {
acpi_os_printf (" Buf [%4.4s]",
acpi_os_printf ("Buf [%4.4s]",
obj_desc->buffer_field.buffer_obj->buffer.node->name.ascii);
}
break;
case INTERNAL_TYPE_REGION_FIELD:
case ACPI_TYPE_LOCAL_REGION_FIELD:
acpi_os_printf (" Rgn [%4.4s]",
acpi_os_printf ("Rgn [%4.4s]",
obj_desc->common_field.region_obj->region.node->name.ascii);
break;
case INTERNAL_TYPE_BANK_FIELD:
case ACPI_TYPE_LOCAL_BANK_FIELD:
acpi_os_printf (" Rgn [%4.4s] Bnk [%4.4s]",
acpi_os_printf ("Rgn [%4.4s] Bnk [%4.4s]",
obj_desc->common_field.region_obj->region.node->name.ascii,
obj_desc->bank_field.bank_obj->common_field.node->name.ascii);
break;
case INTERNAL_TYPE_INDEX_FIELD:
case ACPI_TYPE_LOCAL_INDEX_FIELD:
acpi_os_printf (" Idx [%4.4s] Dat [%4.4s]",
acpi_os_printf ("Idx [%4.4s] Dat [%4.4s]",
obj_desc->index_field.index_obj->common_field.node->name.ascii,
obj_desc->index_field.data_obj->common_field.node->name.ascii);
break;
case INTERNAL_TYPE_ALIAS:
case ACPI_TYPE_LOCAL_ALIAS:
acpi_os_printf (" Target %4.4s (%p)\n", ((acpi_namespace_node *) obj_desc)->name.ascii, obj_desc);
acpi_os_printf ("Target %4.4s (%p)\n", ((acpi_namespace_node *) obj_desc)->name.ascii, obj_desc);
break;
default:
acpi_os_printf (" Object %p\n", obj_desc);
acpi_os_printf ("Object %p\n", obj_desc);
break;
}
......@@ -402,9 +358,10 @@ acpi_ns_dump_one_object (
switch (type) {
case ACPI_TYPE_BUFFER_FIELD:
case INTERNAL_TYPE_REGION_FIELD:
case INTERNAL_TYPE_BANK_FIELD:
case INTERNAL_TYPE_INDEX_FIELD:
case ACPI_TYPE_LOCAL_REGION_FIELD:
case ACPI_TYPE_LOCAL_BANK_FIELD:
case ACPI_TYPE_LOCAL_INDEX_FIELD:
acpi_os_printf (" Off %.2X Len %.2X Acc %.2hd\n",
(obj_desc->common_field.base_byte_offset * 8)
+ obj_desc->common_field.start_field_bit_offset,
......@@ -420,9 +377,7 @@ acpi_ns_dump_one_object (
case ACPI_DISPLAY_OBJECTS:
acpi_os_printf ("%p O:%p",
this_node, obj_desc);
acpi_os_printf ("O:%p", obj_desc);
if (!obj_desc) {
/* No attached object, we are done */
......@@ -490,7 +445,7 @@ acpi_ns_dump_one_object (
/* Dump attached objects */
while (obj_desc) {
obj_type = INTERNAL_TYPE_INVALID;
obj_type = ACPI_TYPE_INVALID;
acpi_os_printf (" Attached Object %p: ", obj_desc);
/* Decode the type of attached object and dump the contents */
......@@ -507,7 +462,7 @@ acpi_ns_dump_one_object (
obj_type = ACPI_GET_OBJECT_TYPE (obj_desc);
if (obj_type > INTERNAL_TYPE_MAX) {
if (obj_type > ACPI_TYPE_LOCAL_MAX) {
acpi_os_printf ("(Ptr to ACPI Object type %X [UNKNOWN])\n", obj_type);
bytes_to_dump = 32;
}
......@@ -558,15 +513,15 @@ acpi_ns_dump_one_object (
obj_desc = (void *) obj_desc->method.aml_start;
break;
case INTERNAL_TYPE_REGION_FIELD:
case ACPI_TYPE_LOCAL_REGION_FIELD:
obj_desc = (void *) obj_desc->field.region_obj;
break;
case INTERNAL_TYPE_BANK_FIELD:
case ACPI_TYPE_LOCAL_BANK_FIELD:
obj_desc = (void *) obj_desc->bank_field.region_obj;
break;
case INTERNAL_TYPE_INDEX_FIELD:
case ACPI_TYPE_LOCAL_INDEX_FIELD:
obj_desc = (void *) obj_desc->index_field.index_obj;
break;
......@@ -574,7 +529,7 @@ acpi_ns_dump_one_object (
goto cleanup;
}
obj_type = INTERNAL_TYPE_INVALID; /* Terminate loop after next pass */
obj_type = ACPI_TYPE_INVALID; /* Terminate loop after next pass */
}
cleanup:
......
......@@ -2,7 +2,7 @@
*
* Module Name: nsobject - Utilities for objects attached to namespace
* table entries
* $Revision: 83 $
* $Revision: 84 $
*
******************************************************************************/
......@@ -127,14 +127,9 @@ acpi_ns_attach_object (
else {
obj_desc = (acpi_operand_object *) object;
/* If a valid type (non-ANY) was given, just use it */
/* Use the given type */
if (ACPI_TYPE_ANY != type) {
object_type = type;
}
else {
object_type = INTERNAL_TYPE_DEF_ANY;
}
object_type = type;
}
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Installing %p into Node %p [%4.4s]\n",
......@@ -201,7 +196,7 @@ acpi_ns_detach_object (
obj_desc = node->object;
if (!obj_desc ||
(ACPI_GET_OBJECT_TYPE (obj_desc) == INTERNAL_TYPE_DATA)) {
(ACPI_GET_OBJECT_TYPE (obj_desc) == ACPI_TYPE_LOCAL_DATA)) {
return_VOID;
}
......@@ -211,7 +206,7 @@ acpi_ns_detach_object (
if (ACPI_GET_DESCRIPTOR_TYPE (obj_desc) == ACPI_DESC_TYPE_OPERAND) {
node->object = obj_desc->common.next_object;
if (node->object &&
(ACPI_GET_OBJECT_TYPE (node->object) != INTERNAL_TYPE_DATA)) {
(ACPI_GET_OBJECT_TYPE (node->object) != ACPI_TYPE_LOCAL_DATA)) {
node->object = node->object->common.next_object;
}
}
......@@ -256,7 +251,7 @@ acpi_ns_get_attached_object (
if (!node->object ||
((ACPI_GET_DESCRIPTOR_TYPE (node->object) != ACPI_DESC_TYPE_OPERAND) &&
(ACPI_GET_DESCRIPTOR_TYPE (node->object) != ACPI_DESC_TYPE_NAMED)) ||
(ACPI_GET_OBJECT_TYPE (node->object) == INTERNAL_TYPE_DATA)) {
(ACPI_GET_OBJECT_TYPE (node->object) == ACPI_TYPE_LOCAL_DATA)) {
return_PTR (NULL);
}
......@@ -282,10 +277,10 @@ acpi_ns_get_secondary_object (
ACPI_FUNCTION_TRACE_PTR ("Ns_get_secondary_object", obj_desc);
if ((!obj_desc) ||
(ACPI_GET_OBJECT_TYPE (obj_desc) == INTERNAL_TYPE_DATA) ||
(!obj_desc->common.next_object) ||
(ACPI_GET_OBJECT_TYPE (obj_desc->common.next_object) == INTERNAL_TYPE_DATA)) {
if ((!obj_desc) ||
(ACPI_GET_OBJECT_TYPE (obj_desc) == ACPI_TYPE_LOCAL_DATA) ||
(!obj_desc->common.next_object) ||
(ACPI_GET_OBJECT_TYPE (obj_desc->common.next_object) == ACPI_TYPE_LOCAL_DATA)) {
return_PTR (NULL);
}
......@@ -320,7 +315,7 @@ acpi_ns_attach_data (
prev_obj_desc = NULL;
obj_desc = node->object;
while (obj_desc) {
if ((ACPI_GET_OBJECT_TYPE (obj_desc) == INTERNAL_TYPE_DATA) &&
if ((ACPI_GET_OBJECT_TYPE (obj_desc) == ACPI_TYPE_LOCAL_DATA) &&
(obj_desc->data.handler == handler)) {
return (AE_ALREADY_EXISTS);
}
......@@ -332,7 +327,7 @@ acpi_ns_attach_data (
/* Create an internal object for the data */
data_desc = acpi_ut_create_internal_object (INTERNAL_TYPE_DATA);
data_desc = acpi_ut_create_internal_object (ACPI_TYPE_LOCAL_DATA);
if (!data_desc) {
return (AE_NO_MEMORY);
}
......@@ -378,7 +373,7 @@ acpi_ns_detach_data (
prev_obj_desc = NULL;
obj_desc = node->object;
while (obj_desc) {
if ((ACPI_GET_OBJECT_TYPE (obj_desc) == INTERNAL_TYPE_DATA) &&
if ((ACPI_GET_OBJECT_TYPE (obj_desc) == ACPI_TYPE_LOCAL_DATA) &&
(obj_desc->data.handler == handler)) {
if (prev_obj_desc) {
prev_obj_desc->common.next_object = obj_desc->common.next_object;
......@@ -422,7 +417,7 @@ acpi_ns_get_attached_data (
obj_desc = node->object;
while (obj_desc) {
if ((ACPI_GET_OBJECT_TYPE (obj_desc) == INTERNAL_TYPE_DATA) &&
if ((ACPI_GET_OBJECT_TYPE (obj_desc) == ACPI_TYPE_LOCAL_DATA) &&
(obj_desc->data.handler == handler)) {
*data = obj_desc->data.pointer;
return (AE_OK);
......
/*******************************************************************************
*
* Module Name: nssearch - Namespace search
* $Revision: 89 $
* $Revision: 92 $
*
******************************************************************************/
......@@ -37,14 +37,15 @@
* FUNCTION: Acpi_ns_search_node
*
* PARAMETERS: *Target_name - Ascii ACPI name to search for
* *Node - Starting table where search will begin
* *Node - Starting node where search will begin
* Type - Object type to match
* **Return_node - Where the matched Named obj is returned
*
* RETURN: Status
*
* DESCRIPTION: Search a single namespace table. Performs a simple search,
* does not add entries or search parents.
* DESCRIPTION: Search a single level of the namespace. Performs a
* simple search of the specified level, and does not add
* entries or search parents.
*
*
* Named object lists are built (and subsequently dumped) in the
......@@ -77,7 +78,7 @@ acpi_ns_search_node (
scope_name = acpi_ns_get_external_pathname (node);
if (scope_name) {
ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, "Searching %s [%p] For %4.4s (type %s)\n",
ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, "Searching %s [%p] For %4.4s (%s)\n",
scope_name, node, (char *) &target_name, acpi_ut_get_type_name (type)));
ACPI_MEM_FREE (scope_name);
......@@ -86,8 +87,8 @@ acpi_ns_search_node (
#endif
/*
* Search for name in this table, which is to say that we must search
* for the name among the children of this object
* Search for name at this namespace level, which is to say that we
* must search for the name among the children of this object
*/
next_node = node->child;
while (next_node) {
......@@ -95,30 +96,8 @@ acpi_ns_search_node (
if (next_node->name.integer == target_name) {
/*
* Found matching entry. Capture the type if appropriate, before
* returning the entry.
*
* The Def_field_defn and Bank_field_defn cases are actually looking up
* the Region in which the field will be defined
* Found matching entry.
*/
if ((INTERNAL_TYPE_FIELD_DEFN == type) ||
(INTERNAL_TYPE_BANK_FIELD_DEFN == type)) {
type = ACPI_TYPE_REGION;
}
/*
* Scope, Def_any, and Index_field_defn are bogus "types" which do not
* actually have anything to do with the type of the name being
* looked up. For any other value of Type, if the type stored in
* the entry is Any (i.e. unknown), save the actual type.
*/
if (type != INTERNAL_TYPE_SCOPE &&
type != INTERNAL_TYPE_DEF_ANY &&
type != INTERNAL_TYPE_INDEX_FIELD_DEFN &&
next_node->type == ACPI_TYPE_ANY) {
next_node->type = (u8) type;
}
ACPI_DEBUG_PRINT ((ACPI_DB_NAMES,
"Name %4.4s Type [%s] found at %p\n",
(char *) &target_name, acpi_ut_get_type_name (next_node->type), next_node));
......@@ -142,7 +121,7 @@ acpi_ns_search_node (
next_node = next_node->peer;
}
/* Searched entire table, not found */
/* Searched entire namespace level, not found */
ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, "Name %4.4s Type [%s] not found at %p\n",
(char *) &target_name, acpi_ut_get_type_name (type), next_node));
......@@ -156,14 +135,14 @@ acpi_ns_search_node (
* FUNCTION: Acpi_ns_search_parent_tree
*
* PARAMETERS: *Target_name - Ascii ACPI name to search for
* *Node - Starting table where search will begin
* *Node - Starting node where search will begin
* Type - Object type to match
* **Return_node - Where the matched Named Obj is returned
*
* RETURN: Status
*
* DESCRIPTION: Called when a name has not been found in the current namespace
* table. Before adding it or giving up, ACPI scope rules require
* level. Before adding it or giving up, ACPI scope rules require
* searching enclosing scopes in cases identified by Acpi_ns_local().
*
* "A name is located by finding the matching name in the current
......@@ -193,22 +172,19 @@ acpi_ns_search_parent_tree (
parent_node = acpi_ns_get_parent_node (node);
/*
* If there is no parent (at the root) or type is "local", we won't be
* searching the parent tree.
* If there is no parent (i.e., we are at the root) or
* type is "local", we won't be searching the parent tree.
*/
if ((acpi_ns_local (type)) ||
(!parent_node)) {
if (!parent_node) {
ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, "[%4.4s] has no parent\n",
(char *) &target_name));
}
if (acpi_ns_local (type)) {
ACPI_DEBUG_PRINT ((ACPI_DB_NAMES,
"[%4.4s] type [%s] must be local to this scope (no parent search)\n",
(char *) &target_name, acpi_ut_get_type_name (type)));
}
if (!parent_node) {
ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, "[%4.4s] has no parent\n",
(char *) &target_name));
return_ACPI_STATUS (AE_NOT_FOUND);
}
if (acpi_ns_local (type)) {
ACPI_DEBUG_PRINT ((ACPI_DB_NAMES,
"[%4.4s] type [%s] must be local to this scope (no parent search)\n",
(char *) &target_name, acpi_ut_get_type_name (type)));
return_ACPI_STATUS (AE_NOT_FOUND);
}
......@@ -251,8 +227,8 @@ acpi_ns_search_parent_tree (
*
* PARAMETERS: Target_name - Ascii ACPI name to search for (4 chars)
* Walk_state - Current state of the walk
* *Node - Starting table where search will begin
* Interpreter_mode - Add names only in MODE_Load_pass_x.
* *Node - Starting node where search will begin
* Interpreter_mode - Add names only in ACPI_MODE_LOAD_PASS_x.
* Otherwise,search only.
* Type - Object type to match
* Flags - Flags describing the search restrictions
......@@ -260,12 +236,12 @@ acpi_ns_search_parent_tree (
*
* RETURN: Status
*
* DESCRIPTION: Search for a name segment in a single name table,
* DESCRIPTION: Search for a name segment in a single namespace level,
* optionally adding it if it is not found. If the passed
* Type is not Any and the type previously stored in the
* entry was Any (i.e. unknown), update the stored type.
*
* In IMODE_EXECUTE, search only.
* In ACPI_IMODE_EXECUTE, search only.
* In other modes, search and add if not found.
*
******************************************************************************/
......@@ -300,14 +276,12 @@ acpi_ns_search_and_enter (
/* Name must consist of printable characters */
if (!acpi_ut_valid_acpi_name (target_name)) {
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "*** Bad character in name: %08x *** \n",
ACPI_REPORT_ERROR (("Ns_search_and_enter: Bad character in ACPI Name: %X\n",
target_name));
ACPI_REPORT_ERROR (("Ns_search_and_enter: Bad character in ACPI Name\n"));
return_ACPI_STATUS (AE_BAD_CHARACTER);
}
/* Try to find the name in the table specified by the caller */
/* Try to find the name in the namespace level specified by the caller */
*return_node = ACPI_ENTRY_NOT_FOUND;
status = acpi_ns_search_node (target_name, node, type, return_node);
......@@ -340,7 +314,7 @@ acpi_ns_search_and_enter (
if ((interpreter_mode != ACPI_IMODE_LOAD_PASS1) &&
(flags & ACPI_NS_SEARCH_PARENT)) {
/*
* Not found in table - search parent tree according
* Not found at this level - search parent tree according
* to ACPI specification
*/
status = acpi_ns_search_parent_tree (target_name, node,
......
......@@ -2,7 +2,7 @@
*
* Module Name: nsutils - Utilities for accessing ACPI namespace, accessing
* parents and siblings and Scope manipulation
* $Revision: 113 $
* $Revision: 115 $
*
*****************************************************************************/
......@@ -747,7 +747,7 @@ u32
acpi_ns_opens_scope (
acpi_object_type type)
{
ACPI_FUNCTION_TRACE_U32 ("Ns_opens_scope", type);
ACPI_FUNCTION_TRACE_STR ("Ns_opens_scope", acpi_ut_get_type_name (type));
if (!acpi_ut_valid_object_type (type)) {
......@@ -885,43 +885,6 @@ acpi_ns_find_parent_name (
}
#if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER)
/*******************************************************************************
*
* FUNCTION: Acpi_ns_exist_downstream_sibling
*
* PARAMETERS: *Node - pointer to first Node to examine
*
* RETURN: TRUE if sibling is found, FALSE otherwise
*
* DESCRIPTION: Searches remainder of scope being processed to determine
* whether there is a downstream sibling to the current
* object. This function is used to determine what type of
* line drawing character to use when displaying namespace
* trees.
*
******************************************************************************/
u8
acpi_ns_exist_downstream_sibling (
acpi_namespace_node *node)
{
if (!node) {
return (FALSE);
}
if (node->name.integer) {
return (TRUE);
}
return (FALSE);
}
#endif /* ACPI_DEBUG_OUTPUT */
/*******************************************************************************
*
* FUNCTION: Acpi_ns_get_parent_node
......
......@@ -2,7 +2,7 @@
*
* Module Name: nsxfeval - Public interfaces to the ACPI subsystem
* ACPI Object evaluation interfaces
* $Revision: 2 $
* $Revision: 3 $
*
******************************************************************************/
......@@ -373,8 +373,8 @@ acpi_walk_namespace (
/* Parameter validation */
if ((type > ACPI_TYPE_MAX) ||
(!max_depth) ||
if ((type > ACPI_TYPE_EXTERNAL_MAX) ||
(!max_depth) ||
(!user_function)) {
return_ACPI_STATUS (AE_BAD_PARAMETER);
}
......
......@@ -2,7 +2,7 @@
*
* Module Name: nsxfobj - Public interfaces to the ACPI subsystem
* ACPI Object oriented interfaces
* $Revision: 113 $
* $Revision: 114 $
*
******************************************************************************/
......@@ -188,7 +188,7 @@ acpi_get_next_object (
/* Parameter validation */
if (type > ACPI_TYPE_MAX) {
if (type > ACPI_TYPE_EXTERNAL_MAX) {
return (AE_BAD_PARAMETER);
}
......
/******************************************************************************
*
* Module Name: psopcode - Parser/Interpreter opcode information table
* $Revision: 72 $
* $Revision: 73 $
*
*****************************************************************************/
......@@ -451,144 +451,144 @@
const acpi_opcode_info acpi_gbl_aml_op_info[AML_NUM_OPCODES] =
{
/*! [Begin] no source code translation */
/* Index Name Parser Args Interpreter Args ObjectType Class Type Flags */
/* 00 */ ACPI_OP ("Zero", ARGP_ZERO_OP, ARGI_ZERO_OP, ACPI_TYPE_INTEGER, AML_CLASS_ARGUMENT, AML_TYPE_CONSTANT, AML_CONSTANT),
/* 01 */ ACPI_OP ("One", ARGP_ONE_OP, ARGI_ONE_OP, ACPI_TYPE_INTEGER, AML_CLASS_ARGUMENT, AML_TYPE_CONSTANT, AML_CONSTANT),
/* 02 */ ACPI_OP ("Alias", ARGP_ALIAS_OP, ARGI_ALIAS_OP, INTERNAL_TYPE_ALIAS, AML_CLASS_NAMED_OBJECT, AML_TYPE_NAMED_SIMPLE, AML_HAS_ARGS | AML_NSOBJECT | AML_NSOPCODE | AML_NSNODE | AML_NAMED),
/* 03 */ ACPI_OP ("Name", ARGP_NAME_OP, ARGI_NAME_OP, ACPI_TYPE_ANY, AML_CLASS_NAMED_OBJECT, AML_TYPE_NAMED_COMPLEX, AML_HAS_ARGS | AML_NSOBJECT | AML_NSOPCODE | AML_NSNODE | AML_NAMED),
/* 04 */ ACPI_OP ("ByteConst", ARGP_BYTE_OP, ARGI_BYTE_OP, ACPI_TYPE_INTEGER, AML_CLASS_ARGUMENT, AML_TYPE_LITERAL, AML_CONSTANT),
/* 05 */ ACPI_OP ("WordConst", ARGP_WORD_OP, ARGI_WORD_OP, ACPI_TYPE_INTEGER, AML_CLASS_ARGUMENT, AML_TYPE_LITERAL, AML_CONSTANT),
/* 06 */ ACPI_OP ("DwordConst", ARGP_DWORD_OP, ARGI_DWORD_OP, ACPI_TYPE_INTEGER, AML_CLASS_ARGUMENT, AML_TYPE_LITERAL, AML_CONSTANT),
/* 07 */ ACPI_OP ("String", ARGP_STRING_OP, ARGI_STRING_OP, ACPI_TYPE_STRING, AML_CLASS_ARGUMENT, AML_TYPE_LITERAL, AML_CONSTANT),
/* 08 */ ACPI_OP ("Scope", ARGP_SCOPE_OP, ARGI_SCOPE_OP, INTERNAL_TYPE_SCOPE, AML_CLASS_NAMED_OBJECT, AML_TYPE_NAMED_NO_OBJ, AML_HAS_ARGS | AML_NSOBJECT | AML_NSOPCODE | AML_NSNODE | AML_NAMED),
/* 09 */ ACPI_OP ("Buffer", ARGP_BUFFER_OP, ARGI_BUFFER_OP, ACPI_TYPE_BUFFER, AML_CLASS_CREATE, AML_TYPE_CREATE_OBJECT, AML_HAS_ARGS | AML_DEFER | AML_CONSTANT),
/* 0A */ ACPI_OP ("Package", ARGP_PACKAGE_OP, ARGI_PACKAGE_OP, ACPI_TYPE_PACKAGE, AML_CLASS_CREATE, AML_TYPE_CREATE_OBJECT, AML_HAS_ARGS | AML_DEFER | AML_CONSTANT),
/* 0B */ ACPI_OP ("Method", ARGP_METHOD_OP, ARGI_METHOD_OP, ACPI_TYPE_METHOD, AML_CLASS_NAMED_OBJECT, AML_TYPE_NAMED_COMPLEX, AML_HAS_ARGS | AML_NSOBJECT | AML_NSOPCODE | AML_NSNODE | AML_NAMED | AML_DEFER),
/* 0C */ ACPI_OP ("Local0", ARGP_LOCAL0, ARGI_LOCAL0, INTERNAL_TYPE_REFERENCE, AML_CLASS_ARGUMENT, AML_TYPE_LOCAL_VARIABLE, 0),
/* 0D */ ACPI_OP ("Local1", ARGP_LOCAL1, ARGI_LOCAL1, INTERNAL_TYPE_REFERENCE, AML_CLASS_ARGUMENT, AML_TYPE_LOCAL_VARIABLE, 0),
/* 0E */ ACPI_OP ("Local2", ARGP_LOCAL2, ARGI_LOCAL2, INTERNAL_TYPE_REFERENCE, AML_CLASS_ARGUMENT, AML_TYPE_LOCAL_VARIABLE, 0),
/* 0F */ ACPI_OP ("Local3", ARGP_LOCAL3, ARGI_LOCAL3, INTERNAL_TYPE_REFERENCE, AML_CLASS_ARGUMENT, AML_TYPE_LOCAL_VARIABLE, 0),
/* 10 */ ACPI_OP ("Local4", ARGP_LOCAL4, ARGI_LOCAL4, INTERNAL_TYPE_REFERENCE, AML_CLASS_ARGUMENT, AML_TYPE_LOCAL_VARIABLE, 0),
/* 11 */ ACPI_OP ("Local5", ARGP_LOCAL5, ARGI_LOCAL5, INTERNAL_TYPE_REFERENCE, AML_CLASS_ARGUMENT, AML_TYPE_LOCAL_VARIABLE, 0),
/* 12 */ ACPI_OP ("Local6", ARGP_LOCAL6, ARGI_LOCAL6, INTERNAL_TYPE_REFERENCE, AML_CLASS_ARGUMENT, AML_TYPE_LOCAL_VARIABLE, 0),
/* 13 */ ACPI_OP ("Local7", ARGP_LOCAL7, ARGI_LOCAL7, INTERNAL_TYPE_REFERENCE, AML_CLASS_ARGUMENT, AML_TYPE_LOCAL_VARIABLE, 0),
/* 14 */ ACPI_OP ("Arg0", ARGP_ARG0, ARGI_ARG0, INTERNAL_TYPE_REFERENCE, AML_CLASS_ARGUMENT, AML_TYPE_METHOD_ARGUMENT, 0),
/* 15 */ ACPI_OP ("Arg1", ARGP_ARG1, ARGI_ARG1, INTERNAL_TYPE_REFERENCE, AML_CLASS_ARGUMENT, AML_TYPE_METHOD_ARGUMENT, 0),
/* 16 */ ACPI_OP ("Arg2", ARGP_ARG2, ARGI_ARG2, INTERNAL_TYPE_REFERENCE, AML_CLASS_ARGUMENT, AML_TYPE_METHOD_ARGUMENT, 0),
/* 17 */ ACPI_OP ("Arg3", ARGP_ARG3, ARGI_ARG3, INTERNAL_TYPE_REFERENCE, AML_CLASS_ARGUMENT, AML_TYPE_METHOD_ARGUMENT, 0),
/* 18 */ ACPI_OP ("Arg4", ARGP_ARG4, ARGI_ARG4, INTERNAL_TYPE_REFERENCE, AML_CLASS_ARGUMENT, AML_TYPE_METHOD_ARGUMENT, 0),
/* 19 */ ACPI_OP ("Arg5", ARGP_ARG5, ARGI_ARG5, INTERNAL_TYPE_REFERENCE, AML_CLASS_ARGUMENT, AML_TYPE_METHOD_ARGUMENT, 0),
/* 1A */ ACPI_OP ("Arg6", ARGP_ARG6, ARGI_ARG6, INTERNAL_TYPE_REFERENCE, AML_CLASS_ARGUMENT, AML_TYPE_METHOD_ARGUMENT, 0),
/* 1B */ ACPI_OP ("Store", ARGP_STORE_OP, ARGI_STORE_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_1T_1R, AML_FLAGS_EXEC_1A_1T_1R),
/* 1C */ ACPI_OP ("RefOf", ARGP_REF_OF_OP, ARGI_REF_OF_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_0T_1R, AML_FLAGS_EXEC_1A_0T_1R),
/* 1D */ ACPI_OP ("Add", ARGP_ADD_OP, ARGI_ADD_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_1T_1R, AML_FLAGS_EXEC_2A_1T_1R | AML_MATH | AML_CONSTANT),
/* 1E */ ACPI_OP ("Concatenate", ARGP_CONCAT_OP, ARGI_CONCAT_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_1T_1R, AML_FLAGS_EXEC_2A_1T_1R | AML_CONSTANT),
/* 1F */ ACPI_OP ("Subtract", ARGP_SUBTRACT_OP, ARGI_SUBTRACT_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_1T_1R, AML_FLAGS_EXEC_2A_1T_1R | AML_MATH | AML_CONSTANT),
/* 20 */ ACPI_OP ("Increment", ARGP_INCREMENT_OP, ARGI_INCREMENT_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_0T_1R, AML_FLAGS_EXEC_1A_0T_1R | AML_CONSTANT),
/* 21 */ ACPI_OP ("Decrement", ARGP_DECREMENT_OP, ARGI_DECREMENT_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_0T_1R, AML_FLAGS_EXEC_1A_0T_1R | AML_CONSTANT),
/* 22 */ ACPI_OP ("Multiply", ARGP_MULTIPLY_OP, ARGI_MULTIPLY_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_1T_1R, AML_FLAGS_EXEC_2A_1T_1R | AML_MATH | AML_CONSTANT),
/* 23 */ ACPI_OP ("Divide", ARGP_DIVIDE_OP, ARGI_DIVIDE_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_2T_1R, AML_FLAGS_EXEC_2A_2T_1R | AML_CONSTANT),
/* 24 */ ACPI_OP ("ShiftLeft", ARGP_SHIFT_LEFT_OP, ARGI_SHIFT_LEFT_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_1T_1R, AML_FLAGS_EXEC_2A_1T_1R | AML_MATH | AML_CONSTANT),
/* 25 */ ACPI_OP ("ShiftRight", ARGP_SHIFT_RIGHT_OP, ARGI_SHIFT_RIGHT_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_1T_1R, AML_FLAGS_EXEC_2A_1T_1R | AML_MATH | AML_CONSTANT),
/* 26 */ ACPI_OP ("And", ARGP_BIT_AND_OP, ARGI_BIT_AND_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_1T_1R, AML_FLAGS_EXEC_2A_1T_1R | AML_MATH | AML_CONSTANT),
/* 27 */ ACPI_OP ("NAnd", ARGP_BIT_NAND_OP, ARGI_BIT_NAND_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_1T_1R, AML_FLAGS_EXEC_2A_1T_1R | AML_MATH | AML_CONSTANT),
/* 28 */ ACPI_OP ("Or", ARGP_BIT_OR_OP, ARGI_BIT_OR_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_1T_1R, AML_FLAGS_EXEC_2A_1T_1R | AML_MATH | AML_CONSTANT),
/* 29 */ ACPI_OP ("NOr", ARGP_BIT_NOR_OP, ARGI_BIT_NOR_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_1T_1R, AML_FLAGS_EXEC_2A_1T_1R | AML_MATH | AML_CONSTANT),
/* 2A */ ACPI_OP ("XOr", ARGP_BIT_XOR_OP, ARGI_BIT_XOR_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_1T_1R, AML_FLAGS_EXEC_2A_1T_1R | AML_MATH | AML_CONSTANT),
/* 2B */ ACPI_OP ("Not", ARGP_BIT_NOT_OP, ARGI_BIT_NOT_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_1T_1R, AML_FLAGS_EXEC_1A_1T_1R | AML_CONSTANT),
/* 2C */ ACPI_OP ("FindSetLeftBit", ARGP_FIND_SET_LEFT_BIT_OP, ARGI_FIND_SET_LEFT_BIT_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_1T_1R, AML_FLAGS_EXEC_1A_1T_1R | AML_CONSTANT),
/* 2D */ ACPI_OP ("FindSetRightBit", ARGP_FIND_SET_RIGHT_BIT_OP,ARGI_FIND_SET_RIGHT_BIT_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_1T_1R, AML_FLAGS_EXEC_1A_1T_1R | AML_CONSTANT),
/* 2E */ ACPI_OP ("DerefOf", ARGP_DEREF_OF_OP, ARGI_DEREF_OF_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_0T_1R, AML_FLAGS_EXEC_1A_0T_1R),
/* 2F */ ACPI_OP ("Notify", ARGP_NOTIFY_OP, ARGI_NOTIFY_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_0T_0R, AML_FLAGS_EXEC_2A_0T_0R),
/* 30 */ ACPI_OP ("SizeOf", ARGP_SIZE_OF_OP, ARGI_SIZE_OF_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_0T_1R, AML_FLAGS_EXEC_1A_0T_1R),
/* 31 */ ACPI_OP ("Index", ARGP_INDEX_OP, ARGI_INDEX_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_1T_1R, AML_FLAGS_EXEC_2A_1T_1R | AML_CONSTANT),
/* 32 */ ACPI_OP ("Match", ARGP_MATCH_OP, ARGI_MATCH_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_6A_0T_1R, AML_FLAGS_EXEC_6A_0T_1R | AML_CONSTANT),
/* 33 */ ACPI_OP ("CreateDWordField", ARGP_CREATE_DWORD_FIELD_OP,ARGI_CREATE_DWORD_FIELD_OP, ACPI_TYPE_BUFFER_FIELD, AML_CLASS_CREATE, AML_TYPE_CREATE_FIELD, AML_HAS_ARGS | AML_NSOBJECT | AML_NSNODE | AML_DEFER | AML_CREATE),
/* 34 */ ACPI_OP ("CreateWordField", ARGP_CREATE_WORD_FIELD_OP, ARGI_CREATE_WORD_FIELD_OP, ACPI_TYPE_BUFFER_FIELD, AML_CLASS_CREATE, AML_TYPE_CREATE_FIELD, AML_HAS_ARGS | AML_NSOBJECT | AML_NSNODE | AML_DEFER | AML_CREATE),
/* 35 */ ACPI_OP ("CreateByteField", ARGP_CREATE_BYTE_FIELD_OP, ARGI_CREATE_BYTE_FIELD_OP, ACPI_TYPE_BUFFER_FIELD, AML_CLASS_CREATE, AML_TYPE_CREATE_FIELD, AML_HAS_ARGS | AML_NSOBJECT | AML_NSNODE | AML_DEFER | AML_CREATE),
/* 36 */ ACPI_OP ("CreateBitField", ARGP_CREATE_BIT_FIELD_OP, ARGI_CREATE_BIT_FIELD_OP, ACPI_TYPE_BUFFER_FIELD, AML_CLASS_CREATE, AML_TYPE_CREATE_FIELD, AML_HAS_ARGS | AML_NSOBJECT | AML_NSNODE | AML_DEFER | AML_CREATE),
/* 37 */ ACPI_OP ("ObjectType", ARGP_TYPE_OP, ARGI_TYPE_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_0T_1R, AML_FLAGS_EXEC_1A_0T_1R),
/* 38 */ ACPI_OP ("LAnd", ARGP_LAND_OP, ARGI_LAND_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_0T_1R, AML_FLAGS_EXEC_2A_0T_1R | AML_LOGICAL | AML_CONSTANT),
/* 39 */ ACPI_OP ("LOr", ARGP_LOR_OP, ARGI_LOR_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_0T_1R, AML_FLAGS_EXEC_2A_0T_1R | AML_LOGICAL | AML_CONSTANT),
/* 3A */ ACPI_OP ("LNot", ARGP_LNOT_OP, ARGI_LNOT_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_0T_1R, AML_FLAGS_EXEC_1A_0T_1R | AML_CONSTANT),
/* 3B */ ACPI_OP ("LEqual", ARGP_LEQUAL_OP, ARGI_LEQUAL_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_0T_1R, AML_FLAGS_EXEC_2A_0T_1R | AML_LOGICAL | AML_CONSTANT),
/* 3C */ ACPI_OP ("LGreater", ARGP_LGREATER_OP, ARGI_LGREATER_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_0T_1R, AML_FLAGS_EXEC_2A_0T_1R | AML_LOGICAL | AML_CONSTANT),
/* 3D */ ACPI_OP ("LLess", ARGP_LLESS_OP, ARGI_LLESS_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_0T_1R, AML_FLAGS_EXEC_2A_0T_1R | AML_LOGICAL | AML_CONSTANT),
/* 3E */ ACPI_OP ("If", ARGP_IF_OP, ARGI_IF_OP, ACPI_TYPE_ANY, AML_CLASS_CONTROL, AML_TYPE_CONTROL, AML_HAS_ARGS),
/* 3F */ ACPI_OP ("Else", ARGP_ELSE_OP, ARGI_ELSE_OP, ACPI_TYPE_ANY, AML_CLASS_CONTROL, AML_TYPE_CONTROL, AML_HAS_ARGS),
/* 40 */ ACPI_OP ("While", ARGP_WHILE_OP, ARGI_WHILE_OP, ACPI_TYPE_ANY, AML_CLASS_CONTROL, AML_TYPE_CONTROL, AML_HAS_ARGS),
/* 41 */ ACPI_OP ("Noop", ARGP_NOOP_OP, ARGI_NOOP_OP, ACPI_TYPE_ANY, AML_CLASS_CONTROL, AML_TYPE_CONTROL, 0),
/* 42 */ ACPI_OP ("Return", ARGP_RETURN_OP, ARGI_RETURN_OP, ACPI_TYPE_ANY, AML_CLASS_CONTROL, AML_TYPE_CONTROL, AML_HAS_ARGS),
/* 43 */ ACPI_OP ("Break", ARGP_BREAK_OP, ARGI_BREAK_OP, ACPI_TYPE_ANY, AML_CLASS_CONTROL, AML_TYPE_CONTROL, 0),
/* 44 */ ACPI_OP ("BreakPoint", ARGP_BREAK_POINT_OP, ARGI_BREAK_POINT_OP, ACPI_TYPE_ANY, AML_CLASS_CONTROL, AML_TYPE_CONTROL, 0),
/* 45 */ ACPI_OP ("Ones", ARGP_ONES_OP, ARGI_ONES_OP, ACPI_TYPE_INTEGER, AML_CLASS_ARGUMENT, AML_TYPE_CONSTANT, AML_CONSTANT),
/* Index Name Parser Args Interpreter Args ObjectType Class Type Flags */
/* 00 */ ACPI_OP ("Zero", ARGP_ZERO_OP, ARGI_ZERO_OP, ACPI_TYPE_INTEGER, AML_CLASS_ARGUMENT, AML_TYPE_CONSTANT, AML_CONSTANT),
/* 01 */ ACPI_OP ("One", ARGP_ONE_OP, ARGI_ONE_OP, ACPI_TYPE_INTEGER, AML_CLASS_ARGUMENT, AML_TYPE_CONSTANT, AML_CONSTANT),
/* 02 */ ACPI_OP ("Alias", ARGP_ALIAS_OP, ARGI_ALIAS_OP, ACPI_TYPE_LOCAL_ALIAS, AML_CLASS_NAMED_OBJECT, AML_TYPE_NAMED_SIMPLE, AML_HAS_ARGS | AML_NSOBJECT | AML_NSOPCODE | AML_NSNODE | AML_NAMED),
/* 03 */ ACPI_OP ("Name", ARGP_NAME_OP, ARGI_NAME_OP, ACPI_TYPE_ANY, AML_CLASS_NAMED_OBJECT, AML_TYPE_NAMED_COMPLEX, AML_HAS_ARGS | AML_NSOBJECT | AML_NSOPCODE | AML_NSNODE | AML_NAMED),
/* 04 */ ACPI_OP ("ByteConst", ARGP_BYTE_OP, ARGI_BYTE_OP, ACPI_TYPE_INTEGER, AML_CLASS_ARGUMENT, AML_TYPE_LITERAL, AML_CONSTANT),
/* 05 */ ACPI_OP ("WordConst", ARGP_WORD_OP, ARGI_WORD_OP, ACPI_TYPE_INTEGER, AML_CLASS_ARGUMENT, AML_TYPE_LITERAL, AML_CONSTANT),
/* 06 */ ACPI_OP ("DwordConst", ARGP_DWORD_OP, ARGI_DWORD_OP, ACPI_TYPE_INTEGER, AML_CLASS_ARGUMENT, AML_TYPE_LITERAL, AML_CONSTANT),
/* 07 */ ACPI_OP ("String", ARGP_STRING_OP, ARGI_STRING_OP, ACPI_TYPE_STRING, AML_CLASS_ARGUMENT, AML_TYPE_LITERAL, AML_CONSTANT),
/* 08 */ ACPI_OP ("Scope", ARGP_SCOPE_OP, ARGI_SCOPE_OP, ACPI_TYPE_LOCAL_SCOPE, AML_CLASS_NAMED_OBJECT, AML_TYPE_NAMED_NO_OBJ, AML_HAS_ARGS | AML_NSOBJECT | AML_NSOPCODE | AML_NSNODE | AML_NAMED),
/* 09 */ ACPI_OP ("Buffer", ARGP_BUFFER_OP, ARGI_BUFFER_OP, ACPI_TYPE_BUFFER, AML_CLASS_CREATE, AML_TYPE_CREATE_OBJECT, AML_HAS_ARGS | AML_DEFER | AML_CONSTANT),
/* 0A */ ACPI_OP ("Package", ARGP_PACKAGE_OP, ARGI_PACKAGE_OP, ACPI_TYPE_PACKAGE, AML_CLASS_CREATE, AML_TYPE_CREATE_OBJECT, AML_HAS_ARGS | AML_DEFER | AML_CONSTANT),
/* 0B */ ACPI_OP ("Method", ARGP_METHOD_OP, ARGI_METHOD_OP, ACPI_TYPE_METHOD, AML_CLASS_NAMED_OBJECT, AML_TYPE_NAMED_COMPLEX, AML_HAS_ARGS | AML_NSOBJECT | AML_NSOPCODE | AML_NSNODE | AML_NAMED | AML_DEFER),
/* 0C */ ACPI_OP ("Local0", ARGP_LOCAL0, ARGI_LOCAL0, ACPI_TYPE_LOCAL_REFERENCE, AML_CLASS_ARGUMENT, AML_TYPE_LOCAL_VARIABLE, 0),
/* 0D */ ACPI_OP ("Local1", ARGP_LOCAL1, ARGI_LOCAL1, ACPI_TYPE_LOCAL_REFERENCE, AML_CLASS_ARGUMENT, AML_TYPE_LOCAL_VARIABLE, 0),
/* 0E */ ACPI_OP ("Local2", ARGP_LOCAL2, ARGI_LOCAL2, ACPI_TYPE_LOCAL_REFERENCE, AML_CLASS_ARGUMENT, AML_TYPE_LOCAL_VARIABLE, 0),
/* 0F */ ACPI_OP ("Local3", ARGP_LOCAL3, ARGI_LOCAL3, ACPI_TYPE_LOCAL_REFERENCE, AML_CLASS_ARGUMENT, AML_TYPE_LOCAL_VARIABLE, 0),
/* 10 */ ACPI_OP ("Local4", ARGP_LOCAL4, ARGI_LOCAL4, ACPI_TYPE_LOCAL_REFERENCE, AML_CLASS_ARGUMENT, AML_TYPE_LOCAL_VARIABLE, 0),
/* 11 */ ACPI_OP ("Local5", ARGP_LOCAL5, ARGI_LOCAL5, ACPI_TYPE_LOCAL_REFERENCE, AML_CLASS_ARGUMENT, AML_TYPE_LOCAL_VARIABLE, 0),
/* 12 */ ACPI_OP ("Local6", ARGP_LOCAL6, ARGI_LOCAL6, ACPI_TYPE_LOCAL_REFERENCE, AML_CLASS_ARGUMENT, AML_TYPE_LOCAL_VARIABLE, 0),
/* 13 */ ACPI_OP ("Local7", ARGP_LOCAL7, ARGI_LOCAL7, ACPI_TYPE_LOCAL_REFERENCE, AML_CLASS_ARGUMENT, AML_TYPE_LOCAL_VARIABLE, 0),
/* 14 */ ACPI_OP ("Arg0", ARGP_ARG0, ARGI_ARG0, ACPI_TYPE_LOCAL_REFERENCE, AML_CLASS_ARGUMENT, AML_TYPE_METHOD_ARGUMENT, 0),
/* 15 */ ACPI_OP ("Arg1", ARGP_ARG1, ARGI_ARG1, ACPI_TYPE_LOCAL_REFERENCE, AML_CLASS_ARGUMENT, AML_TYPE_METHOD_ARGUMENT, 0),
/* 16 */ ACPI_OP ("Arg2", ARGP_ARG2, ARGI_ARG2, ACPI_TYPE_LOCAL_REFERENCE, AML_CLASS_ARGUMENT, AML_TYPE_METHOD_ARGUMENT, 0),
/* 17 */ ACPI_OP ("Arg3", ARGP_ARG3, ARGI_ARG3, ACPI_TYPE_LOCAL_REFERENCE, AML_CLASS_ARGUMENT, AML_TYPE_METHOD_ARGUMENT, 0),
/* 18 */ ACPI_OP ("Arg4", ARGP_ARG4, ARGI_ARG4, ACPI_TYPE_LOCAL_REFERENCE, AML_CLASS_ARGUMENT, AML_TYPE_METHOD_ARGUMENT, 0),
/* 19 */ ACPI_OP ("Arg5", ARGP_ARG5, ARGI_ARG5, ACPI_TYPE_LOCAL_REFERENCE, AML_CLASS_ARGUMENT, AML_TYPE_METHOD_ARGUMENT, 0),
/* 1A */ ACPI_OP ("Arg6", ARGP_ARG6, ARGI_ARG6, ACPI_TYPE_LOCAL_REFERENCE, AML_CLASS_ARGUMENT, AML_TYPE_METHOD_ARGUMENT, 0),
/* 1B */ ACPI_OP ("Store", ARGP_STORE_OP, ARGI_STORE_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_1T_1R, AML_FLAGS_EXEC_1A_1T_1R),
/* 1C */ ACPI_OP ("RefOf", ARGP_REF_OF_OP, ARGI_REF_OF_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_0T_1R, AML_FLAGS_EXEC_1A_0T_1R),
/* 1D */ ACPI_OP ("Add", ARGP_ADD_OP, ARGI_ADD_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_1T_1R, AML_FLAGS_EXEC_2A_1T_1R | AML_MATH | AML_CONSTANT),
/* 1E */ ACPI_OP ("Concatenate", ARGP_CONCAT_OP, ARGI_CONCAT_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_1T_1R, AML_FLAGS_EXEC_2A_1T_1R | AML_CONSTANT),
/* 1F */ ACPI_OP ("Subtract", ARGP_SUBTRACT_OP, ARGI_SUBTRACT_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_1T_1R, AML_FLAGS_EXEC_2A_1T_1R | AML_MATH | AML_CONSTANT),
/* 20 */ ACPI_OP ("Increment", ARGP_INCREMENT_OP, ARGI_INCREMENT_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_0T_1R, AML_FLAGS_EXEC_1A_0T_1R | AML_CONSTANT),
/* 21 */ ACPI_OP ("Decrement", ARGP_DECREMENT_OP, ARGI_DECREMENT_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_0T_1R, AML_FLAGS_EXEC_1A_0T_1R | AML_CONSTANT),
/* 22 */ ACPI_OP ("Multiply", ARGP_MULTIPLY_OP, ARGI_MULTIPLY_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_1T_1R, AML_FLAGS_EXEC_2A_1T_1R | AML_MATH | AML_CONSTANT),
/* 23 */ ACPI_OP ("Divide", ARGP_DIVIDE_OP, ARGI_DIVIDE_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_2T_1R, AML_FLAGS_EXEC_2A_2T_1R | AML_CONSTANT),
/* 24 */ ACPI_OP ("ShiftLeft", ARGP_SHIFT_LEFT_OP, ARGI_SHIFT_LEFT_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_1T_1R, AML_FLAGS_EXEC_2A_1T_1R | AML_MATH | AML_CONSTANT),
/* 25 */ ACPI_OP ("ShiftRight", ARGP_SHIFT_RIGHT_OP, ARGI_SHIFT_RIGHT_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_1T_1R, AML_FLAGS_EXEC_2A_1T_1R | AML_MATH | AML_CONSTANT),
/* 26 */ ACPI_OP ("And", ARGP_BIT_AND_OP, ARGI_BIT_AND_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_1T_1R, AML_FLAGS_EXEC_2A_1T_1R | AML_MATH | AML_CONSTANT),
/* 27 */ ACPI_OP ("NAnd", ARGP_BIT_NAND_OP, ARGI_BIT_NAND_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_1T_1R, AML_FLAGS_EXEC_2A_1T_1R | AML_MATH | AML_CONSTANT),
/* 28 */ ACPI_OP ("Or", ARGP_BIT_OR_OP, ARGI_BIT_OR_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_1T_1R, AML_FLAGS_EXEC_2A_1T_1R | AML_MATH | AML_CONSTANT),
/* 29 */ ACPI_OP ("NOr", ARGP_BIT_NOR_OP, ARGI_BIT_NOR_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_1T_1R, AML_FLAGS_EXEC_2A_1T_1R | AML_MATH | AML_CONSTANT),
/* 2A */ ACPI_OP ("XOr", ARGP_BIT_XOR_OP, ARGI_BIT_XOR_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_1T_1R, AML_FLAGS_EXEC_2A_1T_1R | AML_MATH | AML_CONSTANT),
/* 2B */ ACPI_OP ("Not", ARGP_BIT_NOT_OP, ARGI_BIT_NOT_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_1T_1R, AML_FLAGS_EXEC_1A_1T_1R | AML_CONSTANT),
/* 2C */ ACPI_OP ("FindSetLeftBit", ARGP_FIND_SET_LEFT_BIT_OP, ARGI_FIND_SET_LEFT_BIT_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_1T_1R, AML_FLAGS_EXEC_1A_1T_1R | AML_CONSTANT),
/* 2D */ ACPI_OP ("FindSetRightBit", ARGP_FIND_SET_RIGHT_BIT_OP,ARGI_FIND_SET_RIGHT_BIT_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_1T_1R, AML_FLAGS_EXEC_1A_1T_1R | AML_CONSTANT),
/* 2E */ ACPI_OP ("DerefOf", ARGP_DEREF_OF_OP, ARGI_DEREF_OF_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_0T_1R, AML_FLAGS_EXEC_1A_0T_1R),
/* 2F */ ACPI_OP ("Notify", ARGP_NOTIFY_OP, ARGI_NOTIFY_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_0T_0R, AML_FLAGS_EXEC_2A_0T_0R),
/* 30 */ ACPI_OP ("SizeOf", ARGP_SIZE_OF_OP, ARGI_SIZE_OF_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_0T_1R, AML_FLAGS_EXEC_1A_0T_1R),
/* 31 */ ACPI_OP ("Index", ARGP_INDEX_OP, ARGI_INDEX_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_1T_1R, AML_FLAGS_EXEC_2A_1T_1R | AML_CONSTANT),
/* 32 */ ACPI_OP ("Match", ARGP_MATCH_OP, ARGI_MATCH_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_6A_0T_1R, AML_FLAGS_EXEC_6A_0T_1R | AML_CONSTANT),
/* 33 */ ACPI_OP ("CreateDWordField", ARGP_CREATE_DWORD_FIELD_OP,ARGI_CREATE_DWORD_FIELD_OP, ACPI_TYPE_BUFFER_FIELD, AML_CLASS_CREATE, AML_TYPE_CREATE_FIELD, AML_HAS_ARGS | AML_NSOBJECT | AML_NSNODE | AML_DEFER | AML_CREATE),
/* 34 */ ACPI_OP ("CreateWordField", ARGP_CREATE_WORD_FIELD_OP, ARGI_CREATE_WORD_FIELD_OP, ACPI_TYPE_BUFFER_FIELD, AML_CLASS_CREATE, AML_TYPE_CREATE_FIELD, AML_HAS_ARGS | AML_NSOBJECT | AML_NSNODE | AML_DEFER | AML_CREATE),
/* 35 */ ACPI_OP ("CreateByteField", ARGP_CREATE_BYTE_FIELD_OP, ARGI_CREATE_BYTE_FIELD_OP, ACPI_TYPE_BUFFER_FIELD, AML_CLASS_CREATE, AML_TYPE_CREATE_FIELD, AML_HAS_ARGS | AML_NSOBJECT | AML_NSNODE | AML_DEFER | AML_CREATE),
/* 36 */ ACPI_OP ("CreateBitField", ARGP_CREATE_BIT_FIELD_OP, ARGI_CREATE_BIT_FIELD_OP, ACPI_TYPE_BUFFER_FIELD, AML_CLASS_CREATE, AML_TYPE_CREATE_FIELD, AML_HAS_ARGS | AML_NSOBJECT | AML_NSNODE | AML_DEFER | AML_CREATE),
/* 37 */ ACPI_OP ("ObjectType", ARGP_TYPE_OP, ARGI_TYPE_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_0T_1R, AML_FLAGS_EXEC_1A_0T_1R),
/* 38 */ ACPI_OP ("LAnd", ARGP_LAND_OP, ARGI_LAND_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_0T_1R, AML_FLAGS_EXEC_2A_0T_1R | AML_LOGICAL | AML_CONSTANT),
/* 39 */ ACPI_OP ("LOr", ARGP_LOR_OP, ARGI_LOR_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_0T_1R, AML_FLAGS_EXEC_2A_0T_1R | AML_LOGICAL | AML_CONSTANT),
/* 3A */ ACPI_OP ("LNot", ARGP_LNOT_OP, ARGI_LNOT_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_0T_1R, AML_FLAGS_EXEC_1A_0T_1R | AML_CONSTANT),
/* 3B */ ACPI_OP ("LEqual", ARGP_LEQUAL_OP, ARGI_LEQUAL_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_0T_1R, AML_FLAGS_EXEC_2A_0T_1R | AML_LOGICAL | AML_CONSTANT),
/* 3C */ ACPI_OP ("LGreater", ARGP_LGREATER_OP, ARGI_LGREATER_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_0T_1R, AML_FLAGS_EXEC_2A_0T_1R | AML_LOGICAL | AML_CONSTANT),
/* 3D */ ACPI_OP ("LLess", ARGP_LLESS_OP, ARGI_LLESS_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_0T_1R, AML_FLAGS_EXEC_2A_0T_1R | AML_LOGICAL | AML_CONSTANT),
/* 3E */ ACPI_OP ("If", ARGP_IF_OP, ARGI_IF_OP, ACPI_TYPE_ANY, AML_CLASS_CONTROL, AML_TYPE_CONTROL, AML_HAS_ARGS),
/* 3F */ ACPI_OP ("Else", ARGP_ELSE_OP, ARGI_ELSE_OP, ACPI_TYPE_ANY, AML_CLASS_CONTROL, AML_TYPE_CONTROL, AML_HAS_ARGS),
/* 40 */ ACPI_OP ("While", ARGP_WHILE_OP, ARGI_WHILE_OP, ACPI_TYPE_ANY, AML_CLASS_CONTROL, AML_TYPE_CONTROL, AML_HAS_ARGS),
/* 41 */ ACPI_OP ("Noop", ARGP_NOOP_OP, ARGI_NOOP_OP, ACPI_TYPE_ANY, AML_CLASS_CONTROL, AML_TYPE_CONTROL, 0),
/* 42 */ ACPI_OP ("Return", ARGP_RETURN_OP, ARGI_RETURN_OP, ACPI_TYPE_ANY, AML_CLASS_CONTROL, AML_TYPE_CONTROL, AML_HAS_ARGS),
/* 43 */ ACPI_OP ("Break", ARGP_BREAK_OP, ARGI_BREAK_OP, ACPI_TYPE_ANY, AML_CLASS_CONTROL, AML_TYPE_CONTROL, 0),
/* 44 */ ACPI_OP ("BreakPoint", ARGP_BREAK_POINT_OP, ARGI_BREAK_POINT_OP, ACPI_TYPE_ANY, AML_CLASS_CONTROL, AML_TYPE_CONTROL, 0),
/* 45 */ ACPI_OP ("Ones", ARGP_ONES_OP, ARGI_ONES_OP, ACPI_TYPE_INTEGER, AML_CLASS_ARGUMENT, AML_TYPE_CONSTANT, AML_CONSTANT),
/* Prefixed opcodes (Two-byte opcodes with a prefix op) */
/* 46 */ ACPI_OP ("Mutex", ARGP_MUTEX_OP, ARGI_MUTEX_OP, ACPI_TYPE_MUTEX, AML_CLASS_NAMED_OBJECT, AML_TYPE_NAMED_SIMPLE, AML_HAS_ARGS | AML_NSOBJECT | AML_NSOPCODE | AML_NSNODE | AML_NAMED),
/* 47 */ ACPI_OP ("Event", ARGP_EVENT_OP, ARGI_EVENT_OP, ACPI_TYPE_EVENT, AML_CLASS_NAMED_OBJECT, AML_TYPE_NAMED_SIMPLE, AML_NSOBJECT | AML_NSOPCODE | AML_NSNODE | AML_NAMED ),
/* 48 */ ACPI_OP ("CondRefOf", ARGP_COND_REF_OF_OP, ARGI_COND_REF_OF_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_1T_1R, AML_FLAGS_EXEC_1A_1T_1R),
/* 49 */ ACPI_OP ("CreateField", ARGP_CREATE_FIELD_OP, ARGI_CREATE_FIELD_OP, ACPI_TYPE_BUFFER_FIELD, AML_CLASS_CREATE, AML_TYPE_CREATE_FIELD, AML_HAS_ARGS | AML_NSOBJECT | AML_NSNODE | AML_DEFER | AML_FIELD | AML_CREATE),
/* 4A */ ACPI_OP ("Load", ARGP_LOAD_OP, ARGI_LOAD_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_1T_0R, AML_FLAGS_EXEC_1A_1T_0R),
/* 4B */ ACPI_OP ("Stall", ARGP_STALL_OP, ARGI_STALL_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_0T_0R, AML_FLAGS_EXEC_1A_0T_0R),
/* 4C */ ACPI_OP ("Sleep", ARGP_SLEEP_OP, ARGI_SLEEP_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_0T_0R, AML_FLAGS_EXEC_1A_0T_0R),
/* 4D */ ACPI_OP ("Acquire", ARGP_ACQUIRE_OP, ARGI_ACQUIRE_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_0T_1R, AML_FLAGS_EXEC_2A_0T_1R),
/* 4E */ ACPI_OP ("Signal", ARGP_SIGNAL_OP, ARGI_SIGNAL_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_0T_0R, AML_FLAGS_EXEC_1A_0T_0R),
/* 4F */ ACPI_OP ("Wait", ARGP_WAIT_OP, ARGI_WAIT_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_0T_1R, AML_FLAGS_EXEC_2A_0T_1R),
/* 50 */ ACPI_OP ("Reset", ARGP_RESET_OP, ARGI_RESET_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_0T_0R, AML_FLAGS_EXEC_1A_0T_0R),
/* 51 */ ACPI_OP ("Release", ARGP_RELEASE_OP, ARGI_RELEASE_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_0T_0R, AML_FLAGS_EXEC_1A_0T_0R),
/* 52 */ ACPI_OP ("FromBCD", ARGP_FROM_BCD_OP, ARGI_FROM_BCD_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_1T_1R, AML_FLAGS_EXEC_1A_1T_1R | AML_CONSTANT),
/* 53 */ ACPI_OP ("ToBCD", ARGP_TO_BCD_OP, ARGI_TO_BCD_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_1T_1R, AML_FLAGS_EXEC_1A_1T_1R | AML_CONSTANT),
/* 54 */ ACPI_OP ("Unload", ARGP_UNLOAD_OP, ARGI_UNLOAD_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_0T_0R, AML_FLAGS_EXEC_1A_0T_0R),
/* 55 */ ACPI_OP ("Revision", ARGP_REVISION_OP, ARGI_REVISION_OP, ACPI_TYPE_INTEGER, AML_CLASS_ARGUMENT, AML_TYPE_CONSTANT, 0),
/* 56 */ ACPI_OP ("Debug", ARGP_DEBUG_OP, ARGI_DEBUG_OP, INTERNAL_TYPE_REFERENCE, AML_CLASS_ARGUMENT, AML_TYPE_CONSTANT, 0),
/* 57 */ ACPI_OP ("Fatal", ARGP_FATAL_OP, ARGI_FATAL_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_3A_0T_0R, AML_FLAGS_EXEC_3A_0T_0R),
/* 58 */ ACPI_OP ("OperationRegion", ARGP_REGION_OP, ARGI_REGION_OP, ACPI_TYPE_REGION, AML_CLASS_NAMED_OBJECT, AML_TYPE_NAMED_COMPLEX, AML_HAS_ARGS | AML_NSOBJECT | AML_NSOPCODE | AML_NSNODE | AML_NAMED | AML_DEFER),
/* 59 */ ACPI_OP ("Field", ARGP_FIELD_OP, ARGI_FIELD_OP, INTERNAL_TYPE_FIELD_DEFN,AML_CLASS_NAMED_OBJECT, AML_TYPE_NAMED_FIELD, AML_HAS_ARGS | AML_NSOBJECT | AML_NSOPCODE | AML_FIELD),
/* 5A */ ACPI_OP ("Device", ARGP_DEVICE_OP, ARGI_DEVICE_OP, ACPI_TYPE_DEVICE, AML_CLASS_NAMED_OBJECT, AML_TYPE_NAMED_NO_OBJ, AML_HAS_ARGS | AML_NSOBJECT | AML_NSOPCODE | AML_NSNODE | AML_NAMED),
/* 5B */ ACPI_OP ("Processor", ARGP_PROCESSOR_OP, ARGI_PROCESSOR_OP, ACPI_TYPE_PROCESSOR, AML_CLASS_NAMED_OBJECT, AML_TYPE_NAMED_SIMPLE, AML_HAS_ARGS | AML_NSOBJECT | AML_NSOPCODE | AML_NSNODE | AML_NAMED),
/* 5C */ ACPI_OP ("PowerResource", ARGP_POWER_RES_OP, ARGI_POWER_RES_OP, ACPI_TYPE_POWER, AML_CLASS_NAMED_OBJECT, AML_TYPE_NAMED_SIMPLE, AML_HAS_ARGS | AML_NSOBJECT | AML_NSOPCODE | AML_NSNODE | AML_NAMED),
/* 5D */ ACPI_OP ("ThermalZone", ARGP_THERMAL_ZONE_OP, ARGI_THERMAL_ZONE_OP, ACPI_TYPE_THERMAL, AML_CLASS_NAMED_OBJECT, AML_TYPE_NAMED_NO_OBJ, AML_HAS_ARGS | AML_NSOBJECT | AML_NSOPCODE | AML_NSNODE | AML_NAMED),
/* 5E */ ACPI_OP ("IndexField", ARGP_INDEX_FIELD_OP, ARGI_INDEX_FIELD_OP, INTERNAL_TYPE_INDEX_FIELD_DEFN,AML_CLASS_NAMED_OBJECT, AML_TYPE_NAMED_FIELD, AML_HAS_ARGS | AML_NSOBJECT | AML_NSOPCODE | AML_FIELD),
/* 5F */ ACPI_OP ("BankField", ARGP_BANK_FIELD_OP, ARGI_BANK_FIELD_OP, INTERNAL_TYPE_BANK_FIELD_DEFN,AML_CLASS_NAMED_OBJECT, AML_TYPE_NAMED_FIELD, AML_HAS_ARGS | AML_NSOBJECT | AML_NSOPCODE | AML_FIELD),
/* 46 */ ACPI_OP ("Mutex", ARGP_MUTEX_OP, ARGI_MUTEX_OP, ACPI_TYPE_MUTEX, AML_CLASS_NAMED_OBJECT, AML_TYPE_NAMED_SIMPLE, AML_HAS_ARGS | AML_NSOBJECT | AML_NSOPCODE | AML_NSNODE | AML_NAMED),
/* 47 */ ACPI_OP ("Event", ARGP_EVENT_OP, ARGI_EVENT_OP, ACPI_TYPE_EVENT, AML_CLASS_NAMED_OBJECT, AML_TYPE_NAMED_SIMPLE, AML_NSOBJECT | AML_NSOPCODE | AML_NSNODE | AML_NAMED ),
/* 48 */ ACPI_OP ("CondRefOf", ARGP_COND_REF_OF_OP, ARGI_COND_REF_OF_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_1T_1R, AML_FLAGS_EXEC_1A_1T_1R),
/* 49 */ ACPI_OP ("CreateField", ARGP_CREATE_FIELD_OP, ARGI_CREATE_FIELD_OP, ACPI_TYPE_BUFFER_FIELD, AML_CLASS_CREATE, AML_TYPE_CREATE_FIELD, AML_HAS_ARGS | AML_NSOBJECT | AML_NSNODE | AML_DEFER | AML_FIELD | AML_CREATE),
/* 4A */ ACPI_OP ("Load", ARGP_LOAD_OP, ARGI_LOAD_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_1T_0R, AML_FLAGS_EXEC_1A_1T_0R),
/* 4B */ ACPI_OP ("Stall", ARGP_STALL_OP, ARGI_STALL_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_0T_0R, AML_FLAGS_EXEC_1A_0T_0R),
/* 4C */ ACPI_OP ("Sleep", ARGP_SLEEP_OP, ARGI_SLEEP_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_0T_0R, AML_FLAGS_EXEC_1A_0T_0R),
/* 4D */ ACPI_OP ("Acquire", ARGP_ACQUIRE_OP, ARGI_ACQUIRE_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_0T_1R, AML_FLAGS_EXEC_2A_0T_1R),
/* 4E */ ACPI_OP ("Signal", ARGP_SIGNAL_OP, ARGI_SIGNAL_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_0T_0R, AML_FLAGS_EXEC_1A_0T_0R),
/* 4F */ ACPI_OP ("Wait", ARGP_WAIT_OP, ARGI_WAIT_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_0T_1R, AML_FLAGS_EXEC_2A_0T_1R),
/* 50 */ ACPI_OP ("Reset", ARGP_RESET_OP, ARGI_RESET_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_0T_0R, AML_FLAGS_EXEC_1A_0T_0R),
/* 51 */ ACPI_OP ("Release", ARGP_RELEASE_OP, ARGI_RELEASE_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_0T_0R, AML_FLAGS_EXEC_1A_0T_0R),
/* 52 */ ACPI_OP ("FromBCD", ARGP_FROM_BCD_OP, ARGI_FROM_BCD_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_1T_1R, AML_FLAGS_EXEC_1A_1T_1R | AML_CONSTANT),
/* 53 */ ACPI_OP ("ToBCD", ARGP_TO_BCD_OP, ARGI_TO_BCD_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_1T_1R, AML_FLAGS_EXEC_1A_1T_1R | AML_CONSTANT),
/* 54 */ ACPI_OP ("Unload", ARGP_UNLOAD_OP, ARGI_UNLOAD_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_0T_0R, AML_FLAGS_EXEC_1A_0T_0R),
/* 55 */ ACPI_OP ("Revision", ARGP_REVISION_OP, ARGI_REVISION_OP, ACPI_TYPE_INTEGER, AML_CLASS_ARGUMENT, AML_TYPE_CONSTANT, 0),
/* 56 */ ACPI_OP ("Debug", ARGP_DEBUG_OP, ARGI_DEBUG_OP, ACPI_TYPE_LOCAL_REFERENCE, AML_CLASS_ARGUMENT, AML_TYPE_CONSTANT, 0),
/* 57 */ ACPI_OP ("Fatal", ARGP_FATAL_OP, ARGI_FATAL_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_3A_0T_0R, AML_FLAGS_EXEC_3A_0T_0R),
/* 58 */ ACPI_OP ("OperationRegion", ARGP_REGION_OP, ARGI_REGION_OP, ACPI_TYPE_REGION, AML_CLASS_NAMED_OBJECT, AML_TYPE_NAMED_COMPLEX, AML_HAS_ARGS | AML_NSOBJECT | AML_NSOPCODE | AML_NSNODE | AML_NAMED | AML_DEFER),
/* 59 */ ACPI_OP ("Field", ARGP_FIELD_OP, ARGI_FIELD_OP, ACPI_TYPE_ANY, AML_CLASS_NAMED_OBJECT, AML_TYPE_NAMED_FIELD, AML_HAS_ARGS | AML_NSOBJECT | AML_NSOPCODE | AML_FIELD),
/* 5A */ ACPI_OP ("Device", ARGP_DEVICE_OP, ARGI_DEVICE_OP, ACPI_TYPE_DEVICE, AML_CLASS_NAMED_OBJECT, AML_TYPE_NAMED_NO_OBJ, AML_HAS_ARGS | AML_NSOBJECT | AML_NSOPCODE | AML_NSNODE | AML_NAMED),
/* 5B */ ACPI_OP ("Processor", ARGP_PROCESSOR_OP, ARGI_PROCESSOR_OP, ACPI_TYPE_PROCESSOR, AML_CLASS_NAMED_OBJECT, AML_TYPE_NAMED_SIMPLE, AML_HAS_ARGS | AML_NSOBJECT | AML_NSOPCODE | AML_NSNODE | AML_NAMED),
/* 5C */ ACPI_OP ("PowerResource", ARGP_POWER_RES_OP, ARGI_POWER_RES_OP, ACPI_TYPE_POWER, AML_CLASS_NAMED_OBJECT, AML_TYPE_NAMED_SIMPLE, AML_HAS_ARGS | AML_NSOBJECT | AML_NSOPCODE | AML_NSNODE | AML_NAMED),
/* 5D */ ACPI_OP ("ThermalZone", ARGP_THERMAL_ZONE_OP, ARGI_THERMAL_ZONE_OP, ACPI_TYPE_THERMAL, AML_CLASS_NAMED_OBJECT, AML_TYPE_NAMED_NO_OBJ, AML_HAS_ARGS | AML_NSOBJECT | AML_NSOPCODE | AML_NSNODE | AML_NAMED),
/* 5E */ ACPI_OP ("IndexField", ARGP_INDEX_FIELD_OP, ARGI_INDEX_FIELD_OP, ACPI_TYPE_ANY, AML_CLASS_NAMED_OBJECT, AML_TYPE_NAMED_FIELD, AML_HAS_ARGS | AML_NSOBJECT | AML_NSOPCODE | AML_FIELD),
/* 5F */ ACPI_OP ("BankField", ARGP_BANK_FIELD_OP, ARGI_BANK_FIELD_OP, ACPI_TYPE_ANY, AML_CLASS_NAMED_OBJECT, AML_TYPE_NAMED_FIELD, AML_HAS_ARGS | AML_NSOBJECT | AML_NSOPCODE | AML_FIELD),
/* Internal opcodes that map to invalid AML opcodes */
/* 60 */ ACPI_OP ("LNotEqual", ARGP_LNOTEQUAL_OP, ARGI_LNOTEQUAL_OP, ACPI_TYPE_ANY, AML_CLASS_INTERNAL, AML_TYPE_BOGUS, AML_HAS_ARGS | AML_CONSTANT),
/* 61 */ ACPI_OP ("LLessEqual", ARGP_LLESSEQUAL_OP, ARGI_LLESSEQUAL_OP, ACPI_TYPE_ANY, AML_CLASS_INTERNAL, AML_TYPE_BOGUS, AML_HAS_ARGS | AML_CONSTANT),
/* 62 */ ACPI_OP ("LGreaterEqual", ARGP_LGREATEREQUAL_OP, ARGI_LGREATEREQUAL_OP, ACPI_TYPE_ANY, AML_CLASS_INTERNAL, AML_TYPE_BOGUS, AML_HAS_ARGS | AML_CONSTANT),
/* 63 */ ACPI_OP ("-NamePath-", ARGP_NAMEPATH_OP, ARGI_NAMEPATH_OP, INTERNAL_TYPE_REFERENCE, AML_CLASS_ARGUMENT, AML_TYPE_LITERAL, AML_NSOBJECT | AML_NSNODE ),
/* 64 */ ACPI_OP ("-MethodCall-", ARGP_METHODCALL_OP, ARGI_METHODCALL_OP, ACPI_TYPE_METHOD, AML_CLASS_METHOD_CALL, AML_TYPE_METHOD_CALL, AML_HAS_ARGS | AML_NSOBJECT | AML_NSNODE),
/* 65 */ ACPI_OP ("-ByteList-", ARGP_BYTELIST_OP, ARGI_BYTELIST_OP, ACPI_TYPE_ANY, AML_CLASS_ARGUMENT, AML_TYPE_LITERAL, 0),
/* 66 */ ACPI_OP ("-ReservedField-", ARGP_RESERVEDFIELD_OP, ARGI_RESERVEDFIELD_OP, ACPI_TYPE_ANY, AML_CLASS_INTERNAL, AML_TYPE_BOGUS, 0),
/* 67 */ ACPI_OP ("-NamedField-", ARGP_NAMEDFIELD_OP, ARGI_NAMEDFIELD_OP, ACPI_TYPE_ANY, AML_CLASS_INTERNAL, AML_TYPE_BOGUS, AML_NSOBJECT | AML_NSOPCODE | AML_NSNODE | AML_NAMED ),
/* 68 */ ACPI_OP ("-AccessField-", ARGP_ACCESSFIELD_OP, ARGI_ACCESSFIELD_OP, ACPI_TYPE_ANY, AML_CLASS_INTERNAL, AML_TYPE_BOGUS, 0),
/* 69 */ ACPI_OP ("-StaticString", ARGP_STATICSTRING_OP, ARGI_STATICSTRING_OP, ACPI_TYPE_ANY, AML_CLASS_INTERNAL, AML_TYPE_BOGUS, 0),
/* 6A */ ACPI_OP ("-Return Value-", ARG_NONE, ARG_NONE, ACPI_TYPE_ANY, AML_CLASS_RETURN_VALUE, AML_TYPE_RETURN, AML_HAS_ARGS | AML_HAS_RETVAL),
/* 6B */ ACPI_OP ("-UNKNOWN_OP-", ARG_NONE, ARG_NONE, INTERNAL_TYPE_INVALID, AML_CLASS_UNKNOWN, AML_TYPE_BOGUS, AML_HAS_ARGS),
/* 6C */ ACPI_OP ("-ASCII_ONLY-", ARG_NONE, ARG_NONE, ACPI_TYPE_ANY, AML_CLASS_ASCII, AML_TYPE_BOGUS, AML_HAS_ARGS),
/* 6D */ ACPI_OP ("-PREFIX_ONLY-", ARG_NONE, ARG_NONE, ACPI_TYPE_ANY, AML_CLASS_PREFIX, AML_TYPE_BOGUS, AML_HAS_ARGS),
/* 60 */ ACPI_OP ("LNotEqual", ARGP_LNOTEQUAL_OP, ARGI_LNOTEQUAL_OP, ACPI_TYPE_ANY, AML_CLASS_INTERNAL, AML_TYPE_BOGUS, AML_HAS_ARGS | AML_CONSTANT),
/* 61 */ ACPI_OP ("LLessEqual", ARGP_LLESSEQUAL_OP, ARGI_LLESSEQUAL_OP, ACPI_TYPE_ANY, AML_CLASS_INTERNAL, AML_TYPE_BOGUS, AML_HAS_ARGS | AML_CONSTANT),
/* 62 */ ACPI_OP ("LGreaterEqual", ARGP_LGREATEREQUAL_OP, ARGI_LGREATEREQUAL_OP, ACPI_TYPE_ANY, AML_CLASS_INTERNAL, AML_TYPE_BOGUS, AML_HAS_ARGS | AML_CONSTANT),
/* 63 */ ACPI_OP ("-NamePath-", ARGP_NAMEPATH_OP, ARGI_NAMEPATH_OP, ACPI_TYPE_LOCAL_REFERENCE, AML_CLASS_ARGUMENT, AML_TYPE_LITERAL, AML_NSOBJECT | AML_NSNODE ),
/* 64 */ ACPI_OP ("-MethodCall-", ARGP_METHODCALL_OP, ARGI_METHODCALL_OP, ACPI_TYPE_METHOD, AML_CLASS_METHOD_CALL, AML_TYPE_METHOD_CALL, AML_HAS_ARGS | AML_NSOBJECT | AML_NSNODE),
/* 65 */ ACPI_OP ("-ByteList-", ARGP_BYTELIST_OP, ARGI_BYTELIST_OP, ACPI_TYPE_ANY, AML_CLASS_ARGUMENT, AML_TYPE_LITERAL, 0),
/* 66 */ ACPI_OP ("-ReservedField-", ARGP_RESERVEDFIELD_OP, ARGI_RESERVEDFIELD_OP, ACPI_TYPE_ANY, AML_CLASS_INTERNAL, AML_TYPE_BOGUS, 0),
/* 67 */ ACPI_OP ("-NamedField-", ARGP_NAMEDFIELD_OP, ARGI_NAMEDFIELD_OP, ACPI_TYPE_ANY, AML_CLASS_INTERNAL, AML_TYPE_BOGUS, AML_NSOBJECT | AML_NSOPCODE | AML_NSNODE | AML_NAMED ),
/* 68 */ ACPI_OP ("-AccessField-", ARGP_ACCESSFIELD_OP, ARGI_ACCESSFIELD_OP, ACPI_TYPE_ANY, AML_CLASS_INTERNAL, AML_TYPE_BOGUS, 0),
/* 69 */ ACPI_OP ("-StaticString", ARGP_STATICSTRING_OP, ARGI_STATICSTRING_OP, ACPI_TYPE_ANY, AML_CLASS_INTERNAL, AML_TYPE_BOGUS, 0),
/* 6A */ ACPI_OP ("-Return Value-", ARG_NONE, ARG_NONE, ACPI_TYPE_ANY, AML_CLASS_RETURN_VALUE, AML_TYPE_RETURN, AML_HAS_ARGS | AML_HAS_RETVAL),
/* 6B */ ACPI_OP ("-UNKNOWN_OP-", ARG_NONE, ARG_NONE, ACPI_TYPE_INVALID, AML_CLASS_UNKNOWN, AML_TYPE_BOGUS, AML_HAS_ARGS),
/* 6C */ ACPI_OP ("-ASCII_ONLY-", ARG_NONE, ARG_NONE, ACPI_TYPE_ANY, AML_CLASS_ASCII, AML_TYPE_BOGUS, AML_HAS_ARGS),
/* 6D */ ACPI_OP ("-PREFIX_ONLY-", ARG_NONE, ARG_NONE, ACPI_TYPE_ANY, AML_CLASS_PREFIX, AML_TYPE_BOGUS, AML_HAS_ARGS),
/* ACPI 2.0 opcodes */
/* 6E */ ACPI_OP ("QwordConst", ARGP_QWORD_OP, ARGI_QWORD_OP, ACPI_TYPE_INTEGER, AML_CLASS_ARGUMENT, AML_TYPE_LITERAL, AML_CONSTANT),
/* 6F */ ACPI_OP ("Package /*Var*/", ARGP_VAR_PACKAGE_OP, ARGI_VAR_PACKAGE_OP, ACPI_TYPE_PACKAGE, AML_CLASS_CREATE, AML_TYPE_CREATE_OBJECT, AML_HAS_ARGS | AML_DEFER),
/* 70 */ ACPI_OP ("ConcatenateResTemplate", ARGP_CONCAT_RES_OP, ARGI_CONCAT_RES_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_1T_1R, AML_FLAGS_EXEC_2A_1T_1R | AML_CONSTANT),
/* 71 */ ACPI_OP ("Mod", ARGP_MOD_OP, ARGI_MOD_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_1T_1R, AML_FLAGS_EXEC_2A_1T_1R | AML_CONSTANT),
/* 72 */ ACPI_OP ("CreateQWordField", ARGP_CREATE_QWORD_FIELD_OP,ARGI_CREATE_QWORD_FIELD_OP, ACPI_TYPE_BUFFER_FIELD, AML_CLASS_CREATE, AML_TYPE_CREATE_FIELD, AML_HAS_ARGS | AML_NSOBJECT | AML_NSNODE | AML_DEFER | AML_CREATE),
/* 73 */ ACPI_OP ("ToBuffer", ARGP_TO_BUFFER_OP, ARGI_TO_BUFFER_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_1T_1R, AML_FLAGS_EXEC_1A_1T_1R | AML_CONSTANT),
/* 74 */ ACPI_OP ("ToDecimalString", ARGP_TO_DEC_STR_OP, ARGI_TO_DEC_STR_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_1T_1R, AML_FLAGS_EXEC_1A_1T_1R | AML_CONSTANT),
/* 75 */ ACPI_OP ("ToHexString", ARGP_TO_HEX_STR_OP, ARGI_TO_HEX_STR_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_1T_1R, AML_FLAGS_EXEC_1A_1T_1R | AML_CONSTANT),
/* 76 */ ACPI_OP ("ToInteger", ARGP_TO_INTEGER_OP, ARGI_TO_INTEGER_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_1T_1R, AML_FLAGS_EXEC_1A_1T_1R | AML_CONSTANT),
/* 77 */ ACPI_OP ("ToString", ARGP_TO_STRING_OP, ARGI_TO_STRING_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_1T_1R, AML_FLAGS_EXEC_2A_1T_1R | AML_CONSTANT),
/* 78 */ ACPI_OP ("CopyObject", ARGP_COPY_OP, ARGI_COPY_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_1T_1R, AML_FLAGS_EXEC_1A_1T_1R),
/* 79 */ ACPI_OP ("Mid", ARGP_MID_OP, ARGI_MID_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_3A_1T_1R, AML_FLAGS_EXEC_3A_1T_1R | AML_CONSTANT),
/* 7A */ ACPI_OP ("Continue", ARGP_CONTINUE_OP, ARGI_CONTINUE_OP, ACPI_TYPE_ANY, AML_CLASS_CONTROL, AML_TYPE_CONTROL, 0),
/* 7B */ ACPI_OP ("LoadTable", ARGP_LOAD_TABLE_OP, ARGI_LOAD_TABLE_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_6A_0T_1R, AML_FLAGS_EXEC_6A_0T_1R),
/* 7C */ ACPI_OP ("DataTableRegion", ARGP_DATA_REGION_OP, ARGI_DATA_REGION_OP, ACPI_TYPE_REGION, AML_CLASS_NAMED_OBJECT, AML_TYPE_NAMED_SIMPLE, AML_HAS_ARGS | AML_NSOBJECT | AML_NSOPCODE | AML_NSNODE | AML_NAMED),
/* 7D */ ACPI_OP ("[EvalSubTree]", ARGP_SCOPE_OP, ARGI_SCOPE_OP, INTERNAL_TYPE_SCOPE, AML_CLASS_NAMED_OBJECT, AML_TYPE_NAMED_NO_OBJ, AML_HAS_ARGS | AML_NSOBJECT | AML_NSOPCODE | AML_NSNODE)
/* 6E */ ACPI_OP ("QwordConst", ARGP_QWORD_OP, ARGI_QWORD_OP, ACPI_TYPE_INTEGER, AML_CLASS_ARGUMENT, AML_TYPE_LITERAL, AML_CONSTANT),
/* 6F */ ACPI_OP ("Package /*Var*/", ARGP_VAR_PACKAGE_OP, ARGI_VAR_PACKAGE_OP, ACPI_TYPE_PACKAGE, AML_CLASS_CREATE, AML_TYPE_CREATE_OBJECT, AML_HAS_ARGS | AML_DEFER),
/* 70 */ ACPI_OP ("ConcatenateResTemplate", ARGP_CONCAT_RES_OP, ARGI_CONCAT_RES_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_1T_1R, AML_FLAGS_EXEC_2A_1T_1R | AML_CONSTANT),
/* 71 */ ACPI_OP ("Mod", ARGP_MOD_OP, ARGI_MOD_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_1T_1R, AML_FLAGS_EXEC_2A_1T_1R | AML_CONSTANT),
/* 72 */ ACPI_OP ("CreateQWordField", ARGP_CREATE_QWORD_FIELD_OP,ARGI_CREATE_QWORD_FIELD_OP, ACPI_TYPE_BUFFER_FIELD, AML_CLASS_CREATE, AML_TYPE_CREATE_FIELD, AML_HAS_ARGS | AML_NSOBJECT | AML_NSNODE | AML_DEFER | AML_CREATE),
/* 73 */ ACPI_OP ("ToBuffer", ARGP_TO_BUFFER_OP, ARGI_TO_BUFFER_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_1T_1R, AML_FLAGS_EXEC_1A_1T_1R | AML_CONSTANT),
/* 74 */ ACPI_OP ("ToDecimalString", ARGP_TO_DEC_STR_OP, ARGI_TO_DEC_STR_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_1T_1R, AML_FLAGS_EXEC_1A_1T_1R | AML_CONSTANT),
/* 75 */ ACPI_OP ("ToHexString", ARGP_TO_HEX_STR_OP, ARGI_TO_HEX_STR_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_1T_1R, AML_FLAGS_EXEC_1A_1T_1R | AML_CONSTANT),
/* 76 */ ACPI_OP ("ToInteger", ARGP_TO_INTEGER_OP, ARGI_TO_INTEGER_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_1T_1R, AML_FLAGS_EXEC_1A_1T_1R | AML_CONSTANT),
/* 77 */ ACPI_OP ("ToString", ARGP_TO_STRING_OP, ARGI_TO_STRING_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_1T_1R, AML_FLAGS_EXEC_2A_1T_1R | AML_CONSTANT),
/* 78 */ ACPI_OP ("CopyObject", ARGP_COPY_OP, ARGI_COPY_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_1T_1R, AML_FLAGS_EXEC_1A_1T_1R),
/* 79 */ ACPI_OP ("Mid", ARGP_MID_OP, ARGI_MID_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_3A_1T_1R, AML_FLAGS_EXEC_3A_1T_1R | AML_CONSTANT),
/* 7A */ ACPI_OP ("Continue", ARGP_CONTINUE_OP, ARGI_CONTINUE_OP, ACPI_TYPE_ANY, AML_CLASS_CONTROL, AML_TYPE_CONTROL, 0),
/* 7B */ ACPI_OP ("LoadTable", ARGP_LOAD_TABLE_OP, ARGI_LOAD_TABLE_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_6A_0T_1R, AML_FLAGS_EXEC_6A_0T_1R),
/* 7C */ ACPI_OP ("DataTableRegion", ARGP_DATA_REGION_OP, ARGI_DATA_REGION_OP, ACPI_TYPE_REGION, AML_CLASS_NAMED_OBJECT, AML_TYPE_NAMED_SIMPLE, AML_HAS_ARGS | AML_NSOBJECT | AML_NSOPCODE | AML_NSNODE | AML_NAMED),
/* 7D */ ACPI_OP ("[EvalSubTree]", ARGP_SCOPE_OP, ARGI_SCOPE_OP, ACPI_TYPE_ANY, AML_CLASS_NAMED_OBJECT, AML_TYPE_NAMED_NO_OBJ, AML_HAS_ARGS | AML_NSOBJECT | AML_NSOPCODE | AML_NSNODE)
/*! [End] no source code translation !*/
};
......
......@@ -229,7 +229,7 @@ acpi_pci_irq_add_prt (
PCI Interrupt Routing Support
-------------------------------------------------------------------------- */
static int
int
acpi_pci_irq_lookup (
int segment,
int bus,
......@@ -285,8 +285,9 @@ acpi_pci_irq_derive (
* Attempt to derive an IRQ for this device from a parent bridge's
* PCI interrupt routing entry (a.k.a. the "bridge swizzle").
*/
while (!irq && (bridge = bridge->bus->self)) {
while (!irq && bridge->bus->self) {
pin = (pin + PCI_SLOT(bridge->devfn)) % 4;
bridge = bridge->bus->self;
irq = acpi_pci_irq_lookup(0, bridge->bus->number, PCI_SLOT(bridge->devfn), pin);
}
......
......@@ -217,7 +217,7 @@ acpi_power_on (
static int
acpi_power_off (
acpi_power_off_device (
acpi_handle handle)
{
int result = 0;
......@@ -225,7 +225,7 @@ acpi_power_off (
struct acpi_device *device = NULL;
struct acpi_power_resource *resource = NULL;
ACPI_FUNCTION_TRACE("acpi_power_off");
ACPI_FUNCTION_TRACE("acpi_power_off_device");
result = acpi_power_get_context(handle, &resource);
if (result)
......@@ -358,7 +358,7 @@ acpi_power_transition (
* Then we dereference all power resources used in the current list.
*/
for (i=0; i<cl->count; i++) {
result = acpi_power_off(cl->handles[i]);
result = acpi_power_off_device(cl->handles[i]);
if (result)
goto end;
}
......
......@@ -43,6 +43,10 @@
#include "acpi_bus.h"
#include "acpi_drivers.h"
#ifdef CONFIG_ACPI_PROCESSOR_PERF
#include <linux/cpufreq.h>
#endif
#define ACPI_PROCESSOR_COMPONENT 0x01000000
#define ACPI_PROCESSOR_CLASS "processor"
#define ACPI_PROCESSOR_DRIVER_NAME "ACPI Processor Driver"
......@@ -224,6 +228,11 @@ static struct acpi_processor *processors[NR_CPUS];
static struct acpi_processor_errata errata;
static void (*pm_idle_save)(void) = NULL;
#ifdef CONFIG_ACPI_PROCESSOR_PERF
static unsigned int cpufreq_usage_count = 0;
static struct cpufreq_driver *acpi_cpufreq_driver;
#endif
/* --------------------------------------------------------------------------
Errata Handling
......@@ -830,7 +839,7 @@ acpi_processor_get_power_info (
/* --------------------------------------------------------------------------
Performance Management
-------------------------------------------------------------------------- */
#ifdef CONFIG_ACPI_PROCESSOR_PERF
static int
acpi_processor_get_platform_limit (
struct acpi_processor* pr)
......@@ -1037,6 +1046,7 @@ acpi_processor_set_performance (
u16 port = 0;
u8 value = 0;
int i = 0;
struct cpufreq_freqs cpufreq_freqs;
ACPI_FUNCTION_TRACE("acpi_processor_set_performance");
......@@ -1068,6 +1078,14 @@ acpi_processor_set_performance (
ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Transitioning from P%d to P%d\n",
pr->performance.state, state));
/* cpufreq frequency struct */
cpufreq_freqs.cpu = pr->id;
cpufreq_freqs.old = pr->performance.states[pr->performance.state].core_frequency;
cpufreq_freqs.new = pr->performance.states[state].core_frequency;
/* notify cpufreq */
cpufreq_notify_transition(&cpufreq_freqs, CPUFREQ_PRECHANGE);
/*
* First we write the target state's 'control' value to the
* control_register.
......@@ -1101,7 +1119,15 @@ acpi_processor_set_performance (
udelay(10);
}
/* notify cpufreq */
cpufreq_notify_transition(&cpufreq_freqs, CPUFREQ_POSTCHANGE);
if (value != pr->performance.states[state].status) {
unsigned int tmp = cpufreq_freqs.new;
cpufreq_freqs.new = cpufreq_freqs.old;
cpufreq_freqs.old = tmp;
cpufreq_notify_transition(&cpufreq_freqs, CPUFREQ_PRECHANGE);
cpufreq_notify_transition(&cpufreq_freqs, CPUFREQ_POSTCHANGE);
ACPI_DEBUG_PRINT((ACPI_DB_WARN, "Transition failed\n"));
return_VALUE(-ENODEV);
}
......@@ -1155,6 +1181,23 @@ acpi_processor_get_performance_info (
return_VALUE(0);
}
#else
static int
acpi_processor_get_performance_info (
struct acpi_processor *pr)
{
ACPI_FUNCTION_TRACE("acpi_processor_get_performance_info_dummy");
if (!pr)
return_VALUE(-EINVAL);
pr->flags.performance = 0;
return_VALUE(0);
}
#endif
/* --------------------------------------------------------------------------
......@@ -1400,17 +1443,24 @@ acpi_processor_apply_limit (
if (!pr->flags.limit)
return_VALUE(-ENODEV);
#ifdef CONFIG_ACPI_PROCESSOR_PERF
if (pr->flags.performance) {
px = pr->performance.platform_limit;
if (pr->limit.user.px > px)
px = pr->limit.user.px;
if (pr->limit.thermal.px > px)
px = pr->limit.thermal.px;
result = acpi_processor_set_performance(pr, px);
{
struct cpufreq_policy policy;
policy.cpu = pr->id;
cpufreq_get_policy(&policy, pr->id);
policy.max = pr->performance.states[px].core_frequency * 1000;
result = cpufreq_set_policy(&policy);
}
if (result)
goto end;
}
#endif
if (pr->flags.throttling) {
if (pr->limit.user.tx > tx)
......@@ -1481,9 +1531,6 @@ acpi_processor_set_thermal_limit (
px = pr->limit.thermal.px;
tx = pr->limit.thermal.tx;
px = pr->limit.thermal.px;
tx = pr->limit.thermal.tx;
switch (type) {
case ACPI_PROCESSOR_LIMIT_NONE:
......@@ -1562,6 +1609,271 @@ acpi_processor_get_limit_info (
return_VALUE(0);
}
/* --------------------------------------------------------------------------
cpufreq interface
-------------------------------------------------------------------------- */
#ifdef CONFIG_ACPI_PROCESSOR_PERF
static void
acpi_cpufreq_setpolicy (
struct cpufreq_policy *policy)
{
unsigned int cpu = 0;
unsigned int i = 0;
struct acpi_processor *pr = NULL;
unsigned int next_state = 0;
unsigned int result = 0;
ACPI_FUNCTION_TRACE("acpi_cpufreq_setpolicy");
if (!policy)
return_VOID;
/* get a present, initialized CPU */
if (policy->cpu == CPUFREQ_ALL_CPUS)
{
for (i=0; i<NR_CPUS; i++) {
if (processors[i] != NULL) {
cpu = i;
pr = processors[cpu];
break;
}
}
}
else
{
cpu = policy->cpu;
pr = processors[cpu];
if (!pr)
return_VOID;
}
/* select appropriate P-State */
if (policy->policy == CPUFREQ_POLICY_POWERSAVE)
{
for (i=(pr->performance.state_count - 1); i>= pr->limit.state.px; i--)
{
unsigned int state_freq = pr->performance.states[i].core_frequency * 1000;
if ((policy->min <= state_freq) &&
(policy->max >= state_freq))
{
next_state = i;
break;
}
}
} else {
for (i=pr->limit.state.px; i < pr->performance.state_count; i++)
{
unsigned int state_freq = pr->performance.states[i].core_frequency * 1000;
if ((policy->min <= state_freq) &&
(policy->max >= state_freq))
{
next_state = i;
break;
}
}
}
/* set one or all CPUs to the new state */
if (policy->cpu == CPUFREQ_ALL_CPUS) {
for (i=0; i<NR_CPUS; i++)
{
pr = processors[cpu];
if (!pr || !cpu_online(cpu))
continue;
result = acpi_processor_set_performance (pr, next_state);
}
} else {
result = acpi_processor_set_performance (pr, next_state);
}
return_VOID;
}
static void
acpi_cpufreq_verify (
struct cpufreq_policy *policy)
{
unsigned int cpu = 0;
unsigned int i = 0;
struct acpi_processor *pr = NULL;
unsigned int number_states = 0;
unsigned int next_larger_state = 0;
ACPI_FUNCTION_TRACE("acpi_cpufreq_verify");
if (!policy)
return_VOID;
/* get a present, initialized CPU */
if (policy->cpu == CPUFREQ_ALL_CPUS)
{
for (i=0; i<NR_CPUS; i++) {
if (processors[i] != NULL) {
cpu = i;
pr = processors[cpu];
break;
}
}
}
else
{
cpu = policy->cpu;
pr = processors[cpu];
if (!pr)
return_VOID;
}
/* first check if min and max are within valid limits */
cpufreq_verify_within_limits(
policy,
pr->performance.states[pr->performance.state_count - 1].core_frequency * 1000,
pr->performance.states[pr->limit.state.px].core_frequency * 1000);
/* now check if at least one value is within this limit */
for (i=pr->limit.state.px; i < pr->performance.state_count; i++)
{
unsigned int state_freq = pr->performance.states[i].core_frequency * 1000;
if ((policy->min <= state_freq) &&
(policy->max >= state_freq))
number_states++;
if (state_freq > policy->max)
next_larger_state = i;
}
if (number_states)
return_VOID;
/* round up now */
policy->max = pr->performance.states[next_larger_state].core_frequency * 1000;
return_VOID;
}
static int
acpi_cpufreq_init (
struct acpi_processor *pr)
{
int result = 0;
int i = 0;
int current_state = 0;
struct cpufreq_driver *driver;
ACPI_FUNCTION_TRACE("acpi_cpufreq_init");
if (cpufreq_usage_count) {
if (pr->flags.performance == 1)
cpufreq_usage_count++;
return_VALUE(0);
}
/* test if it works */
current_state = pr->performance.state;
if (current_state == pr->limit.state.px) {
result = acpi_processor_set_performance(pr, (pr->performance.state_count - 1));
if (result) {
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Disabled P-States due to failure while switching.\n"));
pr->flags.performance = 0;
return_VALUE(-ENODEV);
}
}
result = acpi_processor_set_performance(pr, pr->limit.state.px);
if (result) {
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Disabled P-States due to failure while switching.\n"));
pr->flags.performance = 0;
return_VALUE(-ENODEV);
}
if (current_state != 0) {
result = acpi_processor_set_performance(pr, current_state);
if (result) {
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Disabled P-States due to failure while switching.\n"));
pr->flags.performance = 0;
return_VALUE(-ENODEV);
}
}
/* initialization of main "cpufreq" code*/
driver = kmalloc(sizeof(struct cpufreq_driver) +
NR_CPUS * sizeof(struct cpufreq_policy), GFP_KERNEL);
if (!driver)
return_VALUE(-ENOMEM);
driver->policy = (struct cpufreq_policy *) (driver + 1);
#ifdef CONFIG_CPU_FREQ_24_API
driver->cpu_min_freq = pr->performance.states[pr->performance.state_count - 1].core_frequency * 1000;
for (i=0;i<NR_CPUS;i++)
driver->cpu_cur_freq[0] = pr->performance.states[current_state].core_frequency * 1000;
#endif
driver->verify = &acpi_cpufreq_verify;
driver->setpolicy = &acpi_cpufreq_setpolicy;
for (i=0;i<NR_CPUS;i++) {
driver->policy[i].cpu = pr->id;
driver->policy[i].min = pr->performance.states[pr->performance.state_count - 1].core_frequency * 1000;
driver->policy[i].max = pr->performance.states[pr->limit.state.px].core_frequency * 1000;
driver->policy[i].max_cpu_freq = pr->performance.states[0].core_frequency * 1000;
driver->policy[i].policy = ( pr->performance.states[current_state].core_frequency * 1000 == driver->policy[i].max) ?
CPUFREQ_POLICY_PERFORMANCE : CPUFREQ_POLICY_POWERSAVE;
}
acpi_cpufreq_driver = driver;
result = cpufreq_register(driver);
if (result) {
kfree(driver);
acpi_cpufreq_driver = NULL;
return_VALUE(result);
}
cpufreq_usage_count++;
return_VALUE(0);
}
static int
acpi_cpufreq_exit (
struct acpi_processor *pr)
{
int result = 0;
ACPI_FUNCTION_TRACE("acpi_cpufreq_exit");
if (!pr)
return_VALUE(-EINVAL);
if (pr->flags.performance)
cpufreq_usage_count--;
if (!cpufreq_usage_count) {
ACPI_DEBUG_PRINT((ACPI_DB_INFO,
"Removing cpufreq driver\n"));
result = cpufreq_unregister();
}
return_VALUE(result);
}
#else
static int
acpi_cpufreq_init (
struct acpi_processor *pr)
{
ACPI_FUNCTION_TRACE("acpi_cpufreq_init_dummy");
return_VALUE(0);
}
static int
acpi_cpufreq_exit (
struct acpi_processor *pr)
{
ACPI_FUNCTION_TRACE("acpi_cpufreq_exit_dummy");
return_VALUE(0);
}
#endif
/* --------------------------------------------------------------------------
FS Interface (/proc)
......@@ -1688,7 +2000,7 @@ acpi_processor_read_power (
return_VALUE(len);
}
#ifdef CONFIG_ACPI_PROCESSOR_PERF
static int
acpi_processor_read_performance (
char *page,
......@@ -1739,7 +2051,6 @@ acpi_processor_read_performance (
return_VALUE(len);
}
static int
acpi_processor_write_performance (
struct file *file,
......@@ -1750,6 +2061,8 @@ acpi_processor_write_performance (
int result = 0;
struct acpi_processor *pr = (struct acpi_processor *) data;
char state_string[12] = {'\0'};
unsigned int new_state = 0;
struct cpufreq_policy policy;
ACPI_FUNCTION_TRACE("acpi_processor_write_performance");
......@@ -1760,14 +2073,20 @@ acpi_processor_write_performance (
return_VALUE(-EFAULT);
state_string[count] = '\0';
new_state = simple_strtoul(state_string, NULL, 0);
result = acpi_processor_set_performance(pr,
simple_strtoul(state_string, NULL, 0));
cpufreq_get_policy(&policy, pr->id);
policy.cpu = pr->id;
policy.max = pr->performance.states[new_state].core_frequency * 1000;
result = cpufreq_set_policy(&policy);
if (result)
return_VALUE(result);
return_VALUE(count);
}
#endif
static int
......@@ -2005,6 +2324,7 @@ acpi_processor_add_fs (
entry->data = acpi_driver_data(device);
}
#ifdef CONFIG_ACPI_PROCESSOR_PERF
/* 'performance' [R/W] */
entry = create_proc_entry(ACPI_PROCESSOR_FILE_PERFORMANCE,
S_IFREG|S_IRUGO|S_IWUSR, acpi_device_dir(device));
......@@ -2017,6 +2337,7 @@ acpi_processor_add_fs (
entry->write_proc = acpi_processor_write_performance;
entry->data = acpi_driver_data(device);
}
#endif
/* 'throttling' [R/W] */
entry = create_proc_entry(ACPI_PROCESSOR_FILE_THROTTLING,
......@@ -2139,6 +2460,7 @@ acpi_processor_get_info (
acpi_processor_get_power_info(pr);
acpi_processor_get_performance_info(pr);
acpi_cpufreq_init(pr);
acpi_processor_get_throttling_info(pr);
acpi_processor_get_limit_info(pr);
......@@ -2166,9 +2488,15 @@ acpi_processor_notify (
switch (event) {
case ACPI_PROCESSOR_NOTIFY_PERFORMANCE:
#ifdef CONFIG_ACPI_PROCESSOR_PERF
result = acpi_processor_get_platform_limit(pr);
if (!result)
acpi_processor_apply_limit(pr);
#else
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
"Please use kernel with Processor Performance States support included!\n"));
result = 0;
#endif
acpi_bus_generate_event(device, event,
pr->performance.platform_limit);
......@@ -2288,6 +2616,7 @@ acpi_processor_remove (
return_VALUE(-ENODEV);
}
acpi_cpufreq_exit(pr);
acpi_processor_remove_fs(device);
processors[pr->id] = NULL;
......
/*******************************************************************************
*
* Module Name: rscalc - Calculate stream and list lengths
* $Revision: 43 $
* $Revision: 44 $
*
******************************************************************************/
......@@ -771,7 +771,7 @@ acpi_rs_get_pci_routing_table_length (
for (table_index = 0; table_index < 4 && !name_found; table_index++) {
if ((ACPI_TYPE_STRING == ACPI_GET_OBJECT_TYPE (*sub_object_list)) ||
((INTERNAL_TYPE_REFERENCE == ACPI_GET_OBJECT_TYPE (*sub_object_list)) &&
((ACPI_TYPE_LOCAL_REFERENCE == ACPI_GET_OBJECT_TYPE (*sub_object_list)) &&
((*sub_object_list)->reference.opcode == AML_INT_NAMEPATH_OP))) {
name_found = TRUE;
}
......
/*******************************************************************************
*
* Module Name: rscreate - Create resource lists/tables
* $Revision: 58 $
* $Revision: 61 $
*
******************************************************************************/
......@@ -66,7 +66,8 @@ acpi_rs_create_resource_list (
ACPI_FUNCTION_TRACE ("Rs_create_resource_list");
ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Byte_stream_buffer = %p\n", byte_stream_buffer));
ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Byte_stream_buffer = %p\n",
byte_stream_buffer));
/*
* Params already validated, so we don't re-validate here
......@@ -135,13 +136,13 @@ acpi_rs_create_pci_routing_table (
acpi_buffer *output_buffer)
{
u8 *buffer;
acpi_operand_object **top_object_list = NULL;
acpi_operand_object **sub_object_list = NULL;
acpi_operand_object *package_element = NULL;
acpi_operand_object **top_object_list;
acpi_operand_object **sub_object_list;
acpi_operand_object *obj_desc;
ACPI_SIZE buffer_size_needed = 0;
u32 number_of_elements = 0;
u32 index = 0;
acpi_pci_routing_table *user_prt = NULL;
u32 number_of_elements;
u32 index;
acpi_pci_routing_table *user_prt;
acpi_namespace_node *node;
acpi_status status;
acpi_buffer path_buffer;
......@@ -161,7 +162,8 @@ acpi_rs_create_pci_routing_table (
return_ACPI_STATUS (status);
}
ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Buffer_size_needed = %X\n", (u32) buffer_size_needed));
ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Buffer_size_needed = %X\n",
(u32) buffer_size_needed));
/* Validate/Allocate/Clear caller buffer */
......@@ -171,7 +173,8 @@ acpi_rs_create_pci_routing_table (
}
/*
* Loop through the ACPI_INTERNAL_OBJECTS - Each object should contain an
* Loop through the ACPI_INTERNAL_OBJECTS - Each object
* should be a package that in turn contains an
* acpi_integer Address, a u8 Pin, a Name and a u8 Source_index.
*/
top_object_list = package_object->package.elements;
......@@ -194,81 +197,98 @@ acpi_rs_create_pci_routing_table (
* The minus four is to subtract the size of the u8 Source[4] member
* because it is added below.
*/
user_prt->length = (sizeof (acpi_pci_routing_table) -4);
user_prt->length = (sizeof (acpi_pci_routing_table) - 4);
/*
* Dereference the sub-package
* Each element of the top-level package must also be a package
*/
package_element = *top_object_list;
if (ACPI_GET_OBJECT_TYPE (*top_object_list) != ACPI_TYPE_PACKAGE) {
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
"(PRT[%X]) Need sub-package, found %s\n",
index, acpi_ut_get_object_type_name (*top_object_list)));
return_ACPI_STATUS (AE_AML_OPERAND_TYPE);
}
/* Each sub-package must be of length 4 */
if ((*top_object_list)->package.count != 4) {
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
"(PRT[%X]) Need package of length 4, found length %d\n",
index, (*top_object_list)->package.count));
return_ACPI_STATUS (AE_AML_PACKAGE_LIMIT);
}
/*
* Dereference the sub-package.
* The Sub_object_list will now point to an array of the four IRQ
* elements: Address, Pin, Source and Source_index
* elements: [Address, Pin, Source, Source_index]
*/
sub_object_list = package_element->package.elements;
sub_object_list = (*top_object_list)->package.elements;
/*
* 1) First subobject: Dereference the Address
* 1) First subobject: Dereference the PRT.Address
*/
if (ACPI_GET_OBJECT_TYPE (*sub_object_list) == ACPI_TYPE_INTEGER) {
user_prt->address = (*sub_object_list)->integer.value;
obj_desc = sub_object_list[0];
if (ACPI_GET_OBJECT_TYPE (obj_desc) == ACPI_TYPE_INTEGER) {
user_prt->address = obj_desc->integer.value;
}
else {
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Need Integer, found %s\n",
acpi_ut_get_object_type_name (*sub_object_list)));
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
"(PRT[%X].Address) Need Integer, found %s\n",
index, acpi_ut_get_object_type_name (obj_desc)));
return_ACPI_STATUS (AE_BAD_DATA);
}
/*
* 2) Second subobject: Dereference the Pin
* 2) Second subobject: Dereference the PRT.Pin
*/
sub_object_list++;
if (ACPI_GET_OBJECT_TYPE (*sub_object_list) == ACPI_TYPE_INTEGER) {
user_prt->pin = (u32) (*sub_object_list)->integer.value;
obj_desc = sub_object_list[1];
if (ACPI_GET_OBJECT_TYPE (obj_desc) == ACPI_TYPE_INTEGER) {
user_prt->pin = (u32) obj_desc->integer.value;
}
else {
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Need Integer, found %s\n",
acpi_ut_get_object_type_name (*sub_object_list)));
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
"(PRT[%X].Pin) Need Integer, found %s\n",
index, acpi_ut_get_object_type_name (obj_desc)));
return_ACPI_STATUS (AE_BAD_DATA);
}
/*
* 3) Third subobject: Dereference the Source Name
* 3) Third subobject: Dereference the PRT.Source_name
*/
sub_object_list++;
switch (ACPI_GET_OBJECT_TYPE (*sub_object_list)) {
case INTERNAL_TYPE_REFERENCE:
if ((*sub_object_list)->reference.opcode != AML_INT_NAMEPATH_OP) {
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Need name, found reference op %X\n",
(*sub_object_list)->reference.opcode));
obj_desc = sub_object_list[2];
switch (ACPI_GET_OBJECT_TYPE (obj_desc)) {
case ACPI_TYPE_LOCAL_REFERENCE:
if (obj_desc->reference.opcode != AML_INT_NAMEPATH_OP) {
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
"(PRT[%X].Source) Need name, found reference op %X\n",
index, obj_desc->reference.opcode));
return_ACPI_STATUS (AE_BAD_DATA);
}
node = (*sub_object_list)->reference.node;
node = obj_desc->reference.node;
/* Use *remaining* length of the buffer as max for pathname */
path_buffer.length = output_buffer->length -
(u32) ((u8 *) user_prt->source - (u8 *) output_buffer->pointer);
(u32) ((u8 *) user_prt->source -
(u8 *) output_buffer->pointer);
path_buffer.pointer = user_prt->source;
status = acpi_ns_handle_to_pathname ((acpi_handle) node, &path_buffer);
user_prt->length += ACPI_STRLEN (user_prt->source) + 1; /* include null terminator */
user_prt->length += (u32) ACPI_STRLEN (user_prt->source) + 1; /* include null terminator */
break;
case ACPI_TYPE_STRING:
ACPI_STRCPY (user_prt->source,
(*sub_object_list)->string.pointer);
ACPI_STRCPY (user_prt->source, obj_desc->string.pointer);
/* Add to the Length field the length of the string */
user_prt->length += (*sub_object_list)->string.length;
user_prt->length += obj_desc->string.length;
break;
......@@ -285,8 +305,9 @@ acpi_rs_create_pci_routing_table (
default:
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Need Integer, found %s\n",
acpi_ut_get_object_type_name (*sub_object_list)));
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
"(PRT[%X].Source) Need Ref/String/Integer, found %s\n",
index, acpi_ut_get_object_type_name (obj_desc)));
return_ACPI_STATUS (AE_BAD_DATA);
}
......@@ -295,20 +316,20 @@ acpi_rs_create_pci_routing_table (
user_prt->length = ACPI_ROUND_UP_TO_64_bITS (user_prt->length);
/*
* 4) Fourth subobject: Dereference the Source Index
* 4) Fourth subobject: Dereference the PRT.Source_index
*/
sub_object_list++;
if (ACPI_GET_OBJECT_TYPE (*sub_object_list) == ACPI_TYPE_INTEGER) {
user_prt->source_index = (u32) (*sub_object_list)->integer.value;
obj_desc = sub_object_list[3];
if (ACPI_GET_OBJECT_TYPE (obj_desc) == ACPI_TYPE_INTEGER) {
user_prt->source_index = (u32) obj_desc->integer.value;
}
else {
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Need Integer, found %s\n",
acpi_ut_get_object_type_name (*sub_object_list)));
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
"(PRT[%X].Source_index) Need Integer, found %s\n",
index, acpi_ut_get_object_type_name (obj_desc)));
return_ACPI_STATUS (AE_BAD_DATA);
}
/* Point to the next acpi_operand_object */
/* Point to the next acpi_operand_object in the top level package */
top_object_list++;
}
......@@ -349,7 +370,8 @@ acpi_rs_create_byte_stream (
ACPI_FUNCTION_TRACE ("Rs_create_byte_stream");
ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Linked_list_buffer = %p\n", linked_list_buffer));
ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Linked_list_buffer = %p\n",
linked_list_buffer));
/*
* Params already validated, so we don't re-validate here
......
/******************************************************************************
*
* Module Name: tbconvrt - ACPI Table conversion utilities
* $Revision: 43 $
* $Revision: 44 $
*
*****************************************************************************/
......@@ -137,7 +137,6 @@ acpi_tb_convert_to_xsdt (
/* Point the table descriptor to the new table */
table_info->pointer = (acpi_table_header *) new_table;
table_info->base_pointer = (acpi_table_header *) new_table;
table_info->length = table_size;
table_info->allocation = ACPI_MEM_ALLOCATED;
......@@ -385,7 +384,6 @@ acpi_tb_convert_table_fadt (void)
/* Install the new table */
table_desc->pointer = (acpi_table_header *) acpi_gbl_FADT;
table_desc->base_pointer = acpi_gbl_FADT;
table_desc->allocation = ACPI_MEM_ALLOCATED;
table_desc->length = sizeof (fadt_descriptor_rev2);
......
/******************************************************************************
*
* Module Name: tbget - ACPI Table get* routines
* $Revision: 80 $
* $Revision: 81 $
*
*****************************************************************************/
......@@ -386,7 +386,6 @@ acpi_tb_get_this_table (
table_info->pointer = full_table;
table_info->length = (ACPI_SIZE) header->length;
table_info->allocation = allocation;
table_info->base_pointer = full_table;
ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
"Found table [%4.4s] at %8.8X%8.8X, mapped/copied to %p\n",
......
/******************************************************************************
*
* Module Name: tbgetall - Get all required ACPI tables
* $Revision: 2 $
* $Revision: 3 $
*
*****************************************************************************/
......@@ -218,7 +218,13 @@ acpi_tb_get_required_tables (
* Get the tables needed by this subsystem (FADT and any SSDTs).
* NOTE: All other tables are completely ignored at this time.
*/
acpi_tb_get_primary_table (&address, &table_info);
status = acpi_tb_get_primary_table (&address, &table_info);
if ((status != AE_OK) && (status != AE_TABLE_NOT_SUPPORTED)) {
ACPI_REPORT_WARNING (("%s, while getting table at %8.8X%8.8X\n",
acpi_format_exception (status),
ACPI_HIDWORD (address.pointer.value),
ACPI_LODWORD (address.pointer.value)));
}
}
/* We must have a FADT to continue */
......
/******************************************************************************
*
* Module Name: tbinstal - ACPI table installation and removal
* $Revision: 63 $
* $Revision: 64 $
*
*****************************************************************************/
......@@ -286,7 +286,6 @@ acpi_tb_init_table_descriptor (
table_desc->type = table_info->type;
table_desc->pointer = table_info->pointer;
table_desc->base_pointer = table_info->base_pointer;
table_desc->length = table_info->length;
table_desc->allocation = table_info->allocation;
table_desc->aml_start = (u8 *) (table_desc->pointer + 1),
......@@ -480,12 +479,12 @@ acpi_tb_delete_single_table (
case ACPI_MEM_ALLOCATED:
ACPI_MEM_FREE (table_desc->base_pointer);
ACPI_MEM_FREE (table_desc->pointer);
break;
case ACPI_MEM_MAPPED:
acpi_os_unmap_memory (table_desc->base_pointer, table_desc->length);
acpi_os_unmap_memory (table_desc->pointer, table_desc->length);
break;
default:
......
/******************************************************************************
*
* Module Name: tbrsdt - ACPI RSDT table utilities
* $Revision: 3 $
* $Revision: 4 $
*
*****************************************************************************/
......@@ -108,7 +108,6 @@ acpi_tb_verify_rsdp (
table_info.pointer = ACPI_CAST_PTR (acpi_table_header, rsdp);
table_info.length = sizeof (RSDP_DESCRIPTOR);
table_info.allocation = ACPI_MEM_MAPPED;
table_info.base_pointer = rsdp;
/* Save the table pointers and allocation info */
......
/******************************************************************************
*
* Module Name: utcopy - Internal to external object translation utilities
* $Revision: 104 $
* $Revision: 105 $
*
*****************************************************************************/
......@@ -113,7 +113,7 @@ acpi_ut_copy_isimple_to_esimple (
break;
case INTERNAL_TYPE_REFERENCE:
case ACPI_TYPE_LOCAL_REFERENCE:
/*
* This is an object reference. Attempt to dereference it.
......
/*******************************************************************************
*
* Module Name: utdelete - object deletion and reference count utilities
* $Revision: 91 $
* $Revision: 92 $
*
******************************************************************************/
......@@ -417,7 +417,7 @@ acpi_ut_update_object_reference (
break;
case INTERNAL_TYPE_ADDRESS_HANDLER:
case ACPI_TYPE_LOCAL_ADDRESS_HANDLER:
/* Must walk list of address handlers */
......@@ -462,7 +462,7 @@ acpi_ut_update_object_reference (
break;
case INTERNAL_TYPE_REGION_FIELD:
case ACPI_TYPE_LOCAL_REGION_FIELD:
status = acpi_ut_create_update_state_and_push (
object->field.region_obj, action, &state_list);
......@@ -472,7 +472,7 @@ acpi_ut_update_object_reference (
break;
case INTERNAL_TYPE_BANK_FIELD:
case ACPI_TYPE_LOCAL_BANK_FIELD:
status = acpi_ut_create_update_state_and_push (
object->bank_field.bank_obj, action, &state_list);
......@@ -488,7 +488,7 @@ acpi_ut_update_object_reference (
break;
case INTERNAL_TYPE_INDEX_FIELD:
case ACPI_TYPE_LOCAL_INDEX_FIELD:
status = acpi_ut_create_update_state_and_push (
object->index_field.index_obj, action, &state_list);
......@@ -505,7 +505,7 @@ acpi_ut_update_object_reference (
case ACPI_TYPE_REGION:
case INTERNAL_TYPE_REFERENCE:
case ACPI_TYPE_LOCAL_REFERENCE:
default:
/* No subobjects */
......
/******************************************************************************
*
* Module Name: utglobal - Global variables for the ACPI subsystem
* $Revision: 171 $
* $Revision: 172 $
*
*****************************************************************************/
......@@ -176,11 +176,11 @@ const NATIVE_CHAR *acpi_gbl_db_sleep_states[ACPI_NUM_SLEEP_STATES] = {
*/
const acpi_predefined_names acpi_gbl_pre_defined_names[] =
{ {"_GPE", INTERNAL_TYPE_SCOPE, NULL},
{"_PR_", INTERNAL_TYPE_SCOPE, NULL},
{ {"_GPE", ACPI_TYPE_LOCAL_SCOPE, NULL},
{"_PR_", ACPI_TYPE_LOCAL_SCOPE, NULL},
{"_SB_", ACPI_TYPE_DEVICE, NULL},
{"_SI_", INTERNAL_TYPE_SCOPE, NULL},
{"_TZ_", INTERNAL_TYPE_SCOPE, NULL},
{"_SI_", ACPI_TYPE_LOCAL_SCOPE, NULL},
{"_TZ_", ACPI_TYPE_LOCAL_SCOPE, NULL},
{"_REV", ACPI_TYPE_INTEGER, "2"},
{"_OS_", ACPI_TYPE_STRING, ACPI_OS_NAME},
{"_GL_", ACPI_TYPE_MUTEX, "0"},
......@@ -225,17 +225,10 @@ const u8 acpi_gbl_ns_properties[] =
ACPI_NS_NORMAL, /* 23 Address Handler */
ACPI_NS_NEWSCOPE | ACPI_NS_LOCAL, /* 24 Resource Desc */
ACPI_NS_NEWSCOPE | ACPI_NS_LOCAL, /* 25 Resource Field */
ACPI_NS_NORMAL, /* 26 Def_field_defn */
ACPI_NS_NORMAL, /* 27 Bank_field_defn */
ACPI_NS_NORMAL, /* 28 Index_field_defn */
ACPI_NS_NORMAL, /* 29 If */
ACPI_NS_NORMAL, /* 30 Else */
ACPI_NS_NORMAL, /* 31 While */
ACPI_NS_NEWSCOPE, /* 32 Scope */
ACPI_NS_LOCAL, /* 33 Def_any */
ACPI_NS_NORMAL, /* 34 Extra */
ACPI_NS_NORMAL, /* 35 Data */
ACPI_NS_NORMAL /* 36 Invalid */
ACPI_NS_NEWSCOPE, /* 26 Scope */
ACPI_NS_NORMAL, /* 27 Extra */
ACPI_NS_NORMAL, /* 28 Data */
ACPI_NS_NORMAL /* 29 Invalid */
};
......@@ -481,17 +474,10 @@ static const NATIVE_CHAR *acpi_gbl_ns_type_names[] = /* printable names of AC
/* 23 */ "Addr_handler",
/* 24 */ "Resource_desc",
/* 25 */ "Resource_fld",
/* 26 */ "Region_fld_dfn",
/* 27 */ "Bank_fld_dfn",
/* 28 */ "Index_fld_dfn",
/* 29 */ "If",
/* 30 */ "Else",
/* 31 */ "While",
/* 32 */ "Scope",
/* 33 */ "Def_any",
/* 34 */ "Extra",
/* 35 */ "Data",
/* 36 */ "Invalid"
/* 26 */ "Scope",
/* 27 */ "Extra",
/* 28 */ "Data",
/* 39 */ "Invalid"
};
......@@ -500,7 +486,7 @@ acpi_ut_get_type_name (
acpi_object_type type)
{
if (type > INTERNAL_TYPE_INVALID)
if (type > ACPI_TYPE_INVALID)
{
return ((NATIVE_CHAR *) acpi_gbl_bad_type);
}
......@@ -563,7 +549,7 @@ acpi_ut_get_mutex_name (
*
* FUNCTION: Acpi_ut_valid_object_type
*
* PARAMETERS: None.
* PARAMETERS: Type - Object type to be validated
*
* RETURN: TRUE if valid object type
*
......@@ -576,13 +562,11 @@ acpi_ut_valid_object_type (
acpi_object_type type)
{
if (type > ACPI_TYPE_MAX)
if (type > ACPI_TYPE_LOCAL_MAX)
{
if ((type < INTERNAL_TYPE_BEGIN) ||
(type > INTERNAL_TYPE_MAX))
{
return (FALSE);
}
/* Note: Assumes all TYPEs are contiguous (external/local) */
return (FALSE);
}
return (TRUE);
......@@ -767,7 +751,7 @@ acpi_ut_init_globals (
acpi_gbl_root_node_struct.name.integer = ACPI_ROOT_NAME;
acpi_gbl_root_node_struct.descriptor = ACPI_DESC_TYPE_NAMED;
acpi_gbl_root_node_struct.type = ACPI_TYPE_ANY;
acpi_gbl_root_node_struct.type = ACPI_TYPE_DEVICE;
acpi_gbl_root_node_struct.child = NULL;
acpi_gbl_root_node_struct.peer = NULL;
acpi_gbl_root_node_struct.object = NULL;
......
/*******************************************************************************
*
* Module Name: utmisc - common utility procedures
* $Revision: 84 $
* $Revision: 85 $
*
******************************************************************************/
......@@ -32,6 +32,98 @@
ACPI_MODULE_NAME ("utmisc")
/*******************************************************************************
*
* FUNCTION: Acpi_ut_print_string
*
* PARAMETERS: String - Null terminated ASCII string
*
* RETURN: None
*
* DESCRIPTION: Dump an ASCII string with support for ACPI-defined escape
* sequences.
*
******************************************************************************/
void
acpi_ut_print_string (
char *string,
u8 max_length)
{
u32 i;
if (!string) {
acpi_os_printf ("<\"NULL STRING PTR\">");
return;
}
acpi_os_printf ("\"");
for (i = 0; string[i] && (i < max_length); i++) {
/* Escape sequences */
switch (string[i]) {
case 0x07:
acpi_os_printf ("\\a"); /* BELL */
break;
case 0x08:
acpi_os_printf ("\\b"); /* BACKSPACE */
break;
case 0x0C:
acpi_os_printf ("\\f"); /* FORMFEED */
break;
case 0x0A:
acpi_os_printf ("\\n"); /* LINEFEED */
break;
case 0x0D:
acpi_os_printf ("\\r"); /* CARRIAGE RETURN*/
break;
case 0x09:
acpi_os_printf ("\\t"); /* HORIZONTAL TAB */
break;
case 0x0B:
acpi_os_printf ("\\v"); /* VERTICAL TAB */
break;
case '\'': /* Single Quote */
case '\"': /* Double Quote */
case '\\': /* Backslash */
acpi_os_printf ("\\%c", (int) string[i]);
break;
default:
/* Check for printable character or hex escape */
if (ACPI_IS_PRINT (string[i]))
{
/* This is a normal character */
acpi_os_printf ("%c", (int) string[i]);
}
else
{
/* All others will be Hex escapes */
acpi_os_printf ("\\x%2.2X", (s32) string[i]);
}
break;
}
}
acpi_os_printf ("\"");
if (i == max_length && string[i]) {
acpi_os_printf ("...");
}
}
/*******************************************************************************
*
* FUNCTION: Acpi_ut_dword_byte_swap
......
/******************************************************************************
*
* Module Name: utobject - ACPI object create/delete/size/cache routines
* $Revision: 76 $
* $Revision: 77 $
*
*****************************************************************************/
......@@ -87,7 +87,7 @@ acpi_ut_create_internal_object_dbg (
return_PTR (NULL);
}
second_object->common.type = INTERNAL_TYPE_EXTRA;
second_object->common.type = ACPI_TYPE_LOCAL_EXTRA;
second_object->common.reference_count = 1;
/* Link the second object to the first */
......@@ -352,7 +352,7 @@ acpi_ut_get_simple_object_size (
break;
case INTERNAL_TYPE_REFERENCE:
case ACPI_TYPE_LOCAL_REFERENCE:
switch (internal_object->reference.opcode) {
case AML_INT_NAMEPATH_OP:
......
......@@ -90,7 +90,7 @@ struct acpi_table_header {
typedef struct {
u8 type;
u8 length;
} acpi_table_entry_header __attribute__ ((packed));
} __attribute__ ((packed)) acpi_table_entry_header;
/* Root System Description Table (RSDT) */
......@@ -143,7 +143,7 @@ typedef struct {
u16 polarity:2;
u16 trigger:2;
u16 reserved:12;
} acpi_interrupt_flags __attribute__ ((packed));
} __attribute__ ((packed)) acpi_interrupt_flags;
struct acpi_table_lapic {
acpi_table_entry_header header;
......@@ -330,7 +330,7 @@ struct acpi_table_ecdt {
acpi_generic_address ec_data;
u32 uid;
u8 gpe_bit;
char *ec_id;
char ec_id[0];
} __attribute__ ((packed));
/* Table Handlers */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment