Commit 61686124 authored by Bob Moore's avatar Bob Moore Committed by Len Brown

[ACPI] ACPICA 20060317

Implemented the use of a cache object for all internal
namespace nodes. Since there are about 1000 static nodes
in a typical system, this will decrease memory use for
cache implementations that minimize per-allocation overhead
(such as a slab allocator.)

Removed the reference count mechanism for internal
namespace nodes, since it was deemed unnecessary. This
reduces the size of each namespace node by about 5%-10%
on all platforms. Nodes are now 20 bytes for the 32-bit
case, and 32 bytes for the 64-bit case.

Optimized several internal data structures to reduce
object size on 64-bit platforms by packing data within
the 64-bit alignment. This includes the frequently used
ACPI_OPERAND_OBJECT, of which there can be ~1000 static
instances corresponding to the namespace objects.

Added two new strings for the predefined _OSI method:
"Windows 2001.1 SP1" and "Windows 2006".

Split the allocation tracking mechanism out to a separate
file, from utalloc.c to uttrack.c. This mechanism appears
to be only useful for application-level code. Kernels may
wish to not include uttrack.c in distributions.

Removed all remnants of the obsolete ACPI_REPORT_* macros
and the associated code. (These macros have been replaced
by the ACPI_ERROR and ACPI_WARNING macros.)
Signed-off-by: default avatarBob Moore <robert.moore@intel.com>
Signed-off-by: default avatarLen Brown <len.brown@intel.com>
parent 144c87b4
...@@ -596,6 +596,8 @@ void __init acpi_early_init(void) ...@@ -596,6 +596,8 @@ void __init acpi_early_init(void)
if (acpi_disabled) if (acpi_disabled)
return_VOID; return_VOID;
printk(KERN_INFO PREFIX "Core revision %08x\n", ACPI_CA_VERSION);
/* enable workarounds, unless strict ACPI spec. compliance */ /* enable workarounds, unless strict ACPI spec. compliance */
if (!acpi_strict) if (!acpi_strict)
acpi_gbl_enable_interpreter_slack = TRUE; acpi_gbl_enable_interpreter_slack = TRUE;
...@@ -743,8 +745,6 @@ static int __init acpi_init(void) ...@@ -743,8 +745,6 @@ static int __init acpi_init(void)
ACPI_FUNCTION_TRACE("acpi_init"); ACPI_FUNCTION_TRACE("acpi_init");
printk(KERN_INFO PREFIX "Subsystem revision %08x\n", ACPI_CA_VERSION);
if (acpi_disabled) { if (acpi_disabled) {
printk(KERN_INFO PREFIX "Interpreter disabled.\n"); printk(KERN_INFO PREFIX "Interpreter disabled.\n");
return_VALUE(-ENODEV); return_VALUE(-ENODEV);
......
...@@ -100,10 +100,10 @@ void acpi_ds_method_data_init(struct acpi_walk_state *walk_state) ...@@ -100,10 +100,10 @@ void acpi_ds_method_data_init(struct acpi_walk_state *walk_state)
ACPI_MOVE_32_TO_32(&walk_state->arguments[i].name, ACPI_MOVE_32_TO_32(&walk_state->arguments[i].name,
NAMEOF_ARG_NTE); NAMEOF_ARG_NTE);
walk_state->arguments[i].name.integer |= (i << 24); walk_state->arguments[i].name.integer |= (i << 24);
walk_state->arguments[i].descriptor = ACPI_DESC_TYPE_NAMED; walk_state->arguments[i].descriptor_type = ACPI_DESC_TYPE_NAMED;
walk_state->arguments[i].type = ACPI_TYPE_ANY; walk_state->arguments[i].type = ACPI_TYPE_ANY;
walk_state->arguments[i].flags = ANOBJ_END_OF_PEER_LIST | walk_state->arguments[i].flags =
ANOBJ_METHOD_ARG; ANOBJ_END_OF_PEER_LIST | ANOBJ_METHOD_ARG;
} }
/* Init the method locals */ /* Init the method locals */
...@@ -113,11 +113,11 @@ void acpi_ds_method_data_init(struct acpi_walk_state *walk_state) ...@@ -113,11 +113,11 @@ void acpi_ds_method_data_init(struct acpi_walk_state *walk_state)
NAMEOF_LOCAL_NTE); NAMEOF_LOCAL_NTE);
walk_state->local_variables[i].name.integer |= (i << 24); walk_state->local_variables[i].name.integer |= (i << 24);
walk_state->local_variables[i].descriptor = walk_state->local_variables[i].descriptor_type =
ACPI_DESC_TYPE_NAMED; ACPI_DESC_TYPE_NAMED;
walk_state->local_variables[i].type = ACPI_TYPE_ANY; walk_state->local_variables[i].type = ACPI_TYPE_ANY;
walk_state->local_variables[i].flags = ANOBJ_END_OF_PEER_LIST | walk_state->local_variables[i].flags =
ANOBJ_METHOD_LOCAL; ANOBJ_END_OF_PEER_LIST | ANOBJ_METHOD_LOCAL;
} }
return_VOID; return_VOID;
......
...@@ -128,7 +128,7 @@ acpi_ds_scope_stack_push(struct acpi_namespace_node *node, ...@@ -128,7 +128,7 @@ acpi_ds_scope_stack_push(struct acpi_namespace_node *node,
/* Init new scope object */ /* Init new scope object */
scope_info->common.data_type = ACPI_DESC_TYPE_STATE_WSCOPE; scope_info->common.descriptor_type = ACPI_DESC_TYPE_STATE_WSCOPE;
scope_info->scope.node = node; scope_info->scope.node = node;
scope_info->common.value = (u16) type; scope_info->common.value = (u16) type;
......
...@@ -337,7 +337,7 @@ acpi_status acpi_ds_result_stack_push(struct acpi_walk_state * walk_state) ...@@ -337,7 +337,7 @@ acpi_status acpi_ds_result_stack_push(struct acpi_walk_state * walk_state)
return (AE_NO_MEMORY); return (AE_NO_MEMORY);
} }
state->common.data_type = ACPI_DESC_TYPE_STATE_RESULT; state->common.descriptor_type = ACPI_DESC_TYPE_STATE_RESULT;
acpi_ut_push_generic_state(&walk_state->results, state); acpi_ut_push_generic_state(&walk_state->results, state);
ACPI_DEBUG_PRINT((ACPI_DB_EXEC, "Results=%p State=%p\n", ACPI_DEBUG_PRINT((ACPI_DB_EXEC, "Results=%p State=%p\n",
...@@ -620,7 +620,7 @@ struct acpi_walk_state *acpi_ds_pop_walk_state(struct acpi_thread_state *thread) ...@@ -620,7 +620,7 @@ struct acpi_walk_state *acpi_ds_pop_walk_state(struct acpi_thread_state *thread)
* *
* PARAMETERS: owner_id - ID for object creation * PARAMETERS: owner_id - ID for object creation
* Origin - Starting point for this walk * Origin - Starting point for this walk
* mth_desc - Method object * method_desc - Method object
* Thread - Current thread state * Thread - Current thread state
* *
* RETURN: Pointer to the new walk state. * RETURN: Pointer to the new walk state.
...@@ -634,7 +634,7 @@ struct acpi_walk_state *acpi_ds_create_walk_state(acpi_owner_id owner_id, ...@@ -634,7 +634,7 @@ struct acpi_walk_state *acpi_ds_create_walk_state(acpi_owner_id owner_id,
union acpi_parse_object union acpi_parse_object
*origin, *origin,
union acpi_operand_object union acpi_operand_object
*mth_desc, *method_desc,
struct acpi_thread_state struct acpi_thread_state
*thread) *thread)
{ {
...@@ -648,10 +648,10 @@ struct acpi_walk_state *acpi_ds_create_walk_state(acpi_owner_id owner_id, ...@@ -648,10 +648,10 @@ struct acpi_walk_state *acpi_ds_create_walk_state(acpi_owner_id owner_id,
return_PTR(NULL); return_PTR(NULL);
} }
walk_state->data_type = ACPI_DESC_TYPE_WALK; walk_state->descriptor_type = ACPI_DESC_TYPE_WALK;
walk_state->method_desc = method_desc;
walk_state->owner_id = owner_id; walk_state->owner_id = owner_id;
walk_state->origin = origin; walk_state->origin = origin;
walk_state->method_desc = mth_desc;
walk_state->thread = thread; walk_state->thread = thread;
walk_state->parser_state.start_op = origin; walk_state->parser_state.start_op = origin;
...@@ -819,7 +819,7 @@ void acpi_ds_delete_walk_state(struct acpi_walk_state *walk_state) ...@@ -819,7 +819,7 @@ void acpi_ds_delete_walk_state(struct acpi_walk_state *walk_state)
return; return;
} }
if (walk_state->data_type != ACPI_DESC_TYPE_WALK) { if (walk_state->descriptor_type != ACPI_DESC_TYPE_WALK) {
ACPI_ERROR((AE_INFO, "%p is not a valid walk state", ACPI_ERROR((AE_INFO, "%p is not a valid walk state",
walk_state)); walk_state));
return; return;
......
...@@ -131,7 +131,7 @@ u8 acpi_ev_valid_gpe_event(struct acpi_gpe_event_info *gpe_event_info) ...@@ -131,7 +131,7 @@ u8 acpi_ev_valid_gpe_event(struct acpi_gpe_event_info *gpe_event_info)
* *
******************************************************************************/ ******************************************************************************/
acpi_status acpi_ev_walk_gpe_list(ACPI_GPE_CALLBACK gpe_walk_callback) acpi_status acpi_ev_walk_gpe_list(acpi_gpe_callback gpe_walk_callback)
{ {
struct acpi_gpe_block_info *gpe_block; struct acpi_gpe_block_info *gpe_block;
struct acpi_gpe_xrupt_info *gpe_xrupt_info; struct acpi_gpe_xrupt_info *gpe_xrupt_info;
......
...@@ -185,7 +185,8 @@ acpi_ev_queue_notify_request(struct acpi_namespace_node * node, ...@@ -185,7 +185,8 @@ acpi_ev_queue_notify_request(struct acpi_namespace_node * node,
return (AE_NO_MEMORY); return (AE_NO_MEMORY);
} }
notify_info->common.data_type = ACPI_DESC_TYPE_STATE_NOTIFY; notify_info->common.descriptor_type =
ACPI_DESC_TYPE_STATE_NOTIFY;
notify_info->notify.node = node; notify_info->notify.node = node;
notify_info->notify.value = (u16) notify_value; notify_info->notify.value = (u16) notify_value;
notify_info->notify.handler_obj = handler_obj; notify_info->notify.handler_obj = handler_obj;
......
...@@ -250,7 +250,6 @@ acpi_ev_execute_reg_method(union acpi_operand_object *region_obj, u32 function) ...@@ -250,7 +250,6 @@ acpi_ev_execute_reg_method(union acpi_operand_object *region_obj, u32 function)
cleanup: cleanup:
acpi_ut_remove_reference(params[0]); acpi_ut_remove_reference(params[0]);
return_ACPI_STATUS(status); return_ACPI_STATUS(status);
} }
...@@ -389,9 +388,8 @@ acpi_ev_address_space_dispatch(union acpi_operand_object *region_obj, ...@@ -389,9 +388,8 @@ acpi_ev_address_space_dispatch(union acpi_operand_object *region_obj,
acpi_ut_get_region_name(region_obj->region. acpi_ut_get_region_name(region_obj->region.
space_id))); space_id)));
if (! if (!(handler_desc->address_space.handler_flags &
(handler_desc->address_space. ACPI_ADDR_HANDLER_DEFAULT_INSTALLED)) {
hflags & ACPI_ADDR_HANDLER_DEFAULT_INSTALLED)) {
/* /*
* For handlers other than the default (supplied) handlers, we must * For handlers other than the default (supplied) handlers, we must
* exit the interpreter because the handler *might* block -- we don't * exit the interpreter because the handler *might* block -- we don't
...@@ -412,9 +410,8 @@ acpi_ev_address_space_dispatch(union acpi_operand_object *region_obj, ...@@ -412,9 +410,8 @@ acpi_ev_address_space_dispatch(union acpi_operand_object *region_obj,
space_id))); space_id)));
} }
if (! if (!(handler_desc->address_space.handler_flags &
(handler_desc->address_space. ACPI_ADDR_HANDLER_DEFAULT_INSTALLED)) {
hflags & ACPI_ADDR_HANDLER_DEFAULT_INSTALLED)) {
/* /*
* We just returned from a non-default handler, we must re-enter the * We just returned from a non-default handler, we must re-enter the
* interpreter * interpreter
...@@ -772,7 +769,7 @@ acpi_ev_install_space_handler(struct acpi_namespace_node * node, ...@@ -772,7 +769,7 @@ acpi_ev_install_space_handler(struct acpi_namespace_node * node,
union acpi_operand_object *handler_obj; union acpi_operand_object *handler_obj;
acpi_status status; acpi_status status;
acpi_object_type type; acpi_object_type type;
u16 flags = 0; u8 flags = 0;
ACPI_FUNCTION_TRACE("ev_install_space_handler"); ACPI_FUNCTION_TRACE("ev_install_space_handler");
...@@ -930,7 +927,7 @@ acpi_ev_install_space_handler(struct acpi_namespace_node * node, ...@@ -930,7 +927,7 @@ acpi_ev_install_space_handler(struct acpi_namespace_node * node,
/* Init handler obj */ /* Init handler obj */
handler_obj->address_space.space_id = (u8) space_id; handler_obj->address_space.space_id = (u8) space_id;
handler_obj->address_space.hflags = flags; handler_obj->address_space.handler_flags = flags;
handler_obj->address_space.region_list = NULL; handler_obj->address_space.region_list = NULL;
handler_obj->address_space.node = node; handler_obj->address_space.node = node;
handler_obj->address_space.handler = handler; handler_obj->address_space.handler = handler;
......
...@@ -243,8 +243,9 @@ acpi_status acpi_ex_create_mutex(struct acpi_walk_state *walk_state) ...@@ -243,8 +243,9 @@ acpi_status acpi_ex_create_mutex(struct acpi_walk_state *walk_state)
obj_desc->mutex.node = obj_desc->mutex.node =
(struct acpi_namespace_node *)walk_state->operands[0]; (struct acpi_namespace_node *)walk_state->operands[0];
status = acpi_ns_attach_object(obj_desc->mutex.node, status =
obj_desc, ACPI_TYPE_MUTEX); acpi_ns_attach_object(obj_desc->mutex.node, obj_desc,
ACPI_TYPE_MUTEX);
cleanup: cleanup:
/* /*
...@@ -464,9 +465,9 @@ acpi_status acpi_ex_create_processor(struct acpi_walk_state *walk_state) ...@@ -464,9 +465,9 @@ acpi_status acpi_ex_create_processor(struct acpi_walk_state *walk_state)
/* Initialize the processor object from the operands */ /* Initialize the processor object from the operands */
obj_desc->processor.proc_id = (u8) operand[1]->integer.value; obj_desc->processor.proc_id = (u8) operand[1]->integer.value;
obj_desc->processor.length = (u8) operand[3]->integer.value;
obj_desc->processor.address = obj_desc->processor.address =
(acpi_io_address) operand[2]->integer.value; (acpi_io_address) operand[2]->integer.value;
obj_desc->processor.length = (u8) operand[3]->integer.value;
/* Install the processor object in the parent Node */ /* Install the processor object in the parent Node */
......
...@@ -267,8 +267,6 @@ static struct acpi_exdump_info acpi_ex_dump_node[6] = { ...@@ -267,8 +267,6 @@ static struct acpi_exdump_info acpi_ex_dump_node[6] = {
{ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE(acpi_ex_dump_node), NULL}, {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(flags), "Flags"},
{ACPI_EXD_UINT8, ACPI_EXD_NSOFFSET(owner_id), "Owner Id"}, {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(child), "Child List"},
{ACPI_EXD_POINTER, ACPI_EXD_NSOFFSET(peer), "Next Peer"} {ACPI_EXD_POINTER, ACPI_EXD_NSOFFSET(peer), "Next Peer"}
}; };
......
...@@ -47,9 +47,6 @@ ...@@ -47,9 +47,6 @@
#define _COMPONENT ACPI_NAMESPACE #define _COMPONENT ACPI_NAMESPACE
ACPI_MODULE_NAME("nsalloc") ACPI_MODULE_NAME("nsalloc")
/* Local prototypes */
static void acpi_ns_remove_reference(struct acpi_namespace_node *node);
/******************************************************************************* /*******************************************************************************
* *
* FUNCTION: acpi_ns_create_node * FUNCTION: acpi_ns_create_node
...@@ -61,14 +58,13 @@ static void acpi_ns_remove_reference(struct acpi_namespace_node *node); ...@@ -61,14 +58,13 @@ static void acpi_ns_remove_reference(struct acpi_namespace_node *node);
* DESCRIPTION: Create a namespace node * DESCRIPTION: Create a namespace node
* *
******************************************************************************/ ******************************************************************************/
struct acpi_namespace_node *acpi_ns_create_node(u32 name) struct acpi_namespace_node *acpi_ns_create_node(u32 name)
{ {
struct acpi_namespace_node *node; struct acpi_namespace_node *node;
ACPI_FUNCTION_TRACE("ns_create_node"); ACPI_FUNCTION_TRACE("ns_create_node");
node = ACPI_ALLOCATE_ZEROED(sizeof(struct acpi_namespace_node)); node = acpi_os_acquire_object(acpi_gbl_namespace_cache);
if (!node) { if (!node) {
return_PTR(NULL); return_PTR(NULL);
} }
...@@ -76,9 +72,7 @@ struct acpi_namespace_node *acpi_ns_create_node(u32 name) ...@@ -76,9 +72,7 @@ struct acpi_namespace_node *acpi_ns_create_node(u32 name)
ACPI_MEM_TRACKING(acpi_gbl_ns_node_list->total_allocated++); ACPI_MEM_TRACKING(acpi_gbl_ns_node_list->total_allocated++);
node->name.integer = name; node->name.integer = name;
node->reference_count = 1;
ACPI_SET_DESCRIPTOR_TYPE(node, ACPI_DESC_TYPE_NAMED); ACPI_SET_DESCRIPTOR_TYPE(node, ACPI_DESC_TYPE_NAMED);
return_PTR(node); return_PTR(node);
} }
...@@ -139,10 +133,10 @@ void acpi_ns_delete_node(struct acpi_namespace_node *node) ...@@ -139,10 +133,10 @@ void acpi_ns_delete_node(struct acpi_namespace_node *node)
ACPI_MEM_TRACKING(acpi_gbl_ns_node_list->total_freed++); ACPI_MEM_TRACKING(acpi_gbl_ns_node_list->total_freed++);
/* /*
* Detach an object if there is one then delete the node * Detach an object if there is one, then delete the node
*/ */
acpi_ns_detach_object(node); acpi_ns_detach_object(node);
ACPI_FREE(node); (void)acpi_os_release_object(acpi_gbl_namespace_cache, node);
return_VOID; return_VOID;
} }
...@@ -217,16 +211,6 @@ void acpi_ns_install_node(struct acpi_walk_state *walk_state, struct acpi_namesp ...@@ -217,16 +211,6 @@ void acpi_ns_install_node(struct acpi_walk_state *walk_state, struct acpi_namesp
acpi_ut_get_node_name(parent_node), acpi_ut_get_node_name(parent_node),
acpi_ut_get_type_name(parent_node->type), acpi_ut_get_type_name(parent_node->type),
parent_node)); parent_node));
/*
* Increment the reference count(s) of all parents up to
* the root!
*/
while ((node = acpi_ns_get_parent_node(node)) != NULL) {
node->reference_count++;
}
return_VOID;
} }
/******************************************************************************* /*******************************************************************************
...@@ -246,7 +230,6 @@ void acpi_ns_delete_children(struct acpi_namespace_node *parent_node) ...@@ -246,7 +230,6 @@ void acpi_ns_delete_children(struct acpi_namespace_node *parent_node)
{ {
struct acpi_namespace_node *child_node; struct acpi_namespace_node *child_node;
struct acpi_namespace_node *next_node; struct acpi_namespace_node *next_node;
struct acpi_namespace_node *node;
u8 flags; u8 flags;
ACPI_FUNCTION_TRACE_PTR("ns_delete_children", parent_node); ACPI_FUNCTION_TRACE_PTR("ns_delete_children", parent_node);
...@@ -292,26 +275,10 @@ void acpi_ns_delete_children(struct acpi_namespace_node *parent_node) ...@@ -292,26 +275,10 @@ void acpi_ns_delete_children(struct acpi_namespace_node *parent_node)
*/ */
acpi_ns_detach_object(child_node); acpi_ns_detach_object(child_node);
/*
* Decrement the reference count(s) of all parents up to
* the root! (counts were incremented when the node was created)
*/
node = child_node;
while ((node = acpi_ns_get_parent_node(node)) != NULL) {
node->reference_count--;
}
/* There should be only one reference remaining on this node */
if (child_node->reference_count != 1) {
ACPI_WARNING((AE_INFO,
"Existing references (%d) on node being deleted (%p)",
child_node->reference_count, child_node));
}
/* Now we can delete the node */ /* Now we can delete the node */
ACPI_FREE(child_node); (void)acpi_os_release_object(acpi_gbl_namespace_cache,
child_node);
/* And move on to the next child in the list */ /* And move on to the next child in the list */
...@@ -358,8 +325,9 @@ void acpi_ns_delete_namespace_subtree(struct acpi_namespace_node *parent_node) ...@@ -358,8 +325,9 @@ void acpi_ns_delete_namespace_subtree(struct acpi_namespace_node *parent_node)
/* Get the next node in this scope (NULL if none) */ /* Get the next node in this scope (NULL if none) */
child_node = acpi_ns_get_next_node(ACPI_TYPE_ANY, parent_node, child_node =
child_node); acpi_ns_get_next_node(ACPI_TYPE_ANY, parent_node,
child_node);
if (child_node) { if (child_node) {
/* Found a child node - detach any attached object */ /* Found a child node - detach any attached object */
...@@ -404,57 +372,6 @@ void acpi_ns_delete_namespace_subtree(struct acpi_namespace_node *parent_node) ...@@ -404,57 +372,6 @@ void acpi_ns_delete_namespace_subtree(struct acpi_namespace_node *parent_node)
return_VOID; return_VOID;
} }
/*******************************************************************************
*
* FUNCTION: acpi_ns_remove_reference
*
* PARAMETERS: Node - Named node whose reference count is to be
* decremented
*
* RETURN: None.
*
* DESCRIPTION: Remove a Node reference. Decrements the reference count
* of all parent Nodes up to the root. Any node along
* the way that reaches zero references is freed.
*
******************************************************************************/
static void acpi_ns_remove_reference(struct acpi_namespace_node *node)
{
struct acpi_namespace_node *parent_node;
struct acpi_namespace_node *this_node;
ACPI_FUNCTION_ENTRY();
/*
* Decrement the reference count(s) of this node and all
* nodes up to the root, Delete anything with zero remaining references.
*/
this_node = node;
while (this_node) {
/* Prepare to move up to parent */
parent_node = acpi_ns_get_parent_node(this_node);
/* Decrement the reference count on this node */
this_node->reference_count--;
/* Delete the node if no more references */
if (!this_node->reference_count) {
/* Delete all children and delete the node */
acpi_ns_delete_children(this_node);
acpi_ns_delete_node(this_node);
}
this_node = parent_node;
}
}
/******************************************************************************* /*******************************************************************************
* *
* FUNCTION: acpi_ns_delete_namespace_by_owner * FUNCTION: acpi_ns_delete_namespace_by_owner
...@@ -482,9 +399,9 @@ void acpi_ns_delete_namespace_by_owner(acpi_owner_id owner_id) ...@@ -482,9 +399,9 @@ void acpi_ns_delete_namespace_by_owner(acpi_owner_id owner_id)
return_VOID; return_VOID;
} }
deletion_node = NULL;
parent_node = acpi_gbl_root_node; parent_node = acpi_gbl_root_node;
child_node = NULL; child_node = NULL;
deletion_node = NULL;
level = 1; level = 1;
/* /*
...@@ -501,7 +418,8 @@ void acpi_ns_delete_namespace_by_owner(acpi_owner_id owner_id) ...@@ -501,7 +418,8 @@ void acpi_ns_delete_namespace_by_owner(acpi_owner_id owner_id)
child_node); child_node);
if (deletion_node) { if (deletion_node) {
acpi_ns_remove_reference(deletion_node); acpi_ns_delete_children(deletion_node);
acpi_ns_delete_node(deletion_node);
deletion_node = NULL; deletion_node = NULL;
} }
......
...@@ -81,7 +81,7 @@ acpi_ns_report_error(char *module_name, ...@@ -81,7 +81,7 @@ acpi_ns_report_error(char *module_name,
u32 bad_name; u32 bad_name;
char *name = NULL; char *name = NULL;
acpi_ut_report_error(module_name, line_number); acpi_os_printf("ACPI Error (%s-%04d): ", module_name, line_number);
if (lookup_status == AE_BAD_CHARACTER) { if (lookup_status == AE_BAD_CHARACTER) {
...@@ -139,7 +139,7 @@ acpi_ns_report_method_error(char *module_name, ...@@ -139,7 +139,7 @@ acpi_ns_report_method_error(char *module_name,
acpi_status status; acpi_status status;
struct acpi_namespace_node *node = prefix_node; struct acpi_namespace_node *node = prefix_node;
acpi_ut_report_error(module_name, line_number); acpi_os_printf("ACPI Error (%s-%04d): ", module_name, line_number);
if (path) { if (path) {
status = acpi_ns_get_node_by_path(path, prefix_node, status = acpi_ns_get_node_by_path(path, prefix_node,
......
...@@ -1126,14 +1126,13 @@ acpi_status acpi_os_release_object(acpi_cache_t * cache, void *object) ...@@ -1126,14 +1126,13 @@ acpi_status acpi_os_release_object(acpi_cache_t * cache, void *object)
* *
* RETURN: Status * RETURN: Status
* *
* DESCRIPTION: Get an object from the specified cache. If cache is empty, * DESCRIPTION: Return a zero-filled object.
* the object is allocated.
* *
******************************************************************************/ ******************************************************************************/
void *acpi_os_acquire_object(acpi_cache_t * cache) void *acpi_os_acquire_object(acpi_cache_t * cache)
{ {
void *object = kmem_cache_alloc(cache, GFP_KERNEL); void *object = kmem_cache_zalloc(cache, GFP_KERNEL);
WARN_ON(!object); WARN_ON(!object);
return object; return object;
} }
......
...@@ -113,7 +113,7 @@ acpi_ps_init_scope(struct acpi_parse_state * parser_state, ...@@ -113,7 +113,7 @@ acpi_ps_init_scope(struct acpi_parse_state * parser_state,
return_ACPI_STATUS(AE_NO_MEMORY); return_ACPI_STATUS(AE_NO_MEMORY);
} }
scope->common.data_type = ACPI_DESC_TYPE_STATE_RPSCOPE; scope->common.descriptor_type = ACPI_DESC_TYPE_STATE_RPSCOPE;
scope->parse_scope.op = root_op; scope->parse_scope.op = root_op;
scope->parse_scope.arg_count = ACPI_VAR_ARGS; scope->parse_scope.arg_count = ACPI_VAR_ARGS;
scope->parse_scope.arg_end = parser_state->aml_end; scope->parse_scope.arg_end = parser_state->aml_end;
...@@ -143,7 +143,7 @@ acpi_ps_init_scope(struct acpi_parse_state * parser_state, ...@@ -143,7 +143,7 @@ acpi_ps_init_scope(struct acpi_parse_state * parser_state,
acpi_status acpi_status
acpi_ps_push_scope(struct acpi_parse_state *parser_state, acpi_ps_push_scope(struct acpi_parse_state *parser_state,
union acpi_parse_object *op, union acpi_parse_object *op,
u32 remaining_args, u32 arg_count) u32 remaining_args, u8 arg_count)
{ {
union acpi_generic_state *scope; union acpi_generic_state *scope;
...@@ -154,7 +154,7 @@ acpi_ps_push_scope(struct acpi_parse_state *parser_state, ...@@ -154,7 +154,7 @@ acpi_ps_push_scope(struct acpi_parse_state *parser_state,
return_ACPI_STATUS(AE_NO_MEMORY); return_ACPI_STATUS(AE_NO_MEMORY);
} }
scope->common.data_type = ACPI_DESC_TYPE_STATE_PSCOPE; scope->common.descriptor_type = ACPI_DESC_TYPE_STATE_PSCOPE;
scope->parse_scope.op = op; scope->parse_scope.op = op;
scope->parse_scope.arg_list = remaining_args; scope->parse_scope.arg_list = remaining_args;
scope->parse_scope.arg_count = arg_count; scope->parse_scope.arg_count = arg_count;
...@@ -196,7 +196,7 @@ acpi_ps_push_scope(struct acpi_parse_state *parser_state, ...@@ -196,7 +196,7 @@ acpi_ps_push_scope(struct acpi_parse_state *parser_state,
void void
acpi_ps_pop_scope(struct acpi_parse_state *parser_state, acpi_ps_pop_scope(struct acpi_parse_state *parser_state,
union acpi_parse_object **op, u32 * arg_list, u32 * arg_count) union acpi_parse_object **op, u32 * arg_list, u8 * arg_count)
{ {
union acpi_generic_state *scope = parser_state->scope; union acpi_generic_state *scope = parser_state->scope;
...@@ -207,7 +207,7 @@ acpi_ps_pop_scope(struct acpi_parse_state *parser_state, ...@@ -207,7 +207,7 @@ acpi_ps_pop_scope(struct acpi_parse_state *parser_state,
if (scope->common.next) { if (scope->common.next) {
scope = acpi_ut_pop_generic_state(&parser_state->scope); scope = acpi_ut_pop_generic_state(&parser_state->scope);
/* return to parsing previous op */ /* Return to parsing previous op */
*op = scope->parse_scope.op; *op = scope->parse_scope.op;
*arg_list = scope->parse_scope.arg_list; *arg_list = scope->parse_scope.arg_list;
...@@ -218,7 +218,7 @@ acpi_ps_pop_scope(struct acpi_parse_state *parser_state, ...@@ -218,7 +218,7 @@ acpi_ps_pop_scope(struct acpi_parse_state *parser_state,
acpi_ut_delete_generic_state(scope); acpi_ut_delete_generic_state(scope);
} else { } else {
/* empty parse stack, prepare to fetch next opcode */ /* Empty parse stack, prepare to fetch next opcode */
*op = NULL; *op = NULL;
*arg_list = 0; *arg_list = 0;
......
...@@ -89,7 +89,7 @@ void acpi_ps_init_op(union acpi_parse_object *op, u16 opcode) ...@@ -89,7 +89,7 @@ void acpi_ps_init_op(union acpi_parse_object *op, u16 opcode)
{ {
ACPI_FUNCTION_ENTRY(); ACPI_FUNCTION_ENTRY();
op->common.data_type = ACPI_DESC_TYPE_PARSER; op->common.descriptor_type = ACPI_DESC_TYPE_PARSER;
op->common.aml_opcode = opcode; op->common.aml_opcode = opcode;
ACPI_DISASM_ONLY_MEMBERS(ACPI_STRNCPY(op->common.aml_op_name, ACPI_DISASM_ONLY_MEMBERS(ACPI_STRNCPY(op->common.aml_op_name,
......
...@@ -456,7 +456,7 @@ acpi_rs_get_list_length(u8 * aml_buffer, ...@@ -456,7 +456,7 @@ acpi_rs_get_list_length(u8 * aml_buffer,
*size_needed += buffer_size; *size_needed += buffer_size;
ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES,
"Type %.2X, Aml %.2X internal %.2X\n", "Type %.2X, aml_length %.2X internal_length %.2X\n",
acpi_ut_get_resource_type(aml_buffer), acpi_ut_get_resource_type(aml_buffer),
acpi_ut_get_descriptor_length(aml_buffer), acpi_ut_get_descriptor_length(aml_buffer),
buffer_size)); buffer_size));
......
...@@ -75,6 +75,7 @@ acpi_rs_create_resource_list(union acpi_operand_object *aml_buffer, ...@@ -75,6 +75,7 @@ acpi_rs_create_resource_list(union acpi_operand_object *aml_buffer,
u8 *aml_start; u8 *aml_start;
acpi_size list_size_needed = 0; acpi_size list_size_needed = 0;
u32 aml_buffer_length; u32 aml_buffer_length;
void *resource;
ACPI_FUNCTION_TRACE("rs_create_resource_list"); ACPI_FUNCTION_TRACE("rs_create_resource_list");
...@@ -107,8 +108,10 @@ acpi_rs_create_resource_list(union acpi_operand_object *aml_buffer, ...@@ -107,8 +108,10 @@ acpi_rs_create_resource_list(union acpi_operand_object *aml_buffer,
/* Do the conversion */ /* Do the conversion */
status = acpi_rs_convert_aml_to_resources(aml_start, aml_buffer_length, resource = output_buffer->pointer;
output_buffer->pointer); status = acpi_ut_walk_aml_resources(aml_start, aml_buffer_length,
acpi_rs_convert_aml_to_resources,
&resource);
if (ACPI_FAILURE(status)) { if (ACPI_FAILURE(status)) {
return_ACPI_STATUS(status); return_ACPI_STATUS(status);
} }
......
...@@ -51,92 +51,60 @@ ACPI_MODULE_NAME("rslist") ...@@ -51,92 +51,60 @@ ACPI_MODULE_NAME("rslist")
* *
* FUNCTION: acpi_rs_convert_aml_to_resources * FUNCTION: acpi_rs_convert_aml_to_resources
* *
* PARAMETERS: Aml - Pointer to the resource byte stream * PARAMETERS: acpi_walk_aml_callback
* aml_length - Length of Aml * resource_ptr - Pointer to the buffer that will
* output_buffer - Pointer to the buffer that will * contain the output structures
* contain the output structures
* *
* RETURN: Status * RETURN: Status
* *
* DESCRIPTION: Takes the resource byte stream and parses it, creating a * DESCRIPTION: Convert an AML resource to an internal representation of the
* linked list of resources in the caller's output buffer * resource that is aligned and easier to access.
* *
******************************************************************************/ ******************************************************************************/
acpi_status acpi_status
acpi_rs_convert_aml_to_resources(u8 * aml, u32 aml_length, u8 * output_buffer) acpi_rs_convert_aml_to_resources(u8 * aml,
u32 length,
u32 offset,
u8 resource_index, void **resource_ptr)
{ {
struct acpi_resource *resource = (void *)output_buffer; struct acpi_resource *resource = *resource_ptr;
acpi_status status; acpi_status status;
u8 resource_index;
u8 *end_aml;
ACPI_FUNCTION_TRACE("rs_convert_aml_to_resources"); ACPI_FUNCTION_TRACE("rs_convert_aml_to_resources");
end_aml = aml + aml_length; /*
* Check that the input buffer and all subsequent pointers into it
/* Loop until end-of-buffer or an end_tag is found */ * are aligned on a native word boundary. Most important on IA64
*/
while (aml < end_aml) { if (ACPI_IS_MISALIGNED(resource)) {
/* ACPI_WARNING((AE_INFO,
* Check that the input buffer and all subsequent pointers into it "Misaligned resource pointer %p", resource));
* are aligned on a native word boundary. Most important on IA64 }
*/
if (ACPI_IS_MISALIGNED(resource)) {
ACPI_WARNING((AE_INFO,
"Misaligned resource pointer %p",
resource));
}
/* Validate the Resource Type and Resource Length */
status = acpi_ut_validate_resource(aml, &resource_index);
if (ACPI_FAILURE(status)) {
return_ACPI_STATUS(status);
}
/* Convert the AML byte stream resource to a local resource struct */
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_EXCEPTION((AE_INFO, status,
"Could not convert AML resource (Type %X)",
*aml));
return_ACPI_STATUS(status);
}
ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES,
"Type %.2X, Aml %.2X internal %.2X\n",
acpi_ut_get_resource_type(aml),
acpi_ut_get_descriptor_length(aml),
resource->length));
/* Normal exit on completion of an end_tag resource descriptor */
if (acpi_ut_get_resource_type(aml) ==
ACPI_RESOURCE_NAME_END_TAG) {
return_ACPI_STATUS(AE_OK);
}
/* Point to the next input AML resource */
aml += acpi_ut_get_descriptor_length(aml);
/* Point to the next structure in the output buffer */
resource = /* Convert the AML byte stream resource to a local resource struct */
ACPI_ADD_PTR(struct acpi_resource, resource,
resource->length); 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_EXCEPTION((AE_INFO, status,
"Could not convert AML resource (Type %X)",
*aml));
return_ACPI_STATUS(status);
} }
/* Did not find an end_tag resource descriptor */ ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES,
"Type %.2X, aml_length %.2X internal_length %.2X\n",
acpi_ut_get_resource_type(aml), length,
resource->length));
return_ACPI_STATUS(AE_AML_NO_RESOURCE_END_TAG); /* Point to the next structure in the output buffer */
*resource_ptr = ACPI_ADD_PTR(void, resource, resource->length);
return_ACPI_STATUS(AE_OK);
} }
/******************************************************************************* /*******************************************************************************
......
...@@ -242,7 +242,7 @@ ACPI_EXPORT_SYMBOL(acpi_get_possible_resources) ...@@ -242,7 +242,7 @@ ACPI_EXPORT_SYMBOL(acpi_get_possible_resources)
acpi_status acpi_status
acpi_walk_resources(acpi_handle device_handle, acpi_walk_resources(acpi_handle device_handle,
char *name, char *name,
ACPI_WALK_RESOURCE_CALLBACK user_function, void *context) acpi_walk_resource_callback user_function, void *context)
{ {
acpi_status status; acpi_status status;
struct acpi_buffer buffer; struct acpi_buffer buffer;
...@@ -469,7 +469,7 @@ ACPI_EXPORT_SYMBOL(acpi_get_vendor_resource) ...@@ -469,7 +469,7 @@ ACPI_EXPORT_SYMBOL(acpi_get_vendor_resource)
* *
* FUNCTION: acpi_rs_match_vendor_resource * FUNCTION: acpi_rs_match_vendor_resource
* *
* PARAMETERS: ACPI_WALK_RESOURCE_CALLBACK * PARAMETERS: acpi_walk_resource_callback
* *
* RETURN: Status * RETURN: Status
* *
......
This diff is collapsed.
...@@ -272,9 +272,9 @@ void *acpi_os_acquire_object(struct acpi_memory_list *cache) ...@@ -272,9 +272,9 @@ void *acpi_os_acquire_object(struct acpi_memory_list *cache)
cache->current_depth--; cache->current_depth--;
ACPI_MEM_TRACKING(cache->hits++); ACPI_MEM_TRACKING(cache->hits++);
ACPI_MEM_TRACKING(ACPI_DEBUG_PRINT((ACPI_DB_EXEC, ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
"Object %p from %s cache\n", "Object %p from %s cache\n", object,
object, cache->list_name))); cache->list_name));
status = acpi_ut_release_mutex(ACPI_MTX_CACHES); status = acpi_ut_release_mutex(ACPI_MTX_CACHES);
if (ACPI_FAILURE(status)) { if (ACPI_FAILURE(status)) {
......
...@@ -200,8 +200,7 @@ static void acpi_ut_delete_internal_obj(union acpi_operand_object *object) ...@@ -200,8 +200,7 @@ static void acpi_ut_delete_internal_obj(union acpi_operand_object *object)
*/ */
handler_desc = object->region.handler; handler_desc = object->region.handler;
if (handler_desc) { if (handler_desc) {
if (handler_desc->address_space. if (handler_desc->address_space.handler_flags &
hflags &
ACPI_ADDR_HANDLER_DEFAULT_INSTALLED) { ACPI_ADDR_HANDLER_DEFAULT_INSTALLED) {
obj_pointer = obj_pointer =
second_desc->extra.region_context; second_desc->extra.region_context;
......
...@@ -191,12 +191,14 @@ const char *acpi_gbl_valid_osi_strings[ACPI_NUM_OSI_STRINGS] = { ...@@ -191,12 +191,14 @@ const char *acpi_gbl_valid_osi_strings[ACPI_NUM_OSI_STRINGS] = {
"Linux", "Linux",
"Windows 2000", "Windows 2000",
"Windows 2001", "Windows 2001",
"Windows 2001.1",
"Windows 2001 SP0", "Windows 2001 SP0",
"Windows 2001 SP1", "Windows 2001 SP1",
"Windows 2001 SP2", "Windows 2001 SP2",
"Windows 2001 SP3", "Windows 2001 SP3",
"Windows 2001 SP4", "Windows 2001 SP4",
"Windows 2001.1",
"Windows 2001.1 SP1", /* Added 03/2006 */
"Windows 2006", /* Added 03/2006 */
/* Feature Group Strings */ /* Feature Group Strings */
...@@ -633,7 +635,7 @@ char *acpi_ut_get_node_name(void *object) ...@@ -633,7 +635,7 @@ char *acpi_ut_get_node_name(void *object)
/* Descriptor must be a namespace node */ /* Descriptor must be a namespace node */
if (node->descriptor != ACPI_DESC_TYPE_NAMED) { if (ACPI_GET_DESCRIPTOR_TYPE(node) != ACPI_DESC_TYPE_NAMED) {
return ("####"); return ("####");
} }
...@@ -855,7 +857,7 @@ void acpi_ut_init_globals(void) ...@@ -855,7 +857,7 @@ void acpi_ut_init_globals(void)
acpi_gbl_root_node = NULL; acpi_gbl_root_node = NULL;
acpi_gbl_root_node_struct.name.integer = ACPI_ROOT_NAME; acpi_gbl_root_node_struct.name.integer = ACPI_ROOT_NAME;
acpi_gbl_root_node_struct.descriptor = ACPI_DESC_TYPE_NAMED; acpi_gbl_root_node_struct.descriptor_type = ACPI_DESC_TYPE_NAMED;
acpi_gbl_root_node_struct.type = ACPI_TYPE_DEVICE; acpi_gbl_root_node_struct.type = ACPI_TYPE_DEVICE;
acpi_gbl_root_node_struct.child = NULL; acpi_gbl_root_node_struct.child = NULL;
acpi_gbl_root_node_struct.peer = NULL; acpi_gbl_root_node_struct.peer = NULL;
......
...@@ -881,36 +881,3 @@ acpi_ut_info(char *module_name, u32 line_number, char *format, ...) ...@@ -881,36 +881,3 @@ acpi_ut_info(char *module_name, u32 line_number, char *format, ...)
acpi_os_vprintf(format, args); acpi_os_vprintf(format, args);
acpi_os_printf(" [%X]\n", ACPI_CA_VERSION); acpi_os_printf(" [%X]\n", ACPI_CA_VERSION);
} }
/*******************************************************************************
*
* FUNCTION: acpi_ut_report_error, Warning, Info
*
* PARAMETERS: module_name - Caller's module name (for error output)
* line_number - Caller's line number (for error output)
*
* RETURN: None
*
* DESCRIPTION: Print error message
*
* Note: Legacy only, should be removed when no longer used by drivers.
*
******************************************************************************/
void acpi_ut_report_error(char *module_name, u32 line_number)
{
acpi_os_printf("ACPI Error (%s-%04d): ", module_name, line_number);
}
void acpi_ut_report_warning(char *module_name, u32 line_number)
{
acpi_os_printf("ACPI Warning (%s-%04d): ", module_name, line_number);
}
void acpi_ut_report_info(char *module_name, u32 line_number)
{
acpi_os_printf("ACPI (%s-%04d): ", module_name, line_number);
}
...@@ -238,6 +238,104 @@ static const u8 acpi_gbl_resource_types[] = { ...@@ -238,6 +238,104 @@ static const u8 acpi_gbl_resource_types[] = {
ACPI_FIXED_LENGTH ACPI_FIXED_LENGTH
}; };
/*******************************************************************************
*
* FUNCTION: acpi_ut_walk_aml_resources
*
* PARAMETERS: Aml - Pointer to the raw AML resource template
* aml_length - Length of the entire template
* user_function - Called once for each descriptor found. If
* NULL, a pointer to the end_tag is returned
* Context - Passed to user_function
*
* RETURN: Status
*
* DESCRIPTION: Walk a raw AML resource list(buffer). User function called
* once for each resource found.
*
******************************************************************************/
acpi_status
acpi_ut_walk_aml_resources(u8 * aml,
acpi_size aml_length,
acpi_walk_aml_callback user_function, void *context)
{
acpi_status status;
u8 *end_aml;
u8 resource_index;
u32 length;
u32 offset = 0;
ACPI_FUNCTION_TRACE("ut_walk_aml_resources");
/* The absolute minimum resource template is one end_tag descriptor */
if (aml_length < sizeof(struct aml_resource_end_tag)) {
return_ACPI_STATUS(AE_AML_NO_RESOURCE_END_TAG);
}
/* Point to the end of the resource template buffer */
end_aml = aml + aml_length;
/* Walk the byte list, abort on any invalid descriptor type or length */
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);
}
/* Get the length of this descriptor */
length = acpi_ut_get_descriptor_length(aml);
/* Invoke the user function */
if (user_function) {
status =
user_function(aml, length, offset, resource_index,
context);
if (ACPI_FAILURE(status)) {
return (status);
}
}
/* An end_tag descriptor terminates this resource template */
if (acpi_ut_get_resource_type(aml) ==
ACPI_RESOURCE_NAME_END_TAG) {
/*
* There must be at least one more byte in the buffer for
* the 2nd byte of the end_tag
*/
if ((aml + 1) >= end_aml) {
return_ACPI_STATUS(AE_AML_NO_RESOURCE_END_TAG);
}
/* Return the pointer to the end_tag if requested */
if (!user_function) {
*(void **)context = aml;
}
/* Normal exit */
return_ACPI_STATUS(AE_OK);
}
aml += length;
offset += length;
}
/* Did not find an end_tag descriptor */
return (AE_AML_NO_RESOURCE_END_TAG);
}
/******************************************************************************* /*******************************************************************************
* *
* FUNCTION: acpi_ut_validate_resource * FUNCTION: acpi_ut_validate_resource
...@@ -498,61 +596,21 @@ acpi_ut_get_resource_end_tag(union acpi_operand_object * obj_desc, ...@@ -498,61 +596,21 @@ acpi_ut_get_resource_end_tag(union acpi_operand_object * obj_desc,
u8 ** end_tag) u8 ** end_tag)
{ {
acpi_status status; acpi_status status;
u8 *aml;
u8 *end_aml;
ACPI_FUNCTION_TRACE("ut_get_resource_end_tag"); ACPI_FUNCTION_TRACE("ut_get_resource_end_tag");
/* Get start and end pointers */
aml = obj_desc->buffer.pointer;
end_aml = aml + obj_desc->buffer.length;
/* Allow a buffer length of zero */ /* Allow a buffer length of zero */
if (!obj_desc->buffer.length) { if (!obj_desc->buffer.length) {
*end_tag = aml; *end_tag = obj_desc->buffer.pointer;
return_ACPI_STATUS(AE_OK); return_ACPI_STATUS(AE_OK);
} }
/* Walk the resource template, one descriptor per iteration */ /* Validate the template and get a pointer to the end_tag */
while (aml < end_aml) {
/* Validate the Resource Type and Resource Length */
status = acpi_ut_validate_resource(aml, NULL);
if (ACPI_FAILURE(status)) {
return_ACPI_STATUS(status);
}
/* end_tag resource indicates the end of the resource template */
if (acpi_ut_get_resource_type(aml) ==
ACPI_RESOURCE_NAME_END_TAG) {
/*
* There must be at least one more byte in the buffer for
* the 2nd byte of the end_tag
*/
if ((aml + 1) >= end_aml) {
return_ACPI_STATUS(AE_AML_NO_RESOURCE_END_TAG);
}
/* Return the pointer to the end_tag */
*end_tag = aml;
return_ACPI_STATUS(AE_OK);
}
/*
* Point to the next resource descriptor in the AML buffer. The
* descriptor length is guaranteed to be non-zero by resource
* validation above.
*/
aml += acpi_ut_get_descriptor_length(aml);
}
/* Did not find an end_tag resource descriptor */ status = acpi_ut_walk_aml_resources(obj_desc->buffer.pointer,
obj_desc->buffer.length, NULL,
end_tag);
return_ACPI_STATUS(AE_AML_NO_RESOURCE_END_TAG); return_ACPI_STATUS(status);
} }
...@@ -162,7 +162,7 @@ union acpi_generic_state *acpi_ut_create_generic_state(void) ...@@ -162,7 +162,7 @@ union acpi_generic_state *acpi_ut_create_generic_state(void)
/* Initialize */ /* Initialize */
memset(state, 0, sizeof(union acpi_generic_state)); memset(state, 0, sizeof(union acpi_generic_state));
state->common.data_type = ACPI_DESC_TYPE_STATE; state->common.descriptor_type = ACPI_DESC_TYPE_STATE;
} }
return (state); return (state);
...@@ -196,7 +196,7 @@ struct acpi_thread_state *acpi_ut_create_thread_state(void) ...@@ -196,7 +196,7 @@ struct acpi_thread_state *acpi_ut_create_thread_state(void)
/* Init fields specific to the update struct */ /* Init fields specific to the update struct */
state->common.data_type = ACPI_DESC_TYPE_STATE_THREAD; state->common.descriptor_type = ACPI_DESC_TYPE_STATE_THREAD;
state->thread.thread_id = acpi_os_get_thread_id(); state->thread.thread_id = acpi_os_get_thread_id();
return_PTR((struct acpi_thread_state *)state); return_PTR((struct acpi_thread_state *)state);
...@@ -233,7 +233,7 @@ union acpi_generic_state *acpi_ut_create_update_state(union acpi_operand_object ...@@ -233,7 +233,7 @@ union acpi_generic_state *acpi_ut_create_update_state(union acpi_operand_object
/* Init fields specific to the update struct */ /* Init fields specific to the update struct */
state->common.data_type = ACPI_DESC_TYPE_STATE_UPDATE; state->common.descriptor_type = ACPI_DESC_TYPE_STATE_UPDATE;
state->update.object = object; state->update.object = object;
state->update.value = action; state->update.value = action;
...@@ -270,7 +270,7 @@ union acpi_generic_state *acpi_ut_create_pkg_state(void *internal_object, ...@@ -270,7 +270,7 @@ union acpi_generic_state *acpi_ut_create_pkg_state(void *internal_object,
/* Init fields specific to the update struct */ /* Init fields specific to the update struct */
state->common.data_type = ACPI_DESC_TYPE_STATE_PACKAGE; state->common.descriptor_type = ACPI_DESC_TYPE_STATE_PACKAGE;
state->pkg.source_object = (union acpi_operand_object *)internal_object; state->pkg.source_object = (union acpi_operand_object *)internal_object;
state->pkg.dest_object = external_object; state->pkg.dest_object = external_object;
state->pkg.index = index; state->pkg.index = index;
...@@ -307,7 +307,7 @@ union acpi_generic_state *acpi_ut_create_control_state(void) ...@@ -307,7 +307,7 @@ union acpi_generic_state *acpi_ut_create_control_state(void)
/* Init fields specific to the control struct */ /* Init fields specific to the control struct */
state->common.data_type = ACPI_DESC_TYPE_STATE_CONTROL; state->common.descriptor_type = ACPI_DESC_TYPE_STATE_CONTROL;
state->common.state = ACPI_CONTROL_CONDITIONAL_EXECUTING; state->common.state = ACPI_CONTROL_CONDITIONAL_EXECUTING;
return_PTR(state); return_PTR(state);
......
...@@ -63,7 +63,7 @@ ...@@ -63,7 +63,7 @@
/* Current ACPICA subsystem version in YYYYMMDD format */ /* Current ACPICA subsystem version in YYYYMMDD format */
#define ACPI_CA_VERSION 0x20060310 #define ACPI_CA_VERSION 0x20060317
/* /*
* OS name, used for the _OS object. The _OS object is essentially obsolete, * OS name, used for the _OS object. The _OS object is essentially obsolete,
...@@ -81,6 +81,7 @@ ...@@ -81,6 +81,7 @@
#define ACPI_MAX_PARSE_CACHE_DEPTH 96 /* Parse tree objects */ #define ACPI_MAX_PARSE_CACHE_DEPTH 96 /* Parse tree objects */
#define ACPI_MAX_EXTPARSE_CACHE_DEPTH 96 /* Parse tree objects */ #define ACPI_MAX_EXTPARSE_CACHE_DEPTH 96 /* Parse tree objects */
#define ACPI_MAX_OBJECT_CACHE_DEPTH 96 /* Interpreter operand objects */ #define ACPI_MAX_OBJECT_CACHE_DEPTH 96 /* Interpreter operand objects */
#define ACPI_MAX_NAMESPACE_CACHE_DEPTH 96 /* Namespace objects */
/* /*
* Should the subsystem abort the loading of an ACPI table if the * Should the subsystem abort the loading of an ACPI table if the
...@@ -189,7 +190,7 @@ ...@@ -189,7 +190,7 @@
/* Number of strings associated with the _OSI reserved method */ /* Number of strings associated with the _OSI reserved method */
#define ACPI_NUM_OSI_STRINGS 10 #define ACPI_NUM_OSI_STRINGS 12
/****************************************************************************** /******************************************************************************
* *
......
...@@ -93,7 +93,7 @@ struct acpi_gpe_event_info *acpi_ev_get_gpe_event_info(acpi_handle gpe_device, ...@@ -93,7 +93,7 @@ struct acpi_gpe_event_info *acpi_ev_get_gpe_event_info(acpi_handle gpe_device,
*/ */
u8 acpi_ev_valid_gpe_event(struct acpi_gpe_event_info *gpe_event_info); u8 acpi_ev_valid_gpe_event(struct acpi_gpe_event_info *gpe_event_info);
acpi_status acpi_ev_walk_gpe_list(ACPI_GPE_CALLBACK gpe_walk_callback); acpi_status acpi_ev_walk_gpe_list(acpi_gpe_callback gpe_walk_callback);
acpi_status acpi_status
acpi_ev_delete_gpe_handlers(struct acpi_gpe_xrupt_info *gpe_xrupt_info, acpi_ev_delete_gpe_handlers(struct acpi_gpe_xrupt_info *gpe_xrupt_info,
......
...@@ -203,6 +203,7 @@ ACPI_EXTERN struct acpi_memory_list *acpi_gbl_ns_node_list; ...@@ -203,6 +203,7 @@ ACPI_EXTERN struct acpi_memory_list *acpi_gbl_ns_node_list;
/* Object caches */ /* Object caches */
ACPI_EXTERN acpi_cache_t *acpi_gbl_namespace_cache;
ACPI_EXTERN acpi_cache_t *acpi_gbl_state_cache; ACPI_EXTERN acpi_cache_t *acpi_gbl_state_cache;
ACPI_EXTERN acpi_cache_t *acpi_gbl_ps_node_cache; ACPI_EXTERN acpi_cache_t *acpi_gbl_ps_node_cache;
ACPI_EXTERN acpi_cache_t *acpi_gbl_ps_node_ext_cache; ACPI_EXTERN acpi_cache_t *acpi_gbl_ps_node_ext_cache;
......
This diff is collapsed.
...@@ -400,8 +400,8 @@ ...@@ -400,8 +400,8 @@
* *
* The "Descriptor" field is the first field in both structures. * The "Descriptor" field is the first field in both structures.
*/ */
#define ACPI_GET_DESCRIPTOR_TYPE(d) (((union acpi_descriptor *)(void *)(d))->descriptor_id) #define ACPI_GET_DESCRIPTOR_TYPE(d) (((union acpi_descriptor *)(void *)(d))->common.descriptor_type)
#define ACPI_SET_DESCRIPTOR_TYPE(d,t) (((union acpi_descriptor *)(void *)(d))->descriptor_id = t) #define ACPI_SET_DESCRIPTOR_TYPE(d,t) (((union acpi_descriptor *)(void *)(d))->common.descriptor_type = t)
/* Macro to test the object type */ /* Macro to test the object type */
...@@ -490,7 +490,6 @@ ...@@ -490,7 +490,6 @@
#define ACPI_ERROR(plist) #define ACPI_ERROR(plist)
#define ACPI_ERROR_NAMESPACE(s,e) #define ACPI_ERROR_NAMESPACE(s,e)
#define ACPI_ERROR_METHOD(s,n,p,e) #define ACPI_ERROR_METHOD(s,n,p,e)
#endif #endif
/* /*
...@@ -532,13 +531,13 @@ ...@@ -532,13 +531,13 @@
#endif #endif
#define ACPI_FUNCTION_TRACE(a) ACPI_FUNCTION_NAME(a) \ #define ACPI_FUNCTION_TRACE(a) ACPI_FUNCTION_NAME(a) \
acpi_ut_trace(ACPI_DEBUG_PARAMETERS) acpi_ut_trace(ACPI_DEBUG_PARAMETERS)
#define ACPI_FUNCTION_TRACE_PTR(a,b) ACPI_FUNCTION_NAME(a) \ #define ACPI_FUNCTION_TRACE_PTR(a,b) ACPI_FUNCTION_NAME(a) \
acpi_ut_trace_ptr(ACPI_DEBUG_PARAMETERS,(void *)b) acpi_ut_trace_ptr(ACPI_DEBUG_PARAMETERS,(void *)b)
#define ACPI_FUNCTION_TRACE_U32(a,b) ACPI_FUNCTION_NAME(a) \ #define ACPI_FUNCTION_TRACE_U32(a,b) ACPI_FUNCTION_NAME(a) \
acpi_ut_trace_u32(ACPI_DEBUG_PARAMETERS,(u32)b) acpi_ut_trace_u32(ACPI_DEBUG_PARAMETERS,(u32)b)
#define ACPI_FUNCTION_TRACE_STR(a,b) ACPI_FUNCTION_NAME(a) \ #define ACPI_FUNCTION_TRACE_STR(a,b) ACPI_FUNCTION_NAME(a) \
acpi_ut_trace_str(ACPI_DEBUG_PARAMETERS,(char *)b) acpi_ut_trace_str(ACPI_DEBUG_PARAMETERS,(char *)b)
#define ACPI_FUNCTION_ENTRY() acpi_ut_track_stack_ptr() #define ACPI_FUNCTION_ENTRY() acpi_ut_track_stack_ptr()
...@@ -658,6 +657,7 @@ ...@@ -658,6 +657,7 @@
#define ACPI_DUMP_STACK_ENTRY(a) #define ACPI_DUMP_STACK_ENTRY(a)
#define ACPI_DUMP_OPERANDS(a,b,c,d,e) #define ACPI_DUMP_OPERANDS(a,b,c,d,e)
#define ACPI_DUMP_ENTRY(a,b) #define ACPI_DUMP_ENTRY(a,b)
#define ACPI_DUMP_TABLES(a,b)
#define ACPI_DUMP_PATHNAME(a,b,c,d) #define ACPI_DUMP_PATHNAME(a,b,c,d)
#define ACPI_DUMP_RESOURCE_LIST(a) #define ACPI_DUMP_RESOURCE_LIST(a)
#define ACPI_DUMP_BUFFER(a,b) #define ACPI_DUMP_BUFFER(a,b)
...@@ -714,7 +714,7 @@ ...@@ -714,7 +714,7 @@
/* Memory allocation */ /* Memory allocation */
#define ACPI_ALLOCATE(a) acpi_ut_allocate((acpi_size)(a),_COMPONENT,_acpi_module_name,__LINE__) #define ACPI_ALLOCATE(a) acpi_ut_allocate((acpi_size)(a),_COMPONENT,_acpi_module_name,__LINE__)
#define ACPI_ALLOCATE_ZEROED(a) acpi_ut_callocate((acpi_size)(a), _COMPONENT,_acpi_module_name,__LINE__) #define ACPI_ALLOCATE_ZEROED(a) acpi_ut_allocate_zeroed((acpi_size)(a), _COMPONENT,_acpi_module_name,__LINE__)
#define ACPI_FREE(a) acpi_os_free(a) #define ACPI_FREE(a) acpi_os_free(a)
#define ACPI_MEM_TRACKING(a) #define ACPI_MEM_TRACKING(a)
...@@ -723,9 +723,9 @@ ...@@ -723,9 +723,9 @@
/* Memory allocation */ /* Memory allocation */
#define ACPI_ALLOCATE(a) acpi_ut_allocate_and_track((acpi_size)(a),_COMPONENT,_acpi_module_name,__LINE__) #define ACPI_ALLOCATE(a) acpi_ut_allocate_and_track((acpi_size)(a),_COMPONENT,_acpi_module_name,__LINE__)
#define ACPI_ALLOCATE_ZEROED(a) acpi_ut_callocate_and_track((acpi_size)(a), _COMPONENT,_acpi_module_name,__LINE__) #define ACPI_ALLOCATE_ZEROED(a) acpi_ut_allocate_zeroed_and_track((acpi_size)(a), _COMPONENT,_acpi_module_name,__LINE__)
#define ACPI_FREE(a) acpi_ut_free_and_track(a,_COMPONENT,_acpi_module_name,__LINE__) #define ACPI_FREE(a) acpi_ut_free_and_track(a,_COMPONENT,_acpi_module_name,__LINE__)
#define ACPI_MEM_TRACKING(a) a #define ACPI_MEM_TRACKING(a) a
#endif /* ACPI_DBG_TRACK_ALLOCATIONS */ #endif /* ACPI_DBG_TRACK_ALLOCATIONS */
......
This diff is collapsed.
...@@ -144,7 +144,7 @@ ...@@ -144,7 +144,7 @@
/* /*
* These two levels are essentially obsolete, all instances in the * These two levels are essentially obsolete, all instances in the
* ACPICA core code have been replaced by REPORT_ERROR and REPORT_WARNING * ACPICA core code have been replaced by ACPI_ERROR and ACPI_WARNING
* (Kept here because some drivers may still use them) * (Kept here because some drivers may still use them)
*/ */
#define ACPI_DB_ERROR ACPI_DEBUG_LEVEL (ACPI_LV_ERROR) #define ACPI_DB_ERROR ACPI_DEBUG_LEVEL (ACPI_LV_ERROR)
......
...@@ -48,7 +48,7 @@ ...@@ -48,7 +48,7 @@
/* variable # arguments */ /* variable # arguments */
#define ACPI_VAR_ARGS ACPI_UINT32_MAX #define ACPI_VAR_ARGS ACPI_UINT8_MAX
#define ACPI_PARSE_DELETE_TREE 0x0001 #define ACPI_PARSE_DELETE_TREE 0x0001
#define ACPI_PARSE_NO_TREE_DELETE 0x0000 #define ACPI_PARSE_NO_TREE_DELETE 0x0000
...@@ -146,13 +146,12 @@ u8 acpi_ps_has_completed_scope(struct acpi_parse_state *parser_state); ...@@ -146,13 +146,12 @@ u8 acpi_ps_has_completed_scope(struct acpi_parse_state *parser_state);
void void
acpi_ps_pop_scope(struct acpi_parse_state *parser_state, acpi_ps_pop_scope(struct acpi_parse_state *parser_state,
union acpi_parse_object **op, union acpi_parse_object **op, u32 * arg_list, u8 * arg_count);
u32 * arg_list, u32 * arg_count);
acpi_status acpi_status
acpi_ps_push_scope(struct acpi_parse_state *parser_state, acpi_ps_push_scope(struct acpi_parse_state *parser_state,
union acpi_parse_object *op, union acpi_parse_object *op,
u32 remaining_args, u32 arg_count); u32 remaining_args, u8 arg_count);
void acpi_ps_cleanup_scope(struct acpi_parse_state *state); void acpi_ps_cleanup_scope(struct acpi_parse_state *state);
......
...@@ -268,7 +268,7 @@ acpi_status acpi_remove_gpe_block(acpi_handle gpe_device); ...@@ -268,7 +268,7 @@ acpi_status acpi_remove_gpe_block(acpi_handle gpe_device);
* Resource interfaces * Resource interfaces
*/ */
typedef typedef
acpi_status(*ACPI_WALK_RESOURCE_CALLBACK) (struct acpi_resource * resource, acpi_status(*acpi_walk_resource_callback) (struct acpi_resource * resource,
void *context); void *context);
acpi_status acpi_status
...@@ -290,7 +290,7 @@ acpi_get_possible_resources(acpi_handle device_handle, ...@@ -290,7 +290,7 @@ acpi_get_possible_resources(acpi_handle device_handle,
acpi_status acpi_status
acpi_walk_resources(acpi_handle device_handle, acpi_walk_resources(acpi_handle device_handle,
char *name, char *name,
ACPI_WALK_RESOURCE_CALLBACK user_function, void *context); acpi_walk_resource_callback user_function, void *context);
acpi_status acpi_status
acpi_set_current_resources(acpi_handle device_handle, acpi_set_current_resources(acpi_handle device_handle,
......
...@@ -198,8 +198,9 @@ acpi_rs_get_pci_routing_table_length(union acpi_operand_object *package_object, ...@@ -198,8 +198,9 @@ acpi_rs_get_pci_routing_table_length(union acpi_operand_object *package_object,
acpi_size * buffer_size_needed); acpi_size * buffer_size_needed);
acpi_status acpi_status
acpi_rs_convert_aml_to_resources(u8 * aml_buffer, acpi_rs_convert_aml_to_resources(u8 * aml,
u32 aml_buffer_length, u8 * output_buffer); u32 length,
u32 offset, u8 resource_index, void **context);
acpi_status acpi_status
acpi_rs_convert_resources_to_aml(struct acpi_resource *resource, acpi_rs_convert_resources_to_aml(struct acpi_resource *resource,
......
...@@ -44,6 +44,8 @@ ...@@ -44,6 +44,8 @@
#ifndef __ACSTRUCT_H__ #ifndef __ACSTRUCT_H__
#define __ACSTRUCT_H__ #define __ACSTRUCT_H__
/* acpisrc:struct_defs -- for acpisrc conversion */
/***************************************************************************** /*****************************************************************************
* *
* Tree walking typedefs and structs * Tree walking typedefs and structs
...@@ -64,54 +66,55 @@ ...@@ -64,54 +66,55 @@
#define ACPI_WALK_CONST_OPTIONAL 4 #define ACPI_WALK_CONST_OPTIONAL 4
struct acpi_walk_state { struct acpi_walk_state {
u8 data_type; /* To differentiate various internal objs MUST BE FIRST! */ struct acpi_walk_state *next; /* Next walk_state in list */
u8 descriptor_type; /* To differentiate various internal objs */
u8 walk_type; u8 walk_type;
acpi_owner_id owner_id; /* Owner of objects created during the walk */ u16 opcode; /* Current AML opcode */
u8 last_predicate; /* Result of last predicate */
u8 current_result; /* */
u8 next_op_info; /* Info about next_op */ u8 next_op_info; /* Info about next_op */
u8 num_operands; /* Stack pointer for Operands[] array */ u8 num_operands; /* Stack pointer for Operands[] array */
acpi_owner_id owner_id; /* Owner of objects created during the walk */
u8 last_predicate; /* Result of last predicate */
u8 current_result;
u8 return_used; u8 return_used;
u16 opcode; /* Current AML opcode */
u8 scope_depth; u8 scope_depth;
u8 pass_number; /* Parse pass during table load */ u8 pass_number; /* Parse pass during table load */
u32 arg_count; /* push for fixed or var args */
u32 aml_offset; u32 aml_offset;
u32 arg_types; u32 arg_types;
u32 method_breakpoint; /* For single stepping */ u32 method_breakpoint; /* For single stepping */
u32 user_breakpoint; /* User AML breakpoint */ u32 user_breakpoint; /* User AML breakpoint */
u32 parse_flags; u32 parse_flags;
struct acpi_parse_state parser_state; /* Current state of parser */
u32 prev_arg_types; u32 prev_arg_types;
u8 arg_count; /* push for fixed or var args */
u8 *aml_last_while;
struct acpi_namespace_node arguments[ACPI_METHOD_NUM_ARGS]; /* Control method arguments */ struct acpi_namespace_node arguments[ACPI_METHOD_NUM_ARGS]; /* Control method arguments */
struct acpi_namespace_node local_variables[ACPI_METHOD_NUM_LOCALS]; /* Control method locals */
union acpi_operand_object *operands[ACPI_OBJ_NUM_OPERANDS + 1]; /* Operands passed to the interpreter (+1 for NULL terminator) */
union acpi_operand_object **params;
u8 *aml_last_while;
union acpi_operand_object **caller_return_desc; union acpi_operand_object **caller_return_desc;
union acpi_generic_state *control_state; /* List of control states (nested IFs) */ union acpi_generic_state *control_state; /* List of control states (nested IFs) */
struct acpi_namespace_node *deferred_node; /* Used when executing deferred opcodes */ struct acpi_namespace_node *deferred_node; /* Used when executing deferred opcodes */
struct acpi_gpe_event_info *gpe_event_info; /* Info for GPE (_Lxx/_Exx methods only */ struct acpi_gpe_event_info *gpe_event_info; /* Info for GPE (_Lxx/_Exx methods only */
union acpi_operand_object *implicit_return_obj; union acpi_operand_object *implicit_return_obj;
struct acpi_namespace_node local_variables[ACPI_METHOD_NUM_LOCALS]; /* Control method locals */
struct acpi_namespace_node *method_call_node; /* Called method Node */ struct acpi_namespace_node *method_call_node; /* Called method Node */
union acpi_parse_object *method_call_op; /* method_call Op if running a method */ union acpi_parse_object *method_call_op; /* method_call Op if running a method */
union acpi_operand_object *method_desc; /* Method descriptor if running a method */ union acpi_operand_object *method_desc; /* Method descriptor if running a method */
struct acpi_namespace_node *method_node; /* Method node if running a method. */ struct acpi_namespace_node *method_node; /* Method node if running a method. */
union acpi_parse_object *op; /* Current parser op */ union acpi_parse_object *op; /* Current parser op */
union acpi_operand_object *operands[ACPI_OBJ_NUM_OPERANDS + 1]; /* Operands passed to the interpreter (+1 for NULL terminator) */
const struct acpi_opcode_info *op_info; /* Info on current opcode */ const struct acpi_opcode_info *op_info; /* Info on current opcode */
union acpi_parse_object *origin; /* Start of walk [Obsolete] */ union acpi_parse_object *origin; /* Start of walk [Obsolete] */
union acpi_operand_object **params;
struct acpi_parse_state parser_state; /* Current state of parser */
union acpi_operand_object *result_obj; union acpi_operand_object *result_obj;
union acpi_generic_state *results; /* Stack of accumulated results */ union acpi_generic_state *results; /* Stack of accumulated results */
union acpi_operand_object *return_desc; /* Return object, if any */ union acpi_operand_object *return_desc; /* Return object, if any */
union acpi_generic_state *scope_info; /* Stack of nested scopes */ union acpi_generic_state *scope_info; /* Stack of nested scopes */
union acpi_parse_object *prev_op; /* Last op that was processed */ union acpi_parse_object *prev_op; /* Last op that was processed */
union acpi_parse_object *next_op; /* next op to be processed */ union acpi_parse_object *next_op; /* next op to be processed */
struct acpi_thread_state *thread;
acpi_parse_downwards descending_callback; acpi_parse_downwards descending_callback;
acpi_parse_upwards ascending_callback; acpi_parse_upwards ascending_callback;
struct acpi_thread_state *thread;
struct acpi_walk_state *next; /* Next walk_state in list */
}; };
/* Info used by acpi_ps_init_objects */ /* Info used by acpi_ps_init_objects */
...@@ -151,11 +154,11 @@ struct acpi_walk_info { ...@@ -151,11 +154,11 @@ struct acpi_walk_info {
/* Display Types */ /* Display Types */
#define ACPI_DISPLAY_SUMMARY (u8) 0 #define ACPI_DISPLAY_SUMMARY (u8) 0
#define ACPI_DISPLAY_OBJECTS (u8) 1 #define ACPI_DISPLAY_OBJECTS (u8) 1
#define ACPI_DISPLAY_MASK (u8) 1 #define ACPI_DISPLAY_MASK (u8) 1
#define ACPI_DISPLAY_SHORT (u8) 2 #define ACPI_DISPLAY_SHORT (u8) 2
struct acpi_get_devices_info { struct acpi_get_devices_info {
acpi_walk_callback user_function; acpi_walk_callback user_function;
......
...@@ -44,6 +44,8 @@ ...@@ -44,6 +44,8 @@
#ifndef __ACTYPES_H__ #ifndef __ACTYPES_H__
#define __ACTYPES_H__ #define __ACTYPES_H__
/* acpisrc:struct_defs -- for acpisrc conversion */
/* /*
* ACPI_MACHINE_WIDTH must be specified in an OS- or compiler-dependent header * ACPI_MACHINE_WIDTH must be specified in an OS- or compiler-dependent header
* and must be either 16, 32, or 64 * and must be either 16, 32, or 64
...@@ -250,7 +252,7 @@ typedef acpi_native_uint acpi_size; ...@@ -250,7 +252,7 @@ typedef acpi_native_uint acpi_size;
/* Use C99 uintptr_t for pointer casting if available, "void *" otherwise */ /* Use C99 uintptr_t for pointer casting if available, "void *" otherwise */
#ifndef acpi_uintptr_t #ifndef acpi_uintptr_t
#define acpi_uintptr_t void * #define acpi_uintptr_t void *
#endif #endif
/* /*
...@@ -259,7 +261,7 @@ typedef acpi_native_uint acpi_size; ...@@ -259,7 +261,7 @@ typedef acpi_native_uint acpi_size;
* manager implementation is to be used (ACPI_USE_LOCAL_CACHE) * manager implementation is to be used (ACPI_USE_LOCAL_CACHE)
*/ */
#ifndef acpi_cache_t #ifndef acpi_cache_t
#define acpi_cache_t struct acpi_memory_list #define acpi_cache_t struct acpi_memory_list
#endif #endif
/* /*
...@@ -267,7 +269,7 @@ typedef acpi_native_uint acpi_size; ...@@ -267,7 +269,7 @@ typedef acpi_native_uint acpi_size;
* lock and unlock OSL interfaces. * lock and unlock OSL interfaces.
*/ */
#ifndef acpi_cpu_flags #ifndef acpi_cpu_flags
#define acpi_cpu_flags acpi_native_uint #define acpi_cpu_flags acpi_native_uint
#endif #endif
/* /*
...@@ -300,7 +302,7 @@ typedef acpi_native_uint acpi_size; ...@@ -300,7 +302,7 @@ typedef acpi_native_uint acpi_size;
* thread_id is returned by acpi_os_get_thread_id. * thread_id is returned by acpi_os_get_thread_id.
*/ */
#ifndef acpi_thread_id #ifndef acpi_thread_id
#define acpi_thread_id acpi_native_uint #define acpi_thread_id acpi_native_uint
#endif #endif
/******************************************************************************* /*******************************************************************************
...@@ -869,7 +871,7 @@ acpi_status(*acpi_adr_space_handler) (u32 function, ...@@ -869,7 +871,7 @@ acpi_status(*acpi_adr_space_handler) (u32 function,
void *handler_context, void *handler_context,
void *region_context); void *region_context);
#define ACPI_DEFAULT_HANDLER NULL #define ACPI_DEFAULT_HANDLER NULL
typedef typedef
acpi_status(*acpi_adr_space_setup) (acpi_handle region_handle, acpi_status(*acpi_adr_space_setup) (acpi_handle region_handle,
...@@ -926,8 +928,8 @@ struct acpi_compatible_id_list { ...@@ -926,8 +928,8 @@ struct acpi_compatible_id_list {
#define ACPI_STA_BATTERY_PRESENT 0x10 #define ACPI_STA_BATTERY_PRESENT 0x10
#define ACPI_COMMON_OBJ_INFO \ #define ACPI_COMMON_OBJ_INFO \
acpi_object_type type; /* ACPI object type */ \ acpi_object_type type; /* ACPI object type */ \
acpi_name name /* ACPI object Name */ acpi_name name /* ACPI object Name */
struct acpi_obj_info_header { struct acpi_obj_info_header {
ACPI_COMMON_OBJ_INFO; ACPI_COMMON_OBJ_INFO;
...@@ -1182,12 +1184,12 @@ struct acpi_resource_source { ...@@ -1182,12 +1184,12 @@ struct acpi_resource_source {
/* Fields common to all address descriptors, 16/32/64 bit */ /* Fields common to all address descriptors, 16/32/64 bit */
#define ACPI_RESOURCE_ADDRESS_COMMON \ #define ACPI_RESOURCE_ADDRESS_COMMON \
u8 resource_type; \ u8 resource_type; \
u8 producer_consumer; \ u8 producer_consumer; \
u8 decode; \ u8 decode; \
u8 min_address_fixed; \ u8 min_address_fixed; \
u8 max_address_fixed; \ u8 max_address_fixed; \
union acpi_resource_attribute info; union acpi_resource_attribute info;
struct acpi_resource_address { struct acpi_resource_address {
ACPI_RESOURCE_ADDRESS_COMMON}; ACPI_RESOURCE_ADDRESS_COMMON};
...@@ -1308,10 +1310,6 @@ struct acpi_resource { ...@@ -1308,10 +1310,6 @@ struct acpi_resource {
#define ACPI_NEXT_RESOURCE(res) (struct acpi_resource *)((u8 *) res + res->length) #define ACPI_NEXT_RESOURCE(res) (struct acpi_resource *)((u8 *) res + res->length)
/*
* END: of definitions for Resource Attributes
*/
struct acpi_pci_routing_table { struct acpi_pci_routing_table {
u32 length; u32 length;
u32 pin; u32 pin;
...@@ -1320,8 +1318,4 @@ struct acpi_pci_routing_table { ...@@ -1320,8 +1318,4 @@ struct acpi_pci_routing_table {
char source[4]; /* pad to 64 bits so sizeof() works in all cases */ char source[4]; /* pad to 64 bits so sizeof() works in all cases */
}; };
/*
* END: of definitions for PCI Routing tables
*/
#endif /* __ACTYPES_H__ */ #endif /* __ACTYPES_H__ */
...@@ -77,6 +77,12 @@ extern const char *acpi_gbl_TYPdecode[4]; ...@@ -77,6 +77,12 @@ extern const char *acpi_gbl_TYPdecode[4];
#define ACPI_VARIABLE_LENGTH 2 #define ACPI_VARIABLE_LENGTH 2
#define ACPI_SMALL_VARIABLE_LENGTH 3 #define ACPI_SMALL_VARIABLE_LENGTH 3
typedef
acpi_status(*acpi_walk_aml_callback) (u8 * aml,
u32 length,
u32 offset,
u8 resource_index, void *context);
typedef typedef
acpi_status(*acpi_pkg_callback) (u8 object_type, acpi_status(*acpi_pkg_callback) (u8 object_type,
union acpi_operand_object * source_object, union acpi_operand_object * source_object,
...@@ -469,6 +475,25 @@ acpi_ut_strtoul64(char *string, u32 base, acpi_integer * ret_integer); ...@@ -469,6 +475,25 @@ acpi_ut_strtoul64(char *string, u32 base, acpi_integer * ret_integer);
#define ACPI_ANY_BASE 0 #define ACPI_ANY_BASE 0
u32 acpi_ut_dword_byte_swap(u32 value);
void acpi_ut_set_integer_width(u8 revision);
#ifdef ACPI_DEBUG_OUTPUT
void
acpi_ut_display_init_pathname(u8 type,
struct acpi_namespace_node *obj_handle,
char *path);
#endif
/*
* utresrc
*/
acpi_status
acpi_ut_walk_aml_resources(u8 * aml,
acpi_size aml_length,
acpi_walk_aml_callback user_function, void *context);
acpi_status acpi_ut_validate_resource(void *aml, u8 * return_index); acpi_status acpi_ut_validate_resource(void *aml, u8 * return_index);
u32 acpi_ut_get_descriptor_length(void *aml); u32 acpi_ut_get_descriptor_length(void *aml);
...@@ -483,18 +508,6 @@ acpi_status ...@@ -483,18 +508,6 @@ acpi_status
acpi_ut_get_resource_end_tag(union acpi_operand_object *obj_desc, acpi_ut_get_resource_end_tag(union acpi_operand_object *obj_desc,
u8 ** end_tag); u8 ** end_tag);
u32 acpi_ut_dword_byte_swap(u32 value);
void acpi_ut_set_integer_width(u8 revision);
#ifdef ACPI_DEBUG_OUTPUT
void
acpi_ut_display_init_pathname(u8 type,
struct acpi_namespace_node *obj_handle,
char *path);
#endif
/* /*
* utmutex - mutex support * utmutex - mutex support
*/ */
...@@ -521,14 +534,15 @@ acpi_ut_initialize_buffer(struct acpi_buffer *buffer, ...@@ -521,14 +534,15 @@ acpi_ut_initialize_buffer(struct acpi_buffer *buffer,
void *acpi_ut_allocate(acpi_size size, u32 component, char *module, u32 line); void *acpi_ut_allocate(acpi_size size, u32 component, char *module, u32 line);
void *acpi_ut_callocate(acpi_size size, u32 component, char *module, u32 line); void *acpi_ut_allocate_zeroed(acpi_size size,
u32 component, char *module, u32 line);
#ifdef ACPI_DBG_TRACK_ALLOCATIONS #ifdef ACPI_DBG_TRACK_ALLOCATIONS
void *acpi_ut_allocate_and_track(acpi_size size, void *acpi_ut_allocate_and_track(acpi_size size,
u32 component, char *module, u32 line); u32 component, char *module, u32 line);
void *acpi_ut_callocate_and_track(acpi_size size, void *acpi_ut_allocate_zeroed_and_track(acpi_size size,
u32 component, char *module, u32 line); u32 component, char *module, u32 line);
void void
acpi_ut_free_and_track(void *address, u32 component, char *module, u32 line); acpi_ut_free_and_track(void *address, u32 component, char *module, u32 line);
...@@ -538,6 +552,11 @@ void acpi_ut_dump_allocation_info(void); ...@@ -538,6 +552,11 @@ void acpi_ut_dump_allocation_info(void);
#endif /* ACPI_FUTURE_USAGE */ #endif /* ACPI_FUTURE_USAGE */
void acpi_ut_dump_allocations(u32 component, char *module); void acpi_ut_dump_allocations(u32 component, char *module);
acpi_status
acpi_ut_create_list(char *list_name,
u16 object_size, struct acpi_memory_list **return_cache);
#endif #endif
#endif /* _ACUTILS_H */ #endif /* _ACUTILS_H */
...@@ -42,9 +42,17 @@ ...@@ -42,9 +42,17 @@
* POSSIBILITY OF SUCH DAMAGES. * POSSIBILITY OF SUCH DAMAGES.
*/ */
/* acpisrc:struct_defs -- for acpisrc conversion */
#ifndef __AMLRESRC_H #ifndef __AMLRESRC_H
#define __AMLRESRC_H #define __AMLRESRC_H
/*! [Begin] no source code translation */
/*
* Resource descriptor tags, as defined in the ACPI specification.
* Used to symbolically reference fields within a descriptor.
*/
#define ACPI_RESTAG_ADDRESS "_ADR" #define ACPI_RESTAG_ADDRESS "_ADR"
#define ACPI_RESTAG_ALIGNMENT "_ALN" #define ACPI_RESTAG_ALIGNMENT "_ALN"
#define ACPI_RESTAG_ADDRESSSPACE "_ASI" #define ACPI_RESTAG_ADDRESSSPACE "_ASI"
...@@ -57,12 +65,12 @@ ...@@ -57,12 +65,12 @@
#define ACPI_RESTAG_DMATYPE "_TYP" /* Compatible(0), A(1), B(2), F(3) */ #define ACPI_RESTAG_DMATYPE "_TYP" /* Compatible(0), A(1), B(2), F(3) */
#define ACPI_RESTAG_GRANULARITY "_GRA" #define ACPI_RESTAG_GRANULARITY "_GRA"
#define ACPI_RESTAG_INTERRUPT "_INT" #define ACPI_RESTAG_INTERRUPT "_INT"
#define ACPI_RESTAG_INTERRUPTLEVEL "_LL_" /* active_lo(1), active_hi(0) */ #define ACPI_RESTAG_INTERRUPTLEVEL "_LL_" /* ActiveLo(1), ActiveHi(0) */
#define ACPI_RESTAG_INTERRUPTSHARE "_SHR" /* Shareable(1), no_share(0) */ #define ACPI_RESTAG_INTERRUPTSHARE "_SHR" /* Shareable(1), NoShare(0) */
#define ACPI_RESTAG_INTERRUPTTYPE "_HE_" /* Edge(1), Level(0) */ #define ACPI_RESTAG_INTERRUPTTYPE "_HE_" /* Edge(1), Level(0) */
#define ACPI_RESTAG_LENGTH "_LEN" #define ACPI_RESTAG_LENGTH "_LEN"
#define ACPI_RESTAG_MEMATTRIBUTES "_MTP" /* Memory(0), Reserved(1), ACPI(2), NVS(3) */ #define ACPI_RESTAG_MEMATTRIBUTES "_MTP" /* Memory(0), Reserved(1), ACPI(2), NVS(3) */
#define ACPI_RESTAG_MEMTYPE "_MEM" /* non_cache(0), Cacheable(1) Cache+combine(2), Cache+prefetch(3) */ #define ACPI_RESTAG_MEMTYPE "_MEM" /* NonCache(0), Cacheable(1) Cache+combine(2), Cache+prefetch(3) */
#define ACPI_RESTAG_MAXADDR "_MAX" #define ACPI_RESTAG_MAXADDR "_MAX"
#define ACPI_RESTAG_MINADDR "_MIN" #define ACPI_RESTAG_MINADDR "_MIN"
#define ACPI_RESTAG_MAXTYPE "_MAF" #define ACPI_RESTAG_MAXTYPE "_MAF"
...@@ -70,11 +78,12 @@ ...@@ -70,11 +78,12 @@
#define ACPI_RESTAG_REGISTERBITOFFSET "_RBO" #define ACPI_RESTAG_REGISTERBITOFFSET "_RBO"
#define ACPI_RESTAG_REGISTERBITWIDTH "_RBW" #define ACPI_RESTAG_REGISTERBITWIDTH "_RBW"
#define ACPI_RESTAG_RANGETYPE "_RNG" #define ACPI_RESTAG_RANGETYPE "_RNG"
#define ACPI_RESTAG_READWRITETYPE "_RW_" /* read_only(0), Writeable (1) */ #define ACPI_RESTAG_READWRITETYPE "_RW_" /* ReadOnly(0), Writeable (1) */
#define ACPI_RESTAG_TRANSLATION "_TRA" #define ACPI_RESTAG_TRANSLATION "_TRA"
#define ACPI_RESTAG_TRANSTYPE "_TRS" /* Sparse(1), Dense(0) */ #define ACPI_RESTAG_TRANSTYPE "_TRS" /* Sparse(1), Dense(0) */
#define ACPI_RESTAG_TYPE "_TTP" /* Translation(1), Static (0) */ #define ACPI_RESTAG_TYPE "_TTP" /* Translation(1), Static (0) */
#define ACPI_RESTAG_XFERTYPE "_SIz" /* 8(0), 8_and16(1), 16(2) */ #define ACPI_RESTAG_XFERTYPE "_SIZ" /* 8(0), 8And16(1), 16(2) */
/*! [End] no source code translation !*/
/* Default sizes for "small" resource descriptors */ /* Default sizes for "small" resource descriptors */
...@@ -109,7 +118,7 @@ struct asl_resource_node { ...@@ -109,7 +118,7 @@ struct asl_resource_node {
* SMALL descriptors * SMALL descriptors
*/ */
#define AML_RESOURCE_SMALL_HEADER_COMMON \ #define AML_RESOURCE_SMALL_HEADER_COMMON \
u8 descriptor_type; u8 descriptor_type;
struct aml_resource_small_header { struct aml_resource_small_header {
AML_RESOURCE_SMALL_HEADER_COMMON}; AML_RESOURCE_SMALL_HEADER_COMMON};
...@@ -162,8 +171,8 @@ struct aml_resource_end_tag { ...@@ -162,8 +171,8 @@ struct aml_resource_end_tag {
* LARGE descriptors * LARGE descriptors
*/ */
#define AML_RESOURCE_LARGE_HEADER_COMMON \ #define AML_RESOURCE_LARGE_HEADER_COMMON \
u8 descriptor_type;\ u8 descriptor_type;\
u16 resource_length; u16 resource_length;
struct aml_resource_large_header { struct aml_resource_large_header {
AML_RESOURCE_LARGE_HEADER_COMMON}; AML_RESOURCE_LARGE_HEADER_COMMON};
...@@ -194,9 +203,9 @@ struct aml_resource_fixed_memory32 { ...@@ -194,9 +203,9 @@ struct aml_resource_fixed_memory32 {
}; };
#define AML_RESOURCE_ADDRESS_COMMON \ #define AML_RESOURCE_ADDRESS_COMMON \
u8 resource_type; \ u8 resource_type; \
u8 flags; \ u8 flags; \
u8 specific_flags; u8 specific_flags;
struct aml_resource_address { struct aml_resource_address {
AML_RESOURCE_LARGE_HEADER_COMMON AML_RESOURCE_ADDRESS_COMMON}; AML_RESOURCE_LARGE_HEADER_COMMON AML_RESOURCE_ADDRESS_COMMON};
......
...@@ -70,6 +70,7 @@ ...@@ -70,6 +70,7 @@
#define ACPI_DEBUGGER #define ACPI_DEBUGGER
#define ACPI_DISASSEMBLER #define ACPI_DISASSEMBLER
#define ACPI_MUTEX_DEBUG #define ACPI_MUTEX_DEBUG
#define ACPI_DBG_TRACK_ALLOCATIONS
#endif #endif
#ifdef ACPI_ASL_COMPILER #ifdef ACPI_ASL_COMPILER
...@@ -165,17 +166,6 @@ ...@@ -165,17 +166,6 @@
#endif #endif
/*
* Memory allocation tracking. Used only if
* 1) This is the debug version
* 2) This is NOT a 16-bit version of the code (not enough real-mode memory)
*/
#ifdef ACPI_DEBUG_OUTPUT
#if ACPI_MACHINE_WIDTH != 16
#define ACPI_DBG_TRACK_ALLOCATIONS
#endif
#endif
/*! [End] no source code translation !*/ /*! [End] no source code translation !*/
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment