mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-31 04:01:48 -04:00
[ACPI] merge 3549 4320 4485 4588 4980 5483 5651 acpica asus fops pnpacpi branches into release
Signed-off-by: Len Brown <[email protected]>
This commit is contained in:
parent
3ee68c4af3
876c184b31
729b4d4ce1
cf82478840
dacd9b8035
63c94b68ec
35f652b5ef
1a38416cea
4a90c7e862
aea19aa078
757b18661e
c4bb6f5ad9
commit
9fdb62af92
198 changed files with 7811 additions and 8148 deletions
|
|
@ -267,7 +267,6 @@ config ACPI_DEBUG
|
|||
|
||||
config ACPI_EC
|
||||
bool
|
||||
depends on X86
|
||||
default y
|
||||
help
|
||||
This driver is required on some systems for the proper operation of
|
||||
|
|
|
|||
|
|
@ -71,8 +71,8 @@ static struct acpi_driver acpi_memory_device_driver = {
|
|||
struct acpi_memory_device {
|
||||
acpi_handle handle;
|
||||
unsigned int state; /* State of the memory device */
|
||||
unsigned short cache_attribute; /* memory cache attribute */
|
||||
unsigned short read_write_attribute; /* memory read/write attribute */
|
||||
unsigned short caching; /* memory cache attribute */
|
||||
unsigned short write_protect; /* memory read/write attribute */
|
||||
u64 start_addr; /* Memory Range start physical addr */
|
||||
u64 end_addr; /* Memory Range end physical addr */
|
||||
};
|
||||
|
|
@ -97,12 +97,12 @@ acpi_memory_get_device_resources(struct acpi_memory_device *mem_device)
|
|||
if (ACPI_SUCCESS(status)) {
|
||||
if (address64.resource_type == ACPI_MEMORY_RANGE) {
|
||||
/* Populate the structure */
|
||||
mem_device->cache_attribute =
|
||||
address64.attribute.memory.cache_attribute;
|
||||
mem_device->read_write_attribute =
|
||||
address64.attribute.memory.read_write_attribute;
|
||||
mem_device->start_addr = address64.min_address_range;
|
||||
mem_device->end_addr = address64.max_address_range;
|
||||
mem_device->caching =
|
||||
address64.info.mem.caching;
|
||||
mem_device->write_protect =
|
||||
address64.info.mem.write_protect;
|
||||
mem_device->start_addr = address64.minimum;
|
||||
mem_device->end_addr = address64.maximum;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -250,7 +250,6 @@ static int acpi_memory_disable_device(struct acpi_memory_device *mem_device)
|
|||
int result;
|
||||
u64 start = mem_device->start_addr;
|
||||
u64 len = mem_device->end_addr - start + 1;
|
||||
unsigned long attr = mem_device->read_write_attribute;
|
||||
|
||||
ACPI_FUNCTION_TRACE("acpi_memory_disable_device");
|
||||
|
||||
|
|
|
|||
|
|
@ -78,9 +78,9 @@ MODULE_LICENSE("GPL");
|
|||
static uid_t asus_uid;
|
||||
static gid_t asus_gid;
|
||||
module_param(asus_uid, uint, 0);
|
||||
MODULE_PARM_DESC(uid, "UID for entries in /proc/acpi/asus.\n");
|
||||
MODULE_PARM_DESC(asus_uid, "UID for entries in /proc/acpi/asus.\n");
|
||||
module_param(asus_gid, uint, 0);
|
||||
MODULE_PARM_DESC(gid, "GID for entries in /proc/acpi/asus.\n");
|
||||
MODULE_PARM_DESC(asus_gid, "GID for entries in /proc/acpi/asus.\n");
|
||||
|
||||
/* For each model, all features implemented,
|
||||
* those marked with R are relative to HOTK, A for absolute */
|
||||
|
|
@ -302,7 +302,7 @@ static struct model_data model_conf[END_MODEL] = {
|
|||
.brightness_set = "SPLV",
|
||||
.brightness_get = "GPLV",
|
||||
.display_set = "SDSP",
|
||||
.display_get = "\\SSTE"},
|
||||
.display_get = "\\_SB.PCI0.P0P1.VGA.GETD"},
|
||||
{
|
||||
.name = "M6R",
|
||||
.mt_mled = "MLED",
|
||||
|
|
@ -851,6 +851,8 @@ static int __init asus_hotk_add_fs(struct acpi_device *device)
|
|||
mode = S_IFREG | S_IRUGO | S_IWUGO;
|
||||
} else {
|
||||
mode = S_IFREG | S_IRUSR | S_IRGRP | S_IWUSR | S_IWGRP;
|
||||
printk(KERN_WARNING " asus_uid and asus_gid parameters are "
|
||||
"deprecated, use chown and chmod instead!\n");
|
||||
}
|
||||
|
||||
acpi_device_dir(device) = asus_proc_dir;
|
||||
|
|
@ -987,9 +989,21 @@ static int __init asus_hotk_get_info(void)
|
|||
printk(KERN_NOTICE " BSTS called, 0x%02x returned\n",
|
||||
bsts_result);
|
||||
|
||||
/* Samsung P30 has a device with a valid _HID whose INIT does not
|
||||
* return anything. Catch this one and any similar here */
|
||||
if (buffer.pointer == NULL) {
|
||||
/* This is unlikely with implicit return */
|
||||
if (buffer.pointer == NULL)
|
||||
return -EINVAL;
|
||||
|
||||
model = (union acpi_object *) buffer.pointer;
|
||||
/*
|
||||
* Samsung P30 has a device with a valid _HID whose INIT does not
|
||||
* return anything. It used to be possible to catch this exception,
|
||||
* but the implicit return code will now happily confuse the
|
||||
* driver. We assume that every ACPI_TYPE_STRING is a valid model
|
||||
* identifier but it's still possible to get completely bogus data.
|
||||
*/
|
||||
if (model->type == ACPI_TYPE_STRING) {
|
||||
printk(KERN_NOTICE " %s model detected, ", model->string.pointer);
|
||||
} else {
|
||||
if (asus_info && /* Samsung P30 */
|
||||
strncmp(asus_info->oem_table_id, "ODEM", 4) == 0) {
|
||||
hotk->model = P30;
|
||||
|
|
@ -1002,13 +1016,10 @@ static int __init asus_hotk_get_info(void)
|
|||
"the developers with your DSDT\n");
|
||||
}
|
||||
hotk->methods = &model_conf[hotk->model];
|
||||
return AE_OK;
|
||||
}
|
||||
|
||||
acpi_os_free(model);
|
||||
|
||||
model = (union acpi_object *)buffer.pointer;
|
||||
if (model->type == ACPI_TYPE_STRING) {
|
||||
printk(KERN_NOTICE " %s model detected, ",
|
||||
model->string.pointer);
|
||||
return AE_OK;
|
||||
}
|
||||
|
||||
hotk->model = END_MODEL;
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
*****************************************************************************/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2000 - 2005, R. Byron Moore
|
||||
* Copyright (C) 2000 - 2006, R. Byron Moore
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
|
@ -293,7 +293,7 @@ acpi_ds_get_field_names(struct acpi_create_field_info *info,
|
|||
+ (acpi_integer) arg->common.value.size;
|
||||
|
||||
if (position > ACPI_UINT32_MAX) {
|
||||
ACPI_REPORT_ERROR(("Field [%4.4s] bit offset too large (> 0xFFFFFFFF)\n", (char *)&info->field_node->name));
|
||||
ACPI_REPORT_ERROR(("Field [%4.4s] bit offset too large (> 0xFFFFFFFF)\n", ACPI_CAST_PTR(char, &info->field_node->name)));
|
||||
return_ACPI_STATUS(AE_SUPPORT);
|
||||
}
|
||||
|
||||
|
|
@ -302,9 +302,8 @@ acpi_ds_get_field_names(struct acpi_create_field_info *info,
|
|||
|
||||
default:
|
||||
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
||||
"Invalid opcode in field list: %X\n",
|
||||
arg->common.aml_opcode));
|
||||
ACPI_REPORT_ERROR(("Invalid opcode in field list: %X\n",
|
||||
arg->common.aml_opcode));
|
||||
return_ACPI_STATUS(AE_AML_BAD_OPCODE);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
*****************************************************************************/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2000 - 2005, R. Byron Moore
|
||||
* Copyright (C) 2000 - 2006, R. Byron Moore
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
|
@ -84,7 +84,7 @@ acpi_ds_init_one_object(acpi_handle obj_handle,
|
|||
acpi_object_type type;
|
||||
acpi_status status;
|
||||
|
||||
ACPI_FUNCTION_NAME("ds_init_one_object");
|
||||
ACPI_FUNCTION_ENTRY();
|
||||
|
||||
/*
|
||||
* We are only interested in NS nodes owned by the table that
|
||||
|
|
@ -105,11 +105,7 @@ acpi_ds_init_one_object(acpi_handle obj_handle,
|
|||
|
||||
status = acpi_ds_initialize_region(obj_handle);
|
||||
if (ACPI_FAILURE(status)) {
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
||||
"Region %p [%4.4s] - Init failure, %s\n",
|
||||
obj_handle,
|
||||
acpi_ut_get_node_name(obj_handle),
|
||||
acpi_format_exception(status)));
|
||||
ACPI_REPORT_ERROR(("Region %p [%4.4s] - Init failure, %s\n", obj_handle, acpi_ut_get_node_name(obj_handle), acpi_format_exception(status)));
|
||||
}
|
||||
|
||||
info->op_region_count++;
|
||||
|
|
@ -117,14 +113,6 @@ acpi_ds_init_one_object(acpi_handle obj_handle,
|
|||
|
||||
case ACPI_TYPE_METHOD:
|
||||
|
||||
/*
|
||||
* Print a dot for each method unless we are going to print
|
||||
* the entire pathname
|
||||
*/
|
||||
if (!(acpi_dbg_level & ACPI_LV_INIT_NAMES)) {
|
||||
ACPI_DEBUG_PRINT_RAW((ACPI_DB_INIT, "."));
|
||||
}
|
||||
|
||||
/*
|
||||
* Set the execution data width (32 or 64) based upon the
|
||||
* revision number of the parent ACPI table.
|
||||
|
|
@ -134,6 +122,21 @@ acpi_ds_init_one_object(acpi_handle obj_handle,
|
|||
if (info->table_desc->pointer->revision == 1) {
|
||||
node->flags |= ANOBJ_DATA_WIDTH_32;
|
||||
}
|
||||
#ifdef ACPI_INIT_PARSE_METHODS
|
||||
/*
|
||||
* Note 11/2005: Removed this code to parse all methods during table
|
||||
* load because it causes problems if there are any errors during the
|
||||
* parse. Also, it seems like overkill and we probably don't want to
|
||||
* abort a table load because of an issue with a single method.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Print a dot for each method unless we are going to print
|
||||
* the entire pathname
|
||||
*/
|
||||
if (!(acpi_dbg_level & ACPI_LV_INIT_NAMES)) {
|
||||
ACPI_DEBUG_PRINT_RAW((ACPI_DB_INIT, "."));
|
||||
}
|
||||
|
||||
/*
|
||||
* Always parse methods to detect errors, we will delete
|
||||
|
|
@ -141,15 +144,11 @@ acpi_ds_init_one_object(acpi_handle obj_handle,
|
|||
*/
|
||||
status = acpi_ds_parse_method(obj_handle);
|
||||
if (ACPI_FAILURE(status)) {
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
||||
"\n+Method %p [%4.4s] - parse failure, %s\n",
|
||||
obj_handle,
|
||||
acpi_ut_get_node_name(obj_handle),
|
||||
acpi_format_exception(status)));
|
||||
ACPI_REPORT_ERROR(("\n+Method %p [%4.4s] - parse failure, %s\n", obj_handle, acpi_ut_get_node_name(obj_handle), acpi_format_exception(status)));
|
||||
|
||||
/* This parse failed, but we will continue parsing more methods */
|
||||
}
|
||||
|
||||
#endif
|
||||
info->method_count++;
|
||||
break;
|
||||
|
||||
|
|
@ -207,8 +206,8 @@ acpi_ds_initialize_objects(struct acpi_table_desc * table_desc,
|
|||
status = acpi_walk_namespace(ACPI_TYPE_ANY, start_node, ACPI_UINT32_MAX,
|
||||
acpi_ds_init_one_object, &info, NULL);
|
||||
if (ACPI_FAILURE(status)) {
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "walk_namespace failed, %s\n",
|
||||
acpi_format_exception(status)));
|
||||
ACPI_REPORT_ERROR(("walk_namespace failed, %s\n",
|
||||
acpi_format_exception(status)));
|
||||
}
|
||||
|
||||
ACPI_DEBUG_PRINT_RAW((ACPI_DB_INIT,
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
*****************************************************************************/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2000 - 2005, R. Byron Moore
|
||||
* Copyright (C) 2000 - 2006, R. Byron Moore
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
|
@ -47,135 +47,66 @@
|
|||
#include <acpi/acdispat.h>
|
||||
#include <acpi/acinterp.h>
|
||||
#include <acpi/acnamesp.h>
|
||||
#include <acpi/acdisasm.h>
|
||||
|
||||
#define _COMPONENT ACPI_DISPATCHER
|
||||
ACPI_MODULE_NAME("dsmethod")
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: acpi_ds_parse_method
|
||||
* FUNCTION: acpi_ds_method_error
|
||||
*
|
||||
* PARAMETERS: Node - Method node
|
||||
* PARAMETERS: Status - Execution status
|
||||
* walk_state - Current state
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Parse the AML that is associated with the method.
|
||||
* DESCRIPTION: Called on method error. Invoke the global exception handler if
|
||||
* present, dump the method data if the disassembler is configured
|
||||
*
|
||||
* MUTEX: Assumes parser is locked
|
||||
* Note: Allows the exception handler to change the status code
|
||||
*
|
||||
******************************************************************************/
|
||||
acpi_status acpi_ds_parse_method(struct acpi_namespace_node *node)
|
||||
acpi_status
|
||||
acpi_ds_method_error(acpi_status status, struct acpi_walk_state *walk_state)
|
||||
{
|
||||
acpi_status status;
|
||||
union acpi_operand_object *obj_desc;
|
||||
union acpi_parse_object *op;
|
||||
struct acpi_walk_state *walk_state;
|
||||
ACPI_FUNCTION_ENTRY();
|
||||
|
||||
ACPI_FUNCTION_TRACE_PTR("ds_parse_method", node);
|
||||
/* Ignore AE_OK and control exception codes */
|
||||
|
||||
/* Parameter Validation */
|
||||
|
||||
if (!node) {
|
||||
return_ACPI_STATUS(AE_NULL_ENTRY);
|
||||
if (ACPI_SUCCESS(status) || (status & AE_CODE_CONTROL)) {
|
||||
return (status);
|
||||
}
|
||||
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_PARSE,
|
||||
"**** Parsing [%4.4s] **** named_obj=%p\n",
|
||||
acpi_ut_get_node_name(node), node));
|
||||
/* Invoke the global exception handler */
|
||||
|
||||
/* Extract the method object from the method Node */
|
||||
if (acpi_gbl_exception_handler) {
|
||||
/* Exit the interpreter, allow handler to execute methods */
|
||||
|
||||
obj_desc = acpi_ns_get_attached_object(node);
|
||||
if (!obj_desc) {
|
||||
return_ACPI_STATUS(AE_NULL_OBJECT);
|
||||
acpi_ex_exit_interpreter();
|
||||
|
||||
/*
|
||||
* Handler can map the exception code to anything it wants, including
|
||||
* AE_OK, in which case the executing method will not be aborted.
|
||||
*/
|
||||
status = acpi_gbl_exception_handler(status,
|
||||
walk_state->method_node ?
|
||||
walk_state->method_node->
|
||||
name.integer : 0,
|
||||
walk_state->opcode,
|
||||
walk_state->aml_offset,
|
||||
NULL);
|
||||
(void)acpi_ex_enter_interpreter();
|
||||
}
|
||||
|
||||
/* Create a mutex for the method if there is a concurrency limit */
|
||||
|
||||
if ((obj_desc->method.concurrency != ACPI_INFINITE_CONCURRENCY) &&
|
||||
(!obj_desc->method.semaphore)) {
|
||||
status = acpi_os_create_semaphore(obj_desc->method.concurrency,
|
||||
obj_desc->method.concurrency,
|
||||
&obj_desc->method.semaphore);
|
||||
if (ACPI_FAILURE(status)) {
|
||||
return_ACPI_STATUS(status);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Allocate a new parser op to be the root of the parsed
|
||||
* method tree
|
||||
*/
|
||||
op = acpi_ps_alloc_op(AML_METHOD_OP);
|
||||
if (!op) {
|
||||
return_ACPI_STATUS(AE_NO_MEMORY);
|
||||
}
|
||||
|
||||
/* Init new op with the method name and pointer back to the Node */
|
||||
|
||||
acpi_ps_set_name(op, node->name.integer);
|
||||
op->common.node = node;
|
||||
|
||||
/*
|
||||
* Get a new owner_id for objects created by this method. Namespace
|
||||
* objects (such as Operation Regions) can be created during the
|
||||
* first pass parse.
|
||||
*/
|
||||
status = acpi_ut_allocate_owner_id(&obj_desc->method.owner_id);
|
||||
#ifdef ACPI_DISASSEMBLER
|
||||
if (ACPI_FAILURE(status)) {
|
||||
goto cleanup;
|
||||
/* Display method locals/args if disassembler is present */
|
||||
|
||||
acpi_dm_dump_method_info(status, walk_state, walk_state->op);
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Create and initialize a new walk state */
|
||||
|
||||
walk_state =
|
||||
acpi_ds_create_walk_state(obj_desc->method.owner_id, NULL, NULL,
|
||||
NULL);
|
||||
if (!walk_state) {
|
||||
status = AE_NO_MEMORY;
|
||||
goto cleanup2;
|
||||
}
|
||||
|
||||
status = acpi_ds_init_aml_walk(walk_state, op, node,
|
||||
obj_desc->method.aml_start,
|
||||
obj_desc->method.aml_length, NULL, 1);
|
||||
if (ACPI_FAILURE(status)) {
|
||||
acpi_ds_delete_walk_state(walk_state);
|
||||
goto cleanup2;
|
||||
}
|
||||
|
||||
/*
|
||||
* Parse the method, first pass
|
||||
*
|
||||
* The first pass load is where newly declared named objects are added into
|
||||
* the namespace. Actual evaluation of the named objects (what would be
|
||||
* called a "second pass") happens during the actual execution of the
|
||||
* method so that operands to the named objects can take on dynamic
|
||||
* run-time values.
|
||||
*/
|
||||
status = acpi_ps_parse_aml(walk_state);
|
||||
if (ACPI_FAILURE(status)) {
|
||||
goto cleanup2;
|
||||
}
|
||||
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_PARSE,
|
||||
"**** [%4.4s] Parsed **** named_obj=%p Op=%p\n",
|
||||
acpi_ut_get_node_name(node), node, op));
|
||||
|
||||
/*
|
||||
* Delete the parse tree. We simply re-parse the method for every
|
||||
* execution since there isn't much overhead (compared to keeping lots
|
||||
* of parse trees around)
|
||||
*/
|
||||
acpi_ns_delete_namespace_subtree(node);
|
||||
acpi_ns_delete_namespace_by_owner(obj_desc->method.owner_id);
|
||||
|
||||
cleanup2:
|
||||
acpi_ut_release_owner_id(&obj_desc->method.owner_id);
|
||||
|
||||
cleanup:
|
||||
acpi_ps_delete_parse_tree(op);
|
||||
return_ACPI_STATUS(status);
|
||||
return (status);
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
|
|
@ -195,9 +126,9 @@ acpi_status acpi_ds_parse_method(struct acpi_namespace_node *node)
|
|||
******************************************************************************/
|
||||
|
||||
acpi_status
|
||||
acpi_ds_begin_method_execution(struct acpi_namespace_node *method_node,
|
||||
union acpi_operand_object *obj_desc,
|
||||
struct acpi_namespace_node *calling_method_node)
|
||||
acpi_ds_begin_method_execution(struct acpi_namespace_node * method_node,
|
||||
union acpi_operand_object * obj_desc,
|
||||
struct acpi_namespace_node * calling_method_node)
|
||||
{
|
||||
acpi_status status = AE_OK;
|
||||
|
||||
|
|
@ -545,16 +476,54 @@ void acpi_ds_terminate_control_method(struct acpi_walk_state *walk_state)
|
|||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* There are no more threads executing this method. Perform
|
||||
* additional cleanup.
|
||||
*
|
||||
* The method Node is stored in the walk state
|
||||
*/
|
||||
method_node = walk_state->method_node;
|
||||
|
||||
/* Lock namespace for possible update */
|
||||
|
||||
status = acpi_ut_acquire_mutex(ACPI_MTX_NAMESPACE);
|
||||
if (ACPI_FAILURE(status)) {
|
||||
goto exit;
|
||||
}
|
||||
|
||||
/*
|
||||
* Delete any namespace entries created immediately underneath
|
||||
* the method
|
||||
*/
|
||||
if (method_node->child) {
|
||||
acpi_ns_delete_namespace_subtree(method_node);
|
||||
}
|
||||
|
||||
/*
|
||||
* Delete any namespace entries created anywhere else within
|
||||
* the namespace by the execution of this method
|
||||
*/
|
||||
acpi_ns_delete_namespace_by_owner(walk_state->method_desc->method.
|
||||
owner_id);
|
||||
status = acpi_ut_release_mutex(ACPI_MTX_NAMESPACE);
|
||||
|
||||
/* Are there any other threads currently executing this method? */
|
||||
|
||||
if (walk_state->method_desc->method.thread_count) {
|
||||
/*
|
||||
* Additional threads. Do not release the owner_id in this case,
|
||||
* we immediately reuse it for the next thread executing this method
|
||||
*/
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_DISPATCH,
|
||||
"*** Not deleting method namespace, there are still %d threads\n",
|
||||
"*** Completed execution of one thread, %d threads remaining\n",
|
||||
walk_state->method_desc->method.
|
||||
thread_count));
|
||||
} else { /* This is the last executing thread */
|
||||
} else {
|
||||
/* This is the only executing thread for this method */
|
||||
|
||||
/*
|
||||
* Support to dynamically change a method from not_serialized to
|
||||
* Serialized if it appears that the method is written foolishly and
|
||||
* Serialized if it appears that the method is incorrectly written and
|
||||
* does not support multiple thread execution. The best example of this
|
||||
* is if such a method creates namespace objects and blocks. A second
|
||||
* thread will fail with an AE_ALREADY_EXISTS exception
|
||||
|
|
@ -570,34 +539,8 @@ void acpi_ds_terminate_control_method(struct acpi_walk_state *walk_state)
|
|||
semaphore);
|
||||
}
|
||||
|
||||
/*
|
||||
* There are no more threads executing this method. Perform
|
||||
* additional cleanup.
|
||||
*
|
||||
* The method Node is stored in the walk state
|
||||
*/
|
||||
method_node = walk_state->method_node;
|
||||
/* No more threads, we can free the owner_id */
|
||||
|
||||
/*
|
||||
* Delete any namespace entries created immediately underneath
|
||||
* the method
|
||||
*/
|
||||
status = acpi_ut_acquire_mutex(ACPI_MTX_NAMESPACE);
|
||||
if (ACPI_FAILURE(status)) {
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if (method_node->child) {
|
||||
acpi_ns_delete_namespace_subtree(method_node);
|
||||
}
|
||||
|
||||
/*
|
||||
* Delete any namespace entries created anywhere else within
|
||||
* the namespace
|
||||
*/
|
||||
acpi_ns_delete_namespace_by_owner(walk_state->method_desc->
|
||||
method.owner_id);
|
||||
status = acpi_ut_release_mutex(ACPI_MTX_NAMESPACE);
|
||||
acpi_ut_release_owner_id(&walk_state->method_desc->method.
|
||||
owner_id);
|
||||
}
|
||||
|
|
@ -606,3 +549,140 @@ void acpi_ds_terminate_control_method(struct acpi_walk_state *walk_state)
|
|||
(void)acpi_ut_release_mutex(ACPI_MTX_PARSER);
|
||||
return_VOID;
|
||||
}
|
||||
|
||||
#ifdef ACPI_INIT_PARSE_METHODS
|
||||
/*
|
||||
* Note 11/2005: Removed this code to parse all methods during table
|
||||
* load because it causes problems if there are any errors during the
|
||||
* parse. Also, it seems like overkill and we probably don't want to
|
||||
* abort a table load because of an issue with a single method.
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: acpi_ds_parse_method
|
||||
*
|
||||
* PARAMETERS: Node - Method node
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Parse the AML that is associated with the method.
|
||||
*
|
||||
* MUTEX: Assumes parser is locked
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
acpi_status acpi_ds_parse_method(struct acpi_namespace_node *node)
|
||||
{
|
||||
acpi_status status;
|
||||
union acpi_operand_object *obj_desc;
|
||||
union acpi_parse_object *op;
|
||||
struct acpi_walk_state *walk_state;
|
||||
|
||||
ACPI_FUNCTION_TRACE_PTR("ds_parse_method", node);
|
||||
|
||||
/* Parameter Validation */
|
||||
|
||||
if (!node) {
|
||||
return_ACPI_STATUS(AE_NULL_ENTRY);
|
||||
}
|
||||
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_PARSE,
|
||||
"**** Parsing [%4.4s] **** named_obj=%p\n",
|
||||
acpi_ut_get_node_name(node), node));
|
||||
|
||||
/* Extract the method object from the method Node */
|
||||
|
||||
obj_desc = acpi_ns_get_attached_object(node);
|
||||
if (!obj_desc) {
|
||||
return_ACPI_STATUS(AE_NULL_OBJECT);
|
||||
}
|
||||
|
||||
/* Create a mutex for the method if there is a concurrency limit */
|
||||
|
||||
if ((obj_desc->method.concurrency != ACPI_INFINITE_CONCURRENCY) &&
|
||||
(!obj_desc->method.semaphore)) {
|
||||
status = acpi_os_create_semaphore(obj_desc->method.concurrency,
|
||||
obj_desc->method.concurrency,
|
||||
&obj_desc->method.semaphore);
|
||||
if (ACPI_FAILURE(status)) {
|
||||
return_ACPI_STATUS(status);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Allocate a new parser op to be the root of the parsed
|
||||
* method tree
|
||||
*/
|
||||
op = acpi_ps_alloc_op(AML_METHOD_OP);
|
||||
if (!op) {
|
||||
return_ACPI_STATUS(AE_NO_MEMORY);
|
||||
}
|
||||
|
||||
/* Init new op with the method name and pointer back to the Node */
|
||||
|
||||
acpi_ps_set_name(op, node->name.integer);
|
||||
op->common.node = node;
|
||||
|
||||
/*
|
||||
* Get a new owner_id for objects created by this method. Namespace
|
||||
* objects (such as Operation Regions) can be created during the
|
||||
* first pass parse.
|
||||
*/
|
||||
status = acpi_ut_allocate_owner_id(&obj_desc->method.owner_id);
|
||||
if (ACPI_FAILURE(status)) {
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
/* Create and initialize a new walk state */
|
||||
|
||||
walk_state =
|
||||
acpi_ds_create_walk_state(obj_desc->method.owner_id, NULL, NULL,
|
||||
NULL);
|
||||
if (!walk_state) {
|
||||
status = AE_NO_MEMORY;
|
||||
goto cleanup2;
|
||||
}
|
||||
|
||||
status = acpi_ds_init_aml_walk(walk_state, op, node,
|
||||
obj_desc->method.aml_start,
|
||||
obj_desc->method.aml_length, NULL, 1);
|
||||
if (ACPI_FAILURE(status)) {
|
||||
acpi_ds_delete_walk_state(walk_state);
|
||||
goto cleanup2;
|
||||
}
|
||||
|
||||
/*
|
||||
* Parse the method, first pass
|
||||
*
|
||||
* The first pass load is where newly declared named objects are added into
|
||||
* the namespace. Actual evaluation of the named objects (what would be
|
||||
* called a "second pass") happens during the actual execution of the
|
||||
* method so that operands to the named objects can take on dynamic
|
||||
* run-time values.
|
||||
*/
|
||||
status = acpi_ps_parse_aml(walk_state);
|
||||
if (ACPI_FAILURE(status)) {
|
||||
goto cleanup2;
|
||||
}
|
||||
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_PARSE,
|
||||
"**** [%4.4s] Parsed **** named_obj=%p Op=%p\n",
|
||||
acpi_ut_get_node_name(node), node, op));
|
||||
|
||||
/*
|
||||
* Delete the parse tree. We simply re-parse the method for every
|
||||
* execution since there isn't much overhead (compared to keeping lots
|
||||
* of parse trees around)
|
||||
*/
|
||||
acpi_ns_delete_namespace_subtree(node);
|
||||
acpi_ns_delete_namespace_by_owner(obj_desc->method.owner_id);
|
||||
|
||||
cleanup2:
|
||||
acpi_ut_release_owner_id(&obj_desc->method.owner_id);
|
||||
|
||||
cleanup:
|
||||
acpi_ps_delete_parse_tree(op);
|
||||
return_ACPI_STATUS(status);
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
******************************************************************************/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2000 - 2005, R. Byron Moore
|
||||
* Copyright (C) 2000 - 2006, R. Byron Moore
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
|
@ -260,9 +260,7 @@ acpi_ds_method_data_get_node(u16 opcode,
|
|||
case AML_LOCAL_OP:
|
||||
|
||||
if (index > ACPI_METHOD_MAX_LOCAL) {
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
||||
"Local index %d is invalid (max %d)\n",
|
||||
index, ACPI_METHOD_MAX_LOCAL));
|
||||
ACPI_REPORT_ERROR(("Local index %d is invalid (max %d)\n", index, ACPI_METHOD_MAX_LOCAL));
|
||||
return_ACPI_STATUS(AE_AML_INVALID_INDEX);
|
||||
}
|
||||
|
||||
|
|
@ -274,9 +272,8 @@ acpi_ds_method_data_get_node(u16 opcode,
|
|||
case AML_ARG_OP:
|
||||
|
||||
if (index > ACPI_METHOD_MAX_ARG) {
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
||||
"Arg index %d is invalid (max %d)\n",
|
||||
index, ACPI_METHOD_MAX_ARG));
|
||||
ACPI_REPORT_ERROR(("Arg index %d is invalid (max %d)\n",
|
||||
index, ACPI_METHOD_MAX_ARG));
|
||||
return_ACPI_STATUS(AE_AML_INVALID_INDEX);
|
||||
}
|
||||
|
||||
|
|
@ -286,8 +283,7 @@ acpi_ds_method_data_get_node(u16 opcode,
|
|||
break;
|
||||
|
||||
default:
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Opcode %d is invalid\n",
|
||||
opcode));
|
||||
ACPI_REPORT_ERROR(("Opcode %d is invalid\n", opcode));
|
||||
return_ACPI_STATUS(AE_AML_BAD_OPCODE);
|
||||
}
|
||||
|
||||
|
|
@ -378,8 +374,7 @@ acpi_ds_method_data_get_value(u16 opcode,
|
|||
/* Validate the object descriptor */
|
||||
|
||||
if (!dest_desc) {
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
||||
"Null object descriptor pointer\n"));
|
||||
ACPI_REPORT_ERROR(("Null object descriptor pointer\n"));
|
||||
return_ACPI_STATUS(AE_BAD_PARAMETER);
|
||||
}
|
||||
|
||||
|
|
@ -424,23 +419,18 @@ acpi_ds_method_data_get_value(u16 opcode,
|
|||
switch (opcode) {
|
||||
case AML_ARG_OP:
|
||||
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
||||
"Uninitialized Arg[%d] at node %p\n",
|
||||
index, node));
|
||||
ACPI_REPORT_ERROR(("Uninitialized Arg[%d] at node %p\n", index, node));
|
||||
|
||||
return_ACPI_STATUS(AE_AML_UNINITIALIZED_ARG);
|
||||
|
||||
case AML_LOCAL_OP:
|
||||
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
||||
"Uninitialized Local[%d] at node %p\n",
|
||||
index, node));
|
||||
ACPI_REPORT_ERROR(("Uninitialized Local[%d] at node %p\n", index, node));
|
||||
|
||||
return_ACPI_STATUS(AE_AML_UNINITIALIZED_LOCAL);
|
||||
|
||||
default:
|
||||
ACPI_REPORT_ERROR(("Not Arg/Local opcode: %X\n",
|
||||
opcode));
|
||||
ACPI_REPORT_ERROR(("Not a Arg/Local opcode: %X\n", opcode));
|
||||
return_ACPI_STATUS(AE_AML_INTERNAL);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
*****************************************************************************/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2000 - 2005, R. Byron Moore
|
||||
* Copyright (C) 2000 - 2006, R. Byron Moore
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
|
@ -51,6 +51,7 @@
|
|||
#define _COMPONENT ACPI_DISPATCHER
|
||||
ACPI_MODULE_NAME("dsobject")
|
||||
|
||||
/* Local prototypes */
|
||||
static acpi_status
|
||||
acpi_ds_build_internal_object(struct acpi_walk_state *walk_state,
|
||||
union acpi_parse_object *op,
|
||||
|
|
@ -85,7 +86,7 @@ acpi_ds_build_internal_object(struct acpi_walk_state *walk_state,
|
|||
*obj_desc_ptr = NULL;
|
||||
if (op->common.aml_opcode == AML_INT_NAMEPATH_OP) {
|
||||
/*
|
||||
* This is an named object reference. If this name was
|
||||
* This is a named object reference. If this name was
|
||||
* previously looked up in the namespace, it was stored in this op.
|
||||
* Otherwise, go ahead and look it up now
|
||||
*/
|
||||
|
|
@ -96,18 +97,48 @@ acpi_ds_build_internal_object(struct acpi_walk_state *walk_state,
|
|||
ACPI_IMODE_EXECUTE,
|
||||
ACPI_NS_SEARCH_PARENT |
|
||||
ACPI_NS_DONT_OPEN_SCOPE, NULL,
|
||||
(struct acpi_namespace_node **)
|
||||
&(op->common.node));
|
||||
|
||||
ACPI_CAST_INDIRECT_PTR(struct
|
||||
acpi_namespace_node,
|
||||
&(op->
|
||||
common.
|
||||
node)));
|
||||
if (ACPI_FAILURE(status)) {
|
||||
ACPI_REPORT_NSERROR(op->common.value.string,
|
||||
status);
|
||||
/* Check if we are resolving a named reference within a package */
|
||||
|
||||
if ((status == AE_NOT_FOUND)
|
||||
&& (acpi_gbl_enable_interpreter_slack)
|
||||
&&
|
||||
((op->common.parent->common.aml_opcode ==
|
||||
AML_PACKAGE_OP)
|
||||
|| (op->common.parent->common.aml_opcode ==
|
||||
AML_VAR_PACKAGE_OP))) {
|
||||
/*
|
||||
* We didn't find the target and we are populating elements
|
||||
* of a package - ignore if slack enabled. Some ASL code
|
||||
* contains dangling invalid references in packages and
|
||||
* expects that no exception will be issued. Leave the
|
||||
* element as a null element. It cannot be used, but it
|
||||
* can be overwritten by subsequent ASL code - this is
|
||||
* typically the case.
|
||||
*/
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_INFO,
|
||||
"Ignoring unresolved reference in package [%4.4s]\n",
|
||||
walk_state->
|
||||
scope_info->scope.
|
||||
node->name.ascii));
|
||||
|
||||
return_ACPI_STATUS(AE_OK);
|
||||
} else {
|
||||
ACPI_REPORT_NSERROR(op->common.value.
|
||||
string, status);
|
||||
}
|
||||
|
||||
return_ACPI_STATUS(status);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Create and init the internal ACPI object */
|
||||
/* Create and init a new internal ACPI object */
|
||||
|
||||
obj_desc = acpi_ut_create_internal_object((acpi_ps_get_opcode_info
|
||||
(op->common.aml_opcode))->
|
||||
|
|
@ -157,13 +188,13 @@ acpi_ds_build_internal_buffer_obj(struct acpi_walk_state *walk_state,
|
|||
|
||||
ACPI_FUNCTION_TRACE("ds_build_internal_buffer_obj");
|
||||
|
||||
/*
|
||||
* If we are evaluating a Named buffer object "Name (xxxx, Buffer)".
|
||||
* The buffer object already exists (from the NS node), otherwise it must
|
||||
* be created.
|
||||
*/
|
||||
obj_desc = *obj_desc_ptr;
|
||||
if (obj_desc) {
|
||||
/*
|
||||
* We are evaluating a Named buffer object "Name (xxxx, Buffer)".
|
||||
* The buffer object already exists (from the NS node)
|
||||
*/
|
||||
} else {
|
||||
if (!obj_desc) {
|
||||
/* Create a new buffer object */
|
||||
|
||||
obj_desc = acpi_ut_create_internal_object(ACPI_TYPE_BUFFER);
|
||||
|
|
@ -183,10 +214,7 @@ acpi_ds_build_internal_buffer_obj(struct acpi_walk_state *walk_state,
|
|||
byte_list = arg->named.next;
|
||||
if (byte_list) {
|
||||
if (byte_list->common.aml_opcode != AML_INT_BYTELIST_OP) {
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
||||
"Expecting bytelist, got AML opcode %X in op %p\n",
|
||||
byte_list->common.aml_opcode,
|
||||
byte_list));
|
||||
ACPI_REPORT_ERROR(("Expecting bytelist, got AML opcode %X in op %p\n", byte_list->common.aml_opcode, byte_list));
|
||||
|
||||
acpi_ut_remove_reference(obj_desc);
|
||||
return (AE_TYPE);
|
||||
|
|
@ -259,7 +287,7 @@ acpi_ds_build_internal_package_obj(struct acpi_walk_state *walk_state,
|
|||
union acpi_operand_object *obj_desc = NULL;
|
||||
u32 package_list_length;
|
||||
acpi_status status = AE_OK;
|
||||
u32 i;
|
||||
acpi_native_uint i;
|
||||
|
||||
ACPI_FUNCTION_TRACE("ds_build_internal_package_obj");
|
||||
|
||||
|
|
@ -271,13 +299,12 @@ acpi_ds_build_internal_package_obj(struct acpi_walk_state *walk_state,
|
|||
parent = parent->common.parent;
|
||||
}
|
||||
|
||||
/*
|
||||
* If we are evaluating a Named package object "Name (xxxx, Package)",
|
||||
* the package object already exists, otherwise it must be created.
|
||||
*/
|
||||
obj_desc = *obj_desc_ptr;
|
||||
if (obj_desc) {
|
||||
/*
|
||||
* We are evaluating a Named package object "Name (xxxx, Package)".
|
||||
* Get the existing package object from the NS node
|
||||
*/
|
||||
} else {
|
||||
if (!obj_desc) {
|
||||
obj_desc = acpi_ut_create_internal_object(ACPI_TYPE_PACKAGE);
|
||||
*obj_desc_ptr = obj_desc;
|
||||
if (!obj_desc) {
|
||||
|
|
@ -291,11 +318,9 @@ acpi_ds_build_internal_package_obj(struct acpi_walk_state *walk_state,
|
|||
|
||||
/* Count the number of items in the package list */
|
||||
|
||||
package_list_length = 0;
|
||||
arg = op->common.value.arg;
|
||||
arg = arg->common.next;
|
||||
while (arg) {
|
||||
package_list_length++;
|
||||
for (package_list_length = 0; arg; package_list_length++) {
|
||||
arg = arg->common.next;
|
||||
}
|
||||
|
||||
|
|
@ -322,12 +347,11 @@ acpi_ds_build_internal_package_obj(struct acpi_walk_state *walk_state,
|
|||
}
|
||||
|
||||
/*
|
||||
* Now init the elements of the package
|
||||
* Initialize all elements of the package
|
||||
*/
|
||||
i = 0;
|
||||
arg = op->common.value.arg;
|
||||
arg = arg->common.next;
|
||||
while (arg) {
|
||||
for (i = 0; arg; i++) {
|
||||
if (arg->common.aml_opcode == AML_INT_RETURN_VALUE_OP) {
|
||||
/* Object (package or buffer) is already built */
|
||||
|
||||
|
|
@ -340,8 +364,6 @@ acpi_ds_build_internal_package_obj(struct acpi_walk_state *walk_state,
|
|||
package.
|
||||
elements[i]);
|
||||
}
|
||||
|
||||
i++;
|
||||
arg = arg->common.next;
|
||||
}
|
||||
|
||||
|
|
@ -518,9 +540,7 @@ acpi_ds_init_object_from_op(struct acpi_walk_state *walk_state,
|
|||
|
||||
default:
|
||||
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
||||
"Unknown constant opcode %X\n",
|
||||
opcode));
|
||||
ACPI_REPORT_ERROR(("Unknown constant opcode %X\n", opcode));
|
||||
status = AE_AML_OPERAND_TYPE;
|
||||
break;
|
||||
}
|
||||
|
|
@ -535,9 +555,8 @@ acpi_ds_init_object_from_op(struct acpi_walk_state *walk_state,
|
|||
break;
|
||||
|
||||
default:
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
||||
"Unknown Integer type %X\n",
|
||||
op_info->type));
|
||||
ACPI_REPORT_ERROR(("Unknown Integer type %X\n",
|
||||
op_info->type));
|
||||
status = AE_AML_OPERAND_TYPE;
|
||||
break;
|
||||
}
|
||||
|
|
@ -615,9 +634,8 @@ acpi_ds_init_object_from_op(struct acpi_walk_state *walk_state,
|
|||
|
||||
default:
|
||||
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
||||
"Unimplemented data type: %X\n",
|
||||
ACPI_GET_OBJECT_TYPE(obj_desc)));
|
||||
ACPI_REPORT_ERROR(("Unimplemented data type: %X\n",
|
||||
ACPI_GET_OBJECT_TYPE(obj_desc)));
|
||||
|
||||
status = AE_AML_OPERAND_TYPE;
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
*****************************************************************************/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2000 - 2005, R. Byron Moore
|
||||
* Copyright (C) 2000 - 2006, R. Byron Moore
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
|
@ -413,9 +413,7 @@ acpi_ds_init_buffer_field(u16 aml_opcode,
|
|||
/* Host object must be a Buffer */
|
||||
|
||||
if (ACPI_GET_OBJECT_TYPE(buffer_desc) != ACPI_TYPE_BUFFER) {
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
||||
"Target of Create Field is not a Buffer object - %s\n",
|
||||
acpi_ut_get_object_type_name(buffer_desc)));
|
||||
ACPI_REPORT_ERROR(("Target of Create Field is not a Buffer object - %s\n", acpi_ut_get_object_type_name(buffer_desc)));
|
||||
|
||||
status = AE_AML_OPERAND_TYPE;
|
||||
goto cleanup;
|
||||
|
|
@ -427,10 +425,9 @@ acpi_ds_init_buffer_field(u16 aml_opcode,
|
|||
* after resolution in acpi_ex_resolve_operands().
|
||||
*/
|
||||
if (ACPI_GET_DESCRIPTOR_TYPE(result_desc) != ACPI_DESC_TYPE_NAMED) {
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
||||
"(%s) destination not a NS Node [%s]\n",
|
||||
acpi_ps_get_opcode_name(aml_opcode),
|
||||
acpi_ut_get_descriptor_name(result_desc)));
|
||||
ACPI_REPORT_ERROR(("(%s) destination not a NS Node [%s]\n",
|
||||
acpi_ps_get_opcode_name(aml_opcode),
|
||||
acpi_ut_get_descriptor_name(result_desc)));
|
||||
|
||||
status = AE_AML_OPERAND_TYPE;
|
||||
goto cleanup;
|
||||
|
|
@ -453,8 +450,7 @@ acpi_ds_init_buffer_field(u16 aml_opcode,
|
|||
/* Must have a valid (>0) bit count */
|
||||
|
||||
if (bit_count == 0) {
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
||||
"Attempt to create_field of length 0\n"));
|
||||
ACPI_REPORT_ERROR(("Attempt to create_field of length 0\n"));
|
||||
status = AE_AML_OPERAND_VALUE;
|
||||
goto cleanup;
|
||||
}
|
||||
|
|
@ -507,9 +503,8 @@ acpi_ds_init_buffer_field(u16 aml_opcode,
|
|||
|
||||
default:
|
||||
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
||||
"Unknown field creation opcode %02x\n",
|
||||
aml_opcode));
|
||||
ACPI_REPORT_ERROR(("Unknown field creation opcode %02x\n",
|
||||
aml_opcode));
|
||||
status = AE_AML_BAD_OPCODE;
|
||||
goto cleanup;
|
||||
}
|
||||
|
|
@ -517,13 +512,7 @@ acpi_ds_init_buffer_field(u16 aml_opcode,
|
|||
/* Entire field must fit within the current length of the buffer */
|
||||
|
||||
if ((bit_offset + bit_count) > (8 * (u32) buffer_desc->buffer.length)) {
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
||||
"Field [%4.4s] size %d exceeds Buffer [%4.4s] size %d (bits)\n",
|
||||
acpi_ut_get_node_name(result_desc),
|
||||
bit_offset + bit_count,
|
||||
acpi_ut_get_node_name(buffer_desc->buffer.
|
||||
node),
|
||||
8 * (u32) buffer_desc->buffer.length));
|
||||
ACPI_REPORT_ERROR(("Field [%4.4s] size %d exceeds Buffer [%4.4s] size %d (bits)\n", acpi_ut_get_node_name(result_desc), bit_offset + bit_count, acpi_ut_get_node_name(buffer_desc->buffer.node), 8 * (u32) buffer_desc->buffer.length));
|
||||
status = AE_AML_BUFFER_LIMIT;
|
||||
goto cleanup;
|
||||
}
|
||||
|
|
@ -629,9 +618,10 @@ acpi_ds_eval_buffer_field_operands(struct acpi_walk_state *walk_state,
|
|||
"after acpi_ex_resolve_operands");
|
||||
|
||||
if (ACPI_FAILURE(status)) {
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "(%s) bad operand(s) (%X)\n",
|
||||
acpi_ps_get_opcode_name(op->common.
|
||||
aml_opcode), status));
|
||||
ACPI_REPORT_ERROR(("(%s) bad operand(s) (%X)\n",
|
||||
acpi_ps_get_opcode_name(op->common.
|
||||
aml_opcode),
|
||||
status));
|
||||
|
||||
return_ACPI_STATUS(status);
|
||||
}
|
||||
|
|
@ -1155,9 +1145,8 @@ acpi_ds_exec_end_control_op(struct acpi_walk_state * walk_state,
|
|||
|
||||
default:
|
||||
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
||||
"Unknown control opcode=%X Op=%p\n",
|
||||
op->common.aml_opcode, op));
|
||||
ACPI_REPORT_ERROR(("Unknown control opcode=%X Op=%p\n",
|
||||
op->common.aml_opcode, op));
|
||||
|
||||
status = AE_AML_BAD_OPCODE;
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
******************************************************************************/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2000 - 2005, R. Byron Moore
|
||||
* Copyright (C) 2000 - 2006, R. Byron Moore
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
|
@ -176,8 +176,8 @@ acpi_ds_is_result_used(union acpi_parse_object * op,
|
|||
/* Must have both an Op and a Result Object */
|
||||
|
||||
if (!op) {
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Null Op\n"));
|
||||
return_VALUE(TRUE);
|
||||
ACPI_REPORT_ERROR(("Null Op\n"));
|
||||
return_UINT8(TRUE);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -208,7 +208,7 @@ acpi_ds_is_result_used(union acpi_parse_object * op,
|
|||
"At Method level, result of [%s] not used\n",
|
||||
acpi_ps_get_opcode_name(op->common.
|
||||
aml_opcode)));
|
||||
return_VALUE(FALSE);
|
||||
return_UINT8(FALSE);
|
||||
}
|
||||
|
||||
/* Get info on the parent. The root_op is AML_SCOPE */
|
||||
|
|
@ -216,9 +216,8 @@ acpi_ds_is_result_used(union acpi_parse_object * op,
|
|||
parent_info =
|
||||
acpi_ps_get_opcode_info(op->common.parent->common.aml_opcode);
|
||||
if (parent_info->class == AML_CLASS_UNKNOWN) {
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
||||
"Unknown parent opcode. Op=%p\n", op));
|
||||
return_VALUE(FALSE);
|
||||
ACPI_REPORT_ERROR(("Unknown parent opcode Op=%p\n", op));
|
||||
return_UINT8(FALSE);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -304,7 +303,7 @@ acpi_ds_is_result_used(union acpi_parse_object * op,
|
|||
acpi_ps_get_opcode_name(op->common.parent->common.
|
||||
aml_opcode), op));
|
||||
|
||||
return_VALUE(TRUE);
|
||||
return_UINT8(TRUE);
|
||||
|
||||
result_not_used:
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_DISPATCH,
|
||||
|
|
@ -313,7 +312,7 @@ acpi_ds_is_result_used(union acpi_parse_object * op,
|
|||
acpi_ps_get_opcode_name(op->common.parent->common.
|
||||
aml_opcode), op));
|
||||
|
||||
return_VALUE(FALSE);
|
||||
return_UINT8(FALSE);
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
|
|
@ -344,7 +343,7 @@ acpi_ds_delete_result_if_not_used(union acpi_parse_object *op,
|
|||
ACPI_FUNCTION_TRACE_PTR("ds_delete_result_if_not_used", result_obj);
|
||||
|
||||
if (!op) {
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Null Op\n"));
|
||||
ACPI_REPORT_ERROR(("Null Op\n"));
|
||||
return_VOID;
|
||||
}
|
||||
|
||||
|
|
@ -616,7 +615,7 @@ acpi_ds_create_operand(struct acpi_walk_state *walk_state,
|
|||
|
||||
if (op_info->flags & AML_HAS_RETVAL) {
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_DISPATCH,
|
||||
"Argument previously created, already stacked \n"));
|
||||
"Argument previously created, already stacked\n"));
|
||||
|
||||
ACPI_DEBUGGER_EXEC(acpi_db_display_argument_object
|
||||
(walk_state->
|
||||
|
|
@ -635,10 +634,7 @@ acpi_ds_create_operand(struct acpi_walk_state *walk_state,
|
|||
* Only error is underflow, and this indicates
|
||||
* a missing or null operand!
|
||||
*/
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
||||
"Missing or null operand, %s\n",
|
||||
acpi_format_exception
|
||||
(status)));
|
||||
ACPI_REPORT_ERROR(("Missing or null operand, %s\n", acpi_format_exception(status)));
|
||||
return_ACPI_STATUS(status);
|
||||
}
|
||||
} else {
|
||||
|
|
@ -730,7 +726,7 @@ acpi_ds_create_operands(struct acpi_walk_state *walk_state,
|
|||
*/
|
||||
(void)acpi_ds_obj_stack_pop_and_delete(arg_count, walk_state);
|
||||
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "While creating Arg %d - %s\n",
|
||||
(arg_count + 1), acpi_format_exception(status)));
|
||||
ACPI_REPORT_ERROR(("While creating Arg %d - %s\n",
|
||||
(arg_count + 1), acpi_format_exception(status)));
|
||||
return_ACPI_STATUS(status);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
*****************************************************************************/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2000 - 2005, R. Byron Moore
|
||||
* Copyright (C) 2000 - 2006, R. Byron Moore
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
|
@ -100,9 +100,7 @@ acpi_ds_get_predicate_value(struct acpi_walk_state *walk_state,
|
|||
if (result_obj) {
|
||||
status = acpi_ds_result_pop(&obj_desc, walk_state);
|
||||
if (ACPI_FAILURE(status)) {
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
||||
"Could not get result from predicate evaluation, %s\n",
|
||||
acpi_format_exception(status)));
|
||||
ACPI_REPORT_ERROR(("Could not get result from predicate evaluation, %s\n", acpi_format_exception(status)));
|
||||
|
||||
return_ACPI_STATUS(status);
|
||||
}
|
||||
|
|
@ -123,9 +121,8 @@ acpi_ds_get_predicate_value(struct acpi_walk_state *walk_state,
|
|||
}
|
||||
|
||||
if (!obj_desc) {
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
||||
"No predicate obj_desc=%p State=%p\n",
|
||||
obj_desc, walk_state));
|
||||
ACPI_REPORT_ERROR(("No predicate obj_desc=%p State=%p\n",
|
||||
obj_desc, walk_state));
|
||||
|
||||
return_ACPI_STATUS(AE_AML_NO_OPERAND);
|
||||
}
|
||||
|
|
@ -140,10 +137,7 @@ acpi_ds_get_predicate_value(struct acpi_walk_state *walk_state,
|
|||
}
|
||||
|
||||
if (ACPI_GET_OBJECT_TYPE(local_obj_desc) != ACPI_TYPE_INTEGER) {
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
||||
"Bad predicate (not an integer) obj_desc=%p State=%p Type=%X\n",
|
||||
obj_desc, walk_state,
|
||||
ACPI_GET_OBJECT_TYPE(obj_desc)));
|
||||
ACPI_REPORT_ERROR(("Bad predicate (not an integer) obj_desc=%p State=%p Type=%X\n", obj_desc, walk_state, ACPI_GET_OBJECT_TYPE(obj_desc)));
|
||||
|
||||
status = AE_AML_OPERAND_TYPE;
|
||||
goto cleanup;
|
||||
|
|
@ -314,12 +308,13 @@ acpi_ds_exec_begin_op(struct acpi_walk_state *walk_state,
|
|||
|
||||
case AML_CLASS_EXECUTE:
|
||||
case AML_CLASS_CREATE:
|
||||
|
||||
/*
|
||||
* Most operators with arguments.
|
||||
* Start a new result/operand state
|
||||
*/
|
||||
status = acpi_ds_result_stack_push(walk_state);
|
||||
if (walk_state->opcode != AML_CREATE_FIELD_OP) {
|
||||
status = acpi_ds_result_stack_push(walk_state);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
|
|
@ -361,8 +356,8 @@ acpi_status acpi_ds_exec_end_op(struct acpi_walk_state *walk_state)
|
|||
op_class = walk_state->op_info->class;
|
||||
|
||||
if (op_class == AML_CLASS_UNKNOWN) {
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Unknown opcode %X\n",
|
||||
op->common.aml_opcode));
|
||||
ACPI_REPORT_ERROR(("Unknown opcode %X\n",
|
||||
op->common.aml_opcode));
|
||||
return_ACPI_STATUS(AE_NOT_IMPLEMENTED);
|
||||
}
|
||||
|
||||
|
|
@ -452,12 +447,7 @@ acpi_status acpi_ds_exec_end_op(struct acpi_walk_state *walk_state)
|
|||
walk_state->operands[1]->reference.offset)) {
|
||||
status = AE_OK;
|
||||
} else {
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
||||
"[%s]: Could not resolve operands, %s\n",
|
||||
acpi_ps_get_opcode_name
|
||||
(walk_state->opcode),
|
||||
acpi_format_exception
|
||||
(status)));
|
||||
ACPI_REPORT_ERROR(("[%s]: Could not resolve operands, %s\n", acpi_ps_get_opcode_name(walk_state->opcode), acpi_format_exception(status)));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -676,8 +666,8 @@ acpi_status acpi_ds_exec_end_op(struct acpi_walk_state *walk_state)
|
|||
|
||||
case AML_TYPE_UNDEFINED:
|
||||
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
||||
"Undefined opcode type Op=%p\n", op));
|
||||
ACPI_REPORT_ERROR(("Undefined opcode type Op=%p\n",
|
||||
op));
|
||||
return_ACPI_STATUS(AE_NOT_IMPLEMENTED);
|
||||
|
||||
case AML_TYPE_BOGUS:
|
||||
|
|
@ -689,10 +679,7 @@ acpi_status acpi_ds_exec_end_op(struct acpi_walk_state *walk_state)
|
|||
|
||||
default:
|
||||
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
||||
"Unimplemented opcode, class=%X type=%X Opcode=%X Op=%p\n",
|
||||
op_class, op_type,
|
||||
op->common.aml_opcode, op));
|
||||
ACPI_REPORT_ERROR(("Unimplemented opcode, class=%X type=%X Opcode=%X Op=%p\n", op_class, op_type, op->common.aml_opcode, op));
|
||||
|
||||
status = AE_NOT_IMPLEMENTED;
|
||||
break;
|
||||
|
|
@ -723,20 +710,6 @@ acpi_status acpi_ds_exec_end_op(struct acpi_walk_state *walk_state)
|
|||
|
||||
cleanup:
|
||||
|
||||
/* Invoke exception handler on error */
|
||||
|
||||
if (ACPI_FAILURE(status) &&
|
||||
acpi_gbl_exception_handler && !(status & AE_CODE_CONTROL)) {
|
||||
acpi_ex_exit_interpreter();
|
||||
status = acpi_gbl_exception_handler(status,
|
||||
walk_state->method_node->
|
||||
name.integer,
|
||||
walk_state->opcode,
|
||||
walk_state->aml_offset,
|
||||
NULL);
|
||||
(void)acpi_ex_enter_interpreter();
|
||||
}
|
||||
|
||||
if (walk_state->result_obj) {
|
||||
/* Break to debugger to display result */
|
||||
|
||||
|
|
@ -758,18 +731,14 @@ acpi_status acpi_ds_exec_end_op(struct acpi_walk_state *walk_state)
|
|||
}
|
||||
#endif
|
||||
|
||||
/* Invoke exception handler on error */
|
||||
|
||||
if (ACPI_FAILURE(status)) {
|
||||
status = acpi_ds_method_error(status, walk_state);
|
||||
}
|
||||
|
||||
/* Always clear the object stack */
|
||||
|
||||
walk_state->num_operands = 0;
|
||||
|
||||
#ifdef ACPI_DISASSEMBLER
|
||||
|
||||
/* On error, display method locals/args */
|
||||
|
||||
if (ACPI_FAILURE(status)) {
|
||||
acpi_dm_dump_method_info(status, walk_state, op);
|
||||
}
|
||||
#endif
|
||||
|
||||
return_ACPI_STATUS(status);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
*****************************************************************************/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2000 - 2005, R. Byron Moore
|
||||
* Copyright (C) 2000 - 2006, R. Byron Moore
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
|
@ -127,7 +127,7 @@ acpi_ds_load1_begin_op(struct acpi_walk_state * walk_state,
|
|||
char *path;
|
||||
u32 flags;
|
||||
|
||||
ACPI_FUNCTION_NAME("ds_load1_begin_op");
|
||||
ACPI_FUNCTION_TRACE("ds_load1_begin_op");
|
||||
|
||||
op = walk_state->op;
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_DISPATCH, "Op=%p State=%p\n", op,
|
||||
|
|
@ -138,14 +138,14 @@ acpi_ds_load1_begin_op(struct acpi_walk_state * walk_state,
|
|||
if (op) {
|
||||
if (!(walk_state->op_info->flags & AML_NAMED)) {
|
||||
*out_op = op;
|
||||
return (AE_OK);
|
||||
return_ACPI_STATUS(AE_OK);
|
||||
}
|
||||
|
||||
/* Check if this object has already been installed in the namespace */
|
||||
|
||||
if (op->common.node) {
|
||||
*out_op = op;
|
||||
return (AE_OK);
|
||||
return_ACPI_STATUS(AE_OK);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -188,7 +188,7 @@ acpi_ds_load1_begin_op(struct acpi_walk_state * walk_state,
|
|||
#endif
|
||||
if (ACPI_FAILURE(status)) {
|
||||
ACPI_REPORT_NSERROR(path, status);
|
||||
return (status);
|
||||
return_ACPI_STATUS(status);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -235,7 +235,7 @@ acpi_ds_load1_begin_op(struct acpi_walk_state * walk_state,
|
|||
|
||||
ACPI_REPORT_ERROR(("Invalid type (%s) for target of Scope operator [%4.4s] (Cannot override)\n", acpi_ut_get_type_name(node->type), path));
|
||||
|
||||
return (AE_AML_OPERAND_TYPE);
|
||||
return_ACPI_STATUS(AE_AML_OPERAND_TYPE);
|
||||
}
|
||||
break;
|
||||
|
||||
|
|
@ -257,6 +257,7 @@ acpi_ds_load1_begin_op(struct acpi_walk_state * walk_state,
|
|||
* buffer_field, or Package), the name of the object is already
|
||||
* in the namespace.
|
||||
*/
|
||||
|
||||
if (walk_state->deferred_node) {
|
||||
/* This name is already in the namespace, get the node */
|
||||
|
||||
|
|
@ -265,6 +266,16 @@ acpi_ds_load1_begin_op(struct acpi_walk_state * walk_state,
|
|||
break;
|
||||
}
|
||||
|
||||
/*
|
||||
* If we are executing a method, do not create any namespace objects
|
||||
* during the load phase, only during execution.
|
||||
*/
|
||||
if (walk_state->method_node) {
|
||||
node = NULL;
|
||||
status = AE_OK;
|
||||
break;
|
||||
}
|
||||
|
||||
flags = ACPI_NS_NO_UPSEARCH;
|
||||
if ((walk_state->opcode != AML_SCOPE_OP) &&
|
||||
(!(walk_state->parse_flags & ACPI_PARSE_DEFERRED_OP))) {
|
||||
|
|
@ -290,7 +301,7 @@ acpi_ds_load1_begin_op(struct acpi_walk_state * walk_state,
|
|||
&(node));
|
||||
if (ACPI_FAILURE(status)) {
|
||||
ACPI_REPORT_NSERROR(path, status);
|
||||
return (status);
|
||||
return_ACPI_STATUS(status);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
|
@ -302,28 +313,29 @@ acpi_ds_load1_begin_op(struct acpi_walk_state * walk_state,
|
|||
|
||||
op = acpi_ps_alloc_op(walk_state->opcode);
|
||||
if (!op) {
|
||||
return (AE_NO_MEMORY);
|
||||
return_ACPI_STATUS(AE_NO_MEMORY);
|
||||
}
|
||||
}
|
||||
|
||||
/* Initialize */
|
||||
|
||||
op->named.name = node->name.integer;
|
||||
/* Initialize the op */
|
||||
|
||||
#if (defined (ACPI_NO_METHOD_EXECUTION) || defined (ACPI_CONSTANT_EVAL_ONLY))
|
||||
op->named.path = (u8 *) path;
|
||||
op->named.path = ACPI_CAST_PTR(u8, path);
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Put the Node in the "op" object that the parser uses, so we
|
||||
* can get it again quickly when this scope is closed
|
||||
*/
|
||||
op->common.node = node;
|
||||
if (node) {
|
||||
/*
|
||||
* Put the Node in the "op" object that the parser uses, so we
|
||||
* can get it again quickly when this scope is closed
|
||||
*/
|
||||
op->common.node = node;
|
||||
op->named.name = node->name.integer;
|
||||
}
|
||||
|
||||
acpi_ps_append_arg(acpi_ps_get_parent_scope(&walk_state->parser_state),
|
||||
op);
|
||||
|
||||
*out_op = op;
|
||||
return (status);
|
||||
return_ACPI_STATUS(status);
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
|
|
@ -339,13 +351,13 @@ acpi_ds_load1_begin_op(struct acpi_walk_state * walk_state,
|
|||
*
|
||||
******************************************************************************/
|
||||
|
||||
acpi_status acpi_ds_load1_end_op(struct acpi_walk_state * walk_state)
|
||||
acpi_status acpi_ds_load1_end_op(struct acpi_walk_state *walk_state)
|
||||
{
|
||||
union acpi_parse_object *op;
|
||||
acpi_object_type object_type;
|
||||
acpi_status status = AE_OK;
|
||||
|
||||
ACPI_FUNCTION_NAME("ds_load1_end_op");
|
||||
ACPI_FUNCTION_TRACE("ds_load1_end_op");
|
||||
|
||||
op = walk_state->op;
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_DISPATCH, "Op=%p State=%p\n", op,
|
||||
|
|
@ -354,7 +366,7 @@ acpi_status acpi_ds_load1_end_op(struct acpi_walk_state * walk_state)
|
|||
/* We are only interested in opcodes that have an associated name */
|
||||
|
||||
if (!(walk_state->op_info->flags & (AML_NAMED | AML_FIELD))) {
|
||||
return (AE_OK);
|
||||
return_ACPI_STATUS(AE_OK);
|
||||
}
|
||||
|
||||
/* Get the object type to determine if we should pop the scope */
|
||||
|
|
@ -363,21 +375,37 @@ acpi_status acpi_ds_load1_end_op(struct acpi_walk_state * walk_state)
|
|||
|
||||
#ifndef ACPI_NO_METHOD_EXECUTION
|
||||
if (walk_state->op_info->flags & AML_FIELD) {
|
||||
if (walk_state->opcode == AML_FIELD_OP ||
|
||||
walk_state->opcode == AML_BANK_FIELD_OP ||
|
||||
walk_state->opcode == AML_INDEX_FIELD_OP) {
|
||||
status = acpi_ds_init_field_objects(op, walk_state);
|
||||
/*
|
||||
* If we are executing a method, do not create any namespace objects
|
||||
* during the load phase, only during execution.
|
||||
*/
|
||||
if (!walk_state->method_node) {
|
||||
if (walk_state->opcode == AML_FIELD_OP ||
|
||||
walk_state->opcode == AML_BANK_FIELD_OP ||
|
||||
walk_state->opcode == AML_INDEX_FIELD_OP) {
|
||||
status =
|
||||
acpi_ds_init_field_objects(op, walk_state);
|
||||
}
|
||||
}
|
||||
return (status);
|
||||
return_ACPI_STATUS(status);
|
||||
}
|
||||
|
||||
if (op->common.aml_opcode == AML_REGION_OP) {
|
||||
status = acpi_ex_create_region(op->named.data, op->named.length,
|
||||
(acpi_adr_space_type)
|
||||
((op->common.value.arg)->common.
|
||||
value.integer), walk_state);
|
||||
if (ACPI_FAILURE(status)) {
|
||||
return (status);
|
||||
/*
|
||||
* If we are executing a method, do not create any namespace objects
|
||||
* during the load phase, only during execution.
|
||||
*/
|
||||
if (!walk_state->method_node) {
|
||||
if (op->common.aml_opcode == AML_REGION_OP) {
|
||||
status =
|
||||
acpi_ex_create_region(op->named.data,
|
||||
op->named.length,
|
||||
(acpi_adr_space_type)
|
||||
((op->common.value.arg)->
|
||||
common.value.integer),
|
||||
walk_state);
|
||||
if (ACPI_FAILURE(status)) {
|
||||
return_ACPI_STATUS(status);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
|
@ -391,47 +419,63 @@ acpi_status acpi_ds_load1_end_op(struct acpi_walk_state * walk_state)
|
|||
common.
|
||||
aml_opcode))->
|
||||
object_type;
|
||||
op->common.node->type = (u8) object_type;
|
||||
}
|
||||
}
|
||||
|
||||
if (op->common.aml_opcode == AML_METHOD_OP) {
|
||||
/*
|
||||
* method_op pkg_length name_string method_flags term_list
|
||||
*
|
||||
* Note: We must create the method node/object pair as soon as we
|
||||
* see the method declaration. This allows later pass1 parsing
|
||||
* of invocations of the method (need to know the number of
|
||||
* arguments.)
|
||||
*/
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_DISPATCH,
|
||||
"LOADING-Method: State=%p Op=%p named_obj=%p\n",
|
||||
walk_state, op, op->named.node));
|
||||
/* Set node type if we have a namespace node */
|
||||
|
||||
if (!acpi_ns_get_attached_object(op->named.node)) {
|
||||
walk_state->operands[0] = (void *)op->named.node;
|
||||
walk_state->num_operands = 1;
|
||||
|
||||
status =
|
||||
acpi_ds_create_operands(walk_state,
|
||||
op->common.value.arg);
|
||||
if (ACPI_SUCCESS(status)) {
|
||||
status = acpi_ex_create_method(op->named.data,
|
||||
op->named.length,
|
||||
walk_state);
|
||||
}
|
||||
walk_state->operands[0] = NULL;
|
||||
walk_state->num_operands = 0;
|
||||
|
||||
if (ACPI_FAILURE(status)) {
|
||||
return (status);
|
||||
if (op->common.node) {
|
||||
op->common.node->type = (u8) object_type;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Pop the scope stack */
|
||||
/*
|
||||
* If we are executing a method, do not create any namespace objects
|
||||
* during the load phase, only during execution.
|
||||
*/
|
||||
if (!walk_state->method_node) {
|
||||
if (op->common.aml_opcode == AML_METHOD_OP) {
|
||||
/*
|
||||
* method_op pkg_length name_string method_flags term_list
|
||||
*
|
||||
* Note: We must create the method node/object pair as soon as we
|
||||
* see the method declaration. This allows later pass1 parsing
|
||||
* of invocations of the method (need to know the number of
|
||||
* arguments.)
|
||||
*/
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_DISPATCH,
|
||||
"LOADING-Method: State=%p Op=%p named_obj=%p\n",
|
||||
walk_state, op, op->named.node));
|
||||
|
||||
if (acpi_ns_opens_scope(object_type)) {
|
||||
if (!acpi_ns_get_attached_object(op->named.node)) {
|
||||
walk_state->operands[0] =
|
||||
ACPI_CAST_PTR(void, op->named.node);
|
||||
walk_state->num_operands = 1;
|
||||
|
||||
status =
|
||||
acpi_ds_create_operands(walk_state,
|
||||
op->common.value.
|
||||
arg);
|
||||
if (ACPI_SUCCESS(status)) {
|
||||
status =
|
||||
acpi_ex_create_method(op->named.
|
||||
data,
|
||||
op->named.
|
||||
length,
|
||||
walk_state);
|
||||
}
|
||||
walk_state->operands[0] = NULL;
|
||||
walk_state->num_operands = 0;
|
||||
|
||||
if (ACPI_FAILURE(status)) {
|
||||
return_ACPI_STATUS(status);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Pop the scope stack (only if loading a table) */
|
||||
|
||||
if (!walk_state->method_node && acpi_ns_opens_scope(object_type)) {
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_DISPATCH,
|
||||
"(%s): Popping scope for Op %p\n",
|
||||
acpi_ut_get_type_name(object_type), op));
|
||||
|
|
@ -439,7 +483,7 @@ acpi_status acpi_ds_load1_end_op(struct acpi_walk_state * walk_state)
|
|||
status = acpi_ds_scope_stack_pop(walk_state);
|
||||
}
|
||||
|
||||
return (status);
|
||||
return_ACPI_STATUS(status);
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
|
|
@ -456,8 +500,8 @@ acpi_status acpi_ds_load1_end_op(struct acpi_walk_state * walk_state)
|
|||
******************************************************************************/
|
||||
|
||||
acpi_status
|
||||
acpi_ds_load2_begin_op(struct acpi_walk_state * walk_state,
|
||||
union acpi_parse_object ** out_op)
|
||||
acpi_ds_load2_begin_op(struct acpi_walk_state *walk_state,
|
||||
union acpi_parse_object **out_op)
|
||||
{
|
||||
union acpi_parse_object *op;
|
||||
struct acpi_namespace_node *node;
|
||||
|
|
@ -840,6 +884,13 @@ acpi_status acpi_ds_load2_end_op(struct acpi_walk_state *walk_state)
|
|||
|
||||
case AML_TYPE_NAMED_FIELD:
|
||||
|
||||
/*
|
||||
* If we are executing a method, initialize the field
|
||||
*/
|
||||
if (walk_state->method_node) {
|
||||
status = acpi_ds_init_field_objects(op, walk_state);
|
||||
}
|
||||
|
||||
switch (op->common.aml_opcode) {
|
||||
case AML_INDEX_FIELD_OP:
|
||||
|
||||
|
|
@ -929,6 +980,24 @@ acpi_status acpi_ds_load2_end_op(struct acpi_walk_state *walk_state)
|
|||
switch (op->common.aml_opcode) {
|
||||
#ifndef ACPI_NO_METHOD_EXECUTION
|
||||
case AML_REGION_OP:
|
||||
|
||||
/*
|
||||
* If we are executing a method, initialize the region
|
||||
*/
|
||||
if (walk_state->method_node) {
|
||||
status =
|
||||
acpi_ex_create_region(op->named.data,
|
||||
op->named.length,
|
||||
(acpi_adr_space_type)
|
||||
((op->common.value.
|
||||
arg)->common.value.
|
||||
integer),
|
||||
walk_state);
|
||||
if (ACPI_FAILURE(status)) {
|
||||
return (status);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* The op_region is not fully parsed at this time. Only valid
|
||||
* argument is the space_id. (We must save the address of the
|
||||
|
|
@ -957,11 +1026,50 @@ acpi_status acpi_ds_load2_end_op(struct acpi_walk_state *walk_state)
|
|||
|
||||
status = acpi_ds_create_node(walk_state, node, op);
|
||||
break;
|
||||
|
||||
case AML_METHOD_OP:
|
||||
/*
|
||||
* method_op pkg_length name_string method_flags term_list
|
||||
*
|
||||
* Note: We must create the method node/object pair as soon as we
|
||||
* see the method declaration. This allows later pass1 parsing
|
||||
* of invocations of the method (need to know the number of
|
||||
* arguments.)
|
||||
*/
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_DISPATCH,
|
||||
"LOADING-Method: State=%p Op=%p named_obj=%p\n",
|
||||
walk_state, op, op->named.node));
|
||||
|
||||
if (!acpi_ns_get_attached_object(op->named.node)) {
|
||||
walk_state->operands[0] =
|
||||
ACPI_CAST_PTR(void, op->named.node);
|
||||
walk_state->num_operands = 1;
|
||||
|
||||
status =
|
||||
acpi_ds_create_operands(walk_state,
|
||||
op->common.value.
|
||||
arg);
|
||||
if (ACPI_SUCCESS(status)) {
|
||||
status =
|
||||
acpi_ex_create_method(op->named.
|
||||
data,
|
||||
op->named.
|
||||
length,
|
||||
walk_state);
|
||||
}
|
||||
walk_state->operands[0] = NULL;
|
||||
walk_state->num_operands = 0;
|
||||
|
||||
if (ACPI_FAILURE(status)) {
|
||||
return_ACPI_STATUS(status);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
#endif /* ACPI_NO_METHOD_EXECUTION */
|
||||
|
||||
default:
|
||||
/* All NAMED_COMPLEX opcodes must be handled above */
|
||||
/* Note: Method objects were already created in Pass 1 */
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
*****************************************************************************/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2000 - 2005, R. Byron Moore
|
||||
* Copyright (C) 2000 - 2006, R. Byron Moore
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
|
@ -107,14 +107,14 @@ acpi_ds_scope_stack_push(struct acpi_namespace_node *node,
|
|||
if (!node) {
|
||||
/* Invalid scope */
|
||||
|
||||
ACPI_REPORT_ERROR(("ds_scope_stack_push: null scope passed\n"));
|
||||
ACPI_REPORT_ERROR(("Null scope parameter\n"));
|
||||
return_ACPI_STATUS(AE_BAD_PARAMETER);
|
||||
}
|
||||
|
||||
/* Make sure object type is valid */
|
||||
|
||||
if (!acpi_ut_valid_object_type(type)) {
|
||||
ACPI_REPORT_WARNING(("ds_scope_stack_push: Invalid object type: 0x%X\n", type));
|
||||
ACPI_REPORT_WARNING(("Invalid object type: 0x%X\n", type));
|
||||
}
|
||||
|
||||
/* Allocate a new scope object */
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
*****************************************************************************/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2000 - 2005, R. Byron Moore
|
||||
* Copyright (C) 2000 - 2006, R. Byron Moore
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
|
@ -92,26 +92,23 @@ acpi_ds_result_remove(union acpi_operand_object **object,
|
|||
|
||||
state = walk_state->results;
|
||||
if (!state) {
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
||||
"No result object pushed! State=%p\n",
|
||||
walk_state));
|
||||
ACPI_REPORT_ERROR(("No result object pushed! State=%p\n",
|
||||
walk_state));
|
||||
return (AE_NOT_EXIST);
|
||||
}
|
||||
|
||||
if (index >= ACPI_OBJ_MAX_OPERAND) {
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
||||
"Index out of range: %X State=%p Num=%X\n",
|
||||
index, walk_state,
|
||||
state->results.num_results));
|
||||
ACPI_REPORT_ERROR(("Index out of range: %X State=%p Num=%X\n",
|
||||
index, walk_state,
|
||||
state->results.num_results));
|
||||
}
|
||||
|
||||
/* Check for a valid result object */
|
||||
|
||||
if (!state->results.obj_desc[index]) {
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
||||
"Null operand! State=%p #Ops=%X, Index=%X\n",
|
||||
walk_state, state->results.num_results,
|
||||
index));
|
||||
ACPI_REPORT_ERROR(("Null operand! State=%p #Ops=%X, Index=%X\n",
|
||||
walk_state, state->results.num_results,
|
||||
index));
|
||||
return (AE_AML_NO_RETURN_VALUE);
|
||||
}
|
||||
|
||||
|
|
@ -163,9 +160,8 @@ acpi_ds_result_pop(union acpi_operand_object ** object,
|
|||
}
|
||||
|
||||
if (!state->results.num_results) {
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
||||
"Result stack is empty! State=%p\n",
|
||||
walk_state));
|
||||
ACPI_REPORT_ERROR(("Result stack is empty! State=%p\n",
|
||||
walk_state));
|
||||
return (AE_AML_NO_RETURN_VALUE);
|
||||
}
|
||||
|
||||
|
|
@ -192,8 +188,7 @@ acpi_ds_result_pop(union acpi_operand_object ** object,
|
|||
}
|
||||
}
|
||||
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
||||
"No result objects! State=%p\n", walk_state));
|
||||
ACPI_REPORT_ERROR(("No result objects! State=%p\n", walk_state));
|
||||
return (AE_AML_NO_RETURN_VALUE);
|
||||
}
|
||||
|
||||
|
|
@ -222,15 +217,14 @@ acpi_ds_result_pop_from_bottom(union acpi_operand_object ** object,
|
|||
|
||||
state = walk_state->results;
|
||||
if (!state) {
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
||||
"Warning: No result object pushed! State=%p\n",
|
||||
walk_state));
|
||||
ACPI_REPORT_ERROR(("No result object pushed! State=%p\n",
|
||||
walk_state));
|
||||
return (AE_NOT_EXIST);
|
||||
}
|
||||
|
||||
if (!state->results.num_results) {
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
||||
"No result objects! State=%p\n", walk_state));
|
||||
ACPI_REPORT_ERROR(("No result objects! State=%p\n",
|
||||
walk_state));
|
||||
return (AE_AML_NO_RETURN_VALUE);
|
||||
}
|
||||
|
||||
|
|
@ -250,10 +244,9 @@ acpi_ds_result_pop_from_bottom(union acpi_operand_object ** object,
|
|||
/* Check for a valid result object */
|
||||
|
||||
if (!*object) {
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
||||
"Null operand! State=%p #Ops=%X Index=%X\n",
|
||||
walk_state, state->results.num_results,
|
||||
(u32) index));
|
||||
ACPI_REPORT_ERROR(("Null operand! State=%p #Ops=%X Index=%X\n",
|
||||
walk_state, state->results.num_results,
|
||||
(u32) index));
|
||||
return (AE_AML_NO_RETURN_VALUE);
|
||||
}
|
||||
|
||||
|
|
@ -293,18 +286,14 @@ acpi_ds_result_push(union acpi_operand_object * object,
|
|||
}
|
||||
|
||||
if (state->results.num_results == ACPI_OBJ_NUM_OPERANDS) {
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
||||
"Result stack overflow: Obj=%p State=%p Num=%X\n",
|
||||
object, walk_state,
|
||||
state->results.num_results));
|
||||
ACPI_REPORT_ERROR(("Result stack overflow: Obj=%p State=%p Num=%X\n", object, walk_state, state->results.num_results));
|
||||
return (AE_STACK_OVERFLOW);
|
||||
}
|
||||
|
||||
if (!object) {
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
||||
"Null Object! Obj=%p State=%p Num=%X\n",
|
||||
object, walk_state,
|
||||
state->results.num_results));
|
||||
ACPI_REPORT_ERROR(("Null Object! Obj=%p State=%p Num=%X\n",
|
||||
object, walk_state,
|
||||
state->results.num_results));
|
||||
return (AE_BAD_PARAMETER);
|
||||
}
|
||||
|
||||
|
|
@ -413,10 +402,7 @@ acpi_ds_obj_stack_push(void *object, struct acpi_walk_state * walk_state)
|
|||
/* Check for stack overflow */
|
||||
|
||||
if (walk_state->num_operands >= ACPI_OBJ_NUM_OPERANDS) {
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
||||
"overflow! Obj=%p State=%p #Ops=%X\n",
|
||||
object, walk_state,
|
||||
walk_state->num_operands));
|
||||
ACPI_REPORT_ERROR(("Object stack overflow! Obj=%p State=%p #Ops=%X\n", object, walk_state, walk_state->num_operands));
|
||||
return (AE_STACK_OVERFLOW);
|
||||
}
|
||||
|
||||
|
|
@ -460,10 +446,7 @@ acpi_ds_obj_stack_pop(u32 pop_count, struct acpi_walk_state * walk_state)
|
|||
/* Check for stack underflow */
|
||||
|
||||
if (walk_state->num_operands == 0) {
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
||||
"Underflow! Count=%X State=%p #Ops=%X\n",
|
||||
pop_count, walk_state,
|
||||
walk_state->num_operands));
|
||||
ACPI_REPORT_ERROR(("Object stack underflow! Count=%X State=%p #Ops=%X\n", pop_count, walk_state, walk_state->num_operands));
|
||||
return (AE_STACK_UNDERFLOW);
|
||||
}
|
||||
|
||||
|
|
@ -506,10 +489,7 @@ acpi_ds_obj_stack_pop_and_delete(u32 pop_count,
|
|||
/* Check for stack underflow */
|
||||
|
||||
if (walk_state->num_operands == 0) {
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
||||
"Underflow! Count=%X State=%p #Ops=%X\n",
|
||||
pop_count, walk_state,
|
||||
walk_state->num_operands));
|
||||
ACPI_REPORT_ERROR(("Object stack underflow! Count=%X State=%p #Ops=%X\n", pop_count, walk_state, walk_state->num_operands));
|
||||
return (AE_STACK_UNDERFLOW);
|
||||
}
|
||||
|
||||
|
|
@ -826,16 +806,14 @@ void acpi_ds_delete_walk_state(struct acpi_walk_state *walk_state)
|
|||
}
|
||||
|
||||
if (walk_state->data_type != ACPI_DESC_TYPE_WALK) {
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
||||
"%p is not a valid walk state\n",
|
||||
walk_state));
|
||||
ACPI_REPORT_ERROR(("%p is not a valid walk state\n",
|
||||
walk_state));
|
||||
return;
|
||||
}
|
||||
|
||||
if (walk_state->parser_state.scope) {
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
||||
"%p walk still has a scope list\n",
|
||||
walk_state));
|
||||
ACPI_REPORT_ERROR(("%p walk still has a scope list\n",
|
||||
walk_state));
|
||||
}
|
||||
|
||||
/* Always must free any linked control states */
|
||||
|
|
@ -894,25 +872,18 @@ acpi_ds_result_insert(void *object,
|
|||
|
||||
state = walk_state->results;
|
||||
if (!state) {
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
||||
"No result object pushed! State=%p\n",
|
||||
walk_state));
|
||||
ACPI_REPORT_ERROR(("No result object pushed! State=%p\n",
|
||||
walk_state));
|
||||
return (AE_NOT_EXIST);
|
||||
}
|
||||
|
||||
if (index >= ACPI_OBJ_NUM_OPERANDS) {
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
||||
"Index out of range: %X Obj=%p State=%p Num=%X\n",
|
||||
index, object, walk_state,
|
||||
state->results.num_results));
|
||||
ACPI_REPORT_ERROR(("Index out of range: %X Obj=%p State=%p Num=%X\n", index, object, walk_state, state->results.num_results));
|
||||
return (AE_BAD_PARAMETER);
|
||||
}
|
||||
|
||||
if (!object) {
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
||||
"Null Object! Index=%X Obj=%p State=%p Num=%X\n",
|
||||
index, object, walk_state,
|
||||
state->results.num_results));
|
||||
ACPI_REPORT_ERROR(("Null Object! Index=%X Obj=%p State=%p Num=%X\n", index, object, walk_state, state->results.num_results));
|
||||
return (AE_BAD_PARAMETER);
|
||||
}
|
||||
|
||||
|
|
@ -986,9 +957,7 @@ acpi_ds_obj_stack_pop_object(union acpi_operand_object **object,
|
|||
/* Check for stack underflow */
|
||||
|
||||
if (walk_state->num_operands == 0) {
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
||||
"Missing operand/stack empty! State=%p #Ops=%X\n",
|
||||
walk_state, walk_state->num_operands));
|
||||
ACPI_REPORT_ERROR(("Missing operand/stack empty! State=%p #Ops=%X\n", walk_state, walk_state->num_operands));
|
||||
*object = NULL;
|
||||
return (AE_AML_NO_OPERAND);
|
||||
}
|
||||
|
|
@ -1000,9 +969,8 @@ acpi_ds_obj_stack_pop_object(union acpi_operand_object **object,
|
|||
/* Check for a valid operand */
|
||||
|
||||
if (!walk_state->operands[walk_state->num_operands]) {
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
||||
"Null operand! State=%p #Ops=%X\n",
|
||||
walk_state, walk_state->num_operands));
|
||||
ACPI_REPORT_ERROR(("Null operand! State=%p #Ops=%X\n",
|
||||
walk_state, walk_state->num_operands));
|
||||
*object = NULL;
|
||||
return (AE_AML_NO_OPERAND);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -60,20 +60,20 @@ ACPI_MODULE_NAME("acpi_ec")
|
|||
#define ACPI_EC_BURST_ENABLE 0x82
|
||||
#define ACPI_EC_BURST_DISABLE 0x83
|
||||
#define ACPI_EC_COMMAND_QUERY 0x84
|
||||
#define EC_POLLING 0xFF
|
||||
#define EC_BURST 0x00
|
||||
#define EC_POLL 0xFF
|
||||
#define EC_INTR 0x00
|
||||
static int acpi_ec_remove(struct acpi_device *device, int type);
|
||||
static int acpi_ec_start(struct acpi_device *device);
|
||||
static int acpi_ec_stop(struct acpi_device *device, int type);
|
||||
static int acpi_ec_burst_add(struct acpi_device *device);
|
||||
static int acpi_ec_polling_add(struct acpi_device *device);
|
||||
static int acpi_ec_intr_add(struct acpi_device *device);
|
||||
static int acpi_ec_poll_add(struct acpi_device *device);
|
||||
|
||||
static struct acpi_driver acpi_ec_driver = {
|
||||
.name = ACPI_EC_DRIVER_NAME,
|
||||
.class = ACPI_EC_CLASS,
|
||||
.ids = ACPI_EC_HID,
|
||||
.ops = {
|
||||
.add = acpi_ec_polling_add,
|
||||
.add = acpi_ec_intr_add,
|
||||
.remove = acpi_ec_remove,
|
||||
.start = acpi_ec_start,
|
||||
.stop = acpi_ec_stop,
|
||||
|
|
@ -105,7 +105,7 @@ union acpi_ec {
|
|||
atomic_t pending_gpe;
|
||||
struct semaphore sem;
|
||||
wait_queue_head_t wait;
|
||||
} burst;
|
||||
} intr;
|
||||
|
||||
struct {
|
||||
u32 mode;
|
||||
|
|
@ -117,37 +117,37 @@ union acpi_ec {
|
|||
struct acpi_generic_address data_addr;
|
||||
unsigned long global_lock;
|
||||
spinlock_t lock;
|
||||
} polling;
|
||||
} poll;
|
||||
};
|
||||
|
||||
static int acpi_ec_polling_wait(union acpi_ec *ec, u8 event);
|
||||
static int acpi_ec_burst_wait(union acpi_ec *ec, unsigned int event);
|
||||
static int acpi_ec_polling_read(union acpi_ec *ec, u8 address, u32 * data);
|
||||
static int acpi_ec_burst_read(union acpi_ec *ec, u8 address, u32 * data);
|
||||
static int acpi_ec_polling_write(union acpi_ec *ec, u8 address, u8 data);
|
||||
static int acpi_ec_burst_write(union acpi_ec *ec, u8 address, u8 data);
|
||||
static int acpi_ec_polling_query(union acpi_ec *ec, u32 * data);
|
||||
static int acpi_ec_burst_query(union acpi_ec *ec, u32 * data);
|
||||
static void acpi_ec_gpe_polling_query(void *ec_cxt);
|
||||
static void acpi_ec_gpe_burst_query(void *ec_cxt);
|
||||
static u32 acpi_ec_gpe_polling_handler(void *data);
|
||||
static u32 acpi_ec_gpe_burst_handler(void *data);
|
||||
static int acpi_ec_poll_wait(union acpi_ec *ec, u8 event);
|
||||
static int acpi_ec_intr_wait(union acpi_ec *ec, unsigned int event);
|
||||
static int acpi_ec_poll_read(union acpi_ec *ec, u8 address, u32 * data);
|
||||
static int acpi_ec_intr_read(union acpi_ec *ec, u8 address, u32 * data);
|
||||
static int acpi_ec_poll_write(union acpi_ec *ec, u8 address, u8 data);
|
||||
static int acpi_ec_intr_write(union acpi_ec *ec, u8 address, u8 data);
|
||||
static int acpi_ec_poll_query(union acpi_ec *ec, u32 * data);
|
||||
static int acpi_ec_intr_query(union acpi_ec *ec, u32 * data);
|
||||
static void acpi_ec_gpe_poll_query(void *ec_cxt);
|
||||
static void acpi_ec_gpe_intr_query(void *ec_cxt);
|
||||
static u32 acpi_ec_gpe_poll_handler(void *data);
|
||||
static u32 acpi_ec_gpe_intr_handler(void *data);
|
||||
static acpi_status __init
|
||||
acpi_fake_ecdt_polling_callback(acpi_handle handle,
|
||||
acpi_fake_ecdt_poll_callback(acpi_handle handle,
|
||||
u32 Level, void *context, void **retval);
|
||||
|
||||
static acpi_status __init
|
||||
acpi_fake_ecdt_burst_callback(acpi_handle handle,
|
||||
acpi_fake_ecdt_intr_callback(acpi_handle handle,
|
||||
u32 Level, void *context, void **retval);
|
||||
|
||||
static int __init acpi_ec_polling_get_real_ecdt(void);
|
||||
static int __init acpi_ec_burst_get_real_ecdt(void);
|
||||
static int __init acpi_ec_poll_get_real_ecdt(void);
|
||||
static int __init acpi_ec_intr_get_real_ecdt(void);
|
||||
/* If we find an EC via the ECDT, we need to keep a ptr to its context */
|
||||
static union acpi_ec *ec_ecdt;
|
||||
|
||||
/* External interfaces use first EC only, so remember */
|
||||
static struct acpi_device *first_ec;
|
||||
static int acpi_ec_polling_mode = EC_POLLING;
|
||||
static int acpi_ec_poll_mode = EC_INTR;
|
||||
|
||||
/* --------------------------------------------------------------------------
|
||||
Transaction Management
|
||||
|
|
@ -163,13 +163,13 @@ static u32 acpi_ec_read_status(union acpi_ec *ec)
|
|||
|
||||
static int acpi_ec_wait(union acpi_ec *ec, u8 event)
|
||||
{
|
||||
if (acpi_ec_polling_mode)
|
||||
return acpi_ec_polling_wait(ec, event);
|
||||
if (acpi_ec_poll_mode)
|
||||
return acpi_ec_poll_wait(ec, event);
|
||||
else
|
||||
return acpi_ec_burst_wait(ec, event);
|
||||
return acpi_ec_intr_wait(ec, event);
|
||||
}
|
||||
|
||||
static int acpi_ec_polling_wait(union acpi_ec *ec, u8 event)
|
||||
static int acpi_ec_poll_wait(union acpi_ec *ec, u8 event)
|
||||
{
|
||||
u32 acpi_ec_status = 0;
|
||||
u32 i = ACPI_EC_UDELAY_COUNT;
|
||||
|
|
@ -203,36 +203,31 @@ static int acpi_ec_polling_wait(union acpi_ec *ec, u8 event)
|
|||
|
||||
return -ETIME;
|
||||
}
|
||||
static int acpi_ec_burst_wait(union acpi_ec *ec, unsigned int event)
|
||||
static int acpi_ec_intr_wait(union acpi_ec *ec, unsigned int event)
|
||||
{
|
||||
int result = 0;
|
||||
|
||||
ACPI_FUNCTION_TRACE("acpi_ec_wait");
|
||||
|
||||
ec->burst.expect_event = event;
|
||||
ec->intr.expect_event = event;
|
||||
smp_mb();
|
||||
|
||||
switch (event) {
|
||||
case ACPI_EC_EVENT_OBF:
|
||||
if (acpi_ec_read_status(ec) & event) {
|
||||
ec->burst.expect_event = 0;
|
||||
case ACPI_EC_EVENT_IBE:
|
||||
if (~acpi_ec_read_status(ec) & event) {
|
||||
ec->intr.expect_event = 0;
|
||||
return_VALUE(0);
|
||||
}
|
||||
break;
|
||||
|
||||
case ACPI_EC_EVENT_IBE:
|
||||
if (~acpi_ec_read_status(ec) & event) {
|
||||
ec->burst.expect_event = 0;
|
||||
return_VALUE(0);
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
result = wait_event_timeout(ec->burst.wait,
|
||||
!ec->burst.expect_event,
|
||||
result = wait_event_timeout(ec->intr.wait,
|
||||
!ec->intr.expect_event,
|
||||
msecs_to_jiffies(ACPI_EC_DELAY));
|
||||
|
||||
ec->burst.expect_event = 0;
|
||||
ec->intr.expect_event = 0;
|
||||
smp_mb();
|
||||
|
||||
/*
|
||||
|
|
@ -255,7 +250,12 @@ static int acpi_ec_burst_wait(union acpi_ec *ec, unsigned int event)
|
|||
return_VALUE(-ETIME);
|
||||
}
|
||||
|
||||
static int acpi_ec_enter_burst_mode(union acpi_ec *ec)
|
||||
#ifdef ACPI_FUTURE_USAGE
|
||||
/*
|
||||
* Note: samsung nv5000 doesn't work with ec burst mode.
|
||||
* http://bugzilla.kernel.org/show_bug.cgi?id=4980
|
||||
*/
|
||||
int acpi_ec_enter_burst_mode(union acpi_ec *ec)
|
||||
{
|
||||
u32 tmp = 0;
|
||||
int status = 0;
|
||||
|
|
@ -270,45 +270,56 @@ static int acpi_ec_enter_burst_mode(union acpi_ec *ec)
|
|||
acpi_hw_low_level_write(8, ACPI_EC_BURST_ENABLE,
|
||||
&ec->common.command_addr);
|
||||
status = acpi_ec_wait(ec, ACPI_EC_EVENT_OBF);
|
||||
if (status)
|
||||
return_VALUE(-EINVAL);
|
||||
acpi_hw_low_level_read(8, &tmp, &ec->common.data_addr);
|
||||
if (tmp != 0x90) { /* Burst ACK byte */
|
||||
return_VALUE(-EINVAL);
|
||||
}
|
||||
}
|
||||
|
||||
atomic_set(&ec->burst.leaving_burst, 0);
|
||||
atomic_set(&ec->intr.leaving_burst, 0);
|
||||
return_VALUE(0);
|
||||
end:
|
||||
printk("Error in acpi_ec_wait\n");
|
||||
printk(KERN_WARNING PREFIX "Error in acpi_ec_wait\n");
|
||||
return_VALUE(-1);
|
||||
}
|
||||
|
||||
static int acpi_ec_leave_burst_mode(union acpi_ec *ec)
|
||||
int acpi_ec_leave_burst_mode(union acpi_ec *ec)
|
||||
{
|
||||
int status = 0;
|
||||
|
||||
ACPI_FUNCTION_TRACE("acpi_ec_leave_burst_mode");
|
||||
|
||||
atomic_set(&ec->burst.leaving_burst, 1);
|
||||
status = acpi_ec_read_status(ec);
|
||||
if (status != -EINVAL && (status & ACPI_EC_FLAG_BURST)){
|
||||
status = acpi_ec_wait(ec, ACPI_EC_FLAG_IBF);
|
||||
if(status)
|
||||
goto end;
|
||||
acpi_hw_low_level_write(8, ACPI_EC_BURST_DISABLE, &ec->common.command_addr);
|
||||
acpi_ec_wait(ec, ACPI_EC_FLAG_IBF);
|
||||
}
|
||||
atomic_set(&ec->intr.leaving_burst, 1);
|
||||
return_VALUE(0);
|
||||
end:
|
||||
printk(KERN_WARNING PREFIX "leave burst_mode:error\n");
|
||||
return_VALUE(-1);
|
||||
}
|
||||
#endif /* ACPI_FUTURE_USAGE */
|
||||
|
||||
static int acpi_ec_read(union acpi_ec *ec, u8 address, u32 * data)
|
||||
{
|
||||
if (acpi_ec_polling_mode)
|
||||
return acpi_ec_polling_read(ec, address, data);
|
||||
if (acpi_ec_poll_mode)
|
||||
return acpi_ec_poll_read(ec, address, data);
|
||||
else
|
||||
return acpi_ec_burst_read(ec, address, data);
|
||||
return acpi_ec_intr_read(ec, address, data);
|
||||
}
|
||||
static int acpi_ec_write(union acpi_ec *ec, u8 address, u8 data)
|
||||
{
|
||||
if (acpi_ec_polling_mode)
|
||||
return acpi_ec_polling_write(ec, address, data);
|
||||
if (acpi_ec_poll_mode)
|
||||
return acpi_ec_poll_write(ec, address, data);
|
||||
else
|
||||
return acpi_ec_burst_write(ec, address, data);
|
||||
return acpi_ec_intr_write(ec, address, data);
|
||||
}
|
||||
static int acpi_ec_polling_read(union acpi_ec *ec, u8 address, u32 * data)
|
||||
static int acpi_ec_poll_read(union acpi_ec *ec, u8 address, u32 * data)
|
||||
{
|
||||
acpi_status status = AE_OK;
|
||||
int result = 0;
|
||||
|
|
@ -328,7 +339,7 @@ static int acpi_ec_polling_read(union acpi_ec *ec, u8 address, u32 * data)
|
|||
return_VALUE(-ENODEV);
|
||||
}
|
||||
|
||||
spin_lock_irqsave(&ec->polling.lock, flags);
|
||||
spin_lock_irqsave(&ec->poll.lock, flags);
|
||||
|
||||
acpi_hw_low_level_write(8, ACPI_EC_COMMAND_READ,
|
||||
&ec->common.command_addr);
|
||||
|
|
@ -347,7 +358,7 @@ static int acpi_ec_polling_read(union acpi_ec *ec, u8 address, u32 * data)
|
|||
*data, address));
|
||||
|
||||
end:
|
||||
spin_unlock_irqrestore(&ec->polling.lock, flags);
|
||||
spin_unlock_irqrestore(&ec->poll.lock, flags);
|
||||
|
||||
if (ec->common.global_lock)
|
||||
acpi_release_global_lock(glk);
|
||||
|
|
@ -355,7 +366,7 @@ static int acpi_ec_polling_read(union acpi_ec *ec, u8 address, u32 * data)
|
|||
return_VALUE(result);
|
||||
}
|
||||
|
||||
static int acpi_ec_polling_write(union acpi_ec *ec, u8 address, u8 data)
|
||||
static int acpi_ec_poll_write(union acpi_ec *ec, u8 address, u8 data)
|
||||
{
|
||||
int result = 0;
|
||||
acpi_status status = AE_OK;
|
||||
|
|
@ -373,7 +384,7 @@ static int acpi_ec_polling_write(union acpi_ec *ec, u8 address, u8 data)
|
|||
return_VALUE(-ENODEV);
|
||||
}
|
||||
|
||||
spin_lock_irqsave(&ec->polling.lock, flags);
|
||||
spin_lock_irqsave(&ec->poll.lock, flags);
|
||||
|
||||
acpi_hw_low_level_write(8, ACPI_EC_COMMAND_WRITE,
|
||||
&ec->common.command_addr);
|
||||
|
|
@ -395,7 +406,7 @@ static int acpi_ec_polling_write(union acpi_ec *ec, u8 address, u8 data)
|
|||
data, address));
|
||||
|
||||
end:
|
||||
spin_unlock_irqrestore(&ec->polling.lock, flags);
|
||||
spin_unlock_irqrestore(&ec->poll.lock, flags);
|
||||
|
||||
if (ec->common.global_lock)
|
||||
acpi_release_global_lock(glk);
|
||||
|
|
@ -403,7 +414,7 @@ static int acpi_ec_polling_write(union acpi_ec *ec, u8 address, u8 data)
|
|||
return_VALUE(result);
|
||||
}
|
||||
|
||||
static int acpi_ec_burst_read(union acpi_ec *ec, u8 address, u32 * data)
|
||||
static int acpi_ec_intr_read(union acpi_ec *ec, u8 address, u32 * data)
|
||||
{
|
||||
int status = 0;
|
||||
u32 glk;
|
||||
|
|
@ -422,25 +433,24 @@ static int acpi_ec_burst_read(union acpi_ec *ec, u8 address, u32 * data)
|
|||
}
|
||||
|
||||
WARN_ON(in_interrupt());
|
||||
down(&ec->burst.sem);
|
||||
down(&ec->intr.sem);
|
||||
|
||||
acpi_ec_enter_burst_mode(ec);
|
||||
status = acpi_ec_wait(ec, ACPI_EC_EVENT_IBE);
|
||||
if (status) {
|
||||
printk("read EC, IB not empty\n");
|
||||
printk(KERN_DEBUG PREFIX "read EC, IB not empty\n");
|
||||
goto end;
|
||||
}
|
||||
acpi_hw_low_level_write(8, ACPI_EC_COMMAND_READ,
|
||||
&ec->common.command_addr);
|
||||
status = acpi_ec_wait(ec, ACPI_EC_EVENT_IBE);
|
||||
if (status) {
|
||||
printk("read EC, IB not empty\n");
|
||||
printk(KERN_DEBUG PREFIX "read EC, IB not empty\n");
|
||||
}
|
||||
|
||||
acpi_hw_low_level_write(8, address, &ec->common.data_addr);
|
||||
status = acpi_ec_wait(ec, ACPI_EC_EVENT_OBF);
|
||||
if (status) {
|
||||
printk("read EC, OB not full\n");
|
||||
printk(KERN_DEBUG PREFIX "read EC, OB not full\n");
|
||||
goto end;
|
||||
}
|
||||
acpi_hw_low_level_read(8, data, &ec->common.data_addr);
|
||||
|
|
@ -448,8 +458,7 @@ static int acpi_ec_burst_read(union acpi_ec *ec, u8 address, u32 * data)
|
|||
*data, address));
|
||||
|
||||
end:
|
||||
acpi_ec_leave_burst_mode(ec);
|
||||
up(&ec->burst.sem);
|
||||
up(&ec->intr.sem);
|
||||
|
||||
if (ec->common.global_lock)
|
||||
acpi_release_global_lock(glk);
|
||||
|
|
@ -457,7 +466,7 @@ static int acpi_ec_burst_read(union acpi_ec *ec, u8 address, u32 * data)
|
|||
return_VALUE(status);
|
||||
}
|
||||
|
||||
static int acpi_ec_burst_write(union acpi_ec *ec, u8 address, u8 data)
|
||||
static int acpi_ec_intr_write(union acpi_ec *ec, u8 address, u8 data)
|
||||
{
|
||||
int status = 0;
|
||||
u32 glk;
|
||||
|
|
@ -474,25 +483,23 @@ static int acpi_ec_burst_write(union acpi_ec *ec, u8 address, u8 data)
|
|||
}
|
||||
|
||||
WARN_ON(in_interrupt());
|
||||
down(&ec->burst.sem);
|
||||
|
||||
acpi_ec_enter_burst_mode(ec);
|
||||
down(&ec->intr.sem);
|
||||
|
||||
status = acpi_ec_wait(ec, ACPI_EC_EVENT_IBE);
|
||||
if (status) {
|
||||
printk("write EC, IB not empty\n");
|
||||
printk(KERN_DEBUG PREFIX "write EC, IB not empty\n");
|
||||
}
|
||||
acpi_hw_low_level_write(8, ACPI_EC_COMMAND_WRITE,
|
||||
&ec->common.command_addr);
|
||||
status = acpi_ec_wait(ec, ACPI_EC_EVENT_IBE);
|
||||
if (status) {
|
||||
printk("write EC, IB not empty\n");
|
||||
printk(KERN_DEBUG PREFIX "write EC, IB not empty\n");
|
||||
}
|
||||
|
||||
acpi_hw_low_level_write(8, address, &ec->common.data_addr);
|
||||
status = acpi_ec_wait(ec, ACPI_EC_EVENT_IBE);
|
||||
if (status) {
|
||||
printk("write EC, IB not empty\n");
|
||||
printk(KERN_DEBUG PREFIX "write EC, IB not empty\n");
|
||||
}
|
||||
|
||||
acpi_hw_low_level_write(8, data, &ec->common.data_addr);
|
||||
|
|
@ -500,8 +507,7 @@ static int acpi_ec_burst_write(union acpi_ec *ec, u8 address, u8 data)
|
|||
ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Wrote [%02x] to address [%02x]\n",
|
||||
data, address));
|
||||
|
||||
acpi_ec_leave_burst_mode(ec);
|
||||
up(&ec->burst.sem);
|
||||
up(&ec->intr.sem);
|
||||
|
||||
if (ec->common.global_lock)
|
||||
acpi_release_global_lock(glk);
|
||||
|
|
@ -553,12 +559,12 @@ EXPORT_SYMBOL(ec_write);
|
|||
|
||||
static int acpi_ec_query(union acpi_ec *ec, u32 * data)
|
||||
{
|
||||
if (acpi_ec_polling_mode)
|
||||
return acpi_ec_polling_query(ec, data);
|
||||
if (acpi_ec_poll_mode)
|
||||
return acpi_ec_poll_query(ec, data);
|
||||
else
|
||||
return acpi_ec_burst_query(ec, data);
|
||||
return acpi_ec_intr_query(ec, data);
|
||||
}
|
||||
static int acpi_ec_polling_query(union acpi_ec *ec, u32 * data)
|
||||
static int acpi_ec_poll_query(union acpi_ec *ec, u32 * data)
|
||||
{
|
||||
int result = 0;
|
||||
acpi_status status = AE_OK;
|
||||
|
|
@ -583,7 +589,7 @@ static int acpi_ec_polling_query(union acpi_ec *ec, u32 * data)
|
|||
* Note that successful completion of the query causes the ACPI_EC_SCI
|
||||
* bit to be cleared (and thus clearing the interrupt source).
|
||||
*/
|
||||
spin_lock_irqsave(&ec->polling.lock, flags);
|
||||
spin_lock_irqsave(&ec->poll.lock, flags);
|
||||
|
||||
acpi_hw_low_level_write(8, ACPI_EC_COMMAND_QUERY,
|
||||
&ec->common.command_addr);
|
||||
|
|
@ -596,14 +602,14 @@ static int acpi_ec_polling_query(union acpi_ec *ec, u32 * data)
|
|||
result = -ENODATA;
|
||||
|
||||
end:
|
||||
spin_unlock_irqrestore(&ec->polling.lock, flags);
|
||||
spin_unlock_irqrestore(&ec->poll.lock, flags);
|
||||
|
||||
if (ec->common.global_lock)
|
||||
acpi_release_global_lock(glk);
|
||||
|
||||
return_VALUE(result);
|
||||
}
|
||||
static int acpi_ec_burst_query(union acpi_ec *ec, u32 * data)
|
||||
static int acpi_ec_intr_query(union acpi_ec *ec, u32 * data)
|
||||
{
|
||||
int status = 0;
|
||||
u32 glk;
|
||||
|
|
@ -620,11 +626,11 @@ static int acpi_ec_burst_query(union acpi_ec *ec, u32 * data)
|
|||
return_VALUE(-ENODEV);
|
||||
}
|
||||
|
||||
down(&ec->burst.sem);
|
||||
down(&ec->intr.sem);
|
||||
|
||||
status = acpi_ec_wait(ec, ACPI_EC_EVENT_IBE);
|
||||
if (status) {
|
||||
printk("query EC, IB not empty\n");
|
||||
printk(KERN_DEBUG PREFIX "query EC, IB not empty\n");
|
||||
goto end;
|
||||
}
|
||||
/*
|
||||
|
|
@ -636,7 +642,7 @@ static int acpi_ec_burst_query(union acpi_ec *ec, u32 * data)
|
|||
&ec->common.command_addr);
|
||||
status = acpi_ec_wait(ec, ACPI_EC_EVENT_OBF);
|
||||
if (status) {
|
||||
printk("query EC, OB not full\n");
|
||||
printk(KERN_DEBUG PREFIX "query EC, OB not full\n");
|
||||
goto end;
|
||||
}
|
||||
|
||||
|
|
@ -645,7 +651,7 @@ static int acpi_ec_burst_query(union acpi_ec *ec, u32 * data)
|
|||
status = -ENODATA;
|
||||
|
||||
end:
|
||||
up(&ec->burst.sem);
|
||||
up(&ec->intr.sem);
|
||||
|
||||
if (ec->common.global_lock)
|
||||
acpi_release_global_lock(glk);
|
||||
|
|
@ -664,13 +670,13 @@ union acpi_ec_query_data {
|
|||
|
||||
static void acpi_ec_gpe_query(void *ec_cxt)
|
||||
{
|
||||
if (acpi_ec_polling_mode)
|
||||
acpi_ec_gpe_polling_query(ec_cxt);
|
||||
if (acpi_ec_poll_mode)
|
||||
acpi_ec_gpe_poll_query(ec_cxt);
|
||||
else
|
||||
acpi_ec_gpe_burst_query(ec_cxt);
|
||||
acpi_ec_gpe_intr_query(ec_cxt);
|
||||
}
|
||||
|
||||
static void acpi_ec_gpe_polling_query(void *ec_cxt)
|
||||
static void acpi_ec_gpe_poll_query(void *ec_cxt)
|
||||
{
|
||||
union acpi_ec *ec = (union acpi_ec *)ec_cxt;
|
||||
u32 value = 0;
|
||||
|
|
@ -685,9 +691,9 @@ static void acpi_ec_gpe_polling_query(void *ec_cxt)
|
|||
if (!ec_cxt)
|
||||
goto end;
|
||||
|
||||
spin_lock_irqsave(&ec->polling.lock, flags);
|
||||
spin_lock_irqsave(&ec->poll.lock, flags);
|
||||
acpi_hw_low_level_read(8, &value, &ec->common.command_addr);
|
||||
spin_unlock_irqrestore(&ec->polling.lock, flags);
|
||||
spin_unlock_irqrestore(&ec->poll.lock, flags);
|
||||
|
||||
/* TBD: Implement asynch events!
|
||||
* NOTE: All we care about are EC-SCI's. Other EC events are
|
||||
|
|
@ -711,7 +717,7 @@ static void acpi_ec_gpe_polling_query(void *ec_cxt)
|
|||
end:
|
||||
acpi_enable_gpe(NULL, ec->common.gpe_bit, ACPI_NOT_ISR);
|
||||
}
|
||||
static void acpi_ec_gpe_burst_query(void *ec_cxt)
|
||||
static void acpi_ec_gpe_intr_query(void *ec_cxt)
|
||||
{
|
||||
union acpi_ec *ec = (union acpi_ec *)ec_cxt;
|
||||
u32 value;
|
||||
|
|
@ -736,18 +742,18 @@ static void acpi_ec_gpe_burst_query(void *ec_cxt)
|
|||
|
||||
acpi_evaluate_object(ec->common.handle, object_name, NULL, NULL);
|
||||
end:
|
||||
atomic_dec(&ec->burst.pending_gpe);
|
||||
atomic_dec(&ec->intr.pending_gpe);
|
||||
return;
|
||||
}
|
||||
|
||||
static u32 acpi_ec_gpe_handler(void *data)
|
||||
{
|
||||
if (acpi_ec_polling_mode)
|
||||
return acpi_ec_gpe_polling_handler(data);
|
||||
if (acpi_ec_poll_mode)
|
||||
return acpi_ec_gpe_poll_handler(data);
|
||||
else
|
||||
return acpi_ec_gpe_burst_handler(data);
|
||||
return acpi_ec_gpe_intr_handler(data);
|
||||
}
|
||||
static u32 acpi_ec_gpe_polling_handler(void *data)
|
||||
static u32 acpi_ec_gpe_poll_handler(void *data)
|
||||
{
|
||||
acpi_status status = AE_OK;
|
||||
union acpi_ec *ec = (union acpi_ec *)data;
|
||||
|
|
@ -765,7 +771,7 @@ static u32 acpi_ec_gpe_polling_handler(void *data)
|
|||
else
|
||||
return ACPI_INTERRUPT_NOT_HANDLED;
|
||||
}
|
||||
static u32 acpi_ec_gpe_burst_handler(void *data)
|
||||
static u32 acpi_ec_gpe_intr_handler(void *data)
|
||||
{
|
||||
acpi_status status = AE_OK;
|
||||
u32 value;
|
||||
|
|
@ -777,22 +783,22 @@ static u32 acpi_ec_gpe_burst_handler(void *data)
|
|||
acpi_clear_gpe(NULL, ec->common.gpe_bit, ACPI_ISR);
|
||||
value = acpi_ec_read_status(ec);
|
||||
|
||||
switch (ec->burst.expect_event) {
|
||||
switch (ec->intr.expect_event) {
|
||||
case ACPI_EC_EVENT_OBF:
|
||||
if (!(value & ACPI_EC_FLAG_OBF))
|
||||
break;
|
||||
case ACPI_EC_EVENT_IBE:
|
||||
if ((value & ACPI_EC_FLAG_IBF))
|
||||
break;
|
||||
ec->burst.expect_event = 0;
|
||||
wake_up(&ec->burst.wait);
|
||||
ec->intr.expect_event = 0;
|
||||
wake_up(&ec->intr.wait);
|
||||
return ACPI_INTERRUPT_HANDLED;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
if (value & ACPI_EC_FLAG_SCI) {
|
||||
atomic_add(1, &ec->burst.pending_gpe);
|
||||
atomic_add(1, &ec->intr.pending_gpe);
|
||||
status = acpi_os_queue_for_execution(OSD_PRIORITY_GPE,
|
||||
acpi_ec_gpe_query, ec);
|
||||
return status == AE_OK ?
|
||||
|
|
@ -980,7 +986,7 @@ static int acpi_ec_remove_fs(struct acpi_device *device)
|
|||
Driver Interface
|
||||
-------------------------------------------------------------------------- */
|
||||
|
||||
static int acpi_ec_polling_add(struct acpi_device *device)
|
||||
static int acpi_ec_poll_add(struct acpi_device *device)
|
||||
{
|
||||
int result = 0;
|
||||
acpi_status status = AE_OK;
|
||||
|
|
@ -999,7 +1005,7 @@ static int acpi_ec_polling_add(struct acpi_device *device)
|
|||
|
||||
ec->common.handle = device->handle;
|
||||
ec->common.uid = -1;
|
||||
spin_lock_init(&ec->polling.lock);
|
||||
spin_lock_init(&ec->poll.lock);
|
||||
strcpy(acpi_device_name(device), ACPI_EC_DEVICE_NAME);
|
||||
strcpy(acpi_device_class(device), ACPI_EC_CLASS);
|
||||
acpi_driver_data(device) = ec;
|
||||
|
|
@ -1038,7 +1044,7 @@ static int acpi_ec_polling_add(struct acpi_device *device)
|
|||
if (result)
|
||||
goto end;
|
||||
|
||||
printk(KERN_INFO PREFIX "%s [%s] (gpe %d)\n",
|
||||
printk(KERN_INFO PREFIX "%s [%s] (gpe %d) polling mode.\n",
|
||||
acpi_device_name(device), acpi_device_bid(device),
|
||||
(u32) ec->common.gpe_bit);
|
||||
|
||||
|
|
@ -1051,7 +1057,7 @@ static int acpi_ec_polling_add(struct acpi_device *device)
|
|||
|
||||
return_VALUE(result);
|
||||
}
|
||||
static int acpi_ec_burst_add(struct acpi_device *device)
|
||||
static int acpi_ec_intr_add(struct acpi_device *device)
|
||||
{
|
||||
int result = 0;
|
||||
acpi_status status = AE_OK;
|
||||
|
|
@ -1070,10 +1076,10 @@ static int acpi_ec_burst_add(struct acpi_device *device)
|
|||
|
||||
ec->common.handle = device->handle;
|
||||
ec->common.uid = -1;
|
||||
atomic_set(&ec->burst.pending_gpe, 0);
|
||||
atomic_set(&ec->burst.leaving_burst, 1);
|
||||
init_MUTEX(&ec->burst.sem);
|
||||
init_waitqueue_head(&ec->burst.wait);
|
||||
atomic_set(&ec->intr.pending_gpe, 0);
|
||||
atomic_set(&ec->intr.leaving_burst, 1);
|
||||
init_MUTEX(&ec->intr.sem);
|
||||
init_waitqueue_head(&ec->intr.wait);
|
||||
strcpy(acpi_device_name(device), ACPI_EC_DEVICE_NAME);
|
||||
strcpy(acpi_device_class(device), ACPI_EC_CLASS);
|
||||
acpi_driver_data(device) = ec;
|
||||
|
|
@ -1112,8 +1118,7 @@ static int acpi_ec_burst_add(struct acpi_device *device)
|
|||
if (result)
|
||||
goto end;
|
||||
|
||||
printk("burst-mode-ec-10-Aug\n");
|
||||
printk(KERN_INFO PREFIX "%s [%s] (gpe %d)\n",
|
||||
printk(KERN_INFO PREFIX "%s [%s] (gpe %d) interrupt mode.\n",
|
||||
acpi_device_name(device), acpi_device_bid(device),
|
||||
(u32) ec->common.gpe_bit);
|
||||
|
||||
|
|
@ -1151,7 +1156,7 @@ acpi_ec_io_ports(struct acpi_resource *resource, void *context)
|
|||
union acpi_ec *ec = (union acpi_ec *)context;
|
||||
struct acpi_generic_address *addr;
|
||||
|
||||
if (resource->id != ACPI_RSTYPE_IO) {
|
||||
if (resource->type != ACPI_RESOURCE_TYPE_IO) {
|
||||
return AE_OK;
|
||||
}
|
||||
|
||||
|
|
@ -1171,7 +1176,7 @@ acpi_ec_io_ports(struct acpi_resource *resource, void *context)
|
|||
addr->address_space_id = ACPI_ADR_SPACE_SYSTEM_IO;
|
||||
addr->register_bit_width = 8;
|
||||
addr->register_bit_offset = 0;
|
||||
addr->address = resource->data.io.min_base_address;
|
||||
addr->address = resource->data.io.minimum;
|
||||
|
||||
return AE_OK;
|
||||
}
|
||||
|
|
@ -1267,16 +1272,16 @@ acpi_fake_ecdt_callback(acpi_handle handle,
|
|||
u32 Level, void *context, void **retval)
|
||||
{
|
||||
|
||||
if (acpi_ec_polling_mode)
|
||||
return acpi_fake_ecdt_polling_callback(handle,
|
||||
if (acpi_ec_poll_mode)
|
||||
return acpi_fake_ecdt_poll_callback(handle,
|
||||
Level, context, retval);
|
||||
else
|
||||
return acpi_fake_ecdt_burst_callback(handle,
|
||||
return acpi_fake_ecdt_intr_callback(handle,
|
||||
Level, context, retval);
|
||||
}
|
||||
|
||||
static acpi_status __init
|
||||
acpi_fake_ecdt_polling_callback(acpi_handle handle,
|
||||
acpi_fake_ecdt_poll_callback(acpi_handle handle,
|
||||
u32 Level, void *context, void **retval)
|
||||
{
|
||||
acpi_status status;
|
||||
|
|
@ -1295,7 +1300,7 @@ acpi_fake_ecdt_polling_callback(acpi_handle handle,
|
|||
&ec_ecdt->common.gpe_bit);
|
||||
if (ACPI_FAILURE(status))
|
||||
return status;
|
||||
spin_lock_init(&ec_ecdt->polling.lock);
|
||||
spin_lock_init(&ec_ecdt->poll.lock);
|
||||
ec_ecdt->common.global_lock = TRUE;
|
||||
ec_ecdt->common.handle = handle;
|
||||
|
||||
|
|
@ -1308,13 +1313,13 @@ acpi_fake_ecdt_polling_callback(acpi_handle handle,
|
|||
}
|
||||
|
||||
static acpi_status __init
|
||||
acpi_fake_ecdt_burst_callback(acpi_handle handle,
|
||||
acpi_fake_ecdt_intr_callback(acpi_handle handle,
|
||||
u32 Level, void *context, void **retval)
|
||||
{
|
||||
acpi_status status;
|
||||
|
||||
init_MUTEX(&ec_ecdt->burst.sem);
|
||||
init_waitqueue_head(&ec_ecdt->burst.wait);
|
||||
init_MUTEX(&ec_ecdt->intr.sem);
|
||||
init_waitqueue_head(&ec_ecdt->intr.wait);
|
||||
status = acpi_walk_resources(handle, METHOD_NAME__CRS,
|
||||
acpi_ec_io_ports, ec_ecdt);
|
||||
if (ACPI_FAILURE(status))
|
||||
|
|
@ -1380,13 +1385,13 @@ static int __init acpi_ec_fake_ecdt(void)
|
|||
|
||||
static int __init acpi_ec_get_real_ecdt(void)
|
||||
{
|
||||
if (acpi_ec_polling_mode)
|
||||
return acpi_ec_polling_get_real_ecdt();
|
||||
if (acpi_ec_poll_mode)
|
||||
return acpi_ec_poll_get_real_ecdt();
|
||||
else
|
||||
return acpi_ec_burst_get_real_ecdt();
|
||||
return acpi_ec_intr_get_real_ecdt();
|
||||
}
|
||||
|
||||
static int __init acpi_ec_polling_get_real_ecdt(void)
|
||||
static int __init acpi_ec_poll_get_real_ecdt(void)
|
||||
{
|
||||
acpi_status status;
|
||||
struct acpi_table_ecdt *ecdt_ptr;
|
||||
|
|
@ -1411,7 +1416,7 @@ static int __init acpi_ec_polling_get_real_ecdt(void)
|
|||
ec_ecdt->common.status_addr = ecdt_ptr->ec_control;
|
||||
ec_ecdt->common.data_addr = ecdt_ptr->ec_data;
|
||||
ec_ecdt->common.gpe_bit = ecdt_ptr->gpe_bit;
|
||||
spin_lock_init(&ec_ecdt->polling.lock);
|
||||
spin_lock_init(&ec_ecdt->poll.lock);
|
||||
/* use the GL just to be safe */
|
||||
ec_ecdt->common.global_lock = TRUE;
|
||||
ec_ecdt->common.uid = ecdt_ptr->uid;
|
||||
|
|
@ -1431,7 +1436,7 @@ static int __init acpi_ec_polling_get_real_ecdt(void)
|
|||
return -ENODEV;
|
||||
}
|
||||
|
||||
static int __init acpi_ec_burst_get_real_ecdt(void)
|
||||
static int __init acpi_ec_intr_get_real_ecdt(void)
|
||||
{
|
||||
acpi_status status;
|
||||
struct acpi_table_ecdt *ecdt_ptr;
|
||||
|
|
@ -1452,8 +1457,8 @@ static int __init acpi_ec_burst_get_real_ecdt(void)
|
|||
return -ENOMEM;
|
||||
memset(ec_ecdt, 0, sizeof(union acpi_ec));
|
||||
|
||||
init_MUTEX(&ec_ecdt->burst.sem);
|
||||
init_waitqueue_head(&ec_ecdt->burst.wait);
|
||||
init_MUTEX(&ec_ecdt->intr.sem);
|
||||
init_waitqueue_head(&ec_ecdt->intr.wait);
|
||||
ec_ecdt->common.command_addr = ecdt_ptr->ec_control;
|
||||
ec_ecdt->common.status_addr = ecdt_ptr->ec_control;
|
||||
ec_ecdt->common.data_addr = ecdt_ptr->ec_data;
|
||||
|
|
@ -1571,22 +1576,22 @@ static int __init acpi_fake_ecdt_setup(char *str)
|
|||
}
|
||||
|
||||
__setup("acpi_fake_ecdt", acpi_fake_ecdt_setup);
|
||||
static int __init acpi_ec_set_polling_mode(char *str)
|
||||
static int __init acpi_ec_set_intr_mode(char *str)
|
||||
{
|
||||
int burst;
|
||||
int intr;
|
||||
|
||||
if (!get_option(&str, &burst))
|
||||
if (!get_option(&str, &intr))
|
||||
return 0;
|
||||
|
||||
if (burst) {
|
||||
acpi_ec_polling_mode = EC_BURST;
|
||||
acpi_ec_driver.ops.add = acpi_ec_burst_add;
|
||||
if (intr) {
|
||||
acpi_ec_poll_mode = EC_INTR;
|
||||
acpi_ec_driver.ops.add = acpi_ec_intr_add;
|
||||
} else {
|
||||
acpi_ec_polling_mode = EC_POLLING;
|
||||
acpi_ec_driver.ops.add = acpi_ec_polling_add;
|
||||
acpi_ec_poll_mode = EC_POLL;
|
||||
acpi_ec_driver.ops.add = acpi_ec_poll_add;
|
||||
}
|
||||
printk(KERN_INFO PREFIX "EC %s mode.\n", burst ? "burst" : "polling");
|
||||
printk(KERN_INFO PREFIX "EC %s mode.\n", intr ? "interrupt" : "polling");
|
||||
return 0;
|
||||
}
|
||||
|
||||
__setup("ec_burst=", acpi_ec_set_polling_mode);
|
||||
__setup("ec_intr=", acpi_ec_set_intr_mode);
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
*****************************************************************************/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2000 - 2005, R. Byron Moore
|
||||
* Copyright (C) 2000 - 2006, R. Byron Moore
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
|
@ -73,7 +73,7 @@ acpi_status acpi_ev_initialize_events(void)
|
|||
/* Make sure we have ACPI tables */
|
||||
|
||||
if (!acpi_gbl_DSDT) {
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_WARN, "No ACPI tables present!\n"));
|
||||
ACPI_REPORT_WARNING(("No ACPI tables present!\n"));
|
||||
return_ACPI_STATUS(AE_NO_ACPI_TABLES);
|
||||
}
|
||||
|
||||
|
|
@ -98,6 +98,48 @@ acpi_status acpi_ev_initialize_events(void)
|
|||
return_ACPI_STATUS(status);
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: acpi_ev_install_fadt_gpes
|
||||
*
|
||||
* PARAMETERS: None
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Completes initialization of the FADT-defined GPE blocks
|
||||
* (0 and 1). This causes the _PRW methods to be run, so the HW
|
||||
* must be fully initialized at this point, including global lock
|
||||
* support.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
acpi_status acpi_ev_install_fadt_gpes(void)
|
||||
{
|
||||
acpi_status status;
|
||||
|
||||
ACPI_FUNCTION_TRACE("ev_install_fadt_gpes");
|
||||
|
||||
/* Namespace must be locked */
|
||||
|
||||
status = acpi_ut_acquire_mutex(ACPI_MTX_NAMESPACE);
|
||||
if (ACPI_FAILURE(status)) {
|
||||
return (status);
|
||||
}
|
||||
|
||||
/* FADT GPE Block 0 */
|
||||
|
||||
(void)acpi_ev_initialize_gpe_block(acpi_gbl_fadt_gpe_device,
|
||||
acpi_gbl_gpe_fadt_blocks[0]);
|
||||
|
||||
/* FADT GPE Block 1 */
|
||||
|
||||
(void)acpi_ev_initialize_gpe_block(acpi_gbl_fadt_gpe_device,
|
||||
acpi_gbl_gpe_fadt_blocks[1]);
|
||||
|
||||
(void)acpi_ut_release_mutex(ACPI_MTX_NAMESPACE);
|
||||
return_ACPI_STATUS(AE_OK);
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: acpi_ev_install_xrupt_handlers
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
*****************************************************************************/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2000 - 2005, R. Byron Moore
|
||||
* Copyright (C) 2000 - 2006, R. Byron Moore
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
|
@ -372,14 +372,14 @@ struct acpi_gpe_event_info *acpi_ev_get_gpe_event_info(acpi_handle gpe_device,
|
|||
|
||||
u32 acpi_ev_gpe_detect(struct acpi_gpe_xrupt_info * gpe_xrupt_list)
|
||||
{
|
||||
u32 int_status = ACPI_INTERRUPT_NOT_HANDLED;
|
||||
u8 enabled_status_byte;
|
||||
struct acpi_gpe_register_info *gpe_register_info;
|
||||
u32 status_reg;
|
||||
u32 enable_reg;
|
||||
u32 flags;
|
||||
acpi_status status;
|
||||
struct acpi_gpe_block_info *gpe_block;
|
||||
struct acpi_gpe_register_info *gpe_register_info;
|
||||
u32 int_status = ACPI_INTERRUPT_NOT_HANDLED;
|
||||
u8 enabled_status_byte;
|
||||
u32 status_reg;
|
||||
u32 enable_reg;
|
||||
acpi_native_uint flags;
|
||||
acpi_native_uint i;
|
||||
acpi_native_uint j;
|
||||
|
||||
|
|
@ -599,8 +599,10 @@ acpi_ev_gpe_dispatch(struct acpi_gpe_event_info *gpe_event_info, u32 gpe_number)
|
|||
ACPI_GPE_EDGE_TRIGGERED) {
|
||||
status = acpi_hw_clear_gpe(gpe_event_info);
|
||||
if (ACPI_FAILURE(status)) {
|
||||
ACPI_REPORT_ERROR(("acpi_ev_gpe_dispatch: %s, Unable to clear GPE[%2X]\n", acpi_format_exception(status), gpe_number));
|
||||
return_VALUE(ACPI_INTERRUPT_NOT_HANDLED);
|
||||
ACPI_REPORT_ERROR(("%s, Unable to clear GPE[%2X]\n",
|
||||
acpi_format_exception(status),
|
||||
gpe_number));
|
||||
return_UINT32(ACPI_INTERRUPT_NOT_HANDLED);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -637,8 +639,8 @@ acpi_ev_gpe_dispatch(struct acpi_gpe_event_info *gpe_event_info, u32 gpe_number)
|
|||
ACPI_GPE_LEVEL_TRIGGERED) {
|
||||
status = acpi_hw_clear_gpe(gpe_event_info);
|
||||
if (ACPI_FAILURE(status)) {
|
||||
ACPI_REPORT_ERROR(("acpi_ev_gpe_dispatch: %s, Unable to clear GPE[%2X]\n", acpi_format_exception(status), gpe_number));
|
||||
return_VALUE(ACPI_INTERRUPT_NOT_HANDLED);
|
||||
ACPI_REPORT_ERROR(("%s, Unable to clear GPE[%2X]\n", acpi_format_exception(status), gpe_number));
|
||||
return_UINT32(ACPI_INTERRUPT_NOT_HANDLED);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
|
@ -651,8 +653,10 @@ acpi_ev_gpe_dispatch(struct acpi_gpe_event_info *gpe_event_info, u32 gpe_number)
|
|||
*/
|
||||
status = acpi_ev_disable_gpe(gpe_event_info);
|
||||
if (ACPI_FAILURE(status)) {
|
||||
ACPI_REPORT_ERROR(("acpi_ev_gpe_dispatch: %s, Unable to disable GPE[%2X]\n", acpi_format_exception(status), gpe_number));
|
||||
return_VALUE(ACPI_INTERRUPT_NOT_HANDLED);
|
||||
ACPI_REPORT_ERROR(("%s, Unable to disable GPE[%2X]\n",
|
||||
acpi_format_exception(status),
|
||||
gpe_number));
|
||||
return_UINT32(ACPI_INTERRUPT_NOT_HANDLED);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -663,7 +667,7 @@ acpi_ev_gpe_dispatch(struct acpi_gpe_event_info *gpe_event_info, u32 gpe_number)
|
|||
acpi_ev_asynch_execute_gpe_method,
|
||||
gpe_event_info);
|
||||
if (ACPI_FAILURE(status)) {
|
||||
ACPI_REPORT_ERROR(("acpi_ev_gpe_dispatch: %s, Unable to queue handler for GPE[%2X] - event disabled\n", acpi_format_exception(status), gpe_number));
|
||||
ACPI_REPORT_ERROR(("%s, Unable to queue handler for GPE[%2X] - event disabled\n", acpi_format_exception(status), gpe_number));
|
||||
}
|
||||
break;
|
||||
|
||||
|
|
@ -671,7 +675,7 @@ acpi_ev_gpe_dispatch(struct acpi_gpe_event_info *gpe_event_info, u32 gpe_number)
|
|||
|
||||
/* No handler or method to run! */
|
||||
|
||||
ACPI_REPORT_ERROR(("acpi_ev_gpe_dispatch: No handler or method for GPE[%2X], disabling event\n", gpe_number));
|
||||
ACPI_REPORT_ERROR(("No handler or method for GPE[%2X], disabling event\n", gpe_number));
|
||||
|
||||
/*
|
||||
* Disable the GPE. The GPE will remain disabled until the ACPI
|
||||
|
|
@ -679,13 +683,15 @@ acpi_ev_gpe_dispatch(struct acpi_gpe_event_info *gpe_event_info, u32 gpe_number)
|
|||
*/
|
||||
status = acpi_ev_disable_gpe(gpe_event_info);
|
||||
if (ACPI_FAILURE(status)) {
|
||||
ACPI_REPORT_ERROR(("acpi_ev_gpe_dispatch: %s, Unable to disable GPE[%2X]\n", acpi_format_exception(status), gpe_number));
|
||||
return_VALUE(ACPI_INTERRUPT_NOT_HANDLED);
|
||||
ACPI_REPORT_ERROR(("%s, Unable to disable GPE[%2X]\n",
|
||||
acpi_format_exception(status),
|
||||
gpe_number));
|
||||
return_UINT32(ACPI_INTERRUPT_NOT_HANDLED);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
return_VALUE(ACPI_INTERRUPT_HANDLED);
|
||||
return_UINT32(ACPI_INTERRUPT_HANDLED);
|
||||
}
|
||||
|
||||
#ifdef ACPI_GPE_NOTIFY_CHECK
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
*****************************************************************************/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2000 - 2005, R. Byron Moore
|
||||
* Copyright (C) 2000 - 2006, R. Byron Moore
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
|
@ -78,7 +78,7 @@ acpi_ev_create_gpe_info_blocks(struct acpi_gpe_block_info *gpe_block);
|
|||
*
|
||||
* RETURN: TRUE if the gpe_event is valid
|
||||
*
|
||||
* DESCRIPTION: Validate a GPE event. DO NOT CALL FROM INTERRUPT LEVEL.
|
||||
* DESCRIPTION: Validate a GPE event. DO NOT CALL FROM INTERRUPT LEVEL.
|
||||
* Should be called only when the GPE lists are semaphore locked
|
||||
* and not subject to change.
|
||||
*
|
||||
|
|
@ -136,7 +136,7 @@ acpi_status acpi_ev_walk_gpe_list(ACPI_GPE_CALLBACK gpe_walk_callback)
|
|||
struct acpi_gpe_block_info *gpe_block;
|
||||
struct acpi_gpe_xrupt_info *gpe_xrupt_info;
|
||||
acpi_status status = AE_OK;
|
||||
u32 flags;
|
||||
acpi_native_uint flags;
|
||||
|
||||
ACPI_FUNCTION_TRACE("ev_walk_gpe_list");
|
||||
|
||||
|
|
@ -264,7 +264,7 @@ acpi_ev_save_method_info(acpi_handle obj_handle,
|
|||
* 2) Edge/Level determination is based on the 2nd character
|
||||
* of the method name
|
||||
*
|
||||
* NOTE: Default GPE type is RUNTIME. May be changed later to WAKE
|
||||
* NOTE: Default GPE type is RUNTIME. May be changed later to WAKE
|
||||
* if a _PRW object is found that points to this GPE.
|
||||
*/
|
||||
switch (name[1]) {
|
||||
|
|
@ -279,9 +279,7 @@ acpi_ev_save_method_info(acpi_handle obj_handle,
|
|||
default:
|
||||
/* Unknown method type, just ignore it! */
|
||||
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
||||
"Unknown GPE method type: %s (name not of form _Lxx or _Exx)\n",
|
||||
name));
|
||||
ACPI_REPORT_ERROR(("Unknown GPE method type: %s (name not of form _Lxx or _Exx)\n", name));
|
||||
return_ACPI_STATUS(AE_OK);
|
||||
}
|
||||
|
||||
|
|
@ -291,9 +289,7 @@ acpi_ev_save_method_info(acpi_handle obj_handle,
|
|||
if (gpe_number == ACPI_UINT32_MAX) {
|
||||
/* Conversion failed; invalid method, just ignore it */
|
||||
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
||||
"Could not extract GPE number from name: %s (name is not of form _Lxx or _Exx)\n",
|
||||
name));
|
||||
ACPI_REPORT_ERROR(("Could not extract GPE number from name: %s (name is not of form _Lxx or _Exx)\n", name));
|
||||
return_ACPI_STATUS(AE_OK);
|
||||
}
|
||||
|
||||
|
|
@ -313,14 +309,14 @@ acpi_ev_save_method_info(acpi_handle obj_handle,
|
|||
|
||||
/*
|
||||
* Now we can add this information to the gpe_event_info block
|
||||
* for use during dispatch of this GPE. Default type is RUNTIME, although
|
||||
* for use during dispatch of this GPE. Default type is RUNTIME, although
|
||||
* this may change when the _PRW methods are executed later.
|
||||
*/
|
||||
gpe_event_info =
|
||||
&gpe_block->event_info[gpe_number - gpe_block->block_base_number];
|
||||
|
||||
gpe_event_info->flags = (u8) (type | ACPI_GPE_DISPATCH_METHOD |
|
||||
ACPI_GPE_TYPE_RUNTIME);
|
||||
gpe_event_info->flags = (u8)
|
||||
(type | ACPI_GPE_DISPATCH_METHOD | ACPI_GPE_TYPE_RUNTIME);
|
||||
|
||||
gpe_event_info->dispatch.method_node =
|
||||
(struct acpi_namespace_node *)obj_handle;
|
||||
|
|
@ -341,11 +337,11 @@ acpi_ev_save_method_info(acpi_handle obj_handle,
|
|||
*
|
||||
* PARAMETERS: Callback from walk_namespace
|
||||
*
|
||||
* RETURN: Status. NOTE: We ignore errors so that the _PRW walk is
|
||||
* RETURN: Status. NOTE: We ignore errors so that the _PRW walk is
|
||||
* not aborted on a single _PRW failure.
|
||||
*
|
||||
* DESCRIPTION: Called from acpi_walk_namespace. Expects each object to be a
|
||||
* Device. Run the _PRW method. If present, extract the GPE
|
||||
* Device. Run the _PRW method. If present, extract the GPE
|
||||
* number and mark the GPE as a WAKE GPE.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
|
@ -443,6 +439,7 @@ acpi_ev_match_prw_and_gpe(acpi_handle obj_handle,
|
|||
|
||||
gpe_event_info->flags &=
|
||||
~(ACPI_GPE_WAKE_ENABLED | ACPI_GPE_RUN_ENABLED);
|
||||
|
||||
status =
|
||||
acpi_ev_set_gpe_type(gpe_event_info, ACPI_GPE_TYPE_WAKE);
|
||||
if (ACPI_FAILURE(status)) {
|
||||
|
|
@ -466,7 +463,7 @@ acpi_ev_match_prw_and_gpe(acpi_handle obj_handle,
|
|||
*
|
||||
* RETURN: A GPE interrupt block
|
||||
*
|
||||
* DESCRIPTION: Get or Create a GPE interrupt block. There is one interrupt
|
||||
* DESCRIPTION: Get or Create a GPE interrupt block. There is one interrupt
|
||||
* block per unique interrupt level used for GPEs.
|
||||
* Should be called only when the GPE lists are semaphore locked
|
||||
* and not subject to change.
|
||||
|
|
@ -479,7 +476,7 @@ static struct acpi_gpe_xrupt_info *acpi_ev_get_gpe_xrupt_block(u32
|
|||
struct acpi_gpe_xrupt_info *next_gpe_xrupt;
|
||||
struct acpi_gpe_xrupt_info *gpe_xrupt;
|
||||
acpi_status status;
|
||||
u32 flags;
|
||||
acpi_native_uint flags;
|
||||
|
||||
ACPI_FUNCTION_TRACE("ev_get_gpe_xrupt_block");
|
||||
|
||||
|
|
@ -526,9 +523,7 @@ static struct acpi_gpe_xrupt_info *acpi_ev_get_gpe_xrupt_block(u32
|
|||
acpi_ev_gpe_xrupt_handler,
|
||||
gpe_xrupt);
|
||||
if (ACPI_FAILURE(status)) {
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
||||
"Could not install GPE interrupt handler at level 0x%X\n",
|
||||
interrupt_number));
|
||||
ACPI_REPORT_ERROR(("Could not install GPE interrupt handler at level 0x%X\n", interrupt_number));
|
||||
return_PTR(NULL);
|
||||
}
|
||||
}
|
||||
|
|
@ -553,7 +548,7 @@ static acpi_status
|
|||
acpi_ev_delete_gpe_xrupt(struct acpi_gpe_xrupt_info *gpe_xrupt)
|
||||
{
|
||||
acpi_status status;
|
||||
u32 flags;
|
||||
acpi_native_uint flags;
|
||||
|
||||
ACPI_FUNCTION_TRACE("ev_delete_gpe_xrupt");
|
||||
|
||||
|
|
@ -566,8 +561,9 @@ acpi_ev_delete_gpe_xrupt(struct acpi_gpe_xrupt_info *gpe_xrupt)
|
|||
|
||||
/* Disable this interrupt */
|
||||
|
||||
status = acpi_os_remove_interrupt_handler(gpe_xrupt->interrupt_number,
|
||||
acpi_ev_gpe_xrupt_handler);
|
||||
status =
|
||||
acpi_os_remove_interrupt_handler(gpe_xrupt->interrupt_number,
|
||||
acpi_ev_gpe_xrupt_handler);
|
||||
if (ACPI_FAILURE(status)) {
|
||||
return_ACPI_STATUS(status);
|
||||
}
|
||||
|
|
@ -610,7 +606,7 @@ acpi_ev_install_gpe_block(struct acpi_gpe_block_info *gpe_block,
|
|||
struct acpi_gpe_block_info *next_gpe_block;
|
||||
struct acpi_gpe_xrupt_info *gpe_xrupt_block;
|
||||
acpi_status status;
|
||||
u32 flags;
|
||||
acpi_native_uint flags;
|
||||
|
||||
ACPI_FUNCTION_TRACE("ev_install_gpe_block");
|
||||
|
||||
|
|
@ -663,7 +659,7 @@ acpi_ev_install_gpe_block(struct acpi_gpe_block_info *gpe_block,
|
|||
acpi_status acpi_ev_delete_gpe_block(struct acpi_gpe_block_info *gpe_block)
|
||||
{
|
||||
acpi_status status;
|
||||
u32 flags;
|
||||
acpi_native_uint flags;
|
||||
|
||||
ACPI_FUNCTION_TRACE("ev_install_gpe_block");
|
||||
|
||||
|
|
@ -743,22 +739,20 @@ acpi_ev_create_gpe_info_blocks(struct acpi_gpe_block_info *gpe_block)
|
|||
sizeof(struct
|
||||
acpi_gpe_register_info));
|
||||
if (!gpe_register_info) {
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
||||
"Could not allocate the gpe_register_info table\n"));
|
||||
ACPI_REPORT_ERROR(("Could not allocate the gpe_register_info table\n"));
|
||||
return_ACPI_STATUS(AE_NO_MEMORY);
|
||||
}
|
||||
|
||||
/*
|
||||
* Allocate the GPE event_info block. There are eight distinct GPEs
|
||||
* per register. Initialization to zeros is sufficient.
|
||||
* per register. Initialization to zeros is sufficient.
|
||||
*/
|
||||
gpe_event_info = ACPI_MEM_CALLOCATE(((acpi_size) gpe_block->
|
||||
register_count *
|
||||
ACPI_GPE_REGISTER_WIDTH) *
|
||||
sizeof(struct acpi_gpe_event_info));
|
||||
if (!gpe_event_info) {
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
||||
"Could not allocate the gpe_event_info table\n"));
|
||||
ACPI_REPORT_ERROR(("Could not allocate the gpe_event_info table\n"));
|
||||
status = AE_NO_MEMORY;
|
||||
goto error_exit;
|
||||
}
|
||||
|
|
@ -769,9 +763,9 @@ acpi_ev_create_gpe_info_blocks(struct acpi_gpe_block_info *gpe_block)
|
|||
gpe_block->event_info = gpe_event_info;
|
||||
|
||||
/*
|
||||
* Initialize the GPE Register and Event structures. A goal of these
|
||||
* Initialize the GPE Register and Event structures. A goal of these
|
||||
* tables is to hide the fact that there are two separate GPE register sets
|
||||
* in a given gpe hardware block, the status registers occupy the first half,
|
||||
* in a given GPE hardware block, the status registers occupy the first half,
|
||||
* and the enable registers occupy the second half.
|
||||
*/
|
||||
this_register = gpe_register_info;
|
||||
|
|
@ -812,11 +806,8 @@ acpi_ev_create_gpe_info_blocks(struct acpi_gpe_block_info *gpe_block)
|
|||
this_event++;
|
||||
}
|
||||
|
||||
/*
|
||||
* Clear the status/enable registers. Note that status registers
|
||||
* are cleared by writing a '1', while enable registers are cleared
|
||||
* by writing a '0'.
|
||||
*/
|
||||
/* Disable all GPEs within this register */
|
||||
|
||||
status = acpi_hw_low_level_write(ACPI_GPE_REGISTER_WIDTH, 0x00,
|
||||
&this_register->
|
||||
enable_address);
|
||||
|
|
@ -824,6 +815,8 @@ acpi_ev_create_gpe_info_blocks(struct acpi_gpe_block_info *gpe_block)
|
|||
goto error_exit;
|
||||
}
|
||||
|
||||
/* Clear any pending GPE events within this register */
|
||||
|
||||
status = acpi_hw_low_level_write(ACPI_GPE_REGISTER_WIDTH, 0xFF,
|
||||
&this_register->
|
||||
status_address);
|
||||
|
|
@ -860,7 +853,9 @@ acpi_ev_create_gpe_info_blocks(struct acpi_gpe_block_info *gpe_block)
|
|||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Create and Install a block of GPE registers
|
||||
* DESCRIPTION: Create and Install a block of GPE registers. All GPEs within
|
||||
* the block are disabled at exit.
|
||||
* Note: Assumes namespace is locked.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
|
|
@ -872,14 +867,8 @@ acpi_ev_create_gpe_block(struct acpi_namespace_node *gpe_device,
|
|||
u32 interrupt_number,
|
||||
struct acpi_gpe_block_info **return_gpe_block)
|
||||
{
|
||||
struct acpi_gpe_block_info *gpe_block;
|
||||
struct acpi_gpe_event_info *gpe_event_info;
|
||||
acpi_native_uint i;
|
||||
acpi_native_uint j;
|
||||
u32 wake_gpe_count;
|
||||
u32 gpe_enabled_count;
|
||||
acpi_status status;
|
||||
struct acpi_gpe_walk_info gpe_info;
|
||||
struct acpi_gpe_block_info *gpe_block;
|
||||
|
||||
ACPI_FUNCTION_TRACE("ev_create_gpe_block");
|
||||
|
||||
|
|
@ -896,22 +885,24 @@ acpi_ev_create_gpe_block(struct acpi_namespace_node *gpe_device,
|
|||
|
||||
/* Initialize the new GPE block */
|
||||
|
||||
gpe_block->node = gpe_device;
|
||||
gpe_block->register_count = register_count;
|
||||
gpe_block->block_base_number = gpe_block_base_number;
|
||||
gpe_block->node = gpe_device;
|
||||
|
||||
ACPI_MEMCPY(&gpe_block->block_address, gpe_block_address,
|
||||
sizeof(struct acpi_generic_address));
|
||||
|
||||
/* Create the register_info and event_info sub-structures */
|
||||
|
||||
/*
|
||||
* Create the register_info and event_info sub-structures
|
||||
* Note: disables and clears all GPEs in the block
|
||||
*/
|
||||
status = acpi_ev_create_gpe_info_blocks(gpe_block);
|
||||
if (ACPI_FAILURE(status)) {
|
||||
ACPI_MEM_FREE(gpe_block);
|
||||
return_ACPI_STATUS(status);
|
||||
}
|
||||
|
||||
/* Install the new block in the global list(s) */
|
||||
/* Install the new block in the global lists */
|
||||
|
||||
status = acpi_ev_install_gpe_block(gpe_block, interrupt_number);
|
||||
if (ACPI_FAILURE(status)) {
|
||||
|
|
@ -926,16 +917,70 @@ acpi_ev_create_gpe_block(struct acpi_namespace_node *gpe_device,
|
|||
acpi_ev_save_method_info, gpe_block,
|
||||
NULL);
|
||||
|
||||
/* Return the new block */
|
||||
|
||||
if (return_gpe_block) {
|
||||
(*return_gpe_block) = gpe_block;
|
||||
}
|
||||
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_INIT,
|
||||
"GPE %02X to %02X [%4.4s] %u regs on int 0x%X\n",
|
||||
(u32) gpe_block->block_base_number,
|
||||
(u32) (gpe_block->block_base_number +
|
||||
((gpe_block->register_count *
|
||||
ACPI_GPE_REGISTER_WIDTH) - 1)),
|
||||
gpe_device->name.ascii, gpe_block->register_count,
|
||||
interrupt_number));
|
||||
|
||||
return_ACPI_STATUS(AE_OK);
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: acpi_ev_initialize_gpe_block
|
||||
*
|
||||
* PARAMETERS: gpe_device - Handle to the parent GPE block
|
||||
* gpe_block - Gpe Block info
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Initialize and enable a GPE block. First find and run any
|
||||
* _PRT methods associated with the block, then enable the
|
||||
* appropriate GPEs.
|
||||
* Note: Assumes namespace is locked.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
acpi_status
|
||||
acpi_ev_initialize_gpe_block(struct acpi_namespace_node *gpe_device,
|
||||
struct acpi_gpe_block_info *gpe_block)
|
||||
{
|
||||
acpi_status status;
|
||||
struct acpi_gpe_event_info *gpe_event_info;
|
||||
struct acpi_gpe_walk_info gpe_info;
|
||||
u32 wake_gpe_count;
|
||||
u32 gpe_enabled_count;
|
||||
acpi_native_uint i;
|
||||
acpi_native_uint j;
|
||||
|
||||
ACPI_FUNCTION_TRACE("ev_initialize_gpe_block");
|
||||
|
||||
/* Ignore a null GPE block (e.g., if no GPE block 1 exists) */
|
||||
|
||||
if (!gpe_block) {
|
||||
return_ACPI_STATUS(AE_OK);
|
||||
}
|
||||
|
||||
/*
|
||||
* Runtime option: Should Wake GPEs be enabled at runtime? The default
|
||||
* is No, they should only be enabled just as the machine goes to sleep.
|
||||
* Runtime option: Should wake GPEs be enabled at runtime? The default
|
||||
* is no, they should only be enabled just as the machine goes to sleep.
|
||||
*/
|
||||
if (acpi_gbl_leave_wake_gpes_disabled) {
|
||||
/*
|
||||
* Differentiate RUNTIME vs WAKE GPEs, via the _PRW control methods.
|
||||
* (Each GPE that has one or more _PRWs that reference it is by
|
||||
* definition a WAKE GPE and will not be enabled while the machine
|
||||
* is running.)
|
||||
* Differentiate runtime vs wake GPEs, via the _PRW control methods.
|
||||
* Each GPE that has one or more _PRWs that reference it is by
|
||||
* definition a wake GPE and will not be enabled while the machine
|
||||
* is running.
|
||||
*/
|
||||
gpe_info.gpe_block = gpe_block;
|
||||
gpe_info.gpe_device = gpe_device;
|
||||
|
|
@ -948,9 +993,12 @@ acpi_ev_create_gpe_block(struct acpi_namespace_node *gpe_device,
|
|||
}
|
||||
|
||||
/*
|
||||
* Enable all GPEs in this block that are 1) "runtime" or "run/wake" GPEs,
|
||||
* and 2) have a corresponding _Lxx or _Exx method. All other GPEs must
|
||||
* be enabled via the acpi_enable_gpe() external interface.
|
||||
* Enable all GPEs in this block that have these attributes:
|
||||
* 1) are "runtime" or "run/wake" GPEs, and
|
||||
* 2) have a corresponding _Lxx or _Exx method
|
||||
*
|
||||
* Any other GPEs within this block must be enabled via the acpi_enable_gpe()
|
||||
* external interface.
|
||||
*/
|
||||
wake_gpe_count = 0;
|
||||
gpe_enabled_count = 0;
|
||||
|
|
@ -976,32 +1024,19 @@ acpi_ev_create_gpe_block(struct acpi_namespace_node *gpe_device,
|
|||
}
|
||||
}
|
||||
|
||||
/* Dump info about this GPE block */
|
||||
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_INIT,
|
||||
"GPE %02X to %02X [%4.4s] %u regs on int 0x%X\n",
|
||||
(u32) gpe_block->block_base_number,
|
||||
(u32) (gpe_block->block_base_number +
|
||||
((gpe_block->register_count *
|
||||
ACPI_GPE_REGISTER_WIDTH) - 1)),
|
||||
gpe_device->name.ascii, gpe_block->register_count,
|
||||
interrupt_number));
|
||||
|
||||
/* Enable all valid GPEs found above */
|
||||
|
||||
status = acpi_hw_enable_runtime_gpe_block(NULL, gpe_block);
|
||||
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_INIT,
|
||||
"Found %u Wake, Enabled %u Runtime GPEs in this block\n",
|
||||
wake_gpe_count, gpe_enabled_count));
|
||||
|
||||
/* Return the new block */
|
||||
/* Enable all valid runtime GPEs found above */
|
||||
|
||||
if (return_gpe_block) {
|
||||
(*return_gpe_block) = gpe_block;
|
||||
status = acpi_hw_enable_runtime_gpe_block(NULL, gpe_block);
|
||||
if (ACPI_FAILURE(status)) {
|
||||
ACPI_REPORT_ERROR(("Could not enable GPEs in gpe_block %p\n",
|
||||
gpe_block));
|
||||
}
|
||||
|
||||
return_ACPI_STATUS(AE_OK);
|
||||
return_ACPI_STATUS(status);
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
*****************************************************************************/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2000 - 2005, R. Byron Moore
|
||||
* Copyright (C) 2000 - 2006, R. Byron Moore
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
|
@ -542,9 +542,7 @@ void acpi_ev_terminate(void)
|
|||
for (i = 0; i < ACPI_NUM_FIXED_EVENTS; i++) {
|
||||
status = acpi_disable_event((u32) i, 0);
|
||||
if (ACPI_FAILURE(status)) {
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
||||
"Could not disable fixed event %d\n",
|
||||
(u32) i));
|
||||
ACPI_REPORT_ERROR(("Could not disable fixed event %d\n", (u32) i));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -556,8 +554,7 @@ void acpi_ev_terminate(void)
|
|||
|
||||
status = acpi_ev_remove_sci_handler();
|
||||
if (ACPI_FAILURE(status)) {
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
||||
"Could not remove SCI handler\n"));
|
||||
ACPI_REPORT_ERROR(("Could not remove SCI handler\n"));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -570,8 +567,7 @@ void acpi_ev_terminate(void)
|
|||
if (acpi_gbl_original_mode == ACPI_SYS_MODE_LEGACY) {
|
||||
status = acpi_disable();
|
||||
if (ACPI_FAILURE(status)) {
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_WARN,
|
||||
"acpi_disable failed\n"));
|
||||
ACPI_REPORT_WARNING(("acpi_disable failed\n"));
|
||||
}
|
||||
}
|
||||
return_VOID;
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
*****************************************************************************/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2000 - 2005, R. Byron Moore
|
||||
* Copyright (C) 2000 - 2006, R. Byron Moore
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
|
@ -295,12 +295,11 @@ acpi_ev_address_space_dispatch(union acpi_operand_object *region_obj,
|
|||
|
||||
handler_desc = region_obj->region.handler;
|
||||
if (!handler_desc) {
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
||||
"No handler for Region [%4.4s] (%p) [%s]\n",
|
||||
acpi_ut_get_node_name(region_obj->region.
|
||||
node), region_obj,
|
||||
acpi_ut_get_region_name(region_obj->region.
|
||||
space_id)));
|
||||
ACPI_REPORT_ERROR(("No handler for Region [%4.4s] (%p) [%s]\n",
|
||||
acpi_ut_get_node_name(region_obj->region.
|
||||
node), region_obj,
|
||||
acpi_ut_get_region_name(region_obj->region.
|
||||
space_id)));
|
||||
|
||||
return_ACPI_STATUS(AE_NOT_EXIST);
|
||||
}
|
||||
|
|
@ -317,12 +316,7 @@ acpi_ev_address_space_dispatch(union acpi_operand_object *region_obj,
|
|||
if (!region_setup) {
|
||||
/* No initialization routine, exit with error */
|
||||
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
||||
"No init routine for region(%p) [%s]\n",
|
||||
region_obj,
|
||||
acpi_ut_get_region_name(region_obj->
|
||||
region.
|
||||
space_id)));
|
||||
ACPI_REPORT_ERROR(("No init routine for region(%p) [%s]\n", region_obj, acpi_ut_get_region_name(region_obj->region.space_id)));
|
||||
return_ACPI_STATUS(AE_NOT_EXIST);
|
||||
}
|
||||
|
||||
|
|
@ -347,12 +341,11 @@ acpi_ev_address_space_dispatch(union acpi_operand_object *region_obj,
|
|||
/* Check for failure of the Region Setup */
|
||||
|
||||
if (ACPI_FAILURE(status)) {
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
||||
"Region Init: %s [%s]\n",
|
||||
acpi_format_exception(status),
|
||||
acpi_ut_get_region_name(region_obj->
|
||||
region.
|
||||
space_id)));
|
||||
ACPI_REPORT_ERROR(("Region Initialization: %s [%s]\n",
|
||||
acpi_format_exception(status),
|
||||
acpi_ut_get_region_name(region_obj->
|
||||
region.
|
||||
space_id)));
|
||||
return_ACPI_STATUS(status);
|
||||
}
|
||||
|
||||
|
|
@ -501,12 +494,7 @@ acpi_ev_detach_region(union acpi_operand_object *region_obj,
|
|||
|
||||
status = acpi_ev_execute_reg_method(region_obj, 0);
|
||||
if (ACPI_FAILURE(status)) {
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
||||
"%s from region _REG, [%s]\n",
|
||||
acpi_format_exception(status),
|
||||
acpi_ut_get_region_name
|
||||
(region_obj->region.
|
||||
space_id)));
|
||||
ACPI_REPORT_ERROR(("%s from region _REG, [%s]\n", acpi_format_exception(status), acpi_ut_get_region_name(region_obj->region.space_id)));
|
||||
}
|
||||
|
||||
if (acpi_ns_is_locked) {
|
||||
|
|
@ -528,12 +516,7 @@ acpi_ev_detach_region(union acpi_operand_object *region_obj,
|
|||
/* Init routine may fail, Just ignore errors */
|
||||
|
||||
if (ACPI_FAILURE(status)) {
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
||||
"%s from region init, [%s]\n",
|
||||
acpi_format_exception(status),
|
||||
acpi_ut_get_region_name
|
||||
(region_obj->region.
|
||||
space_id)));
|
||||
ACPI_REPORT_ERROR(("%s from region init, [%s]\n", acpi_format_exception(status), acpi_ut_get_region_name(region_obj->region.space_id)));
|
||||
}
|
||||
|
||||
region_obj->region.flags &= ~(AOPOBJ_SETUP_COMPLETE);
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
*****************************************************************************/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2000 - 2005, R. Byron Moore
|
||||
* Copyright (C) 2000 - 2006, R. Byron Moore
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
******************************************************************************/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2000 - 2005, R. Byron Moore
|
||||
* Copyright (C) 2000 - 2006, R. Byron Moore
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
|
@ -88,7 +88,7 @@ static u32 ACPI_SYSTEM_XFACE acpi_ev_sci_xrupt_handler(void *context)
|
|||
*/
|
||||
interrupt_handled |= acpi_ev_gpe_detect(gpe_xrupt_list);
|
||||
|
||||
return_VALUE(interrupt_handled);
|
||||
return_UINT32(interrupt_handled);
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
|
|
@ -121,7 +121,7 @@ u32 ACPI_SYSTEM_XFACE acpi_ev_gpe_xrupt_handler(void *context)
|
|||
*/
|
||||
interrupt_handled |= acpi_ev_gpe_detect(gpe_xrupt_list);
|
||||
|
||||
return_VALUE(interrupt_handled);
|
||||
return_UINT32(interrupt_handled);
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
*****************************************************************************/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2000 - 2005, R. Byron Moore
|
||||
* Copyright (C) 2000 - 2006, R. Byron Moore
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
|
@ -143,8 +143,8 @@ acpi_install_fixed_event_handler(u32 event,
|
|||
if (ACPI_SUCCESS(status))
|
||||
status = acpi_enable_event(event, 0);
|
||||
if (ACPI_FAILURE(status)) {
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_WARN,
|
||||
"Could not enable fixed event.\n"));
|
||||
ACPI_REPORT_WARNING(("Could not enable fixed event %X\n",
|
||||
event));
|
||||
|
||||
/* Remove the handler */
|
||||
|
||||
|
|
@ -204,10 +204,9 @@ acpi_remove_fixed_event_handler(u32 event, acpi_event_handler handler)
|
|||
acpi_gbl_fixed_event_handlers[event].context = NULL;
|
||||
|
||||
if (ACPI_FAILURE(status)) {
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_WARN,
|
||||
"Could not write to fixed event enable register.\n"));
|
||||
ACPI_REPORT_WARNING(("Could not write to fixed event enable register %X\n", event));
|
||||
} else {
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Disabled fixed event %X.\n",
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Disabled fixed event %X\n",
|
||||
event));
|
||||
}
|
||||
|
||||
|
|
@ -434,7 +433,7 @@ acpi_remove_notify_handler(acpi_handle device,
|
|||
|
||||
if (device == ACPI_ROOT_OBJECT) {
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_INFO,
|
||||
"Removing notify handler for ROOT object.\n"));
|
||||
"Removing notify handler for namespace root object\n"));
|
||||
|
||||
if (((handler_type & ACPI_SYSTEM_NOTIFY) &&
|
||||
!acpi_gbl_system_notify.handler) ||
|
||||
|
|
@ -562,7 +561,7 @@ acpi_install_gpe_handler(acpi_handle gpe_device,
|
|||
struct acpi_gpe_event_info *gpe_event_info;
|
||||
struct acpi_handler_info *handler;
|
||||
acpi_status status;
|
||||
u32 flags;
|
||||
acpi_native_uint flags;
|
||||
|
||||
ACPI_FUNCTION_TRACE("acpi_install_gpe_handler");
|
||||
|
||||
|
|
@ -653,7 +652,7 @@ acpi_remove_gpe_handler(acpi_handle gpe_device,
|
|||
struct acpi_gpe_event_info *gpe_event_info;
|
||||
struct acpi_handler_info *handler;
|
||||
acpi_status status;
|
||||
u32 flags;
|
||||
acpi_native_uint flags;
|
||||
|
||||
ACPI_FUNCTION_TRACE("acpi_remove_gpe_handler");
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
*****************************************************************************/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2000 - 2005, R. Byron Moore
|
||||
* Copyright (C) 2000 - 2006, R. Byron Moore
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
|
@ -70,8 +70,7 @@ acpi_status acpi_enable(void)
|
|||
/* Make sure we have the FADT */
|
||||
|
||||
if (!acpi_gbl_FADT) {
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_WARN,
|
||||
"No FADT information present!\n"));
|
||||
ACPI_REPORT_WARNING(("No FADT information present!\n"));
|
||||
return_ACPI_STATUS(AE_NO_ACPI_TABLES);
|
||||
}
|
||||
|
||||
|
|
@ -83,7 +82,7 @@ acpi_status acpi_enable(void)
|
|||
|
||||
status = acpi_hw_set_mode(ACPI_SYS_MODE_ACPI);
|
||||
if (ACPI_FAILURE(status)) {
|
||||
ACPI_REPORT_ERROR(("Could not transition to ACPI mode.\n"));
|
||||
ACPI_REPORT_ERROR(("Could not transition to ACPI mode\n"));
|
||||
return_ACPI_STATUS(status);
|
||||
}
|
||||
|
||||
|
|
@ -113,8 +112,7 @@ acpi_status acpi_disable(void)
|
|||
ACPI_FUNCTION_TRACE("acpi_disable");
|
||||
|
||||
if (!acpi_gbl_FADT) {
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_WARN,
|
||||
"No FADT information present!\n"));
|
||||
ACPI_REPORT_WARNING(("No FADT information present!\n"));
|
||||
return_ACPI_STATUS(AE_NO_ACPI_TABLES);
|
||||
}
|
||||
|
||||
|
|
@ -127,8 +125,7 @@ acpi_status acpi_disable(void)
|
|||
status = acpi_hw_set_mode(ACPI_SYS_MODE_LEGACY);
|
||||
|
||||
if (ACPI_FAILURE(status)) {
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
||||
"Could not exit ACPI mode to legacy mode"));
|
||||
ACPI_REPORT_ERROR(("Could not exit ACPI mode to legacy mode"));
|
||||
return_ACPI_STATUS(status);
|
||||
}
|
||||
|
||||
|
|
@ -185,9 +182,8 @@ acpi_status acpi_enable_event(u32 event, u32 flags)
|
|||
}
|
||||
|
||||
if (value != 1) {
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
||||
"Could not enable %s event\n",
|
||||
acpi_ut_get_event_name(event)));
|
||||
ACPI_REPORT_ERROR(("Could not enable %s event\n",
|
||||
acpi_ut_get_event_name(event)));
|
||||
return_ACPI_STATUS(AE_NO_HARDWARE_RESPONSE);
|
||||
}
|
||||
|
||||
|
|
@ -384,9 +380,8 @@ acpi_status acpi_disable_event(u32 event, u32 flags)
|
|||
}
|
||||
|
||||
if (value != 0) {
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
||||
"Could not disable %s events\n",
|
||||
acpi_ut_get_event_name(event)));
|
||||
ACPI_REPORT_ERROR(("Could not disable %s events\n",
|
||||
acpi_ut_get_event_name(event)));
|
||||
return_ACPI_STATUS(AE_NO_HARDWARE_RESPONSE);
|
||||
}
|
||||
|
||||
|
|
@ -626,6 +621,13 @@ acpi_install_gpe_block(acpi_handle gpe_device,
|
|||
goto unlock_and_exit;
|
||||
}
|
||||
|
||||
/* Run the _PRW methods and enable the GPEs */
|
||||
|
||||
status = acpi_ev_initialize_gpe_block(node, gpe_block);
|
||||
if (ACPI_FAILURE(status)) {
|
||||
goto unlock_and_exit;
|
||||
}
|
||||
|
||||
/* Get the device_object attached to the node */
|
||||
|
||||
obj_desc = acpi_ns_get_attached_object(node);
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
*****************************************************************************/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2000 - 2005, R. Byron Moore
|
||||
* Copyright (C) 2000 - 2006, R. Byron Moore
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
*****************************************************************************/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2000 - 2005, R. Byron Moore
|
||||
* Copyright (C) 2000 - 2006, R. Byron Moore
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
|
@ -413,9 +413,7 @@ acpi_ex_load_op(union acpi_operand_object *obj_desc,
|
|||
(!ACPI_STRNCMP(table_ptr->signature,
|
||||
acpi_gbl_table_data[ACPI_TABLE_SSDT].signature,
|
||||
acpi_gbl_table_data[ACPI_TABLE_SSDT].sig_length))) {
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
||||
"Table has invalid signature [%4.4s], must be SSDT or PSDT\n",
|
||||
table_ptr->signature));
|
||||
ACPI_REPORT_ERROR(("Table has invalid signature [%4.4s], must be SSDT or PSDT\n", table_ptr->signature));
|
||||
status = AE_BAD_SIGNATURE;
|
||||
goto cleanup;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
*****************************************************************************/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2000 - 2005, R. Byron Moore
|
||||
* Copyright (C) 2000 - 2006, R. Byron Moore
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
|
@ -504,18 +504,12 @@ acpi_ex_convert_to_string(union acpi_operand_object * obj_desc,
|
|||
}
|
||||
|
||||
/*
|
||||
* Perform the conversion.
|
||||
* Create a new string object and string buffer
|
||||
* (-1 because of extra separator included in string_length from above)
|
||||
*/
|
||||
string_length--;
|
||||
if (string_length > ACPI_MAX_STRING_CONVERSION) { /* ACPI limit */
|
||||
return_ACPI_STATUS(AE_AML_STRING_LIMIT);
|
||||
}
|
||||
|
||||
/* Create a new string object and string buffer */
|
||||
|
||||
return_desc =
|
||||
acpi_ut_create_string_object((acpi_size) string_length);
|
||||
acpi_ut_create_string_object((acpi_size)
|
||||
(string_length - 1));
|
||||
if (!return_desc) {
|
||||
return_ACPI_STATUS(AE_NO_MEMORY);
|
||||
}
|
||||
|
|
@ -660,17 +654,8 @@ acpi_ex_convert_to_target_type(acpi_object_type destination_type,
|
|||
break;
|
||||
|
||||
default:
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
||||
"Unknown Target type ID 0x%X Op %s dest_type %s\n",
|
||||
GET_CURRENT_ARG_TYPE(walk_state->op_info->
|
||||
runtime_args),
|
||||
walk_state->op_info->name,
|
||||
acpi_ut_get_type_name(destination_type)));
|
||||
|
||||
ACPI_REPORT_ERROR(("Bad Target Type (ARGI): %X\n",
|
||||
GET_CURRENT_ARG_TYPE(walk_state->op_info->
|
||||
runtime_args)))
|
||||
status = AE_AML_INTERNAL;
|
||||
ACPI_REPORT_ERROR(("Unknown Target type ID 0x%X aml_opcode %X dest_type %s\n", GET_CURRENT_ARG_TYPE(walk_state->op_info->runtime_args), walk_state->opcode, acpi_ut_get_type_name(destination_type)));
|
||||
status = AE_AML_INTERNAL;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
*****************************************************************************/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2000 - 2005, R. Byron Moore
|
||||
* Copyright (C) 2000 - 2006, R. Byron Moore
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
*****************************************************************************/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2000 - 2005, R. Byron Moore
|
||||
* Copyright (C) 2000 - 2006, R. Byron Moore
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
|
@ -55,20 +55,386 @@ ACPI_MODULE_NAME("exdump")
|
|||
*/
|
||||
#if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER)
|
||||
/* Local prototypes */
|
||||
#ifdef ACPI_FUTURE_USAGE
|
||||
static void acpi_ex_out_string(char *title, char *value);
|
||||
|
||||
static void acpi_ex_out_pointer(char *title, void *value);
|
||||
|
||||
static void acpi_ex_out_integer(char *title, u32 value);
|
||||
|
||||
static void acpi_ex_out_address(char *title, acpi_physical_address value);
|
||||
|
||||
static void acpi_ex_dump_reference(union acpi_operand_object *obj_desc);
|
||||
static void acpi_ex_dump_reference_obj(union acpi_operand_object *obj_desc);
|
||||
|
||||
static void
|
||||
acpi_ex_dump_package(union acpi_operand_object *obj_desc, u32 level, u32 index);
|
||||
#endif /* ACPI_FUTURE_USAGE */
|
||||
acpi_ex_dump_package_obj(union acpi_operand_object *obj_desc,
|
||||
u32 level, u32 index);
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* Object Descriptor info tables
|
||||
*
|
||||
* Note: The first table entry must be an INIT opcode and must contain
|
||||
* the table length (number of table entries)
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
static struct acpi_exdump_info acpi_ex_dump_integer[2] = {
|
||||
{ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE(acpi_ex_dump_integer), NULL},
|
||||
{ACPI_EXD_UINT64, ACPI_EXD_OFFSET(integer.value), "Value"}
|
||||
};
|
||||
|
||||
static struct acpi_exdump_info acpi_ex_dump_string[4] = {
|
||||
{ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE(acpi_ex_dump_string), NULL},
|
||||
{ACPI_EXD_UINT32, ACPI_EXD_OFFSET(string.length), "Length"},
|
||||
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET(string.pointer), "Pointer"},
|
||||
{ACPI_EXD_STRING, 0, NULL}
|
||||
};
|
||||
|
||||
static struct acpi_exdump_info acpi_ex_dump_buffer[4] = {
|
||||
{ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE(acpi_ex_dump_buffer), NULL},
|
||||
{ACPI_EXD_UINT32, ACPI_EXD_OFFSET(buffer.length), "Length"},
|
||||
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET(buffer.pointer), "Pointer"},
|
||||
{ACPI_EXD_BUFFER, 0, NULL}
|
||||
};
|
||||
|
||||
static struct acpi_exdump_info acpi_ex_dump_package[5] = {
|
||||
{ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE(acpi_ex_dump_package), NULL},
|
||||
{ACPI_EXD_UINT8, ACPI_EXD_OFFSET(package.flags), "Flags"},
|
||||
{ACPI_EXD_UINT32, ACPI_EXD_OFFSET(package.count), "Elements"},
|
||||
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET(package.elements), "Element List"},
|
||||
{ACPI_EXD_PACKAGE, 0, NULL}
|
||||
};
|
||||
|
||||
static struct acpi_exdump_info acpi_ex_dump_device[4] = {
|
||||
{ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE(acpi_ex_dump_device), NULL},
|
||||
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET(device.handler), "Handler"},
|
||||
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET(device.system_notify),
|
||||
"System Notify"},
|
||||
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET(device.device_notify),
|
||||
"Device Notify"}
|
||||
};
|
||||
|
||||
static struct acpi_exdump_info acpi_ex_dump_event[2] = {
|
||||
{ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE(acpi_ex_dump_event), NULL},
|
||||
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET(event.semaphore), "Semaphore"}
|
||||
};
|
||||
|
||||
static struct acpi_exdump_info acpi_ex_dump_method[8] = {
|
||||
{ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE(acpi_ex_dump_method), NULL},
|
||||
{ACPI_EXD_UINT8, ACPI_EXD_OFFSET(method.param_count), "param_count"},
|
||||
{ACPI_EXD_UINT8, ACPI_EXD_OFFSET(method.concurrency), "Concurrency"},
|
||||
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET(method.semaphore), "Semaphore"},
|
||||
{ACPI_EXD_UINT8, ACPI_EXD_OFFSET(method.owner_id), "Owner Id"},
|
||||
{ACPI_EXD_UINT8, ACPI_EXD_OFFSET(method.thread_count), "Thread Count"},
|
||||
{ACPI_EXD_UINT32, ACPI_EXD_OFFSET(method.aml_length), "Aml Length"},
|
||||
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET(method.aml_start), "Aml Start"}
|
||||
};
|
||||
|
||||
static struct acpi_exdump_info acpi_ex_dump_mutex[5] = {
|
||||
{ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE(acpi_ex_dump_mutex), NULL},
|
||||
{ACPI_EXD_UINT8, ACPI_EXD_OFFSET(mutex.sync_level), "Sync Level"},
|
||||
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET(mutex.owner_thread), "Owner Thread"},
|
||||
{ACPI_EXD_UINT16, ACPI_EXD_OFFSET(mutex.acquisition_depth),
|
||||
"Acquire Depth"},
|
||||
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET(mutex.semaphore), "Semaphore"}
|
||||
};
|
||||
|
||||
static struct acpi_exdump_info acpi_ex_dump_region[7] = {
|
||||
{ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE(acpi_ex_dump_region), NULL},
|
||||
{ACPI_EXD_UINT8, ACPI_EXD_OFFSET(region.space_id), "Space Id"},
|
||||
{ACPI_EXD_UINT8, ACPI_EXD_OFFSET(region.flags), "Flags"},
|
||||
{ACPI_EXD_ADDRESS, ACPI_EXD_OFFSET(region.address), "Address"},
|
||||
{ACPI_EXD_UINT32, ACPI_EXD_OFFSET(region.length), "Length"},
|
||||
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET(region.handler), "Handler"},
|
||||
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET(region.next), "Next"}
|
||||
};
|
||||
|
||||
static struct acpi_exdump_info acpi_ex_dump_power[5] = {
|
||||
{ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE(acpi_ex_dump_power), NULL},
|
||||
{ACPI_EXD_UINT32, ACPI_EXD_OFFSET(power_resource.system_level),
|
||||
"System Level"},
|
||||
{ACPI_EXD_UINT32, ACPI_EXD_OFFSET(power_resource.resource_order),
|
||||
"Resource Order"},
|
||||
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET(power_resource.system_notify),
|
||||
"System Notify"},
|
||||
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET(power_resource.device_notify),
|
||||
"Device Notify"}
|
||||
};
|
||||
|
||||
static struct acpi_exdump_info acpi_ex_dump_processor[7] = {
|
||||
{ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE(acpi_ex_dump_processor), NULL},
|
||||
{ACPI_EXD_UINT32, ACPI_EXD_OFFSET(processor.proc_id), "Processor ID"},
|
||||
{ACPI_EXD_UINT32, ACPI_EXD_OFFSET(processor.length), "Length"},
|
||||
{ACPI_EXD_ADDRESS, ACPI_EXD_OFFSET(processor.address), "Address"},
|
||||
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET(processor.system_notify),
|
||||
"System Notify"},
|
||||
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET(processor.device_notify),
|
||||
"Device Notify"},
|
||||
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET(processor.handler), "Handler"}
|
||||
};
|
||||
|
||||
static struct acpi_exdump_info acpi_ex_dump_thermal[4] = {
|
||||
{ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE(acpi_ex_dump_thermal), NULL},
|
||||
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET(thermal_zone.system_notify),
|
||||
"System Notify"},
|
||||
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET(thermal_zone.device_notify),
|
||||
"Device Notify"},
|
||||
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET(thermal_zone.handler), "Handler"}
|
||||
};
|
||||
|
||||
static struct acpi_exdump_info acpi_ex_dump_buffer_field[3] = {
|
||||
{ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE(acpi_ex_dump_buffer_field), NULL},
|
||||
{ACPI_EXD_FIELD, 0, NULL},
|
||||
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET(buffer_field.buffer_obj),
|
||||
"Buffer Object"}
|
||||
};
|
||||
|
||||
static struct acpi_exdump_info acpi_ex_dump_region_field[3] = {
|
||||
{ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE(acpi_ex_dump_region_field), NULL},
|
||||
{ACPI_EXD_FIELD, 0, NULL},
|
||||
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET(field.region_obj), "Region Object"}
|
||||
};
|
||||
|
||||
static struct acpi_exdump_info acpi_ex_dump_bank_field[5] = {
|
||||
{ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE(acpi_ex_dump_bank_field), NULL},
|
||||
{ACPI_EXD_FIELD, 0, NULL},
|
||||
{ACPI_EXD_UINT32, ACPI_EXD_OFFSET(bank_field.value), "Value"},
|
||||
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET(bank_field.region_obj),
|
||||
"Region Object"},
|
||||
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET(bank_field.bank_obj), "Bank Object"}
|
||||
};
|
||||
|
||||
static struct acpi_exdump_info acpi_ex_dump_index_field[5] = {
|
||||
{ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE(acpi_ex_dump_bank_field), NULL},
|
||||
{ACPI_EXD_FIELD, 0, NULL},
|
||||
{ACPI_EXD_UINT32, ACPI_EXD_OFFSET(index_field.value), "Value"},
|
||||
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET(index_field.index_obj),
|
||||
"Index Object"},
|
||||
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET(index_field.data_obj), "Data Object"}
|
||||
};
|
||||
|
||||
static struct acpi_exdump_info acpi_ex_dump_reference[7] = {
|
||||
{ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE(acpi_ex_dump_reference), NULL},
|
||||
{ACPI_EXD_UINT8, ACPI_EXD_OFFSET(reference.target_type), "Target Type"},
|
||||
{ACPI_EXD_UINT32, ACPI_EXD_OFFSET(reference.offset), "Offset"},
|
||||
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET(reference.object), "Object Desc"},
|
||||
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET(reference.node), "Node"},
|
||||
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET(reference.where), "Where"},
|
||||
{ACPI_EXD_REFERENCE, 0, NULL}
|
||||
};
|
||||
|
||||
static struct acpi_exdump_info acpi_ex_dump_address_handler[6] = {
|
||||
{ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE(acpi_ex_dump_address_handler),
|
||||
NULL},
|
||||
{ACPI_EXD_UINT8, ACPI_EXD_OFFSET(address_space.space_id), "Space Id"},
|
||||
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET(address_space.next), "Next"},
|
||||
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET(address_space.region_list),
|
||||
"Region List"},
|
||||
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET(address_space.node), "Node"},
|
||||
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET(address_space.context), "Context"}
|
||||
};
|
||||
|
||||
static struct acpi_exdump_info acpi_ex_dump_notify[3] = {
|
||||
{ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE(acpi_ex_dump_notify), NULL},
|
||||
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET(notify.node), "Node"},
|
||||
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET(notify.context), "Context"}
|
||||
};
|
||||
|
||||
/* Miscellaneous tables */
|
||||
|
||||
static struct acpi_exdump_info acpi_ex_dump_common[4] = {
|
||||
{ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE(acpi_ex_dump_common), NULL},
|
||||
{ACPI_EXD_TYPE, 0, NULL},
|
||||
{ACPI_EXD_UINT16, ACPI_EXD_OFFSET(common.reference_count),
|
||||
"Reference Count"},
|
||||
{ACPI_EXD_UINT8, ACPI_EXD_OFFSET(common.flags), "Flags"}
|
||||
};
|
||||
|
||||
static struct acpi_exdump_info acpi_ex_dump_field_common[7] = {
|
||||
{ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE(acpi_ex_dump_field_common), NULL},
|
||||
{ACPI_EXD_UINT8, ACPI_EXD_OFFSET(common_field.field_flags),
|
||||
"Field Flags"},
|
||||
{ACPI_EXD_UINT8, ACPI_EXD_OFFSET(common_field.access_byte_width),
|
||||
"Access Byte Width"},
|
||||
{ACPI_EXD_UINT32, ACPI_EXD_OFFSET(common_field.bit_length),
|
||||
"Bit Length"},
|
||||
{ACPI_EXD_UINT8, ACPI_EXD_OFFSET(common_field.start_field_bit_offset),
|
||||
"Field Bit Offset"},
|
||||
{ACPI_EXD_UINT32, ACPI_EXD_OFFSET(common_field.base_byte_offset),
|
||||
"Base Byte Offset"},
|
||||
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET(common_field.node), "Parent Node"}
|
||||
};
|
||||
|
||||
static struct acpi_exdump_info acpi_ex_dump_node[6] = {
|
||||
{ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE(acpi_ex_dump_node), NULL},
|
||||
{ACPI_EXD_UINT8, ACPI_EXD_NSOFFSET(flags), "Flags"},
|
||||
{ACPI_EXD_UINT8, ACPI_EXD_NSOFFSET(owner_id), "Owner Id"},
|
||||
{ACPI_EXD_UINT16, ACPI_EXD_NSOFFSET(reference_count),
|
||||
"Reference Count"},
|
||||
{ACPI_EXD_POINTER, ACPI_EXD_NSOFFSET(child), "Child List"},
|
||||
{ACPI_EXD_POINTER, ACPI_EXD_NSOFFSET(peer), "Next Peer"}
|
||||
};
|
||||
|
||||
/* Dispatch table, indexed by object type */
|
||||
|
||||
static struct acpi_exdump_info *acpi_ex_dump_info[] = {
|
||||
NULL,
|
||||
acpi_ex_dump_integer,
|
||||
acpi_ex_dump_string,
|
||||
acpi_ex_dump_buffer,
|
||||
acpi_ex_dump_package,
|
||||
NULL,
|
||||
acpi_ex_dump_device,
|
||||
acpi_ex_dump_event,
|
||||
acpi_ex_dump_method,
|
||||
acpi_ex_dump_mutex,
|
||||
acpi_ex_dump_region,
|
||||
acpi_ex_dump_power,
|
||||
acpi_ex_dump_processor,
|
||||
acpi_ex_dump_thermal,
|
||||
acpi_ex_dump_buffer_field,
|
||||
NULL,
|
||||
NULL,
|
||||
acpi_ex_dump_region_field,
|
||||
acpi_ex_dump_bank_field,
|
||||
acpi_ex_dump_index_field,
|
||||
acpi_ex_dump_reference,
|
||||
NULL,
|
||||
NULL,
|
||||
acpi_ex_dump_notify,
|
||||
acpi_ex_dump_address_handler,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL
|
||||
};
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: acpi_ex_dump_object
|
||||
*
|
||||
* PARAMETERS: obj_desc - Descriptor to dump
|
||||
* Info - Info table corresponding to this object
|
||||
* type
|
||||
*
|
||||
* RETURN: None
|
||||
*
|
||||
* DESCRIPTION: Walk the info table for this object
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
static void
|
||||
acpi_ex_dump_object(union acpi_operand_object *obj_desc,
|
||||
struct acpi_exdump_info *info)
|
||||
{
|
||||
u8 *target;
|
||||
char *name;
|
||||
u8 count;
|
||||
|
||||
if (!info) {
|
||||
acpi_os_printf
|
||||
("ex_dump_object: Display not implemented for object type %s\n",
|
||||
acpi_ut_get_object_type_name(obj_desc));
|
||||
return;
|
||||
}
|
||||
|
||||
/* First table entry must contain the table length (# of table entries) */
|
||||
|
||||
count = info->offset;
|
||||
|
||||
while (count) {
|
||||
target = ACPI_ADD_PTR(u8, obj_desc, info->offset);
|
||||
name = info->name;
|
||||
|
||||
switch (info->opcode) {
|
||||
case ACPI_EXD_INIT:
|
||||
break;
|
||||
|
||||
case ACPI_EXD_TYPE:
|
||||
acpi_ex_out_string("Type",
|
||||
acpi_ut_get_object_type_name
|
||||
(obj_desc));
|
||||
break;
|
||||
|
||||
case ACPI_EXD_UINT8:
|
||||
|
||||
acpi_os_printf("%20s : %2.2X\n", name, *target);
|
||||
break;
|
||||
|
||||
case ACPI_EXD_UINT16:
|
||||
|
||||
acpi_os_printf("%20s : %4.4X\n", name,
|
||||
ACPI_GET16(target));
|
||||
break;
|
||||
|
||||
case ACPI_EXD_UINT32:
|
||||
|
||||
acpi_os_printf("%20s : %8.8X\n", name,
|
||||
ACPI_GET32(target));
|
||||
break;
|
||||
|
||||
case ACPI_EXD_UINT64:
|
||||
|
||||
acpi_os_printf("%20s : %8.8X%8.8X\n", "Value",
|
||||
ACPI_FORMAT_UINT64(ACPI_GET64(target)));
|
||||
break;
|
||||
|
||||
case ACPI_EXD_POINTER:
|
||||
|
||||
acpi_ex_out_pointer(name,
|
||||
*ACPI_CAST_PTR(void *, target));
|
||||
break;
|
||||
|
||||
case ACPI_EXD_ADDRESS:
|
||||
|
||||
acpi_ex_out_address(name,
|
||||
*ACPI_CAST_PTR
|
||||
(acpi_physical_address, target));
|
||||
break;
|
||||
|
||||
case ACPI_EXD_STRING:
|
||||
|
||||
acpi_ut_print_string(obj_desc->string.pointer,
|
||||
ACPI_UINT8_MAX);
|
||||
acpi_os_printf("\n");
|
||||
break;
|
||||
|
||||
case ACPI_EXD_BUFFER:
|
||||
|
||||
ACPI_DUMP_BUFFER(obj_desc->buffer.pointer,
|
||||
obj_desc->buffer.length);
|
||||
break;
|
||||
|
||||
case ACPI_EXD_PACKAGE:
|
||||
|
||||
/* Dump the package contents */
|
||||
|
||||
acpi_os_printf("\nPackage Contents:\n");
|
||||
acpi_ex_dump_package_obj(obj_desc, 0, 0);
|
||||
break;
|
||||
|
||||
case ACPI_EXD_FIELD:
|
||||
|
||||
acpi_ex_dump_object(obj_desc,
|
||||
acpi_ex_dump_field_common);
|
||||
break;
|
||||
|
||||
case ACPI_EXD_REFERENCE:
|
||||
|
||||
acpi_ex_out_string("Opcode",
|
||||
(acpi_ps_get_opcode_info
|
||||
(obj_desc->reference.opcode))->
|
||||
name);
|
||||
acpi_ex_dump_reference_obj(obj_desc);
|
||||
break;
|
||||
|
||||
default:
|
||||
acpi_os_printf("**** Invalid table opcode [%X] ****\n",
|
||||
info->opcode);
|
||||
return;
|
||||
}
|
||||
|
||||
info++;
|
||||
count--;
|
||||
}
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
|
|
@ -214,7 +580,7 @@ void acpi_ex_dump_operand(union acpi_operand_object *obj_desc, u32 depth)
|
|||
|
||||
case ACPI_TYPE_BUFFER:
|
||||
|
||||
acpi_os_printf("Buffer len %X @ %p \n",
|
||||
acpi_os_printf("Buffer len %X @ %p\n",
|
||||
obj_desc->buffer.length,
|
||||
obj_desc->buffer.pointer);
|
||||
|
||||
|
|
@ -320,17 +686,17 @@ void acpi_ex_dump_operand(union acpi_operand_object *obj_desc, u32 depth)
|
|||
|
||||
case ACPI_TYPE_BUFFER_FIELD:
|
||||
|
||||
acpi_os_printf("buffer_field: %X bits at byte %X bit %X of \n",
|
||||
acpi_os_printf("buffer_field: %X bits at byte %X bit %X of\n",
|
||||
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) {
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_EXEC, "*NULL* \n"));
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_EXEC, "*NULL*\n"));
|
||||
} else
|
||||
if (ACPI_GET_OBJECT_TYPE(obj_desc->buffer_field.buffer_obj)
|
||||
!= ACPI_TYPE_BUFFER) {
|
||||
acpi_os_printf("*not a Buffer* \n");
|
||||
acpi_os_printf("*not a Buffer*\n");
|
||||
} else {
|
||||
acpi_ex_dump_operand(obj_desc->buffer_field.buffer_obj,
|
||||
depth + 1);
|
||||
|
|
@ -441,7 +807,6 @@ acpi_ex_dump_operands(union acpi_operand_object **operands,
|
|||
return;
|
||||
}
|
||||
|
||||
#ifdef ACPI_FUTURE_USAGE
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: acpi_ex_out* functions
|
||||
|
|
@ -465,11 +830,6 @@ static void acpi_ex_out_pointer(char *title, void *value)
|
|||
acpi_os_printf("%20s : %p\n", title, value);
|
||||
}
|
||||
|
||||
static void acpi_ex_out_integer(char *title, u32 value)
|
||||
{
|
||||
acpi_os_printf("%20s : %.2X\n", title, value);
|
||||
}
|
||||
|
||||
static void acpi_ex_out_address(char *title, acpi_physical_address value)
|
||||
{
|
||||
|
||||
|
|
@ -482,16 +842,16 @@ static void acpi_ex_out_address(char *title, acpi_physical_address value)
|
|||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: acpi_ex_dump_node
|
||||
* FUNCTION: acpi_ex_dump_namespace_node
|
||||
*
|
||||
* PARAMETERS: *Node - Descriptor to dump
|
||||
* PARAMETERS: Node - Descriptor to dump
|
||||
* Flags - Force display if TRUE
|
||||
*
|
||||
* DESCRIPTION: Dumps the members of the given.Node
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
void acpi_ex_dump_node(struct acpi_namespace_node *node, u32 flags)
|
||||
void acpi_ex_dump_namespace_node(struct acpi_namespace_node *node, u32 flags)
|
||||
{
|
||||
|
||||
ACPI_FUNCTION_ENTRY();
|
||||
|
|
@ -506,19 +866,17 @@ void acpi_ex_dump_node(struct acpi_namespace_node *node, u32 flags)
|
|||
|
||||
acpi_os_printf("%20s : %4.4s\n", "Name", acpi_ut_get_node_name(node));
|
||||
acpi_ex_out_string("Type", acpi_ut_get_type_name(node->type));
|
||||
acpi_ex_out_integer("Flags", node->flags);
|
||||
acpi_ex_out_integer("Owner Id", node->owner_id);
|
||||
acpi_ex_out_integer("Reference Count", node->reference_count);
|
||||
acpi_ex_out_pointer("Attached Object",
|
||||
acpi_ns_get_attached_object(node));
|
||||
acpi_ex_out_pointer("child_list", node->child);
|
||||
acpi_ex_out_pointer("next_peer", node->peer);
|
||||
acpi_ex_out_pointer("Parent", acpi_ns_get_parent_node(node));
|
||||
|
||||
acpi_ex_dump_object(ACPI_CAST_PTR(union acpi_operand_object, node),
|
||||
acpi_ex_dump_node);
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: acpi_ex_dump_reference
|
||||
* FUNCTION: acpi_ex_dump_reference_obj
|
||||
*
|
||||
* PARAMETERS: Object - Descriptor to dump
|
||||
*
|
||||
|
|
@ -526,14 +884,16 @@ void acpi_ex_dump_node(struct acpi_namespace_node *node, u32 flags)
|
|||
*
|
||||
******************************************************************************/
|
||||
|
||||
static void acpi_ex_dump_reference(union acpi_operand_object *obj_desc)
|
||||
static void acpi_ex_dump_reference_obj(union acpi_operand_object *obj_desc)
|
||||
{
|
||||
struct acpi_buffer ret_buf;
|
||||
acpi_status status;
|
||||
|
||||
ret_buf.length = ACPI_ALLOCATE_LOCAL_BUFFER;
|
||||
|
||||
if (obj_desc->reference.opcode == AML_INT_NAMEPATH_OP) {
|
||||
acpi_os_printf("Named Object %p ", obj_desc->reference.node);
|
||||
ret_buf.length = ACPI_ALLOCATE_LOCAL_BUFFER;
|
||||
|
||||
status =
|
||||
acpi_ns_handle_to_pathname(obj_desc->reference.node,
|
||||
&ret_buf);
|
||||
|
|
@ -551,9 +911,9 @@ static void acpi_ex_dump_reference(union acpi_operand_object *obj_desc)
|
|||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: acpi_ex_dump_package
|
||||
* FUNCTION: acpi_ex_dump_package_obj
|
||||
*
|
||||
* PARAMETERS: Object - Descriptor to dump
|
||||
* PARAMETERS: obj_desc - Descriptor to dump
|
||||
* Level - Indentation Level
|
||||
* Index - Package index for this object
|
||||
*
|
||||
|
|
@ -562,7 +922,8 @@ static void acpi_ex_dump_reference(union acpi_operand_object *obj_desc)
|
|||
******************************************************************************/
|
||||
|
||||
static void
|
||||
acpi_ex_dump_package(union acpi_operand_object *obj_desc, u32 level, u32 index)
|
||||
acpi_ex_dump_package_obj(union acpi_operand_object *obj_desc,
|
||||
u32 level, u32 index)
|
||||
{
|
||||
u32 i;
|
||||
|
||||
|
|
@ -608,7 +969,8 @@ acpi_ex_dump_package(union acpi_operand_object *obj_desc, u32 level, u32 index)
|
|||
acpi_os_printf("[Buffer] Length %.2X = ",
|
||||
obj_desc->buffer.length);
|
||||
if (obj_desc->buffer.length) {
|
||||
acpi_ut_dump_buffer((u8 *) obj_desc->buffer.pointer,
|
||||
acpi_ut_dump_buffer(ACPI_CAST_PTR
|
||||
(u8, obj_desc->buffer.pointer),
|
||||
obj_desc->buffer.length,
|
||||
DB_DWORD_DISPLAY, _COMPONENT);
|
||||
} else {
|
||||
|
|
@ -618,19 +980,19 @@ acpi_ex_dump_package(union acpi_operand_object *obj_desc, u32 level, u32 index)
|
|||
|
||||
case ACPI_TYPE_PACKAGE:
|
||||
|
||||
acpi_os_printf("[Package] Contains %d Elements: \n",
|
||||
acpi_os_printf("[Package] Contains %d Elements:\n",
|
||||
obj_desc->package.count);
|
||||
|
||||
for (i = 0; i < obj_desc->package.count; i++) {
|
||||
acpi_ex_dump_package(obj_desc->package.elements[i],
|
||||
level + 1, i);
|
||||
acpi_ex_dump_package_obj(obj_desc->package.elements[i],
|
||||
level + 1, i);
|
||||
}
|
||||
break;
|
||||
|
||||
case ACPI_TYPE_LOCAL_REFERENCE:
|
||||
|
||||
acpi_os_printf("[Object Reference] ");
|
||||
acpi_ex_dump_reference(obj_desc);
|
||||
acpi_ex_dump_reference_obj(obj_desc);
|
||||
break;
|
||||
|
||||
default:
|
||||
|
|
@ -645,7 +1007,7 @@ acpi_ex_dump_package(union acpi_operand_object *obj_desc, u32 level, u32 index)
|
|||
*
|
||||
* FUNCTION: acpi_ex_dump_object_descriptor
|
||||
*
|
||||
* PARAMETERS: Object - Descriptor to dump
|
||||
* PARAMETERS: obj_desc - Descriptor to dump
|
||||
* Flags - Force display if TRUE
|
||||
*
|
||||
* DESCRIPTION: Dumps the members of the object descriptor given.
|
||||
|
|
@ -670,11 +1032,13 @@ acpi_ex_dump_object_descriptor(union acpi_operand_object *obj_desc, u32 flags)
|
|||
}
|
||||
|
||||
if (ACPI_GET_DESCRIPTOR_TYPE(obj_desc) == ACPI_DESC_TYPE_NAMED) {
|
||||
acpi_ex_dump_node((struct acpi_namespace_node *)obj_desc,
|
||||
flags);
|
||||
acpi_ex_dump_namespace_node((struct acpi_namespace_node *)
|
||||
obj_desc, flags);
|
||||
|
||||
acpi_os_printf("\nAttached Object (%p):\n",
|
||||
((struct acpi_namespace_node *)obj_desc)->
|
||||
object);
|
||||
|
||||
acpi_ex_dump_object_descriptor(((struct acpi_namespace_node *)
|
||||
obj_desc)->object, flags);
|
||||
return_VOID;
|
||||
|
|
@ -687,233 +1051,18 @@ acpi_ex_dump_object_descriptor(union acpi_operand_object *obj_desc, u32 flags)
|
|||
return_VOID;
|
||||
}
|
||||
|
||||
/* Common Fields */
|
||||
|
||||
acpi_ex_out_string("Type", acpi_ut_get_object_type_name(obj_desc));
|
||||
acpi_ex_out_integer("Reference Count",
|
||||
obj_desc->common.reference_count);
|
||||
acpi_ex_out_integer("Flags", obj_desc->common.flags);
|
||||
|
||||
/* Object-specific Fields */
|
||||
|
||||
switch (ACPI_GET_OBJECT_TYPE(obj_desc)) {
|
||||
case ACPI_TYPE_INTEGER:
|
||||
|
||||
acpi_os_printf("%20s : %8.8X%8.8X\n", "Value",
|
||||
ACPI_FORMAT_UINT64(obj_desc->integer.value));
|
||||
break;
|
||||
|
||||
case ACPI_TYPE_STRING:
|
||||
|
||||
acpi_ex_out_integer("Length", obj_desc->string.length);
|
||||
|
||||
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;
|
||||
|
||||
case ACPI_TYPE_BUFFER:
|
||||
|
||||
acpi_ex_out_integer("Length", obj_desc->buffer.length);
|
||||
acpi_ex_out_pointer("Pointer", obj_desc->buffer.pointer);
|
||||
ACPI_DUMP_BUFFER(obj_desc->buffer.pointer,
|
||||
obj_desc->buffer.length);
|
||||
break;
|
||||
|
||||
case ACPI_TYPE_PACKAGE:
|
||||
|
||||
acpi_ex_out_integer("Flags", obj_desc->package.flags);
|
||||
acpi_ex_out_integer("Elements", obj_desc->package.count);
|
||||
acpi_ex_out_pointer("Element List", obj_desc->package.elements);
|
||||
|
||||
/* Dump the package contents */
|
||||
|
||||
acpi_os_printf("\nPackage Contents:\n");
|
||||
acpi_ex_dump_package(obj_desc, 0, 0);
|
||||
break;
|
||||
|
||||
case ACPI_TYPE_DEVICE:
|
||||
|
||||
acpi_ex_out_pointer("Handler", obj_desc->device.handler);
|
||||
acpi_ex_out_pointer("system_notify",
|
||||
obj_desc->device.system_notify);
|
||||
acpi_ex_out_pointer("device_notify",
|
||||
obj_desc->device.device_notify);
|
||||
break;
|
||||
|
||||
case ACPI_TYPE_EVENT:
|
||||
|
||||
acpi_ex_out_pointer("Semaphore", obj_desc->event.semaphore);
|
||||
break;
|
||||
|
||||
case ACPI_TYPE_METHOD:
|
||||
|
||||
acpi_ex_out_integer("param_count",
|
||||
obj_desc->method.param_count);
|
||||
acpi_ex_out_integer("Concurrency",
|
||||
obj_desc->method.concurrency);
|
||||
acpi_ex_out_pointer("Semaphore", obj_desc->method.semaphore);
|
||||
acpi_ex_out_integer("owner_id", obj_desc->method.owner_id);
|
||||
acpi_ex_out_integer("aml_length", obj_desc->method.aml_length);
|
||||
acpi_ex_out_pointer("aml_start", obj_desc->method.aml_start);
|
||||
break;
|
||||
|
||||
case ACPI_TYPE_MUTEX:
|
||||
|
||||
acpi_ex_out_integer("sync_level", obj_desc->mutex.sync_level);
|
||||
acpi_ex_out_pointer("owner_thread",
|
||||
obj_desc->mutex.owner_thread);
|
||||
acpi_ex_out_integer("acquire_depth",
|
||||
obj_desc->mutex.acquisition_depth);
|
||||
acpi_ex_out_pointer("Semaphore", obj_desc->mutex.semaphore);
|
||||
break;
|
||||
|
||||
case ACPI_TYPE_REGION:
|
||||
|
||||
acpi_ex_out_integer("space_id", obj_desc->region.space_id);
|
||||
acpi_ex_out_integer("Flags", obj_desc->region.flags);
|
||||
acpi_ex_out_address("Address", obj_desc->region.address);
|
||||
acpi_ex_out_integer("Length", obj_desc->region.length);
|
||||
acpi_ex_out_pointer("Handler", obj_desc->region.handler);
|
||||
acpi_ex_out_pointer("Next", obj_desc->region.next);
|
||||
break;
|
||||
|
||||
case ACPI_TYPE_POWER:
|
||||
|
||||
acpi_ex_out_integer("system_level",
|
||||
obj_desc->power_resource.system_level);
|
||||
acpi_ex_out_integer("resource_order",
|
||||
obj_desc->power_resource.resource_order);
|
||||
acpi_ex_out_pointer("system_notify",
|
||||
obj_desc->power_resource.system_notify);
|
||||
acpi_ex_out_pointer("device_notify",
|
||||
obj_desc->power_resource.device_notify);
|
||||
break;
|
||||
|
||||
case ACPI_TYPE_PROCESSOR:
|
||||
|
||||
acpi_ex_out_integer("Processor ID",
|
||||
obj_desc->processor.proc_id);
|
||||
acpi_ex_out_integer("Length", obj_desc->processor.length);
|
||||
acpi_ex_out_address("Address",
|
||||
(acpi_physical_address) obj_desc->processor.
|
||||
address);
|
||||
acpi_ex_out_pointer("system_notify",
|
||||
obj_desc->processor.system_notify);
|
||||
acpi_ex_out_pointer("device_notify",
|
||||
obj_desc->processor.device_notify);
|
||||
acpi_ex_out_pointer("Handler", obj_desc->processor.handler);
|
||||
break;
|
||||
|
||||
case ACPI_TYPE_THERMAL:
|
||||
|
||||
acpi_ex_out_pointer("system_notify",
|
||||
obj_desc->thermal_zone.system_notify);
|
||||
acpi_ex_out_pointer("device_notify",
|
||||
obj_desc->thermal_zone.device_notify);
|
||||
acpi_ex_out_pointer("Handler", obj_desc->thermal_zone.handler);
|
||||
break;
|
||||
|
||||
case ACPI_TYPE_BUFFER_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);
|
||||
acpi_ex_out_integer("bit_length",
|
||||
obj_desc->common_field.bit_length);
|
||||
acpi_ex_out_integer("fld_bit_offset",
|
||||
obj_desc->common_field.
|
||||
start_field_bit_offset);
|
||||
acpi_ex_out_integer("base_byte_offset",
|
||||
obj_desc->common_field.base_byte_offset);
|
||||
acpi_ex_out_pointer("parent_node", obj_desc->common_field.node);
|
||||
|
||||
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 ACPI_TYPE_LOCAL_REGION_FIELD:
|
||||
acpi_ex_out_pointer("region_obj",
|
||||
obj_desc->field.region_obj);
|
||||
break;
|
||||
|
||||
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 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);
|
||||
break;
|
||||
|
||||
default:
|
||||
/* All object types covered above */
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
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);
|
||||
acpi_ex_out_integer("Offset", obj_desc->reference.offset);
|
||||
acpi_ex_out_pointer("obj_desc", obj_desc->reference.object);
|
||||
acpi_ex_out_pointer("Node", obj_desc->reference.node);
|
||||
acpi_ex_out_pointer("Where", obj_desc->reference.where);
|
||||
|
||||
acpi_ex_dump_reference(obj_desc);
|
||||
break;
|
||||
|
||||
case ACPI_TYPE_LOCAL_ADDRESS_HANDLER:
|
||||
|
||||
acpi_ex_out_integer("space_id",
|
||||
obj_desc->address_space.space_id);
|
||||
acpi_ex_out_pointer("Next", obj_desc->address_space.next);
|
||||
acpi_ex_out_pointer("region_list",
|
||||
obj_desc->address_space.region_list);
|
||||
acpi_ex_out_pointer("Node", obj_desc->address_space.node);
|
||||
acpi_ex_out_pointer("Context", obj_desc->address_space.context);
|
||||
break;
|
||||
|
||||
case ACPI_TYPE_LOCAL_NOTIFY:
|
||||
|
||||
acpi_ex_out_pointer("Node", obj_desc->notify.node);
|
||||
acpi_ex_out_pointer("Context", obj_desc->notify.context);
|
||||
break;
|
||||
|
||||
case ACPI_TYPE_LOCAL_ALIAS:
|
||||
case ACPI_TYPE_LOCAL_METHOD_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",
|
||||
acpi_ut_get_object_type_name(obj_desc));
|
||||
break;
|
||||
if (obj_desc->common.type > ACPI_TYPE_NS_NODE_MAX) {
|
||||
return_VOID;
|
||||
}
|
||||
|
||||
/* Common Fields */
|
||||
|
||||
acpi_ex_dump_object(obj_desc, acpi_ex_dump_common);
|
||||
|
||||
/* Object-specific fields */
|
||||
|
||||
acpi_ex_dump_object(obj_desc, acpi_ex_dump_info[obj_desc->common.type]);
|
||||
return_VOID;
|
||||
}
|
||||
|
||||
#endif /* ACPI_FUTURE_USAGE */
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
*****************************************************************************/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2000 - 2005, R. Byron Moore
|
||||
* Copyright (C) 2000 - 2006, R. Byron Moore
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
*****************************************************************************/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2000 - 2005, R. Byron Moore
|
||||
* Copyright (C) 2000 - 2006, R. Byron Moore
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
|
@ -94,10 +94,9 @@ acpi_ex_setup_region(union acpi_operand_object *obj_desc,
|
|||
/* We must have a valid region */
|
||||
|
||||
if (ACPI_GET_OBJECT_TYPE(rgn_desc) != ACPI_TYPE_REGION) {
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
||||
"Needed Region, found type %X (%s)\n",
|
||||
ACPI_GET_OBJECT_TYPE(rgn_desc),
|
||||
acpi_ut_get_object_type_name(rgn_desc)));
|
||||
ACPI_REPORT_ERROR(("Needed Region, found type %X (%s)\n",
|
||||
ACPI_GET_OBJECT_TYPE(rgn_desc),
|
||||
acpi_ut_get_object_type_name(rgn_desc)));
|
||||
|
||||
return_ACPI_STATUS(AE_AML_OPERAND_TYPE);
|
||||
}
|
||||
|
|
@ -162,31 +161,14 @@ acpi_ex_setup_region(union acpi_operand_object *obj_desc,
|
|||
* than the region itself. For example, a region of length one
|
||||
* byte, and a field with Dword access specified.
|
||||
*/
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
||||
"Field [%4.4s] access width (%d bytes) too large for region [%4.4s] (length %X)\n",
|
||||
acpi_ut_get_node_name(obj_desc->
|
||||
common_field.
|
||||
node),
|
||||
obj_desc->common_field.
|
||||
access_byte_width,
|
||||
acpi_ut_get_node_name(rgn_desc->
|
||||
region.node),
|
||||
rgn_desc->region.length));
|
||||
ACPI_REPORT_ERROR(("Field [%4.4s] access width (%d bytes) too large for region [%4.4s] (length %X)\n", acpi_ut_get_node_name(obj_desc->common_field.node), obj_desc->common_field.access_byte_width, acpi_ut_get_node_name(rgn_desc->region.node), rgn_desc->region.length));
|
||||
}
|
||||
|
||||
/*
|
||||
* Offset rounded up to next multiple of field width
|
||||
* exceeds region length, indicate an error
|
||||
*/
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
||||
"Field [%4.4s] Base+Offset+Width %X+%X+%X is beyond end of region [%4.4s] (length %X)\n",
|
||||
acpi_ut_get_node_name(obj_desc->common_field.
|
||||
node),
|
||||
obj_desc->common_field.base_byte_offset,
|
||||
field_datum_byte_offset,
|
||||
obj_desc->common_field.access_byte_width,
|
||||
acpi_ut_get_node_name(rgn_desc->region.node),
|
||||
rgn_desc->region.length));
|
||||
ACPI_REPORT_ERROR(("Field [%4.4s] Base+Offset+Width %X+%X+%X is beyond end of region [%4.4s] (length %X)\n", acpi_ut_get_node_name(obj_desc->common_field.node), obj_desc->common_field.base_byte_offset, field_datum_byte_offset, obj_desc->common_field.access_byte_width, acpi_ut_get_node_name(rgn_desc->region.node), rgn_desc->region.length));
|
||||
|
||||
return_ACPI_STATUS(AE_AML_REGION_LIMIT);
|
||||
}
|
||||
|
|
@ -270,12 +252,11 @@ acpi_ex_access_region(union acpi_operand_object *obj_desc,
|
|||
|
||||
if (ACPI_FAILURE(status)) {
|
||||
if (status == AE_NOT_IMPLEMENTED) {
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
||||
"Region %s(%X) not implemented\n",
|
||||
acpi_ut_get_region_name(rgn_desc->
|
||||
region.
|
||||
space_id),
|
||||
rgn_desc->region.space_id));
|
||||
ACPI_REPORT_ERROR(("Region %s(%X) not implemented\n",
|
||||
acpi_ut_get_region_name(rgn_desc->
|
||||
region.
|
||||
space_id),
|
||||
rgn_desc->region.space_id));
|
||||
} else if (status == AE_NOT_EXIST) {
|
||||
ACPI_REPORT_ERROR(("Region %s(%X) has no handler\n",
|
||||
acpi_ut_get_region_name(rgn_desc->
|
||||
|
|
@ -618,11 +599,10 @@ acpi_ex_write_with_update_rule(union acpi_operand_object *obj_desc,
|
|||
|
||||
default:
|
||||
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
||||
"write_with_update_rule: Unknown update_rule setting: %X\n",
|
||||
(obj_desc->common_field.
|
||||
field_flags &
|
||||
AML_FIELD_UPDATE_RULE_MASK)));
|
||||
ACPI_REPORT_ERROR(("Unknown update_rule value: %X\n",
|
||||
(obj_desc->common_field.
|
||||
field_flags &
|
||||
AML_FIELD_UPDATE_RULE_MASK)));
|
||||
return_ACPI_STATUS(AE_AML_OPERAND_VALUE);
|
||||
}
|
||||
}
|
||||
|
|
@ -677,10 +657,7 @@ acpi_ex_extract_from_field(union acpi_operand_object *obj_desc,
|
|||
|
||||
if (buffer_length <
|
||||
ACPI_ROUND_BITS_UP_TO_BYTES(obj_desc->common_field.bit_length)) {
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
||||
"Field size %X (bits) is too large for buffer (%X)\n",
|
||||
obj_desc->common_field.bit_length,
|
||||
buffer_length));
|
||||
ACPI_REPORT_ERROR(("Field size %X (bits) is too large for buffer (%X)\n", obj_desc->common_field.bit_length, buffer_length));
|
||||
|
||||
return_ACPI_STATUS(AE_BUFFER_OVERFLOW);
|
||||
}
|
||||
|
|
@ -792,10 +769,7 @@ acpi_ex_insert_into_field(union acpi_operand_object *obj_desc,
|
|||
|
||||
if (buffer_length <
|
||||
ACPI_ROUND_BITS_UP_TO_BYTES(obj_desc->common_field.bit_length)) {
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
||||
"Field size %X (bits) is too large for buffer (%X)\n",
|
||||
obj_desc->common_field.bit_length,
|
||||
buffer_length));
|
||||
ACPI_REPORT_ERROR(("Field size %X (bits) is too large for buffer (%X)\n", obj_desc->common_field.bit_length, buffer_length));
|
||||
|
||||
return_ACPI_STATUS(AE_BUFFER_OVERFLOW);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
*****************************************************************************/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2000 - 2005, R. Byron Moore
|
||||
* Copyright (C) 2000 - 2006, R. Byron Moore
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
|
@ -45,6 +45,7 @@
|
|||
#include <acpi/acpi.h>
|
||||
#include <acpi/acinterp.h>
|
||||
#include <acpi/amlcode.h>
|
||||
#include <acpi/amlresrc.h>
|
||||
|
||||
#define _COMPONENT ACPI_EXECUTER
|
||||
ACPI_MODULE_NAME("exmisc")
|
||||
|
|
@ -97,7 +98,8 @@ acpi_ex_get_object_reference(union acpi_operand_object *obj_desc,
|
|||
|
||||
default:
|
||||
|
||||
ACPI_REPORT_ERROR(("Unknown Reference opcode in get_reference %X\n", obj_desc->reference.opcode));
|
||||
ACPI_REPORT_ERROR(("Unknown Reference opcode %X\n",
|
||||
obj_desc->reference.opcode));
|
||||
return_ACPI_STATUS(AE_AML_INTERNAL);
|
||||
}
|
||||
break;
|
||||
|
|
@ -112,7 +114,8 @@ acpi_ex_get_object_reference(union acpi_operand_object *obj_desc,
|
|||
|
||||
default:
|
||||
|
||||
ACPI_REPORT_ERROR(("Invalid descriptor type in get_reference: %X\n", ACPI_GET_DESCRIPTOR_TYPE(obj_desc)));
|
||||
ACPI_REPORT_ERROR(("Invalid descriptor type %X\n",
|
||||
ACPI_GET_DESCRIPTOR_TYPE(obj_desc)));
|
||||
return_ACPI_STATUS(AE_TYPE);
|
||||
}
|
||||
|
||||
|
|
@ -157,48 +160,58 @@ acpi_ex_concat_template(union acpi_operand_object *operand0,
|
|||
union acpi_operand_object **actual_return_desc,
|
||||
struct acpi_walk_state *walk_state)
|
||||
{
|
||||
acpi_status status;
|
||||
union acpi_operand_object *return_desc;
|
||||
u8 *new_buf;
|
||||
u8 *end_tag1;
|
||||
u8 *end_tag2;
|
||||
u8 *end_tag;
|
||||
acpi_size length0;
|
||||
acpi_size length1;
|
||||
acpi_size length2;
|
||||
|
||||
ACPI_FUNCTION_TRACE("ex_concat_template");
|
||||
|
||||
/* Find the end_tags in each resource template */
|
||||
|
||||
end_tag1 = acpi_ut_get_resource_end_tag(operand0);
|
||||
end_tag2 = acpi_ut_get_resource_end_tag(operand1);
|
||||
if (!end_tag1 || !end_tag2) {
|
||||
return_ACPI_STATUS(AE_AML_OPERAND_TYPE);
|
||||
/*
|
||||
* Find the end_tag descriptor in each resource template.
|
||||
* Note: returned pointers point TO the end_tag, not past it.
|
||||
*
|
||||
* Compute the length of each resource template
|
||||
*/
|
||||
status = acpi_ut_get_resource_end_tag(operand0, &end_tag);
|
||||
if (ACPI_FAILURE(status)) {
|
||||
return_ACPI_STATUS(status);
|
||||
}
|
||||
|
||||
/* Compute the length of each part */
|
||||
length0 = ACPI_PTR_DIFF(end_tag, operand0->buffer.pointer);
|
||||
|
||||
length1 = ACPI_PTR_DIFF(end_tag1, operand0->buffer.pointer);
|
||||
length2 = ACPI_PTR_DIFF(end_tag2, operand1->buffer.pointer) + 2; /* Size of END_TAG */
|
||||
status = acpi_ut_get_resource_end_tag(operand1, &end_tag);
|
||||
if (ACPI_FAILURE(status)) {
|
||||
return_ACPI_STATUS(status);
|
||||
}
|
||||
|
||||
/* Include the end_tag in the second template length */
|
||||
|
||||
length1 = ACPI_PTR_DIFF(end_tag, operand1->buffer.pointer) +
|
||||
sizeof(struct aml_resource_end_tag);
|
||||
|
||||
/* Create a new buffer object for the result */
|
||||
|
||||
return_desc = acpi_ut_create_buffer_object(length1 + length2);
|
||||
return_desc = acpi_ut_create_buffer_object(length0 + length1);
|
||||
if (!return_desc) {
|
||||
return_ACPI_STATUS(AE_NO_MEMORY);
|
||||
}
|
||||
|
||||
/* Copy the templates to the new descriptor */
|
||||
|
||||
/*
|
||||
* Copy the templates to the new buffer, 0 first, then 1 follows. One
|
||||
* end_tag descriptor is copied from Operand1.
|
||||
*/
|
||||
new_buf = return_desc->buffer.pointer;
|
||||
ACPI_MEMCPY(new_buf, operand0->buffer.pointer, length1);
|
||||
ACPI_MEMCPY(new_buf + length1, operand1->buffer.pointer, length2);
|
||||
ACPI_MEMCPY(new_buf, operand0->buffer.pointer, length0);
|
||||
ACPI_MEMCPY(new_buf + length0, operand1->buffer.pointer, length1);
|
||||
|
||||
/* Compute the new checksum */
|
||||
/* Set the end_tag checksum to zero, means "ignore checksum" */
|
||||
|
||||
new_buf[return_desc->buffer.length - 1] =
|
||||
acpi_ut_generate_checksum(return_desc->buffer.pointer,
|
||||
(return_desc->buffer.length - 1));
|
||||
new_buf[return_desc->buffer.length - 1] = 0;
|
||||
|
||||
/* Return the completed template descriptor */
|
||||
/* Return the completed resource template */
|
||||
|
||||
*actual_return_desc = return_desc;
|
||||
return_ACPI_STATUS(AE_OK);
|
||||
|
|
@ -229,7 +242,6 @@ acpi_ex_do_concatenate(union acpi_operand_object *operand0,
|
|||
union acpi_operand_object *return_desc;
|
||||
char *new_buf;
|
||||
acpi_status status;
|
||||
acpi_size new_length;
|
||||
|
||||
ACPI_FUNCTION_TRACE("ex_do_concatenate");
|
||||
|
||||
|
|
@ -256,7 +268,7 @@ acpi_ex_do_concatenate(union acpi_operand_object *operand0,
|
|||
break;
|
||||
|
||||
default:
|
||||
ACPI_REPORT_ERROR(("Concat - invalid obj type: %X\n",
|
||||
ACPI_REPORT_ERROR(("Invalid object type: %X\n",
|
||||
ACPI_GET_OBJECT_TYPE(operand0)));
|
||||
status = AE_AML_INTERNAL;
|
||||
}
|
||||
|
|
@ -296,8 +308,7 @@ acpi_ex_do_concatenate(union acpi_operand_object *operand0,
|
|||
|
||||
/* Copy the first integer, LSB first */
|
||||
|
||||
ACPI_MEMCPY(new_buf,
|
||||
&operand0->integer.value,
|
||||
ACPI_MEMCPY(new_buf, &operand0->integer.value,
|
||||
acpi_gbl_integer_byte_width);
|
||||
|
||||
/* Copy the second integer (LSB first) after the first */
|
||||
|
|
@ -311,14 +322,11 @@ acpi_ex_do_concatenate(union acpi_operand_object *operand0,
|
|||
|
||||
/* Result of two Strings is a String */
|
||||
|
||||
new_length = (acpi_size) operand0->string.length +
|
||||
(acpi_size) local_operand1->string.length;
|
||||
if (new_length > ACPI_MAX_STRING_CONVERSION) {
|
||||
status = AE_AML_STRING_LIMIT;
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
return_desc = acpi_ut_create_string_object(new_length);
|
||||
return_desc = acpi_ut_create_string_object((acpi_size)
|
||||
(operand0->string.
|
||||
length +
|
||||
local_operand1->
|
||||
string.length));
|
||||
if (!return_desc) {
|
||||
status = AE_NO_MEMORY;
|
||||
goto cleanup;
|
||||
|
|
@ -338,11 +346,10 @@ acpi_ex_do_concatenate(union acpi_operand_object *operand0,
|
|||
/* Result of two Buffers is a Buffer */
|
||||
|
||||
return_desc = acpi_ut_create_buffer_object((acpi_size)
|
||||
operand0->buffer.
|
||||
length +
|
||||
(acpi_size)
|
||||
local_operand1->
|
||||
buffer.length);
|
||||
(operand0->buffer.
|
||||
length +
|
||||
local_operand1->
|
||||
buffer.length));
|
||||
if (!return_desc) {
|
||||
status = AE_NO_MEMORY;
|
||||
goto cleanup;
|
||||
|
|
@ -352,8 +359,8 @@ acpi_ex_do_concatenate(union acpi_operand_object *operand0,
|
|||
|
||||
/* Concatenate the buffers */
|
||||
|
||||
ACPI_MEMCPY(new_buf,
|
||||
operand0->buffer.pointer, operand0->buffer.length);
|
||||
ACPI_MEMCPY(new_buf, operand0->buffer.pointer,
|
||||
operand0->buffer.length);
|
||||
ACPI_MEMCPY(new_buf + operand0->buffer.length,
|
||||
local_operand1->buffer.pointer,
|
||||
local_operand1->buffer.length);
|
||||
|
|
@ -363,7 +370,7 @@ acpi_ex_do_concatenate(union acpi_operand_object *operand0,
|
|||
|
||||
/* Invalid object type, should not happen here */
|
||||
|
||||
ACPI_REPORT_ERROR(("Concatenate - Invalid object type: %X\n",
|
||||
ACPI_REPORT_ERROR(("Invalid object type: %X\n",
|
||||
ACPI_GET_OBJECT_TYPE(operand0)));
|
||||
status = AE_AML_INTERNAL;
|
||||
goto cleanup;
|
||||
|
|
@ -625,9 +632,8 @@ acpi_ex_do_logical_op(u16 opcode,
|
|||
|
||||
/* Lexicographic compare: compare the data bytes */
|
||||
|
||||
compare = ACPI_MEMCMP((const char *)operand0->buffer.pointer,
|
||||
(const char *)local_operand1->buffer.
|
||||
pointer,
|
||||
compare = ACPI_MEMCMP(operand0->buffer.pointer,
|
||||
local_operand1->buffer.pointer,
|
||||
(length0 > length1) ? length1 : length0);
|
||||
|
||||
switch (opcode) {
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
*****************************************************************************/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2000 - 2005, R. Byron Moore
|
||||
* Copyright (C) 2000 - 2006, R. Byron Moore
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
*****************************************************************************/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2000 - 2005, R. Byron Moore
|
||||
* Copyright (C) 2000 - 2006, R. Byron Moore
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
|
@ -99,7 +99,8 @@ static char *acpi_ex_allocate_name_string(u32 prefix_count, u32 num_name_segs)
|
|||
*/
|
||||
name_string = ACPI_MEM_ALLOCATE(size_needed);
|
||||
if (!name_string) {
|
||||
ACPI_REPORT_ERROR(("ex_allocate_name_string: Could not allocate size %d\n", size_needed));
|
||||
ACPI_REPORT_ERROR(("Could not allocate size %d\n",
|
||||
size_needed));
|
||||
return_PTR(NULL);
|
||||
}
|
||||
|
||||
|
|
@ -167,8 +168,7 @@ static acpi_status acpi_ex_name_segment(u8 ** in_aml_address, char *name_string)
|
|||
char_buf[0] = *aml_address;
|
||||
|
||||
if ('0' <= char_buf[0] && char_buf[0] <= '9') {
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "leading digit: %c\n",
|
||||
char_buf[0]));
|
||||
ACPI_REPORT_ERROR(("Invalid leading digit: %c\n", char_buf[0]));
|
||||
return_ACPI_STATUS(AE_CTRL_PENDING);
|
||||
}
|
||||
|
||||
|
|
@ -191,10 +191,10 @@ static acpi_status acpi_ex_name_segment(u8 ** in_aml_address, char *name_string)
|
|||
if (name_string) {
|
||||
ACPI_STRCAT(name_string, char_buf);
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_NAMES,
|
||||
"Appended to - %s \n", name_string));
|
||||
"Appended to - %s\n", name_string));
|
||||
} else {
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_NAMES,
|
||||
"No Name string - %s \n", char_buf));
|
||||
"No Name string - %s\n", char_buf));
|
||||
}
|
||||
} else if (index == 0) {
|
||||
/*
|
||||
|
|
@ -211,12 +211,11 @@ static acpi_status acpi_ex_name_segment(u8 ** in_aml_address, char *name_string)
|
|||
* the required 4
|
||||
*/
|
||||
status = AE_AML_BAD_NAME;
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
||||
"Bad character %02x in name, at %p\n",
|
||||
*aml_address, aml_address));
|
||||
ACPI_REPORT_ERROR(("Bad character %02x in name, at %p\n",
|
||||
*aml_address, aml_address));
|
||||
}
|
||||
|
||||
*in_aml_address = (u8 *) aml_address;
|
||||
*in_aml_address = ACPI_CAST_PTR(u8, aml_address);
|
||||
return_ACPI_STATUS(status);
|
||||
}
|
||||
|
||||
|
|
@ -412,8 +411,7 @@ acpi_ex_get_name_string(acpi_object_type data_type,
|
|||
if (AE_CTRL_PENDING == status && has_prefix) {
|
||||
/* Ran out of segments after processing a prefix */
|
||||
|
||||
ACPI_REPORT_ERROR(("ex_do_name: Malformed Name at %p\n",
|
||||
name_string));
|
||||
ACPI_REPORT_ERROR(("Malformed Name at %p\n", name_string));
|
||||
status = AE_AML_BAD_NAME;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
*****************************************************************************/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2000 - 2005, R. Byron Moore
|
||||
* Copyright (C) 2000 - 2006, R. Byron Moore
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
|
@ -111,7 +111,8 @@ acpi_status acpi_ex_opcode_0A_0T_1R(struct acpi_walk_state *walk_state)
|
|||
|
||||
default: /* Unknown opcode */
|
||||
|
||||
ACPI_REPORT_ERROR(("acpi_ex_opcode_0A_0T_1R: Unknown opcode %X\n", walk_state->opcode));
|
||||
ACPI_REPORT_ERROR(("Unknown AML opcode %X\n",
|
||||
walk_state->opcode));
|
||||
status = AE_AML_BAD_OPCODE;
|
||||
break;
|
||||
}
|
||||
|
|
@ -188,7 +189,8 @@ acpi_status acpi_ex_opcode_1A_0T_0R(struct acpi_walk_state *walk_state)
|
|||
|
||||
default: /* Unknown opcode */
|
||||
|
||||
ACPI_REPORT_ERROR(("acpi_ex_opcode_1A_0T_0R: Unknown opcode %X\n", walk_state->opcode));
|
||||
ACPI_REPORT_ERROR(("Unknown AML opcode %X\n",
|
||||
walk_state->opcode));
|
||||
status = AE_AML_BAD_OPCODE;
|
||||
break;
|
||||
}
|
||||
|
|
@ -227,7 +229,8 @@ acpi_status acpi_ex_opcode_1A_1T_0R(struct acpi_walk_state *walk_state)
|
|||
|
||||
default: /* Unknown opcode */
|
||||
|
||||
ACPI_REPORT_ERROR(("acpi_ex_opcode_1A_1T_0R: Unknown opcode %X\n", walk_state->opcode));
|
||||
ACPI_REPORT_ERROR(("Unknown AML opcode %X\n",
|
||||
walk_state->opcode));
|
||||
status = AE_AML_BAD_OPCODE;
|
||||
goto cleanup;
|
||||
}
|
||||
|
|
@ -346,9 +349,7 @@ acpi_status acpi_ex_opcode_1A_1T_1R(struct acpi_walk_state *walk_state)
|
|||
/* Check the range of the digit */
|
||||
|
||||
if (temp32 > 9) {
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
||||
"BCD digit too large (not decimal): 0x%X\n",
|
||||
temp32));
|
||||
ACPI_REPORT_ERROR(("BCD digit too large (not decimal): 0x%X\n", temp32));
|
||||
|
||||
status = AE_AML_NUMERIC_OVERFLOW;
|
||||
goto cleanup;
|
||||
|
|
@ -393,12 +394,7 @@ acpi_status acpi_ex_opcode_1A_1T_1R(struct acpi_walk_state *walk_state)
|
|||
/* Overflow if there is any data left in Digit */
|
||||
|
||||
if (digit > 0) {
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
||||
"Integer too large to convert to BCD: %8.8X%8.8X\n",
|
||||
ACPI_FORMAT_UINT64(operand
|
||||
[0]->
|
||||
integer.
|
||||
value)));
|
||||
ACPI_REPORT_ERROR(("Integer too large to convert to BCD: %8.8X%8.8X\n", ACPI_FORMAT_UINT64(operand[0]->integer.value)));
|
||||
status = AE_AML_NUMERIC_OVERFLOW;
|
||||
goto cleanup;
|
||||
}
|
||||
|
|
@ -525,15 +521,16 @@ acpi_status acpi_ex_opcode_1A_1T_1R(struct acpi_walk_state *walk_state)
|
|||
|
||||
/* These are two obsolete opcodes */
|
||||
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
||||
"%s is obsolete and not implemented\n",
|
||||
acpi_ps_get_opcode_name(walk_state->opcode)));
|
||||
ACPI_REPORT_ERROR(("%s is obsolete and not implemented\n",
|
||||
acpi_ps_get_opcode_name(walk_state->
|
||||
opcode)));
|
||||
status = AE_SUPPORT;
|
||||
goto cleanup;
|
||||
|
||||
default: /* Unknown opcode */
|
||||
|
||||
ACPI_REPORT_ERROR(("acpi_ex_opcode_1A_1T_1R: Unknown opcode %X\n", walk_state->opcode));
|
||||
ACPI_REPORT_ERROR(("Unknown AML opcode %X\n",
|
||||
walk_state->opcode));
|
||||
status = AE_AML_BAD_OPCODE;
|
||||
goto cleanup;
|
||||
}
|
||||
|
|
@ -639,11 +636,10 @@ acpi_status acpi_ex_opcode_1A_0T_1R(struct acpi_walk_state *walk_state)
|
|||
acpi_ex_resolve_operands(AML_LNOT_OP, &temp_desc,
|
||||
walk_state);
|
||||
if (ACPI_FAILURE(status)) {
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
||||
"%s: bad operand(s) %s\n",
|
||||
acpi_ps_get_opcode_name(walk_state->
|
||||
opcode),
|
||||
acpi_format_exception(status)));
|
||||
ACPI_REPORT_ERROR(("%s: bad operand(s) %s\n",
|
||||
acpi_ps_get_opcode_name(walk_state->
|
||||
opcode),
|
||||
acpi_format_exception(status)));
|
||||
|
||||
goto cleanup;
|
||||
}
|
||||
|
|
@ -742,9 +738,7 @@ acpi_status acpi_ex_opcode_1A_0T_1R(struct acpi_walk_state *walk_state)
|
|||
break;
|
||||
|
||||
default:
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
||||
"size_of - Operand is not Buf/Int/Str/Pkg - found type %s\n",
|
||||
acpi_ut_get_type_name(type)));
|
||||
ACPI_REPORT_ERROR(("Operand is not Buf/Int/Str/Pkg - found type %s\n", acpi_ut_get_type_name(type)));
|
||||
status = AE_AML_OPERAND_TYPE;
|
||||
goto cleanup;
|
||||
}
|
||||
|
|
@ -941,11 +935,7 @@ acpi_status acpi_ex_opcode_1A_0T_1R(struct acpi_walk_state *walk_state)
|
|||
|
||||
default:
|
||||
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
||||
"Unknown Index target_type %X in obj %p\n",
|
||||
operand[0]->reference.
|
||||
target_type,
|
||||
operand[0]));
|
||||
ACPI_REPORT_ERROR(("Unknown Index target_type %X in obj %p\n", operand[0]->reference.target_type, operand[0]));
|
||||
status = AE_AML_OPERAND_TYPE;
|
||||
goto cleanup;
|
||||
}
|
||||
|
|
@ -971,11 +961,7 @@ acpi_status acpi_ex_opcode_1A_0T_1R(struct acpi_walk_state *walk_state)
|
|||
break;
|
||||
|
||||
default:
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
||||
"Unknown opcode in ref(%p) - %X\n",
|
||||
operand[0],
|
||||
operand[0]->reference.
|
||||
opcode));
|
||||
ACPI_REPORT_ERROR(("Unknown opcode in ref(%p) - %X\n", operand[0], operand[0]->reference.opcode));
|
||||
|
||||
status = AE_TYPE;
|
||||
goto cleanup;
|
||||
|
|
@ -985,7 +971,8 @@ acpi_status acpi_ex_opcode_1A_0T_1R(struct acpi_walk_state *walk_state)
|
|||
|
||||
default:
|
||||
|
||||
ACPI_REPORT_ERROR(("acpi_ex_opcode_1A_0T_1R: Unknown opcode %X\n", walk_state->opcode));
|
||||
ACPI_REPORT_ERROR(("Unknown AML opcode %X\n",
|
||||
walk_state->opcode));
|
||||
status = AE_AML_BAD_OPCODE;
|
||||
goto cleanup;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
*****************************************************************************/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2000 - 2005, R. Byron Moore
|
||||
* Copyright (C) 2000 - 2006, R. Byron Moore
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
|
@ -111,9 +111,7 @@ acpi_status acpi_ex_opcode_2A_0T_0R(struct acpi_walk_state *walk_state)
|
|||
/* Are notifies allowed on this object? */
|
||||
|
||||
if (!acpi_ev_is_notify_object(node)) {
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
||||
"Unexpected notify object type [%s]\n",
|
||||
acpi_ut_get_type_name(node->type)));
|
||||
ACPI_REPORT_ERROR(("Unexpected notify object type [%s]\n", acpi_ut_get_type_name(node->type)));
|
||||
|
||||
status = AE_AML_OPERAND_TYPE;
|
||||
break;
|
||||
|
|
@ -157,7 +155,8 @@ acpi_status acpi_ex_opcode_2A_0T_0R(struct acpi_walk_state *walk_state)
|
|||
|
||||
default:
|
||||
|
||||
ACPI_REPORT_ERROR(("acpi_ex_opcode_2A_0T_0R: Unknown opcode %X\n", walk_state->opcode));
|
||||
ACPI_REPORT_ERROR(("Unknown AML opcode %X\n",
|
||||
walk_state->opcode));
|
||||
status = AE_AML_BAD_OPCODE;
|
||||
}
|
||||
|
||||
|
|
@ -221,7 +220,8 @@ acpi_status acpi_ex_opcode_2A_2T_1R(struct acpi_walk_state *walk_state)
|
|||
|
||||
default:
|
||||
|
||||
ACPI_REPORT_ERROR(("acpi_ex_opcode_2A_2T_1R: Unknown opcode %X\n", walk_state->opcode));
|
||||
ACPI_REPORT_ERROR(("Unknown AML opcode %X\n",
|
||||
walk_state->opcode));
|
||||
status = AE_AML_BAD_OPCODE;
|
||||
goto cleanup;
|
||||
}
|
||||
|
|
@ -344,10 +344,6 @@ acpi_status acpi_ex_opcode_2A_1T_1R(struct acpi_walk_state *walk_state)
|
|||
(length < operand[1]->integer.value) &&
|
||||
(operand[0]->buffer.pointer[length])) {
|
||||
length++;
|
||||
if (length > ACPI_MAX_STRING_CONVERSION) {
|
||||
status = AE_AML_STRING_LIMIT;
|
||||
goto cleanup;
|
||||
}
|
||||
}
|
||||
|
||||
/* Allocate a new string object */
|
||||
|
|
@ -358,8 +354,10 @@ acpi_status acpi_ex_opcode_2A_1T_1R(struct acpi_walk_state *walk_state)
|
|||
goto cleanup;
|
||||
}
|
||||
|
||||
/* Copy the raw buffer data with no transform. NULL terminated already */
|
||||
|
||||
/*
|
||||
* Copy the raw buffer data with no transform.
|
||||
* (NULL terminated already)
|
||||
*/
|
||||
ACPI_MEMCPY(return_desc->string.pointer,
|
||||
operand[0]->buffer.pointer, length);
|
||||
break;
|
||||
|
|
@ -391,10 +389,7 @@ acpi_status acpi_ex_opcode_2A_1T_1R(struct acpi_walk_state *walk_state)
|
|||
/* Object to be indexed is a Package */
|
||||
|
||||
if (index >= operand[0]->package.count) {
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
||||
"Index value (%X%8.8X) beyond package end (%X)\n",
|
||||
ACPI_FORMAT_UINT64(index),
|
||||
operand[0]->package.count));
|
||||
ACPI_REPORT_ERROR(("Index value (%X%8.8X) beyond package end (%X)\n", ACPI_FORMAT_UINT64(index), operand[0]->package.count));
|
||||
status = AE_AML_PACKAGE_LIMIT;
|
||||
goto cleanup;
|
||||
}
|
||||
|
|
@ -407,10 +402,7 @@ acpi_status acpi_ex_opcode_2A_1T_1R(struct acpi_walk_state *walk_state)
|
|||
/* Object to be indexed is a Buffer/String */
|
||||
|
||||
if (index >= operand[0]->buffer.length) {
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
||||
"Index value (%X%8.8X) beyond end of buffer (%X)\n",
|
||||
ACPI_FORMAT_UINT64(index),
|
||||
operand[0]->buffer.length));
|
||||
ACPI_REPORT_ERROR(("Index value (%X%8.8X) beyond end of buffer (%X)\n", ACPI_FORMAT_UINT64(index), operand[0]->buffer.length));
|
||||
status = AE_AML_BUFFER_LIMIT;
|
||||
goto cleanup;
|
||||
}
|
||||
|
|
@ -442,7 +434,8 @@ acpi_status acpi_ex_opcode_2A_1T_1R(struct acpi_walk_state *walk_state)
|
|||
|
||||
default:
|
||||
|
||||
ACPI_REPORT_ERROR(("acpi_ex_opcode_2A_1T_1R: Unknown opcode %X\n", walk_state->opcode));
|
||||
ACPI_REPORT_ERROR(("Unknown AML opcode %X\n",
|
||||
walk_state->opcode));
|
||||
status = AE_AML_BAD_OPCODE;
|
||||
break;
|
||||
}
|
||||
|
|
@ -546,7 +539,8 @@ acpi_status acpi_ex_opcode_2A_0T_1R(struct acpi_walk_state *walk_state)
|
|||
|
||||
default:
|
||||
|
||||
ACPI_REPORT_ERROR(("acpi_ex_opcode_2A_0T_1R: Unknown opcode %X\n", walk_state->opcode));
|
||||
ACPI_REPORT_ERROR(("Unknown AML opcode %X\n",
|
||||
walk_state->opcode));
|
||||
status = AE_AML_BAD_OPCODE;
|
||||
goto cleanup;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
*****************************************************************************/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2000 - 2005, R. Byron Moore
|
||||
* Copyright (C) 2000 - 2006, R. Byron Moore
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
|
@ -119,7 +119,8 @@ acpi_status acpi_ex_opcode_3A_0T_0R(struct acpi_walk_state *walk_state)
|
|||
|
||||
default:
|
||||
|
||||
ACPI_REPORT_ERROR(("acpi_ex_opcode_3A_0T_0R: Unknown opcode %X\n", walk_state->opcode));
|
||||
ACPI_REPORT_ERROR(("Unknown AML opcode %X\n",
|
||||
walk_state->opcode));
|
||||
status = AE_AML_BAD_OPCODE;
|
||||
goto cleanup;
|
||||
}
|
||||
|
|
@ -223,8 +224,8 @@ acpi_status acpi_ex_opcode_3A_1T_1R(struct acpi_walk_state *walk_state)
|
|||
goto cleanup;
|
||||
}
|
||||
|
||||
if (length > 0) {
|
||||
/* Copy the portion requested */
|
||||
if (buffer) {
|
||||
/* We have a buffer, copy the portion requested */
|
||||
|
||||
ACPI_MEMCPY(buffer, operand[0]->string.pointer + index,
|
||||
length);
|
||||
|
|
@ -242,7 +243,8 @@ acpi_status acpi_ex_opcode_3A_1T_1R(struct acpi_walk_state *walk_state)
|
|||
|
||||
default:
|
||||
|
||||
ACPI_REPORT_ERROR(("acpi_ex_opcode_3A_0T_0R: Unknown opcode %X\n", walk_state->opcode));
|
||||
ACPI_REPORT_ERROR(("Unknown AML opcode %X\n",
|
||||
walk_state->opcode));
|
||||
status = AE_AML_BAD_OPCODE;
|
||||
goto cleanup;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
*****************************************************************************/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2000 - 2005, R. Byron Moore
|
||||
* Copyright (C) 2000 - 2006, R. Byron Moore
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
|
@ -234,8 +234,7 @@ acpi_status acpi_ex_opcode_6A_0T_1R(struct acpi_walk_state * walk_state)
|
|||
|
||||
if ((operand[1]->integer.value > MAX_MATCH_OPERATOR) ||
|
||||
(operand[3]->integer.value > MAX_MATCH_OPERATOR)) {
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
||||
"Match operator out of range\n"));
|
||||
ACPI_REPORT_ERROR(("Match operator out of range\n"));
|
||||
status = AE_AML_OPERAND_VALUE;
|
||||
goto cleanup;
|
||||
}
|
||||
|
|
@ -244,10 +243,7 @@ acpi_status acpi_ex_opcode_6A_0T_1R(struct acpi_walk_state * walk_state)
|
|||
|
||||
index = operand[5]->integer.value;
|
||||
if (index >= operand[0]->package.count) {
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
||||
"Index (%X%8.8X) beyond package end (%X)\n",
|
||||
ACPI_FORMAT_UINT64(index),
|
||||
operand[0]->package.count));
|
||||
ACPI_REPORT_ERROR(("Index (%X%8.8X) beyond package end (%X)\n", ACPI_FORMAT_UINT64(index), operand[0]->package.count));
|
||||
status = AE_AML_PACKAGE_LIMIT;
|
||||
goto cleanup;
|
||||
}
|
||||
|
|
@ -316,7 +312,8 @@ acpi_status acpi_ex_opcode_6A_0T_1R(struct acpi_walk_state * walk_state)
|
|||
|
||||
default:
|
||||
|
||||
ACPI_REPORT_ERROR(("acpi_ex_opcode_6A_0T_1R: Unknown opcode %X\n", walk_state->opcode));
|
||||
ACPI_REPORT_ERROR(("Unknown AML opcode %X\n",
|
||||
walk_state->opcode));
|
||||
status = AE_AML_BAD_OPCODE;
|
||||
goto cleanup;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
*****************************************************************************/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2000 - 2005, R. Byron Moore
|
||||
* Copyright (C) 2000 - 2006, R. Byron Moore
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
|
@ -274,9 +274,8 @@ acpi_ex_decode_field_access(union acpi_operand_object *obj_desc,
|
|||
default:
|
||||
/* Invalid field access type */
|
||||
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
||||
"Unknown field access type %X\n", access));
|
||||
return_VALUE(0);
|
||||
ACPI_REPORT_ERROR(("Unknown field access type %X\n", access));
|
||||
return_UINT32(0);
|
||||
}
|
||||
|
||||
if (ACPI_GET_OBJECT_TYPE(obj_desc) == ACPI_TYPE_BUFFER_FIELD) {
|
||||
|
|
@ -289,7 +288,7 @@ acpi_ex_decode_field_access(union acpi_operand_object *obj_desc,
|
|||
}
|
||||
|
||||
*return_byte_alignment = byte_alignment;
|
||||
return_VALUE(bit_length);
|
||||
return_UINT32(bit_length);
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
|
|
@ -422,15 +421,13 @@ acpi_status acpi_ex_prep_field_value(struct acpi_create_field_info *info)
|
|||
|
||||
if (info->field_type != ACPI_TYPE_LOCAL_INDEX_FIELD) {
|
||||
if (!info->region_node) {
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Null region_node\n"));
|
||||
ACPI_REPORT_ERROR(("Null region_node\n"));
|
||||
return_ACPI_STATUS(AE_AML_NO_OPERAND);
|
||||
}
|
||||
|
||||
type = acpi_ns_get_type(info->region_node);
|
||||
if (type != ACPI_TYPE_REGION) {
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
||||
"Needed Region, found type %X (%s)\n",
|
||||
type, acpi_ut_get_type_name(type)));
|
||||
ACPI_REPORT_ERROR(("Needed Region, found type %X (%s)\n", type, acpi_ut_get_type_name(type)));
|
||||
|
||||
return_ACPI_STATUS(AE_AML_OPERAND_TYPE);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
*****************************************************************************/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2000 - 2005, R. Byron Moore
|
||||
* Copyright (C) 2000 - 2006, R. Byron Moore
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
|
@ -77,7 +77,7 @@ acpi_ex_system_memory_space_handler(u32 function,
|
|||
struct acpi_mem_space_context *mem_info = region_context;
|
||||
u32 length;
|
||||
acpi_size window_size;
|
||||
#ifndef ACPI_MISALIGNED_TRANSFERS
|
||||
#ifdef ACPI_MISALIGNMENT_NOT_SUPPORTED
|
||||
u32 remainder;
|
||||
#endif
|
||||
|
||||
|
|
@ -103,13 +103,12 @@ acpi_ex_system_memory_space_handler(u32 function,
|
|||
break;
|
||||
|
||||
default:
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
||||
"Invalid system_memory width %d\n",
|
||||
bit_width));
|
||||
ACPI_REPORT_ERROR(("Invalid system_memory width %d\n",
|
||||
bit_width));
|
||||
return_ACPI_STATUS(AE_AML_OPERAND_VALUE);
|
||||
}
|
||||
|
||||
#ifndef ACPI_MISALIGNED_TRANSFERS
|
||||
#ifdef ACPI_MISALIGNMENT_NOT_SUPPORTED
|
||||
/*
|
||||
* Hardware does not support non-aligned data transfers, we must verify
|
||||
* the request.
|
||||
|
|
@ -159,10 +158,7 @@ acpi_ex_system_memory_space_handler(u32 function,
|
|||
(void **)&mem_info->
|
||||
mapped_logical_address);
|
||||
if (ACPI_FAILURE(status)) {
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
||||
"Could not map memory at %8.8X%8.8X, size %X\n",
|
||||
ACPI_FORMAT_UINT64(address),
|
||||
(u32) window_size));
|
||||
ACPI_REPORT_ERROR(("Could not map memory at %8.8X%8.8X, size %X\n", ACPI_FORMAT_UINT64(address), (u32) window_size));
|
||||
mem_info->mapped_length = 0;
|
||||
return_ACPI_STATUS(status);
|
||||
}
|
||||
|
|
@ -199,20 +195,20 @@ acpi_ex_system_memory_space_handler(u32 function,
|
|||
*value = 0;
|
||||
switch (bit_width) {
|
||||
case 8:
|
||||
*value = (acpi_integer) * ((u8 *) logical_addr_ptr);
|
||||
*value = (acpi_integer) ACPI_GET8(logical_addr_ptr);
|
||||
break;
|
||||
|
||||
case 16:
|
||||
*value = (acpi_integer) * ((u16 *) logical_addr_ptr);
|
||||
*value = (acpi_integer) ACPI_GET16(logical_addr_ptr);
|
||||
break;
|
||||
|
||||
case 32:
|
||||
*value = (acpi_integer) * ((u32 *) logical_addr_ptr);
|
||||
*value = (acpi_integer) ACPI_GET32(logical_addr_ptr);
|
||||
break;
|
||||
|
||||
#if ACPI_MACHINE_WIDTH != 16
|
||||
case 64:
|
||||
*value = (acpi_integer) * ((u64 *) logical_addr_ptr);
|
||||
*value = (acpi_integer) ACPI_GET64(logical_addr_ptr);
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
|
|
@ -225,20 +221,20 @@ acpi_ex_system_memory_space_handler(u32 function,
|
|||
|
||||
switch (bit_width) {
|
||||
case 8:
|
||||
*(u8 *) logical_addr_ptr = (u8) * value;
|
||||
ACPI_SET8(logical_addr_ptr) = (u8) * value;
|
||||
break;
|
||||
|
||||
case 16:
|
||||
*(u16 *) logical_addr_ptr = (u16) * value;
|
||||
ACPI_SET16(logical_addr_ptr) = (u16) * value;
|
||||
break;
|
||||
|
||||
case 32:
|
||||
*(u32 *) logical_addr_ptr = (u32) * value;
|
||||
ACPI_SET32(logical_addr_ptr) = (u32) * value;
|
||||
break;
|
||||
|
||||
#if ACPI_MACHINE_WIDTH != 16
|
||||
case 64:
|
||||
*(u64 *) logical_addr_ptr = (u64) * value;
|
||||
ACPI_SET64(logical_addr_ptr) = (u64) * value;
|
||||
break;
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
*****************************************************************************/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2000 - 2005, R. Byron Moore
|
||||
* Copyright (C) 2000 - 2006, R. Byron Moore
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
|
@ -122,8 +122,7 @@ acpi_ex_resolve_node_to_value(struct acpi_namespace_node **object_ptr,
|
|||
}
|
||||
|
||||
if (!source_desc) {
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
||||
"No object attached to node %p\n", node));
|
||||
ACPI_REPORT_ERROR(("No object attached to node %p\n", node));
|
||||
return_ACPI_STATUS(AE_AML_NO_OPERAND);
|
||||
}
|
||||
|
||||
|
|
@ -135,10 +134,9 @@ acpi_ex_resolve_node_to_value(struct acpi_namespace_node **object_ptr,
|
|||
case ACPI_TYPE_PACKAGE:
|
||||
|
||||
if (ACPI_GET_OBJECT_TYPE(source_desc) != ACPI_TYPE_PACKAGE) {
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
||||
"Object not a Package, type %s\n",
|
||||
acpi_ut_get_object_type_name
|
||||
(source_desc)));
|
||||
ACPI_REPORT_ERROR(("Object not a Package, type %s\n",
|
||||
acpi_ut_get_object_type_name
|
||||
(source_desc)));
|
||||
return_ACPI_STATUS(AE_AML_OPERAND_TYPE);
|
||||
}
|
||||
|
||||
|
|
@ -154,10 +152,9 @@ acpi_ex_resolve_node_to_value(struct acpi_namespace_node **object_ptr,
|
|||
case ACPI_TYPE_BUFFER:
|
||||
|
||||
if (ACPI_GET_OBJECT_TYPE(source_desc) != ACPI_TYPE_BUFFER) {
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
||||
"Object not a Buffer, type %s\n",
|
||||
acpi_ut_get_object_type_name
|
||||
(source_desc)));
|
||||
ACPI_REPORT_ERROR(("Object not a Buffer, type %s\n",
|
||||
acpi_ut_get_object_type_name
|
||||
(source_desc)));
|
||||
return_ACPI_STATUS(AE_AML_OPERAND_TYPE);
|
||||
}
|
||||
|
||||
|
|
@ -173,10 +170,9 @@ acpi_ex_resolve_node_to_value(struct acpi_namespace_node **object_ptr,
|
|||
case ACPI_TYPE_STRING:
|
||||
|
||||
if (ACPI_GET_OBJECT_TYPE(source_desc) != ACPI_TYPE_STRING) {
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
||||
"Object not a String, type %s\n",
|
||||
acpi_ut_get_object_type_name
|
||||
(source_desc)));
|
||||
ACPI_REPORT_ERROR(("Object not a String, type %s\n",
|
||||
acpi_ut_get_object_type_name
|
||||
(source_desc)));
|
||||
return_ACPI_STATUS(AE_AML_OPERAND_TYPE);
|
||||
}
|
||||
|
||||
|
|
@ -189,10 +185,9 @@ acpi_ex_resolve_node_to_value(struct acpi_namespace_node **object_ptr,
|
|||
case ACPI_TYPE_INTEGER:
|
||||
|
||||
if (ACPI_GET_OBJECT_TYPE(source_desc) != ACPI_TYPE_INTEGER) {
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
||||
"Object not a Integer, type %s\n",
|
||||
acpi_ut_get_object_type_name
|
||||
(source_desc)));
|
||||
ACPI_REPORT_ERROR(("Object not a Integer, type %s\n",
|
||||
acpi_ut_get_object_type_name
|
||||
(source_desc)));
|
||||
return_ACPI_STATUS(AE_AML_OPERAND_TYPE);
|
||||
}
|
||||
|
||||
|
|
@ -236,9 +231,8 @@ acpi_ex_resolve_node_to_value(struct acpi_namespace_node **object_ptr,
|
|||
|
||||
case ACPI_TYPE_ANY:
|
||||
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
||||
"Untyped entry %p, no attached object!\n",
|
||||
node));
|
||||
ACPI_REPORT_ERROR(("Untyped entry %p, no attached object!\n",
|
||||
node));
|
||||
|
||||
return_ACPI_STATUS(AE_AML_OPERAND_TYPE); /* Cannot be AE_TYPE */
|
||||
|
||||
|
|
@ -257,12 +251,7 @@ acpi_ex_resolve_node_to_value(struct acpi_namespace_node **object_ptr,
|
|||
default:
|
||||
/* No named references are allowed here */
|
||||
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
||||
"Unsupported Reference opcode %X (%s)\n",
|
||||
source_desc->reference.opcode,
|
||||
acpi_ps_get_opcode_name(source_desc->
|
||||
reference.
|
||||
opcode)));
|
||||
ACPI_REPORT_ERROR(("Unsupported Reference opcode %X (%s)\n", source_desc->reference.opcode, acpi_ps_get_opcode_name(source_desc->reference.opcode)));
|
||||
|
||||
return_ACPI_STATUS(AE_AML_OPERAND_TYPE);
|
||||
}
|
||||
|
|
@ -272,9 +261,8 @@ acpi_ex_resolve_node_to_value(struct acpi_namespace_node **object_ptr,
|
|||
|
||||
/* Default case is for unknown types */
|
||||
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
||||
"Node %p - Unknown object type %X\n",
|
||||
node, entry_type));
|
||||
ACPI_REPORT_ERROR(("Node %p - Unknown object type %X\n",
|
||||
node, entry_type));
|
||||
|
||||
return_ACPI_STATUS(AE_AML_OPERAND_TYPE);
|
||||
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
*****************************************************************************/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2000 - 2005, R. Byron Moore
|
||||
* Copyright (C) 2000 - 2006, R. Byron Moore
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
|
@ -81,7 +81,7 @@ acpi_ex_resolve_to_value(union acpi_operand_object **stack_ptr,
|
|||
ACPI_FUNCTION_TRACE_PTR("ex_resolve_to_value", stack_ptr);
|
||||
|
||||
if (!stack_ptr || !*stack_ptr) {
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Internal - null pointer\n"));
|
||||
ACPI_REPORT_ERROR(("Internal - null pointer\n"));
|
||||
return_ACPI_STATUS(AE_AML_NO_OPERAND);
|
||||
}
|
||||
|
||||
|
|
@ -97,8 +97,7 @@ acpi_ex_resolve_to_value(union acpi_operand_object **stack_ptr,
|
|||
}
|
||||
|
||||
if (!*stack_ptr) {
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
||||
"Internal - null pointer\n"));
|
||||
ACPI_REPORT_ERROR(("Internal - null pointer\n"));
|
||||
return_ACPI_STATUS(AE_AML_NO_OPERAND);
|
||||
}
|
||||
}
|
||||
|
|
@ -228,9 +227,7 @@ acpi_ex_resolve_object_to_value(union acpi_operand_object **stack_ptr,
|
|||
* A NULL object descriptor means an unitialized element of
|
||||
* the package, can't dereference it
|
||||
*/
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
||||
"Attempt to deref an Index to NULL pkg element Idx=%p\n",
|
||||
stack_desc));
|
||||
ACPI_REPORT_ERROR(("Attempt to deref an Index to NULL pkg element Idx=%p\n", stack_desc));
|
||||
status = AE_AML_UNINITIALIZED_ELEMENT;
|
||||
}
|
||||
break;
|
||||
|
|
@ -239,7 +236,7 @@ acpi_ex_resolve_object_to_value(union acpi_operand_object **stack_ptr,
|
|||
|
||||
/* Invalid reference object */
|
||||
|
||||
ACPI_REPORT_ERROR(("During resolve, Unknown target_type %X in Index/Reference obj %p\n", stack_desc->reference.target_type, stack_desc));
|
||||
ACPI_REPORT_ERROR(("Unknown target_type %X in Index/Reference obj %p\n", stack_desc->reference.target_type, stack_desc));
|
||||
status = AE_AML_INTERNAL;
|
||||
break;
|
||||
}
|
||||
|
|
@ -264,7 +261,7 @@ acpi_ex_resolve_object_to_value(union acpi_operand_object **stack_ptr,
|
|||
|
||||
default:
|
||||
|
||||
ACPI_REPORT_ERROR(("During resolve, Unknown Reference opcode %X (%s) in %p\n", opcode, acpi_ps_get_opcode_name(opcode), stack_desc));
|
||||
ACPI_REPORT_ERROR(("Unknown Reference opcode %X (%s) in %p\n", opcode, acpi_ps_get_opcode_name(opcode), stack_desc));
|
||||
status = AE_AML_INTERNAL;
|
||||
break;
|
||||
}
|
||||
|
|
@ -386,7 +383,10 @@ acpi_ex_resolve_multiple(struct acpi_walk_state *walk_state,
|
|||
|
||||
if (ACPI_GET_DESCRIPTOR_TYPE(node) !=
|
||||
ACPI_DESC_TYPE_NAMED) {
|
||||
ACPI_REPORT_ERROR(("acpi_ex_resolve_multiple: Not a NS node %p [%s]\n", node, acpi_ut_get_descriptor_name(node)));
|
||||
ACPI_REPORT_ERROR(("Not a NS node %p [%s]\n",
|
||||
node,
|
||||
acpi_ut_get_descriptor_name
|
||||
(node)));
|
||||
return_ACPI_STATUS(AE_AML_INTERNAL);
|
||||
}
|
||||
|
||||
|
|
@ -442,7 +442,10 @@ acpi_ex_resolve_multiple(struct acpi_walk_state *walk_state,
|
|||
|
||||
if (ACPI_GET_DESCRIPTOR_TYPE(node) !=
|
||||
ACPI_DESC_TYPE_NAMED) {
|
||||
ACPI_REPORT_ERROR(("acpi_ex_resolve_multiple: Not a NS node %p [%s]\n", node, acpi_ut_get_descriptor_name(node)));
|
||||
ACPI_REPORT_ERROR(("Not a NS node %p [%s]\n",
|
||||
node,
|
||||
acpi_ut_get_descriptor_name
|
||||
(node)));
|
||||
return_ACPI_STATUS(AE_AML_INTERNAL);
|
||||
}
|
||||
|
||||
|
|
@ -511,7 +514,8 @@ acpi_ex_resolve_multiple(struct acpi_walk_state *walk_state,
|
|||
|
||||
default:
|
||||
|
||||
ACPI_REPORT_ERROR(("acpi_ex_resolve_multiple: Unknown Reference subtype %X\n", obj_desc->reference.opcode));
|
||||
ACPI_REPORT_ERROR(("Unknown Reference subtype %X\n",
|
||||
obj_desc->reference.opcode));
|
||||
return_ACPI_STATUS(AE_AML_INTERNAL);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
*****************************************************************************/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2000 - 2005, R. Byron Moore
|
||||
* Copyright (C) 2000 - 2006, R. Byron Moore
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
|
@ -73,7 +73,7 @@ static acpi_status
|
|||
acpi_ex_check_object_type(acpi_object_type type_needed,
|
||||
acpi_object_type this_type, void *object)
|
||||
{
|
||||
ACPI_FUNCTION_NAME("ex_check_object_type");
|
||||
ACPI_FUNCTION_ENTRY();
|
||||
|
||||
if (type_needed == ACPI_TYPE_ANY) {
|
||||
/* All types OK, so we don't perform any typechecks */
|
||||
|
|
@ -95,10 +95,9 @@ acpi_ex_check_object_type(acpi_object_type type_needed,
|
|||
}
|
||||
|
||||
if (type_needed != this_type) {
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
||||
"Needed [%s], found [%s] %p\n",
|
||||
acpi_ut_get_type_name(type_needed),
|
||||
acpi_ut_get_type_name(this_type), object));
|
||||
ACPI_REPORT_ERROR(("Needed type [%s], found [%s] %p\n",
|
||||
acpi_ut_get_type_name(type_needed),
|
||||
acpi_ut_get_type_name(this_type), object));
|
||||
|
||||
return (AE_AML_OPERAND_TYPE);
|
||||
}
|
||||
|
|
@ -151,13 +150,13 @@ acpi_ex_resolve_operands(u16 opcode,
|
|||
|
||||
arg_types = op_info->runtime_args;
|
||||
if (arg_types == ARGI_INVALID_OPCODE) {
|
||||
ACPI_REPORT_ERROR(("resolve_operands: %X is not a valid AML opcode\n", opcode));
|
||||
ACPI_REPORT_ERROR(("Unknown AML opcode %X\n", opcode));
|
||||
|
||||
return_ACPI_STATUS(AE_AML_INTERNAL);
|
||||
}
|
||||
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
|
||||
"Opcode %X [%s] required_operand_types=%8.8X \n",
|
||||
"Opcode %X [%s] required_operand_types=%8.8X\n",
|
||||
opcode, op_info->name, arg_types));
|
||||
|
||||
/*
|
||||
|
|
@ -169,7 +168,8 @@ acpi_ex_resolve_operands(u16 opcode,
|
|||
*/
|
||||
while (GET_CURRENT_ARG_TYPE(arg_types)) {
|
||||
if (!stack_ptr || !*stack_ptr) {
|
||||
ACPI_REPORT_ERROR(("resolve_operands: Null stack entry at %p\n", stack_ptr));
|
||||
ACPI_REPORT_ERROR(("Null stack entry at %p\n",
|
||||
stack_ptr));
|
||||
|
||||
return_ACPI_STATUS(AE_AML_INTERNAL);
|
||||
}
|
||||
|
|
@ -198,9 +198,7 @@ acpi_ex_resolve_operands(u16 opcode,
|
|||
/* Check for bad acpi_object_type */
|
||||
|
||||
if (!acpi_ut_valid_object_type(object_type)) {
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
||||
"Bad operand object type [%X]\n",
|
||||
object_type));
|
||||
ACPI_REPORT_ERROR(("Bad operand object type [%X]\n", object_type));
|
||||
|
||||
return_ACPI_STATUS(AE_AML_OPERAND_TYPE);
|
||||
}
|
||||
|
|
@ -238,13 +236,7 @@ acpi_ex_resolve_operands(u16 opcode,
|
|||
break;
|
||||
|
||||
default:
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
||||
"Operand is a Reference, Unknown Reference Opcode %X [%s]\n",
|
||||
obj_desc->reference.
|
||||
opcode,
|
||||
(acpi_ps_get_opcode_info
|
||||
(obj_desc->reference.
|
||||
opcode))->name));
|
||||
ACPI_REPORT_ERROR(("Operand is a Reference, Unknown Reference Opcode: %X\n", obj_desc->reference.opcode));
|
||||
|
||||
return_ACPI_STATUS(AE_AML_OPERAND_TYPE);
|
||||
}
|
||||
|
|
@ -255,11 +247,10 @@ acpi_ex_resolve_operands(u16 opcode,
|
|||
|
||||
/* Invalid descriptor */
|
||||
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
||||
"Invalid descriptor %p [%s]\n",
|
||||
obj_desc,
|
||||
acpi_ut_get_descriptor_name
|
||||
(obj_desc)));
|
||||
ACPI_REPORT_ERROR(("Invalid descriptor %p [%s]\n",
|
||||
obj_desc,
|
||||
acpi_ut_get_descriptor_name
|
||||
(obj_desc)));
|
||||
|
||||
return_ACPI_STATUS(AE_AML_OPERAND_TYPE);
|
||||
}
|
||||
|
|
@ -417,11 +408,7 @@ acpi_ex_resolve_operands(u16 opcode,
|
|||
acpi_ex_convert_to_integer(obj_desc, stack_ptr, 16);
|
||||
if (ACPI_FAILURE(status)) {
|
||||
if (status == AE_TYPE) {
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
||||
"Needed [Integer/String/Buffer], found [%s] %p\n",
|
||||
acpi_ut_get_object_type_name
|
||||
(obj_desc),
|
||||
obj_desc));
|
||||
ACPI_REPORT_ERROR(("Needed [Integer/String/Buffer], found [%s] %p\n", acpi_ut_get_object_type_name(obj_desc), obj_desc));
|
||||
|
||||
return_ACPI_STATUS(AE_AML_OPERAND_TYPE);
|
||||
}
|
||||
|
|
@ -444,11 +431,7 @@ acpi_ex_resolve_operands(u16 opcode,
|
|||
status = acpi_ex_convert_to_buffer(obj_desc, stack_ptr);
|
||||
if (ACPI_FAILURE(status)) {
|
||||
if (status == AE_TYPE) {
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
||||
"Needed [Integer/String/Buffer], found [%s] %p\n",
|
||||
acpi_ut_get_object_type_name
|
||||
(obj_desc),
|
||||
obj_desc));
|
||||
ACPI_REPORT_ERROR(("Needed [Integer/String/Buffer], found [%s] %p\n", acpi_ut_get_object_type_name(obj_desc), obj_desc));
|
||||
|
||||
return_ACPI_STATUS(AE_AML_OPERAND_TYPE);
|
||||
}
|
||||
|
|
@ -472,11 +455,7 @@ acpi_ex_resolve_operands(u16 opcode,
|
|||
ACPI_IMPLICIT_CONVERT_HEX);
|
||||
if (ACPI_FAILURE(status)) {
|
||||
if (status == AE_TYPE) {
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
||||
"Needed [Integer/String/Buffer], found [%s] %p\n",
|
||||
acpi_ut_get_object_type_name
|
||||
(obj_desc),
|
||||
obj_desc));
|
||||
ACPI_REPORT_ERROR(("Needed [Integer/String/Buffer], found [%s] %p\n", acpi_ut_get_object_type_name(obj_desc), obj_desc));
|
||||
|
||||
return_ACPI_STATUS(AE_AML_OPERAND_TYPE);
|
||||
}
|
||||
|
|
@ -502,10 +481,7 @@ acpi_ex_resolve_operands(u16 opcode,
|
|||
break;
|
||||
|
||||
default:
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
||||
"Needed [Integer/String/Buffer], found [%s] %p\n",
|
||||
acpi_ut_get_object_type_name
|
||||
(obj_desc), obj_desc));
|
||||
ACPI_REPORT_ERROR(("Needed [Integer/String/Buffer], found [%s] %p\n", acpi_ut_get_object_type_name(obj_desc), obj_desc));
|
||||
|
||||
return_ACPI_STATUS(AE_AML_OPERAND_TYPE);
|
||||
}
|
||||
|
|
@ -539,10 +515,7 @@ acpi_ex_resolve_operands(u16 opcode,
|
|||
break;
|
||||
|
||||
default:
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
||||
"Needed [Integer/String/Buffer], found [%s] %p\n",
|
||||
acpi_ut_get_object_type_name
|
||||
(obj_desc), obj_desc));
|
||||
ACPI_REPORT_ERROR(("Needed [Integer/String/Buffer], found [%s] %p\n", acpi_ut_get_object_type_name(obj_desc), obj_desc));
|
||||
|
||||
return_ACPI_STATUS(AE_AML_OPERAND_TYPE);
|
||||
}
|
||||
|
|
@ -566,10 +539,7 @@ acpi_ex_resolve_operands(u16 opcode,
|
|||
break;
|
||||
|
||||
default:
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
||||
"Needed [Buffer/String/Package/Reference], found [%s] %p\n",
|
||||
acpi_ut_get_object_type_name
|
||||
(obj_desc), obj_desc));
|
||||
ACPI_REPORT_ERROR(("Needed [Buffer/String/Package/Reference], found [%s] %p\n", acpi_ut_get_object_type_name(obj_desc), obj_desc));
|
||||
|
||||
return_ACPI_STATUS(AE_AML_OPERAND_TYPE);
|
||||
}
|
||||
|
|
@ -588,10 +558,7 @@ acpi_ex_resolve_operands(u16 opcode,
|
|||
break;
|
||||
|
||||
default:
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
||||
"Needed [Buffer/String/Package], found [%s] %p\n",
|
||||
acpi_ut_get_object_type_name
|
||||
(obj_desc), obj_desc));
|
||||
ACPI_REPORT_ERROR(("Needed [Buffer/String/Package], found [%s] %p\n", acpi_ut_get_object_type_name(obj_desc), obj_desc));
|
||||
|
||||
return_ACPI_STATUS(AE_AML_OPERAND_TYPE);
|
||||
}
|
||||
|
|
@ -611,10 +578,7 @@ acpi_ex_resolve_operands(u16 opcode,
|
|||
break;
|
||||
|
||||
default:
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
||||
"Needed [Region/region_field], found [%s] %p\n",
|
||||
acpi_ut_get_object_type_name
|
||||
(obj_desc), obj_desc));
|
||||
ACPI_REPORT_ERROR(("Needed [Region/region_field], found [%s] %p\n", acpi_ut_get_object_type_name(obj_desc), obj_desc));
|
||||
|
||||
return_ACPI_STATUS(AE_AML_OPERAND_TYPE);
|
||||
}
|
||||
|
|
@ -656,10 +620,7 @@ acpi_ex_resolve_operands(u16 opcode,
|
|||
break;
|
||||
}
|
||||
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
||||
"Needed Integer/Buffer/String/Package/Ref/Ddb], found [%s] %p\n",
|
||||
acpi_ut_get_object_type_name
|
||||
(obj_desc), obj_desc));
|
||||
ACPI_REPORT_ERROR(("Needed Integer/Buffer/String/Package/Ref/Ddb], found [%s] %p\n", acpi_ut_get_object_type_name(obj_desc), obj_desc));
|
||||
|
||||
return_ACPI_STATUS(AE_AML_OPERAND_TYPE);
|
||||
}
|
||||
|
|
@ -669,9 +630,7 @@ acpi_ex_resolve_operands(u16 opcode,
|
|||
|
||||
/* Unknown type */
|
||||
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
||||
"Internal - Unknown ARGI (required operand) type %X\n",
|
||||
this_arg_type));
|
||||
ACPI_REPORT_ERROR(("Internal - Unknown ARGI (required operand) type %X\n", this_arg_type));
|
||||
|
||||
return_ACPI_STATUS(AE_BAD_PARAMETER);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
*****************************************************************************/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2000 - 2005, R. Byron Moore
|
||||
* Copyright (C) 2000 - 2006, R. Byron Moore
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
|
@ -250,7 +250,7 @@ acpi_ex_store(union acpi_operand_object *source_desc,
|
|||
/* Validate parameters */
|
||||
|
||||
if (!source_desc || !dest_desc) {
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Null parameter\n"));
|
||||
ACPI_REPORT_ERROR(("Null parameter\n"));
|
||||
return_ACPI_STATUS(AE_AML_NO_OPERAND);
|
||||
}
|
||||
|
||||
|
|
@ -290,10 +290,7 @@ acpi_ex_store(union acpi_operand_object *source_desc,
|
|||
|
||||
/* Destination is not a Reference object */
|
||||
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
||||
"Target is not a Reference or Constant object - %s [%p]\n",
|
||||
acpi_ut_get_object_type_name(dest_desc),
|
||||
dest_desc));
|
||||
ACPI_REPORT_ERROR(("Target is not a Reference or Constant object - %s [%p]\n", acpi_ut_get_object_type_name(dest_desc), dest_desc));
|
||||
|
||||
ACPI_DUMP_STACK_ENTRY(source_desc);
|
||||
ACPI_DUMP_STACK_ENTRY(dest_desc);
|
||||
|
|
@ -360,7 +357,7 @@ acpi_ex_store(union acpi_operand_object *source_desc,
|
|||
|
||||
default:
|
||||
|
||||
ACPI_REPORT_ERROR(("ex_store: Unknown Reference opcode %X\n",
|
||||
ACPI_REPORT_ERROR(("Unknown Reference opcode %X\n",
|
||||
ref_desc->reference.opcode));
|
||||
ACPI_DUMP_ENTRY(ref_desc, ACPI_LV_ERROR);
|
||||
|
||||
|
|
@ -490,10 +487,7 @@ acpi_ex_store_object_to_index(union acpi_operand_object *source_desc,
|
|||
|
||||
/* All other types are invalid */
|
||||
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
||||
"Source must be Integer/Buffer/String type, not %s\n",
|
||||
acpi_ut_get_object_type_name
|
||||
(source_desc)));
|
||||
ACPI_REPORT_ERROR(("Source must be Integer/Buffer/String type, not %s\n", acpi_ut_get_object_type_name(source_desc)));
|
||||
return_ACPI_STATUS(AE_AML_OPERAND_TYPE);
|
||||
}
|
||||
|
||||
|
|
@ -503,8 +497,7 @@ acpi_ex_store_object_to_index(union acpi_operand_object *source_desc,
|
|||
break;
|
||||
|
||||
default:
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
||||
"Target is not a Package or buffer_field\n"));
|
||||
ACPI_REPORT_ERROR(("Target is not a Package or buffer_field\n"));
|
||||
status = AE_AML_OPERAND_TYPE;
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
*****************************************************************************/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2000 - 2005, R. Byron Moore
|
||||
* Copyright (C) 2000 - 2006, R. Byron Moore
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
|
@ -123,11 +123,7 @@ acpi_ex_resolve_object(union acpi_operand_object **source_desc_ptr,
|
|||
&& (source_desc->reference.opcode == AML_LOAD_OP))) {
|
||||
/* Conversion successful but still not a valid type */
|
||||
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
||||
"Cannot assign type %s to %s (must be type Int/Str/Buf)\n",
|
||||
acpi_ut_get_object_type_name
|
||||
(source_desc),
|
||||
acpi_ut_get_type_name(target_type)));
|
||||
ACPI_REPORT_ERROR(("Cannot assign type %s to %s (must be type Int/Str/Buf)\n", acpi_ut_get_object_type_name(source_desc), acpi_ut_get_type_name(target_type)));
|
||||
status = AE_AML_OPERAND_TYPE;
|
||||
}
|
||||
break;
|
||||
|
|
@ -280,9 +276,8 @@ acpi_ex_store_object_to_object(union acpi_operand_object *source_desc,
|
|||
/*
|
||||
* All other types come here.
|
||||
*/
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_WARN,
|
||||
"Store into type %s not implemented\n",
|
||||
acpi_ut_get_object_type_name(dest_desc)));
|
||||
ACPI_REPORT_WARNING(("Store into type %s not implemented\n",
|
||||
acpi_ut_get_object_type_name(dest_desc)));
|
||||
|
||||
status = AE_NOT_IMPLEMENTED;
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
*****************************************************************************/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2000 - 2005, R. Byron Moore
|
||||
* Copyright (C) 2000 - 2006, R. Byron Moore
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
|
@ -71,7 +71,7 @@ acpi_ex_store_buffer_to_buffer(union acpi_operand_object *source_desc,
|
|||
|
||||
/* We know that source_desc is a buffer by now */
|
||||
|
||||
buffer = (u8 *) source_desc->buffer.pointer;
|
||||
buffer = ACPI_CAST_PTR(u8, source_desc->buffer.pointer);
|
||||
length = source_desc->buffer.length;
|
||||
|
||||
/*
|
||||
|
|
@ -160,7 +160,7 @@ acpi_ex_store_string_to_string(union acpi_operand_object *source_desc,
|
|||
|
||||
/* We know that source_desc is a string by now */
|
||||
|
||||
buffer = (u8 *) source_desc->string.pointer;
|
||||
buffer = ACPI_CAST_PTR(u8, source_desc->string.pointer);
|
||||
length = source_desc->string.length;
|
||||
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
*****************************************************************************/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2000 - 2005, R. Byron Moore
|
||||
* Copyright (C) 2000 - 2006, R. Byron Moore
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
|
@ -129,7 +129,7 @@ acpi_status acpi_ex_system_do_stall(u32 how_long)
|
|||
* (ACPI specifies 100 usec as max, but this gives some slack in
|
||||
* order to support existing BIOSs)
|
||||
*/
|
||||
ACPI_REPORT_ERROR(("Stall: Time parameter is too large (%d)\n",
|
||||
ACPI_REPORT_ERROR(("Time parameter is too large (%d)\n",
|
||||
how_long));
|
||||
status = AE_AML_OPERAND_VALUE;
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
*****************************************************************************/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2000 - 2005, R. Byron Moore
|
||||
* Copyright (C) 2000 - 2006, R. Byron Moore
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
|
@ -200,13 +200,11 @@ u8 acpi_ex_acquire_global_lock(u32 field_flags)
|
|||
if (ACPI_SUCCESS(status)) {
|
||||
locked = TRUE;
|
||||
} else {
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
||||
"Could not acquire Global Lock, %s\n",
|
||||
acpi_format_exception(status)));
|
||||
ACPI_REPORT_ERROR(("Could not acquire Global Lock, %s\n", acpi_format_exception(status)));
|
||||
}
|
||||
}
|
||||
|
||||
return_VALUE(locked);
|
||||
return_UINT8(locked);
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
|
|
@ -268,7 +266,7 @@ static u32 acpi_ex_digits_needed(acpi_integer value, u32 base)
|
|||
/* acpi_integer is unsigned, so we don't worry about a '-' prefix */
|
||||
|
||||
if (value == 0) {
|
||||
return_VALUE(1);
|
||||
return_UINT32(1);
|
||||
}
|
||||
|
||||
current_value = value;
|
||||
|
|
@ -282,7 +280,7 @@ static u32 acpi_ex_digits_needed(acpi_integer value, u32 base)
|
|||
num_digits++;
|
||||
}
|
||||
|
||||
return_VALUE(num_digits);
|
||||
return_UINT32(num_digits);
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
|
|
|
|||
|
|
@ -99,15 +99,15 @@ do_root_bridge_busnr_callback(struct acpi_resource *resource, void *data)
|
|||
unsigned long *busnr = (unsigned long *)data;
|
||||
struct acpi_resource_address64 address;
|
||||
|
||||
if (resource->id != ACPI_RSTYPE_ADDRESS16 &&
|
||||
resource->id != ACPI_RSTYPE_ADDRESS32 &&
|
||||
resource->id != ACPI_RSTYPE_ADDRESS64)
|
||||
if (resource->type != ACPI_RESOURCE_TYPE_ADDRESS16 &&
|
||||
resource->type != ACPI_RESOURCE_TYPE_ADDRESS32 &&
|
||||
resource->type != ACPI_RESOURCE_TYPE_ADDRESS64)
|
||||
return AE_OK;
|
||||
|
||||
acpi_resource_to_address64(resource, &address);
|
||||
if ((address.address_length > 0) &&
|
||||
(address.resource_type == ACPI_BUS_NUMBER_RANGE))
|
||||
*busnr = address.min_address_range;
|
||||
*busnr = address.minimum;
|
||||
|
||||
return AE_OK;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
*****************************************************************************/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2000 - 2005, R. Byron Moore
|
||||
* Copyright (C) 2000 - 2006, R. Byron Moore
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
|
@ -68,8 +68,7 @@ acpi_status acpi_hw_initialize(void)
|
|||
/* We must have the ACPI tables by the time we get here */
|
||||
|
||||
if (!acpi_gbl_FADT) {
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "No FADT is present\n"));
|
||||
|
||||
ACPI_REPORT_ERROR(("No FADT is present\n"));
|
||||
return_ACPI_STATUS(AE_NO_ACPI_TABLES);
|
||||
}
|
||||
|
||||
|
|
@ -108,7 +107,7 @@ acpi_status acpi_hw_set_mode(u32 mode)
|
|||
* system does not support mode transition.
|
||||
*/
|
||||
if (!acpi_gbl_FADT->smi_cmd) {
|
||||
ACPI_REPORT_ERROR(("No SMI_CMD in FADT, mode transition failed.\n"));
|
||||
ACPI_REPORT_ERROR(("No SMI_CMD in FADT, mode transition failed\n"));
|
||||
return_ACPI_STATUS(AE_NO_HARDWARE_RESPONSE);
|
||||
}
|
||||
|
||||
|
|
@ -204,18 +203,18 @@ u32 acpi_hw_get_mode(void)
|
|||
* system does not support mode transition.
|
||||
*/
|
||||
if (!acpi_gbl_FADT->smi_cmd) {
|
||||
return_VALUE(ACPI_SYS_MODE_ACPI);
|
||||
return_UINT32(ACPI_SYS_MODE_ACPI);
|
||||
}
|
||||
|
||||
status =
|
||||
acpi_get_register(ACPI_BITREG_SCI_ENABLE, &value, ACPI_MTX_LOCK);
|
||||
if (ACPI_FAILURE(status)) {
|
||||
return_VALUE(ACPI_SYS_MODE_LEGACY);
|
||||
return_UINT32(ACPI_SYS_MODE_LEGACY);
|
||||
}
|
||||
|
||||
if (value) {
|
||||
return_VALUE(ACPI_SYS_MODE_ACPI);
|
||||
return_UINT32(ACPI_SYS_MODE_ACPI);
|
||||
} else {
|
||||
return_VALUE(ACPI_SYS_MODE_LEGACY);
|
||||
return_UINT32(ACPI_SYS_MODE_LEGACY);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
*****************************************************************************/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2000 - 2005, R. Byron Moore
|
||||
* Copyright (C) 2000 - 2006, R. Byron Moore
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
******************************************************************************/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2000 - 2005, R. Byron Moore
|
||||
* Copyright (C) 2000 - 2006, R. Byron Moore
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
|
@ -144,7 +144,8 @@ acpi_get_sleep_type_data(u8 sleep_state, u8 * sleep_type_a, u8 * sleep_type_b)
|
|||
|
||||
info.parameters = NULL;
|
||||
info.return_object = NULL;
|
||||
sleep_state_name = (char *)acpi_gbl_sleep_state_names[sleep_state];
|
||||
sleep_state_name =
|
||||
ACPI_CAST_PTR(char, acpi_gbl_sleep_state_names[sleep_state]);
|
||||
|
||||
status = acpi_ns_evaluate_by_name(sleep_state_name, &info);
|
||||
if (ACPI_FAILURE(status)) {
|
||||
|
|
@ -201,12 +202,7 @@ acpi_get_sleep_type_data(u8 sleep_state, u8 * sleep_type_a, u8 * sleep_type_b)
|
|||
}
|
||||
|
||||
if (ACPI_FAILURE(status)) {
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
||||
"%s While evaluating sleep_state [%s], bad Sleep object %p type %s\n",
|
||||
acpi_format_exception(status),
|
||||
sleep_state_name, info.return_object,
|
||||
acpi_ut_get_object_type_name(info.
|
||||
return_object)));
|
||||
ACPI_REPORT_ERROR(("%s While evaluating sleep_state [%s], bad Sleep object %p type %s\n", acpi_format_exception(status), sleep_state_name, info.return_object, acpi_ut_get_object_type_name(info.return_object)));
|
||||
}
|
||||
|
||||
acpi_ut_remove_reference(info.return_object);
|
||||
|
|
@ -229,12 +225,11 @@ EXPORT_SYMBOL(acpi_get_sleep_type_data);
|
|||
|
||||
struct acpi_bit_register_info *acpi_hw_get_bit_register_info(u32 register_id)
|
||||
{
|
||||
ACPI_FUNCTION_NAME("hw_get_bit_register_info");
|
||||
ACPI_FUNCTION_ENTRY();
|
||||
|
||||
if (register_id > ACPI_BITREG_MAX) {
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
||||
"Invalid bit_register ID: %X\n",
|
||||
register_id));
|
||||
ACPI_REPORT_ERROR(("Invalid bit_register ID: %X\n",
|
||||
register_id));
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
|
|
@ -569,8 +564,7 @@ acpi_hw_register_read(u8 use_lock, u32 register_id, u32 * return_value)
|
|||
break;
|
||||
|
||||
default:
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Unknown Register ID: %X\n",
|
||||
register_id));
|
||||
ACPI_REPORT_ERROR(("Unknown Register ID: %X\n", register_id));
|
||||
status = AE_BAD_PARAMETER;
|
||||
break;
|
||||
}
|
||||
|
|
@ -765,9 +759,8 @@ acpi_hw_low_level_read(u32 width, u32 * value, struct acpi_generic_address *reg)
|
|||
break;
|
||||
|
||||
default:
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
||||
"Unsupported address space: %X\n",
|
||||
reg->address_space_id));
|
||||
ACPI_REPORT_ERROR(("Unsupported address space: %X\n",
|
||||
reg->address_space_id));
|
||||
return (AE_BAD_PARAMETER);
|
||||
}
|
||||
|
||||
|
|
@ -836,9 +829,8 @@ acpi_hw_low_level_write(u32 width, u32 value, struct acpi_generic_address * reg)
|
|||
break;
|
||||
|
||||
default:
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
||||
"Unsupported address space: %X\n",
|
||||
reg->address_space_id));
|
||||
ACPI_REPORT_ERROR(("Unsupported address space: %X\n",
|
||||
reg->address_space_id));
|
||||
return (AE_BAD_PARAMETER);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
*****************************************************************************/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2000 - 2005, R. Byron Moore
|
||||
* Copyright (C) 2000 - 2006, R. Byron Moore
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
*****************************************************************************/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2000 - 2005, R. Byron Moore
|
||||
* Copyright (C) 2000 - 2006, R. Byron Moore
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
|
|
|||
|
|
@ -54,36 +54,36 @@ static acpi_status acpi_reserve_io_ranges(struct acpi_resource *res, void *data)
|
|||
|
||||
ACPI_FUNCTION_TRACE("acpi_reserve_io_ranges");
|
||||
|
||||
if (res->id == ACPI_RSTYPE_IO) {
|
||||
if (res->type == ACPI_RESOURCE_TYPE_IO) {
|
||||
struct acpi_resource_io *io_res = &res->data.io;
|
||||
|
||||
if (io_res->min_base_address != io_res->max_base_address)
|
||||
if (io_res->minimum != io_res->maximum)
|
||||
return_VALUE(AE_OK);
|
||||
if (IS_RESERVED_ADDR
|
||||
(io_res->min_base_address, io_res->range_length)) {
|
||||
(io_res->minimum, io_res->address_length)) {
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_INFO,
|
||||
"Motherboard resources 0x%08x - 0x%08x\n",
|
||||
io_res->min_base_address,
|
||||
io_res->min_base_address +
|
||||
io_res->range_length));
|
||||
io_res->minimum,
|
||||
io_res->minimum +
|
||||
io_res->address_length));
|
||||
requested_res =
|
||||
request_region(io_res->min_base_address,
|
||||
io_res->range_length, "motherboard");
|
||||
request_region(io_res->minimum,
|
||||
io_res->address_length, "motherboard");
|
||||
}
|
||||
} else if (res->id == ACPI_RSTYPE_FIXED_IO) {
|
||||
} else if (res->type == ACPI_RESOURCE_TYPE_FIXED_IO) {
|
||||
struct acpi_resource_fixed_io *fixed_io_res =
|
||||
&res->data.fixed_io;
|
||||
|
||||
if (IS_RESERVED_ADDR
|
||||
(fixed_io_res->base_address, fixed_io_res->range_length)) {
|
||||
(fixed_io_res->address, fixed_io_res->address_length)) {
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_INFO,
|
||||
"Motherboard resources 0x%08x - 0x%08x\n",
|
||||
fixed_io_res->base_address,
|
||||
fixed_io_res->base_address +
|
||||
fixed_io_res->range_length));
|
||||
fixed_io_res->address,
|
||||
fixed_io_res->address +
|
||||
fixed_io_res->address_length));
|
||||
requested_res =
|
||||
request_region(fixed_io_res->base_address,
|
||||
fixed_io_res->range_length,
|
||||
request_region(fixed_io_res->address,
|
||||
fixed_io_res->address_length,
|
||||
"motherboard");
|
||||
}
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
******************************************************************************/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2000 - 2005, R. Byron Moore
|
||||
* Copyright (C) 2000 - 2006, R. Byron Moore
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
|
@ -110,10 +110,7 @@ acpi_status acpi_ns_root_initialize(void)
|
|||
ACPI_NS_NO_UPSEARCH, NULL, &new_node);
|
||||
|
||||
if (ACPI_FAILURE(status) || (!new_node)) { /* Must be on same line for code converter */
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
||||
"Could not create predefined name %s, %s\n",
|
||||
init_val->name,
|
||||
acpi_format_exception(status)));
|
||||
ACPI_REPORT_ERROR(("Could not create predefined name %s, %s\n", init_val->name, acpi_format_exception(status)));
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -124,9 +121,7 @@ acpi_status acpi_ns_root_initialize(void)
|
|||
if (init_val->val) {
|
||||
status = acpi_os_predefined_override(init_val, &val);
|
||||
if (ACPI_FAILURE(status)) {
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
||||
"Could not override predefined %s\n",
|
||||
init_val->name));
|
||||
ACPI_REPORT_ERROR(("Could not override predefined %s\n", init_val->name));
|
||||
}
|
||||
|
||||
if (!val) {
|
||||
|
|
@ -339,7 +334,10 @@ acpi_ns_lookup(union acpi_generic_state *scope_info,
|
|||
prefix_node = scope_info->scope.node;
|
||||
if (ACPI_GET_DESCRIPTOR_TYPE(prefix_node) !=
|
||||
ACPI_DESC_TYPE_NAMED) {
|
||||
ACPI_REPORT_ERROR(("ns_lookup: %p is not a namespace node [%s]\n", prefix_node, acpi_ut_get_descriptor_name(prefix_node)));
|
||||
ACPI_REPORT_ERROR(("%p is not a namespace node [%s]\n",
|
||||
prefix_node,
|
||||
acpi_ut_get_descriptor_name
|
||||
(prefix_node)));
|
||||
return_ACPI_STATUS(AE_AML_INTERNAL);
|
||||
}
|
||||
|
||||
|
|
@ -498,7 +496,7 @@ acpi_ns_lookup(union acpi_generic_state *scope_info,
|
|||
path++;
|
||||
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_NAMES,
|
||||
"Multi Pathname (%d Segments, Flags=%X) \n",
|
||||
"Multi Pathname (%d Segments, Flags=%X)\n",
|
||||
num_segments, flags));
|
||||
break;
|
||||
|
||||
|
|
@ -600,7 +598,7 @@ acpi_ns_lookup(union acpi_generic_state *scope_info,
|
|||
(this_node->type != type_to_check_for)) {
|
||||
/* Complain about a type mismatch */
|
||||
|
||||
ACPI_REPORT_WARNING(("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)));
|
||||
ACPI_REPORT_WARNING(("ns_lookup: Type mismatch on %4.4s (%s), searching for (%s)\n", ACPI_CAST_PTR(char, &simple_name), acpi_ut_get_type_name(this_node->type), acpi_ut_get_type_name(type_to_check_for)));
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
******************************************************************************/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2000 - 2005, R. Byron Moore
|
||||
* Copyright (C) 2000 - 2006, R. Byron Moore
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
|
@ -272,9 +272,8 @@ void acpi_ns_delete_children(struct acpi_namespace_node *parent_node)
|
|||
/* Grandchildren should have all been deleted already */
|
||||
|
||||
if (child_node->child) {
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
||||
"Found a grandchild! P=%p C=%p\n",
|
||||
parent_node, child_node));
|
||||
ACPI_REPORT_ERROR(("Found a grandchild! P=%p C=%p\n",
|
||||
parent_node, child_node));
|
||||
}
|
||||
|
||||
/* Now we can free this child object */
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
*****************************************************************************/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2000 - 2005, R. Byron Moore
|
||||
* Copyright (C) 2000 - 2006, R. Byron Moore
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
|
@ -198,7 +198,8 @@ acpi_ns_dump_one_object(acpi_handle obj_handle,
|
|||
/* Check the node type and name */
|
||||
|
||||
if (type > ACPI_TYPE_LOCAL_MAX) {
|
||||
ACPI_REPORT_WARNING(("Invalid ACPI Type %08X\n", type));
|
||||
ACPI_REPORT_WARNING(("Invalid ACPI Object Type %08X\n",
|
||||
type));
|
||||
}
|
||||
|
||||
if (!acpi_ut_valid_acpi_name(this_node->name.integer)) {
|
||||
|
|
@ -212,7 +213,9 @@ acpi_ns_dump_one_object(acpi_handle obj_handle,
|
|||
/*
|
||||
* Now we can print out the pertinent information
|
||||
*/
|
||||
acpi_os_printf(" %-12s %p ", acpi_ut_get_type_name(type), this_node);
|
||||
acpi_os_printf(" %-12s %p %2.2X ",
|
||||
acpi_ut_get_type_name(type), this_node,
|
||||
this_node->owner_id);
|
||||
|
||||
dbg_level = acpi_dbg_level;
|
||||
acpi_dbg_level = 0;
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
*****************************************************************************/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2000 - 2005, R. Byron Moore
|
||||
* Copyright (C) 2000 - 2006, R. Byron Moore
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
******************************************************************************/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2000 - 2005, R. Byron Moore
|
||||
* Copyright (C) 2000 - 2006, R. Byron Moore
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
|
@ -373,8 +373,7 @@ acpi_ns_execute_control_method(struct acpi_parameter_info *info)
|
|||
|
||||
info->obj_desc = acpi_ns_get_attached_object(info->node);
|
||||
if (!info->obj_desc) {
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
||||
"No attached method object\n"));
|
||||
ACPI_REPORT_ERROR(("No attached method object\n"));
|
||||
|
||||
(void)acpi_ut_release_mutex(ACPI_MTX_NAMESPACE);
|
||||
return_ACPI_STATUS(AE_NULL_OBJECT);
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
*****************************************************************************/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2000 - 2005, R. Byron Moore
|
||||
* Copyright (C) 2000 - 2006, R. Byron Moore
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
|
@ -93,8 +93,8 @@ acpi_status acpi_ns_initialize_objects(void)
|
|||
ACPI_UINT32_MAX, acpi_ns_init_one_object,
|
||||
&info, NULL);
|
||||
if (ACPI_FAILURE(status)) {
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "walk_namespace failed! %s\n",
|
||||
acpi_format_exception(status)));
|
||||
ACPI_REPORT_ERROR(("walk_namespace failed! %s\n",
|
||||
acpi_format_exception(status)));
|
||||
}
|
||||
|
||||
ACPI_DEBUG_PRINT_RAW((ACPI_DB_INIT,
|
||||
|
|
@ -159,8 +159,8 @@ acpi_status acpi_ns_initialize_devices(void)
|
|||
(void)acpi_ut_release_mutex(ACPI_MTX_NAMESPACE);
|
||||
|
||||
if (ACPI_FAILURE(status)) {
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "walk_namespace failed! %s\n",
|
||||
acpi_format_exception(status)));
|
||||
ACPI_REPORT_ERROR(("walk_namespace failed! %s\n",
|
||||
acpi_format_exception(status)));
|
||||
}
|
||||
|
||||
ACPI_DEBUG_PRINT_RAW((ACPI_DB_INIT,
|
||||
|
|
@ -289,12 +289,7 @@ acpi_ns_init_one_object(acpi_handle obj_handle,
|
|||
}
|
||||
|
||||
if (ACPI_FAILURE(status)) {
|
||||
ACPI_DEBUG_PRINT_RAW((ACPI_DB_ERROR, "\n"));
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
||||
"Could not execute arguments for [%4.4s] (%s), %s\n",
|
||||
acpi_ut_get_node_name(node),
|
||||
acpi_ut_get_type_name(type),
|
||||
acpi_format_exception(status)));
|
||||
ACPI_REPORT_ERROR(("\nCould not execute arguments for [%4.4s] (%s), %s\n", acpi_ut_get_node_name(node), acpi_ut_get_type_name(type), acpi_format_exception(status)));
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -336,23 +331,22 @@ acpi_ns_init_one_device(acpi_handle obj_handle,
|
|||
struct acpi_parameter_info pinfo;
|
||||
u32 flags;
|
||||
acpi_status status;
|
||||
struct acpi_namespace_node *ini_node;
|
||||
struct acpi_namespace_node *device_node;
|
||||
|
||||
ACPI_FUNCTION_TRACE("ns_init_one_device");
|
||||
|
||||
pinfo.parameters = NULL;
|
||||
pinfo.parameter_type = ACPI_PARAM_ARGS;
|
||||
|
||||
pinfo.node = acpi_ns_map_handle_to_node(obj_handle);
|
||||
if (!pinfo.node) {
|
||||
device_node = acpi_ns_map_handle_to_node(obj_handle);
|
||||
if (!device_node) {
|
||||
return_ACPI_STATUS(AE_BAD_PARAMETER);
|
||||
}
|
||||
|
||||
/*
|
||||
* We will run _STA/_INI on Devices, Processors and thermal_zones only
|
||||
*/
|
||||
if ((pinfo.node->type != ACPI_TYPE_DEVICE) &&
|
||||
(pinfo.node->type != ACPI_TYPE_PROCESSOR) &&
|
||||
(pinfo.node->type != ACPI_TYPE_THERMAL)) {
|
||||
if ((device_node->type != ACPI_TYPE_DEVICE) &&
|
||||
(device_node->type != ACPI_TYPE_PROCESSOR) &&
|
||||
(device_node->type != ACPI_TYPE_THERMAL)) {
|
||||
return_ACPI_STATUS(AE_OK);
|
||||
}
|
||||
|
||||
|
|
@ -364,57 +358,70 @@ acpi_ns_init_one_device(acpi_handle obj_handle,
|
|||
info->device_count++;
|
||||
|
||||
/*
|
||||
* Run _STA to determine if we can run _INI on the device.
|
||||
* Check if the _INI method exists for this device -
|
||||
* if _INI does not exist, there is no need to run _STA
|
||||
* No _INI means device requires no initialization
|
||||
*/
|
||||
ACPI_DEBUG_EXEC(acpi_ut_display_init_pathname(ACPI_TYPE_METHOD,
|
||||
pinfo.node,
|
||||
METHOD_NAME__STA));
|
||||
status = acpi_ut_execute_STA(pinfo.node, &flags);
|
||||
|
||||
status = acpi_ns_search_node(*ACPI_CAST_PTR(u32, METHOD_NAME__INI),
|
||||
device_node, ACPI_TYPE_METHOD, &ini_node);
|
||||
if (ACPI_FAILURE(status)) {
|
||||
if (pinfo.node->type == ACPI_TYPE_DEVICE) {
|
||||
/* Ignore error and move on to next device */
|
||||
/* No _INI method found - move on to next device */
|
||||
|
||||
return_ACPI_STATUS(AE_OK);
|
||||
}
|
||||
|
||||
/* _STA is not required for Processor or thermal_zone objects */
|
||||
} else {
|
||||
info->num_STA++;
|
||||
|
||||
if (!(flags & 0x01)) {
|
||||
/* Don't look at children of a not present device */
|
||||
|
||||
return_ACPI_STATUS(AE_CTRL_DEPTH);
|
||||
}
|
||||
return_ACPI_STATUS(AE_OK);
|
||||
}
|
||||
|
||||
/*
|
||||
* The device is present. Run _INI.
|
||||
* Run _STA to determine if we can run _INI on the device -
|
||||
* the device must be present before _INI can be run.
|
||||
* However, _STA is not required - assume device present if no _STA
|
||||
*/
|
||||
ACPI_DEBUG_EXEC(acpi_ut_display_init_pathname(ACPI_TYPE_METHOD,
|
||||
device_node,
|
||||
METHOD_NAME__STA));
|
||||
|
||||
pinfo.node = device_node;
|
||||
pinfo.parameters = NULL;
|
||||
pinfo.parameter_type = ACPI_PARAM_ARGS;
|
||||
|
||||
status = acpi_ut_execute_STA(pinfo.node, &flags);
|
||||
if (ACPI_FAILURE(status)) {
|
||||
/* Ignore error and move on to next device */
|
||||
|
||||
return_ACPI_STATUS(AE_OK);
|
||||
}
|
||||
|
||||
if (flags != ACPI_UINT32_MAX) {
|
||||
info->num_STA++;
|
||||
}
|
||||
|
||||
if (!(flags & ACPI_STA_DEVICE_PRESENT)) {
|
||||
/* Don't look at children of a not present device */
|
||||
|
||||
return_ACPI_STATUS(AE_CTRL_DEPTH);
|
||||
}
|
||||
|
||||
/*
|
||||
* The device is present and _INI exists. Run the _INI method.
|
||||
* (We already have the _INI node from above)
|
||||
*/
|
||||
ACPI_DEBUG_EXEC(acpi_ut_display_init_pathname(ACPI_TYPE_METHOD,
|
||||
pinfo.node,
|
||||
METHOD_NAME__INI));
|
||||
status = acpi_ns_evaluate_relative(METHOD_NAME__INI, &pinfo);
|
||||
if (ACPI_FAILURE(status)) {
|
||||
/* No _INI (AE_NOT_FOUND) means device requires no initialization */
|
||||
|
||||
if (status != AE_NOT_FOUND) {
|
||||
/* Ignore error and move on to next device */
|
||||
pinfo.node = ini_node;
|
||||
status = acpi_ns_evaluate_by_handle(&pinfo);
|
||||
if (ACPI_FAILURE(status)) {
|
||||
/* Ignore error and move on to next device */
|
||||
|
||||
#ifdef ACPI_DEBUG_OUTPUT
|
||||
char *scope_name =
|
||||
acpi_ns_get_external_pathname(pinfo.node);
|
||||
char *scope_name = acpi_ns_get_external_pathname(ini_node);
|
||||
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_WARN, "%s._INI failed: %s\n",
|
||||
scope_name,
|
||||
acpi_format_exception(status)));
|
||||
ACPI_REPORT_WARNING(("%s._INI failed: %s\n",
|
||||
scope_name,
|
||||
acpi_format_exception(status)));
|
||||
|
||||
ACPI_MEM_FREE(scope_name);
|
||||
ACPI_MEM_FREE(scope_name);
|
||||
#endif
|
||||
}
|
||||
|
||||
status = AE_OK;
|
||||
} else {
|
||||
/* Delete any return object (especially if implicit_return is enabled) */
|
||||
|
||||
|
|
@ -434,5 +441,5 @@ acpi_ns_init_one_device(acpi_handle obj_handle,
|
|||
acpi_gbl_init_handler(pinfo.node, ACPI_INIT_DEVICE_INI);
|
||||
}
|
||||
|
||||
return_ACPI_STATUS(status);
|
||||
return_ACPI_STATUS(AE_OK);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
*****************************************************************************/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2000 - 2005, R. Byron Moore
|
||||
* Copyright (C) 2000 - 2006, R. Byron Moore
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
|
@ -92,7 +92,7 @@ acpi_ns_load_table(struct acpi_table_desc *table_desc,
|
|||
/* Check validity of the AML start and length */
|
||||
|
||||
if (!table_desc->aml_start) {
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Null AML pointer\n"));
|
||||
ACPI_REPORT_ERROR(("Null AML pointer\n"));
|
||||
return_ACPI_STATUS(AE_BAD_PARAMETER);
|
||||
}
|
||||
|
||||
|
|
@ -263,7 +263,7 @@ acpi_status acpi_ns_load_namespace(void)
|
|||
/* There must be at least a DSDT installed */
|
||||
|
||||
if (acpi_gbl_DSDT == NULL) {
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "DSDT is not in memory\n"));
|
||||
ACPI_REPORT_ERROR(("DSDT is not in memory\n"));
|
||||
return_ACPI_STATUS(AE_NO_ACPI_TABLES);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
******************************************************************************/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2000 - 2005, R. Byron Moore
|
||||
* Copyright (C) 2000 - 2006, R. Byron Moore
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
|
@ -75,7 +75,7 @@ acpi_ns_build_external_path(struct acpi_namespace_node *node,
|
|||
acpi_size index;
|
||||
struct acpi_namespace_node *parent_node;
|
||||
|
||||
ACPI_FUNCTION_NAME("ns_build_external_path");
|
||||
ACPI_FUNCTION_ENTRY();
|
||||
|
||||
/* Special case for root */
|
||||
|
||||
|
|
@ -110,9 +110,7 @@ acpi_ns_build_external_path(struct acpi_namespace_node *node,
|
|||
name_buffer[index] = AML_ROOT_PREFIX;
|
||||
|
||||
if (index != 0) {
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
||||
"Could not construct pathname; index=%X, size=%X, Path=%s\n",
|
||||
(u32) index, (u32) size, &name_buffer[size]));
|
||||
ACPI_REPORT_ERROR(("Could not construct pathname; index=%X, size=%X, Path=%s\n", (u32) index, (u32) size, &name_buffer[size]));
|
||||
}
|
||||
|
||||
return;
|
||||
|
|
@ -148,7 +146,7 @@ char *acpi_ns_get_external_pathname(struct acpi_namespace_node *node)
|
|||
|
||||
name_buffer = ACPI_MEM_CALLOCATE(size);
|
||||
if (!name_buffer) {
|
||||
ACPI_REPORT_ERROR(("ns_get_table_pathname: allocation failure\n"));
|
||||
ACPI_REPORT_ERROR(("Allocation failure\n"));
|
||||
return_PTR(NULL);
|
||||
}
|
||||
|
||||
|
|
@ -241,7 +239,7 @@ acpi_ns_handle_to_pathname(acpi_handle target_handle,
|
|||
|
||||
acpi_ns_build_external_path(node, required_size, buffer->pointer);
|
||||
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_EXEC, "%s [%X] \n",
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_EXEC, "%s [%X]\n",
|
||||
(char *)buffer->pointer, (u32) required_size));
|
||||
return_ACPI_STATUS(AE_OK);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
******************************************************************************/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2000 - 2005, R. Byron Moore
|
||||
* Copyright (C) 2000 - 2006, R. Byron Moore
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
|
@ -84,21 +84,21 @@ acpi_ns_attach_object(struct acpi_namespace_node *node,
|
|||
if (!node) {
|
||||
/* Invalid handle */
|
||||
|
||||
ACPI_REPORT_ERROR(("ns_attach_object: Null named_obj handle\n"));
|
||||
ACPI_REPORT_ERROR(("Null named_obj handle\n"));
|
||||
return_ACPI_STATUS(AE_BAD_PARAMETER);
|
||||
}
|
||||
|
||||
if (!object && (ACPI_TYPE_ANY != type)) {
|
||||
/* Null object */
|
||||
|
||||
ACPI_REPORT_ERROR(("ns_attach_object: Null object, but type not ACPI_TYPE_ANY\n"));
|
||||
ACPI_REPORT_ERROR(("Null object, but type not ACPI_TYPE_ANY\n"));
|
||||
return_ACPI_STATUS(AE_BAD_PARAMETER);
|
||||
}
|
||||
|
||||
if (ACPI_GET_DESCRIPTOR_TYPE(node) != ACPI_DESC_TYPE_NAMED) {
|
||||
/* Not a name handle */
|
||||
|
||||
ACPI_REPORT_ERROR(("ns_attach_object: Invalid handle %p [%s]\n",
|
||||
ACPI_REPORT_ERROR(("Invalid handle %p [%s]\n",
|
||||
node, acpi_ut_get_descriptor_name(node)));
|
||||
return_ACPI_STATUS(AE_BAD_PARAMETER);
|
||||
}
|
||||
|
|
@ -254,7 +254,7 @@ union acpi_operand_object *acpi_ns_get_attached_object(struct
|
|||
ACPI_FUNCTION_TRACE_PTR("ns_get_attached_object", node);
|
||||
|
||||
if (!node) {
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_WARN, "Null Node ptr\n"));
|
||||
ACPI_REPORT_WARNING(("Null Node ptr\n"));
|
||||
return_PTR(NULL);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
*****************************************************************************/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2000 - 2005, R. Byron Moore
|
||||
* Copyright (C) 2000 - 2006, R. Byron Moore
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
******************************************************************************/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2000 - 2005, R. Byron Moore
|
||||
* Copyright (C) 2000 - 2006, R. Byron Moore
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
|
@ -99,8 +99,8 @@ acpi_ns_search_node(u32 target_name,
|
|||
if (scope_name) {
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_NAMES,
|
||||
"Searching %s (%p) For [%4.4s] (%s)\n",
|
||||
scope_name, node,
|
||||
(char *)&target_name,
|
||||
scope_name, node, ACPI_CAST_PTR(char,
|
||||
&target_name),
|
||||
acpi_ut_get_type_name(type)));
|
||||
|
||||
ACPI_MEM_FREE(scope_name);
|
||||
|
|
@ -131,7 +131,7 @@ acpi_ns_search_node(u32 target_name,
|
|||
*/
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_NAMES,
|
||||
"Name [%4.4s] (%s) %p found in scope [%4.4s] %p\n",
|
||||
(char *)&target_name,
|
||||
ACPI_CAST_PTR(char, &target_name),
|
||||
acpi_ut_get_type_name(next_node->
|
||||
type),
|
||||
next_node,
|
||||
|
|
@ -160,7 +160,8 @@ acpi_ns_search_node(u32 target_name,
|
|||
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_NAMES,
|
||||
"Name [%4.4s] (%s) not found in search in scope [%4.4s] %p first child %p\n",
|
||||
(char *)&target_name, acpi_ut_get_type_name(type),
|
||||
ACPI_CAST_PTR(char, &target_name),
|
||||
acpi_ut_get_type_name(type),
|
||||
acpi_ut_get_node_name(node), node, node->child));
|
||||
|
||||
return_ACPI_STATUS(AE_NOT_FOUND);
|
||||
|
|
@ -210,14 +211,14 @@ acpi_ns_search_parent_tree(u32 target_name,
|
|||
*/
|
||||
if (!parent_node) {
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_NAMES, "[%4.4s] has no parent\n",
|
||||
(char *)&target_name));
|
||||
ACPI_CAST_PTR(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_CAST_PTR(char, &target_name),
|
||||
acpi_ut_get_type_name(type)));
|
||||
return_ACPI_STATUS(AE_NOT_FOUND);
|
||||
}
|
||||
|
|
@ -227,7 +228,7 @@ acpi_ns_search_parent_tree(u32 target_name,
|
|||
ACPI_DEBUG_PRINT((ACPI_DB_NAMES,
|
||||
"Searching parent [%4.4s] for [%4.4s]\n",
|
||||
acpi_ut_get_node_name(parent_node),
|
||||
(char *)&target_name));
|
||||
ACPI_CAST_PTR(char, &target_name)));
|
||||
|
||||
/*
|
||||
* Search parents until target is found or we have backed up to the root
|
||||
|
|
@ -297,18 +298,15 @@ acpi_ns_search_and_enter(u32 target_name,
|
|||
/* Parameter validation */
|
||||
|
||||
if (!node || !target_name || !return_node) {
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
||||
"Null param: Node %p Name %X return_node %p\n",
|
||||
node, target_name, return_node));
|
||||
|
||||
ACPI_REPORT_ERROR(("ns_search_and_enter: Null parameter\n"));
|
||||
ACPI_REPORT_ERROR(("Null param: Node %p Name %X return_node %p\n", node, target_name, return_node));
|
||||
return_ACPI_STATUS(AE_BAD_PARAMETER);
|
||||
}
|
||||
|
||||
/* Name must consist of printable characters */
|
||||
|
||||
if (!acpi_ut_valid_acpi_name(target_name)) {
|
||||
ACPI_REPORT_ERROR(("ns_search_and_enter: Bad character in ACPI Name: %X\n", target_name));
|
||||
ACPI_REPORT_ERROR(("Bad character in ACPI Name: %X\n",
|
||||
target_name));
|
||||
return_ACPI_STATUS(AE_BAD_CHARACTER);
|
||||
}
|
||||
|
||||
|
|
@ -360,7 +358,7 @@ acpi_ns_search_and_enter(u32 target_name,
|
|||
if (interpreter_mode == ACPI_IMODE_EXECUTE) {
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_NAMES,
|
||||
"%4.4s Not found in %p [Not adding]\n",
|
||||
(char *)&target_name, node));
|
||||
ACPI_CAST_PTR(char, &target_name), node));
|
||||
|
||||
return_ACPI_STATUS(AE_NOT_FOUND);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
*****************************************************************************/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2000 - 2005, R. Byron Moore
|
||||
* Copyright (C) 2000 - 2006, R. Byron Moore
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
|
@ -63,7 +63,6 @@ acpi_name acpi_ns_find_parent_name(struct acpi_namespace_node *node_to_search);
|
|||
*
|
||||
* PARAMETERS: module_name - Caller's module name (for error output)
|
||||
* line_number - Caller's line number (for error output)
|
||||
* component_id - Caller's component ID (for error output)
|
||||
* internal_name - Name or path of the namespace node
|
||||
* lookup_status - Exception code from NS lookup
|
||||
*
|
||||
|
|
@ -76,14 +75,12 @@ acpi_name acpi_ns_find_parent_name(struct acpi_namespace_node *node_to_search);
|
|||
void
|
||||
acpi_ns_report_error(char *module_name,
|
||||
u32 line_number,
|
||||
u32 component_id,
|
||||
char *internal_name, acpi_status lookup_status)
|
||||
{
|
||||
acpi_status status;
|
||||
char *name = NULL;
|
||||
|
||||
acpi_os_printf("%8s-%04d: *** Error: Looking up ",
|
||||
module_name, line_number);
|
||||
acpi_ut_report_error(module_name, line_number);
|
||||
|
||||
if (lookup_status == AE_BAD_CHARACTER) {
|
||||
/* There is a non-ascii character in the name */
|
||||
|
|
@ -109,7 +106,7 @@ acpi_ns_report_error(char *module_name,
|
|||
}
|
||||
}
|
||||
|
||||
acpi_os_printf(" in namespace, %s\n",
|
||||
acpi_os_printf("Namespace lookup failure, %s\n",
|
||||
acpi_format_exception(lookup_status));
|
||||
}
|
||||
|
||||
|
|
@ -119,10 +116,9 @@ acpi_ns_report_error(char *module_name,
|
|||
*
|
||||
* PARAMETERS: module_name - Caller's module name (for error output)
|
||||
* line_number - Caller's line number (for error output)
|
||||
* component_id - Caller's component ID (for error output)
|
||||
* Message - Error message to use on failure
|
||||
* prefix_node - Prefix relative to the path
|
||||
* Path - Path to the node
|
||||
* Path - Path to the node (optional)
|
||||
* method_status - Execution status
|
||||
*
|
||||
* RETURN: None
|
||||
|
|
@ -134,7 +130,6 @@ acpi_ns_report_error(char *module_name,
|
|||
void
|
||||
acpi_ns_report_method_error(char *module_name,
|
||||
u32 line_number,
|
||||
u32 component_id,
|
||||
char *message,
|
||||
struct acpi_namespace_node *prefix_node,
|
||||
char *path, acpi_status method_status)
|
||||
|
|
@ -142,17 +137,16 @@ acpi_ns_report_method_error(char *module_name,
|
|||
acpi_status status;
|
||||
struct acpi_namespace_node *node = prefix_node;
|
||||
|
||||
acpi_ut_report_error(module_name, line_number);
|
||||
|
||||
if (path) {
|
||||
status = acpi_ns_get_node_by_path(path, prefix_node,
|
||||
ACPI_NS_NO_UPSEARCH, &node);
|
||||
if (ACPI_FAILURE(status)) {
|
||||
acpi_os_printf
|
||||
("report_method_error: Could not get node\n");
|
||||
return;
|
||||
acpi_os_printf("[Could not get node by pathname]");
|
||||
}
|
||||
}
|
||||
|
||||
acpi_os_printf("%8s-%04d: *** Error: ", module_name, line_number);
|
||||
acpi_ns_print_node_pathname(node, message);
|
||||
acpi_os_printf(", %s\n", acpi_format_exception(method_status));
|
||||
}
|
||||
|
|
@ -248,11 +242,11 @@ acpi_object_type acpi_ns_get_type(struct acpi_namespace_node * node)
|
|||
ACPI_FUNCTION_TRACE("ns_get_type");
|
||||
|
||||
if (!node) {
|
||||
ACPI_REPORT_WARNING(("ns_get_type: Null Node input pointer\n"));
|
||||
return_VALUE(ACPI_TYPE_ANY);
|
||||
ACPI_REPORT_WARNING(("Null Node parameter\n"));
|
||||
return_UINT32(ACPI_TYPE_ANY);
|
||||
}
|
||||
|
||||
return_VALUE((acpi_object_type) node->type);
|
||||
return_UINT32((acpi_object_type) node->type);
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
|
|
@ -275,11 +269,11 @@ u32 acpi_ns_local(acpi_object_type type)
|
|||
if (!acpi_ut_valid_object_type(type)) {
|
||||
/* Type code out of range */
|
||||
|
||||
ACPI_REPORT_WARNING(("ns_local: Invalid Object Type\n"));
|
||||
return_VALUE(ACPI_NS_NORMAL);
|
||||
ACPI_REPORT_WARNING(("Invalid Object Type %X\n", type));
|
||||
return_UINT32(ACPI_NS_NORMAL);
|
||||
}
|
||||
|
||||
return_VALUE((u32) acpi_gbl_ns_properties[type] & ACPI_NS_LOCAL);
|
||||
return_UINT32((u32) acpi_gbl_ns_properties[type] & ACPI_NS_LOCAL);
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
|
|
@ -627,7 +621,7 @@ acpi_ns_externalize_name(u32 internal_name_length,
|
|||
* with internal_name (invalid format).
|
||||
*/
|
||||
if (required_length > internal_name_length) {
|
||||
ACPI_REPORT_ERROR(("ns_externalize_name: Invalid internal name\n"));
|
||||
ACPI_REPORT_ERROR(("Invalid internal name\n"));
|
||||
return_ACPI_STATUS(AE_BAD_PATHNAME);
|
||||
}
|
||||
|
||||
|
|
@ -803,12 +797,11 @@ u32 acpi_ns_opens_scope(acpi_object_type type)
|
|||
if (!acpi_ut_valid_object_type(type)) {
|
||||
/* type code out of range */
|
||||
|
||||
ACPI_REPORT_WARNING(("ns_opens_scope: Invalid Object Type %X\n",
|
||||
type));
|
||||
return_VALUE(ACPI_NS_NORMAL);
|
||||
ACPI_REPORT_WARNING(("Invalid Object Type %X\n", type));
|
||||
return_UINT32(ACPI_NS_NORMAL);
|
||||
}
|
||||
|
||||
return_VALUE(((u32) acpi_gbl_ns_properties[type]) & ACPI_NS_NEWSCOPE);
|
||||
return_UINT32(((u32) acpi_gbl_ns_properties[type]) & ACPI_NS_NEWSCOPE);
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
*****************************************************************************/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2000 - 2005, R. Byron Moore
|
||||
* Copyright (C) 2000 - 2006, R. Byron Moore
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
******************************************************************************/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2000 - 2005, R. Byron Moore
|
||||
* Copyright (C) 2000 - 2006, R. Byron Moore
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
|
@ -112,8 +112,7 @@ acpi_evaluate_object_typed(acpi_handle handle,
|
|||
if (return_buffer->length == 0) {
|
||||
/* Error because caller specifically asked for a return value */
|
||||
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "No return value\n"));
|
||||
|
||||
ACPI_REPORT_ERROR(("No return value\n"));
|
||||
return_ACPI_STATUS(AE_NULL_OBJECT);
|
||||
}
|
||||
|
||||
|
|
@ -125,11 +124,11 @@ acpi_evaluate_object_typed(acpi_handle handle,
|
|||
|
||||
/* Return object type does not match requested type */
|
||||
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
||||
"Incorrect return type [%s] requested [%s]\n",
|
||||
acpi_ut_get_type_name(((union acpi_object *)
|
||||
return_buffer->pointer)->type),
|
||||
acpi_ut_get_type_name(return_type)));
|
||||
ACPI_REPORT_ERROR(("Incorrect return type [%s] requested [%s]\n",
|
||||
acpi_ut_get_type_name(((union acpi_object *)
|
||||
return_buffer->pointer)->
|
||||
type),
|
||||
acpi_ut_get_type_name(return_type)));
|
||||
|
||||
if (must_free) {
|
||||
/* Caller used ACPI_ALLOCATE_BUFFER, free the return buffer */
|
||||
|
|
@ -236,11 +235,9 @@ acpi_evaluate_object(acpi_handle handle,
|
|||
* qualified names above, this is an error
|
||||
*/
|
||||
if (!pathname) {
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
||||
"Both Handle and Pathname are NULL\n"));
|
||||
ACPI_REPORT_ERROR(("Both Handle and Pathname are NULL\n"));
|
||||
} else {
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
||||
"Handle is NULL and Pathname is relative\n"));
|
||||
ACPI_REPORT_ERROR(("Handle is NULL and Pathname is relative\n"));
|
||||
}
|
||||
|
||||
status = AE_BAD_PARAMETER;
|
||||
|
|
@ -399,7 +396,7 @@ acpi_walk_namespace(acpi_object_type type,
|
|||
|
||||
/* Parameter validation */
|
||||
|
||||
if ((type > ACPI_TYPE_EXTERNAL_MAX) || (!max_depth) || (!user_function)) {
|
||||
if ((type > ACPI_TYPE_LOCAL_MAX) || (!max_depth) || (!user_function)) {
|
||||
return_ACPI_STATUS(AE_BAD_PARAMETER);
|
||||
}
|
||||
|
||||
|
|
@ -473,8 +470,8 @@ acpi_ns_get_device_callback(acpi_handle obj_handle,
|
|||
return (AE_CTRL_DEPTH);
|
||||
}
|
||||
|
||||
if (!(flags & 0x01)) {
|
||||
/* Don't return at the device or children of the device if not there */
|
||||
if (!(flags & ACPI_STA_DEVICE_PRESENT)) {
|
||||
/* Don't examine children of the device if not present */
|
||||
|
||||
return (AE_CTRL_DEPTH);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
*****************************************************************************/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2000 - 2005, R. Byron Moore
|
||||
* Copyright (C) 2000 - 2006, R. Byron Moore
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
******************************************************************************/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2000 - 2005, R. Byron Moore
|
||||
* Copyright (C) 2000 - 2006, R. Byron Moore
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
|
|
|||
|
|
@ -838,7 +838,7 @@ acpi_status acpi_os_wait_semaphore(acpi_handle handle, u32 units, u16 timeout)
|
|||
static const int quantum_ms = 1000 / HZ;
|
||||
|
||||
ret = down_trylock(sem);
|
||||
for (i = timeout; (i > 0 && ret < 0); i -= quantum_ms) {
|
||||
for (i = timeout; (i > 0 && ret != 0); i -= quantum_ms) {
|
||||
schedule_timeout_interruptible(1);
|
||||
ret = down_trylock(sem);
|
||||
}
|
||||
|
|
@ -1060,11 +1060,9 @@ EXPORT_SYMBOL(max_cstate);
|
|||
* Acquire a spinlock.
|
||||
*
|
||||
* handle is a pointer to the spinlock_t.
|
||||
* flags is *not* the result of save_flags - it is an ACPI-specific flag variable
|
||||
* that indicates whether we are at interrupt level.
|
||||
*/
|
||||
|
||||
unsigned long acpi_os_acquire_lock(acpi_handle handle)
|
||||
acpi_native_uint acpi_os_acquire_lock(acpi_handle handle)
|
||||
{
|
||||
unsigned long flags;
|
||||
spin_lock_irqsave((spinlock_t *) handle, flags);
|
||||
|
|
@ -1075,9 +1073,9 @@ unsigned long acpi_os_acquire_lock(acpi_handle handle)
|
|||
* Release a spinlock. See above.
|
||||
*/
|
||||
|
||||
void acpi_os_release_lock(acpi_handle handle, unsigned long flags)
|
||||
void acpi_os_release_lock(acpi_handle handle, acpi_native_uint flags)
|
||||
{
|
||||
spin_unlock_irqrestore((spinlock_t *) handle, flags);
|
||||
spin_unlock_irqrestore((spinlock_t *) handle, (unsigned long) flags);
|
||||
}
|
||||
|
||||
#ifndef ACPI_USE_LOCAL_CACHE
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
*****************************************************************************/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2000 - 2005, R. Byron Moore
|
||||
* Copyright (C) 2000 - 2006, R. Byron Moore
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
|
@ -45,6 +45,7 @@
|
|||
#include <acpi/acparser.h>
|
||||
#include <acpi/amlcode.h>
|
||||
#include <acpi/acnamesp.h>
|
||||
#include <acpi/acdispat.h>
|
||||
|
||||
#define _COMPONENT ACPI_PARSER
|
||||
ACPI_MODULE_NAME("psargs")
|
||||
|
|
@ -62,61 +63,51 @@ static union acpi_parse_object *acpi_ps_get_next_field(struct acpi_parse_state
|
|||
*
|
||||
* PARAMETERS: parser_state - Current parser state object
|
||||
*
|
||||
* RETURN: Decoded package length. On completion, the AML pointer points
|
||||
* RETURN: Decoded package length. On completion, the AML pointer points
|
||||
* past the length byte or bytes.
|
||||
*
|
||||
* DESCRIPTION: Decode and return a package length field
|
||||
* DESCRIPTION: Decode and return a package length field.
|
||||
* Note: Largest package length is 28 bits, from ACPI specification
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
static u32
|
||||
acpi_ps_get_next_package_length(struct acpi_parse_state *parser_state)
|
||||
{
|
||||
u32 encoded_length;
|
||||
u32 length = 0;
|
||||
u8 *aml = parser_state->aml;
|
||||
u32 package_length = 0;
|
||||
acpi_native_uint byte_count;
|
||||
u8 byte_zero_mask = 0x3F; /* Default [0:5] */
|
||||
|
||||
ACPI_FUNCTION_TRACE("ps_get_next_package_length");
|
||||
|
||||
encoded_length = (u32) ACPI_GET8(parser_state->aml);
|
||||
parser_state->aml++;
|
||||
/*
|
||||
* Byte 0 bits [6:7] contain the number of additional bytes
|
||||
* used to encode the package length, either 0,1,2, or 3
|
||||
*/
|
||||
byte_count = (aml[0] >> 6);
|
||||
parser_state->aml += (byte_count + 1);
|
||||
|
||||
switch (encoded_length >> 6) { /* bits 6-7 contain encoding scheme */
|
||||
case 0: /* 1-byte encoding (bits 0-5) */
|
||||
/* Get bytes 3, 2, 1 as needed */
|
||||
|
||||
length = (encoded_length & 0x3F);
|
||||
break;
|
||||
while (byte_count) {
|
||||
/*
|
||||
* Final bit positions for the package length bytes:
|
||||
* Byte3->[20:27]
|
||||
* Byte2->[12:19]
|
||||
* Byte1->[04:11]
|
||||
* Byte0->[00:03]
|
||||
*/
|
||||
package_length |= (aml[byte_count] << ((byte_count << 3) - 4));
|
||||
|
||||
case 1: /* 2-byte encoding (next byte + bits 0-3) */
|
||||
|
||||
length = ((ACPI_GET8(parser_state->aml) << 04) |
|
||||
(encoded_length & 0x0F));
|
||||
parser_state->aml++;
|
||||
break;
|
||||
|
||||
case 2: /* 3-byte encoding (next 2 bytes + bits 0-3) */
|
||||
|
||||
length = ((ACPI_GET8(parser_state->aml + 1) << 12) |
|
||||
(ACPI_GET8(parser_state->aml) << 04) |
|
||||
(encoded_length & 0x0F));
|
||||
parser_state->aml += 2;
|
||||
break;
|
||||
|
||||
case 3: /* 4-byte encoding (next 3 bytes + bits 0-3) */
|
||||
|
||||
length = ((ACPI_GET8(parser_state->aml + 2) << 20) |
|
||||
(ACPI_GET8(parser_state->aml + 1) << 12) |
|
||||
(ACPI_GET8(parser_state->aml) << 04) |
|
||||
(encoded_length & 0x0F));
|
||||
parser_state->aml += 3;
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
/* Can't get here, only 2 bits / 4 cases */
|
||||
break;
|
||||
byte_zero_mask = 0x0F; /* Use bits [0:3] of byte 0 */
|
||||
byte_count--;
|
||||
}
|
||||
|
||||
return_VALUE(length);
|
||||
/* Byte 0 is a special case, either bits [0:3] or [0:5] are used */
|
||||
|
||||
package_length |= (aml[0] & byte_zero_mask);
|
||||
return_UINT32(package_length);
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
|
|
@ -135,16 +126,15 @@ acpi_ps_get_next_package_length(struct acpi_parse_state *parser_state)
|
|||
u8 *acpi_ps_get_next_package_end(struct acpi_parse_state *parser_state)
|
||||
{
|
||||
u8 *start = parser_state->aml;
|
||||
acpi_native_uint length;
|
||||
u32 package_length;
|
||||
|
||||
ACPI_FUNCTION_TRACE("ps_get_next_package_end");
|
||||
|
||||
/* Function below changes parser_state->Aml */
|
||||
/* Function below updates parser_state->Aml */
|
||||
|
||||
length =
|
||||
(acpi_native_uint) acpi_ps_get_next_package_length(parser_state);
|
||||
package_length = acpi_ps_get_next_package_length(parser_state);
|
||||
|
||||
return_PTR(start + length); /* end of package */
|
||||
return_PTR(start + package_length); /* end of package */
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
|
|
@ -169,17 +159,15 @@ char *acpi_ps_get_next_namestring(struct acpi_parse_state *parser_state)
|
|||
|
||||
ACPI_FUNCTION_TRACE("ps_get_next_namestring");
|
||||
|
||||
/* Handle multiple prefix characters */
|
||||
|
||||
while (acpi_ps_is_prefix_char(ACPI_GET8(end))) {
|
||||
/* Include prefix '\\' or '^' */
|
||||
/* Point past any namestring prefix characters (backslash or carat) */
|
||||
|
||||
while (acpi_ps_is_prefix_char(*end)) {
|
||||
end++;
|
||||
}
|
||||
|
||||
/* Decode the path */
|
||||
/* Decode the path prefix character */
|
||||
|
||||
switch (ACPI_GET8(end)) {
|
||||
switch (*end) {
|
||||
case 0:
|
||||
|
||||
/* null_name */
|
||||
|
|
@ -199,9 +187,9 @@ char *acpi_ps_get_next_namestring(struct acpi_parse_state *parser_state)
|
|||
|
||||
case AML_MULTI_NAME_PREFIX_OP:
|
||||
|
||||
/* Multiple name segments, 4 chars each */
|
||||
/* Multiple name segments, 4 chars each, count in next byte */
|
||||
|
||||
end += 2 + ((acpi_size) ACPI_GET8(end + 1) * ACPI_NAME_SIZE);
|
||||
end += 2 + (*(end + 1) * ACPI_NAME_SIZE);
|
||||
break;
|
||||
|
||||
default:
|
||||
|
|
@ -212,7 +200,7 @@ char *acpi_ps_get_next_namestring(struct acpi_parse_state *parser_state)
|
|||
break;
|
||||
}
|
||||
|
||||
parser_state->aml = (u8 *) end;
|
||||
parser_state->aml = end;
|
||||
return_PTR((char *)start);
|
||||
}
|
||||
|
||||
|
|
@ -224,7 +212,7 @@ char *acpi_ps_get_next_namestring(struct acpi_parse_state *parser_state)
|
|||
* Arg - Where the namepath will be stored
|
||||
* arg_count - If the namepath points to a control method
|
||||
* the method's argument is returned here.
|
||||
* method_call - Whether the namepath can possibly be the
|
||||
* possible_method_call - Whether the namepath can possibly be the
|
||||
* start of a method call
|
||||
*
|
||||
* RETURN: Status
|
||||
|
|
@ -240,11 +228,11 @@ char *acpi_ps_get_next_namestring(struct acpi_parse_state *parser_state)
|
|||
acpi_status
|
||||
acpi_ps_get_next_namepath(struct acpi_walk_state *walk_state,
|
||||
struct acpi_parse_state *parser_state,
|
||||
union acpi_parse_object *arg, u8 method_call)
|
||||
union acpi_parse_object *arg, u8 possible_method_call)
|
||||
{
|
||||
char *path;
|
||||
union acpi_parse_object *name_op;
|
||||
acpi_status status = AE_OK;
|
||||
acpi_status status;
|
||||
union acpi_operand_object *method_desc;
|
||||
struct acpi_namespace_node *node;
|
||||
union acpi_generic_state scope_info;
|
||||
|
|
@ -252,115 +240,127 @@ acpi_ps_get_next_namepath(struct acpi_walk_state *walk_state,
|
|||
ACPI_FUNCTION_TRACE("ps_get_next_namepath");
|
||||
|
||||
path = acpi_ps_get_next_namestring(parser_state);
|
||||
acpi_ps_init_op(arg, AML_INT_NAMEPATH_OP);
|
||||
|
||||
/* Null path case is allowed */
|
||||
/* Null path case is allowed, just exit */
|
||||
|
||||
if (path) {
|
||||
/*
|
||||
* Lookup the name in the internal namespace
|
||||
*/
|
||||
scope_info.scope.node = NULL;
|
||||
node = parser_state->start_node;
|
||||
if (node) {
|
||||
scope_info.scope.node = node;
|
||||
}
|
||||
if (!path) {
|
||||
arg->common.value.name = path;
|
||||
return_ACPI_STATUS(AE_OK);
|
||||
}
|
||||
|
||||
/*
|
||||
* Lookup object. We don't want to add anything new to the namespace
|
||||
* here, however. So we use MODE_EXECUTE. Allow searching of the
|
||||
* parent tree, but don't open a new scope -- we just want to lookup the
|
||||
* object (MUST BE mode EXECUTE to perform upsearch)
|
||||
*/
|
||||
status = acpi_ns_lookup(&scope_info, path, ACPI_TYPE_ANY,
|
||||
ACPI_IMODE_EXECUTE,
|
||||
ACPI_NS_SEARCH_PARENT |
|
||||
ACPI_NS_DONT_OPEN_SCOPE, NULL, &node);
|
||||
if (ACPI_SUCCESS(status) && method_call) {
|
||||
if (node->type == ACPI_TYPE_METHOD) {
|
||||
/* This name is actually a control method invocation */
|
||||
/* Setup search scope info */
|
||||
|
||||
method_desc = acpi_ns_get_attached_object(node);
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_PARSE,
|
||||
"Control Method - %p Desc %p Path=%p\n",
|
||||
node, method_desc, path));
|
||||
|
||||
name_op = acpi_ps_alloc_op(AML_INT_NAMEPATH_OP);
|
||||
if (!name_op) {
|
||||
return_ACPI_STATUS(AE_NO_MEMORY);
|
||||
}
|
||||
|
||||
/* Change arg into a METHOD CALL and attach name to it */
|
||||
|
||||
acpi_ps_init_op(arg, AML_INT_METHODCALL_OP);
|
||||
name_op->common.value.name = path;
|
||||
|
||||
/* Point METHODCALL/NAME to the METHOD Node */
|
||||
|
||||
name_op->common.node = node;
|
||||
acpi_ps_append_arg(arg, name_op);
|
||||
|
||||
if (!method_desc) {
|
||||
ACPI_REPORT_ERROR(("ps_get_next_namepath: Control Method %p has no attached object\n", node));
|
||||
return_ACPI_STATUS(AE_AML_INTERNAL);
|
||||
}
|
||||
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_PARSE,
|
||||
"Control Method - %p Args %X\n",
|
||||
node,
|
||||
method_desc->method.
|
||||
param_count));
|
||||
|
||||
/* Get the number of arguments to expect */
|
||||
|
||||
walk_state->arg_count =
|
||||
method_desc->method.param_count;
|
||||
return_ACPI_STATUS(AE_OK);
|
||||
}
|
||||
|
||||
/*
|
||||
* Else this is normal named object reference.
|
||||
* Just init the NAMEPATH object with the pathname.
|
||||
* (See code below)
|
||||
*/
|
||||
}
|
||||
|
||||
if (ACPI_FAILURE(status)) {
|
||||
/*
|
||||
* 1) Any error other than NOT_FOUND is always severe
|
||||
* 2) NOT_FOUND is only important if we are executing a method.
|
||||
* 3) If executing a cond_ref_of opcode, NOT_FOUND is ok.
|
||||
*/
|
||||
if ((((walk_state->
|
||||
parse_flags & ACPI_PARSE_MODE_MASK) ==
|
||||
ACPI_PARSE_EXECUTE) && (status == AE_NOT_FOUND)
|
||||
&& (walk_state->op->common.aml_opcode !=
|
||||
AML_COND_REF_OF_OP))
|
||||
|| (status != AE_NOT_FOUND)) {
|
||||
ACPI_REPORT_NSERROR(path, status);
|
||||
|
||||
acpi_os_printf
|
||||
("search_node %p start_node %p return_node %p\n",
|
||||
scope_info.scope.node,
|
||||
parser_state->start_node, node);
|
||||
|
||||
} else {
|
||||
/*
|
||||
* We got a NOT_FOUND during table load or we encountered
|
||||
* a cond_ref_of(x) where the target does not exist.
|
||||
* Either case is ok
|
||||
*/
|
||||
status = AE_OK;
|
||||
}
|
||||
}
|
||||
scope_info.scope.node = NULL;
|
||||
node = parser_state->start_node;
|
||||
if (node) {
|
||||
scope_info.scope.node = node;
|
||||
}
|
||||
|
||||
/*
|
||||
* Regardless of success/failure above,
|
||||
* Just initialize the Op with the pathname.
|
||||
* Lookup the name in the internal namespace. We don't want to add
|
||||
* anything new to the namespace here, however, so we use MODE_EXECUTE.
|
||||
* Allow searching of the parent tree, but don't open a new scope -
|
||||
* we just want to lookup the object (must be mode EXECUTE to perform
|
||||
* the upsearch)
|
||||
*/
|
||||
acpi_ps_init_op(arg, AML_INT_NAMEPATH_OP);
|
||||
arg->common.value.name = path;
|
||||
status =
|
||||
acpi_ns_lookup(&scope_info, path, ACPI_TYPE_ANY, ACPI_IMODE_EXECUTE,
|
||||
ACPI_NS_SEARCH_PARENT | ACPI_NS_DONT_OPEN_SCOPE,
|
||||
NULL, &node);
|
||||
|
||||
/*
|
||||
* If this name is a control method invocation, we must
|
||||
* setup the method call
|
||||
*/
|
||||
if (ACPI_SUCCESS(status) &&
|
||||
possible_method_call && (node->type == ACPI_TYPE_METHOD)) {
|
||||
/* This name is actually a control method invocation */
|
||||
|
||||
method_desc = acpi_ns_get_attached_object(node);
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_PARSE,
|
||||
"Control Method - %p Desc %p Path=%p\n", node,
|
||||
method_desc, path));
|
||||
|
||||
name_op = acpi_ps_alloc_op(AML_INT_NAMEPATH_OP);
|
||||
if (!name_op) {
|
||||
return_ACPI_STATUS(AE_NO_MEMORY);
|
||||
}
|
||||
|
||||
/* Change Arg into a METHOD CALL and attach name to it */
|
||||
|
||||
acpi_ps_init_op(arg, AML_INT_METHODCALL_OP);
|
||||
name_op->common.value.name = path;
|
||||
|
||||
/* Point METHODCALL/NAME to the METHOD Node */
|
||||
|
||||
name_op->common.node = node;
|
||||
acpi_ps_append_arg(arg, name_op);
|
||||
|
||||
if (!method_desc) {
|
||||
ACPI_REPORT_ERROR(("Control Method %p has no attached object\n", node));
|
||||
return_ACPI_STATUS(AE_AML_INTERNAL);
|
||||
}
|
||||
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_PARSE,
|
||||
"Control Method - %p Args %X\n",
|
||||
node, method_desc->method.param_count));
|
||||
|
||||
/* Get the number of arguments to expect */
|
||||
|
||||
walk_state->arg_count = method_desc->method.param_count;
|
||||
return_ACPI_STATUS(AE_OK);
|
||||
}
|
||||
|
||||
/*
|
||||
* Special handling if the name was not found during the lookup -
|
||||
* some not_found cases are allowed
|
||||
*/
|
||||
if (status == AE_NOT_FOUND) {
|
||||
/* 1) not_found is ok during load pass 1/2 (allow forward references) */
|
||||
|
||||
if ((walk_state->parse_flags & ACPI_PARSE_MODE_MASK) !=
|
||||
ACPI_PARSE_EXECUTE) {
|
||||
status = AE_OK;
|
||||
}
|
||||
|
||||
/* 2) not_found during a cond_ref_of(x) is ok by definition */
|
||||
|
||||
else if (walk_state->op->common.aml_opcode ==
|
||||
AML_COND_REF_OF_OP) {
|
||||
status = AE_OK;
|
||||
}
|
||||
|
||||
/*
|
||||
* 3) not_found while building a Package is ok at this point, we
|
||||
* may flag as an error later if slack mode is not enabled.
|
||||
* (Some ASL code depends on allowing this behavior)
|
||||
*/
|
||||
else if ((arg->common.parent) &&
|
||||
((arg->common.parent->common.aml_opcode ==
|
||||
AML_PACKAGE_OP)
|
||||
|| (arg->common.parent->common.aml_opcode ==
|
||||
AML_VAR_PACKAGE_OP))) {
|
||||
status = AE_OK;
|
||||
}
|
||||
}
|
||||
|
||||
/* Final exception check (may have been changed from code above) */
|
||||
|
||||
if (ACPI_FAILURE(status)) {
|
||||
ACPI_REPORT_NSERROR(path, status);
|
||||
|
||||
if ((walk_state->parse_flags & ACPI_PARSE_MODE_MASK) ==
|
||||
ACPI_PARSE_EXECUTE) {
|
||||
/* Report a control method execution error */
|
||||
|
||||
status = acpi_ds_method_error(status, walk_state);
|
||||
}
|
||||
}
|
||||
|
||||
/* Save the namepath */
|
||||
|
||||
arg->common.value.name = path;
|
||||
return_ACPI_STATUS(status);
|
||||
}
|
||||
|
||||
|
|
@ -382,59 +382,63 @@ void
|
|||
acpi_ps_get_next_simple_arg(struct acpi_parse_state *parser_state,
|
||||
u32 arg_type, union acpi_parse_object *arg)
|
||||
{
|
||||
u32 length;
|
||||
u16 opcode;
|
||||
u8 *aml = parser_state->aml;
|
||||
|
||||
ACPI_FUNCTION_TRACE_U32("ps_get_next_simple_arg", arg_type);
|
||||
|
||||
switch (arg_type) {
|
||||
case ARGP_BYTEDATA:
|
||||
|
||||
acpi_ps_init_op(arg, AML_BYTE_OP);
|
||||
arg->common.value.integer = (u32) ACPI_GET8(parser_state->aml);
|
||||
parser_state->aml++;
|
||||
/* Get 1 byte from the AML stream */
|
||||
|
||||
opcode = AML_BYTE_OP;
|
||||
arg->common.value.integer = (acpi_integer) * aml;
|
||||
length = 1;
|
||||
break;
|
||||
|
||||
case ARGP_WORDDATA:
|
||||
|
||||
acpi_ps_init_op(arg, AML_WORD_OP);
|
||||
|
||||
/* Get 2 bytes from the AML stream */
|
||||
|
||||
ACPI_MOVE_16_TO_32(&arg->common.value.integer,
|
||||
parser_state->aml);
|
||||
parser_state->aml += 2;
|
||||
opcode = AML_WORD_OP;
|
||||
ACPI_MOVE_16_TO_64(&arg->common.value.integer, aml);
|
||||
length = 2;
|
||||
break;
|
||||
|
||||
case ARGP_DWORDDATA:
|
||||
|
||||
acpi_ps_init_op(arg, AML_DWORD_OP);
|
||||
|
||||
/* Get 4 bytes from the AML stream */
|
||||
|
||||
ACPI_MOVE_32_TO_32(&arg->common.value.integer,
|
||||
parser_state->aml);
|
||||
parser_state->aml += 4;
|
||||
opcode = AML_DWORD_OP;
|
||||
ACPI_MOVE_32_TO_64(&arg->common.value.integer, aml);
|
||||
length = 4;
|
||||
break;
|
||||
|
||||
case ARGP_QWORDDATA:
|
||||
|
||||
acpi_ps_init_op(arg, AML_QWORD_OP);
|
||||
|
||||
/* Get 8 bytes from the AML stream */
|
||||
|
||||
ACPI_MOVE_64_TO_64(&arg->common.value.integer,
|
||||
parser_state->aml);
|
||||
parser_state->aml += 8;
|
||||
opcode = AML_QWORD_OP;
|
||||
ACPI_MOVE_64_TO_64(&arg->common.value.integer, aml);
|
||||
length = 8;
|
||||
break;
|
||||
|
||||
case ARGP_CHARLIST:
|
||||
|
||||
acpi_ps_init_op(arg, AML_STRING_OP);
|
||||
arg->common.value.string = (char *)parser_state->aml;
|
||||
/* Get a pointer to the string, point past the string */
|
||||
|
||||
while (ACPI_GET8(parser_state->aml) != '\0') {
|
||||
parser_state->aml++;
|
||||
opcode = AML_STRING_OP;
|
||||
arg->common.value.string = ACPI_CAST_PTR(char, aml);
|
||||
|
||||
/* Find the null terminator */
|
||||
|
||||
length = 0;
|
||||
while (aml[length]) {
|
||||
length++;
|
||||
}
|
||||
parser_state->aml++;
|
||||
length++;
|
||||
break;
|
||||
|
||||
case ARGP_NAME:
|
||||
|
|
@ -443,14 +447,16 @@ acpi_ps_get_next_simple_arg(struct acpi_parse_state *parser_state,
|
|||
acpi_ps_init_op(arg, AML_INT_NAMEPATH_OP);
|
||||
arg->common.value.name =
|
||||
acpi_ps_get_next_namestring(parser_state);
|
||||
break;
|
||||
return_VOID;
|
||||
|
||||
default:
|
||||
|
||||
ACPI_REPORT_ERROR(("Invalid arg_type %X\n", arg_type));
|
||||
break;
|
||||
return_VOID;
|
||||
}
|
||||
|
||||
acpi_ps_init_op(arg, opcode);
|
||||
parser_state->aml += length;
|
||||
return_VOID;
|
||||
}
|
||||
|
||||
|
|
@ -540,7 +546,7 @@ static union acpi_parse_object *acpi_ps_get_next_field(struct acpi_parse_state
|
|||
* access_type is first operand, access_attribute is second
|
||||
*/
|
||||
field->common.value.integer =
|
||||
(ACPI_GET8(parser_state->aml) << 8);
|
||||
(((u32) ACPI_GET8(parser_state->aml) << 8));
|
||||
parser_state->aml++;
|
||||
field->common.value.integer |= ACPI_GET8(parser_state->aml);
|
||||
parser_state->aml++;
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
*****************************************************************************/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2000 - 2005, R. Byron Moore
|
||||
* Copyright (C) 2000 - 2006, R. Byron Moore
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
|
@ -123,16 +123,10 @@ acpi_status acpi_ps_parse_loop(struct acpi_walk_state *walk_state)
|
|||
&& ((status & AE_CODE_MASK) !=
|
||||
AE_CODE_CONTROL)) {
|
||||
if (status == AE_AML_NO_RETURN_VALUE) {
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
||||
"Invoked method did not return a value, %s\n",
|
||||
acpi_format_exception
|
||||
(status)));
|
||||
ACPI_REPORT_ERROR(("Invoked method did not return a value, %s\n", acpi_format_exception(status)));
|
||||
|
||||
}
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
||||
"get_predicate Failed, %s\n",
|
||||
acpi_format_exception
|
||||
(status)));
|
||||
ACPI_REPORT_ERROR(("get_predicate Failed, %s\n", acpi_format_exception(status)));
|
||||
return_ACPI_STATUS(status);
|
||||
}
|
||||
|
||||
|
|
@ -190,11 +184,7 @@ acpi_status acpi_ps_parse_loop(struct acpi_walk_state *walk_state)
|
|||
|
||||
/* The opcode is unrecognized. Just skip unknown opcodes */
|
||||
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
||||
"Found unknown opcode %X at AML address %p offset %X, ignoring\n",
|
||||
walk_state->opcode,
|
||||
parser_state->aml,
|
||||
walk_state->aml_offset));
|
||||
ACPI_REPORT_ERROR(("Found unknown opcode %X at AML address %p offset %X, ignoring\n", walk_state->opcode, parser_state->aml, walk_state->aml_offset));
|
||||
|
||||
ACPI_DUMP_BUFFER(parser_state->aml, 128);
|
||||
|
||||
|
|
@ -281,10 +271,7 @@ acpi_status acpi_ps_parse_loop(struct acpi_walk_state *walk_state)
|
|||
walk_state->descending_callback(walk_state,
|
||||
&op);
|
||||
if (ACPI_FAILURE(status)) {
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
||||
"During name lookup/catalog, %s\n",
|
||||
acpi_format_exception
|
||||
(status)));
|
||||
ACPI_REPORT_ERROR(("During name lookup/catalog, %s\n", acpi_format_exception(status)));
|
||||
goto close_this_op;
|
||||
}
|
||||
|
||||
|
|
@ -704,6 +691,15 @@ acpi_status acpi_ps_parse_loop(struct acpi_walk_state *walk_state)
|
|||
acpi_ps_pop_scope(parser_state, &op,
|
||||
&walk_state->arg_types,
|
||||
&walk_state->arg_count);
|
||||
|
||||
if (op->common.aml_opcode != AML_WHILE_OP) {
|
||||
status2 =
|
||||
acpi_ds_result_stack_pop
|
||||
(walk_state);
|
||||
if (ACPI_FAILURE(status2)) {
|
||||
return_ACPI_STATUS(status2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Close this iteration of the While loop */
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
*****************************************************************************/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2000 - 2005, R. Byron Moore
|
||||
* Copyright (C) 2000 - 2006, R. Byron Moore
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
|
@ -747,7 +747,7 @@ const struct acpi_opcode_info *acpi_ps_get_opcode_info(u16 opcode)
|
|||
|
||||
/* Unknown AML opcode */
|
||||
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
|
||||
"Unknown AML opcode [%4.4X]\n", opcode));
|
||||
|
||||
return (&acpi_gbl_aml_op_info[_UNK]);
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
*****************************************************************************/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2000 - 2005, R. Byron Moore
|
||||
* Copyright (C) 2000 - 2006, R. Byron Moore
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
|
@ -333,7 +333,6 @@ acpi_ps_next_parse_state(struct acpi_walk_state *walk_state,
|
|||
|
||||
switch (callback_status) {
|
||||
case AE_CTRL_TERMINATE:
|
||||
|
||||
/*
|
||||
* A control method was terminated via a RETURN statement.
|
||||
* The walk of this method is complete.
|
||||
|
|
@ -346,13 +345,19 @@ acpi_ps_next_parse_state(struct acpi_walk_state *walk_state,
|
|||
|
||||
parser_state->aml = walk_state->aml_last_while;
|
||||
walk_state->control_state->common.value = FALSE;
|
||||
status = AE_CTRL_BREAK;
|
||||
status = acpi_ds_result_stack_pop(walk_state);
|
||||
if (ACPI_SUCCESS(status)) {
|
||||
status = AE_CTRL_BREAK;
|
||||
}
|
||||
break;
|
||||
|
||||
case AE_CTRL_CONTINUE:
|
||||
|
||||
parser_state->aml = walk_state->aml_last_while;
|
||||
status = AE_CTRL_CONTINUE;
|
||||
status = acpi_ds_result_stack_pop(walk_state);
|
||||
if (ACPI_SUCCESS(status)) {
|
||||
status = AE_CTRL_CONTINUE;
|
||||
}
|
||||
break;
|
||||
|
||||
case AE_CTRL_PENDING:
|
||||
|
|
@ -369,16 +374,18 @@ acpi_ps_next_parse_state(struct acpi_walk_state *walk_state,
|
|||
#endif
|
||||
|
||||
case AE_CTRL_TRUE:
|
||||
|
||||
/*
|
||||
* Predicate of an IF was true, and we are at the matching ELSE.
|
||||
* Just close out this package
|
||||
*/
|
||||
parser_state->aml = acpi_ps_get_next_package_end(parser_state);
|
||||
status = acpi_ds_result_stack_pop(walk_state);
|
||||
if (ACPI_SUCCESS(status)) {
|
||||
status = AE_CTRL_PENDING;
|
||||
}
|
||||
break;
|
||||
|
||||
case AE_CTRL_FALSE:
|
||||
|
||||
/*
|
||||
* Either an IF/WHILE Predicate was false or we encountered a BREAK
|
||||
* opcode. In both cases, we do not execute the rest of the
|
||||
|
|
@ -503,22 +510,23 @@ acpi_status acpi_ps_parse_aml(struct acpi_walk_state *walk_state)
|
|||
} else if (status == AE_CTRL_TERMINATE) {
|
||||
status = AE_OK;
|
||||
} else if ((status != AE_OK) && (walk_state->method_desc)) {
|
||||
ACPI_REPORT_METHOD_ERROR("Method execution failed",
|
||||
walk_state->method_node, NULL,
|
||||
status);
|
||||
/* Either the method parse or actual execution failed */
|
||||
|
||||
/* Ensure proper cleanup */
|
||||
|
||||
walk_state->parse_flags |= ACPI_PARSE_EXECUTE;
|
||||
ACPI_REPORT_MTERROR("Method parse/execution failed",
|
||||
walk_state->method_node, NULL,
|
||||
status);
|
||||
|
||||
/* Check for possible multi-thread reentrancy problem */
|
||||
|
||||
if ((status == AE_ALREADY_EXISTS) &&
|
||||
(!walk_state->method_desc->method.semaphore)) {
|
||||
/*
|
||||
* This method is marked not_serialized, but it tried to create
|
||||
* Method tried to create an object twice. The probable cause is
|
||||
* that the method cannot handle reentrancy.
|
||||
*
|
||||
* The method is marked not_serialized, but it tried to create
|
||||
* a named object, causing the second thread entrance to fail.
|
||||
* We will workaround this by marking the method permanently
|
||||
* Workaround this problem by marking the method permanently
|
||||
* as Serialized.
|
||||
*/
|
||||
walk_state->method_desc->method.method_flags |=
|
||||
|
|
@ -536,15 +544,22 @@ acpi_status acpi_ps_parse_aml(struct acpi_walk_state *walk_state)
|
|||
acpi_ds_scope_stack_clear(walk_state);
|
||||
|
||||
/*
|
||||
* If we just returned from the execution of a control method,
|
||||
* there's lots of cleanup to do
|
||||
* If we just returned from the execution of a control method or if we
|
||||
* encountered an error during the method parse phase, there's lots of
|
||||
* cleanup to do
|
||||
*/
|
||||
if ((walk_state->parse_flags & ACPI_PARSE_MODE_MASK) ==
|
||||
ACPI_PARSE_EXECUTE) {
|
||||
if (((walk_state->parse_flags & ACPI_PARSE_MODE_MASK) ==
|
||||
ACPI_PARSE_EXECUTE) || (ACPI_FAILURE(status))) {
|
||||
if (walk_state->method_desc) {
|
||||
/* Decrement the thread count on the method parse tree */
|
||||
|
||||
walk_state->method_desc->method.thread_count--;
|
||||
if (walk_state->method_desc->method.
|
||||
thread_count) {
|
||||
walk_state->method_desc->method.
|
||||
thread_count--;
|
||||
} else {
|
||||
ACPI_REPORT_ERROR(("Invalid zero thread count in method\n"));
|
||||
}
|
||||
}
|
||||
|
||||
acpi_ds_terminate_control_method(walk_state);
|
||||
|
|
@ -553,7 +568,6 @@ acpi_status acpi_ps_parse_aml(struct acpi_walk_state *walk_state)
|
|||
/* Delete this walk state and all linked control states */
|
||||
|
||||
acpi_ps_cleanup_scope(&walk_state->parser_state);
|
||||
|
||||
previous_walk_state = walk_state;
|
||||
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_PARSE,
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
*****************************************************************************/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2000 - 2005, R. Byron Moore
|
||||
* Copyright (C) 2000 - 2006, R. Byron Moore
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
*****************************************************************************/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2000 - 2005, R. Byron Moore
|
||||
* Copyright (C) 2000 - 2006, R. Byron Moore
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
|
@ -132,7 +132,8 @@ acpi_ps_append_arg(union acpi_parse_object *op, union acpi_parse_object *arg)
|
|||
if (op_info->class == AML_CLASS_UNKNOWN) {
|
||||
/* Invalid opcode */
|
||||
|
||||
ACPI_REPORT_ERROR(("ps_append_arg: Invalid AML Opcode: 0x%2.2X\n", op->common.aml_opcode));
|
||||
ACPI_REPORT_ERROR(("Invalid AML Opcode: 0x%2.2X\n",
|
||||
op->common.aml_opcode));
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
*****************************************************************************/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2000 - 2005, R. Byron Moore
|
||||
* Copyright (C) 2000 - 2006, R. Byron Moore
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
*****************************************************************************/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2000 - 2005, R. Byron Moore
|
||||
* Copyright (C) 2000 - 2006, R. Byron Moore
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
*****************************************************************************/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2000 - 2005, R. Byron Moore
|
||||
* Copyright (C) 2000 - 2006, R. Byron Moore
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
|
@ -50,11 +50,145 @@
|
|||
ACPI_MODULE_NAME("psxface")
|
||||
|
||||
/* Local Prototypes */
|
||||
static void acpi_ps_start_trace(struct acpi_parameter_info *info);
|
||||
|
||||
static void acpi_ps_stop_trace(struct acpi_parameter_info *info);
|
||||
|
||||
static acpi_status acpi_ps_execute_pass(struct acpi_parameter_info *info);
|
||||
|
||||
static void
|
||||
acpi_ps_update_parameter_list(struct acpi_parameter_info *info, u16 action);
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: acpi_debug_trace
|
||||
*
|
||||
* PARAMETERS: method_name - Valid ACPI name string
|
||||
* debug_level - Optional level mask. 0 to use default
|
||||
* debug_layer - Optional layer mask. 0 to use default
|
||||
* Flags - bit 1: one shot(1) or persistent(0)
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: External interface to enable debug tracing during control
|
||||
* method execution
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
acpi_status
|
||||
acpi_debug_trace(char *name, u32 debug_level, u32 debug_layer, u32 flags)
|
||||
{
|
||||
acpi_status status;
|
||||
|
||||
status = acpi_ut_acquire_mutex(ACPI_MTX_NAMESPACE);
|
||||
if (ACPI_FAILURE(status)) {
|
||||
return (status);
|
||||
}
|
||||
|
||||
/* TBDs: Validate name, allow full path or just nameseg */
|
||||
|
||||
acpi_gbl_trace_method_name = *ACPI_CAST_PTR(u32, name);
|
||||
acpi_gbl_trace_flags = flags;
|
||||
|
||||
if (debug_level) {
|
||||
acpi_gbl_trace_dbg_level = debug_level;
|
||||
}
|
||||
if (debug_layer) {
|
||||
acpi_gbl_trace_dbg_layer = debug_layer;
|
||||
}
|
||||
|
||||
(void)acpi_ut_release_mutex(ACPI_MTX_NAMESPACE);
|
||||
return (AE_OK);
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: acpi_ps_start_trace
|
||||
*
|
||||
* PARAMETERS: Info - Method info struct
|
||||
*
|
||||
* RETURN: None
|
||||
*
|
||||
* DESCRIPTION: Start control method execution trace
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
static void acpi_ps_start_trace(struct acpi_parameter_info *info)
|
||||
{
|
||||
acpi_status status;
|
||||
|
||||
ACPI_FUNCTION_ENTRY();
|
||||
|
||||
status = acpi_ut_acquire_mutex(ACPI_MTX_NAMESPACE);
|
||||
if (ACPI_FAILURE(status)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ((!acpi_gbl_trace_method_name) ||
|
||||
(acpi_gbl_trace_method_name != info->node->name.integer)) {
|
||||
goto exit;
|
||||
}
|
||||
|
||||
acpi_gbl_original_dbg_level = acpi_dbg_level;
|
||||
acpi_gbl_original_dbg_layer = acpi_dbg_layer;
|
||||
|
||||
acpi_dbg_level = 0x00FFFFFF;
|
||||
acpi_dbg_layer = ACPI_UINT32_MAX;
|
||||
|
||||
if (acpi_gbl_trace_dbg_level) {
|
||||
acpi_dbg_level = acpi_gbl_trace_dbg_level;
|
||||
}
|
||||
if (acpi_gbl_trace_dbg_layer) {
|
||||
acpi_dbg_layer = acpi_gbl_trace_dbg_layer;
|
||||
}
|
||||
|
||||
exit:
|
||||
(void)acpi_ut_release_mutex(ACPI_MTX_NAMESPACE);
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: acpi_ps_stop_trace
|
||||
*
|
||||
* PARAMETERS: Info - Method info struct
|
||||
*
|
||||
* RETURN: None
|
||||
*
|
||||
* DESCRIPTION: Stop control method execution trace
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
static void acpi_ps_stop_trace(struct acpi_parameter_info *info)
|
||||
{
|
||||
acpi_status status;
|
||||
|
||||
ACPI_FUNCTION_ENTRY();
|
||||
|
||||
status = acpi_ut_acquire_mutex(ACPI_MTX_NAMESPACE);
|
||||
if (ACPI_FAILURE(status)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ((!acpi_gbl_trace_method_name) ||
|
||||
(acpi_gbl_trace_method_name != info->node->name.integer)) {
|
||||
goto exit;
|
||||
}
|
||||
|
||||
/* Disable further tracing if type is one-shot */
|
||||
|
||||
if (acpi_gbl_trace_flags & 1) {
|
||||
acpi_gbl_trace_method_name = 0;
|
||||
acpi_gbl_trace_dbg_level = 0;
|
||||
acpi_gbl_trace_dbg_layer = 0;
|
||||
}
|
||||
|
||||
acpi_dbg_level = acpi_gbl_original_dbg_level;
|
||||
acpi_dbg_layer = acpi_gbl_original_dbg_layer;
|
||||
|
||||
exit:
|
||||
(void)acpi_ut_release_mutex(ACPI_MTX_NAMESPACE);
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: acpi_ps_execute_method
|
||||
|
|
@ -104,6 +238,10 @@ acpi_status acpi_ps_execute_method(struct acpi_parameter_info *info)
|
|||
*/
|
||||
acpi_ps_update_parameter_list(info, REF_INCREMENT);
|
||||
|
||||
/* Begin tracing if requested */
|
||||
|
||||
acpi_ps_start_trace(info);
|
||||
|
||||
/*
|
||||
* 1) Perform the first pass parse of the method to enter any
|
||||
* named objects that it creates into the namespace
|
||||
|
|
@ -129,6 +267,10 @@ acpi_status acpi_ps_execute_method(struct acpi_parameter_info *info)
|
|||
status = acpi_ps_execute_pass(info);
|
||||
|
||||
cleanup:
|
||||
/* End optional tracing */
|
||||
|
||||
acpi_ps_stop_trace(info);
|
||||
|
||||
/* Take away the extra reference that we gave the parameters above */
|
||||
|
||||
acpi_ps_update_parameter_list(info, REF_DECREMENT);
|
||||
|
|
|
|||
|
|
@ -258,7 +258,7 @@ typedef int (*irq_lookup_func) (struct acpi_prt_entry *, int *, int *, char **);
|
|||
|
||||
static int
|
||||
acpi_pci_allocate_irq(struct acpi_prt_entry *entry,
|
||||
int *edge_level, int *active_high_low, char **link)
|
||||
int *triggering, int *polarity, char **link)
|
||||
{
|
||||
int irq;
|
||||
|
||||
|
|
@ -266,8 +266,8 @@ acpi_pci_allocate_irq(struct acpi_prt_entry *entry,
|
|||
|
||||
if (entry->link.handle) {
|
||||
irq = acpi_pci_link_allocate_irq(entry->link.handle,
|
||||
entry->link.index, edge_level,
|
||||
active_high_low, link);
|
||||
entry->link.index, triggering,
|
||||
polarity, link);
|
||||
if (irq < 0) {
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_WARN,
|
||||
"Invalid IRQ link routing entry\n"));
|
||||
|
|
@ -275,8 +275,8 @@ acpi_pci_allocate_irq(struct acpi_prt_entry *entry,
|
|||
}
|
||||
} else {
|
||||
irq = entry->link.index;
|
||||
*edge_level = ACPI_LEVEL_SENSITIVE;
|
||||
*active_high_low = ACPI_ACTIVE_LOW;
|
||||
*triggering = ACPI_LEVEL_SENSITIVE;
|
||||
*polarity = ACPI_ACTIVE_LOW;
|
||||
}
|
||||
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Found IRQ %d\n", irq));
|
||||
|
|
@ -285,7 +285,7 @@ acpi_pci_allocate_irq(struct acpi_prt_entry *entry,
|
|||
|
||||
static int
|
||||
acpi_pci_free_irq(struct acpi_prt_entry *entry,
|
||||
int *edge_level, int *active_high_low, char **link)
|
||||
int *triggering, int *polarity, char **link)
|
||||
{
|
||||
int irq;
|
||||
|
||||
|
|
@ -307,8 +307,8 @@ static int
|
|||
acpi_pci_irq_lookup(struct pci_bus *bus,
|
||||
int device,
|
||||
int pin,
|
||||
int *edge_level,
|
||||
int *active_high_low, char **link, irq_lookup_func func)
|
||||
int *triggering,
|
||||
int *polarity, char **link, irq_lookup_func func)
|
||||
{
|
||||
struct acpi_prt_entry *entry = NULL;
|
||||
int segment = pci_domain_nr(bus);
|
||||
|
|
@ -327,7 +327,7 @@ acpi_pci_irq_lookup(struct pci_bus *bus,
|
|||
return_VALUE(-1);
|
||||
}
|
||||
|
||||
ret = func(entry, edge_level, active_high_low, link);
|
||||
ret = func(entry, triggering, polarity, link);
|
||||
return_VALUE(ret);
|
||||
}
|
||||
|
||||
|
|
@ -339,8 +339,8 @@ acpi_pci_irq_lookup(struct pci_bus *bus,
|
|||
static int
|
||||
acpi_pci_irq_derive(struct pci_dev *dev,
|
||||
int pin,
|
||||
int *edge_level,
|
||||
int *active_high_low, char **link, irq_lookup_func func)
|
||||
int *triggering,
|
||||
int *polarity, char **link, irq_lookup_func func)
|
||||
{
|
||||
struct pci_dev *bridge = dev;
|
||||
int irq = -1;
|
||||
|
|
@ -374,7 +374,7 @@ acpi_pci_irq_derive(struct pci_dev *dev,
|
|||
}
|
||||
|
||||
irq = acpi_pci_irq_lookup(bridge->bus, PCI_SLOT(bridge->devfn),
|
||||
pin, edge_level, active_high_low,
|
||||
pin, triggering, polarity,
|
||||
link, func);
|
||||
}
|
||||
|
||||
|
|
@ -401,8 +401,8 @@ int acpi_pci_irq_enable(struct pci_dev *dev)
|
|||
{
|
||||
int irq = 0;
|
||||
u8 pin = 0;
|
||||
int edge_level = ACPI_LEVEL_SENSITIVE;
|
||||
int active_high_low = ACPI_ACTIVE_LOW;
|
||||
int triggering = ACPI_LEVEL_SENSITIVE;
|
||||
int polarity = ACPI_ACTIVE_LOW;
|
||||
char *link = NULL;
|
||||
int rc;
|
||||
|
||||
|
|
@ -431,7 +431,7 @@ int acpi_pci_irq_enable(struct pci_dev *dev)
|
|||
* values override any BIOS-assigned IRQs set during boot.
|
||||
*/
|
||||
irq = acpi_pci_irq_lookup(dev->bus, PCI_SLOT(dev->devfn), pin,
|
||||
&edge_level, &active_high_low, &link,
|
||||
&triggering, &polarity, &link,
|
||||
acpi_pci_allocate_irq);
|
||||
|
||||
/*
|
||||
|
|
@ -439,8 +439,8 @@ int acpi_pci_irq_enable(struct pci_dev *dev)
|
|||
* device's parent bridge.
|
||||
*/
|
||||
if (irq < 0)
|
||||
irq = acpi_pci_irq_derive(dev, pin, &edge_level,
|
||||
&active_high_low, &link,
|
||||
irq = acpi_pci_irq_derive(dev, pin, &triggering,
|
||||
&polarity, &link,
|
||||
acpi_pci_allocate_irq);
|
||||
|
||||
/*
|
||||
|
|
@ -462,7 +462,7 @@ int acpi_pci_irq_enable(struct pci_dev *dev)
|
|||
}
|
||||
}
|
||||
|
||||
rc = acpi_register_gsi(irq, edge_level, active_high_low);
|
||||
rc = acpi_register_gsi(irq, triggering, polarity);
|
||||
if (rc < 0) {
|
||||
printk(KERN_WARNING PREFIX "PCI Interrupt %s[%c]: failed "
|
||||
"to register GSI\n", pci_name(dev), ('A' + pin));
|
||||
|
|
@ -477,8 +477,8 @@ int acpi_pci_irq_enable(struct pci_dev *dev)
|
|||
printk("Link [%s] -> ", link);
|
||||
|
||||
printk("GSI %u (%s, %s) -> IRQ %d\n", irq,
|
||||
(edge_level == ACPI_LEVEL_SENSITIVE) ? "level" : "edge",
|
||||
(active_high_low == ACPI_ACTIVE_LOW) ? "low" : "high", dev->irq);
|
||||
(triggering == ACPI_LEVEL_SENSITIVE) ? "level" : "edge",
|
||||
(polarity == ACPI_ACTIVE_LOW) ? "low" : "high", dev->irq);
|
||||
|
||||
return_VALUE(0);
|
||||
}
|
||||
|
|
@ -494,8 +494,8 @@ void acpi_pci_irq_disable(struct pci_dev *dev)
|
|||
{
|
||||
int gsi = 0;
|
||||
u8 pin = 0;
|
||||
int edge_level = ACPI_LEVEL_SENSITIVE;
|
||||
int active_high_low = ACPI_ACTIVE_LOW;
|
||||
int triggering = ACPI_LEVEL_SENSITIVE;
|
||||
int polarity = ACPI_ACTIVE_LOW;
|
||||
|
||||
ACPI_FUNCTION_TRACE("acpi_pci_irq_disable");
|
||||
|
||||
|
|
@ -511,7 +511,7 @@ void acpi_pci_irq_disable(struct pci_dev *dev)
|
|||
* First we check the PCI IRQ routing table (PRT) for an IRQ.
|
||||
*/
|
||||
gsi = acpi_pci_irq_lookup(dev->bus, PCI_SLOT(dev->devfn), pin,
|
||||
&edge_level, &active_high_low, NULL,
|
||||
&triggering, &polarity, NULL,
|
||||
acpi_pci_free_irq);
|
||||
/*
|
||||
* If no PRT entry was found, we'll try to derive an IRQ from the
|
||||
|
|
@ -519,7 +519,7 @@ void acpi_pci_irq_disable(struct pci_dev *dev)
|
|||
*/
|
||||
if (gsi < 0)
|
||||
gsi = acpi_pci_irq_derive(dev, pin,
|
||||
&edge_level, &active_high_low, NULL,
|
||||
&triggering, &polarity, NULL,
|
||||
acpi_pci_free_irq);
|
||||
if (gsi < 0)
|
||||
return_VOID;
|
||||
|
|
|
|||
|
|
@ -70,8 +70,8 @@ static struct acpi_driver acpi_pci_link_driver = {
|
|||
*/
|
||||
struct acpi_pci_link_irq {
|
||||
u8 active; /* Current IRQ */
|
||||
u8 edge_level; /* All IRQs */
|
||||
u8 active_high_low; /* All IRQs */
|
||||
u8 triggering; /* All IRQs */
|
||||
u8 polarity; /* All IRQs */
|
||||
u8 resource_type;
|
||||
u8 possible_count;
|
||||
u8 possible[ACPI_PCI_LINK_MAX_POSSIBLE];
|
||||
|
|
@ -108,19 +108,19 @@ acpi_pci_link_check_possible(struct acpi_resource *resource, void *context)
|
|||
|
||||
ACPI_FUNCTION_TRACE("acpi_pci_link_check_possible");
|
||||
|
||||
switch (resource->id) {
|
||||
case ACPI_RSTYPE_START_DPF:
|
||||
switch (resource->type) {
|
||||
case ACPI_RESOURCE_TYPE_START_DEPENDENT:
|
||||
return_ACPI_STATUS(AE_OK);
|
||||
case ACPI_RSTYPE_IRQ:
|
||||
case ACPI_RESOURCE_TYPE_IRQ:
|
||||
{
|
||||
struct acpi_resource_irq *p = &resource->data.irq;
|
||||
if (!p || !p->number_of_interrupts) {
|
||||
if (!p || !p->interrupt_count) {
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_WARN,
|
||||
"Blank IRQ resource\n"));
|
||||
return_ACPI_STATUS(AE_OK);
|
||||
}
|
||||
for (i = 0;
|
||||
(i < p->number_of_interrupts
|
||||
(i < p->interrupt_count
|
||||
&& i < ACPI_PCI_LINK_MAX_POSSIBLE); i++) {
|
||||
if (!p->interrupts[i]) {
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_WARN,
|
||||
|
|
@ -131,22 +131,22 @@ acpi_pci_link_check_possible(struct acpi_resource *resource, void *context)
|
|||
link->irq.possible[i] = p->interrupts[i];
|
||||
link->irq.possible_count++;
|
||||
}
|
||||
link->irq.edge_level = p->edge_level;
|
||||
link->irq.active_high_low = p->active_high_low;
|
||||
link->irq.resource_type = ACPI_RSTYPE_IRQ;
|
||||
link->irq.triggering = p->triggering;
|
||||
link->irq.polarity = p->polarity;
|
||||
link->irq.resource_type = ACPI_RESOURCE_TYPE_IRQ;
|
||||
break;
|
||||
}
|
||||
case ACPI_RSTYPE_EXT_IRQ:
|
||||
case ACPI_RESOURCE_TYPE_EXTENDED_IRQ:
|
||||
{
|
||||
struct acpi_resource_ext_irq *p =
|
||||
struct acpi_resource_extended_irq *p =
|
||||
&resource->data.extended_irq;
|
||||
if (!p || !p->number_of_interrupts) {
|
||||
if (!p || !p->interrupt_count) {
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_WARN,
|
||||
"Blank EXT IRQ resource\n"));
|
||||
return_ACPI_STATUS(AE_OK);
|
||||
}
|
||||
for (i = 0;
|
||||
(i < p->number_of_interrupts
|
||||
(i < p->interrupt_count
|
||||
&& i < ACPI_PCI_LINK_MAX_POSSIBLE); i++) {
|
||||
if (!p->interrupts[i]) {
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_WARN,
|
||||
|
|
@ -157,9 +157,9 @@ acpi_pci_link_check_possible(struct acpi_resource *resource, void *context)
|
|||
link->irq.possible[i] = p->interrupts[i];
|
||||
link->irq.possible_count++;
|
||||
}
|
||||
link->irq.edge_level = p->edge_level;
|
||||
link->irq.active_high_low = p->active_high_low;
|
||||
link->irq.resource_type = ACPI_RSTYPE_EXT_IRQ;
|
||||
link->irq.triggering = p->triggering;
|
||||
link->irq.polarity = p->polarity;
|
||||
link->irq.resource_type = ACPI_RESOURCE_TYPE_EXTENDED_IRQ;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
|
|
@ -201,11 +201,11 @@ acpi_pci_link_check_current(struct acpi_resource *resource, void *context)
|
|||
|
||||
ACPI_FUNCTION_TRACE("acpi_pci_link_check_current");
|
||||
|
||||
switch (resource->id) {
|
||||
case ACPI_RSTYPE_IRQ:
|
||||
switch (resource->type) {
|
||||
case ACPI_RESOURCE_TYPE_IRQ:
|
||||
{
|
||||
struct acpi_resource_irq *p = &resource->data.irq;
|
||||
if (!p || !p->number_of_interrupts) {
|
||||
if (!p || !p->interrupt_count) {
|
||||
/*
|
||||
* IRQ descriptors may have no IRQ# bits set,
|
||||
* particularly those those w/ _STA disabled
|
||||
|
|
@ -217,11 +217,11 @@ acpi_pci_link_check_current(struct acpi_resource *resource, void *context)
|
|||
*irq = p->interrupts[0];
|
||||
break;
|
||||
}
|
||||
case ACPI_RSTYPE_EXT_IRQ:
|
||||
case ACPI_RESOURCE_TYPE_EXTENDED_IRQ:
|
||||
{
|
||||
struct acpi_resource_ext_irq *p =
|
||||
struct acpi_resource_extended_irq *p =
|
||||
&resource->data.extended_irq;
|
||||
if (!p || !p->number_of_interrupts) {
|
||||
if (!p || !p->interrupt_count) {
|
||||
/*
|
||||
* extended IRQ descriptors must
|
||||
* return at least 1 IRQ
|
||||
|
|
@ -325,36 +325,36 @@ static int acpi_pci_link_set(struct acpi_pci_link *link, int irq)
|
|||
buffer.pointer = resource;
|
||||
|
||||
switch (link->irq.resource_type) {
|
||||
case ACPI_RSTYPE_IRQ:
|
||||
resource->res.id = ACPI_RSTYPE_IRQ;
|
||||
case ACPI_RESOURCE_TYPE_IRQ:
|
||||
resource->res.type = ACPI_RESOURCE_TYPE_IRQ;
|
||||
resource->res.length = sizeof(struct acpi_resource);
|
||||
resource->res.data.irq.edge_level = link->irq.edge_level;
|
||||
resource->res.data.irq.active_high_low =
|
||||
link->irq.active_high_low;
|
||||
if (link->irq.edge_level == ACPI_EDGE_SENSITIVE)
|
||||
resource->res.data.irq.shared_exclusive =
|
||||
resource->res.data.irq.triggering = link->irq.triggering;
|
||||
resource->res.data.irq.polarity =
|
||||
link->irq.polarity;
|
||||
if (link->irq.triggering == ACPI_EDGE_SENSITIVE)
|
||||
resource->res.data.irq.sharable =
|
||||
ACPI_EXCLUSIVE;
|
||||
else
|
||||
resource->res.data.irq.shared_exclusive = ACPI_SHARED;
|
||||
resource->res.data.irq.number_of_interrupts = 1;
|
||||
resource->res.data.irq.sharable = ACPI_SHARED;
|
||||
resource->res.data.irq.interrupt_count = 1;
|
||||
resource->res.data.irq.interrupts[0] = irq;
|
||||
break;
|
||||
|
||||
case ACPI_RSTYPE_EXT_IRQ:
|
||||
resource->res.id = ACPI_RSTYPE_EXT_IRQ;
|
||||
case ACPI_RESOURCE_TYPE_EXTENDED_IRQ:
|
||||
resource->res.type = ACPI_RESOURCE_TYPE_EXTENDED_IRQ;
|
||||
resource->res.length = sizeof(struct acpi_resource);
|
||||
resource->res.data.extended_irq.producer_consumer =
|
||||
ACPI_CONSUMER;
|
||||
resource->res.data.extended_irq.edge_level =
|
||||
link->irq.edge_level;
|
||||
resource->res.data.extended_irq.active_high_low =
|
||||
link->irq.active_high_low;
|
||||
if (link->irq.edge_level == ACPI_EDGE_SENSITIVE)
|
||||
resource->res.data.irq.shared_exclusive =
|
||||
resource->res.data.extended_irq.triggering =
|
||||
link->irq.triggering;
|
||||
resource->res.data.extended_irq.polarity =
|
||||
link->irq.polarity;
|
||||
if (link->irq.triggering == ACPI_EDGE_SENSITIVE)
|
||||
resource->res.data.irq.sharable =
|
||||
ACPI_EXCLUSIVE;
|
||||
else
|
||||
resource->res.data.irq.shared_exclusive = ACPI_SHARED;
|
||||
resource->res.data.extended_irq.number_of_interrupts = 1;
|
||||
resource->res.data.irq.sharable = ACPI_SHARED;
|
||||
resource->res.data.extended_irq.interrupt_count = 1;
|
||||
resource->res.data.extended_irq.interrupts[0] = irq;
|
||||
/* ignore resource_source, it's optional */
|
||||
break;
|
||||
|
|
@ -364,7 +364,7 @@ static int acpi_pci_link_set(struct acpi_pci_link *link, int irq)
|
|||
goto end;
|
||||
|
||||
}
|
||||
resource->end.id = ACPI_RSTYPE_END_TAG;
|
||||
resource->end.type = ACPI_RESOURCE_TYPE_END_TAG;
|
||||
|
||||
/* Attempt to set the resource */
|
||||
status = acpi_set_current_resources(link->handle, &buffer);
|
||||
|
|
@ -613,7 +613,7 @@ static int acpi_pci_link_allocate(struct acpi_pci_link *link)
|
|||
int
|
||||
acpi_pci_link_allocate_irq(acpi_handle handle,
|
||||
int index,
|
||||
int *edge_level, int *active_high_low, char **name)
|
||||
int *triggering, int *polarity, char **name)
|
||||
{
|
||||
int result = 0;
|
||||
struct acpi_device *device = NULL;
|
||||
|
|
@ -653,10 +653,10 @@ acpi_pci_link_allocate_irq(acpi_handle handle,
|
|||
link->refcnt++;
|
||||
up(&acpi_link_lock);
|
||||
|
||||
if (edge_level)
|
||||
*edge_level = link->irq.edge_level;
|
||||
if (active_high_low)
|
||||
*active_high_low = link->irq.active_high_low;
|
||||
if (triggering)
|
||||
*triggering = link->irq.triggering;
|
||||
if (polarity)
|
||||
*polarity = link->irq.polarity;
|
||||
if (name)
|
||||
*name = acpi_device_bid(link->device);
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_INFO,
|
||||
|
|
|
|||
|
|
@ -122,15 +122,15 @@ get_root_bridge_busnr_callback(struct acpi_resource *resource, void *data)
|
|||
int *busnr = (int *)data;
|
||||
struct acpi_resource_address64 address;
|
||||
|
||||
if (resource->id != ACPI_RSTYPE_ADDRESS16 &&
|
||||
resource->id != ACPI_RSTYPE_ADDRESS32 &&
|
||||
resource->id != ACPI_RSTYPE_ADDRESS64)
|
||||
if (resource->type != ACPI_RESOURCE_TYPE_ADDRESS16 &&
|
||||
resource->type != ACPI_RESOURCE_TYPE_ADDRESS32 &&
|
||||
resource->type != ACPI_RESOURCE_TYPE_ADDRESS64)
|
||||
return AE_OK;
|
||||
|
||||
acpi_resource_to_address64(resource, &address);
|
||||
if ((address.address_length > 0) &&
|
||||
(address.resource_type == ACPI_BUS_NUMBER_RANGE))
|
||||
*busnr = address.min_address_range;
|
||||
*busnr = address.minimum;
|
||||
|
||||
return AE_OK;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -253,31 +253,21 @@ static int acpi_processor_errata(struct acpi_processor *pr)
|
|||
* _PDC is required for a BIOS-OS handshake for most of the newer
|
||||
* ACPI processor features.
|
||||
*/
|
||||
|
||||
int acpi_processor_set_pdc(struct acpi_processor *pr,
|
||||
struct acpi_object_list *pdc_in)
|
||||
static int acpi_processor_set_pdc(struct acpi_processor *pr)
|
||||
{
|
||||
struct acpi_object_list *pdc_in = pr->pdc;
|
||||
acpi_status status = AE_OK;
|
||||
u32 arg0_buf[3];
|
||||
union acpi_object arg0 = { ACPI_TYPE_BUFFER };
|
||||
struct acpi_object_list no_object = { 1, &arg0 };
|
||||
struct acpi_object_list *pdc;
|
||||
|
||||
ACPI_FUNCTION_TRACE("acpi_processor_set_pdc");
|
||||
|
||||
arg0.buffer.length = 12;
|
||||
arg0.buffer.pointer = (u8 *) arg0_buf;
|
||||
arg0_buf[0] = ACPI_PDC_REVISION_ID;
|
||||
arg0_buf[1] = 0;
|
||||
arg0_buf[2] = 0;
|
||||
if (!pdc_in)
|
||||
return_VALUE(status);
|
||||
|
||||
pdc = (pdc_in) ? pdc_in : &no_object;
|
||||
status = acpi_evaluate_object(pr->handle, "_PDC", pdc_in, NULL);
|
||||
|
||||
status = acpi_evaluate_object(pr->handle, "_PDC", pdc, NULL);
|
||||
|
||||
if ((ACPI_FAILURE(status)) && (pdc_in))
|
||||
if (ACPI_FAILURE(status))
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_INFO,
|
||||
"Error evaluating _PDC, using legacy perf. control...\n"));
|
||||
"Could not evaluate _PDC, using legacy perf. control...\n"));
|
||||
|
||||
return_VALUE(status);
|
||||
}
|
||||
|
|
@ -357,7 +347,6 @@ static int acpi_processor_add_fs(struct acpi_device *device)
|
|||
ACPI_PROCESSOR_FILE_THROTTLING));
|
||||
else {
|
||||
entry->proc_fops = &acpi_processor_throttling_fops;
|
||||
entry->proc_fops->write = acpi_processor_write_throttling;
|
||||
entry->data = acpi_driver_data(device);
|
||||
entry->owner = THIS_MODULE;
|
||||
}
|
||||
|
|
@ -372,7 +361,6 @@ static int acpi_processor_add_fs(struct acpi_device *device)
|
|||
ACPI_PROCESSOR_FILE_LIMIT));
|
||||
else {
|
||||
entry->proc_fops = &acpi_processor_limit_fops;
|
||||
entry->proc_fops->write = acpi_processor_write_limit;
|
||||
entry->data = acpi_driver_data(device);
|
||||
entry->owner = THIS_MODULE;
|
||||
}
|
||||
|
|
@ -589,6 +577,10 @@ static int acpi_processor_start(struct acpi_device *device)
|
|||
"Error installing device notify handler\n"));
|
||||
}
|
||||
|
||||
/* _PDC call should be done before doing anything else (if reqd.). */
|
||||
arch_acpi_processor_init_pdc(pr);
|
||||
acpi_processor_set_pdc(pr);
|
||||
|
||||
acpi_processor_power_init(pr, device);
|
||||
|
||||
if (pr->flags.throttling) {
|
||||
|
|
|
|||
|
|
@ -95,22 +95,57 @@ static int set_max_cstate(struct dmi_system_id *id)
|
|||
}
|
||||
|
||||
static struct dmi_system_id __initdata processor_power_dmi_table[] = {
|
||||
{set_max_cstate, "IBM ThinkPad R40e", {
|
||||
DMI_MATCH(DMI_BIOS_VENDOR,
|
||||
"IBM"),
|
||||
DMI_MATCH(DMI_BIOS_VERSION,
|
||||
"1SET60WW")},
|
||||
(void *)1},
|
||||
{set_max_cstate, "Medion 41700", {
|
||||
DMI_MATCH(DMI_BIOS_VENDOR,
|
||||
"Phoenix Technologies LTD"),
|
||||
DMI_MATCH(DMI_BIOS_VERSION,
|
||||
"R01-A1J")}, (void *)1},
|
||||
{set_max_cstate, "Clevo 5600D", {
|
||||
DMI_MATCH(DMI_BIOS_VENDOR,
|
||||
"Phoenix Technologies LTD"),
|
||||
DMI_MATCH(DMI_BIOS_VERSION,
|
||||
"SHE845M0.86C.0013.D.0302131307")},
|
||||
{ set_max_cstate, "IBM ThinkPad R40e", {
|
||||
DMI_MATCH(DMI_BIOS_VENDOR,"IBM"),
|
||||
DMI_MATCH(DMI_BIOS_VERSION,"1SET60WW")}, (void *)1},
|
||||
{ set_max_cstate, "IBM ThinkPad R40e", {
|
||||
DMI_MATCH(DMI_BIOS_VENDOR,"IBM"),
|
||||
DMI_MATCH(DMI_BIOS_VERSION,"1SET43WW") }, (void*)1},
|
||||
{ set_max_cstate, "IBM ThinkPad R40e", {
|
||||
DMI_MATCH(DMI_BIOS_VENDOR,"IBM"),
|
||||
DMI_MATCH(DMI_BIOS_VERSION,"1SET45WW") }, (void*)1},
|
||||
{ set_max_cstate, "IBM ThinkPad R40e", {
|
||||
DMI_MATCH(DMI_BIOS_VENDOR,"IBM"),
|
||||
DMI_MATCH(DMI_BIOS_VERSION,"1SET47WW") }, (void*)1},
|
||||
{ set_max_cstate, "IBM ThinkPad R40e", {
|
||||
DMI_MATCH(DMI_BIOS_VENDOR,"IBM"),
|
||||
DMI_MATCH(DMI_BIOS_VERSION,"1SET50WW") }, (void*)1},
|
||||
{ set_max_cstate, "IBM ThinkPad R40e", {
|
||||
DMI_MATCH(DMI_BIOS_VENDOR,"IBM"),
|
||||
DMI_MATCH(DMI_BIOS_VERSION,"1SET52WW") }, (void*)1},
|
||||
{ set_max_cstate, "IBM ThinkPad R40e", {
|
||||
DMI_MATCH(DMI_BIOS_VENDOR,"IBM"),
|
||||
DMI_MATCH(DMI_BIOS_VERSION,"1SET55WW") }, (void*)1},
|
||||
{ set_max_cstate, "IBM ThinkPad R40e", {
|
||||
DMI_MATCH(DMI_BIOS_VENDOR,"IBM"),
|
||||
DMI_MATCH(DMI_BIOS_VERSION,"1SET56WW") }, (void*)1},
|
||||
{ set_max_cstate, "IBM ThinkPad R40e", {
|
||||
DMI_MATCH(DMI_BIOS_VENDOR,"IBM"),
|
||||
DMI_MATCH(DMI_BIOS_VERSION,"1SET59WW") }, (void*)1},
|
||||
{ set_max_cstate, "IBM ThinkPad R40e", {
|
||||
DMI_MATCH(DMI_BIOS_VENDOR,"IBM"),
|
||||
DMI_MATCH(DMI_BIOS_VERSION,"1SET60WW") }, (void*)1},
|
||||
{ set_max_cstate, "IBM ThinkPad R40e", {
|
||||
DMI_MATCH(DMI_BIOS_VENDOR,"IBM"),
|
||||
DMI_MATCH(DMI_BIOS_VERSION,"1SET61WW") }, (void*)1},
|
||||
{ set_max_cstate, "IBM ThinkPad R40e", {
|
||||
DMI_MATCH(DMI_BIOS_VENDOR,"IBM"),
|
||||
DMI_MATCH(DMI_BIOS_VERSION,"1SET62WW") }, (void*)1},
|
||||
{ set_max_cstate, "IBM ThinkPad R40e", {
|
||||
DMI_MATCH(DMI_BIOS_VENDOR,"IBM"),
|
||||
DMI_MATCH(DMI_BIOS_VERSION,"1SET64WW") }, (void*)1},
|
||||
{ set_max_cstate, "IBM ThinkPad R40e", {
|
||||
DMI_MATCH(DMI_BIOS_VENDOR,"IBM"),
|
||||
DMI_MATCH(DMI_BIOS_VERSION,"1SET65WW") }, (void*)1},
|
||||
{ set_max_cstate, "IBM ThinkPad R40e", {
|
||||
DMI_MATCH(DMI_BIOS_VENDOR,"IBM"),
|
||||
DMI_MATCH(DMI_BIOS_VERSION,"1SET68WW") }, (void*)1},
|
||||
{ set_max_cstate, "Medion 41700", {
|
||||
DMI_MATCH(DMI_BIOS_VENDOR,"Phoenix Technologies LTD"),
|
||||
DMI_MATCH(DMI_BIOS_VERSION,"R01-A1J")}, (void *)1},
|
||||
{ set_max_cstate, "Clevo 5600D", {
|
||||
DMI_MATCH(DMI_BIOS_VENDOR,"Phoenix Technologies LTD"),
|
||||
DMI_MATCH(DMI_BIOS_VERSION,"SHE845M0.86C.0013.D.0302131307")},
|
||||
(void *)2},
|
||||
{},
|
||||
};
|
||||
|
|
@ -550,18 +585,10 @@ static int acpi_processor_get_power_info_fadt(struct acpi_processor *pr)
|
|||
if (!pr->pblk)
|
||||
return_VALUE(-ENODEV);
|
||||
|
||||
memset(pr->power.states, 0, sizeof(pr->power.states));
|
||||
|
||||
/* if info is obtained from pblk/fadt, type equals state */
|
||||
pr->power.states[ACPI_STATE_C1].type = ACPI_STATE_C1;
|
||||
pr->power.states[ACPI_STATE_C2].type = ACPI_STATE_C2;
|
||||
pr->power.states[ACPI_STATE_C3].type = ACPI_STATE_C3;
|
||||
|
||||
/* the C0 state only exists as a filler in our array,
|
||||
* and all processors need to support C1 */
|
||||
pr->power.states[ACPI_STATE_C0].valid = 1;
|
||||
pr->power.states[ACPI_STATE_C1].valid = 1;
|
||||
|
||||
#ifndef CONFIG_HOTPLUG_CPU
|
||||
/*
|
||||
* Check for P_LVL2_UP flag before entering C2 and above on
|
||||
|
|
@ -591,12 +618,11 @@ static int acpi_processor_get_power_info_default_c1(struct acpi_processor *pr)
|
|||
{
|
||||
ACPI_FUNCTION_TRACE("acpi_processor_get_power_info_default_c1");
|
||||
|
||||
/* Zero initialize all the C-states info. */
|
||||
memset(pr->power.states, 0, sizeof(pr->power.states));
|
||||
|
||||
/* if info is obtained from pblk/fadt, type equals state */
|
||||
/* set the first C-State to C1 */
|
||||
pr->power.states[ACPI_STATE_C1].type = ACPI_STATE_C1;
|
||||
pr->power.states[ACPI_STATE_C2].type = ACPI_STATE_C2;
|
||||
pr->power.states[ACPI_STATE_C3].type = ACPI_STATE_C3;
|
||||
|
||||
/* the C0 state only exists as a filler in our array,
|
||||
* and all processors need to support C1 */
|
||||
|
|
@ -610,6 +636,7 @@ static int acpi_processor_get_power_info_cst(struct acpi_processor *pr)
|
|||
{
|
||||
acpi_status status = 0;
|
||||
acpi_integer count;
|
||||
int current_count;
|
||||
int i;
|
||||
struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };
|
||||
union acpi_object *cst;
|
||||
|
|
@ -619,10 +646,12 @@ static int acpi_processor_get_power_info_cst(struct acpi_processor *pr)
|
|||
if (nocst)
|
||||
return_VALUE(-ENODEV);
|
||||
|
||||
pr->power.count = 0;
|
||||
for (i = 0; i < ACPI_PROCESSOR_MAX_POWER; i++)
|
||||
memset(&(pr->power.states[i]), 0,
|
||||
sizeof(struct acpi_processor_cx));
|
||||
current_count = 1;
|
||||
|
||||
/* Zero initialize C2 onwards and prepare for fresh CST lookup */
|
||||
for (i = 2; i < ACPI_PROCESSOR_MAX_POWER; i++)
|
||||
memset(&(pr->power.states[i]), 0,
|
||||
sizeof(struct acpi_processor_cx));
|
||||
|
||||
status = acpi_evaluate_object(pr->handle, "_CST", NULL, &buffer);
|
||||
if (ACPI_FAILURE(status)) {
|
||||
|
|
@ -650,16 +679,6 @@ static int acpi_processor_get_power_info_cst(struct acpi_processor *pr)
|
|||
goto end;
|
||||
}
|
||||
|
||||
/* We support up to ACPI_PROCESSOR_MAX_POWER. */
|
||||
if (count > ACPI_PROCESSOR_MAX_POWER) {
|
||||
printk(KERN_WARNING
|
||||
"Limiting number of power states to max (%d)\n",
|
||||
ACPI_PROCESSOR_MAX_POWER);
|
||||
printk(KERN_WARNING
|
||||
"Please increase ACPI_PROCESSOR_MAX_POWER if needed.\n");
|
||||
count = ACPI_PROCESSOR_MAX_POWER;
|
||||
}
|
||||
|
||||
/* Tell driver that at least _CST is supported. */
|
||||
pr->flags.has_cst = 1;
|
||||
|
||||
|
|
@ -703,7 +722,7 @@ static int acpi_processor_get_power_info_cst(struct acpi_processor *pr)
|
|||
(reg->space_id != ACPI_ADR_SPACE_SYSTEM_IO))
|
||||
continue;
|
||||
|
||||
if ((cx.type < ACPI_STATE_C1) || (cx.type > ACPI_STATE_C3))
|
||||
if ((cx.type < ACPI_STATE_C2) || (cx.type > ACPI_STATE_C3))
|
||||
continue;
|
||||
|
||||
obj = (union acpi_object *)&(element->package.elements[2]);
|
||||
|
|
@ -718,15 +737,28 @@ static int acpi_processor_get_power_info_cst(struct acpi_processor *pr)
|
|||
|
||||
cx.power = obj->integer.value;
|
||||
|
||||
(pr->power.count)++;
|
||||
memcpy(&(pr->power.states[pr->power.count]), &cx, sizeof(cx));
|
||||
current_count++;
|
||||
memcpy(&(pr->power.states[current_count]), &cx, sizeof(cx));
|
||||
|
||||
/*
|
||||
* We support total ACPI_PROCESSOR_MAX_POWER - 1
|
||||
* (From 1 through ACPI_PROCESSOR_MAX_POWER - 1)
|
||||
*/
|
||||
if (current_count >= (ACPI_PROCESSOR_MAX_POWER - 1)) {
|
||||
printk(KERN_WARNING
|
||||
"Limiting number of power states to max (%d)\n",
|
||||
ACPI_PROCESSOR_MAX_POWER);
|
||||
printk(KERN_WARNING
|
||||
"Please increase ACPI_PROCESSOR_MAX_POWER if needed.\n");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Found %d power states\n",
|
||||
pr->power.count));
|
||||
current_count));
|
||||
|
||||
/* Validate number of power states discovered */
|
||||
if (pr->power.count < 2)
|
||||
if (current_count < 2)
|
||||
status = -EFAULT;
|
||||
|
||||
end:
|
||||
|
|
@ -892,12 +924,13 @@ static int acpi_processor_get_power_info(struct acpi_processor *pr)
|
|||
/* NOTE: the idle thread may not be running while calling
|
||||
* this function */
|
||||
|
||||
/* Adding C1 state */
|
||||
acpi_processor_get_power_info_default_c1(pr);
|
||||
result = acpi_processor_get_power_info_cst(pr);
|
||||
if (result == -ENODEV)
|
||||
result = acpi_processor_get_power_info_fadt(pr);
|
||||
acpi_processor_get_power_info_fadt(pr);
|
||||
|
||||
if ((result) || (acpi_processor_power_verify(pr) < 2))
|
||||
result = acpi_processor_get_power_info_default_c1(pr);
|
||||
pr->power.count = acpi_processor_power_verify(pr);
|
||||
|
||||
/*
|
||||
* Set Default Policy
|
||||
|
|
@ -1066,8 +1099,6 @@ int acpi_processor_power_init(struct acpi_processor *pr,
|
|||
}
|
||||
}
|
||||
|
||||
acpi_processor_power_init_pdc(&(pr->power), pr->id);
|
||||
acpi_processor_set_pdc(pr, pr->power.pdc);
|
||||
acpi_processor_get_power_info(pr);
|
||||
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -315,8 +315,6 @@ static int acpi_processor_get_performance_info(struct acpi_processor *pr)
|
|||
if (!pr || !pr->performance || !pr->handle)
|
||||
return_VALUE(-EINVAL);
|
||||
|
||||
acpi_processor_set_pdc(pr, pr->performance->pdc);
|
||||
|
||||
status = acpi_get_handle(pr->handle, "_PCT", &handle);
|
||||
if (ACPI_FAILURE(status)) {
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_INFO,
|
||||
|
|
@ -520,8 +518,8 @@ static void acpi_cpufreq_add_file(struct acpi_processor *pr)
|
|||
"Unable to create '%s' fs entry\n",
|
||||
ACPI_PROCESSOR_FILE_PERFORMANCE));
|
||||
else {
|
||||
acpi_processor_perf_fops.write = acpi_processor_write_performance;
|
||||
entry->proc_fops = &acpi_processor_perf_fops;
|
||||
entry->proc_fops->write = acpi_processor_write_performance;
|
||||
entry->data = acpi_driver_data(device);
|
||||
entry->owner = THIS_MODULE;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -348,9 +348,9 @@ static int acpi_processor_limit_open_fs(struct inode *inode, struct file *file)
|
|||
PDE(inode)->data);
|
||||
}
|
||||
|
||||
ssize_t acpi_processor_write_limit(struct file * file,
|
||||
const char __user * buffer,
|
||||
size_t count, loff_t * data)
|
||||
static ssize_t acpi_processor_write_limit(struct file * file,
|
||||
const char __user * buffer,
|
||||
size_t count, loff_t * data)
|
||||
{
|
||||
int result = 0;
|
||||
struct seq_file *m = (struct seq_file *)file->private_data;
|
||||
|
|
@ -394,6 +394,7 @@ ssize_t acpi_processor_write_limit(struct file * file,
|
|||
struct file_operations acpi_processor_limit_fops = {
|
||||
.open = acpi_processor_limit_open_fs,
|
||||
.read = seq_read,
|
||||
.write = acpi_processor_write_limit,
|
||||
.llseek = seq_lseek,
|
||||
.release = single_release,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -306,9 +306,9 @@ static int acpi_processor_throttling_open_fs(struct inode *inode,
|
|||
PDE(inode)->data);
|
||||
}
|
||||
|
||||
ssize_t acpi_processor_write_throttling(struct file * file,
|
||||
const char __user * buffer,
|
||||
size_t count, loff_t * data)
|
||||
static ssize_t acpi_processor_write_throttling(struct file * file,
|
||||
const char __user * buffer,
|
||||
size_t count, loff_t * data)
|
||||
{
|
||||
int result = 0;
|
||||
struct seq_file *m = (struct seq_file *)file->private_data;
|
||||
|
|
@ -337,6 +337,7 @@ ssize_t acpi_processor_write_throttling(struct file * file,
|
|||
struct file_operations acpi_processor_throttling_fops = {
|
||||
.open = acpi_processor_throttling_open_fs,
|
||||
.read = seq_read,
|
||||
.write = acpi_processor_write_throttling,
|
||||
.llseek = seq_lseek,
|
||||
.release = single_release,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
# Makefile for all Linux ACPI interpreter subdirectories
|
||||
#
|
||||
|
||||
obj-y := rsaddr.o rscreate.o rsio.o rslist.o rsmisc.o rsxface.o \
|
||||
obj-y := rsaddr.o rscreate.o rsinfo.o rsio.o rslist.o rsmisc.o rsxface.o \
|
||||
rscalc.o rsirq.o rsmemory.o rsutils.o
|
||||
|
||||
obj-$(ACPI_FUTURE_USAGE) += rsdump.o
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -5,7 +5,7 @@
|
|||
******************************************************************************/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2000 - 2005, R. Byron Moore
|
||||
* Copyright (C) 2000 - 2006, R. Byron Moore
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
|
@ -49,652 +49,433 @@
|
|||
#define _COMPONENT ACPI_RESOURCES
|
||||
ACPI_MODULE_NAME("rscalc")
|
||||
|
||||
/* Local prototypes */
|
||||
static u8 acpi_rs_count_set_bits(u16 bit_field);
|
||||
|
||||
static acpi_rs_length
|
||||
acpi_rs_struct_option_length(struct acpi_resource_source *resource_source);
|
||||
|
||||
static u32
|
||||
acpi_rs_stream_option_length(u32 resource_length, u32 minimum_total_length);
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: acpi_rs_get_byte_stream_length
|
||||
* FUNCTION: acpi_rs_count_set_bits
|
||||
*
|
||||
* PARAMETERS: linked_list - Pointer to the resource linked list
|
||||
* size_needed - u32 pointer of the size buffer needed
|
||||
* to properly return the parsed data
|
||||
* PARAMETERS: bit_field - Field in which to count bits
|
||||
*
|
||||
* RETURN: Number of bits set within the field
|
||||
*
|
||||
* DESCRIPTION: Count the number of bits set in a resource field. Used for
|
||||
* (Short descriptor) interrupt and DMA lists.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
static u8 acpi_rs_count_set_bits(u16 bit_field)
|
||||
{
|
||||
u8 bits_set;
|
||||
|
||||
ACPI_FUNCTION_ENTRY();
|
||||
|
||||
for (bits_set = 0; bit_field; bits_set++) {
|
||||
/* Zero the least significant bit that is set */
|
||||
|
||||
bit_field &= (bit_field - 1);
|
||||
}
|
||||
|
||||
return (bits_set);
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: acpi_rs_struct_option_length
|
||||
*
|
||||
* PARAMETERS: resource_source - Pointer to optional descriptor field
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Takes the resource byte stream and parses it once, calculating
|
||||
* the size buffer needed to hold the linked list that conveys
|
||||
* the resource data.
|
||||
* DESCRIPTION: Common code to handle optional resource_source_index and
|
||||
* resource_source fields in some Large descriptors. Used during
|
||||
* list-to-stream conversion
|
||||
*
|
||||
******************************************************************************/
|
||||
acpi_status
|
||||
acpi_rs_get_byte_stream_length(struct acpi_resource *linked_list,
|
||||
acpi_size * size_needed)
|
||||
|
||||
static acpi_rs_length
|
||||
acpi_rs_struct_option_length(struct acpi_resource_source *resource_source)
|
||||
{
|
||||
acpi_size byte_stream_size_needed = 0;
|
||||
acpi_size segment_size;
|
||||
u8 done = FALSE;
|
||||
ACPI_FUNCTION_ENTRY();
|
||||
|
||||
ACPI_FUNCTION_TRACE("rs_get_byte_stream_length");
|
||||
/*
|
||||
* If the resource_source string is valid, return the size of the string
|
||||
* (string_length includes the NULL terminator) plus the size of the
|
||||
* resource_source_index (1).
|
||||
*/
|
||||
if (resource_source->string_ptr) {
|
||||
return ((acpi_rs_length) (resource_source->string_length + 1));
|
||||
}
|
||||
|
||||
while (!done) {
|
||||
/* Init the variable that will hold the size to add to the total. */
|
||||
return (0);
|
||||
}
|
||||
|
||||
segment_size = 0;
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: acpi_rs_stream_option_length
|
||||
*
|
||||
* PARAMETERS: resource_length - Length from the resource header
|
||||
* minimum_total_length - Minimum length of this resource, before
|
||||
* any optional fields. Includes header size
|
||||
*
|
||||
* RETURN: Length of optional string (0 if no string present)
|
||||
*
|
||||
* DESCRIPTION: Common code to handle optional resource_source_index and
|
||||
* resource_source fields in some Large descriptors. Used during
|
||||
* stream-to-list conversion
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
switch (linked_list->id) {
|
||||
case ACPI_RSTYPE_IRQ:
|
||||
static u32
|
||||
acpi_rs_stream_option_length(u32 resource_length,
|
||||
u32 minimum_aml_resource_length)
|
||||
{
|
||||
u32 string_length = 0;
|
||||
|
||||
ACPI_FUNCTION_ENTRY();
|
||||
|
||||
/*
|
||||
* The resource_source_index and resource_source are optional elements of some
|
||||
* Large-type resource descriptors.
|
||||
*/
|
||||
|
||||
/*
|
||||
* If the length of the actual resource descriptor is greater than the ACPI
|
||||
* spec-defined minimum length, it means that a resource_source_index exists
|
||||
* and is followed by a (required) null terminated string. The string length
|
||||
* (including the null terminator) is the resource length minus the minimum
|
||||
* length, minus one byte for the resource_source_index itself.
|
||||
*/
|
||||
if (resource_length > minimum_aml_resource_length) {
|
||||
/* Compute the length of the optional string */
|
||||
|
||||
string_length =
|
||||
resource_length - minimum_aml_resource_length - 1;
|
||||
}
|
||||
|
||||
/* Round up length to 32 bits for internal structure alignment */
|
||||
|
||||
return (ACPI_ROUND_UP_to_32_bITS(string_length));
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: acpi_rs_get_aml_length
|
||||
*
|
||||
* PARAMETERS: Resource - Pointer to the resource linked list
|
||||
* size_needed - Where the required size is returned
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Takes a linked list of internal resource descriptors and
|
||||
* calculates the size buffer needed to hold the corresponding
|
||||
* external resource byte stream.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
acpi_status
|
||||
acpi_rs_get_aml_length(struct acpi_resource * resource, acpi_size * size_needed)
|
||||
{
|
||||
acpi_size aml_size_needed = 0;
|
||||
acpi_rs_length total_size;
|
||||
|
||||
ACPI_FUNCTION_TRACE("rs_get_aml_length");
|
||||
|
||||
/* Traverse entire list of internal resource descriptors */
|
||||
|
||||
while (resource) {
|
||||
/* Validate the descriptor type */
|
||||
|
||||
if (resource->type > ACPI_RESOURCE_TYPE_MAX) {
|
||||
return_ACPI_STATUS(AE_AML_INVALID_RESOURCE_TYPE);
|
||||
}
|
||||
|
||||
/* Get the base size of the (external stream) resource descriptor */
|
||||
|
||||
total_size = acpi_gbl_aml_resource_sizes[resource->type];
|
||||
|
||||
/*
|
||||
* Augment the base size for descriptors with optional and/or
|
||||
* variable-length fields
|
||||
*/
|
||||
switch (resource->type) {
|
||||
case ACPI_RESOURCE_TYPE_VENDOR:
|
||||
/*
|
||||
* IRQ Resource
|
||||
* For an IRQ Resource, Byte 3, although optional, will always be
|
||||
* created - it holds IRQ information.
|
||||
*/
|
||||
segment_size = 4;
|
||||
break;
|
||||
|
||||
case ACPI_RSTYPE_DMA:
|
||||
/*
|
||||
* DMA Resource
|
||||
* For this resource the size is static
|
||||
*/
|
||||
segment_size = 3;
|
||||
break;
|
||||
|
||||
case ACPI_RSTYPE_START_DPF:
|
||||
/*
|
||||
* Start Dependent Functions Resource
|
||||
* For a start_dependent_functions Resource, Byte 1, although
|
||||
* optional, will always be created.
|
||||
*/
|
||||
segment_size = 2;
|
||||
break;
|
||||
|
||||
case ACPI_RSTYPE_END_DPF:
|
||||
/*
|
||||
* End Dependent Functions Resource
|
||||
* For this resource the size is static
|
||||
*/
|
||||
segment_size = 1;
|
||||
break;
|
||||
|
||||
case ACPI_RSTYPE_IO:
|
||||
/*
|
||||
* IO Port Resource
|
||||
* For this resource the size is static
|
||||
*/
|
||||
segment_size = 8;
|
||||
break;
|
||||
|
||||
case ACPI_RSTYPE_FIXED_IO:
|
||||
/*
|
||||
* Fixed IO Port Resource
|
||||
* For this resource the size is static
|
||||
*/
|
||||
segment_size = 4;
|
||||
break;
|
||||
|
||||
case ACPI_RSTYPE_VENDOR:
|
||||
/*
|
||||
* Vendor Defined Resource
|
||||
* Vendor Defined Resource:
|
||||
* For a Vendor Specific resource, if the Length is between 1 and 7
|
||||
* it will be created as a Small Resource data type, otherwise it
|
||||
* is a Large Resource data type.
|
||||
*/
|
||||
if (linked_list->data.vendor_specific.length > 7) {
|
||||
segment_size = 3;
|
||||
} else {
|
||||
segment_size = 1;
|
||||
if (resource->data.vendor.byte_length > 7) {
|
||||
/* Base size of a Large resource descriptor */
|
||||
|
||||
total_size =
|
||||
sizeof(struct aml_resource_large_header);
|
||||
}
|
||||
segment_size +=
|
||||
linked_list->data.vendor_specific.length;
|
||||
|
||||
/* Add the size of the vendor-specific data */
|
||||
|
||||
total_size = (acpi_rs_length)
|
||||
(total_size + resource->data.vendor.byte_length);
|
||||
break;
|
||||
|
||||
case ACPI_RSTYPE_END_TAG:
|
||||
case ACPI_RESOURCE_TYPE_END_TAG:
|
||||
/*
|
||||
* End Tag
|
||||
* For this resource the size is static
|
||||
* End Tag:
|
||||
* We are done -- return the accumulated total size.
|
||||
*/
|
||||
segment_size = 2;
|
||||
done = TRUE;
|
||||
*size_needed = aml_size_needed + total_size;
|
||||
|
||||
/* Normal exit */
|
||||
|
||||
return_ACPI_STATUS(AE_OK);
|
||||
|
||||
case ACPI_RESOURCE_TYPE_ADDRESS16:
|
||||
/*
|
||||
* 16-Bit Address Resource:
|
||||
* Add the size of the optional resource_source info
|
||||
*/
|
||||
total_size = (acpi_rs_length)
|
||||
(total_size +
|
||||
acpi_rs_struct_option_length(&resource->data.
|
||||
address16.
|
||||
resource_source));
|
||||
break;
|
||||
|
||||
case ACPI_RSTYPE_MEM24:
|
||||
case ACPI_RESOURCE_TYPE_ADDRESS32:
|
||||
/*
|
||||
* 24-Bit Memory Resource
|
||||
* For this resource the size is static
|
||||
* 32-Bit Address Resource:
|
||||
* Add the size of the optional resource_source info
|
||||
*/
|
||||
segment_size = 12;
|
||||
total_size = (acpi_rs_length)
|
||||
(total_size +
|
||||
acpi_rs_struct_option_length(&resource->data.
|
||||
address32.
|
||||
resource_source));
|
||||
break;
|
||||
|
||||
case ACPI_RSTYPE_MEM32:
|
||||
case ACPI_RESOURCE_TYPE_ADDRESS64:
|
||||
/*
|
||||
* 32-Bit Memory Range Resource
|
||||
* For this resource the size is static
|
||||
* 64-Bit Address Resource:
|
||||
* Add the size of the optional resource_source info
|
||||
*/
|
||||
segment_size = 20;
|
||||
total_size = (acpi_rs_length)
|
||||
(total_size +
|
||||
acpi_rs_struct_option_length(&resource->data.
|
||||
address64.
|
||||
resource_source));
|
||||
break;
|
||||
|
||||
case ACPI_RSTYPE_FIXED_MEM32:
|
||||
case ACPI_RESOURCE_TYPE_EXTENDED_IRQ:
|
||||
/*
|
||||
* 32-Bit Fixed Memory Resource
|
||||
* For this resource the size is static
|
||||
* Extended IRQ Resource:
|
||||
* Add the size of each additional optional interrupt beyond the
|
||||
* required 1 (4 bytes for each u32 interrupt number)
|
||||
*/
|
||||
segment_size = 12;
|
||||
break;
|
||||
|
||||
case ACPI_RSTYPE_ADDRESS16:
|
||||
/*
|
||||
* 16-Bit Address Resource
|
||||
* The base size of this byte stream is 16. If a Resource Source
|
||||
* string is not NULL, add 1 for the Index + the length of the null
|
||||
* terminated string Resource Source + 1 for the null.
|
||||
*/
|
||||
segment_size = 16;
|
||||
|
||||
if (linked_list->data.address16.resource_source.
|
||||
string_ptr) {
|
||||
segment_size +=
|
||||
linked_list->data.address16.resource_source.
|
||||
string_length;
|
||||
segment_size++;
|
||||
}
|
||||
break;
|
||||
|
||||
case ACPI_RSTYPE_ADDRESS32:
|
||||
/*
|
||||
* 32-Bit Address Resource
|
||||
* The base size of this byte stream is 26. If a Resource
|
||||
* Source string is not NULL, add 1 for the Index + the
|
||||
* length of the null terminated string Resource Source +
|
||||
* 1 for the null.
|
||||
*/
|
||||
segment_size = 26;
|
||||
|
||||
if (linked_list->data.address32.resource_source.
|
||||
string_ptr) {
|
||||
segment_size +=
|
||||
linked_list->data.address32.resource_source.
|
||||
string_length;
|
||||
segment_size++;
|
||||
}
|
||||
break;
|
||||
|
||||
case ACPI_RSTYPE_ADDRESS64:
|
||||
/*
|
||||
* 64-Bit Address Resource
|
||||
* The base size of this byte stream is 46. If a resource_source
|
||||
* string is not NULL, add 1 for the Index + the length of the null
|
||||
* terminated string Resource Source + 1 for the null.
|
||||
*/
|
||||
segment_size = 46;
|
||||
|
||||
if (linked_list->data.address64.resource_source.
|
||||
string_ptr) {
|
||||
segment_size +=
|
||||
linked_list->data.address64.resource_source.
|
||||
string_length;
|
||||
segment_size++;
|
||||
}
|
||||
break;
|
||||
|
||||
case ACPI_RSTYPE_EXT_IRQ:
|
||||
/*
|
||||
* Extended IRQ Resource
|
||||
* The base size of this byte stream is 9. This is for an Interrupt
|
||||
* table length of 1. For each additional interrupt, add 4.
|
||||
* If a Resource Source string is not NULL, add 1 for the
|
||||
* Index + the length of the null terminated string
|
||||
* Resource Source + 1 for the null.
|
||||
*/
|
||||
segment_size = 9 + (((acpi_size)
|
||||
linked_list->data.extended_irq.
|
||||
number_of_interrupts - 1) * 4);
|
||||
|
||||
if (linked_list->data.extended_irq.resource_source.
|
||||
string_ptr) {
|
||||
segment_size +=
|
||||
linked_list->data.extended_irq.
|
||||
resource_source.string_length;
|
||||
segment_size++;
|
||||
}
|
||||
total_size = (acpi_rs_length)
|
||||
(total_size +
|
||||
((resource->data.extended_irq.interrupt_count -
|
||||
1) * 4) +
|
||||
/* Add the size of the optional resource_source info */
|
||||
acpi_rs_struct_option_length(&resource->data.
|
||||
extended_irq.
|
||||
resource_source));
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
/* If we get here, everything is out of sync, exit with error */
|
||||
|
||||
return_ACPI_STATUS(AE_AML_INVALID_RESOURCE_TYPE);
|
||||
|
||||
} /* switch (linked_list->Id) */
|
||||
break;
|
||||
}
|
||||
|
||||
/* Update the total */
|
||||
|
||||
byte_stream_size_needed += segment_size;
|
||||
aml_size_needed += total_size;
|
||||
|
||||
/* Point to the next object */
|
||||
|
||||
linked_list = ACPI_PTR_ADD(struct acpi_resource,
|
||||
linked_list, linked_list->length);
|
||||
resource =
|
||||
ACPI_ADD_PTR(struct acpi_resource, resource,
|
||||
resource->length);
|
||||
}
|
||||
|
||||
/* This is the data the caller needs */
|
||||
/* Did not find an end_tag resource descriptor */
|
||||
|
||||
*size_needed = byte_stream_size_needed;
|
||||
return_ACPI_STATUS(AE_OK);
|
||||
return_ACPI_STATUS(AE_AML_NO_RESOURCE_END_TAG);
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: acpi_rs_get_list_length
|
||||
*
|
||||
* PARAMETERS: byte_stream_buffer - Pointer to the resource byte stream
|
||||
* byte_stream_buffer_length - Size of byte_stream_buffer
|
||||
* size_needed - u32 pointer of the size buffer
|
||||
* needed to properly return the
|
||||
* parsed data
|
||||
* PARAMETERS: aml_buffer - Pointer to the resource byte stream
|
||||
* aml_buffer_length - Size of aml_buffer
|
||||
* size_needed - Where the size needed is returned
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Takes the resource byte stream and parses it once, calculating
|
||||
* the size buffer needed to hold the linked list that conveys
|
||||
* the resource data.
|
||||
* DESCRIPTION: Takes an external resource byte stream and calculates the size
|
||||
* buffer needed to hold the corresponding internal resource
|
||||
* descriptor linked list.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
acpi_status
|
||||
acpi_rs_get_list_length(u8 * byte_stream_buffer,
|
||||
u32 byte_stream_buffer_length, acpi_size * size_needed)
|
||||
acpi_rs_get_list_length(u8 * aml_buffer,
|
||||
u32 aml_buffer_length, acpi_size * size_needed)
|
||||
{
|
||||
u32 buffer_size = 0;
|
||||
u32 bytes_parsed = 0;
|
||||
u8 number_of_interrupts = 0;
|
||||
u8 number_of_channels = 0;
|
||||
u8 resource_type;
|
||||
u32 structure_size;
|
||||
u32 bytes_consumed;
|
||||
acpi_status status;
|
||||
u8 *end_aml;
|
||||
u8 *buffer;
|
||||
u8 temp8;
|
||||
u32 buffer_size = 0;
|
||||
u16 temp16;
|
||||
u8 index;
|
||||
u8 additional_bytes;
|
||||
u16 resource_length;
|
||||
u32 extra_struct_bytes;
|
||||
u8 resource_index;
|
||||
u8 minimum_aml_resource_length;
|
||||
|
||||
ACPI_FUNCTION_TRACE("rs_get_list_length");
|
||||
|
||||
while (bytes_parsed < byte_stream_buffer_length) {
|
||||
/* The next byte in the stream is the resource type */
|
||||
end_aml = aml_buffer + aml_buffer_length;
|
||||
|
||||
resource_type = acpi_rs_get_resource_type(*byte_stream_buffer);
|
||||
/* Walk the list of AML resource descriptors */
|
||||
|
||||
switch (resource_type) {
|
||||
case ACPI_RDESC_TYPE_MEMORY_24:
|
||||
while (aml_buffer < end_aml) {
|
||||
/* Validate the Resource Type and Resource Length */
|
||||
|
||||
status = acpi_ut_validate_resource(aml_buffer, &resource_index);
|
||||
if (ACPI_FAILURE(status)) {
|
||||
return_ACPI_STATUS(status);
|
||||
}
|
||||
|
||||
/* Get the resource length and base (minimum) AML size */
|
||||
|
||||
resource_length = acpi_ut_get_resource_length(aml_buffer);
|
||||
minimum_aml_resource_length =
|
||||
acpi_gbl_resource_aml_sizes[resource_index];
|
||||
|
||||
/*
|
||||
* Augment the size for descriptors with optional
|
||||
* and/or variable length fields
|
||||
*/
|
||||
extra_struct_bytes = 0;
|
||||
buffer =
|
||||
aml_buffer + acpi_ut_get_resource_header_length(aml_buffer);
|
||||
|
||||
switch (acpi_ut_get_resource_type(aml_buffer)) {
|
||||
case ACPI_RESOURCE_NAME_IRQ:
|
||||
/*
|
||||
* 24-Bit Memory Resource
|
||||
* IRQ Resource:
|
||||
* Get the number of bits set in the 16-bit IRQ mask
|
||||
*/
|
||||
bytes_consumed = 12;
|
||||
|
||||
structure_size =
|
||||
ACPI_SIZEOF_RESOURCE(struct acpi_resource_mem24);
|
||||
break;
|
||||
|
||||
case ACPI_RDESC_TYPE_LARGE_VENDOR:
|
||||
/*
|
||||
* Vendor Defined Resource
|
||||
*/
|
||||
buffer = byte_stream_buffer;
|
||||
++buffer;
|
||||
|
||||
ACPI_MOVE_16_TO_16(&temp16, buffer);
|
||||
bytes_consumed = temp16 + 3;
|
||||
|
||||
/* Ensure a 32-bit boundary for the structure */
|
||||
|
||||
temp16 = (u16) ACPI_ROUND_UP_to_32_bITS(temp16);
|
||||
|
||||
structure_size =
|
||||
ACPI_SIZEOF_RESOURCE(struct acpi_resource_vendor) +
|
||||
(temp16 * sizeof(u8));
|
||||
extra_struct_bytes = acpi_rs_count_set_bits(temp16);
|
||||
break;
|
||||
|
||||
case ACPI_RDESC_TYPE_MEMORY_32:
|
||||
case ACPI_RESOURCE_NAME_DMA:
|
||||
/*
|
||||
* 32-Bit Memory Range Resource
|
||||
* DMA Resource:
|
||||
* Get the number of bits set in the 8-bit DMA mask
|
||||
*/
|
||||
bytes_consumed = 20;
|
||||
|
||||
structure_size =
|
||||
ACPI_SIZEOF_RESOURCE(struct acpi_resource_mem32);
|
||||
extra_struct_bytes = acpi_rs_count_set_bits(*buffer);
|
||||
break;
|
||||
|
||||
case ACPI_RDESC_TYPE_FIXED_MEMORY_32:
|
||||
case ACPI_RESOURCE_NAME_VENDOR_SMALL:
|
||||
/*
|
||||
* 32-Bit Fixed Memory Resource
|
||||
* Vendor Resource:
|
||||
* Ensure a 32-bit boundary for the structure
|
||||
*/
|
||||
bytes_consumed = 12;
|
||||
|
||||
structure_size =
|
||||
ACPI_SIZEOF_RESOURCE(struct
|
||||
acpi_resource_fixed_mem32);
|
||||
extra_struct_bytes =
|
||||
ACPI_ROUND_UP_to_32_bITS(resource_length) -
|
||||
resource_length;
|
||||
break;
|
||||
|
||||
case ACPI_RDESC_TYPE_EXTENDED_ADDRESS_SPACE:
|
||||
case ACPI_RESOURCE_NAME_END_TAG:
|
||||
/*
|
||||
* 64-Bit Address Resource
|
||||
* End Tag: This is the normal exit, add size of end_tag
|
||||
*/
|
||||
buffer = byte_stream_buffer;
|
||||
*size_needed = buffer_size + ACPI_RS_SIZE_MIN;
|
||||
return_ACPI_STATUS(AE_OK);
|
||||
|
||||
++buffer;
|
||||
ACPI_MOVE_16_TO_16(&temp16, buffer);
|
||||
|
||||
bytes_consumed = temp16 + 3;
|
||||
structure_size =
|
||||
ACPI_SIZEOF_RESOURCE(struct
|
||||
acpi_resource_address64);
|
||||
case ACPI_RESOURCE_NAME_VENDOR_LARGE:
|
||||
/*
|
||||
* Vendor Resource:
|
||||
* Add vendor data and ensure a 32-bit boundary for the structure
|
||||
*/
|
||||
extra_struct_bytes =
|
||||
ACPI_ROUND_UP_to_32_bITS(resource_length) -
|
||||
resource_length;
|
||||
break;
|
||||
|
||||
case ACPI_RDESC_TYPE_QWORD_ADDRESS_SPACE:
|
||||
case ACPI_RESOURCE_NAME_ADDRESS32:
|
||||
case ACPI_RESOURCE_NAME_ADDRESS16:
|
||||
/*
|
||||
* 64-Bit Address Resource
|
||||
* 32-Bit or 16-bit Address Resource:
|
||||
* Add the size of any optional data (resource_source)
|
||||
*/
|
||||
buffer = byte_stream_buffer;
|
||||
|
||||
++buffer;
|
||||
ACPI_MOVE_16_TO_16(&temp16, buffer);
|
||||
|
||||
bytes_consumed = temp16 + 3;
|
||||
|
||||
/*
|
||||
* Resource Source Index and Resource Source are optional elements.
|
||||
* Check the length of the Bytestream. If it is greater than 43,
|
||||
* that means that an Index exists and is followed by a null
|
||||
* terminated string. Therefore, set the temp variable to the
|
||||
* length minus the minimum byte stream length plus the byte for
|
||||
* the Index to determine the size of the NULL terminated string.
|
||||
*/
|
||||
if (43 < temp16) {
|
||||
temp8 = (u8) (temp16 - 44);
|
||||
} else {
|
||||
temp8 = 0;
|
||||
}
|
||||
|
||||
/* Ensure a 64-bit boundary for the structure */
|
||||
|
||||
temp8 = (u8) ACPI_ROUND_UP_to_64_bITS(temp8);
|
||||
|
||||
structure_size =
|
||||
ACPI_SIZEOF_RESOURCE(struct acpi_resource_address64)
|
||||
+ (temp8 * sizeof(u8));
|
||||
extra_struct_bytes =
|
||||
acpi_rs_stream_option_length(resource_length,
|
||||
minimum_aml_resource_length);
|
||||
break;
|
||||
|
||||
case ACPI_RDESC_TYPE_DWORD_ADDRESS_SPACE:
|
||||
case ACPI_RESOURCE_NAME_EXTENDED_IRQ:
|
||||
/*
|
||||
* 32-Bit Address Resource
|
||||
* Extended IRQ:
|
||||
* Point past the interrupt_vector_flags to get the
|
||||
* interrupt_table_length.
|
||||
*/
|
||||
buffer = byte_stream_buffer;
|
||||
buffer++;
|
||||
|
||||
++buffer;
|
||||
ACPI_MOVE_16_TO_16(&temp16, buffer);
|
||||
|
||||
bytes_consumed = temp16 + 3;
|
||||
|
||||
/*
|
||||
* Resource Source Index and Resource Source are optional elements.
|
||||
* Check the length of the Bytestream. If it is greater than 23,
|
||||
* that means that an Index exists and is followed by a null
|
||||
* terminated string. Therefore, set the temp variable to the
|
||||
* length minus the minimum byte stream length plus the byte for
|
||||
* the Index to determine the size of the NULL terminated string.
|
||||
*/
|
||||
if (23 < temp16) {
|
||||
temp8 = (u8) (temp16 - 24);
|
||||
} else {
|
||||
temp8 = 0;
|
||||
}
|
||||
|
||||
/* Ensure a 32-bit boundary for the structure */
|
||||
|
||||
temp8 = (u8) ACPI_ROUND_UP_to_32_bITS(temp8);
|
||||
|
||||
structure_size =
|
||||
ACPI_SIZEOF_RESOURCE(struct acpi_resource_address32)
|
||||
+ (temp8 * sizeof(u8));
|
||||
extra_struct_bytes =
|
||||
/*
|
||||
* Add 4 bytes for each additional interrupt. Note: at
|
||||
* least one interrupt is required and is included in
|
||||
* the minimum descriptor size
|
||||
*/
|
||||
((*buffer - 1) * sizeof(u32)) +
|
||||
/* Add the size of any optional data (resource_source) */
|
||||
acpi_rs_stream_option_length(resource_length -
|
||||
extra_struct_bytes,
|
||||
minimum_aml_resource_length);
|
||||
break;
|
||||
|
||||
case ACPI_RDESC_TYPE_WORD_ADDRESS_SPACE:
|
||||
case ACPI_RESOURCE_NAME_ADDRESS64:
|
||||
/*
|
||||
* 16-Bit Address Resource
|
||||
* 64-Bit Address Resource:
|
||||
* Add the size of any optional data (resource_source)
|
||||
* Ensure a 64-bit boundary for the structure
|
||||
*/
|
||||
buffer = byte_stream_buffer;
|
||||
|
||||
++buffer;
|
||||
ACPI_MOVE_16_TO_16(&temp16, buffer);
|
||||
|
||||
bytes_consumed = temp16 + 3;
|
||||
|
||||
/*
|
||||
* Resource Source Index and Resource Source are optional elements.
|
||||
* Check the length of the Bytestream. If it is greater than 13,
|
||||
* that means that an Index exists and is followed by a null
|
||||
* terminated string. Therefore, set the temp variable to the
|
||||
* length minus the minimum byte stream length plus the byte for
|
||||
* the Index to determine the size of the NULL terminated string.
|
||||
*/
|
||||
if (13 < temp16) {
|
||||
temp8 = (u8) (temp16 - 14);
|
||||
} else {
|
||||
temp8 = 0;
|
||||
}
|
||||
|
||||
/* Ensure a 32-bit boundary for the structure */
|
||||
|
||||
temp8 = (u8) ACPI_ROUND_UP_to_32_bITS(temp8);
|
||||
|
||||
structure_size =
|
||||
ACPI_SIZEOF_RESOURCE(struct acpi_resource_address16)
|
||||
+ (temp8 * sizeof(u8));
|
||||
break;
|
||||
|
||||
case ACPI_RDESC_TYPE_EXTENDED_XRUPT:
|
||||
/*
|
||||
* Extended IRQ
|
||||
*/
|
||||
buffer = byte_stream_buffer;
|
||||
|
||||
++buffer;
|
||||
ACPI_MOVE_16_TO_16(&temp16, buffer);
|
||||
|
||||
bytes_consumed = temp16 + 3;
|
||||
|
||||
/*
|
||||
* Point past the length field and the Interrupt vector flags to
|
||||
* save off the Interrupt table length to the Temp8 variable.
|
||||
*/
|
||||
buffer += 3;
|
||||
temp8 = *buffer;
|
||||
|
||||
/*
|
||||
* To compensate for multiple interrupt numbers, add 4 bytes for
|
||||
* each additional interrupts greater than 1
|
||||
*/
|
||||
additional_bytes = (u8) ((temp8 - 1) * 4);
|
||||
|
||||
/*
|
||||
* Resource Source Index and Resource Source are optional elements.
|
||||
* Check the length of the Bytestream. If it is greater than 9,
|
||||
* that means that an Index exists and is followed by a null
|
||||
* terminated string. Therefore, set the temp variable to the
|
||||
* length minus the minimum byte stream length plus the byte for
|
||||
* the Index to determine the size of the NULL terminated string.
|
||||
*/
|
||||
if (9 + additional_bytes < temp16) {
|
||||
temp8 = (u8) (temp16 - (9 + additional_bytes));
|
||||
} else {
|
||||
temp8 = 0;
|
||||
}
|
||||
|
||||
/* Ensure a 32-bit boundary for the structure */
|
||||
|
||||
temp8 = (u8) ACPI_ROUND_UP_to_32_bITS(temp8);
|
||||
|
||||
structure_size =
|
||||
ACPI_SIZEOF_RESOURCE(struct acpi_resource_ext_irq) +
|
||||
(additional_bytes * sizeof(u8)) +
|
||||
(temp8 * sizeof(u8));
|
||||
break;
|
||||
|
||||
case ACPI_RDESC_TYPE_IRQ_FORMAT:
|
||||
/*
|
||||
* IRQ Resource.
|
||||
* Determine if it there are two or three trailing bytes
|
||||
*/
|
||||
buffer = byte_stream_buffer;
|
||||
temp8 = *buffer;
|
||||
|
||||
if (temp8 & 0x01) {
|
||||
bytes_consumed = 4;
|
||||
} else {
|
||||
bytes_consumed = 3;
|
||||
}
|
||||
|
||||
/* Point past the descriptor */
|
||||
|
||||
++buffer;
|
||||
|
||||
/* Look at the number of bits set */
|
||||
|
||||
ACPI_MOVE_16_TO_16(&temp16, buffer);
|
||||
|
||||
for (index = 0; index < 16; index++) {
|
||||
if (temp16 & 0x1) {
|
||||
++number_of_interrupts;
|
||||
}
|
||||
|
||||
temp16 >>= 1;
|
||||
}
|
||||
|
||||
structure_size =
|
||||
ACPI_SIZEOF_RESOURCE(struct acpi_resource_io) +
|
||||
(number_of_interrupts * sizeof(u32));
|
||||
break;
|
||||
|
||||
case ACPI_RDESC_TYPE_DMA_FORMAT:
|
||||
/*
|
||||
* DMA Resource
|
||||
*/
|
||||
buffer = byte_stream_buffer;
|
||||
bytes_consumed = 3;
|
||||
|
||||
/* Point past the descriptor */
|
||||
|
||||
++buffer;
|
||||
|
||||
/* Look at the number of bits set */
|
||||
|
||||
temp8 = *buffer;
|
||||
|
||||
for (index = 0; index < 8; index++) {
|
||||
if (temp8 & 0x1) {
|
||||
++number_of_channels;
|
||||
}
|
||||
|
||||
temp8 >>= 1;
|
||||
}
|
||||
|
||||
structure_size =
|
||||
ACPI_SIZEOF_RESOURCE(struct acpi_resource_dma) +
|
||||
(number_of_channels * sizeof(u32));
|
||||
break;
|
||||
|
||||
case ACPI_RDESC_TYPE_START_DEPENDENT:
|
||||
/*
|
||||
* Start Dependent Functions Resource
|
||||
* Determine if it there are two or three trailing bytes
|
||||
*/
|
||||
buffer = byte_stream_buffer;
|
||||
temp8 = *buffer;
|
||||
|
||||
if (temp8 & 0x01) {
|
||||
bytes_consumed = 2;
|
||||
} else {
|
||||
bytes_consumed = 1;
|
||||
}
|
||||
|
||||
structure_size =
|
||||
ACPI_SIZEOF_RESOURCE(struct
|
||||
acpi_resource_start_dpf);
|
||||
break;
|
||||
|
||||
case ACPI_RDESC_TYPE_END_DEPENDENT:
|
||||
/*
|
||||
* End Dependent Functions Resource
|
||||
*/
|
||||
bytes_consumed = 1;
|
||||
structure_size = ACPI_RESOURCE_LENGTH;
|
||||
break;
|
||||
|
||||
case ACPI_RDESC_TYPE_IO_PORT:
|
||||
/*
|
||||
* IO Port Resource
|
||||
*/
|
||||
bytes_consumed = 8;
|
||||
structure_size =
|
||||
ACPI_SIZEOF_RESOURCE(struct acpi_resource_io);
|
||||
break;
|
||||
|
||||
case ACPI_RDESC_TYPE_FIXED_IO_PORT:
|
||||
/*
|
||||
* Fixed IO Port Resource
|
||||
*/
|
||||
bytes_consumed = 4;
|
||||
structure_size =
|
||||
ACPI_SIZEOF_RESOURCE(struct acpi_resource_fixed_io);
|
||||
break;
|
||||
|
||||
case ACPI_RDESC_TYPE_SMALL_VENDOR:
|
||||
/*
|
||||
* Vendor Specific Resource
|
||||
*/
|
||||
buffer = byte_stream_buffer;
|
||||
|
||||
temp8 = *buffer;
|
||||
temp8 = (u8) (temp8 & 0x7);
|
||||
bytes_consumed = temp8 + 1;
|
||||
|
||||
/* Ensure a 32-bit boundary for the structure */
|
||||
|
||||
temp8 = (u8) ACPI_ROUND_UP_to_32_bITS(temp8);
|
||||
structure_size =
|
||||
ACPI_SIZEOF_RESOURCE(struct acpi_resource_vendor) +
|
||||
(temp8 * sizeof(u8));
|
||||
break;
|
||||
|
||||
case ACPI_RDESC_TYPE_END_TAG:
|
||||
/*
|
||||
* End Tag
|
||||
*/
|
||||
bytes_consumed = 2;
|
||||
structure_size = ACPI_RESOURCE_LENGTH;
|
||||
byte_stream_buffer_length = bytes_parsed;
|
||||
extra_struct_bytes =
|
||||
ACPI_ROUND_UP_to_64_bITS
|
||||
(acpi_rs_stream_option_length
|
||||
(resource_length, minimum_aml_resource_length));
|
||||
break;
|
||||
|
||||
default:
|
||||
/*
|
||||
* If we get here, everything is out of sync,
|
||||
* exit with an error
|
||||
*/
|
||||
return_ACPI_STATUS(AE_AML_INVALID_RESOURCE_TYPE);
|
||||
break;
|
||||
}
|
||||
|
||||
/* Update the return value and counter */
|
||||
/* Update the required buffer size for the internal descriptor structs */
|
||||
|
||||
buffer_size += (u32) ACPI_ALIGN_RESOURCE_SIZE(structure_size);
|
||||
bytes_parsed += bytes_consumed;
|
||||
temp16 = (u16) (acpi_gbl_resource_struct_sizes[resource_index] +
|
||||
extra_struct_bytes);
|
||||
buffer_size += (u32) ACPI_ROUND_UP_TO_NATIVE_WORD(temp16);
|
||||
|
||||
/* Set the byte stream to point to the next resource */
|
||||
|
||||
byte_stream_buffer += bytes_consumed;
|
||||
/*
|
||||
* Point to the next resource within the stream
|
||||
* using the size of the header plus the length contained in the header
|
||||
*/
|
||||
aml_buffer += acpi_ut_get_descriptor_length(aml_buffer);
|
||||
}
|
||||
|
||||
/* This is the data the caller needs */
|
||||
/* Did not find an end_tag resource descriptor */
|
||||
|
||||
*size_needed = buffer_size;
|
||||
return_ACPI_STATUS(AE_OK);
|
||||
return_ACPI_STATUS(AE_AML_NO_RESOURCE_END_TAG);
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
******************************************************************************/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2000 - 2005, R. Byron Moore
|
||||
* Copyright (C) 2000 - 2006, R. Byron Moore
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
|
@ -53,10 +53,10 @@ ACPI_MODULE_NAME("rscreate")
|
|||
*
|
||||
* FUNCTION: acpi_rs_create_resource_list
|
||||
*
|
||||
* PARAMETERS: byte_stream_buffer - Pointer to the resource byte stream
|
||||
* output_buffer - Pointer to the user's buffer
|
||||
* PARAMETERS: aml_buffer - Pointer to the resource byte stream
|
||||
* output_buffer - Pointer to the user's buffer
|
||||
*
|
||||
* RETURN: Status - AE_OK if okay, else a valid acpi_status code
|
||||
* RETURN: Status: AE_OK if okay, else a valid acpi_status code
|
||||
* If output_buffer is not large enough, output_buffer_length
|
||||
* indicates how large output_buffer should be, else it
|
||||
* indicates how may u8 elements of output_buffer are valid.
|
||||
|
|
@ -67,33 +67,30 @@ ACPI_MODULE_NAME("rscreate")
|
|||
*
|
||||
******************************************************************************/
|
||||
acpi_status
|
||||
acpi_rs_create_resource_list(union acpi_operand_object *byte_stream_buffer,
|
||||
acpi_rs_create_resource_list(union acpi_operand_object *aml_buffer,
|
||||
struct acpi_buffer *output_buffer)
|
||||
{
|
||||
|
||||
acpi_status status;
|
||||
u8 *byte_stream_start;
|
||||
u8 *aml_start;
|
||||
acpi_size list_size_needed = 0;
|
||||
u32 byte_stream_buffer_length;
|
||||
u32 aml_buffer_length;
|
||||
|
||||
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, "aml_buffer = %p\n", aml_buffer));
|
||||
|
||||
/* Params already validated, so we don't re-validate here */
|
||||
|
||||
byte_stream_buffer_length = byte_stream_buffer->buffer.length;
|
||||
byte_stream_start = byte_stream_buffer->buffer.pointer;
|
||||
aml_buffer_length = aml_buffer->buffer.length;
|
||||
aml_start = aml_buffer->buffer.pointer;
|
||||
|
||||
/*
|
||||
* Pass the byte_stream_buffer into a module that can calculate
|
||||
* Pass the aml_buffer into a module that can calculate
|
||||
* the buffer size needed for the linked list
|
||||
*/
|
||||
status =
|
||||
acpi_rs_get_list_length(byte_stream_start,
|
||||
byte_stream_buffer_length,
|
||||
&list_size_needed);
|
||||
status = acpi_rs_get_list_length(aml_start, aml_buffer_length,
|
||||
&list_size_needed);
|
||||
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Status=%X list_size_needed=%X\n",
|
||||
status, (u32) list_size_needed));
|
||||
|
|
@ -110,10 +107,8 @@ acpi_rs_create_resource_list(union acpi_operand_object *byte_stream_buffer,
|
|||
|
||||
/* Do the conversion */
|
||||
|
||||
status =
|
||||
acpi_rs_byte_stream_to_list(byte_stream_start,
|
||||
byte_stream_buffer_length,
|
||||
output_buffer->pointer);
|
||||
status = acpi_rs_convert_aml_to_resources(aml_start, aml_buffer_length,
|
||||
output_buffer->pointer);
|
||||
if (ACPI_FAILURE(status)) {
|
||||
return_ACPI_STATUS(status);
|
||||
}
|
||||
|
|
@ -212,21 +207,14 @@ acpi_rs_create_pci_routing_table(union acpi_operand_object *package_object,
|
|||
/* Each element of the top-level package must also be a package */
|
||||
|
||||
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)));
|
||||
ACPI_REPORT_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));
|
||||
ACPI_REPORT_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);
|
||||
}
|
||||
|
||||
|
|
@ -243,11 +231,7 @@ acpi_rs_create_pci_routing_table(union acpi_operand_object *package_object,
|
|||
if (ACPI_GET_OBJECT_TYPE(obj_desc) == ACPI_TYPE_INTEGER) {
|
||||
user_prt->address = obj_desc->integer.value;
|
||||
} else {
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
||||
"(PRT[%X].Address) Need Integer, found %s\n",
|
||||
index,
|
||||
acpi_ut_get_object_type_name
|
||||
(obj_desc)));
|
||||
ACPI_REPORT_ERROR(("(PRT[%X].Address) Need Integer, found %s\n", index, acpi_ut_get_object_type_name(obj_desc)));
|
||||
return_ACPI_STATUS(AE_BAD_DATA);
|
||||
}
|
||||
|
||||
|
|
@ -257,11 +241,7 @@ acpi_rs_create_pci_routing_table(union acpi_operand_object *package_object,
|
|||
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,
|
||||
"(PRT[%X].Pin) Need Integer, found %s\n",
|
||||
index,
|
||||
acpi_ut_get_object_type_name
|
||||
(obj_desc)));
|
||||
ACPI_REPORT_ERROR(("(PRT[%X].Pin) Need Integer, found %s\n", index, acpi_ut_get_object_type_name(obj_desc)));
|
||||
return_ACPI_STATUS(AE_BAD_DATA);
|
||||
}
|
||||
|
||||
|
|
@ -272,10 +252,7 @@ acpi_rs_create_pci_routing_table(union acpi_operand_object *package_object,
|
|||
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));
|
||||
ACPI_REPORT_ERROR(("(PRT[%X].Source) Need name, found reference op %X\n", index, obj_desc->reference.opcode));
|
||||
return_ACPI_STATUS(AE_BAD_DATA);
|
||||
}
|
||||
|
||||
|
|
@ -321,11 +298,7 @@ acpi_rs_create_pci_routing_table(union acpi_operand_object *package_object,
|
|||
|
||||
default:
|
||||
|
||||
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)));
|
||||
ACPI_REPORT_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);
|
||||
}
|
||||
|
||||
|
|
@ -340,11 +313,7 @@ acpi_rs_create_pci_routing_table(union acpi_operand_object *package_object,
|
|||
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,
|
||||
"(PRT[%X].source_index) Need Integer, found %s\n",
|
||||
index,
|
||||
acpi_ut_get_object_type_name
|
||||
(obj_desc)));
|
||||
ACPI_REPORT_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);
|
||||
}
|
||||
|
||||
|
|
@ -360,7 +329,7 @@ acpi_rs_create_pci_routing_table(union acpi_operand_object *package_object,
|
|||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: acpi_rs_create_byte_stream
|
||||
* FUNCTION: acpi_rs_create_aml_resources
|
||||
*
|
||||
* PARAMETERS: linked_list_buffer - Pointer to the resource linked list
|
||||
* output_buffer - Pointer to the user's buffer
|
||||
|
|
@ -377,13 +346,13 @@ acpi_rs_create_pci_routing_table(union acpi_operand_object *package_object,
|
|||
******************************************************************************/
|
||||
|
||||
acpi_status
|
||||
acpi_rs_create_byte_stream(struct acpi_resource *linked_list_buffer,
|
||||
struct acpi_buffer *output_buffer)
|
||||
acpi_rs_create_aml_resources(struct acpi_resource *linked_list_buffer,
|
||||
struct acpi_buffer *output_buffer)
|
||||
{
|
||||
acpi_status status;
|
||||
acpi_size byte_stream_size_needed = 0;
|
||||
acpi_size aml_size_needed = 0;
|
||||
|
||||
ACPI_FUNCTION_TRACE("rs_create_byte_stream");
|
||||
ACPI_FUNCTION_TRACE("rs_create_aml_resources");
|
||||
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_INFO, "linked_list_buffer = %p\n",
|
||||
linked_list_buffer));
|
||||
|
|
@ -394,11 +363,10 @@ acpi_rs_create_byte_stream(struct acpi_resource *linked_list_buffer,
|
|||
* Pass the linked_list_buffer into a module that calculates
|
||||
* the buffer size needed for the byte stream.
|
||||
*/
|
||||
status = acpi_rs_get_byte_stream_length(linked_list_buffer,
|
||||
&byte_stream_size_needed);
|
||||
status = acpi_rs_get_aml_length(linked_list_buffer, &aml_size_needed);
|
||||
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_INFO, "byte_stream_size_needed=%X, %s\n",
|
||||
(u32) byte_stream_size_needed,
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_INFO, "aml_size_needed=%X, %s\n",
|
||||
(u32) aml_size_needed,
|
||||
acpi_format_exception(status)));
|
||||
if (ACPI_FAILURE(status)) {
|
||||
return_ACPI_STATUS(status);
|
||||
|
|
@ -406,8 +374,7 @@ acpi_rs_create_byte_stream(struct acpi_resource *linked_list_buffer,
|
|||
|
||||
/* Validate/Allocate/Clear caller buffer */
|
||||
|
||||
status =
|
||||
acpi_ut_initialize_buffer(output_buffer, byte_stream_size_needed);
|
||||
status = acpi_ut_initialize_buffer(output_buffer, aml_size_needed);
|
||||
if (ACPI_FAILURE(status)) {
|
||||
return_ACPI_STATUS(status);
|
||||
}
|
||||
|
|
@ -415,9 +382,9 @@ acpi_rs_create_byte_stream(struct acpi_resource *linked_list_buffer,
|
|||
/* Do the conversion */
|
||||
|
||||
status =
|
||||
acpi_rs_list_to_byte_stream(linked_list_buffer,
|
||||
byte_stream_size_needed,
|
||||
output_buffer->pointer);
|
||||
acpi_rs_convert_resources_to_aml(linked_list_buffer,
|
||||
aml_size_needed,
|
||||
output_buffer->pointer);
|
||||
if (ACPI_FAILURE(status)) {
|
||||
return_ACPI_STATUS(status);
|
||||
}
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
204
drivers/acpi/resources/rsinfo.c
Normal file
204
drivers/acpi/resources/rsinfo.c
Normal file
|
|
@ -0,0 +1,204 @@
|
|||
/*******************************************************************************
|
||||
*
|
||||
* Module Name: rsinfo - Dispatch and Info tables
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2000 - 2006, R. Byron Moore
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions, and the following disclaimer,
|
||||
* without modification.
|
||||
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
|
||||
* substantially similar to the "NO WARRANTY" disclaimer below
|
||||
* ("Disclaimer") and any redistribution must be conditioned upon
|
||||
* including a substantially similar Disclaimer requirement for further
|
||||
* binary redistribution.
|
||||
* 3. Neither the names of the above-listed copyright holders nor the names
|
||||
* of any contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* Alternatively, this software may be distributed under the terms of the
|
||||
* GNU General Public License ("GPL") version 2 as published by the Free
|
||||
* Software Foundation.
|
||||
*
|
||||
* NO WARRANTY
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
|
||||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
* HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
||||
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGES.
|
||||
*/
|
||||
|
||||
#include <acpi/acpi.h>
|
||||
#include <acpi/acresrc.h>
|
||||
|
||||
#define _COMPONENT ACPI_RESOURCES
|
||||
ACPI_MODULE_NAME("rsinfo")
|
||||
|
||||
/*
|
||||
* Resource dispatch and information tables. Any new resource types (either
|
||||
* Large or Small) must be reflected in each of these tables, so they are here
|
||||
* in one place.
|
||||
*
|
||||
* The tables for Large descriptors are indexed by bits 6:0 of the AML
|
||||
* descriptor type byte. The tables for Small descriptors are indexed by
|
||||
* bits 6:3 of the descriptor byte. The tables for internal resource
|
||||
* descriptors are indexed by the acpi_resource_type field.
|
||||
*/
|
||||
/* Dispatch table for resource-to-AML (Set Resource) conversion functions */
|
||||
struct acpi_rsconvert_info *acpi_gbl_set_resource_dispatch[] = {
|
||||
acpi_rs_set_irq, /* 0x00, ACPI_RESOURCE_TYPE_IRQ */
|
||||
acpi_rs_convert_dma, /* 0x01, ACPI_RESOURCE_TYPE_DMA */
|
||||
acpi_rs_set_start_dpf, /* 0x02, ACPI_RESOURCE_TYPE_START_DEPENDENT */
|
||||
acpi_rs_convert_end_dpf, /* 0x03, ACPI_RESOURCE_TYPE_END_DEPENDENT */
|
||||
acpi_rs_convert_io, /* 0x04, ACPI_RESOURCE_TYPE_IO */
|
||||
acpi_rs_convert_fixed_io, /* 0x05, ACPI_RESOURCE_TYPE_FIXED_IO */
|
||||
acpi_rs_set_vendor, /* 0x06, ACPI_RESOURCE_TYPE_VENDOR */
|
||||
acpi_rs_convert_end_tag, /* 0x07, ACPI_RESOURCE_TYPE_END_TAG */
|
||||
acpi_rs_convert_memory24, /* 0x08, ACPI_RESOURCE_TYPE_MEMORY24 */
|
||||
acpi_rs_convert_memory32, /* 0x09, ACPI_RESOURCE_TYPE_MEMORY32 */
|
||||
acpi_rs_convert_fixed_memory32, /* 0x0A, ACPI_RESOURCE_TYPE_FIXED_MEMORY32 */
|
||||
acpi_rs_convert_address16, /* 0x0B, ACPI_RESOURCE_TYPE_ADDRESS16 */
|
||||
acpi_rs_convert_address32, /* 0x0C, ACPI_RESOURCE_TYPE_ADDRESS32 */
|
||||
acpi_rs_convert_address64, /* 0x0D, ACPI_RESOURCE_TYPE_ADDRESS64 */
|
||||
acpi_rs_convert_ext_address64, /* 0x0E, ACPI_RESOURCE_TYPE_EXTENDED_ADDRESS64 */
|
||||
acpi_rs_convert_ext_irq, /* 0x0F, ACPI_RESOURCE_TYPE_EXTENDED_IRQ */
|
||||
acpi_rs_convert_generic_reg /* 0x10, ACPI_RESOURCE_TYPE_GENERIC_REGISTER */
|
||||
};
|
||||
|
||||
/* Dispatch tables for AML-to-resource (Get Resource) conversion functions */
|
||||
|
||||
struct acpi_rsconvert_info *acpi_gbl_get_resource_dispatch[] = {
|
||||
/* Small descriptors */
|
||||
|
||||
NULL, /* 0x00, Reserved */
|
||||
NULL, /* 0x01, Reserved */
|
||||
NULL, /* 0x02, Reserved */
|
||||
NULL, /* 0x03, Reserved */
|
||||
acpi_rs_get_irq, /* 0x04, ACPI_RESOURCE_NAME_IRQ */
|
||||
acpi_rs_convert_dma, /* 0x05, ACPI_RESOURCE_NAME_DMA */
|
||||
acpi_rs_get_start_dpf, /* 0x06, ACPI_RESOURCE_NAME_START_DEPENDENT */
|
||||
acpi_rs_convert_end_dpf, /* 0x07, ACPI_RESOURCE_NAME_END_DEPENDENT */
|
||||
acpi_rs_convert_io, /* 0x08, ACPI_RESOURCE_NAME_IO */
|
||||
acpi_rs_convert_fixed_io, /* 0x09, ACPI_RESOURCE_NAME_FIXED_IO */
|
||||
NULL, /* 0x0A, Reserved */
|
||||
NULL, /* 0x0B, Reserved */
|
||||
NULL, /* 0x0C, Reserved */
|
||||
NULL, /* 0x0D, Reserved */
|
||||
acpi_rs_get_vendor_small, /* 0x0E, ACPI_RESOURCE_NAME_VENDOR_SMALL */
|
||||
acpi_rs_convert_end_tag, /* 0x0F, ACPI_RESOURCE_NAME_END_TAG */
|
||||
|
||||
/* Large descriptors */
|
||||
|
||||
NULL, /* 0x00, Reserved */
|
||||
acpi_rs_convert_memory24, /* 0x01, ACPI_RESOURCE_NAME_MEMORY24 */
|
||||
acpi_rs_convert_generic_reg, /* 0x02, ACPI_RESOURCE_NAME_GENERIC_REGISTER */
|
||||
NULL, /* 0x03, Reserved */
|
||||
acpi_rs_get_vendor_large, /* 0x04, ACPI_RESOURCE_NAME_VENDOR_LARGE */
|
||||
acpi_rs_convert_memory32, /* 0x05, ACPI_RESOURCE_NAME_MEMORY32 */
|
||||
acpi_rs_convert_fixed_memory32, /* 0x06, ACPI_RESOURCE_NAME_FIXED_MEMORY32 */
|
||||
acpi_rs_convert_address32, /* 0x07, ACPI_RESOURCE_NAME_ADDRESS32 */
|
||||
acpi_rs_convert_address16, /* 0x08, ACPI_RESOURCE_NAME_ADDRESS16 */
|
||||
acpi_rs_convert_ext_irq, /* 0x09, ACPI_RESOURCE_NAME_EXTENDED_IRQ */
|
||||
acpi_rs_convert_address64, /* 0x0A, ACPI_RESOURCE_NAME_ADDRESS64 */
|
||||
acpi_rs_convert_ext_address64 /* 0x0B, ACPI_RESOURCE_NAME_EXTENDED_ADDRESS64 */
|
||||
};
|
||||
|
||||
#ifdef ACPI_FUTURE_USAGE
|
||||
#if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER)
|
||||
|
||||
/* Dispatch table for resource dump functions */
|
||||
|
||||
struct acpi_rsdump_info *acpi_gbl_dump_resource_dispatch[] = {
|
||||
acpi_rs_dump_irq, /* ACPI_RESOURCE_TYPE_IRQ */
|
||||
acpi_rs_dump_dma, /* ACPI_RESOURCE_TYPE_DMA */
|
||||
acpi_rs_dump_start_dpf, /* ACPI_RESOURCE_TYPE_START_DEPENDENT */
|
||||
acpi_rs_dump_end_dpf, /* ACPI_RESOURCE_TYPE_END_DEPENDENT */
|
||||
acpi_rs_dump_io, /* ACPI_RESOURCE_TYPE_IO */
|
||||
acpi_rs_dump_fixed_io, /* ACPI_RESOURCE_TYPE_FIXED_IO */
|
||||
acpi_rs_dump_vendor, /* ACPI_RESOURCE_TYPE_VENDOR */
|
||||
acpi_rs_dump_end_tag, /* ACPI_RESOURCE_TYPE_END_TAG */
|
||||
acpi_rs_dump_memory24, /* ACPI_RESOURCE_TYPE_MEMORY24 */
|
||||
acpi_rs_dump_memory32, /* ACPI_RESOURCE_TYPE_MEMORY32 */
|
||||
acpi_rs_dump_fixed_memory32, /* ACPI_RESOURCE_TYPE_FIXED_MEMORY32 */
|
||||
acpi_rs_dump_address16, /* ACPI_RESOURCE_TYPE_ADDRESS16 */
|
||||
acpi_rs_dump_address32, /* ACPI_RESOURCE_TYPE_ADDRESS32 */
|
||||
acpi_rs_dump_address64, /* ACPI_RESOURCE_TYPE_ADDRESS64 */
|
||||
acpi_rs_dump_ext_address64, /* ACPI_RESOURCE_TYPE_EXTENDED_ADDRESS64 */
|
||||
acpi_rs_dump_ext_irq, /* ACPI_RESOURCE_TYPE_EXTENDED_IRQ */
|
||||
acpi_rs_dump_generic_reg, /* ACPI_RESOURCE_TYPE_GENERIC_REGISTER */
|
||||
};
|
||||
#endif
|
||||
#endif /* ACPI_FUTURE_USAGE */
|
||||
/*
|
||||
* Base sizes for external AML resource descriptors, indexed by internal type.
|
||||
* Includes size of the descriptor header (1 byte for small descriptors,
|
||||
* 3 bytes for large descriptors)
|
||||
*/
|
||||
const u8 acpi_gbl_aml_resource_sizes[] = {
|
||||
sizeof(struct aml_resource_irq), /* ACPI_RESOURCE_TYPE_IRQ (optional Byte 3 always created) */
|
||||
sizeof(struct aml_resource_dma), /* ACPI_RESOURCE_TYPE_DMA */
|
||||
sizeof(struct aml_resource_start_dependent), /* ACPI_RESOURCE_TYPE_START_DEPENDENT (optional Byte 1 always created) */
|
||||
sizeof(struct aml_resource_end_dependent), /* ACPI_RESOURCE_TYPE_END_DEPENDENT */
|
||||
sizeof(struct aml_resource_io), /* ACPI_RESOURCE_TYPE_IO */
|
||||
sizeof(struct aml_resource_fixed_io), /* ACPI_RESOURCE_TYPE_FIXED_IO */
|
||||
sizeof(struct aml_resource_vendor_small), /* ACPI_RESOURCE_TYPE_VENDOR */
|
||||
sizeof(struct aml_resource_end_tag), /* ACPI_RESOURCE_TYPE_END_TAG */
|
||||
sizeof(struct aml_resource_memory24), /* ACPI_RESOURCE_TYPE_MEMORY24 */
|
||||
sizeof(struct aml_resource_memory32), /* ACPI_RESOURCE_TYPE_MEMORY32 */
|
||||
sizeof(struct aml_resource_fixed_memory32), /* ACPI_RESOURCE_TYPE_FIXED_MEMORY32 */
|
||||
sizeof(struct aml_resource_address16), /* ACPI_RESOURCE_TYPE_ADDRESS16 */
|
||||
sizeof(struct aml_resource_address32), /* ACPI_RESOURCE_TYPE_ADDRESS32 */
|
||||
sizeof(struct aml_resource_address64), /* ACPI_RESOURCE_TYPE_ADDRESS64 */
|
||||
sizeof(struct aml_resource_extended_address64), /*ACPI_RESOURCE_TYPE_EXTENDED_ADDRESS64 */
|
||||
sizeof(struct aml_resource_extended_irq), /* ACPI_RESOURCE_TYPE_EXTENDED_IRQ */
|
||||
sizeof(struct aml_resource_generic_register) /* ACPI_RESOURCE_TYPE_GENERIC_REGISTER */
|
||||
};
|
||||
|
||||
const u8 acpi_gbl_resource_struct_sizes[] = {
|
||||
/* Small descriptors */
|
||||
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
ACPI_RS_SIZE(struct acpi_resource_irq),
|
||||
ACPI_RS_SIZE(struct acpi_resource_dma),
|
||||
ACPI_RS_SIZE(struct acpi_resource_start_dependent),
|
||||
ACPI_RS_SIZE_MIN,
|
||||
ACPI_RS_SIZE(struct acpi_resource_io),
|
||||
ACPI_RS_SIZE(struct acpi_resource_fixed_io),
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
ACPI_RS_SIZE(struct acpi_resource_vendor),
|
||||
ACPI_RS_SIZE_MIN,
|
||||
|
||||
/* Large descriptors */
|
||||
|
||||
0,
|
||||
ACPI_RS_SIZE(struct acpi_resource_memory24),
|
||||
ACPI_RS_SIZE(struct acpi_resource_generic_register),
|
||||
0,
|
||||
ACPI_RS_SIZE(struct acpi_resource_vendor),
|
||||
ACPI_RS_SIZE(struct acpi_resource_memory32),
|
||||
ACPI_RS_SIZE(struct acpi_resource_fixed_memory32),
|
||||
ACPI_RS_SIZE(struct acpi_resource_address32),
|
||||
ACPI_RS_SIZE(struct acpi_resource_address16),
|
||||
ACPI_RS_SIZE(struct acpi_resource_extended_irq),
|
||||
ACPI_RS_SIZE(struct acpi_resource_address64),
|
||||
ACPI_RS_SIZE(struct acpi_resource_extended_address64)
|
||||
};
|
||||
|
|
@ -5,7 +5,7 @@
|
|||
******************************************************************************/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2000 - 2005, R. Byron Moore
|
||||
* Copyright (C) 2000 - 2006, R. Byron Moore
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
|
@ -49,428 +49,206 @@ ACPI_MODULE_NAME("rsio")
|
|||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: acpi_rs_io_resource
|
||||
*
|
||||
* PARAMETERS: byte_stream_buffer - Pointer to the resource input byte
|
||||
* stream
|
||||
* bytes_consumed - Pointer to where the number of bytes
|
||||
* consumed the byte_stream_buffer is
|
||||
* returned
|
||||
* output_buffer - Pointer to the return data buffer
|
||||
* structure_size - Pointer to where the number of bytes
|
||||
* in the return data struct is returned
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Take the resource byte stream and fill out the appropriate
|
||||
* structure pointed to by the output_buffer. Return the
|
||||
* number of bytes consumed from the byte stream.
|
||||
* acpi_rs_convert_io
|
||||
*
|
||||
******************************************************************************/
|
||||
acpi_status
|
||||
acpi_rs_io_resource(u8 * byte_stream_buffer,
|
||||
acpi_size * bytes_consumed,
|
||||
u8 ** output_buffer, acpi_size * structure_size)
|
||||
{
|
||||
u8 *buffer = byte_stream_buffer;
|
||||
struct acpi_resource *output_struct = (void *)*output_buffer;
|
||||
u16 temp16 = 0;
|
||||
u8 temp8 = 0;
|
||||
acpi_size struct_size = ACPI_SIZEOF_RESOURCE(struct acpi_resource_io);
|
||||
struct acpi_rsconvert_info acpi_rs_convert_io[5] = {
|
||||
{ACPI_RSC_INITGET, ACPI_RESOURCE_TYPE_IO,
|
||||
ACPI_RS_SIZE(struct acpi_resource_io),
|
||||
ACPI_RSC_TABLE_SIZE(acpi_rs_convert_io)},
|
||||
|
||||
ACPI_FUNCTION_TRACE("rs_io_resource");
|
||||
{ACPI_RSC_INITSET, ACPI_RESOURCE_NAME_IO,
|
||||
sizeof(struct aml_resource_io),
|
||||
0},
|
||||
|
||||
/* The number of bytes consumed are Constant */
|
||||
/* Decode flag */
|
||||
|
||||
*bytes_consumed = 8;
|
||||
{ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.io.io_decode),
|
||||
AML_OFFSET(io.flags),
|
||||
0},
|
||||
/*
|
||||
* These fields are contiguous in both the source and destination:
|
||||
* Address Alignment
|
||||
* Length
|
||||
* Minimum Base Address
|
||||
* Maximum Base Address
|
||||
*/
|
||||
{ACPI_RSC_MOVE8, ACPI_RS_OFFSET(data.io.alignment),
|
||||
AML_OFFSET(io.alignment),
|
||||
2},
|
||||
|
||||
output_struct->id = ACPI_RSTYPE_IO;
|
||||
|
||||
/* Check Decode */
|
||||
|
||||
buffer += 1;
|
||||
temp8 = *buffer;
|
||||
|
||||
output_struct->data.io.io_decode = temp8 & 0x01;
|
||||
|
||||
/* Check min_base Address */
|
||||
|
||||
buffer += 1;
|
||||
ACPI_MOVE_16_TO_16(&temp16, buffer);
|
||||
|
||||
output_struct->data.io.min_base_address = temp16;
|
||||
|
||||
/* Check max_base Address */
|
||||
|
||||
buffer += 2;
|
||||
ACPI_MOVE_16_TO_16(&temp16, buffer);
|
||||
|
||||
output_struct->data.io.max_base_address = temp16;
|
||||
|
||||
/* Check Base alignment */
|
||||
|
||||
buffer += 2;
|
||||
temp8 = *buffer;
|
||||
|
||||
output_struct->data.io.alignment = temp8;
|
||||
|
||||
/* Check range_length */
|
||||
|
||||
buffer += 1;
|
||||
temp8 = *buffer;
|
||||
|
||||
output_struct->data.io.range_length = temp8;
|
||||
|
||||
/* Set the Length parameter */
|
||||
|
||||
output_struct->length = (u32) struct_size;
|
||||
|
||||
/* Return the final size of the structure */
|
||||
|
||||
*structure_size = struct_size;
|
||||
return_ACPI_STATUS(AE_OK);
|
||||
}
|
||||
{ACPI_RSC_MOVE16, ACPI_RS_OFFSET(data.io.minimum),
|
||||
AML_OFFSET(io.minimum),
|
||||
2}
|
||||
};
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: acpi_rs_fixed_io_resource
|
||||
*
|
||||
* PARAMETERS: byte_stream_buffer - Pointer to the resource input byte
|
||||
* stream
|
||||
* bytes_consumed - Pointer to where the number of bytes
|
||||
* consumed the byte_stream_buffer is
|
||||
* returned
|
||||
* output_buffer - Pointer to the return data buffer
|
||||
* structure_size - Pointer to where the number of bytes
|
||||
* in the return data struct is returned
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Take the resource byte stream and fill out the appropriate
|
||||
* structure pointed to by the output_buffer. Return the
|
||||
* number of bytes consumed from the byte stream.
|
||||
* acpi_rs_convert_fixed_io
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
acpi_status
|
||||
acpi_rs_fixed_io_resource(u8 * byte_stream_buffer,
|
||||
acpi_size * bytes_consumed,
|
||||
u8 ** output_buffer, acpi_size * structure_size)
|
||||
{
|
||||
u8 *buffer = byte_stream_buffer;
|
||||
struct acpi_resource *output_struct = (void *)*output_buffer;
|
||||
u16 temp16 = 0;
|
||||
u8 temp8 = 0;
|
||||
acpi_size struct_size =
|
||||
ACPI_SIZEOF_RESOURCE(struct acpi_resource_fixed_io);
|
||||
struct acpi_rsconvert_info acpi_rs_convert_fixed_io[4] = {
|
||||
{ACPI_RSC_INITGET, ACPI_RESOURCE_TYPE_FIXED_IO,
|
||||
ACPI_RS_SIZE(struct acpi_resource_fixed_io),
|
||||
ACPI_RSC_TABLE_SIZE(acpi_rs_convert_fixed_io)},
|
||||
|
||||
ACPI_FUNCTION_TRACE("rs_fixed_io_resource");
|
||||
{ACPI_RSC_INITSET, ACPI_RESOURCE_NAME_FIXED_IO,
|
||||
sizeof(struct aml_resource_fixed_io),
|
||||
0},
|
||||
/*
|
||||
* These fields are contiguous in both the source and destination:
|
||||
* Base Address
|
||||
* Length
|
||||
*/
|
||||
{ACPI_RSC_MOVE8, ACPI_RS_OFFSET(data.fixed_io.address_length),
|
||||
AML_OFFSET(fixed_io.address_length),
|
||||
1},
|
||||
|
||||
/* The number of bytes consumed are Constant */
|
||||
|
||||
*bytes_consumed = 4;
|
||||
|
||||
output_struct->id = ACPI_RSTYPE_FIXED_IO;
|
||||
|
||||
/* Check Range Base Address */
|
||||
|
||||
buffer += 1;
|
||||
ACPI_MOVE_16_TO_16(&temp16, buffer);
|
||||
|
||||
output_struct->data.fixed_io.base_address = temp16;
|
||||
|
||||
/* Check range_length */
|
||||
|
||||
buffer += 2;
|
||||
temp8 = *buffer;
|
||||
|
||||
output_struct->data.fixed_io.range_length = temp8;
|
||||
|
||||
/* Set the Length parameter */
|
||||
|
||||
output_struct->length = (u32) struct_size;
|
||||
|
||||
/* Return the final size of the structure */
|
||||
|
||||
*structure_size = struct_size;
|
||||
return_ACPI_STATUS(AE_OK);
|
||||
}
|
||||
{ACPI_RSC_MOVE16, ACPI_RS_OFFSET(data.fixed_io.address),
|
||||
AML_OFFSET(fixed_io.address),
|
||||
1}
|
||||
};
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: acpi_rs_io_stream
|
||||
*
|
||||
* PARAMETERS: linked_list - Pointer to the resource linked list
|
||||
* output_buffer - Pointer to the user's return buffer
|
||||
* bytes_consumed - Pointer to where the number of bytes
|
||||
* used in the output_buffer is returned
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Take the linked list resource structure and fills in the
|
||||
* the appropriate bytes in a byte stream
|
||||
* acpi_rs_convert_generic_reg
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
acpi_status
|
||||
acpi_rs_io_stream(struct acpi_resource *linked_list,
|
||||
u8 ** output_buffer, acpi_size * bytes_consumed)
|
||||
{
|
||||
u8 *buffer = *output_buffer;
|
||||
u16 temp16 = 0;
|
||||
u8 temp8 = 0;
|
||||
struct acpi_rsconvert_info acpi_rs_convert_generic_reg[4] = {
|
||||
{ACPI_RSC_INITGET, ACPI_RESOURCE_TYPE_GENERIC_REGISTER,
|
||||
ACPI_RS_SIZE(struct acpi_resource_generic_register),
|
||||
ACPI_RSC_TABLE_SIZE(acpi_rs_convert_generic_reg)},
|
||||
|
||||
ACPI_FUNCTION_TRACE("rs_io_stream");
|
||||
{ACPI_RSC_INITSET, ACPI_RESOURCE_NAME_GENERIC_REGISTER,
|
||||
sizeof(struct aml_resource_generic_register),
|
||||
0},
|
||||
/*
|
||||
* These fields are contiguous in both the source and destination:
|
||||
* Address Space ID
|
||||
* Register Bit Width
|
||||
* Register Bit Offset
|
||||
* Access Size
|
||||
*/
|
||||
{ACPI_RSC_MOVE8, ACPI_RS_OFFSET(data.generic_reg.space_id),
|
||||
AML_OFFSET(generic_reg.address_space_id),
|
||||
4},
|
||||
|
||||
/* The descriptor field is static */
|
||||
/* Get the Register Address */
|
||||
|
||||
*buffer = 0x47;
|
||||
buffer += 1;
|
||||
|
||||
/* Io Information Byte */
|
||||
|
||||
temp8 = (u8) (linked_list->data.io.io_decode & 0x01);
|
||||
|
||||
*buffer = temp8;
|
||||
buffer += 1;
|
||||
|
||||
/* Set the Range minimum base address */
|
||||
|
||||
temp16 = (u16) linked_list->data.io.min_base_address;
|
||||
|
||||
ACPI_MOVE_16_TO_16(buffer, &temp16);
|
||||
buffer += 2;
|
||||
|
||||
/* Set the Range maximum base address */
|
||||
|
||||
temp16 = (u16) linked_list->data.io.max_base_address;
|
||||
|
||||
ACPI_MOVE_16_TO_16(buffer, &temp16);
|
||||
buffer += 2;
|
||||
|
||||
/* Set the base alignment */
|
||||
|
||||
temp8 = (u8) linked_list->data.io.alignment;
|
||||
|
||||
*buffer = temp8;
|
||||
buffer += 1;
|
||||
|
||||
/* Set the range length */
|
||||
|
||||
temp8 = (u8) linked_list->data.io.range_length;
|
||||
|
||||
*buffer = temp8;
|
||||
buffer += 1;
|
||||
|
||||
/* Return the number of bytes consumed in this operation */
|
||||
|
||||
*bytes_consumed = ACPI_PTR_DIFF(buffer, *output_buffer);
|
||||
return_ACPI_STATUS(AE_OK);
|
||||
}
|
||||
{ACPI_RSC_MOVE64, ACPI_RS_OFFSET(data.generic_reg.address),
|
||||
AML_OFFSET(generic_reg.address),
|
||||
1}
|
||||
};
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: acpi_rs_fixed_io_stream
|
||||
*
|
||||
* PARAMETERS: linked_list - Pointer to the resource linked list
|
||||
* output_buffer - Pointer to the user's return buffer
|
||||
* bytes_consumed - Pointer to where the number of bytes
|
||||
* used in the output_buffer is returned
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Take the linked list resource structure and fills in the
|
||||
* the appropriate bytes in a byte stream
|
||||
* acpi_rs_convert_end_dpf
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
acpi_status
|
||||
acpi_rs_fixed_io_stream(struct acpi_resource *linked_list,
|
||||
u8 ** output_buffer, acpi_size * bytes_consumed)
|
||||
{
|
||||
u8 *buffer = *output_buffer;
|
||||
u16 temp16 = 0;
|
||||
u8 temp8 = 0;
|
||||
struct acpi_rsconvert_info acpi_rs_convert_end_dpf[2] = {
|
||||
{ACPI_RSC_INITGET, ACPI_RESOURCE_TYPE_END_DEPENDENT,
|
||||
ACPI_RS_SIZE_MIN,
|
||||
ACPI_RSC_TABLE_SIZE(acpi_rs_convert_end_dpf)},
|
||||
|
||||
ACPI_FUNCTION_TRACE("rs_fixed_io_stream");
|
||||
|
||||
/* The descriptor field is static */
|
||||
|
||||
*buffer = 0x4B;
|
||||
|
||||
buffer += 1;
|
||||
|
||||
/* Set the Range base address */
|
||||
|
||||
temp16 = (u16) linked_list->data.fixed_io.base_address;
|
||||
|
||||
ACPI_MOVE_16_TO_16(buffer, &temp16);
|
||||
buffer += 2;
|
||||
|
||||
/* Set the range length */
|
||||
|
||||
temp8 = (u8) linked_list->data.fixed_io.range_length;
|
||||
|
||||
*buffer = temp8;
|
||||
buffer += 1;
|
||||
|
||||
/* Return the number of bytes consumed in this operation */
|
||||
|
||||
*bytes_consumed = ACPI_PTR_DIFF(buffer, *output_buffer);
|
||||
return_ACPI_STATUS(AE_OK);
|
||||
}
|
||||
{ACPI_RSC_INITSET, ACPI_RESOURCE_NAME_END_DEPENDENT,
|
||||
sizeof(struct aml_resource_end_dependent),
|
||||
0}
|
||||
};
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: acpi_rs_dma_resource
|
||||
*
|
||||
* PARAMETERS: byte_stream_buffer - Pointer to the resource input byte
|
||||
* stream
|
||||
* bytes_consumed - Pointer to where the number of bytes
|
||||
* consumed the byte_stream_buffer is
|
||||
* returned
|
||||
* output_buffer - Pointer to the return data buffer
|
||||
* structure_size - Pointer to where the number of bytes
|
||||
* in the return data struct is returned
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Take the resource byte stream and fill out the appropriate
|
||||
* structure pointed to by the output_buffer. Return the
|
||||
* number of bytes consumed from the byte stream.
|
||||
* acpi_rs_convert_end_tag
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
acpi_status
|
||||
acpi_rs_dma_resource(u8 * byte_stream_buffer,
|
||||
acpi_size * bytes_consumed,
|
||||
u8 ** output_buffer, acpi_size * structure_size)
|
||||
{
|
||||
u8 *buffer = byte_stream_buffer;
|
||||
struct acpi_resource *output_struct = (void *)*output_buffer;
|
||||
u8 temp8 = 0;
|
||||
u8 index;
|
||||
u8 i;
|
||||
acpi_size struct_size = ACPI_SIZEOF_RESOURCE(struct acpi_resource_dma);
|
||||
struct acpi_rsconvert_info acpi_rs_convert_end_tag[2] = {
|
||||
{ACPI_RSC_INITGET, ACPI_RESOURCE_TYPE_END_TAG,
|
||||
ACPI_RS_SIZE_MIN,
|
||||
ACPI_RSC_TABLE_SIZE(acpi_rs_convert_end_tag)},
|
||||
|
||||
ACPI_FUNCTION_TRACE("rs_dma_resource");
|
||||
|
||||
/* The number of bytes consumed are Constant */
|
||||
|
||||
*bytes_consumed = 3;
|
||||
output_struct->id = ACPI_RSTYPE_DMA;
|
||||
|
||||
/* Point to the 8-bits of Byte 1 */
|
||||
|
||||
buffer += 1;
|
||||
temp8 = *buffer;
|
||||
|
||||
/* Decode the DMA channel bits */
|
||||
|
||||
for (i = 0, index = 0; index < 8; index++) {
|
||||
if ((temp8 >> index) & 0x01) {
|
||||
output_struct->data.dma.channels[i] = index;
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
/* Zero DMA channels is valid */
|
||||
|
||||
output_struct->data.dma.number_of_channels = i;
|
||||
if (i > 0) {
|
||||
/* Calculate the structure size based upon the number of interrupts */
|
||||
|
||||
struct_size += ((acpi_size) i - 1) * 4;
|
||||
}
|
||||
|
||||
/* Point to Byte 2 */
|
||||
|
||||
buffer += 1;
|
||||
temp8 = *buffer;
|
||||
|
||||
/* Check for transfer preference (Bits[1:0]) */
|
||||
|
||||
output_struct->data.dma.transfer = temp8 & 0x03;
|
||||
|
||||
if (0x03 == output_struct->data.dma.transfer) {
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
||||
"Invalid DMA.Transfer preference (3)\n"));
|
||||
return_ACPI_STATUS(AE_BAD_DATA);
|
||||
}
|
||||
|
||||
/* Get bus master preference (Bit[2]) */
|
||||
|
||||
output_struct->data.dma.bus_master = (temp8 >> 2) & 0x01;
|
||||
|
||||
/* Get channel speed support (Bits[6:5]) */
|
||||
|
||||
output_struct->data.dma.type = (temp8 >> 5) & 0x03;
|
||||
|
||||
/* Set the Length parameter */
|
||||
|
||||
output_struct->length = (u32) struct_size;
|
||||
|
||||
/* Return the final size of the structure */
|
||||
|
||||
*structure_size = struct_size;
|
||||
return_ACPI_STATUS(AE_OK);
|
||||
}
|
||||
/*
|
||||
* Note: The checksum field is set to zero, meaning that the resource
|
||||
* data is treated as if the checksum operation succeeded.
|
||||
* (ACPI Spec 1.0b Section 6.4.2.8)
|
||||
*/
|
||||
{ACPI_RSC_INITSET, ACPI_RESOURCE_NAME_END_TAG,
|
||||
sizeof(struct aml_resource_end_tag),
|
||||
0}
|
||||
};
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: acpi_rs_dma_stream
|
||||
*
|
||||
* PARAMETERS: linked_list - Pointer to the resource linked list
|
||||
* output_buffer - Pointer to the user's return buffer
|
||||
* bytes_consumed - Pointer to where the number of bytes
|
||||
* used in the output_buffer is returned
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Take the linked list resource structure and fills in the
|
||||
* the appropriate bytes in a byte stream
|
||||
* acpi_rs_get_start_dpf
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
acpi_status
|
||||
acpi_rs_dma_stream(struct acpi_resource *linked_list,
|
||||
u8 ** output_buffer, acpi_size * bytes_consumed)
|
||||
{
|
||||
u8 *buffer = *output_buffer;
|
||||
u16 temp16 = 0;
|
||||
u8 temp8 = 0;
|
||||
u8 index;
|
||||
struct acpi_rsconvert_info acpi_rs_get_start_dpf[5] = {
|
||||
{ACPI_RSC_INITGET, ACPI_RESOURCE_TYPE_START_DEPENDENT,
|
||||
ACPI_RS_SIZE(struct acpi_resource_start_dependent),
|
||||
ACPI_RSC_TABLE_SIZE(acpi_rs_get_start_dpf)},
|
||||
|
||||
ACPI_FUNCTION_TRACE("rs_dma_stream");
|
||||
/* Defaults for Compatibility and Performance priorities */
|
||||
|
||||
/* The descriptor field is static */
|
||||
{ACPI_RSC_SET8, ACPI_RS_OFFSET(data.start_dpf.compatibility_priority),
|
||||
ACPI_ACCEPTABLE_CONFIGURATION,
|
||||
2},
|
||||
|
||||
*buffer = 0x2A;
|
||||
buffer += 1;
|
||||
temp8 = 0;
|
||||
/* All done if there is no flag byte present in the descriptor */
|
||||
|
||||
/* Loop through all of the Channels and set the mask bits */
|
||||
{ACPI_RSC_EXIT_NE, ACPI_RSC_COMPARE_AML_LENGTH, 0, 1},
|
||||
|
||||
for (index = 0;
|
||||
index < linked_list->data.dma.number_of_channels; index++) {
|
||||
temp16 = (u16) linked_list->data.dma.channels[index];
|
||||
temp8 |= 0x1 << temp16;
|
||||
}
|
||||
/* Flag byte is present, get the flags */
|
||||
|
||||
*buffer = temp8;
|
||||
buffer += 1;
|
||||
{ACPI_RSC_2BITFLAG,
|
||||
ACPI_RS_OFFSET(data.start_dpf.compatibility_priority),
|
||||
AML_OFFSET(start_dpf.flags),
|
||||
0},
|
||||
|
||||
/* Set the DMA Info */
|
||||
{ACPI_RSC_2BITFLAG,
|
||||
ACPI_RS_OFFSET(data.start_dpf.performance_robustness),
|
||||
AML_OFFSET(start_dpf.flags),
|
||||
2}
|
||||
};
|
||||
|
||||
temp8 = (u8) ((linked_list->data.dma.type & 0x03) << 5);
|
||||
temp8 |= ((linked_list->data.dma.bus_master & 0x01) << 2);
|
||||
temp8 |= (linked_list->data.dma.transfer & 0x03);
|
||||
/*******************************************************************************
|
||||
*
|
||||
* acpi_rs_set_start_dpf
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
*buffer = temp8;
|
||||
buffer += 1;
|
||||
struct acpi_rsconvert_info acpi_rs_set_start_dpf[6] = {
|
||||
{ACPI_RSC_INITSET, ACPI_RESOURCE_NAME_START_DEPENDENT,
|
||||
sizeof(struct aml_resource_start_dependent),
|
||||
ACPI_RSC_TABLE_SIZE(acpi_rs_set_start_dpf)},
|
||||
|
||||
/* Return the number of bytes consumed in this operation */
|
||||
/* Set the default flag values */
|
||||
|
||||
*bytes_consumed = ACPI_PTR_DIFF(buffer, *output_buffer);
|
||||
return_ACPI_STATUS(AE_OK);
|
||||
}
|
||||
{ACPI_RSC_2BITFLAG,
|
||||
ACPI_RS_OFFSET(data.start_dpf.compatibility_priority),
|
||||
AML_OFFSET(start_dpf.flags),
|
||||
0},
|
||||
|
||||
{ACPI_RSC_2BITFLAG,
|
||||
ACPI_RS_OFFSET(data.start_dpf.performance_robustness),
|
||||
AML_OFFSET(start_dpf.flags),
|
||||
2},
|
||||
/*
|
||||
* All done if flags byte is necessary -- if either priority value
|
||||
* is not ACPI_ACCEPTABLE_CONFIGURATION
|
||||
*/
|
||||
{ACPI_RSC_EXIT_NE, ACPI_RSC_COMPARE_VALUE,
|
||||
ACPI_RS_OFFSET(data.start_dpf.compatibility_priority),
|
||||
ACPI_ACCEPTABLE_CONFIGURATION},
|
||||
|
||||
{ACPI_RSC_EXIT_NE, ACPI_RSC_COMPARE_VALUE,
|
||||
ACPI_RS_OFFSET(data.start_dpf.performance_robustness),
|
||||
ACPI_ACCEPTABLE_CONFIGURATION},
|
||||
|
||||
/* Flag byte is not necessary */
|
||||
|
||||
{ACPI_RSC_LENGTH, 0, 0,
|
||||
sizeof(struct aml_resource_start_dependent_noprio)}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
******************************************************************************/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2000 - 2005, R. Byron Moore
|
||||
* Copyright (C) 2000 - 2006, R. Byron Moore
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
|
@ -49,504 +49,182 @@ ACPI_MODULE_NAME("rsirq")
|
|||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: acpi_rs_irq_resource
|
||||
*
|
||||
* PARAMETERS: byte_stream_buffer - Pointer to the resource input byte
|
||||
* stream
|
||||
* bytes_consumed - Pointer to where the number of bytes
|
||||
* consumed the byte_stream_buffer is
|
||||
* returned
|
||||
* output_buffer - Pointer to the return data buffer
|
||||
* structure_size - Pointer to where the number of bytes
|
||||
* in the return data struct is returned
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Take the resource byte stream and fill out the appropriate
|
||||
* structure pointed to by the output_buffer. Return the
|
||||
* number of bytes consumed from the byte stream.
|
||||
* acpi_rs_get_irq
|
||||
*
|
||||
******************************************************************************/
|
||||
acpi_status
|
||||
acpi_rs_irq_resource(u8 * byte_stream_buffer,
|
||||
acpi_size * bytes_consumed,
|
||||
u8 ** output_buffer, acpi_size * structure_size)
|
||||
{
|
||||
u8 *buffer = byte_stream_buffer;
|
||||
struct acpi_resource *output_struct = (void *)*output_buffer;
|
||||
u16 temp16 = 0;
|
||||
u8 temp8 = 0;
|
||||
u8 index;
|
||||
u8 i;
|
||||
acpi_size struct_size = ACPI_SIZEOF_RESOURCE(struct acpi_resource_irq);
|
||||
struct acpi_rsconvert_info acpi_rs_get_irq[7] = {
|
||||
{ACPI_RSC_INITGET, ACPI_RESOURCE_TYPE_IRQ,
|
||||
ACPI_RS_SIZE(struct acpi_resource_irq),
|
||||
ACPI_RSC_TABLE_SIZE(acpi_rs_get_irq)},
|
||||
|
||||
ACPI_FUNCTION_TRACE("rs_irq_resource");
|
||||
/* Get the IRQ mask (bytes 1:2) */
|
||||
|
||||
/*
|
||||
* The number of bytes consumed are contained in the descriptor
|
||||
* (Bits:0-1)
|
||||
*/
|
||||
temp8 = *buffer;
|
||||
*bytes_consumed = (temp8 & 0x03) + 1;
|
||||
output_struct->id = ACPI_RSTYPE_IRQ;
|
||||
{ACPI_RSC_BITMASK16, ACPI_RS_OFFSET(data.irq.interrupts[0]),
|
||||
AML_OFFSET(irq.irq_mask),
|
||||
ACPI_RS_OFFSET(data.irq.interrupt_count)},
|
||||
|
||||
/* Point to the 16-bits of Bytes 1 and 2 */
|
||||
/* Set default flags (others are zero) */
|
||||
|
||||
buffer += 1;
|
||||
ACPI_MOVE_16_TO_16(&temp16, buffer);
|
||||
{ACPI_RSC_SET8, ACPI_RS_OFFSET(data.irq.triggering),
|
||||
ACPI_EDGE_SENSITIVE,
|
||||
1},
|
||||
|
||||
output_struct->data.irq.number_of_interrupts = 0;
|
||||
/* All done if no flag byte present in descriptor */
|
||||
|
||||
/* Decode the IRQ bits */
|
||||
{ACPI_RSC_EXIT_NE, ACPI_RSC_COMPARE_AML_LENGTH, 0, 3},
|
||||
|
||||
for (i = 0, index = 0; index < 16; index++) {
|
||||
if ((temp16 >> index) & 0x01) {
|
||||
output_struct->data.irq.interrupts[i] = index;
|
||||
i++;
|
||||
}
|
||||
}
|
||||
/* Get flags: Triggering[0], Polarity[3], Sharing[4] */
|
||||
|
||||
/* Zero interrupts is valid */
|
||||
{ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.irq.triggering),
|
||||
AML_OFFSET(irq.flags),
|
||||
0},
|
||||
|
||||
output_struct->data.irq.number_of_interrupts = i;
|
||||
if (i > 0) {
|
||||
/* Calculate the structure size based upon the number of interrupts */
|
||||
{ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.irq.polarity),
|
||||
AML_OFFSET(irq.flags),
|
||||
3},
|
||||
|
||||
struct_size += ((acpi_size) i - 1) * 4;
|
||||
}
|
||||
|
||||
/* Point to Byte 3 if it is used */
|
||||
|
||||
if (4 == *bytes_consumed) {
|
||||
buffer += 2;
|
||||
temp8 = *buffer;
|
||||
|
||||
/* Check for HE, LL interrupts */
|
||||
|
||||
switch (temp8 & 0x09) {
|
||||
case 0x01: /* HE */
|
||||
output_struct->data.irq.edge_level =
|
||||
ACPI_EDGE_SENSITIVE;
|
||||
output_struct->data.irq.active_high_low =
|
||||
ACPI_ACTIVE_HIGH;
|
||||
break;
|
||||
|
||||
case 0x08: /* LL */
|
||||
output_struct->data.irq.edge_level =
|
||||
ACPI_LEVEL_SENSITIVE;
|
||||
output_struct->data.irq.active_high_low =
|
||||
ACPI_ACTIVE_LOW;
|
||||
break;
|
||||
|
||||
default:
|
||||
/*
|
||||
* Only _LL and _HE polarity/trigger interrupts
|
||||
* are allowed (ACPI spec, section "IRQ Format")
|
||||
* so 0x00 and 0x09 are illegal.
|
||||
*/
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
||||
"Invalid interrupt polarity/trigger in resource list, %X\n",
|
||||
temp8));
|
||||
return_ACPI_STATUS(AE_BAD_DATA);
|
||||
}
|
||||
|
||||
/* Check for sharable */
|
||||
|
||||
output_struct->data.irq.shared_exclusive = (temp8 >> 3) & 0x01;
|
||||
} else {
|
||||
/*
|
||||
* Assume Edge Sensitive, Active High, Non-Sharable
|
||||
* per ACPI Specification
|
||||
*/
|
||||
output_struct->data.irq.edge_level = ACPI_EDGE_SENSITIVE;
|
||||
output_struct->data.irq.active_high_low = ACPI_ACTIVE_HIGH;
|
||||
output_struct->data.irq.shared_exclusive = ACPI_EXCLUSIVE;
|
||||
}
|
||||
|
||||
/* Set the Length parameter */
|
||||
|
||||
output_struct->length = (u32) struct_size;
|
||||
|
||||
/* Return the final size of the structure */
|
||||
|
||||
*structure_size = struct_size;
|
||||
return_ACPI_STATUS(AE_OK);
|
||||
}
|
||||
{ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.irq.sharable),
|
||||
AML_OFFSET(irq.flags),
|
||||
4}
|
||||
};
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: acpi_rs_irq_stream
|
||||
*
|
||||
* PARAMETERS: linked_list - Pointer to the resource linked list
|
||||
* output_buffer - Pointer to the user's return buffer
|
||||
* bytes_consumed - Pointer to where the number of bytes
|
||||
* used in the output_buffer is returned
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Take the linked list resource structure and fills in the
|
||||
* the appropriate bytes in a byte stream
|
||||
* acpi_rs_set_irq
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
acpi_status
|
||||
acpi_rs_irq_stream(struct acpi_resource *linked_list,
|
||||
u8 ** output_buffer, acpi_size * bytes_consumed)
|
||||
{
|
||||
u8 *buffer = *output_buffer;
|
||||
u16 temp16 = 0;
|
||||
u8 temp8 = 0;
|
||||
u8 index;
|
||||
u8 IRqinfo_byte_needed;
|
||||
struct acpi_rsconvert_info acpi_rs_set_irq[9] = {
|
||||
{ACPI_RSC_INITSET, ACPI_RESOURCE_NAME_IRQ,
|
||||
sizeof(struct aml_resource_irq),
|
||||
ACPI_RSC_TABLE_SIZE(acpi_rs_set_irq)},
|
||||
|
||||
ACPI_FUNCTION_TRACE("rs_irq_stream");
|
||||
/* Convert interrupt list to 16-bit IRQ bitmask */
|
||||
|
||||
{ACPI_RSC_BITMASK16, ACPI_RS_OFFSET(data.irq.interrupts[0]),
|
||||
AML_OFFSET(irq.irq_mask),
|
||||
ACPI_RS_OFFSET(data.irq.interrupt_count)},
|
||||
|
||||
/* Set the flags byte by default */
|
||||
|
||||
{ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.irq.triggering),
|
||||
AML_OFFSET(irq.flags),
|
||||
0},
|
||||
|
||||
{ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.irq.polarity),
|
||||
AML_OFFSET(irq.flags),
|
||||
3},
|
||||
|
||||
{ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.irq.sharable),
|
||||
AML_OFFSET(irq.flags),
|
||||
4},
|
||||
/*
|
||||
* The descriptor field is set based upon whether a third byte is
|
||||
* needed to contain the IRQ Information.
|
||||
* Check if the flags byte is necessary. Not needed if the flags are:
|
||||
* ACPI_EDGE_SENSITIVE, ACPI_ACTIVE_HIGH, ACPI_EXCLUSIVE
|
||||
*/
|
||||
if (ACPI_EDGE_SENSITIVE == linked_list->data.irq.edge_level &&
|
||||
ACPI_ACTIVE_HIGH == linked_list->data.irq.active_high_low &&
|
||||
ACPI_EXCLUSIVE == linked_list->data.irq.shared_exclusive) {
|
||||
*buffer = 0x22;
|
||||
IRqinfo_byte_needed = FALSE;
|
||||
} else {
|
||||
*buffer = 0x23;
|
||||
IRqinfo_byte_needed = TRUE;
|
||||
}
|
||||
{ACPI_RSC_EXIT_NE, ACPI_RSC_COMPARE_VALUE,
|
||||
ACPI_RS_OFFSET(data.irq.triggering),
|
||||
ACPI_EDGE_SENSITIVE},
|
||||
|
||||
buffer += 1;
|
||||
temp16 = 0;
|
||||
{ACPI_RSC_EXIT_NE, ACPI_RSC_COMPARE_VALUE,
|
||||
ACPI_RS_OFFSET(data.irq.polarity),
|
||||
ACPI_ACTIVE_HIGH},
|
||||
|
||||
/* Loop through all of the interrupts and set the mask bits */
|
||||
{ACPI_RSC_EXIT_NE, ACPI_RSC_COMPARE_VALUE,
|
||||
ACPI_RS_OFFSET(data.irq.sharable),
|
||||
ACPI_EXCLUSIVE},
|
||||
|
||||
for (index = 0;
|
||||
index < linked_list->data.irq.number_of_interrupts; index++) {
|
||||
temp8 = (u8) linked_list->data.irq.interrupts[index];
|
||||
temp16 |= 0x1 << temp8;
|
||||
}
|
||||
/* irq_no_flags() descriptor can be used */
|
||||
|
||||
ACPI_MOVE_16_TO_16(buffer, &temp16);
|
||||
buffer += 2;
|
||||
|
||||
/* Set the IRQ Info byte if needed. */
|
||||
|
||||
if (IRqinfo_byte_needed) {
|
||||
temp8 = 0;
|
||||
temp8 = (u8) ((linked_list->data.irq.shared_exclusive &
|
||||
0x01) << 4);
|
||||
|
||||
if (ACPI_LEVEL_SENSITIVE == linked_list->data.irq.edge_level &&
|
||||
ACPI_ACTIVE_LOW == linked_list->data.irq.active_high_low) {
|
||||
temp8 |= 0x08;
|
||||
} else {
|
||||
temp8 |= 0x01;
|
||||
}
|
||||
|
||||
*buffer = temp8;
|
||||
buffer += 1;
|
||||
}
|
||||
|
||||
/* Return the number of bytes consumed in this operation */
|
||||
|
||||
*bytes_consumed = ACPI_PTR_DIFF(buffer, *output_buffer);
|
||||
return_ACPI_STATUS(AE_OK);
|
||||
}
|
||||
{ACPI_RSC_LENGTH, 0, 0, sizeof(struct aml_resource_irq_noflags)}
|
||||
};
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: acpi_rs_extended_irq_resource
|
||||
*
|
||||
* PARAMETERS: byte_stream_buffer - Pointer to the resource input byte
|
||||
* stream
|
||||
* bytes_consumed - Pointer to where the number of bytes
|
||||
* consumed the byte_stream_buffer is
|
||||
* returned
|
||||
* output_buffer - Pointer to the return data buffer
|
||||
* structure_size - Pointer to where the number of bytes
|
||||
* in the return data struct is returned
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Take the resource byte stream and fill out the appropriate
|
||||
* structure pointed to by the output_buffer. Return the
|
||||
* number of bytes consumed from the byte stream.
|
||||
* acpi_rs_convert_ext_irq
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
acpi_status
|
||||
acpi_rs_extended_irq_resource(u8 * byte_stream_buffer,
|
||||
acpi_size * bytes_consumed,
|
||||
u8 ** output_buffer, acpi_size * structure_size)
|
||||
{
|
||||
u8 *buffer = byte_stream_buffer;
|
||||
struct acpi_resource *output_struct = (void *)*output_buffer;
|
||||
u16 temp16 = 0;
|
||||
u8 temp8 = 0;
|
||||
u8 *temp_ptr;
|
||||
u8 index;
|
||||
acpi_size struct_size =
|
||||
ACPI_SIZEOF_RESOURCE(struct acpi_resource_ext_irq);
|
||||
struct acpi_rsconvert_info acpi_rs_convert_ext_irq[9] = {
|
||||
{ACPI_RSC_INITGET, ACPI_RESOURCE_TYPE_EXTENDED_IRQ,
|
||||
ACPI_RS_SIZE(struct acpi_resource_extended_irq),
|
||||
ACPI_RSC_TABLE_SIZE(acpi_rs_convert_ext_irq)},
|
||||
|
||||
ACPI_FUNCTION_TRACE("rs_extended_irq_resource");
|
||||
{ACPI_RSC_INITSET, ACPI_RESOURCE_NAME_EXTENDED_IRQ,
|
||||
sizeof(struct aml_resource_extended_irq),
|
||||
0},
|
||||
|
||||
/* Get the Descriptor Length field */
|
||||
/* Flag bits */
|
||||
|
||||
buffer += 1;
|
||||
ACPI_MOVE_16_TO_16(&temp16, buffer);
|
||||
{ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.extended_irq.producer_consumer),
|
||||
AML_OFFSET(extended_irq.flags),
|
||||
0},
|
||||
|
||||
/* Validate minimum descriptor length */
|
||||
{ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.extended_irq.triggering),
|
||||
AML_OFFSET(extended_irq.flags),
|
||||
1},
|
||||
|
||||
if (temp16 < 6) {
|
||||
return_ACPI_STATUS(AE_AML_BAD_RESOURCE_LENGTH);
|
||||
}
|
||||
{ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.extended_irq.polarity),
|
||||
AML_OFFSET(extended_irq.flags),
|
||||
2},
|
||||
|
||||
*bytes_consumed = temp16 + 3;
|
||||
output_struct->id = ACPI_RSTYPE_EXT_IRQ;
|
||||
{ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.extended_irq.sharable),
|
||||
AML_OFFSET(extended_irq.flags),
|
||||
3},
|
||||
|
||||
/* Point to the Byte3 */
|
||||
/* IRQ Table length (Byte4) */
|
||||
|
||||
buffer += 2;
|
||||
temp8 = *buffer;
|
||||
{ACPI_RSC_COUNT, ACPI_RS_OFFSET(data.extended_irq.interrupt_count),
|
||||
AML_OFFSET(extended_irq.interrupt_count),
|
||||
sizeof(u32)}
|
||||
,
|
||||
|
||||
output_struct->data.extended_irq.producer_consumer = temp8 & 0x01;
|
||||
/* Copy every IRQ in the table, each is 32 bits */
|
||||
|
||||
/*
|
||||
* Check for Interrupt Mode
|
||||
*
|
||||
* The definition of an Extended IRQ changed between ACPI spec v1.0b
|
||||
* and ACPI spec 2.0 (section 6.4.3.6 in both).
|
||||
*
|
||||
* - Edge/Level are defined opposite in the table vs the headers
|
||||
*/
|
||||
output_struct->data.extended_irq.edge_level =
|
||||
(temp8 & 0x2) ? ACPI_EDGE_SENSITIVE : ACPI_LEVEL_SENSITIVE;
|
||||
{ACPI_RSC_MOVE32, ACPI_RS_OFFSET(data.extended_irq.interrupts[0]),
|
||||
AML_OFFSET(extended_irq.interrupts[0]),
|
||||
0}
|
||||
,
|
||||
|
||||
/* Check Interrupt Polarity */
|
||||
/* Optional resource_source (Index and String) */
|
||||
|
||||
output_struct->data.extended_irq.active_high_low = (temp8 >> 2) & 0x1;
|
||||
|
||||
/* Check for sharable */
|
||||
|
||||
output_struct->data.extended_irq.shared_exclusive = (temp8 >> 3) & 0x01;
|
||||
|
||||
/* Point to Byte4 (IRQ Table length) */
|
||||
|
||||
buffer += 1;
|
||||
temp8 = *buffer;
|
||||
|
||||
/* Must have at least one IRQ */
|
||||
|
||||
if (temp8 < 1) {
|
||||
return_ACPI_STATUS(AE_AML_BAD_RESOURCE_LENGTH);
|
||||
}
|
||||
|
||||
output_struct->data.extended_irq.number_of_interrupts = temp8;
|
||||
|
||||
/*
|
||||
* Add any additional structure size to properly calculate
|
||||
* the next pointer at the end of this function
|
||||
*/
|
||||
struct_size += (temp8 - 1) * 4;
|
||||
|
||||
/* Point to Byte5 (First IRQ Number) */
|
||||
|
||||
buffer += 1;
|
||||
|
||||
/* Cycle through every IRQ in the table */
|
||||
|
||||
for (index = 0; index < temp8; index++) {
|
||||
ACPI_MOVE_32_TO_32(&output_struct->data.extended_irq.
|
||||
interrupts[index], buffer);
|
||||
|
||||
/* Point to the next IRQ */
|
||||
|
||||
buffer += 4;
|
||||
}
|
||||
|
||||
/*
|
||||
* This will leave us pointing to the Resource Source Index
|
||||
* If it is present, then save it off and calculate the
|
||||
* pointer to where the null terminated string goes:
|
||||
* Each Interrupt takes 32-bits + the 5 bytes of the
|
||||
* stream that are default.
|
||||
*
|
||||
* Note: Some resource descriptors will have an additional null, so
|
||||
* we add 1 to the length.
|
||||
*/
|
||||
if (*bytes_consumed >
|
||||
((acpi_size) output_struct->data.extended_irq.number_of_interrupts *
|
||||
4) + (5 + 1)) {
|
||||
/* Dereference the Index */
|
||||
|
||||
temp8 = *buffer;
|
||||
output_struct->data.extended_irq.resource_source.index =
|
||||
(u32) temp8;
|
||||
|
||||
/* Point to the String */
|
||||
|
||||
buffer += 1;
|
||||
|
||||
/* Point the String pointer to the end of this structure. */
|
||||
|
||||
output_struct->data.extended_irq.resource_source.string_ptr =
|
||||
(char *)((char *)output_struct + struct_size);
|
||||
|
||||
temp_ptr = (u8 *)
|
||||
output_struct->data.extended_irq.resource_source.string_ptr;
|
||||
|
||||
/* Copy the string into the buffer */
|
||||
|
||||
index = 0;
|
||||
while (*buffer) {
|
||||
*temp_ptr = *buffer;
|
||||
|
||||
temp_ptr += 1;
|
||||
buffer += 1;
|
||||
index += 1;
|
||||
}
|
||||
|
||||
/* Add the terminating null */
|
||||
|
||||
*temp_ptr = 0;
|
||||
output_struct->data.extended_irq.resource_source.string_length =
|
||||
index + 1;
|
||||
|
||||
/*
|
||||
* In order for the struct_size to fall on a 32-bit boundary,
|
||||
* calculate the length of the string and expand the
|
||||
* struct_size to the next 32-bit boundary.
|
||||
*/
|
||||
temp8 = (u8) (index + 1);
|
||||
struct_size += ACPI_ROUND_UP_to_32_bITS(temp8);
|
||||
} else {
|
||||
output_struct->data.extended_irq.resource_source.index = 0;
|
||||
output_struct->data.extended_irq.resource_source.string_length =
|
||||
0;
|
||||
output_struct->data.extended_irq.resource_source.string_ptr =
|
||||
NULL;
|
||||
}
|
||||
|
||||
/* Set the Length parameter */
|
||||
|
||||
output_struct->length = (u32) struct_size;
|
||||
|
||||
/* Return the final size of the structure */
|
||||
|
||||
*structure_size = struct_size;
|
||||
return_ACPI_STATUS(AE_OK);
|
||||
}
|
||||
{ACPI_RSC_SOURCEX, ACPI_RS_OFFSET(data.extended_irq.resource_source),
|
||||
ACPI_RS_OFFSET(data.extended_irq.interrupts[0]),
|
||||
sizeof(struct aml_resource_extended_irq)}
|
||||
};
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: acpi_rs_extended_irq_stream
|
||||
*
|
||||
* PARAMETERS: linked_list - Pointer to the resource linked list
|
||||
* output_buffer - Pointer to the user's return buffer
|
||||
* bytes_consumed - Pointer to where the number of bytes
|
||||
* used in the output_buffer is returned
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Take the linked list resource structure and fills in the
|
||||
* the appropriate bytes in a byte stream
|
||||
* acpi_rs_convert_dma
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
acpi_status
|
||||
acpi_rs_extended_irq_stream(struct acpi_resource *linked_list,
|
||||
u8 ** output_buffer, acpi_size * bytes_consumed)
|
||||
{
|
||||
u8 *buffer = *output_buffer;
|
||||
u16 *length_field;
|
||||
u8 temp8 = 0;
|
||||
u8 index;
|
||||
struct acpi_rsconvert_info acpi_rs_convert_dma[6] = {
|
||||
{ACPI_RSC_INITGET, ACPI_RESOURCE_TYPE_DMA,
|
||||
ACPI_RS_SIZE(struct acpi_resource_dma),
|
||||
ACPI_RSC_TABLE_SIZE(acpi_rs_convert_dma)},
|
||||
|
||||
ACPI_FUNCTION_TRACE("rs_extended_irq_stream");
|
||||
{ACPI_RSC_INITSET, ACPI_RESOURCE_NAME_DMA,
|
||||
sizeof(struct aml_resource_dma),
|
||||
0},
|
||||
|
||||
/* Set the Descriptor Type field */
|
||||
/* Flags: transfer preference, bus mastering, channel speed */
|
||||
|
||||
*buffer = ACPI_RDESC_TYPE_EXTENDED_XRUPT;
|
||||
buffer += 1;
|
||||
{ACPI_RSC_2BITFLAG, ACPI_RS_OFFSET(data.dma.transfer),
|
||||
AML_OFFSET(dma.flags),
|
||||
0},
|
||||
|
||||
/* Save a pointer to the Length field - to be filled in later */
|
||||
{ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.dma.bus_master),
|
||||
AML_OFFSET(dma.flags),
|
||||
2},
|
||||
|
||||
length_field = ACPI_CAST_PTR(u16, buffer);
|
||||
buffer += 2;
|
||||
{ACPI_RSC_2BITFLAG, ACPI_RS_OFFSET(data.dma.type),
|
||||
AML_OFFSET(dma.flags),
|
||||
5},
|
||||
|
||||
/* Set the Interrupt vector flags */
|
||||
/* DMA channel mask bits */
|
||||
|
||||
temp8 = (u8) (linked_list->data.extended_irq.producer_consumer & 0x01);
|
||||
temp8 |=
|
||||
((linked_list->data.extended_irq.shared_exclusive & 0x01) << 3);
|
||||
|
||||
/*
|
||||
* Set the Interrupt Mode
|
||||
*
|
||||
* The definition of an Extended IRQ changed between ACPI spec v1.0b
|
||||
* and ACPI spec 2.0 (section 6.4.3.6 in both). This code does not
|
||||
* implement the more restrictive definition of 1.0b
|
||||
*
|
||||
* - Edge/Level are defined opposite in the table vs the headers
|
||||
*/
|
||||
if (ACPI_EDGE_SENSITIVE == linked_list->data.extended_irq.edge_level) {
|
||||
temp8 |= 0x2;
|
||||
}
|
||||
|
||||
/* Set the Interrupt Polarity */
|
||||
|
||||
temp8 |= ((linked_list->data.extended_irq.active_high_low & 0x1) << 2);
|
||||
|
||||
*buffer = temp8;
|
||||
buffer += 1;
|
||||
|
||||
/* Set the Interrupt table length */
|
||||
|
||||
temp8 = (u8) linked_list->data.extended_irq.number_of_interrupts;
|
||||
|
||||
*buffer = temp8;
|
||||
buffer += 1;
|
||||
|
||||
for (index = 0;
|
||||
index < linked_list->data.extended_irq.number_of_interrupts;
|
||||
index++) {
|
||||
ACPI_MOVE_32_TO_32(buffer,
|
||||
&linked_list->data.extended_irq.
|
||||
interrupts[index]);
|
||||
buffer += 4;
|
||||
}
|
||||
|
||||
/* Resource Source Index and Resource Source are optional */
|
||||
|
||||
if (0 != linked_list->data.extended_irq.resource_source.string_length) {
|
||||
*buffer =
|
||||
(u8) linked_list->data.extended_irq.resource_source.index;
|
||||
buffer += 1;
|
||||
|
||||
/* Copy the string */
|
||||
|
||||
ACPI_STRCPY((char *)buffer,
|
||||
linked_list->data.extended_irq.resource_source.
|
||||
string_ptr);
|
||||
|
||||
/*
|
||||
* Buffer needs to be set to the length of the string + one for the
|
||||
* terminating null
|
||||
*/
|
||||
buffer +=
|
||||
(acpi_size) (ACPI_STRLEN
|
||||
(linked_list->data.extended_irq.
|
||||
resource_source.string_ptr) + 1);
|
||||
}
|
||||
|
||||
/* Return the number of bytes consumed in this operation */
|
||||
|
||||
*bytes_consumed = ACPI_PTR_DIFF(buffer, *output_buffer);
|
||||
|
||||
/*
|
||||
* Set the length field to the number of bytes consumed
|
||||
* minus the header size (3 bytes)
|
||||
*/
|
||||
*length_field = (u16) (*bytes_consumed - 3);
|
||||
return_ACPI_STATUS(AE_OK);
|
||||
}
|
||||
{ACPI_RSC_BITMASK, ACPI_RS_OFFSET(data.dma.channels[0]),
|
||||
AML_OFFSET(dma.dma_channel_mask),
|
||||
ACPI_RS_OFFSET(data.dma.channel_count)}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
******************************************************************************/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2000 - 2005, R. Byron Moore
|
||||
* Copyright (C) 2000 - 2006, R. Byron Moore
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
|
@ -49,52 +49,12 @@ ACPI_MODULE_NAME("rslist")
|
|||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: acpi_rs_get_resource_type
|
||||
* FUNCTION: acpi_rs_convert_aml_to_resources
|
||||
*
|
||||
* PARAMETERS: resource_start_byte - Byte 0 of a resource descriptor
|
||||
*
|
||||
* RETURN: The Resource Type with no extraneous bits
|
||||
*
|
||||
* DESCRIPTION: Extract the Resource Type/Name from the first byte of
|
||||
* a resource descriptor.
|
||||
*
|
||||
******************************************************************************/
|
||||
u8 acpi_rs_get_resource_type(u8 resource_start_byte)
|
||||
{
|
||||
|
||||
ACPI_FUNCTION_ENTRY();
|
||||
|
||||
/* Determine if this is a small or large resource */
|
||||
|
||||
switch (resource_start_byte & ACPI_RDESC_TYPE_MASK) {
|
||||
case ACPI_RDESC_TYPE_SMALL:
|
||||
|
||||
/* Small Resource Type -- Only bits 6:3 are valid */
|
||||
|
||||
return ((u8) (resource_start_byte & ACPI_RDESC_SMALL_MASK));
|
||||
|
||||
case ACPI_RDESC_TYPE_LARGE:
|
||||
|
||||
/* Large Resource Type -- All bits are valid */
|
||||
|
||||
return (resource_start_byte);
|
||||
|
||||
default:
|
||||
/* Invalid type */
|
||||
break;
|
||||
}
|
||||
|
||||
return (0xFF);
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: acpi_rs_byte_stream_to_list
|
||||
*
|
||||
* PARAMETERS: byte_stream_buffer - Pointer to the resource byte stream
|
||||
* byte_stream_buffer_length - Length of byte_stream_buffer
|
||||
* output_buffer - Pointer to the buffer that will
|
||||
* contain the output structures
|
||||
* PARAMETERS: Aml - Pointer to the resource byte stream
|
||||
* aml_length - Length of Aml
|
||||
* output_buffer - Pointer to the buffer that will
|
||||
* contain the output structures
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
|
|
@ -102,241 +62,76 @@ u8 acpi_rs_get_resource_type(u8 resource_start_byte)
|
|||
* linked list of resources in the caller's output buffer
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
acpi_status
|
||||
acpi_rs_byte_stream_to_list(u8 * byte_stream_buffer,
|
||||
u32 byte_stream_buffer_length, u8 * output_buffer)
|
||||
acpi_rs_convert_aml_to_resources(u8 * aml, u32 aml_length, u8 * output_buffer)
|
||||
{
|
||||
struct acpi_resource *resource = (void *)output_buffer;
|
||||
acpi_status status;
|
||||
acpi_size bytes_parsed = 0;
|
||||
u8 resource_type = 0;
|
||||
acpi_size bytes_consumed = 0;
|
||||
u8 *buffer = output_buffer;
|
||||
acpi_size structure_size = 0;
|
||||
u8 end_tag_processed = FALSE;
|
||||
struct acpi_resource *resource;
|
||||
u8 resource_index;
|
||||
u8 *end_aml;
|
||||
|
||||
ACPI_FUNCTION_TRACE("rs_byte_stream_to_list");
|
||||
ACPI_FUNCTION_TRACE("rs_convert_aml_to_resources");
|
||||
|
||||
while (bytes_parsed < byte_stream_buffer_length && !end_tag_processed) {
|
||||
/* The next byte in the stream is the resource type */
|
||||
end_aml = aml + aml_length;
|
||||
|
||||
resource_type = acpi_rs_get_resource_type(*byte_stream_buffer);
|
||||
/* Loop until end-of-buffer or an end_tag is found */
|
||||
|
||||
switch (resource_type) {
|
||||
case ACPI_RDESC_TYPE_MEMORY_24:
|
||||
/*
|
||||
* 24-Bit Memory Resource
|
||||
*/
|
||||
status = acpi_rs_memory24_resource(byte_stream_buffer,
|
||||
&bytes_consumed,
|
||||
&buffer,
|
||||
&structure_size);
|
||||
break;
|
||||
|
||||
case ACPI_RDESC_TYPE_LARGE_VENDOR:
|
||||
/*
|
||||
* Vendor Defined Resource
|
||||
*/
|
||||
status = acpi_rs_vendor_resource(byte_stream_buffer,
|
||||
&bytes_consumed,
|
||||
&buffer,
|
||||
&structure_size);
|
||||
break;
|
||||
|
||||
case ACPI_RDESC_TYPE_MEMORY_32:
|
||||
/*
|
||||
* 32-Bit Memory Range Resource
|
||||
*/
|
||||
status =
|
||||
acpi_rs_memory32_range_resource(byte_stream_buffer,
|
||||
&bytes_consumed,
|
||||
&buffer,
|
||||
&structure_size);
|
||||
break;
|
||||
|
||||
case ACPI_RDESC_TYPE_FIXED_MEMORY_32:
|
||||
/*
|
||||
* 32-Bit Fixed Memory Resource
|
||||
*/
|
||||
status =
|
||||
acpi_rs_fixed_memory32_resource(byte_stream_buffer,
|
||||
&bytes_consumed,
|
||||
&buffer,
|
||||
&structure_size);
|
||||
break;
|
||||
|
||||
case ACPI_RDESC_TYPE_QWORD_ADDRESS_SPACE:
|
||||
case ACPI_RDESC_TYPE_EXTENDED_ADDRESS_SPACE:
|
||||
/*
|
||||
* 64-Bit Address Resource
|
||||
*/
|
||||
status = acpi_rs_address64_resource(byte_stream_buffer,
|
||||
&bytes_consumed,
|
||||
&buffer,
|
||||
&structure_size);
|
||||
break;
|
||||
|
||||
case ACPI_RDESC_TYPE_DWORD_ADDRESS_SPACE:
|
||||
/*
|
||||
* 32-Bit Address Resource
|
||||
*/
|
||||
status = acpi_rs_address32_resource(byte_stream_buffer,
|
||||
&bytes_consumed,
|
||||
&buffer,
|
||||
&structure_size);
|
||||
break;
|
||||
|
||||
case ACPI_RDESC_TYPE_WORD_ADDRESS_SPACE:
|
||||
/*
|
||||
* 16-Bit Address Resource
|
||||
*/
|
||||
status = acpi_rs_address16_resource(byte_stream_buffer,
|
||||
&bytes_consumed,
|
||||
&buffer,
|
||||
&structure_size);
|
||||
break;
|
||||
|
||||
case ACPI_RDESC_TYPE_EXTENDED_XRUPT:
|
||||
/*
|
||||
* Extended IRQ
|
||||
*/
|
||||
status =
|
||||
acpi_rs_extended_irq_resource(byte_stream_buffer,
|
||||
&bytes_consumed,
|
||||
&buffer,
|
||||
&structure_size);
|
||||
break;
|
||||
|
||||
case ACPI_RDESC_TYPE_IRQ_FORMAT:
|
||||
/*
|
||||
* IRQ Resource
|
||||
*/
|
||||
status = acpi_rs_irq_resource(byte_stream_buffer,
|
||||
&bytes_consumed, &buffer,
|
||||
&structure_size);
|
||||
break;
|
||||
|
||||
case ACPI_RDESC_TYPE_DMA_FORMAT:
|
||||
/*
|
||||
* DMA Resource
|
||||
*/
|
||||
status = acpi_rs_dma_resource(byte_stream_buffer,
|
||||
&bytes_consumed, &buffer,
|
||||
&structure_size);
|
||||
break;
|
||||
|
||||
case ACPI_RDESC_TYPE_START_DEPENDENT:
|
||||
/*
|
||||
* Start Dependent Functions Resource
|
||||
*/
|
||||
status =
|
||||
acpi_rs_start_depend_fns_resource
|
||||
(byte_stream_buffer, &bytes_consumed, &buffer,
|
||||
&structure_size);
|
||||
break;
|
||||
|
||||
case ACPI_RDESC_TYPE_END_DEPENDENT:
|
||||
/*
|
||||
* End Dependent Functions Resource
|
||||
*/
|
||||
status =
|
||||
acpi_rs_end_depend_fns_resource(byte_stream_buffer,
|
||||
&bytes_consumed,
|
||||
&buffer,
|
||||
&structure_size);
|
||||
break;
|
||||
|
||||
case ACPI_RDESC_TYPE_IO_PORT:
|
||||
/*
|
||||
* IO Port Resource
|
||||
*/
|
||||
status = acpi_rs_io_resource(byte_stream_buffer,
|
||||
&bytes_consumed, &buffer,
|
||||
&structure_size);
|
||||
break;
|
||||
|
||||
case ACPI_RDESC_TYPE_FIXED_IO_PORT:
|
||||
/*
|
||||
* Fixed IO Port Resource
|
||||
*/
|
||||
status = acpi_rs_fixed_io_resource(byte_stream_buffer,
|
||||
&bytes_consumed,
|
||||
&buffer,
|
||||
&structure_size);
|
||||
break;
|
||||
|
||||
case ACPI_RDESC_TYPE_SMALL_VENDOR:
|
||||
/*
|
||||
* Vendor Specific Resource
|
||||
*/
|
||||
status = acpi_rs_vendor_resource(byte_stream_buffer,
|
||||
&bytes_consumed,
|
||||
&buffer,
|
||||
&structure_size);
|
||||
break;
|
||||
|
||||
case ACPI_RDESC_TYPE_END_TAG:
|
||||
/*
|
||||
* End Tag
|
||||
*/
|
||||
end_tag_processed = TRUE;
|
||||
status = acpi_rs_end_tag_resource(byte_stream_buffer,
|
||||
&bytes_consumed,
|
||||
&buffer,
|
||||
&structure_size);
|
||||
break;
|
||||
|
||||
default:
|
||||
/*
|
||||
* Invalid/Unknown resource type
|
||||
*/
|
||||
status = AE_AML_INVALID_RESOURCE_TYPE;
|
||||
break;
|
||||
}
|
||||
while (aml < end_aml) {
|
||||
/* Validate the Resource Type and Resource Length */
|
||||
|
||||
status = acpi_ut_validate_resource(aml, &resource_index);
|
||||
if (ACPI_FAILURE(status)) {
|
||||
return_ACPI_STATUS(status);
|
||||
}
|
||||
|
||||
/* Update the return value and counter */
|
||||
/* Convert the AML byte stream resource to a local resource struct */
|
||||
|
||||
bytes_parsed += bytes_consumed;
|
||||
status =
|
||||
acpi_rs_convert_aml_to_resource(resource,
|
||||
ACPI_CAST_PTR(union
|
||||
aml_resource,
|
||||
aml),
|
||||
acpi_gbl_get_resource_dispatch
|
||||
[resource_index]);
|
||||
if (ACPI_FAILURE(status)) {
|
||||
ACPI_REPORT_ERROR(("Could not convert AML resource (Type %X) to resource, %s\n", *aml, acpi_format_exception(status)));
|
||||
return_ACPI_STATUS(status);
|
||||
}
|
||||
|
||||
/* Set the byte stream to point to the next resource */
|
||||
/* Normal exit on completion of an end_tag resource descriptor */
|
||||
|
||||
byte_stream_buffer += bytes_consumed;
|
||||
if (acpi_ut_get_resource_type(aml) ==
|
||||
ACPI_RESOURCE_NAME_END_TAG) {
|
||||
return_ACPI_STATUS(AE_OK);
|
||||
}
|
||||
|
||||
/* Set the Buffer to the next structure */
|
||||
/* Point to the next input AML resource */
|
||||
|
||||
resource = ACPI_CAST_PTR(struct acpi_resource, buffer);
|
||||
resource->length =
|
||||
(u32) ACPI_ALIGN_RESOURCE_SIZE(resource->length);
|
||||
buffer += ACPI_ALIGN_RESOURCE_SIZE(structure_size);
|
||||
aml += acpi_ut_get_descriptor_length(aml);
|
||||
|
||||
/* Point to the next structure in the output buffer */
|
||||
|
||||
resource =
|
||||
ACPI_ADD_PTR(struct acpi_resource, resource,
|
||||
resource->length);
|
||||
}
|
||||
|
||||
/* Check the reason for exiting the while loop */
|
||||
/* Did not find an end_tag resource descriptor */
|
||||
|
||||
if (!end_tag_processed) {
|
||||
return_ACPI_STATUS(AE_AML_NO_RESOURCE_END_TAG);
|
||||
}
|
||||
|
||||
return_ACPI_STATUS(AE_OK);
|
||||
return_ACPI_STATUS(AE_AML_NO_RESOURCE_END_TAG);
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: acpi_rs_list_to_byte_stream
|
||||
* FUNCTION: acpi_rs_convert_resources_to_aml
|
||||
*
|
||||
* PARAMETERS: linked_list - Pointer to the resource linked list
|
||||
* byte_steam_size_needed - Calculated size of the byte stream
|
||||
* needed from calling
|
||||
* acpi_rs_get_byte_stream_length()
|
||||
* The size of the output_buffer is
|
||||
* guaranteed to be >=
|
||||
* byte_stream_size_needed
|
||||
* output_buffer - Pointer to the buffer that will
|
||||
* contain the byte stream
|
||||
* PARAMETERS: Resource - Pointer to the resource linked list
|
||||
* aml_size_needed - Calculated size of the byte stream
|
||||
* needed from calling acpi_rs_get_aml_length()
|
||||
* The size of the output_buffer is
|
||||
* guaranteed to be >= aml_size_needed
|
||||
* output_buffer - Pointer to the buffer that will
|
||||
* contain the byte stream
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
|
|
@ -346,180 +141,69 @@ acpi_rs_byte_stream_to_list(u8 * byte_stream_buffer,
|
|||
******************************************************************************/
|
||||
|
||||
acpi_status
|
||||
acpi_rs_list_to_byte_stream(struct acpi_resource *linked_list,
|
||||
acpi_size byte_stream_size_needed,
|
||||
u8 * output_buffer)
|
||||
acpi_rs_convert_resources_to_aml(struct acpi_resource *resource,
|
||||
acpi_size aml_size_needed, u8 * output_buffer)
|
||||
{
|
||||
u8 *aml = output_buffer;
|
||||
u8 *end_aml = output_buffer + aml_size_needed;
|
||||
acpi_status status;
|
||||
u8 *buffer = output_buffer;
|
||||
acpi_size bytes_consumed = 0;
|
||||
u8 done = FALSE;
|
||||
|
||||
ACPI_FUNCTION_TRACE("rs_list_to_byte_stream");
|
||||
ACPI_FUNCTION_TRACE("rs_convert_resources_to_aml");
|
||||
|
||||
while (!done) {
|
||||
switch (linked_list->id) {
|
||||
case ACPI_RSTYPE_IRQ:
|
||||
/*
|
||||
* IRQ Resource
|
||||
*/
|
||||
status =
|
||||
acpi_rs_irq_stream(linked_list, &buffer,
|
||||
&bytes_consumed);
|
||||
break;
|
||||
/* Walk the resource descriptor list, convert each descriptor */
|
||||
|
||||
case ACPI_RSTYPE_DMA:
|
||||
/*
|
||||
* DMA Resource
|
||||
*/
|
||||
status =
|
||||
acpi_rs_dma_stream(linked_list, &buffer,
|
||||
&bytes_consumed);
|
||||
break;
|
||||
while (aml < end_aml) {
|
||||
/* Validate the (internal) Resource Type */
|
||||
|
||||
case ACPI_RSTYPE_START_DPF:
|
||||
/*
|
||||
* Start Dependent Functions Resource
|
||||
*/
|
||||
status = acpi_rs_start_depend_fns_stream(linked_list,
|
||||
&buffer,
|
||||
&bytes_consumed);
|
||||
break;
|
||||
|
||||
case ACPI_RSTYPE_END_DPF:
|
||||
/*
|
||||
* End Dependent Functions Resource
|
||||
*/
|
||||
status = acpi_rs_end_depend_fns_stream(linked_list,
|
||||
&buffer,
|
||||
&bytes_consumed);
|
||||
break;
|
||||
|
||||
case ACPI_RSTYPE_IO:
|
||||
/*
|
||||
* IO Port Resource
|
||||
*/
|
||||
status =
|
||||
acpi_rs_io_stream(linked_list, &buffer,
|
||||
&bytes_consumed);
|
||||
break;
|
||||
|
||||
case ACPI_RSTYPE_FIXED_IO:
|
||||
/*
|
||||
* Fixed IO Port Resource
|
||||
*/
|
||||
status =
|
||||
acpi_rs_fixed_io_stream(linked_list, &buffer,
|
||||
&bytes_consumed);
|
||||
break;
|
||||
|
||||
case ACPI_RSTYPE_VENDOR:
|
||||
/*
|
||||
* Vendor Defined Resource
|
||||
*/
|
||||
status =
|
||||
acpi_rs_vendor_stream(linked_list, &buffer,
|
||||
&bytes_consumed);
|
||||
break;
|
||||
|
||||
case ACPI_RSTYPE_END_TAG:
|
||||
/*
|
||||
* End Tag
|
||||
*/
|
||||
status =
|
||||
acpi_rs_end_tag_stream(linked_list, &buffer,
|
||||
&bytes_consumed);
|
||||
|
||||
/* An End Tag indicates the end of the Resource Template */
|
||||
|
||||
done = TRUE;
|
||||
break;
|
||||
|
||||
case ACPI_RSTYPE_MEM24:
|
||||
/*
|
||||
* 24-Bit Memory Resource
|
||||
*/
|
||||
status =
|
||||
acpi_rs_memory24_stream(linked_list, &buffer,
|
||||
&bytes_consumed);
|
||||
break;
|
||||
|
||||
case ACPI_RSTYPE_MEM32:
|
||||
/*
|
||||
* 32-Bit Memory Range Resource
|
||||
*/
|
||||
status =
|
||||
acpi_rs_memory32_range_stream(linked_list, &buffer,
|
||||
&bytes_consumed);
|
||||
break;
|
||||
|
||||
case ACPI_RSTYPE_FIXED_MEM32:
|
||||
/*
|
||||
* 32-Bit Fixed Memory Resource
|
||||
*/
|
||||
status =
|
||||
acpi_rs_fixed_memory32_stream(linked_list, &buffer,
|
||||
&bytes_consumed);
|
||||
break;
|
||||
|
||||
case ACPI_RSTYPE_ADDRESS16:
|
||||
/*
|
||||
* 16-Bit Address Descriptor Resource
|
||||
*/
|
||||
status = acpi_rs_address16_stream(linked_list, &buffer,
|
||||
&bytes_consumed);
|
||||
break;
|
||||
|
||||
case ACPI_RSTYPE_ADDRESS32:
|
||||
/*
|
||||
* 32-Bit Address Descriptor Resource
|
||||
*/
|
||||
status = acpi_rs_address32_stream(linked_list, &buffer,
|
||||
&bytes_consumed);
|
||||
break;
|
||||
|
||||
case ACPI_RSTYPE_ADDRESS64:
|
||||
/*
|
||||
* 64-Bit Address Descriptor Resource
|
||||
*/
|
||||
status = acpi_rs_address64_stream(linked_list, &buffer,
|
||||
&bytes_consumed);
|
||||
break;
|
||||
|
||||
case ACPI_RSTYPE_EXT_IRQ:
|
||||
/*
|
||||
* Extended IRQ Resource
|
||||
*/
|
||||
status =
|
||||
acpi_rs_extended_irq_stream(linked_list, &buffer,
|
||||
&bytes_consumed);
|
||||
break;
|
||||
|
||||
default:
|
||||
/*
|
||||
* If we get here, everything is out of sync,
|
||||
* so exit with an error
|
||||
*/
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
||||
"Invalid descriptor type (%X) in resource list\n",
|
||||
linked_list->id));
|
||||
status = AE_BAD_DATA;
|
||||
break;
|
||||
if (resource->type > ACPI_RESOURCE_TYPE_MAX) {
|
||||
ACPI_REPORT_ERROR(("Invalid descriptor type (%X) in resource list\n", resource->type));
|
||||
return_ACPI_STATUS(AE_BAD_DATA);
|
||||
}
|
||||
|
||||
/* Perform the conversion */
|
||||
|
||||
status = acpi_rs_convert_resource_to_aml(resource,
|
||||
ACPI_CAST_PTR(union
|
||||
aml_resource,
|
||||
aml),
|
||||
acpi_gbl_set_resource_dispatch
|
||||
[resource->type]);
|
||||
if (ACPI_FAILURE(status)) {
|
||||
ACPI_REPORT_ERROR(("Could not convert resource (type %X) to AML, %s\n", resource->type, acpi_format_exception(status)));
|
||||
return_ACPI_STATUS(status);
|
||||
}
|
||||
|
||||
/* Perform final sanity check on the new AML resource descriptor */
|
||||
|
||||
status =
|
||||
acpi_ut_validate_resource(ACPI_CAST_PTR
|
||||
(union aml_resource, aml), NULL);
|
||||
if (ACPI_FAILURE(status)) {
|
||||
return_ACPI_STATUS(status);
|
||||
}
|
||||
|
||||
/* Set the Buffer to point to the open byte */
|
||||
/* Check for end-of-list, normal exit */
|
||||
|
||||
buffer += bytes_consumed;
|
||||
if (resource->type == ACPI_RESOURCE_TYPE_END_TAG) {
|
||||
/* An End Tag indicates the end of the input Resource Template */
|
||||
|
||||
/* Point to the next object */
|
||||
return_ACPI_STATUS(AE_OK);
|
||||
}
|
||||
|
||||
linked_list = ACPI_PTR_ADD(struct acpi_resource,
|
||||
linked_list, linked_list->length);
|
||||
/*
|
||||
* Extract the total length of the new descriptor and set the
|
||||
* Aml to point to the next (output) resource descriptor
|
||||
*/
|
||||
aml += acpi_ut_get_descriptor_length(aml);
|
||||
|
||||
/* Point to the next input resource descriptor */
|
||||
|
||||
resource =
|
||||
ACPI_ADD_PTR(struct acpi_resource, resource,
|
||||
resource->length);
|
||||
}
|
||||
|
||||
return_ACPI_STATUS(AE_OK);
|
||||
/* Completed buffer, but did not find an end_tag resource descriptor */
|
||||
|
||||
return_ACPI_STATUS(AE_AML_NO_RESOURCE_END_TAG);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
******************************************************************************/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2000 - 2005, R. Byron Moore
|
||||
* Copyright (C) 2000 - 2006, R. Byron Moore
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
|
@ -49,454 +49,187 @@ ACPI_MODULE_NAME("rsmemory")
|
|||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: acpi_rs_memory24_resource
|
||||
*
|
||||
* PARAMETERS: byte_stream_buffer - Pointer to the resource input byte
|
||||
* stream
|
||||
* bytes_consumed - Pointer to where the number of bytes
|
||||
* consumed the byte_stream_buffer is
|
||||
* returned
|
||||
* output_buffer - Pointer to the return data buffer
|
||||
* structure_size - Pointer to where the number of bytes
|
||||
* in the return data struct is returned
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Take the resource byte stream and fill out the appropriate
|
||||
* structure pointed to by the output_buffer. Return the
|
||||
* number of bytes consumed from the byte stream.
|
||||
* acpi_rs_convert_memory24
|
||||
*
|
||||
******************************************************************************/
|
||||
acpi_status
|
||||
acpi_rs_memory24_resource(u8 * byte_stream_buffer,
|
||||
acpi_size * bytes_consumed,
|
||||
u8 ** output_buffer, acpi_size * structure_size)
|
||||
{
|
||||
u8 *buffer = byte_stream_buffer;
|
||||
struct acpi_resource *output_struct = (void *)*output_buffer;
|
||||
u16 temp16 = 0;
|
||||
u8 temp8 = 0;
|
||||
acpi_size struct_size =
|
||||
ACPI_SIZEOF_RESOURCE(struct acpi_resource_mem24);
|
||||
struct acpi_rsconvert_info acpi_rs_convert_memory24[4] = {
|
||||
{ACPI_RSC_INITGET, ACPI_RESOURCE_TYPE_MEMORY24,
|
||||
ACPI_RS_SIZE(struct acpi_resource_memory24),
|
||||
ACPI_RSC_TABLE_SIZE(acpi_rs_convert_memory24)},
|
||||
|
||||
ACPI_FUNCTION_TRACE("rs_memory24_resource");
|
||||
{ACPI_RSC_INITSET, ACPI_RESOURCE_NAME_MEMORY24,
|
||||
sizeof(struct aml_resource_memory24),
|
||||
0},
|
||||
|
||||
/* Point past the Descriptor to get the number of bytes consumed */
|
||||
/* Read/Write bit */
|
||||
|
||||
buffer += 1;
|
||||
|
||||
ACPI_MOVE_16_TO_16(&temp16, buffer);
|
||||
buffer += 2;
|
||||
*bytes_consumed = (acpi_size) temp16 + 3;
|
||||
output_struct->id = ACPI_RSTYPE_MEM24;
|
||||
|
||||
/* Check Byte 3 the Read/Write bit */
|
||||
|
||||
temp8 = *buffer;
|
||||
buffer += 1;
|
||||
output_struct->data.memory24.read_write_attribute = temp8 & 0x01;
|
||||
|
||||
/* Get min_base_address (Bytes 4-5) */
|
||||
|
||||
ACPI_MOVE_16_TO_16(&temp16, buffer);
|
||||
buffer += 2;
|
||||
output_struct->data.memory24.min_base_address = temp16;
|
||||
|
||||
/* Get max_base_address (Bytes 6-7) */
|
||||
|
||||
ACPI_MOVE_16_TO_16(&temp16, buffer);
|
||||
buffer += 2;
|
||||
output_struct->data.memory24.max_base_address = temp16;
|
||||
|
||||
/* Get Alignment (Bytes 8-9) */
|
||||
|
||||
ACPI_MOVE_16_TO_16(&temp16, buffer);
|
||||
buffer += 2;
|
||||
output_struct->data.memory24.alignment = temp16;
|
||||
|
||||
/* Get range_length (Bytes 10-11) */
|
||||
|
||||
ACPI_MOVE_16_TO_16(&temp16, buffer);
|
||||
output_struct->data.memory24.range_length = temp16;
|
||||
|
||||
/* Set the Length parameter */
|
||||
|
||||
output_struct->length = (u32) struct_size;
|
||||
|
||||
/* Return the final size of the structure */
|
||||
|
||||
*structure_size = struct_size;
|
||||
return_ACPI_STATUS(AE_OK);
|
||||
}
|
||||
{ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.memory24.write_protect),
|
||||
AML_OFFSET(memory24.flags),
|
||||
0},
|
||||
/*
|
||||
* These fields are contiguous in both the source and destination:
|
||||
* Minimum Base Address
|
||||
* Maximum Base Address
|
||||
* Address Base Alignment
|
||||
* Range Length
|
||||
*/
|
||||
{ACPI_RSC_MOVE16, ACPI_RS_OFFSET(data.memory24.minimum),
|
||||
AML_OFFSET(memory24.minimum),
|
||||
4}
|
||||
};
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: acpi_rs_memory24_stream
|
||||
*
|
||||
* PARAMETERS: linked_list - Pointer to the resource linked list
|
||||
* output_buffer - Pointer to the user's return buffer
|
||||
* bytes_consumed - Pointer to where the number of bytes
|
||||
* used in the output_buffer is returned
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Take the linked list resource structure and fills in the
|
||||
* the appropriate bytes in a byte stream
|
||||
* acpi_rs_convert_memory32
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
acpi_status
|
||||
acpi_rs_memory24_stream(struct acpi_resource *linked_list,
|
||||
u8 ** output_buffer, acpi_size * bytes_consumed)
|
||||
{
|
||||
u8 *buffer = *output_buffer;
|
||||
u16 temp16 = 0;
|
||||
u8 temp8 = 0;
|
||||
struct acpi_rsconvert_info acpi_rs_convert_memory32[4] = {
|
||||
{ACPI_RSC_INITGET, ACPI_RESOURCE_TYPE_MEMORY32,
|
||||
ACPI_RS_SIZE(struct acpi_resource_memory32),
|
||||
ACPI_RSC_TABLE_SIZE(acpi_rs_convert_memory32)},
|
||||
|
||||
ACPI_FUNCTION_TRACE("rs_memory24_stream");
|
||||
{ACPI_RSC_INITSET, ACPI_RESOURCE_NAME_MEMORY32,
|
||||
sizeof(struct aml_resource_memory32),
|
||||
0},
|
||||
|
||||
/* The descriptor field is static */
|
||||
/* Read/Write bit */
|
||||
|
||||
*buffer = 0x81;
|
||||
buffer += 1;
|
||||
|
||||
/* The length field is static */
|
||||
|
||||
temp16 = 0x09;
|
||||
ACPI_MOVE_16_TO_16(buffer, &temp16);
|
||||
buffer += 2;
|
||||
|
||||
/* Set the Information Byte */
|
||||
|
||||
temp8 = (u8) (linked_list->data.memory24.read_write_attribute & 0x01);
|
||||
*buffer = temp8;
|
||||
buffer += 1;
|
||||
|
||||
/* Set the Range minimum base address */
|
||||
|
||||
ACPI_MOVE_32_TO_16(buffer,
|
||||
&linked_list->data.memory24.min_base_address);
|
||||
buffer += 2;
|
||||
|
||||
/* Set the Range maximum base address */
|
||||
|
||||
ACPI_MOVE_32_TO_16(buffer,
|
||||
&linked_list->data.memory24.max_base_address);
|
||||
buffer += 2;
|
||||
|
||||
/* Set the base alignment */
|
||||
|
||||
ACPI_MOVE_32_TO_16(buffer, &linked_list->data.memory24.alignment);
|
||||
buffer += 2;
|
||||
|
||||
/* Set the range length */
|
||||
|
||||
ACPI_MOVE_32_TO_16(buffer, &linked_list->data.memory24.range_length);
|
||||
buffer += 2;
|
||||
|
||||
/* Return the number of bytes consumed in this operation */
|
||||
|
||||
*bytes_consumed = ACPI_PTR_DIFF(buffer, *output_buffer);
|
||||
return_ACPI_STATUS(AE_OK);
|
||||
}
|
||||
{ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.memory32.write_protect),
|
||||
AML_OFFSET(memory32.flags),
|
||||
0},
|
||||
/*
|
||||
* These fields are contiguous in both the source and destination:
|
||||
* Minimum Base Address
|
||||
* Maximum Base Address
|
||||
* Address Base Alignment
|
||||
* Range Length
|
||||
*/
|
||||
{ACPI_RSC_MOVE32, ACPI_RS_OFFSET(data.memory32.minimum),
|
||||
AML_OFFSET(memory32.minimum),
|
||||
4}
|
||||
};
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: acpi_rs_memory32_range_resource
|
||||
*
|
||||
* PARAMETERS: byte_stream_buffer - Pointer to the resource input byte
|
||||
* stream
|
||||
* bytes_consumed - Pointer to where the number of bytes
|
||||
* consumed the byte_stream_buffer is
|
||||
* returned
|
||||
* output_buffer - Pointer to the return data buffer
|
||||
* structure_size - Pointer to where the number of bytes
|
||||
* in the return data struct is returned
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Take the resource byte stream and fill out the appropriate
|
||||
* structure pointed to by the output_buffer. Return the
|
||||
* number of bytes consumed from the byte stream.
|
||||
* acpi_rs_convert_fixed_memory32
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
acpi_status
|
||||
acpi_rs_memory32_range_resource(u8 * byte_stream_buffer,
|
||||
acpi_size * bytes_consumed,
|
||||
u8 ** output_buffer, acpi_size * structure_size)
|
||||
{
|
||||
u8 *buffer = byte_stream_buffer;
|
||||
struct acpi_resource *output_struct = (void *)*output_buffer;
|
||||
u16 temp16 = 0;
|
||||
u8 temp8 = 0;
|
||||
acpi_size struct_size =
|
||||
ACPI_SIZEOF_RESOURCE(struct acpi_resource_mem32);
|
||||
struct acpi_rsconvert_info acpi_rs_convert_fixed_memory32[4] = {
|
||||
{ACPI_RSC_INITGET, ACPI_RESOURCE_TYPE_FIXED_MEMORY32,
|
||||
ACPI_RS_SIZE(struct acpi_resource_fixed_memory32),
|
||||
ACPI_RSC_TABLE_SIZE(acpi_rs_convert_fixed_memory32)},
|
||||
|
||||
ACPI_FUNCTION_TRACE("rs_memory32_range_resource");
|
||||
{ACPI_RSC_INITSET, ACPI_RESOURCE_NAME_FIXED_MEMORY32,
|
||||
sizeof(struct aml_resource_fixed_memory32),
|
||||
0},
|
||||
|
||||
/* Point past the Descriptor to get the number of bytes consumed */
|
||||
/* Read/Write bit */
|
||||
|
||||
buffer += 1;
|
||||
{ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.fixed_memory32.write_protect),
|
||||
AML_OFFSET(fixed_memory32.flags),
|
||||
0},
|
||||
/*
|
||||
* These fields are contiguous in both the source and destination:
|
||||
* Base Address
|
||||
* Range Length
|
||||
*/
|
||||
{ACPI_RSC_MOVE32, ACPI_RS_OFFSET(data.fixed_memory32.address),
|
||||
AML_OFFSET(fixed_memory32.address),
|
||||
2}
|
||||
};
|
||||
|
||||
ACPI_MOVE_16_TO_16(&temp16, buffer);
|
||||
buffer += 2;
|
||||
*bytes_consumed = (acpi_size) temp16 + 3;
|
||||
/*******************************************************************************
|
||||
*
|
||||
* acpi_rs_get_vendor_small
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
output_struct->id = ACPI_RSTYPE_MEM32;
|
||||
struct acpi_rsconvert_info acpi_rs_get_vendor_small[3] = {
|
||||
{ACPI_RSC_INITGET, ACPI_RESOURCE_TYPE_VENDOR,
|
||||
ACPI_RS_SIZE(struct acpi_resource_vendor),
|
||||
ACPI_RSC_TABLE_SIZE(acpi_rs_get_vendor_small)},
|
||||
|
||||
/* Length of the vendor data (byte count) */
|
||||
|
||||
{ACPI_RSC_COUNT16, ACPI_RS_OFFSET(data.vendor.byte_length),
|
||||
0,
|
||||
sizeof(u8)}
|
||||
,
|
||||
|
||||
/* Vendor data */
|
||||
|
||||
{ACPI_RSC_MOVE8, ACPI_RS_OFFSET(data.vendor.byte_data[0]),
|
||||
sizeof(struct aml_resource_small_header),
|
||||
0}
|
||||
};
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* acpi_rs_get_vendor_large
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
struct acpi_rsconvert_info acpi_rs_get_vendor_large[3] = {
|
||||
{ACPI_RSC_INITGET, ACPI_RESOURCE_TYPE_VENDOR,
|
||||
ACPI_RS_SIZE(struct acpi_resource_vendor),
|
||||
ACPI_RSC_TABLE_SIZE(acpi_rs_get_vendor_large)},
|
||||
|
||||
/* Length of the vendor data (byte count) */
|
||||
|
||||
{ACPI_RSC_COUNT16, ACPI_RS_OFFSET(data.vendor.byte_length),
|
||||
0,
|
||||
sizeof(u8)}
|
||||
,
|
||||
|
||||
/* Vendor data */
|
||||
|
||||
{ACPI_RSC_MOVE8, ACPI_RS_OFFSET(data.vendor.byte_data[0]),
|
||||
sizeof(struct aml_resource_large_header),
|
||||
0}
|
||||
};
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* acpi_rs_set_vendor
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
struct acpi_rsconvert_info acpi_rs_set_vendor[7] = {
|
||||
/* Default is a small vendor descriptor */
|
||||
|
||||
{ACPI_RSC_INITSET, ACPI_RESOURCE_NAME_VENDOR_SMALL,
|
||||
sizeof(struct aml_resource_small_header),
|
||||
ACPI_RSC_TABLE_SIZE(acpi_rs_set_vendor)},
|
||||
|
||||
/* Get the length and copy the data */
|
||||
|
||||
{ACPI_RSC_COUNT16, ACPI_RS_OFFSET(data.vendor.byte_length),
|
||||
0,
|
||||
0},
|
||||
|
||||
{ACPI_RSC_MOVE8, ACPI_RS_OFFSET(data.vendor.byte_data[0]),
|
||||
sizeof(struct aml_resource_small_header),
|
||||
0},
|
||||
|
||||
/*
|
||||
* Point to the place in the output buffer where the data portion will
|
||||
* begin.
|
||||
* 1. Set the RESOURCE_DATA * Data to point to its own address, then
|
||||
* 2. Set the pointer to the next address.
|
||||
*
|
||||
* NOTE: output_struct->Data is cast to u8, otherwise, this addition adds
|
||||
* 4 * sizeof(RESOURCE_DATA) instead of 4 * sizeof(u8)
|
||||
* All done if the Vendor byte length is 7 or less, meaning that it will
|
||||
* fit within a small descriptor
|
||||
*/
|
||||
{ACPI_RSC_EXIT_LE, 0, 0, 7},
|
||||
|
||||
/* Check Byte 3 the Read/Write bit */
|
||||
/* Must create a large vendor descriptor */
|
||||
|
||||
temp8 = *buffer;
|
||||
buffer += 1;
|
||||
{ACPI_RSC_INITSET, ACPI_RESOURCE_NAME_VENDOR_LARGE,
|
||||
sizeof(struct aml_resource_large_header),
|
||||
0},
|
||||
|
||||
output_struct->data.memory32.read_write_attribute = temp8 & 0x01;
|
||||
{ACPI_RSC_COUNT16, ACPI_RS_OFFSET(data.vendor.byte_length),
|
||||
0,
|
||||
0},
|
||||
|
||||
/* Get min_base_address (Bytes 4-7) */
|
||||
|
||||
ACPI_MOVE_32_TO_32(&output_struct->data.memory32.min_base_address,
|
||||
buffer);
|
||||
buffer += 4;
|
||||
|
||||
/* Get max_base_address (Bytes 8-11) */
|
||||
|
||||
ACPI_MOVE_32_TO_32(&output_struct->data.memory32.max_base_address,
|
||||
buffer);
|
||||
buffer += 4;
|
||||
|
||||
/* Get Alignment (Bytes 12-15) */
|
||||
|
||||
ACPI_MOVE_32_TO_32(&output_struct->data.memory32.alignment, buffer);
|
||||
buffer += 4;
|
||||
|
||||
/* Get range_length (Bytes 16-19) */
|
||||
|
||||
ACPI_MOVE_32_TO_32(&output_struct->data.memory32.range_length, buffer);
|
||||
|
||||
/* Set the Length parameter */
|
||||
|
||||
output_struct->length = (u32) struct_size;
|
||||
|
||||
/* Return the final size of the structure */
|
||||
|
||||
*structure_size = struct_size;
|
||||
return_ACPI_STATUS(AE_OK);
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: acpi_rs_fixed_memory32_resource
|
||||
*
|
||||
* PARAMETERS: byte_stream_buffer - Pointer to the resource input byte
|
||||
* stream
|
||||
* bytes_consumed - Pointer to where the number of bytes
|
||||
* consumed the byte_stream_buffer is
|
||||
* returned
|
||||
* output_buffer - Pointer to the return data buffer
|
||||
* structure_size - Pointer to where the number of bytes
|
||||
* in the return data struct is returned
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Take the resource byte stream and fill out the appropriate
|
||||
* structure pointed to by the output_buffer. Return the
|
||||
* number of bytes consumed from the byte stream.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
acpi_status
|
||||
acpi_rs_fixed_memory32_resource(u8 * byte_stream_buffer,
|
||||
acpi_size * bytes_consumed,
|
||||
u8 ** output_buffer, acpi_size * structure_size)
|
||||
{
|
||||
u8 *buffer = byte_stream_buffer;
|
||||
struct acpi_resource *output_struct = (void *)*output_buffer;
|
||||
u16 temp16 = 0;
|
||||
u8 temp8 = 0;
|
||||
acpi_size struct_size =
|
||||
ACPI_SIZEOF_RESOURCE(struct acpi_resource_fixed_mem32);
|
||||
|
||||
ACPI_FUNCTION_TRACE("rs_fixed_memory32_resource");
|
||||
|
||||
/* Point past the Descriptor to get the number of bytes consumed */
|
||||
|
||||
buffer += 1;
|
||||
ACPI_MOVE_16_TO_16(&temp16, buffer);
|
||||
|
||||
buffer += 2;
|
||||
*bytes_consumed = (acpi_size) temp16 + 3;
|
||||
|
||||
output_struct->id = ACPI_RSTYPE_FIXED_MEM32;
|
||||
|
||||
/* Check Byte 3 the Read/Write bit */
|
||||
|
||||
temp8 = *buffer;
|
||||
buffer += 1;
|
||||
output_struct->data.fixed_memory32.read_write_attribute = temp8 & 0x01;
|
||||
|
||||
/* Get range_base_address (Bytes 4-7) */
|
||||
|
||||
ACPI_MOVE_32_TO_32(&output_struct->data.fixed_memory32.
|
||||
range_base_address, buffer);
|
||||
buffer += 4;
|
||||
|
||||
/* Get range_length (Bytes 8-11) */
|
||||
|
||||
ACPI_MOVE_32_TO_32(&output_struct->data.fixed_memory32.range_length,
|
||||
buffer);
|
||||
|
||||
/* Set the Length parameter */
|
||||
|
||||
output_struct->length = (u32) struct_size;
|
||||
|
||||
/* Return the final size of the structure */
|
||||
|
||||
*structure_size = struct_size;
|
||||
return_ACPI_STATUS(AE_OK);
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: acpi_rs_memory32_range_stream
|
||||
*
|
||||
* PARAMETERS: linked_list - Pointer to the resource linked list
|
||||
* output_buffer - Pointer to the user's return buffer
|
||||
* bytes_consumed - Pointer to where the number of bytes
|
||||
* used in the output_buffer is returned
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Take the linked list resource structure and fills in the
|
||||
* the appropriate bytes in a byte stream
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
acpi_status
|
||||
acpi_rs_memory32_range_stream(struct acpi_resource *linked_list,
|
||||
u8 ** output_buffer, acpi_size * bytes_consumed)
|
||||
{
|
||||
u8 *buffer = *output_buffer;
|
||||
u16 temp16 = 0;
|
||||
u8 temp8 = 0;
|
||||
|
||||
ACPI_FUNCTION_TRACE("rs_memory32_range_stream");
|
||||
|
||||
/* The descriptor field is static */
|
||||
|
||||
*buffer = 0x85;
|
||||
buffer += 1;
|
||||
|
||||
/* The length field is static */
|
||||
|
||||
temp16 = 0x11;
|
||||
|
||||
ACPI_MOVE_16_TO_16(buffer, &temp16);
|
||||
buffer += 2;
|
||||
|
||||
/* Set the Information Byte */
|
||||
|
||||
temp8 = (u8) (linked_list->data.memory32.read_write_attribute & 0x01);
|
||||
*buffer = temp8;
|
||||
buffer += 1;
|
||||
|
||||
/* Set the Range minimum base address */
|
||||
|
||||
ACPI_MOVE_32_TO_32(buffer,
|
||||
&linked_list->data.memory32.min_base_address);
|
||||
buffer += 4;
|
||||
|
||||
/* Set the Range maximum base address */
|
||||
|
||||
ACPI_MOVE_32_TO_32(buffer,
|
||||
&linked_list->data.memory32.max_base_address);
|
||||
buffer += 4;
|
||||
|
||||
/* Set the base alignment */
|
||||
|
||||
ACPI_MOVE_32_TO_32(buffer, &linked_list->data.memory32.alignment);
|
||||
buffer += 4;
|
||||
|
||||
/* Set the range length */
|
||||
|
||||
ACPI_MOVE_32_TO_32(buffer, &linked_list->data.memory32.range_length);
|
||||
buffer += 4;
|
||||
|
||||
/* Return the number of bytes consumed in this operation */
|
||||
|
||||
*bytes_consumed = ACPI_PTR_DIFF(buffer, *output_buffer);
|
||||
return_ACPI_STATUS(AE_OK);
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: acpi_rs_fixed_memory32_stream
|
||||
*
|
||||
* PARAMETERS: linked_list - Pointer to the resource linked list
|
||||
* output_buffer - Pointer to the user's return buffer
|
||||
* bytes_consumed - Pointer to where the number of bytes
|
||||
* used in the output_buffer is returned
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Take the linked list resource structure and fills in the
|
||||
* the appropriate bytes in a byte stream
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
acpi_status
|
||||
acpi_rs_fixed_memory32_stream(struct acpi_resource *linked_list,
|
||||
u8 ** output_buffer, acpi_size * bytes_consumed)
|
||||
{
|
||||
u8 *buffer = *output_buffer;
|
||||
u16 temp16 = 0;
|
||||
u8 temp8 = 0;
|
||||
|
||||
ACPI_FUNCTION_TRACE("rs_fixed_memory32_stream");
|
||||
|
||||
/* The descriptor field is static */
|
||||
|
||||
*buffer = 0x86;
|
||||
buffer += 1;
|
||||
|
||||
/* The length field is static */
|
||||
|
||||
temp16 = 0x09;
|
||||
|
||||
ACPI_MOVE_16_TO_16(buffer, &temp16);
|
||||
buffer += 2;
|
||||
|
||||
/* Set the Information Byte */
|
||||
|
||||
temp8 =
|
||||
(u8) (linked_list->data.fixed_memory32.read_write_attribute & 0x01);
|
||||
*buffer = temp8;
|
||||
buffer += 1;
|
||||
|
||||
/* Set the Range base address */
|
||||
|
||||
ACPI_MOVE_32_TO_32(buffer,
|
||||
&linked_list->data.fixed_memory32.
|
||||
range_base_address);
|
||||
buffer += 4;
|
||||
|
||||
/* Set the range length */
|
||||
|
||||
ACPI_MOVE_32_TO_32(buffer,
|
||||
&linked_list->data.fixed_memory32.range_length);
|
||||
buffer += 4;
|
||||
|
||||
/* Return the number of bytes consumed in this operation */
|
||||
|
||||
*bytes_consumed = ACPI_PTR_DIFF(buffer, *output_buffer);
|
||||
return_ACPI_STATUS(AE_OK);
|
||||
}
|
||||
{ACPI_RSC_MOVE8, ACPI_RS_OFFSET(data.vendor.byte_data[0]),
|
||||
sizeof(struct aml_resource_large_header),
|
||||
0}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
******************************************************************************/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2000 - 2005, R. Byron Moore
|
||||
* Copyright (C) 2000 - 2006, R. Byron Moore
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
|
@ -47,481 +47,495 @@
|
|||
#define _COMPONENT ACPI_RESOURCES
|
||||
ACPI_MODULE_NAME("rsmisc")
|
||||
|
||||
#define INIT_RESOURCE_TYPE(i) i->resource_offset
|
||||
#define INIT_RESOURCE_LENGTH(i) i->aml_offset
|
||||
#define INIT_TABLE_LENGTH(i) i->value
|
||||
#define COMPARE_OPCODE(i) i->resource_offset
|
||||
#define COMPARE_TARGET(i) i->aml_offset
|
||||
#define COMPARE_VALUE(i) i->value
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: acpi_rs_end_tag_resource
|
||||
* FUNCTION: acpi_rs_convert_aml_to_resource
|
||||
*
|
||||
* PARAMETERS: byte_stream_buffer - Pointer to the resource input byte
|
||||
* stream
|
||||
* bytes_consumed - Pointer to where the number of bytes
|
||||
* consumed the byte_stream_buffer is
|
||||
* returned
|
||||
* output_buffer - Pointer to the return data buffer
|
||||
* structure_size - Pointer to where the number of bytes
|
||||
* in the return data struct is returned
|
||||
* PARAMETERS: Resource - Pointer to the resource descriptor
|
||||
* Aml - Where the AML descriptor is returned
|
||||
* Info - Pointer to appropriate conversion table
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Take the resource byte stream and fill out the appropriate
|
||||
* structure pointed to by the output_buffer. Return the
|
||||
* number of bytes consumed from the byte stream.
|
||||
* DESCRIPTION: Convert an external AML resource descriptor to the corresponding
|
||||
* internal resource descriptor
|
||||
*
|
||||
******************************************************************************/
|
||||
acpi_status
|
||||
acpi_rs_end_tag_resource(u8 * byte_stream_buffer,
|
||||
acpi_size * bytes_consumed,
|
||||
u8 ** output_buffer, acpi_size * structure_size)
|
||||
acpi_rs_convert_aml_to_resource(struct acpi_resource *resource,
|
||||
union aml_resource *aml,
|
||||
struct acpi_rsconvert_info *info)
|
||||
{
|
||||
struct acpi_resource *output_struct = (void *)*output_buffer;
|
||||
acpi_size struct_size = ACPI_RESOURCE_LENGTH;
|
||||
acpi_rs_length aml_resource_length;
|
||||
void *source;
|
||||
void *destination;
|
||||
char *target;
|
||||
u8 count;
|
||||
u8 flags_mode = FALSE;
|
||||
u16 item_count = 0;
|
||||
u16 temp16 = 0;
|
||||
|
||||
ACPI_FUNCTION_TRACE("rs_end_tag_resource");
|
||||
ACPI_FUNCTION_TRACE("rs_get_resource");
|
||||
|
||||
/* The number of bytes consumed is static */
|
||||
if (((acpi_native_uint) resource) & 0x3) {
|
||||
acpi_os_printf
|
||||
("**** GET: Misaligned resource pointer: %p Type %2.2X Len %X\n",
|
||||
resource, resource->type, resource->length);
|
||||
}
|
||||
|
||||
*bytes_consumed = 2;
|
||||
/* Extract the resource Length field (does not include header length) */
|
||||
|
||||
/* Fill out the structure */
|
||||
|
||||
output_struct->id = ACPI_RSTYPE_END_TAG;
|
||||
|
||||
/* Set the Length parameter */
|
||||
|
||||
output_struct->length = 0;
|
||||
|
||||
/* Return the final size of the structure */
|
||||
|
||||
*structure_size = struct_size;
|
||||
return_ACPI_STATUS(AE_OK);
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: acpi_rs_end_tag_stream
|
||||
*
|
||||
* PARAMETERS: linked_list - Pointer to the resource linked list
|
||||
* output_buffer - Pointer to the user's return buffer
|
||||
* bytes_consumed - Pointer to where the number of bytes
|
||||
* used in the output_buffer is returned
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Take the linked list resource structure and fills in the
|
||||
* the appropriate bytes in a byte stream
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
acpi_status
|
||||
acpi_rs_end_tag_stream(struct acpi_resource *linked_list,
|
||||
u8 ** output_buffer, acpi_size * bytes_consumed)
|
||||
{
|
||||
u8 *buffer = *output_buffer;
|
||||
u8 temp8 = 0;
|
||||
|
||||
ACPI_FUNCTION_TRACE("rs_end_tag_stream");
|
||||
|
||||
/* The descriptor field is static */
|
||||
|
||||
*buffer = 0x79;
|
||||
buffer += 1;
|
||||
aml_resource_length = acpi_ut_get_resource_length(aml);
|
||||
|
||||
/*
|
||||
* Set the Checksum - zero means that the resource data is treated as if
|
||||
* the checksum operation succeeded (ACPI Spec 1.0b Section 6.4.2.8)
|
||||
* First table entry must be ACPI_RSC_INITxxx and must contain the
|
||||
* table length (# of table entries)
|
||||
*/
|
||||
temp8 = 0;
|
||||
count = INIT_TABLE_LENGTH(info);
|
||||
|
||||
*buffer = temp8;
|
||||
buffer += 1;
|
||||
while (count) {
|
||||
/*
|
||||
* Source is the external AML byte stream buffer,
|
||||
* destination is the internal resource descriptor
|
||||
*/
|
||||
source = ACPI_ADD_PTR(void, aml, info->aml_offset);
|
||||
destination =
|
||||
ACPI_ADD_PTR(void, resource, info->resource_offset);
|
||||
|
||||
/* Return the number of bytes consumed in this operation */
|
||||
switch (info->opcode) {
|
||||
case ACPI_RSC_INITGET:
|
||||
/*
|
||||
* Get the resource type and the initial (minimum) length
|
||||
*/
|
||||
ACPI_MEMSET(resource, 0, INIT_RESOURCE_LENGTH(info));
|
||||
resource->type = INIT_RESOURCE_TYPE(info);
|
||||
resource->length = INIT_RESOURCE_LENGTH(info);
|
||||
break;
|
||||
|
||||
*bytes_consumed = ACPI_PTR_DIFF(buffer, *output_buffer);
|
||||
return_ACPI_STATUS(AE_OK);
|
||||
}
|
||||
case ACPI_RSC_INITSET:
|
||||
break;
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: acpi_rs_vendor_resource
|
||||
*
|
||||
* PARAMETERS: byte_stream_buffer - Pointer to the resource input byte
|
||||
* stream
|
||||
* bytes_consumed - Pointer to where the number of bytes
|
||||
* consumed the byte_stream_buffer is
|
||||
* returned
|
||||
* output_buffer - Pointer to the return data buffer
|
||||
* structure_size - Pointer to where the number of bytes
|
||||
* in the return data struct is returned
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Take the resource byte stream and fill out the appropriate
|
||||
* structure pointed to by the output_buffer. Return the
|
||||
* number of bytes consumed from the byte stream.
|
||||
*
|
||||
******************************************************************************/
|
||||
case ACPI_RSC_FLAGINIT:
|
||||
|
||||
acpi_status
|
||||
acpi_rs_vendor_resource(u8 * byte_stream_buffer,
|
||||
acpi_size * bytes_consumed,
|
||||
u8 ** output_buffer, acpi_size * structure_size)
|
||||
{
|
||||
u8 *buffer = byte_stream_buffer;
|
||||
struct acpi_resource *output_struct = (void *)*output_buffer;
|
||||
u16 temp16 = 0;
|
||||
u8 temp8 = 0;
|
||||
u8 index;
|
||||
acpi_size struct_size =
|
||||
ACPI_SIZEOF_RESOURCE(struct acpi_resource_vendor);
|
||||
flags_mode = TRUE;
|
||||
break;
|
||||
|
||||
ACPI_FUNCTION_TRACE("rs_vendor_resource");
|
||||
case ACPI_RSC_1BITFLAG:
|
||||
/*
|
||||
* Mask and shift the flag bit
|
||||
*/
|
||||
ACPI_SET8(destination) = (u8)
|
||||
((ACPI_GET8(source) >> info->value) & 0x01);
|
||||
break;
|
||||
|
||||
/* Dereference the Descriptor to find if this is a large or small item. */
|
||||
case ACPI_RSC_2BITFLAG:
|
||||
/*
|
||||
* Mask and shift the flag bits
|
||||
*/
|
||||
ACPI_SET8(destination) = (u8)
|
||||
((ACPI_GET8(source) >> info->value) & 0x03);
|
||||
break;
|
||||
|
||||
temp8 = *buffer;
|
||||
case ACPI_RSC_COUNT:
|
||||
|
||||
if (temp8 & 0x80) {
|
||||
/* Large Item, point to the length field */
|
||||
item_count = ACPI_GET8(source);
|
||||
ACPI_SET8(destination) = (u8) item_count;
|
||||
|
||||
buffer += 1;
|
||||
resource->length = resource->length +
|
||||
(info->value * (item_count - 1));
|
||||
break;
|
||||
|
||||
/* Dereference */
|
||||
case ACPI_RSC_COUNT16:
|
||||
|
||||
ACPI_MOVE_16_TO_16(&temp16, buffer);
|
||||
item_count = aml_resource_length;
|
||||
ACPI_SET16(destination) = item_count;
|
||||
|
||||
/* Calculate bytes consumed */
|
||||
resource->length = resource->length +
|
||||
(info->value * (item_count - 1));
|
||||
break;
|
||||
|
||||
*bytes_consumed = (acpi_size) temp16 + 3;
|
||||
case ACPI_RSC_LENGTH:
|
||||
|
||||
/* Point to the first vendor byte */
|
||||
resource->length = resource->length + info->value;
|
||||
break;
|
||||
|
||||
buffer += 2;
|
||||
} else {
|
||||
/* Small Item, dereference the size */
|
||||
case ACPI_RSC_MOVE8:
|
||||
case ACPI_RSC_MOVE16:
|
||||
case ACPI_RSC_MOVE32:
|
||||
case ACPI_RSC_MOVE64:
|
||||
/*
|
||||
* Raw data move. Use the Info value field unless item_count has
|
||||
* been previously initialized via a COUNT opcode
|
||||
*/
|
||||
if (info->value) {
|
||||
item_count = info->value;
|
||||
}
|
||||
acpi_rs_move_data(destination, source, item_count,
|
||||
info->opcode);
|
||||
break;
|
||||
|
||||
temp16 = (u8) (*buffer & 0x07);
|
||||
case ACPI_RSC_SET8:
|
||||
|
||||
/* Calculate bytes consumed */
|
||||
ACPI_MEMSET(destination, info->aml_offset, info->value);
|
||||
break;
|
||||
|
||||
*bytes_consumed = (acpi_size) temp16 + 1;
|
||||
case ACPI_RSC_DATA8:
|
||||
|
||||
/* Point to the first vendor byte */
|
||||
target = ACPI_ADD_PTR(char, resource, info->value);
|
||||
ACPI_MEMCPY(destination, source, ACPI_GET16(target));
|
||||
break;
|
||||
|
||||
buffer += 1;
|
||||
}
|
||||
case ACPI_RSC_ADDRESS:
|
||||
/*
|
||||
* Common handler for address descriptor flags
|
||||
*/
|
||||
if (!acpi_rs_get_address_common(resource, aml)) {
|
||||
return_ACPI_STATUS
|
||||
(AE_AML_INVALID_RESOURCE_TYPE);
|
||||
}
|
||||
break;
|
||||
|
||||
output_struct->id = ACPI_RSTYPE_VENDOR;
|
||||
output_struct->data.vendor_specific.length = temp16;
|
||||
case ACPI_RSC_SOURCE:
|
||||
/*
|
||||
* Optional resource_source (Index and String)
|
||||
*/
|
||||
resource->length +=
|
||||
acpi_rs_get_resource_source(aml_resource_length,
|
||||
info->value,
|
||||
destination, aml, NULL);
|
||||
break;
|
||||
|
||||
for (index = 0; index < temp16; index++) {
|
||||
output_struct->data.vendor_specific.reserved[index] = *buffer;
|
||||
buffer += 1;
|
||||
}
|
||||
case ACPI_RSC_SOURCEX:
|
||||
/*
|
||||
* Optional resource_source (Index and String). This is the more
|
||||
* complicated case used by the Interrupt() macro
|
||||
*/
|
||||
target =
|
||||
ACPI_ADD_PTR(char, resource,
|
||||
info->aml_offset + (item_count * 4));
|
||||
|
||||
/*
|
||||
* In order for the struct_size to fall on a 32-bit boundary,
|
||||
* calculate the length of the vendor string and expand the
|
||||
* struct_size to the next 32-bit boundary.
|
||||
*/
|
||||
struct_size += ACPI_ROUND_UP_to_32_bITS(temp16);
|
||||
resource->length +=
|
||||
acpi_rs_get_resource_source(aml_resource_length,
|
||||
(acpi_rs_length) (((item_count - 1) * sizeof(u32)) + info->value), destination, aml, target);
|
||||
break;
|
||||
|
||||
/* Set the Length parameter */
|
||||
case ACPI_RSC_BITMASK:
|
||||
/*
|
||||
* 8-bit encoded bitmask (DMA macro)
|
||||
*/
|
||||
item_count =
|
||||
acpi_rs_decode_bitmask(ACPI_GET8(source),
|
||||
destination);
|
||||
if (item_count) {
|
||||
resource->length += (item_count - 1);
|
||||
}
|
||||
|
||||
output_struct->length = (u32) struct_size;
|
||||
target = ACPI_ADD_PTR(char, resource, info->value);
|
||||
ACPI_SET8(target) = (u8) item_count;
|
||||
break;
|
||||
|
||||
/* Return the final size of the structure */
|
||||
case ACPI_RSC_BITMASK16:
|
||||
/*
|
||||
* 16-bit encoded bitmask (IRQ macro)
|
||||
*/
|
||||
ACPI_MOVE_16_TO_16(&temp16, source);
|
||||
|
||||
*structure_size = struct_size;
|
||||
return_ACPI_STATUS(AE_OK);
|
||||
}
|
||||
item_count =
|
||||
acpi_rs_decode_bitmask(temp16, destination);
|
||||
if (item_count) {
|
||||
resource->length += (item_count - 1);
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: acpi_rs_vendor_stream
|
||||
*
|
||||
* PARAMETERS: linked_list - Pointer to the resource linked list
|
||||
* output_buffer - Pointer to the user's return buffer
|
||||
* bytes_consumed - Pointer to where the number of bytes
|
||||
* used in the output_buffer is returned
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Take the linked list resource structure and fills in the
|
||||
* the appropriate bytes in a byte stream
|
||||
*
|
||||
******************************************************************************/
|
||||
target = ACPI_ADD_PTR(char, resource, info->value);
|
||||
ACPI_SET8(target) = (u8) item_count;
|
||||
break;
|
||||
|
||||
acpi_status
|
||||
acpi_rs_vendor_stream(struct acpi_resource *linked_list,
|
||||
u8 ** output_buffer, acpi_size * bytes_consumed)
|
||||
{
|
||||
u8 *buffer = *output_buffer;
|
||||
u16 temp16 = 0;
|
||||
u8 temp8 = 0;
|
||||
u8 index;
|
||||
case ACPI_RSC_EXIT_NE:
|
||||
/*
|
||||
* Control - Exit conversion if not equal
|
||||
*/
|
||||
switch (info->resource_offset) {
|
||||
case ACPI_RSC_COMPARE_AML_LENGTH:
|
||||
if (aml_resource_length != info->value) {
|
||||
goto exit;
|
||||
}
|
||||
break;
|
||||
|
||||
ACPI_FUNCTION_TRACE("rs_vendor_stream");
|
||||
case ACPI_RSC_COMPARE_VALUE:
|
||||
if (ACPI_GET8(source) != info->value) {
|
||||
goto exit;
|
||||
}
|
||||
break;
|
||||
|
||||
/* Dereference the length to find if this is a large or small item. */
|
||||
default:
|
||||
acpi_os_printf
|
||||
("*** Invalid conversion sub-opcode\n");
|
||||
return_ACPI_STATUS(AE_BAD_PARAMETER);
|
||||
}
|
||||
break;
|
||||
|
||||
if (linked_list->data.vendor_specific.length > 7) {
|
||||
/* Large Item, Set the descriptor field and length bytes */
|
||||
default:
|
||||
|
||||
*buffer = 0x84;
|
||||
buffer += 1;
|
||||
|
||||
temp16 = (u16) linked_list->data.vendor_specific.length;
|
||||
|
||||
ACPI_MOVE_16_TO_16(buffer, &temp16);
|
||||
buffer += 2;
|
||||
} else {
|
||||
/* Small Item, Set the descriptor field */
|
||||
|
||||
temp8 = 0x70;
|
||||
temp8 |= (u8) linked_list->data.vendor_specific.length;
|
||||
|
||||
*buffer = temp8;
|
||||
buffer += 1;
|
||||
}
|
||||
|
||||
/* Loop through all of the Vendor Specific fields */
|
||||
|
||||
for (index = 0; index < linked_list->data.vendor_specific.length;
|
||||
index++) {
|
||||
temp8 = linked_list->data.vendor_specific.reserved[index];
|
||||
|
||||
*buffer = temp8;
|
||||
buffer += 1;
|
||||
}
|
||||
|
||||
/* Return the number of bytes consumed in this operation */
|
||||
|
||||
*bytes_consumed = ACPI_PTR_DIFF(buffer, *output_buffer);
|
||||
return_ACPI_STATUS(AE_OK);
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: acpi_rs_start_depend_fns_resource
|
||||
*
|
||||
* PARAMETERS: byte_stream_buffer - Pointer to the resource input byte
|
||||
* stream
|
||||
* bytes_consumed - Pointer to where the number of bytes
|
||||
* consumed the byte_stream_buffer is
|
||||
* returned
|
||||
* output_buffer - Pointer to the return data buffer
|
||||
* structure_size - Pointer to where the number of bytes
|
||||
* in the return data struct is returned
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Take the resource byte stream and fill out the appropriate
|
||||
* structure pointed to by the output_buffer. Return the
|
||||
* number of bytes consumed from the byte stream.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
acpi_status
|
||||
acpi_rs_start_depend_fns_resource(u8 * byte_stream_buffer,
|
||||
acpi_size * bytes_consumed,
|
||||
u8 ** output_buffer,
|
||||
acpi_size * structure_size)
|
||||
{
|
||||
u8 *buffer = byte_stream_buffer;
|
||||
struct acpi_resource *output_struct = (void *)*output_buffer;
|
||||
u8 temp8 = 0;
|
||||
acpi_size struct_size =
|
||||
ACPI_SIZEOF_RESOURCE(struct acpi_resource_start_dpf);
|
||||
|
||||
ACPI_FUNCTION_TRACE("rs_start_depend_fns_resource");
|
||||
|
||||
/* The number of bytes consumed are found in the descriptor (Bits:0-1) */
|
||||
|
||||
temp8 = *buffer;
|
||||
|
||||
*bytes_consumed = (temp8 & 0x01) + 1;
|
||||
|
||||
output_struct->id = ACPI_RSTYPE_START_DPF;
|
||||
|
||||
/* Point to Byte 1 if it is used */
|
||||
|
||||
if (2 == *bytes_consumed) {
|
||||
buffer += 1;
|
||||
temp8 = *buffer;
|
||||
|
||||
/* Check Compatibility priority */
|
||||
|
||||
output_struct->data.start_dpf.compatibility_priority =
|
||||
temp8 & 0x03;
|
||||
|
||||
if (3 == output_struct->data.start_dpf.compatibility_priority) {
|
||||
return_ACPI_STATUS(AE_AML_BAD_RESOURCE_VALUE);
|
||||
acpi_os_printf("*** Invalid conversion opcode\n");
|
||||
return_ACPI_STATUS(AE_BAD_PARAMETER);
|
||||
}
|
||||
|
||||
/* Check Performance/Robustness preference */
|
||||
|
||||
output_struct->data.start_dpf.performance_robustness =
|
||||
(temp8 >> 2) & 0x03;
|
||||
|
||||
if (3 == output_struct->data.start_dpf.performance_robustness) {
|
||||
return_ACPI_STATUS(AE_AML_BAD_RESOURCE_VALUE);
|
||||
}
|
||||
} else {
|
||||
output_struct->data.start_dpf.compatibility_priority =
|
||||
ACPI_ACCEPTABLE_CONFIGURATION;
|
||||
|
||||
output_struct->data.start_dpf.performance_robustness =
|
||||
ACPI_ACCEPTABLE_CONFIGURATION;
|
||||
count--;
|
||||
info++;
|
||||
}
|
||||
|
||||
/* Set the Length parameter */
|
||||
exit:
|
||||
if (!flags_mode) {
|
||||
/* Round the resource struct length up to the next 32-bit boundary */
|
||||
|
||||
output_struct->length = (u32) struct_size;
|
||||
|
||||
/* Return the final size of the structure */
|
||||
|
||||
*structure_size = struct_size;
|
||||
resource->length = ACPI_ROUND_UP_to_32_bITS(resource->length);
|
||||
}
|
||||
return_ACPI_STATUS(AE_OK);
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: acpi_rs_end_depend_fns_resource
|
||||
* FUNCTION: acpi_rs_convert_resource_to_aml
|
||||
*
|
||||
* PARAMETERS: byte_stream_buffer - Pointer to the resource input byte
|
||||
* stream
|
||||
* bytes_consumed - Pointer to where the number of bytes
|
||||
* consumed the byte_stream_buffer is
|
||||
* returned
|
||||
* output_buffer - Pointer to the return data buffer
|
||||
* structure_size - Pointer to where the number of bytes
|
||||
* in the return data struct is returned
|
||||
* PARAMETERS: Resource - Pointer to the resource descriptor
|
||||
* Aml - Where the AML descriptor is returned
|
||||
* Info - Pointer to appropriate conversion table
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Take the resource byte stream and fill out the appropriate
|
||||
* structure pointed to by the output_buffer. Return the
|
||||
* number of bytes consumed from the byte stream.
|
||||
* DESCRIPTION: Convert an internal resource descriptor to the corresponding
|
||||
* external AML resource descriptor.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
acpi_status
|
||||
acpi_rs_end_depend_fns_resource(u8 * byte_stream_buffer,
|
||||
acpi_size * bytes_consumed,
|
||||
u8 ** output_buffer, acpi_size * structure_size)
|
||||
acpi_rs_convert_resource_to_aml(struct acpi_resource *resource,
|
||||
union aml_resource *aml,
|
||||
struct acpi_rsconvert_info *info)
|
||||
{
|
||||
struct acpi_resource *output_struct = (void *)*output_buffer;
|
||||
acpi_size struct_size = ACPI_RESOURCE_LENGTH;
|
||||
void *source = NULL;
|
||||
void *destination;
|
||||
acpi_rsdesc_size aml_length = 0;
|
||||
u8 count;
|
||||
u16 temp16 = 0;
|
||||
u16 item_count = 0;
|
||||
|
||||
ACPI_FUNCTION_TRACE("rs_end_depend_fns_resource");
|
||||
|
||||
/* The number of bytes consumed is static */
|
||||
|
||||
*bytes_consumed = 1;
|
||||
|
||||
/* Fill out the structure */
|
||||
|
||||
output_struct->id = ACPI_RSTYPE_END_DPF;
|
||||
|
||||
/* Set the Length parameter */
|
||||
|
||||
output_struct->length = (u32) struct_size;
|
||||
|
||||
/* Return the final size of the structure */
|
||||
|
||||
*structure_size = struct_size;
|
||||
return_ACPI_STATUS(AE_OK);
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: acpi_rs_start_depend_fns_stream
|
||||
*
|
||||
* PARAMETERS: linked_list - Pointer to the resource linked list
|
||||
* output_buffer - Pointer to the user's return buffer
|
||||
* bytes_consumed - u32 pointer that is filled with
|
||||
* the number of bytes of the
|
||||
* output_buffer used
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Take the linked list resource structure and fills in the
|
||||
* the appropriate bytes in a byte stream
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
acpi_status
|
||||
acpi_rs_start_depend_fns_stream(struct acpi_resource *linked_list,
|
||||
u8 ** output_buffer, acpi_size * bytes_consumed)
|
||||
{
|
||||
u8 *buffer = *output_buffer;
|
||||
u8 temp8 = 0;
|
||||
|
||||
ACPI_FUNCTION_TRACE("rs_start_depend_fns_stream");
|
||||
ACPI_FUNCTION_TRACE("rs_convert_resource_to_aml");
|
||||
|
||||
/*
|
||||
* The descriptor field is set based upon whether a byte is needed
|
||||
* to contain Priority data.
|
||||
* First table entry must be ACPI_RSC_INITxxx and must contain the
|
||||
* table length (# of table entries)
|
||||
*/
|
||||
if (ACPI_ACCEPTABLE_CONFIGURATION ==
|
||||
linked_list->data.start_dpf.compatibility_priority &&
|
||||
ACPI_ACCEPTABLE_CONFIGURATION ==
|
||||
linked_list->data.start_dpf.performance_robustness) {
|
||||
*buffer = 0x30;
|
||||
} else {
|
||||
*buffer = 0x31;
|
||||
buffer += 1;
|
||||
count = INIT_TABLE_LENGTH(info);
|
||||
|
||||
/* Set the Priority Byte Definition */
|
||||
while (count) {
|
||||
/*
|
||||
* Source is the internal resource descriptor,
|
||||
* destination is the external AML byte stream buffer
|
||||
*/
|
||||
source = ACPI_ADD_PTR(void, resource, info->resource_offset);
|
||||
destination = ACPI_ADD_PTR(void, aml, info->aml_offset);
|
||||
|
||||
temp8 = 0;
|
||||
temp8 =
|
||||
(u8) ((linked_list->data.start_dpf.
|
||||
performance_robustness & 0x03) << 2);
|
||||
temp8 |=
|
||||
(linked_list->data.start_dpf.compatibility_priority & 0x03);
|
||||
*buffer = temp8;
|
||||
switch (info->opcode) {
|
||||
case ACPI_RSC_INITSET:
|
||||
|
||||
ACPI_MEMSET(aml, 0, INIT_RESOURCE_LENGTH(info));
|
||||
aml_length = INIT_RESOURCE_LENGTH(info);
|
||||
acpi_rs_set_resource_header(INIT_RESOURCE_TYPE(info),
|
||||
aml_length, aml);
|
||||
break;
|
||||
|
||||
case ACPI_RSC_INITGET:
|
||||
break;
|
||||
|
||||
case ACPI_RSC_FLAGINIT:
|
||||
/*
|
||||
* Clear the flag byte
|
||||
*/
|
||||
ACPI_SET8(destination) = 0;
|
||||
break;
|
||||
|
||||
case ACPI_RSC_1BITFLAG:
|
||||
/*
|
||||
* Mask and shift the flag bit
|
||||
*/
|
||||
ACPI_SET8(destination) |= (u8)
|
||||
((ACPI_GET8(source) & 0x01) << info->value);
|
||||
break;
|
||||
|
||||
case ACPI_RSC_2BITFLAG:
|
||||
/*
|
||||
* Mask and shift the flag bits
|
||||
*/
|
||||
ACPI_SET8(destination) |= (u8)
|
||||
((ACPI_GET8(source) & 0x03) << info->value);
|
||||
break;
|
||||
|
||||
case ACPI_RSC_COUNT:
|
||||
|
||||
item_count = ACPI_GET8(source);
|
||||
ACPI_SET8(destination) = (u8) item_count;
|
||||
|
||||
aml_length =
|
||||
(u16) (aml_length +
|
||||
(info->value * (item_count - 1)));
|
||||
break;
|
||||
|
||||
case ACPI_RSC_COUNT16:
|
||||
|
||||
item_count = ACPI_GET16(source);
|
||||
aml_length = (u16) (aml_length + item_count);
|
||||
acpi_rs_set_resource_length(aml_length, aml);
|
||||
break;
|
||||
|
||||
case ACPI_RSC_LENGTH:
|
||||
|
||||
acpi_rs_set_resource_length(info->value, aml);
|
||||
break;
|
||||
|
||||
case ACPI_RSC_MOVE8:
|
||||
case ACPI_RSC_MOVE16:
|
||||
case ACPI_RSC_MOVE32:
|
||||
case ACPI_RSC_MOVE64:
|
||||
|
||||
if (info->value) {
|
||||
item_count = info->value;
|
||||
}
|
||||
acpi_rs_move_data(destination, source, item_count,
|
||||
info->opcode);
|
||||
break;
|
||||
|
||||
case ACPI_RSC_ADDRESS:
|
||||
|
||||
/* Set the Resource Type, General Flags, and Type-Specific Flags */
|
||||
|
||||
acpi_rs_set_address_common(aml, resource);
|
||||
break;
|
||||
|
||||
case ACPI_RSC_SOURCEX:
|
||||
/*
|
||||
* Optional resource_source (Index and String)
|
||||
*/
|
||||
aml_length =
|
||||
acpi_rs_set_resource_source(aml,
|
||||
(acpi_rs_length)
|
||||
aml_length, source);
|
||||
acpi_rs_set_resource_length(aml_length, aml);
|
||||
break;
|
||||
|
||||
case ACPI_RSC_SOURCE:
|
||||
/*
|
||||
* Optional resource_source (Index and String). This is the more
|
||||
* complicated case used by the Interrupt() macro
|
||||
*/
|
||||
aml_length =
|
||||
acpi_rs_set_resource_source(aml, info->value,
|
||||
source);
|
||||
acpi_rs_set_resource_length(aml_length, aml);
|
||||
break;
|
||||
|
||||
case ACPI_RSC_BITMASK:
|
||||
/*
|
||||
* 8-bit encoded bitmask (DMA macro)
|
||||
*/
|
||||
ACPI_SET8(destination) = (u8)
|
||||
acpi_rs_encode_bitmask(source,
|
||||
*ACPI_ADD_PTR(u8, resource,
|
||||
info->value));
|
||||
break;
|
||||
|
||||
case ACPI_RSC_BITMASK16:
|
||||
/*
|
||||
* 16-bit encoded bitmask (IRQ macro)
|
||||
*/
|
||||
temp16 = acpi_rs_encode_bitmask(source,
|
||||
*ACPI_ADD_PTR(u8,
|
||||
resource,
|
||||
info->
|
||||
value));
|
||||
ACPI_MOVE_16_TO_16(destination, &temp16);
|
||||
break;
|
||||
|
||||
case ACPI_RSC_EXIT_LE:
|
||||
/*
|
||||
* Control - Exit conversion if less than or equal
|
||||
*/
|
||||
if (item_count <= info->value) {
|
||||
goto exit;
|
||||
}
|
||||
break;
|
||||
|
||||
case ACPI_RSC_EXIT_NE:
|
||||
/*
|
||||
* Control - Exit conversion if not equal
|
||||
*/
|
||||
switch (COMPARE_OPCODE(info)) {
|
||||
case ACPI_RSC_COMPARE_VALUE:
|
||||
|
||||
if (*ACPI_ADD_PTR(u8, resource,
|
||||
COMPARE_TARGET(info)) !=
|
||||
COMPARE_VALUE(info)) {
|
||||
goto exit;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
acpi_os_printf
|
||||
("*** Invalid conversion sub-opcode\n");
|
||||
return_ACPI_STATUS(AE_BAD_PARAMETER);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
acpi_os_printf("*** Invalid conversion opcode\n");
|
||||
return_ACPI_STATUS(AE_BAD_PARAMETER);
|
||||
}
|
||||
|
||||
count--;
|
||||
info++;
|
||||
}
|
||||
|
||||
buffer += 1;
|
||||
|
||||
/* Return the number of bytes consumed in this operation */
|
||||
|
||||
*bytes_consumed = ACPI_PTR_DIFF(buffer, *output_buffer);
|
||||
exit:
|
||||
return_ACPI_STATUS(AE_OK);
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: acpi_rs_end_depend_fns_stream
|
||||
*
|
||||
* PARAMETERS: linked_list - Pointer to the resource linked list
|
||||
* output_buffer - Pointer to the user's return buffer
|
||||
* bytes_consumed - Pointer to where the number of bytes
|
||||
* used in the output_buffer is returned
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Take the linked list resource structure and fills in the
|
||||
* the appropriate bytes in a byte stream
|
||||
*
|
||||
******************************************************************************/
|
||||
#if 0
|
||||
/* Previous resource validations */
|
||||
|
||||
acpi_status
|
||||
acpi_rs_end_depend_fns_stream(struct acpi_resource *linked_list,
|
||||
u8 ** output_buffer, acpi_size * bytes_consumed)
|
||||
{
|
||||
u8 *buffer = *output_buffer;
|
||||
|
||||
ACPI_FUNCTION_TRACE("rs_end_depend_fns_stream");
|
||||
|
||||
/* The descriptor field is static */
|
||||
|
||||
*buffer = 0x38;
|
||||
buffer += 1;
|
||||
|
||||
/* Return the number of bytes consumed in this operation */
|
||||
|
||||
*bytes_consumed = ACPI_PTR_DIFF(buffer, *output_buffer);
|
||||
return_ACPI_STATUS(AE_OK);
|
||||
if (aml->ext_address64.revision_iD != AML_RESOURCE_EXTENDED_ADDRESS_REVISION) {
|
||||
return_ACPI_STATUS(AE_SUPPORT);
|
||||
}
|
||||
|
||||
if (resource->data.start_dpf.performance_robustness >= 3) {
|
||||
return_ACPI_STATUS(AE_AML_BAD_RESOURCE_VALUE);
|
||||
}
|
||||
|
||||
if (((aml->irq.flags & 0x09) == 0x00) || ((aml->irq.flags & 0x09) == 0x09)) {
|
||||
/*
|
||||
* Only [active_high, edge_sensitive] or [active_low, level_sensitive]
|
||||
* polarity/trigger interrupts are allowed (ACPI spec, section
|
||||
* "IRQ Format"), so 0x00 and 0x09 are illegal.
|
||||
*/
|
||||
ACPI_REPORT_ERROR(("Invalid interrupt polarity/trigger in resource list, %X\n", aml->irq.flags));
|
||||
return_ACPI_STATUS(AE_BAD_DATA);
|
||||
}
|
||||
|
||||
resource->data.extended_irq.interrupt_count = temp8;
|
||||
if (temp8 < 1) {
|
||||
/* Must have at least one IRQ */
|
||||
|
||||
return_ACPI_STATUS(AE_AML_BAD_RESOURCE_LENGTH);
|
||||
}
|
||||
|
||||
if (resource->data.dma.transfer == 0x03) {
|
||||
ACPI_REPORT_ERROR(("Invalid DMA.Transfer preference (3)\n"));
|
||||
return_ACPI_STATUS(AE_BAD_DATA);
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue