void *context,
void **return_value)
{
+ struct acpi_init_walk_info *info = (struct acpi_init_walk_info *) context;
+ struct acpi_namespace_node *node = (struct acpi_namespace_node *) obj_handle;
acpi_object_type type;
acpi_status status;
- struct acpi_init_walk_info *info = (struct acpi_init_walk_info *) context;
ACPI_FUNCTION_NAME ("ds_init_one_object");
/*
- * We are only interested in objects owned by the table that
+ * We are only interested in NS nodes owned by the table that
* was just loaded
*/
- if (((struct acpi_namespace_node *) obj_handle)->owner_id !=
- info->table_desc->owner_id) {
+ if (node->owner_id != info->table_desc->owner_id) {
return (AE_OK);
}
case ACPI_TYPE_METHOD:
- info->method_count++;
-
/*
* Print a dot for each method unless we are going to print
* the entire pathname
* on a per-table basis. Currently, we just use a global for the width.
*/
if (info->table_desc->pointer->revision == 1) {
- ((struct acpi_namespace_node *) obj_handle)->flags |= ANOBJ_DATA_WIDTH_32;
+ node->flags |= ANOBJ_DATA_WIDTH_32;
}
/*
status = acpi_ds_parse_method (obj_handle);
if (ACPI_FAILURE (status)) {
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
- "Method %p [%4.4s] - parse failure, %s\n",
+ "\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 */
-
- break;
}
- /*
- * Delete the parse tree. We simply re-parse the method
- * for every execution since there isn't much overhead
- */
- acpi_ns_delete_namespace_subtree (obj_handle);
- acpi_ns_delete_namespace_by_owner (
- ((struct acpi_namespace_node *) obj_handle)->object->method.owner_id);
+ info->method_count++;
break;
*
* FUNCTION: acpi_ds_parse_method
*
- * PARAMETERS: obj_handle - Method node
+ * PARAMETERS: Node - Method node
*
* RETURN: Status
*
- * DESCRIPTION: Call the parser and parse the AML that is associated with the
- * method.
+ * DESCRIPTION: Parse the AML that is associated with the method.
*
* MUTEX: Assumes parser is locked
*
acpi_status
acpi_ds_parse_method (
- acpi_handle obj_handle)
+ struct acpi_namespace_node *node)
{
acpi_status status;
union acpi_operand_object *obj_desc;
union acpi_parse_object *op;
- struct acpi_namespace_node *node;
struct acpi_walk_state *walk_state;
- ACPI_FUNCTION_TRACE_PTR ("ds_parse_method", obj_handle);
+ ACPI_FUNCTION_TRACE_PTR ("ds_parse_method", node);
/* Parameter Validation */
- if (!obj_handle) {
+ 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 (obj_handle), obj_handle));
+ acpi_ut_get_node_name (node), node));
/* Extract the method object from the method Node */
- node = (struct acpi_namespace_node *) obj_handle;
obj_desc = acpi_ns_get_attached_object (node);
if (!obj_desc) {
return_ACPI_STATUS (AE_NULL_OBJECT);
ACPI_DEBUG_PRINT ((ACPI_DB_PARSE,
"**** [%4.4s] Parsed **** named_obj=%p Op=%p\n",
- acpi_ut_get_node_name (obj_handle), obj_handle, op));
+ 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:
- (void) acpi_ut_release_owner_id (obj_desc->method.owner_id);
+ acpi_ut_release_owner_id (&obj_desc->method.owner_id);
cleanup:
acpi_ps_delete_parse_tree (op);
/* On error, we must delete the new walk state */
cleanup:
- (void) acpi_ut_release_owner_id (obj_desc->method.owner_id);
+ acpi_ut_release_owner_id (&obj_desc->method.owner_id);
if (next_walk_state && (next_walk_state->method_desc)) {
/* Decrement the thread count on the method parse tree */
*/
if ((walk_state->method_desc->method.concurrency == 1) &&
(!walk_state->method_desc->method.semaphore)) {
- status = acpi_os_create_semaphore (1,
- 1,
+ status = acpi_os_create_semaphore (1, 1,
&walk_state->method_desc->method.semaphore);
}
*/
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);
+
if (ACPI_FAILURE (status)) {
return_ACPI_STATUS (status);
}
u8 *aml_start,
u32 aml_length,
struct acpi_parameter_info *info,
- u32 pass_number)
+ u8 pass_number)
{
acpi_status status;
struct acpi_parse_state *parser_state = &walk_state->parser_state;
/* The next_op of the next_walk will be the beginning of the method */
walk_state->next_op = NULL;
- walk_state->pass_number = (u8) pass_number;
+ walk_state->pass_number = pass_number;
if (info) {
if (info->parameter_type == ACPI_PARAM_GPE) {
* with an error.
*/
if (status == AE_NO_HARDWARE_RESPONSE) {
+ ACPI_REPORT_ERROR ((
+ "No response from Global Lock hardware, disabling lock\n"));
+
acpi_gbl_global_lock_present = FALSE;
status = AE_OK;
}
return_ACPI_STATUS (AE_NO_MEMORY);
}
+ /* Init the table handle */
+
+ obj_desc->reference.opcode = AML_LOAD_OP;
+ *ddb_handle = obj_desc;
+
/* Install the new table into the local data structures */
ACPI_MEMSET (&table_info, 0, sizeof (struct acpi_table_desc));
table_info.allocation = ACPI_MEM_ALLOCATED;
status = acpi_tb_install_table (&table_info);
+ obj_desc->reference.object = table_info.installed_desc;
+
if (ACPI_FAILURE (status)) {
+ if (status == AE_ALREADY_EXISTS) {
+ /* Table already exists, just return the handle */
+
+ return_ACPI_STATUS (AE_OK);
+ }
goto cleanup;
}
goto cleanup;
}
- /* Init the table handle */
-
- obj_desc->reference.opcode = AML_LOAD_OP;
- obj_desc->reference.object = table_info.installed_desc;
- *ddb_handle = obj_desc;
return_ACPI_STATUS (AE_OK);
cleanup:
acpi_ut_remove_reference (obj_desc);
+ *ddb_handle = NULL;
return_ACPI_STATUS (status);
}
* (Offset contains the table_id)
*/
acpi_ns_delete_namespace_by_owner (table_info->owner_id);
+ acpi_ut_release_owner_id (&table_info->owner_id);
/* Delete the table itself */
acpi_os_printf ("Could not convert name to pathname\n");
}
else {
- acpi_os_printf ("%s\n", ret_buf.pointer);
+ acpi_os_printf ("%s\n", (char *) ret_buf.pointer);
ACPI_MEM_FREE (ret_buf.pointer);
}
}
*/
return_desc = *(operand[0]->reference.where);
if (return_desc) {
- acpi_ut_add_reference (return_desc);
+ acpi_ut_add_reference (return_desc);
}
break;
obj_desc->method.param_count = (u8) ACPI_TO_INTEGER (val);
obj_desc->common.flags |= AOPOBJ_DATA_VALID;
-#if defined (ACPI_ASL_COMPILER) || defined (ACPI_DUMP_App)
+#if defined (ACPI_ASL_COMPILER)
- /*
- * i_aSL Compiler cheats by putting parameter count
- * in the owner_iD (param_count max is 7)
- */
- new_node->owner_id = obj_desc->method.param_count;
+ /* save the parameter count for the i_aSL compiler */
+
+ new_node->value = obj_desc->method.param_count;
#else
/* Mark this as a very SPECIAL method */
obj_desc->method.method_flags = AML_METHOD_INTERNAL_ONLY;
+
+#ifndef ACPI_DUMP_APP
obj_desc->method.implementation = acpi_ut_osi_implementation;
+#endif
#endif
break;
* DESCRIPTION: Initialize a new namespace node and install it amongst
* its peers.
*
- * Note: Current namespace lookup is linear search. However, the
- * nodes are linked in alphabetical order to 1) put all reserved
- * names (start with underscore) first, and to 2) make a readable
- * namespace dump.
+ * Note: Current namespace lookup is linear search. This appears
+ * to be sufficient as namespace searches consume only a small
+ * fraction of the execution time of the ACPI subsystem.
*
******************************************************************************/
{
acpi_owner_id owner_id = 0;
struct acpi_namespace_node *child_node;
-#ifdef ACPI_ALPHABETIC_NAMESPACE
-
- struct acpi_namespace_node *previous_child_node;
-#endif
ACPI_FUNCTION_TRACE ("ns_install_node");
node->peer = parent_node;
}
else {
-#ifdef ACPI_ALPHABETIC_NAMESPACE
- /*
- * Walk the list whilst searching for the correct
- * alphabetic placement.
- */
- previous_child_node = NULL;
- while (acpi_ns_compare_names (acpi_ut_get_node_name (child_node),
- acpi_ut_get_node_name (node)) < 0) {
- if (child_node->flags & ANOBJ_END_OF_PEER_LIST) {
- /* Last peer; Clear end-of-list flag */
-
- child_node->flags &= ~ANOBJ_END_OF_PEER_LIST;
-
- /* This node is the new peer to the child node */
-
- child_node->peer = node;
-
- /* This node is the new end-of-list */
-
- node->flags |= ANOBJ_END_OF_PEER_LIST;
- node->peer = parent_node;
- break;
- }
-
- /* Get next peer */
-
- previous_child_node = child_node;
- child_node = child_node->peer;
- }
-
- /* Did the node get inserted at the end-of-list? */
-
- if (!(node->flags & ANOBJ_END_OF_PEER_LIST)) {
- /*
- * Loop above terminated without reaching the end-of-list.
- * Insert the new node at the current location
- */
- if (previous_child_node) {
- /* Insert node alphabetically */
-
- node->peer = child_node;
- previous_child_node->peer = node;
- }
- else {
- /* Insert node alphabetically at start of list */
-
- node->peer = child_node;
- parent_node->child = node;
- }
- }
-#else
while (!(child_node->flags & ANOBJ_END_OF_PEER_LIST)) {
child_node = child_node->peer;
}
/* Clear end-of-list flag */
child_node->flags &= ~ANOBJ_END_OF_PEER_LIST;
- node->flags |= ANOBJ_END_OF_PEER_LIST;
+ node->flags |= ANOBJ_END_OF_PEER_LIST;
node->peer = parent_node;
-#endif
}
/* Init the new entry */
ACPI_FUNCTION_TRACE_U32 ("ns_delete_namespace_by_owner", owner_id);
+ if (owner_id == 0) {
+ return_VOID;
+ }
+
parent_node = acpi_gbl_root_node;
child_node = NULL;
deletion_node = NULL;
}
}
- (void) acpi_ut_release_owner_id (owner_id);
return_VOID;
}
-#ifdef ACPI_ALPHABETIC_NAMESPACE
-/*******************************************************************************
- *
- * FUNCTION: acpi_ns_compare_names
- *
- * PARAMETERS: Name1 - First name to compare
- * Name2 - Second name to compare
- *
- * RETURN: value from strncmp
- *
- * DESCRIPTION: Compare two ACPI names. Names that are prefixed with an
- * underscore are forced to be alphabetically first.
- *
- ******************************************************************************/
-
-int
-acpi_ns_compare_names (
- char *name1,
- char *name2)
-{
- char reversed_name1[ACPI_NAME_SIZE];
- char reversed_name2[ACPI_NAME_SIZE];
- u32 i;
- u32 j;
-
-
- /*
- * Replace all instances of "underscore" with a value that is smaller so
- * that all names that are prefixed with underscore(s) are alphabetically
- * first.
- *
- * Reverse the name bytewise so we can just do a 32-bit compare instead
- * of a strncmp.
- */
- for (i = 0, j= (ACPI_NAME_SIZE - 1); i < ACPI_NAME_SIZE; i++, j--) {
- reversed_name1[j] = name1[i];
- if (name1[i] == '_') {
- reversed_name1[j] = '*';
- }
-
- reversed_name2[j] = name2[i];
- if (name2[i] == '_') {
- reversed_name2[j] = '*';
- }
- }
-
- return (*(int *) reversed_name1 - *(int *) reversed_name2);
-}
-#endif
-
-
u32 num_segments,
char *pathname)
{
+ acpi_native_uint i;
+
+
ACPI_FUNCTION_NAME ("ns_print_pathname");
ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, "["));
while (num_segments) {
- acpi_os_printf ("%4.4s", pathname);
- pathname += ACPI_NAME_SIZE;
+ for (i = 0; i < 4; i++) {
+ ACPI_IS_PRINT (pathname[i]) ?
+ acpi_os_printf ("%c", pathname[i]) :
+ acpi_os_printf ("?");
+ }
+ pathname += ACPI_NAME_SIZE;
num_segments--;
if (num_segments) {
acpi_os_printf (".");
*
* PARAMETERS: Info - Method info block, contains:
* Node - Method Node to execute
+ * obj_desc - Method object
* Parameters - List of parameters to pass to the method,
* terminated by NULL. Params itself may be
* NULL if no parameters are being passed.
struct acpi_parameter_info *info)
{
acpi_status status;
- union acpi_operand_object *obj_desc;
ACPI_FUNCTION_TRACE ("ns_execute_control_method");
/* Verify that there is a method associated with this object */
- obj_desc = acpi_ns_get_attached_object (info->node);
- if (!obj_desc) {
+ 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"));
(void) acpi_ut_release_mutex (ACPI_MTX_NAMESPACE);
ACPI_LV_INFO, _COMPONENT);
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Method at AML address %p Length %X\n",
- obj_desc->method.aml_start + 1, obj_desc->method.aml_length - 1));
+ info->obj_desc->method.aml_start + 1, info->obj_desc->method.aml_length - 1));
/*
* Unlock the namespace before execution. This allows namespace access
return_ACPI_STATUS (status);
}
- status = acpi_psx_execute (info);
+ status = acpi_ps_execute_method (info);
acpi_ex_exit_interpreter ();
return_ACPI_STATUS (status);
switch (table_type) {
case ACPI_TABLE_DSDT:
- ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Loading DSDT\n"));
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Namespace load: DSDT\n"));
table_desc = acpi_gbl_table_lists[ACPI_TABLE_DSDT].next;
case ACPI_TABLE_SSDT:
+ case ACPI_TABLE_PSDT:
- ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Loading %d SSDTs\n",
- acpi_gbl_table_lists[ACPI_TABLE_SSDT].count));
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Namespace load: %d SSDT or PSDTs\n",
+ acpi_gbl_table_lists[table_type].count));
/*
- * Traverse list of SSDT tables
+ * Traverse list of SSDT or PSDT tables
*/
- table_desc = acpi_gbl_table_lists[ACPI_TABLE_SSDT].next;
- for (i = 0; i < acpi_gbl_table_lists[ACPI_TABLE_SSDT].count; i++) {
+ table_desc = acpi_gbl_table_lists[table_type].next;
+ for (i = 0; i < acpi_gbl_table_lists[table_type].count; i++) {
/*
- * Only attempt to load table if it is not
+ * Only attempt to load table into namespace if it is not
* already loaded!
*/
if (!table_desc->loaded_into_namespace) {
break;
- case ACPI_TABLE_PSDT:
-
- ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Loading %d PSDTs\n",
- acpi_gbl_table_lists[ACPI_TABLE_PSDT].count));
-
- /*
- * Traverse list of PSDT tables
- */
- table_desc = acpi_gbl_table_lists[ACPI_TABLE_PSDT].next;
-
- for (i = 0; i < acpi_gbl_table_lists[ACPI_TABLE_PSDT].count; i++) {
- /* Only attempt to load table if it is not already loaded! */
-
- if (!table_desc->loaded_into_namespace) {
- status = acpi_ns_load_table (table_desc, acpi_gbl_root_node);
- if (ACPI_FAILURE (status)) {
- break;
- }
-
- table_desc->loaded_into_namespace = TRUE;
- }
-
- table_desc = table_desc->next;
- }
- break;
-
-
default:
status = AE_SUPPORT;
break;
acpi_status
acpi_ns_one_complete_parse (
- u32 pass_number,
+ u8 pass_number,
struct acpi_table_desc *table_desc)
{
union acpi_parse_object *parse_root;
#include <acpi/acparser.h>
#include <acpi/acdispat.h>
#include <acpi/amlcode.h>
-#include <acpi/acnamesp.h>
-#include <acpi/acinterp.h>
#define _COMPONENT ACPI_PARSER
ACPI_MODULE_NAME ("psloop")
/* Special processing for certain opcodes */
-#define ACPI_NO_MODULE_LEVEL_CODE
-
/* TBD (remove): Temporary mechanism to disable this code if needed */
-#ifndef ACPI_NO_MODULE_LEVEL_CODE
+#ifdef ACPI_ENABLE_MODULE_LEVEL_CODE
if ((walk_state->pass_number <= ACPI_IMODE_LOAD_PASS1) &&
((walk_state->parse_flags & ACPI_PARSE_DISASSEMBLE) == 0)) {
case AML_ELSE_OP:
case AML_WHILE_OP:
+ ACPI_DEBUG_PRINT ((ACPI_DB_PARSE,
+ "Pass1: Skipping an If/Else/While body\n"));
+
/* Skip body of if/else/while in pass 1 */
parser_state->aml = parser_state->pkg_end;
}
if (op->common.flags & ACPI_PARSEOP_GENERIC) {
- acpi_os_release_object (acpi_gbl_ps_node_cache, op);
+ (void) acpi_os_release_object (acpi_gbl_ps_node_cache, op);
}
else {
- acpi_os_release_object (acpi_gbl_ps_node_ext_cache, op);
+ (void) acpi_os_release_object (acpi_gbl_ps_node_ext_cache, op);
}
}
#include <acpi/acparser.h>
#include <acpi/acdispat.h>
#include <acpi/acinterp.h>
-#include <acpi/acnamesp.h>
#define _COMPONENT ACPI_PARSER
ACPI_MODULE_NAME ("psxface")
+/* Local Prototypes */
+
+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_psx_execute
+ * FUNCTION: acpi_ps_execute_method
*
* PARAMETERS: Info - Method info block, contains:
* Node - Method Node to execute
+ * obj_desc - Method object
* Parameters - List of parameters to pass to the method,
* terminated by NULL. Params itself may be
* NULL if no parameters are being passed.
* parameter_type - Type of Parameter list
* return_object - Where to put method's return value (if
* any). If NULL, no value is returned.
+ * pass_number - Parse or execute pass
*
* RETURN: Status
*
******************************************************************************/
acpi_status
-acpi_psx_execute (
+acpi_ps_execute_method (
struct acpi_parameter_info *info)
{
acpi_status status;
- union acpi_operand_object *obj_desc;
- u32 i;
- union acpi_parse_object *op;
- struct acpi_walk_state *walk_state;
- ACPI_FUNCTION_TRACE ("psx_execute");
+ ACPI_FUNCTION_TRACE ("ps_execute_method");
- /* Validate the Node and get the attached object */
+ /* Validate the Info and method Node */
if (!info || !info->node) {
return_ACPI_STATUS (AE_NULL_ENTRY);
}
- obj_desc = acpi_ns_get_attached_object (info->node);
- if (!obj_desc) {
- return_ACPI_STATUS (AE_NULL_OBJECT);
- }
-
/* Init for new method, wait on concurrency semaphore */
- status = acpi_ds_begin_method_execution (info->node, obj_desc, NULL);
+ status = acpi_ds_begin_method_execution (info->node, info->obj_desc, NULL);
if (ACPI_FAILURE (status)) {
return_ACPI_STATUS (status);
}
- if ((info->parameter_type == ACPI_PARAM_ARGS) &&
- (info->parameters)) {
- /*
- * The caller "owns" the parameters, so give each one an extra
- * reference
- */
- for (i = 0; info->parameters[i]; i++) {
- acpi_ut_add_reference (info->parameters[i]);
- }
- }
-
- /*
- * 1) Perform the first pass parse of the method to enter any
- * named objects that it creates into the namespace
- */
- ACPI_DEBUG_PRINT ((ACPI_DB_PARSE,
- "**** Begin Method Parse **** Entry=%p obj=%p\n",
- info->node, obj_desc));
-
- /* Create and init a Root Node */
-
- op = acpi_ps_create_scope_op ();
- if (!op) {
- status = AE_NO_MEMORY;
- goto cleanup1;
- }
-
/*
* 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);
+ status = acpi_ut_allocate_owner_id (&info->obj_desc->method.owner_id);
if (ACPI_FAILURE (status)) {
- goto cleanup2;
- }
-
- /* 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;
+ return_ACPI_STATUS (status);
}
- status = acpi_ds_init_aml_walk (walk_state, op, info->node,
- obj_desc->method.aml_start,
- obj_desc->method.aml_length, NULL, 1);
- if (ACPI_FAILURE (status)) {
- goto cleanup3;
- }
+ /*
+ * The caller "owns" the parameters, so give each one an extra
+ * reference
+ */
+ acpi_ps_update_parameter_list (info, REF_INCREMENT);
- /* Parse the AML */
+ /*
+ * 1) Perform the first pass parse of the method to enter any
+ * named objects that it creates into the namespace
+ */
+ ACPI_DEBUG_PRINT ((ACPI_DB_PARSE,
+ "**** Begin Method Parse **** Entry=%p obj=%p\n",
+ info->node, info->obj_desc));
- status = acpi_ps_parse_aml (walk_state);
- acpi_ps_delete_parse_tree (op);
+ info->pass_number = 1;
+ status = acpi_ps_execute_pass (info);
if (ACPI_FAILURE (status)) {
- goto cleanup1; /* Walk state is already deleted */
+ goto cleanup;
}
/*
- * 2) Execute the method. Performs second pass parse simultaneously
+ * 2) Execute the method. Performs second pass parse simultaneously
*/
ACPI_DEBUG_PRINT ((ACPI_DB_PARSE,
"**** Begin Method Execution **** Entry=%p obj=%p\n",
- info->node, obj_desc));
+ info->node, info->obj_desc));
- /* Create and init a Root Node */
+ info->pass_number = 3;
+ status = acpi_ps_execute_pass (info);
- op = acpi_ps_create_scope_op ();
- if (!op) {
- status = AE_NO_MEMORY;
- goto cleanup1;
+
+cleanup:
+ if (info->obj_desc->method.owner_id) {
+ acpi_ut_release_owner_id (&info->obj_desc->method.owner_id);
}
- /* Init new op with the method name and pointer back to the NS node */
+ /* Take away the extra reference that we gave the parameters above */
- acpi_ps_set_name (op, info->node->name.integer);
- op->common.node = info->node;
+ acpi_ps_update_parameter_list (info, REF_DECREMENT);
- /* Create and initialize a new walk state */
+ /* Exit now if error above */
- walk_state = acpi_ds_create_walk_state (0, NULL, NULL, NULL);
- if (!walk_state) {
- status = AE_NO_MEMORY;
- goto cleanup2;
+ if (ACPI_FAILURE (status)) {
+ return_ACPI_STATUS (status);
}
- status = acpi_ds_init_aml_walk (walk_state, op, info->node,
- obj_desc->method.aml_start,
- obj_desc->method.aml_length, info, 3);
- if (ACPI_FAILURE (status)) {
- goto cleanup3;
+ /*
+ * If the method has returned an object, signal this to the caller with
+ * a control exception code
+ */
+ if (info->return_object) {
+ ACPI_DEBUG_PRINT ((ACPI_DB_PARSE, "Method returned obj_desc=%p\n",
+ info->return_object));
+ ACPI_DUMP_STACK_ENTRY (info->return_object);
+
+ status = AE_CTRL_RETURN_VALUE;
}
- /* The walk of the parse tree is where we actually execute the method */
+ return_ACPI_STATUS (status);
+}
- status = acpi_ps_parse_aml (walk_state);
- goto cleanup2; /* Walk state already deleted */
+/*******************************************************************************
+ *
+ * FUNCTION: acpi_ps_update_parameter_list
+ *
+ * PARAMETERS: Info - See struct acpi_parameter_info
+ * (Used: parameter_type and Parameters)
+ * Action - Add or Remove reference
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Update reference count on all method parameter objects
+ *
+ ******************************************************************************/
-cleanup3:
- acpi_ds_delete_walk_state (walk_state);
+static void
+acpi_ps_update_parameter_list (
+ struct acpi_parameter_info *info,
+ u16 action)
+{
+ acpi_native_uint i;
-cleanup2:
- acpi_ps_delete_parse_tree (op);
-cleanup1:
if ((info->parameter_type == ACPI_PARAM_ARGS) &&
(info->parameters)) {
- /* Take away the extra reference that we gave the parameters above */
+ /* Update reference count for each parameter */
for (i = 0; info->parameters[i]; i++) {
/* Ignore errors, just do them all */
- (void) acpi_ut_update_object_reference (
- info->parameters[i], REF_DECREMENT);
+ (void) acpi_ut_update_object_reference (info->parameters[i], action);
}
}
+}
- if (ACPI_FAILURE (status)) {
- return_ACPI_STATUS (status);
+
+/*******************************************************************************
+ *
+ * FUNCTION: acpi_ps_execute_pass
+ *
+ * PARAMETERS: Info - See struct acpi_parameter_info
+ * (Used: pass_number, Node, and obj_desc)
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Single AML pass: Parse or Execute a control method
+ *
+ ******************************************************************************/
+
+static acpi_status
+acpi_ps_execute_pass (
+ struct acpi_parameter_info *info)
+{
+ acpi_status status;
+ union acpi_parse_object *op;
+ struct acpi_walk_state *walk_state;
+
+
+ ACPI_FUNCTION_TRACE ("ps_execute_pass");
+
+
+ /* Create and init a Root Node */
+
+ op = acpi_ps_create_scope_op ();
+ if (!op) {
+ return_ACPI_STATUS (AE_NO_MEMORY);
}
- /*
- * If the method has returned an object, signal this to the caller with
- * a control exception code
- */
- if (info->return_object) {
- ACPI_DEBUG_PRINT ((ACPI_DB_PARSE, "Method returned obj_desc=%p\n",
- info->return_object));
- ACPI_DUMP_STACK_ENTRY (info->return_object);
+ /* Create and initialize a new walk state */
- status = AE_CTRL_RETURN_VALUE;
+ walk_state = acpi_ds_create_walk_state (
+ info->obj_desc->method.owner_id, NULL, NULL, NULL);
+ if (!walk_state) {
+ status = AE_NO_MEMORY;
+ goto cleanup;
+ }
+
+ status = acpi_ds_init_aml_walk (walk_state, op, info->node,
+ info->obj_desc->method.aml_start,
+ info->obj_desc->method.aml_length,
+ info->pass_number == 1 ? NULL : info,
+ info->pass_number);
+ if (ACPI_FAILURE (status)) {
+ acpi_ds_delete_walk_state (walk_state);
+ goto cleanup;
}
+ /* Parse the AML */
+
+ status = acpi_ps_parse_aml (walk_state);
+
+ /* Walk state was deleted by parse_aml */
+
+cleanup:
+ acpi_ps_delete_parse_tree (op);
return_ACPI_STATUS (status);
}
*
* RETURN: Status
*
- * DESCRIPTION: Load and validate all tables other than the RSDT. The RSDT must
- * already be loaded and validated.
- * Install the table into the global data structs.
+ * DESCRIPTION: Install the table into the global data structures.
*
******************************************************************************/
{
acpi_status status;
+
ACPI_FUNCTION_TRACE ("tb_install_table");
status = acpi_ut_acquire_mutex (ACPI_MTX_TABLES);
if (ACPI_FAILURE (status)) {
- ACPI_REPORT_ERROR (("Could not acquire table mutex for [%4.4s], %s\n",
- table_info->pointer->signature, acpi_format_exception (status)));
+ ACPI_REPORT_ERROR (("Could not acquire table mutex, %s\n",
+ acpi_format_exception (status)));
return_ACPI_STATUS (status);
}
+ /*
+ * Ignore a table that is already installed. For example, some BIOS
+ * ASL code will repeatedly attempt to load the same SSDT.
+ */
+ status = acpi_tb_is_table_installed (table_info);
+ if (ACPI_FAILURE (status)) {
+ goto unlock_and_exit;
+ }
+
/* Install the table into the global data structure */
status = acpi_tb_init_table_descriptor (table_info->type, table_info);
if (ACPI_FAILURE (status)) {
- ACPI_REPORT_ERROR (("Could not install ACPI table [%4.4s], %s\n",
+ ACPI_REPORT_ERROR (("Could not install table [%4.4s], %s\n",
table_info->pointer->signature, acpi_format_exception (status)));
}
ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "%s located at %p\n",
acpi_gbl_table_data[table_info->type].name, table_info->pointer));
+
+unlock_and_exit:
(void) acpi_ut_release_mutex (ACPI_MTX_TABLES);
return_ACPI_STATUS (status);
}
#endif
+/*******************************************************************************
+ *
+ * FUNCTION: acpi_tb_is_table_installed
+ *
+ * PARAMETERS: new_table_desc - Descriptor for new table being installed
+ *
+ * RETURN: Status - AE_ALREADY_EXISTS if the table is already installed
+ *
+ * DESCRIPTION: Determine if an ACPI table is already installed
+ *
+ * MUTEX: Table data structures should be locked
+ *
+ ******************************************************************************/
+
+acpi_status
+acpi_tb_is_table_installed (
+ struct acpi_table_desc *new_table_desc)
+{
+ struct acpi_table_desc *table_desc;
+
+
+ ACPI_FUNCTION_TRACE ("tb_is_table_installed");
+
+
+ /* Get the list descriptor and first table descriptor */
+
+ table_desc = acpi_gbl_table_lists[new_table_desc->type].next;
+
+ /* Examine all installed tables of this type */
+
+ while (table_desc) {
+ /* Compare Revision and oem_table_id */
+
+ if ((table_desc->loaded_into_namespace) &&
+ (table_desc->pointer->revision ==
+ new_table_desc->pointer->revision) &&
+ (!ACPI_MEMCMP (table_desc->pointer->oem_table_id,
+ new_table_desc->pointer->oem_table_id, 8))) {
+ /* This table is already installed */
+
+ ACPI_DEBUG_PRINT ((ACPI_DB_TABLES,
+ "Table [%4.4s] already installed: Rev %X oem_table_id [%8.8s]\n",
+ new_table_desc->pointer->signature,
+ new_table_desc->pointer->revision,
+ new_table_desc->pointer->oem_table_id));
+
+ new_table_desc->owner_id = table_desc->owner_id;
+ new_table_desc->installed_desc = table_desc;
+
+ return_ACPI_STATUS (AE_ALREADY_EXISTS);
+ }
+
+ /* Get next table on the list */
+
+ table_desc = table_desc->next;
+ }
+
+ return_ACPI_STATUS (AE_OK);
+}
+
+
/*******************************************************************************
*
* FUNCTION: acpi_tb_validate_table_header
/* Compute the checksum on the table */
- checksum = acpi_tb_checksum (table_header, table_header->length);
+ checksum = acpi_tb_generate_checksum (table_header, table_header->length);
/* Return the appropriate exception */
/*******************************************************************************
*
- * FUNCTION: acpi_tb_checksum
+ * FUNCTION: acpi_tb_generate_checksum
*
* PARAMETERS: Buffer - Buffer to checksum
* Length - Size of the buffer
******************************************************************************/
u8
-acpi_tb_checksum (
+acpi_tb_generate_checksum (
void *buffer,
u32 length)
{
return_ACPI_STATUS (status);
}
+ /* Check signature for a valid table type */
+
+ status = acpi_tb_recognize_table (&table_info, ACPI_TABLE_ALL);
+ if (ACPI_FAILURE (status)) {
+ return_ACPI_STATUS (status);
+ }
+
/* Install the new table into the local data structures */
status = acpi_tb_install_table (&table_info);
if (ACPI_FAILURE (status)) {
+ if (status == AE_ALREADY_EXISTS) {
+ /* Table already exists, no error */
+
+ status = AE_OK;
+ }
+
/* Free table allocated by acpi_tb_get_table_body */
acpi_tb_delete_single_table (&table_info);
* simply a position within the hierarchy
*/
acpi_ns_delete_namespace_by_owner (table_desc->owner_id);
+ acpi_ut_release_owner_id (&table_desc->owner_id);
table_desc = table_desc->next;
}
/* Check the standard checksum */
- if (acpi_tb_checksum (rsdp, ACPI_RSDP_CHECKSUM_LENGTH) != 0) {
+ if (acpi_tb_generate_checksum (rsdp, ACPI_RSDP_CHECKSUM_LENGTH) != 0) {
return (AE_BAD_CHECKSUM);
}
/* Check extended checksum if table version >= 2 */
if ((rsdp->revision >= 2) &&
- (acpi_tb_checksum (rsdp, ACPI_RSDP_XCHECKSUM_LENGTH) != 0)) {
+ (acpi_tb_generate_checksum (rsdp, ACPI_RSDP_XCHECKSUM_LENGTH) != 0)) {
return (AE_BAD_CHECKSUM);
}
acpi_ut_create_list (
char *list_name,
u16 object_size,
- acpi_handle *return_cache);
+ struct acpi_memory_list **return_cache);
#endif
acpi_ut_create_list (
char *list_name,
u16 object_size,
- acpi_handle *return_cache)
+ struct acpi_memory_list **return_cache)
{
struct acpi_memory_list *cache;
static char *acpi_gbl_fn_entry_str = "----Entry";
static char *acpi_gbl_fn_exit_str = "----Exit-";
+/* Local prototypes */
+
+static const char *
+acpi_ut_trim_function_name (
+ const char *function_name);
+
/*******************************************************************************
*
acpi_ut_init_stack_ptr_trace (
void)
{
- u32 current_sp;
+ u32 current_sp;
acpi_gbl_entry_stack_pointer = ACPI_PTR_DIFF (¤t_sp, NULL);
acpi_ut_track_stack_ptr (
void)
{
- acpi_size current_sp;
+ acpi_size current_sp;
current_sp = ACPI_PTR_DIFF (¤t_sp, NULL);
}
+/*******************************************************************************
+ *
+ * FUNCTION: acpi_ut_trim_function_name
+ *
+ * PARAMETERS: function_name - Ascii string containing a procedure name
+ *
+ * RETURN: Updated pointer to the function name
+ *
+ * DESCRIPTION: Remove the "Acpi" prefix from the function name, if present.
+ * This allows compiler macros such as __FUNCTION__ to be used
+ * with no change to the debug output.
+ *
+ ******************************************************************************/
+
+static const char *
+acpi_ut_trim_function_name (
+ const char *function_name)
+{
+
+ /* All Function names are longer than 4 chars, check is safe */
+
+ if (*(ACPI_CAST_PTR (u32, function_name)) == ACPI_FUNCTION_PREFIX1) {
+ /* This is the case where the original source has not been modified */
+
+ return (function_name + 4);
+ }
+
+ if (*(ACPI_CAST_PTR (u32, function_name)) == ACPI_FUNCTION_PREFIX2) {
+ /* This is the case where the source has been 'linuxized' */
+
+ return (function_name + 5);
+ }
+
+ return (function_name);
+}
+
+
/*******************************************************************************
*
* FUNCTION: acpi_ut_debug_print
acpi_ut_debug_print (
u32 requested_debug_level,
u32 line_number,
- char *function_name,
+ const char *function_name,
char *module_name,
u32 component_id,
char *format,
}
acpi_os_printf ("[%02ld] %-22.22s: ",
- acpi_gbl_nesting_level, function_name);
+ acpi_gbl_nesting_level, acpi_ut_trim_function_name (function_name));
va_start (args, format);
acpi_os_vprintf (format, args);
acpi_ut_debug_print_raw (
u32 requested_debug_level,
u32 line_number,
- char *function_name,
+ const char *function_name,
char *module_name,
u32 component_id,
char *format,
void
acpi_ut_trace (
u32 line_number,
- char *function_name,
+ const char *function_name,
char *module_name,
u32 component_id)
{
void
acpi_ut_trace_ptr (
u32 line_number,
- char *function_name,
+ const char *function_name,
char *module_name,
u32 component_id,
void *pointer)
void
acpi_ut_trace_str (
u32 line_number,
- char *function_name,
+ const char *function_name,
char *module_name,
u32 component_id,
char *string)
void
acpi_ut_trace_u32 (
u32 line_number,
- char *function_name,
+ const char *function_name,
char *module_name,
u32 component_id,
u32 integer)
void
acpi_ut_exit (
u32 line_number,
- char *function_name,
+ const char *function_name,
char *module_name,
u32 component_id)
{
void
acpi_ut_status_exit (
u32 line_number,
- char *function_name,
+ const char *function_name,
char *module_name,
u32 component_id,
acpi_status status)
void
acpi_ut_value_exit (
u32 line_number,
- char *function_name,
+ const char *function_name,
char *module_name,
u32 component_id,
acpi_integer value)
void
acpi_ut_ptr_exit (
u32 line_number,
- char *function_name,
+ const char *function_name,
char *module_name,
u32 component_id,
u8 *ptr)
}
/*
- * Print the ASCII equivalent characters
- * But watch out for the bad unprintable ones...
+ * Print the ASCII equivalent characters but watch out for the bad
+ * unprintable ones (printable chars are 0x20 through 0x7E)
*/
acpi_os_printf (" ");
for (j = 0; j < 16; j++) {
}
buf_char = buffer[i + j];
- if ((buf_char > 0x1F && buf_char < 0x2E) ||
- (buf_char > 0x2F && buf_char < 0x61) ||
- (buf_char > 0x60 && buf_char < 0x7F)) {
+ if (ACPI_IS_PRINT (buf_char)) {
acpi_os_printf ("%c", buf_char);
}
else {
*
* PARAMETERS: owner_id - Where the new owner ID is returned
*
- * DESCRIPTION: Allocate a table or method owner id
+ * RETURN: Status
+ *
+ * DESCRIPTION: Allocate a table or method owner ID. The owner ID is used to
+ * track objects created by the table or method, to be deleted
+ * when the method exits or the table is unloaded.
*
******************************************************************************/
ACPI_FUNCTION_TRACE ("ut_allocate_owner_id");
+ /* Mutex for the global ID mask */
+
status = acpi_ut_acquire_mutex (ACPI_MTX_CACHES);
if (ACPI_FAILURE (status)) {
return_ACPI_STATUS (status);
for (i = 0; i < 32; i++) {
if (!(acpi_gbl_owner_id_mask & (1 << i))) {
acpi_gbl_owner_id_mask |= (1 << i);
- *owner_id = (acpi_owner_id) i;
+ *owner_id = (acpi_owner_id) (i + 1);
goto exit;
}
}
* they are released when a table is unloaded or a method completes
* execution.
*/
+ *owner_id = 0;
status = AE_OWNER_ID_LIMIT;
ACPI_REPORT_ERROR ((
"Could not allocate new owner_id (32 max), AE_OWNER_ID_LIMIT\n"));
*
* FUNCTION: acpi_ut_release_owner_id
*
- * PARAMETERS: owner_id - A previously allocated owner ID
+ * PARAMETERS: owner_id_ptr - Pointer to a previously allocated owner_iD
*
- * DESCRIPTION: Release a table or method owner id
+ * RETURN: None. No error is returned because we are either exiting a
+ * control method or unloading a table. Either way, we would
+ * ignore any error anyway.
+ *
+ * DESCRIPTION: Release a table or method owner ID. Valid IDs are 1 - 32
*
******************************************************************************/
-acpi_status
+void
acpi_ut_release_owner_id (
- acpi_owner_id owner_id)
+ acpi_owner_id *owner_id_ptr)
{
+ acpi_owner_id owner_id = *owner_id_ptr;
acpi_status status;
ACPI_FUNCTION_TRACE ("ut_release_owner_id");
+ /* Always clear the input owner_id (zero is an invalid ID) */
+
+ *owner_id_ptr = 0;
+
+ /* Zero is not a valid owner_iD */
+
+ if ((owner_id == 0) || (owner_id > 32)) {
+ ACPI_REPORT_ERROR (("Invalid owner_id: %2.2X\n", owner_id));
+ return_VOID;
+ }
+
+ /* Mutex for the global ID mask */
+
status = acpi_ut_acquire_mutex (ACPI_MTX_CACHES);
if (ACPI_FAILURE (status)) {
- return_ACPI_STATUS (status);
+ return_VOID;
}
- /* Free the owner ID */
+ owner_id--; /* Normalize to zero */
+
+ /* Free the owner ID only if it is valid */
if (acpi_gbl_owner_id_mask & (1 << owner_id)) {
acpi_gbl_owner_id_mask ^= (1 << owner_id);
}
- else {
- /* This owner_id has not been allocated */
-
- status = AE_NOT_EXIST;
- }
(void) acpi_ut_release_mutex (ACPI_MTX_CACHES);
- return_ACPI_STATUS (status);
+ return_VOID;
}
*
* PARAMETERS: src_string - The source string to convert
*
- * RETURN: Converted src_string (same as input pointer)
+ * RETURN: None
*
* DESCRIPTION: Convert string to uppercase
*
*
******************************************************************************/
-char *
+void
acpi_ut_strupr (
char *src_string)
{
if (!src_string) {
- return (NULL);
+ return;
}
/* Walk entire string, uppercasing the letters */
*string = (char) ACPI_TOUPPER (*string);
}
- return (src_string);
+ return;
}
/* Version string */
-#define ACPI_CA_VERSION 0x20050708
+#define ACPI_CA_VERSION 0x20050729
/*
* OS name, used for the _OS object. The _OS object is essentially obsolete,
*/
acpi_status
acpi_ds_parse_method (
- acpi_handle obj_handle);
+ struct acpi_namespace_node *node);
acpi_status
acpi_ds_call_control_method (
u8 *aml_start,
u32 aml_length,
struct acpi_parameter_info *info,
- u32 pass_number);
+ u8 pass_number);
acpi_status
acpi_ds_obj_stack_pop_and_delete (
* The Name parameter should be the procedure name as a quoted string.
* This is declared as a local string ("my_function_name") so that it can
* be also used by the function exit macros below.
+ * Note: (const char) is used to be compatible with the debug interfaces
+ * and macros such as __FUNCTION__.
*/
-#define ACPI_FUNCTION_NAME(name) char *_acpi_function_name = name;
+#define ACPI_FUNCTION_NAME(name) const char *_acpi_function_name = name;
#else
/* Compiler supports __FUNCTION__ (or equivalent) -- Ignore this macro */
#define ACPI_NS_ROOT_PATH "\\"
#define ACPI_NS_SYSTEM_BUS "_SB_"
+/*! [Begin] no source code translation (not handled by acpisrc) */
+#define ACPI_FUNCTION_PREFIX1 'ipcA'
+#define ACPI_FUNCTION_PREFIX2 'ipca'
+/*! [End] no source code translation !*/
+
#endif /* __ACNAMES_H__ */
acpi_status
acpi_ns_one_complete_parse (
- u32 pass_number,
+ u8 pass_number,
struct acpi_table_desc *table_desc);
* psxface - Parser external interfaces
*/
acpi_status
-acpi_psx_load_table (
- u8 *pcode_addr,
- u32 pcode_length);
-
-acpi_status
-acpi_psx_execute (
+acpi_ps_execute_method (
struct acpi_parameter_info *info);
struct acpi_walk_info
{
u32 debug_level;
+ u32 count;
acpi_owner_id owner_id;
u8 display_type;
};
struct acpi_parameter_info
{
struct acpi_namespace_node *node;
+ union acpi_operand_object *obj_desc;
union acpi_operand_object **parameters;
union acpi_operand_object *return_object;
+ u8 pass_number;
u8 parameter_type;
u8 return_object_type;
};
* tbutils - common table utilities
*/
acpi_status
+acpi_tb_is_table_installed (
+ struct acpi_table_desc *new_table_desc);
+
+acpi_status
acpi_tb_verify_table_checksum (
struct acpi_table_header *table_header);
u8
-acpi_tb_checksum (
+acpi_tb_generate_checksum (
void *buffer,
u32 length);
void
acpi_ut_trace (
u32 line_number,
- char *function_name,
+ const char *function_name,
char *module_name,
u32 component_id);
void
acpi_ut_trace_ptr (
u32 line_number,
- char *function_name,
+ const char *function_name,
char *module_name,
u32 component_id,
void *pointer);
void
acpi_ut_trace_u32 (
u32 line_number,
- char *function_name,
+ const char *function_name,
char *module_name,
u32 component_id,
u32 integer);
void
acpi_ut_trace_str (
u32 line_number,
- char *function_name,
+ const char *function_name,
char *module_name,
u32 component_id,
char *string);
void
acpi_ut_exit (
u32 line_number,
- char *function_name,
+ const char *function_name,
char *module_name,
u32 component_id);
void
acpi_ut_status_exit (
u32 line_number,
- char *function_name,
+ const char *function_name,
char *module_name,
u32 component_id,
acpi_status status);
void
acpi_ut_value_exit (
u32 line_number,
- char *function_name,
+ const char *function_name,
char *module_name,
u32 component_id,
acpi_integer value);
void
acpi_ut_ptr_exit (
u32 line_number,
- char *function_name,
+ const char *function_name,
char *module_name,
u32 component_id,
u8 *ptr);
acpi_ut_debug_print (
u32 requested_debug_level,
u32 line_number,
- char *function_name,
+ const char *function_name,
char *module_name,
u32 component_id,
char *format,
acpi_ut_debug_print_raw (
u32 requested_debug_level,
u32 line_number,
- char *function_name,
+ const char *function_name,
char *module_name,
u32 component_id,
char *format,
acpi_ut_allocate_owner_id (
acpi_owner_id *owner_id);
-acpi_status
+void
acpi_ut_release_owner_id (
- acpi_owner_id owner_id);
+ acpi_owner_id *owner_id);
acpi_status
acpi_ut_walk_package_tree (
acpi_pkg_callback walk_callback,
void *context);
-char *
+void
acpi_ut_strupr (
char *src_string);
#define ACPI_MEMCPY(d,s,n) (void) memcpy((d), (s), (acpi_size)(n))
#define ACPI_MEMSET(d,s,n) (void) memset((d), (s), (acpi_size)(n))
-#define ACPI_TOUPPER toupper
-#define ACPI_TOLOWER tolower
-#define ACPI_IS_XDIGIT isxdigit
-#define ACPI_IS_DIGIT isdigit
-#define ACPI_IS_SPACE isspace
-#define ACPI_IS_UPPER isupper
-#define ACPI_IS_PRINT isprint
-#define ACPI_IS_ALPHA isalpha
-#define ACPI_IS_ASCII isascii
+#define ACPI_TOUPPER(i) toupper((int) (i))
+#define ACPI_TOLOWER(i) tolower((int) (i))
+#define ACPI_IS_XDIGIT(i) isxdigit((int) (i))
+#define ACPI_IS_DIGIT(i) isdigit((int) (i))
+#define ACPI_IS_SPACE(i) isspace((int) (i))
+#define ACPI_IS_UPPER(i) isupper((int) (i))
+#define ACPI_IS_PRINT(i) isprint((int) (i))
+#define ACPI_IS_ALPHA(i) isalpha((int) (i))
+#define ACPI_IS_ASCII(i) isascii((int) (i))
#else
/* Function name is used for debug output. Non-ANSI, compiler-dependent */
-#define ACPI_GET_FUNCTION_NAME (char *) __FUNCTION__
+#define ACPI_GET_FUNCTION_NAME __FUNCTION__
/* This macro is used to tag functions as "printf-like" because
* some compilers (like GCC) can catch printf format string problems.