You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
[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: Bob Moore <robert.moore@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
This commit is contained in:
+2
-2
@@ -596,6 +596,8 @@ void __init acpi_early_init(void)
|
||||
if (acpi_disabled)
|
||||
return_VOID;
|
||||
|
||||
printk(KERN_INFO PREFIX "Core revision %08x\n", ACPI_CA_VERSION);
|
||||
|
||||
/* enable workarounds, unless strict ACPI spec. compliance */
|
||||
if (!acpi_strict)
|
||||
acpi_gbl_enable_interpreter_slack = TRUE;
|
||||
@@ -743,8 +745,6 @@ static int __init acpi_init(void)
|
||||
|
||||
ACPI_FUNCTION_TRACE("acpi_init");
|
||||
|
||||
printk(KERN_INFO PREFIX "Subsystem revision %08x\n", ACPI_CA_VERSION);
|
||||
|
||||
if (acpi_disabled) {
|
||||
printk(KERN_INFO PREFIX "Interpreter disabled.\n");
|
||||
return_VALUE(-ENODEV);
|
||||
|
||||
@@ -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,
|
||||
NAMEOF_ARG_NTE);
|
||||
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].flags = ANOBJ_END_OF_PEER_LIST |
|
||||
ANOBJ_METHOD_ARG;
|
||||
walk_state->arguments[i].flags =
|
||||
ANOBJ_END_OF_PEER_LIST | ANOBJ_METHOD_ARG;
|
||||
}
|
||||
|
||||
/* Init the method locals */
|
||||
@@ -113,11 +113,11 @@ void acpi_ds_method_data_init(struct acpi_walk_state *walk_state)
|
||||
NAMEOF_LOCAL_NTE);
|
||||
|
||||
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;
|
||||
walk_state->local_variables[i].type = ACPI_TYPE_ANY;
|
||||
walk_state->local_variables[i].flags = ANOBJ_END_OF_PEER_LIST |
|
||||
ANOBJ_METHOD_LOCAL;
|
||||
walk_state->local_variables[i].flags =
|
||||
ANOBJ_END_OF_PEER_LIST | ANOBJ_METHOD_LOCAL;
|
||||
}
|
||||
|
||||
return_VOID;
|
||||
|
||||
@@ -128,7 +128,7 @@ acpi_ds_scope_stack_push(struct acpi_namespace_node *node,
|
||||
|
||||
/* 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->common.value = (u16) type;
|
||||
|
||||
|
||||
@@ -337,7 +337,7 @@ acpi_status acpi_ds_result_stack_push(struct acpi_walk_state * walk_state)
|
||||
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_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)
|
||||
*
|
||||
* PARAMETERS: owner_id - ID for object creation
|
||||
* Origin - Starting point for this walk
|
||||
* mth_desc - Method object
|
||||
* method_desc - Method object
|
||||
* Thread - Current thread 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,
|
||||
union acpi_parse_object
|
||||
*origin,
|
||||
union acpi_operand_object
|
||||
*mth_desc,
|
||||
*method_desc,
|
||||
struct acpi_thread_state
|
||||
*thread)
|
||||
{
|
||||
@@ -648,10 +648,10 @@ struct acpi_walk_state *acpi_ds_create_walk_state(acpi_owner_id owner_id,
|
||||
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->origin = origin;
|
||||
walk_state->method_desc = mth_desc;
|
||||
walk_state->thread = thread;
|
||||
|
||||
walk_state->parser_state.start_op = origin;
|
||||
@@ -819,7 +819,7 @@ void acpi_ds_delete_walk_state(struct acpi_walk_state *walk_state)
|
||||
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",
|
||||
walk_state));
|
||||
return;
|
||||
|
||||
@@ -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_xrupt_info *gpe_xrupt_info;
|
||||
|
||||
@@ -185,7 +185,8 @@ acpi_ev_queue_notify_request(struct acpi_namespace_node * node,
|
||||
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.value = (u16) notify_value;
|
||||
notify_info->notify.handler_obj = handler_obj;
|
||||
|
||||
@@ -250,7 +250,6 @@ acpi_ev_execute_reg_method(union acpi_operand_object *region_obj, u32 function)
|
||||
|
||||
cleanup:
|
||||
acpi_ut_remove_reference(params[0]);
|
||||
|
||||
return_ACPI_STATUS(status);
|
||||
}
|
||||
|
||||
@@ -389,9 +388,8 @@ acpi_ev_address_space_dispatch(union acpi_operand_object *region_obj,
|
||||
acpi_ut_get_region_name(region_obj->region.
|
||||
space_id)));
|
||||
|
||||
if (!
|
||||
(handler_desc->address_space.
|
||||
hflags & ACPI_ADDR_HANDLER_DEFAULT_INSTALLED)) {
|
||||
if (!(handler_desc->address_space.handler_flags &
|
||||
ACPI_ADDR_HANDLER_DEFAULT_INSTALLED)) {
|
||||
/*
|
||||
* For handlers other than the default (supplied) handlers, we must
|
||||
* 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,
|
||||
space_id)));
|
||||
}
|
||||
|
||||
if (!
|
||||
(handler_desc->address_space.
|
||||
hflags & ACPI_ADDR_HANDLER_DEFAULT_INSTALLED)) {
|
||||
if (!(handler_desc->address_space.handler_flags &
|
||||
ACPI_ADDR_HANDLER_DEFAULT_INSTALLED)) {
|
||||
/*
|
||||
* We just returned from a non-default handler, we must re-enter the
|
||||
* interpreter
|
||||
@@ -772,7 +769,7 @@ acpi_ev_install_space_handler(struct acpi_namespace_node * node,
|
||||
union acpi_operand_object *handler_obj;
|
||||
acpi_status status;
|
||||
acpi_object_type type;
|
||||
u16 flags = 0;
|
||||
u8 flags = 0;
|
||||
|
||||
ACPI_FUNCTION_TRACE("ev_install_space_handler");
|
||||
|
||||
@@ -930,7 +927,7 @@ acpi_ev_install_space_handler(struct acpi_namespace_node * node,
|
||||
/* Init handler obj */
|
||||
|
||||
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.node = node;
|
||||
handler_obj->address_space.handler = handler;
|
||||
|
||||
@@ -243,8 +243,9 @@ acpi_status acpi_ex_create_mutex(struct acpi_walk_state *walk_state)
|
||||
obj_desc->mutex.node =
|
||||
(struct acpi_namespace_node *)walk_state->operands[0];
|
||||
|
||||
status = acpi_ns_attach_object(obj_desc->mutex.node,
|
||||
obj_desc, ACPI_TYPE_MUTEX);
|
||||
status =
|
||||
acpi_ns_attach_object(obj_desc->mutex.node, obj_desc,
|
||||
ACPI_TYPE_MUTEX);
|
||||
|
||||
cleanup:
|
||||
/*
|
||||
@@ -464,9 +465,9 @@ acpi_status acpi_ex_create_processor(struct acpi_walk_state *walk_state)
|
||||
/* Initialize the processor object from the operands */
|
||||
|
||||
obj_desc->processor.proc_id = (u8) operand[1]->integer.value;
|
||||
obj_desc->processor.length = (u8) operand[3]->integer.value;
|
||||
obj_desc->processor.address =
|
||||
(acpi_io_address) operand[2]->integer.value;
|
||||
obj_desc->processor.length = (u8) operand[3]->integer.value;
|
||||
|
||||
/* Install the processor object in the parent Node */
|
||||
|
||||
|
||||
@@ -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_UINT8, ACPI_EXD_NSOFFSET(flags), "Flags"},
|
||||
{ACPI_EXD_UINT8, ACPI_EXD_NSOFFSET(owner_id), "Owner Id"},
|
||||
{ACPI_EXD_UINT16, ACPI_EXD_NSOFFSET(reference_count),
|
||||
"Reference Count"},
|
||||
{ACPI_EXD_POINTER, ACPI_EXD_NSOFFSET(child), "Child List"},
|
||||
{ACPI_EXD_POINTER, ACPI_EXD_NSOFFSET(peer), "Next Peer"}
|
||||
};
|
||||
|
||||
@@ -47,9 +47,6 @@
|
||||
#define _COMPONENT ACPI_NAMESPACE
|
||||
ACPI_MODULE_NAME("nsalloc")
|
||||
|
||||
/* Local prototypes */
|
||||
static void acpi_ns_remove_reference(struct acpi_namespace_node *node);
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: acpi_ns_create_node
|
||||
@@ -61,14 +58,13 @@ static void acpi_ns_remove_reference(struct acpi_namespace_node *node);
|
||||
* DESCRIPTION: Create a namespace node
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
struct acpi_namespace_node *acpi_ns_create_node(u32 name)
|
||||
{
|
||||
struct acpi_namespace_node *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) {
|
||||
return_PTR(NULL);
|
||||
}
|
||||
@@ -76,9 +72,7 @@ struct acpi_namespace_node *acpi_ns_create_node(u32 name)
|
||||
ACPI_MEM_TRACKING(acpi_gbl_ns_node_list->total_allocated++);
|
||||
|
||||
node->name.integer = name;
|
||||
node->reference_count = 1;
|
||||
ACPI_SET_DESCRIPTOR_TYPE(node, ACPI_DESC_TYPE_NAMED);
|
||||
|
||||
return_PTR(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++);
|
||||
|
||||
/*
|
||||
* 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_FREE(node);
|
||||
(void)acpi_os_release_object(acpi_gbl_namespace_cache, node);
|
||||
return_VOID;
|
||||
}
|
||||
|
||||
@@ -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_type_name(parent_node->type),
|
||||
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)
|
||||
{
|
||||
struct acpi_namespace_node *child_node;
|
||||
struct acpi_namespace_node *next_node;
|
||||
struct acpi_namespace_node *node;
|
||||
u8 flags;
|
||||
|
||||
ACPI_FUNCTION_TRACE_PTR("ns_delete_children", parent_node);
|
||||
@@ -292,26 +275,10 @@ void acpi_ns_delete_children(struct acpi_namespace_node *parent_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 */
|
||||
|
||||
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 */
|
||||
|
||||
@@ -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) */
|
||||
|
||||
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) {
|
||||
|
||||
/* Found a child node - detach any attached object */
|
||||
@@ -404,57 +372,6 @@ void acpi_ns_delete_namespace_subtree(struct acpi_namespace_node *parent_node)
|
||||
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
|
||||
@@ -482,9 +399,9 @@ void acpi_ns_delete_namespace_by_owner(acpi_owner_id owner_id)
|
||||
return_VOID;
|
||||
}
|
||||
|
||||
deletion_node = NULL;
|
||||
parent_node = acpi_gbl_root_node;
|
||||
child_node = NULL;
|
||||
deletion_node = NULL;
|
||||
level = 1;
|
||||
|
||||
/*
|
||||
@@ -501,7 +418,8 @@ void acpi_ns_delete_namespace_by_owner(acpi_owner_id owner_id)
|
||||
child_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;
|
||||
}
|
||||
|
||||
|
||||
@@ -81,7 +81,7 @@ acpi_ns_report_error(char *module_name,
|
||||
u32 bad_name;
|
||||
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) {
|
||||
|
||||
@@ -139,7 +139,7 @@ acpi_ns_report_method_error(char *module_name,
|
||||
acpi_status status;
|
||||
struct acpi_namespace_node *node = prefix_node;
|
||||
|
||||
acpi_ut_report_error(module_name, line_number);
|
||||
acpi_os_printf("ACPI Error (%s-%04d): ", module_name, line_number);
|
||||
|
||||
if (path) {
|
||||
status = acpi_ns_get_node_by_path(path, prefix_node,
|
||||
|
||||
+2
-3
@@ -1126,14 +1126,13 @@ acpi_status acpi_os_release_object(acpi_cache_t * cache, void *object)
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Get an object from the specified cache. If cache is empty,
|
||||
* the object is allocated.
|
||||
* DESCRIPTION: Return a zero-filled object.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
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);
|
||||
return object;
|
||||
}
|
||||
|
||||
@@ -113,7 +113,7 @@ acpi_ps_init_scope(struct acpi_parse_state * parser_state,
|
||||
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.arg_count = ACPI_VAR_ARGS;
|
||||
scope->parse_scope.arg_end = parser_state->aml_end;
|
||||
@@ -143,7 +143,7 @@ acpi_ps_init_scope(struct acpi_parse_state * parser_state,
|
||||
acpi_status
|
||||
acpi_ps_push_scope(struct acpi_parse_state *parser_state,
|
||||
union acpi_parse_object *op,
|
||||
u32 remaining_args, u32 arg_count)
|
||||
u32 remaining_args, u8 arg_count)
|
||||
{
|
||||
union acpi_generic_state *scope;
|
||||
|
||||
@@ -154,7 +154,7 @@ acpi_ps_push_scope(struct acpi_parse_state *parser_state,
|
||||
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.arg_list = remaining_args;
|
||||
scope->parse_scope.arg_count = arg_count;
|
||||
@@ -196,7 +196,7 @@ acpi_ps_push_scope(struct acpi_parse_state *parser_state,
|
||||
|
||||
void
|
||||
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;
|
||||
|
||||
@@ -207,7 +207,7 @@ acpi_ps_pop_scope(struct acpi_parse_state *parser_state,
|
||||
if (scope->common.next) {
|
||||
scope = acpi_ut_pop_generic_state(&parser_state->scope);
|
||||
|
||||
/* return to parsing previous op */
|
||||
/* Return to parsing previous op */
|
||||
|
||||
*op = scope->parse_scope.op;
|
||||
*arg_list = scope->parse_scope.arg_list;
|
||||
@@ -218,7 +218,7 @@ acpi_ps_pop_scope(struct acpi_parse_state *parser_state,
|
||||
|
||||
acpi_ut_delete_generic_state(scope);
|
||||
} else {
|
||||
/* empty parse stack, prepare to fetch next opcode */
|
||||
/* Empty parse stack, prepare to fetch next opcode */
|
||||
|
||||
*op = NULL;
|
||||
*arg_list = 0;
|
||||
|
||||
@@ -89,7 +89,7 @@ void acpi_ps_init_op(union acpi_parse_object *op, u16 opcode)
|
||||
{
|
||||
ACPI_FUNCTION_ENTRY();
|
||||
|
||||
op->common.data_type = ACPI_DESC_TYPE_PARSER;
|
||||
op->common.descriptor_type = ACPI_DESC_TYPE_PARSER;
|
||||
op->common.aml_opcode = opcode;
|
||||
|
||||
ACPI_DISASM_ONLY_MEMBERS(ACPI_STRNCPY(op->common.aml_op_name,
|
||||
|
||||
@@ -456,7 +456,7 @@ acpi_rs_get_list_length(u8 * aml_buffer,
|
||||
*size_needed += buffer_size;
|
||||
|
||||
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_descriptor_length(aml_buffer),
|
||||
buffer_size));
|
||||
|
||||
@@ -75,6 +75,7 @@ acpi_rs_create_resource_list(union acpi_operand_object *aml_buffer,
|
||||
u8 *aml_start;
|
||||
acpi_size list_size_needed = 0;
|
||||
u32 aml_buffer_length;
|
||||
void *resource;
|
||||
|
||||
ACPI_FUNCTION_TRACE("rs_create_resource_list");
|
||||
|
||||
@@ -107,8 +108,10 @@ acpi_rs_create_resource_list(union acpi_operand_object *aml_buffer,
|
||||
|
||||
/* Do the conversion */
|
||||
|
||||
status = acpi_rs_convert_aml_to_resources(aml_start, aml_buffer_length,
|
||||
output_buffer->pointer);
|
||||
resource = 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)) {
|
||||
return_ACPI_STATUS(status);
|
||||
}
|
||||
|
||||
@@ -51,92 +51,60 @@ ACPI_MODULE_NAME("rslist")
|
||||
*
|
||||
* FUNCTION: acpi_rs_convert_aml_to_resources
|
||||
*
|
||||
* PARAMETERS: Aml - Pointer to the resource byte stream
|
||||
* aml_length - Length of Aml
|
||||
* output_buffer - Pointer to the buffer that will
|
||||
* contain the output structures
|
||||
* PARAMETERS: acpi_walk_aml_callback
|
||||
* resource_ptr - Pointer to the buffer that will
|
||||
* contain the output structures
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Takes the resource byte stream and parses it, creating a
|
||||
* linked list of resources in the caller's output buffer
|
||||
* DESCRIPTION: Convert an AML resource to an internal representation of the
|
||||
* resource that is aligned and easier to access.
|
||||
*
|
||||
******************************************************************************/
|
||||
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;
|
||||
u8 resource_index;
|
||||
u8 *end_aml;
|
||||
|
||||
ACPI_FUNCTION_TRACE("rs_convert_aml_to_resources");
|
||||
|
||||
end_aml = aml + aml_length;
|
||||
|
||||
/* Loop until end-of-buffer or an end_tag is found */
|
||||
|
||||
while (aml < end_aml) {
|
||||
/*
|
||||
* Check that the input buffer and all subsequent pointers into it
|
||||
* 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 =
|
||||
ACPI_ADD_PTR(struct acpi_resource, resource,
|
||||
resource->length);
|
||||
/*
|
||||
* Check that the input buffer and all subsequent pointers into it
|
||||
* 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));
|
||||
}
|
||||
|
||||
/* Did not find an end_tag resource descriptor */
|
||||
/* Convert the AML byte stream resource to a local resource struct */
|
||||
|
||||
return_ACPI_STATUS(AE_AML_NO_RESOURCE_END_TAG);
|
||||
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_length %.2X internal_length %.2X\n",
|
||||
acpi_ut_get_resource_type(aml), length,
|
||||
resource->length));
|
||||
|
||||
/* 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)
|
||||
acpi_status
|
||||
acpi_walk_resources(acpi_handle device_handle,
|
||||
char *name,
|
||||
ACPI_WALK_RESOURCE_CALLBACK user_function, void *context)
|
||||
acpi_walk_resource_callback user_function, void *context)
|
||||
{
|
||||
acpi_status status;
|
||||
struct acpi_buffer buffer;
|
||||
@@ -469,7 +469,7 @@ ACPI_EXPORT_SYMBOL(acpi_get_vendor_resource)
|
||||
*
|
||||
* FUNCTION: acpi_rs_match_vendor_resource
|
||||
*
|
||||
* PARAMETERS: ACPI_WALK_RESOURCE_CALLBACK
|
||||
* PARAMETERS: acpi_walk_resource_callback
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -272,9 +272,9 @@ void *acpi_os_acquire_object(struct acpi_memory_list *cache)
|
||||
cache->current_depth--;
|
||||
|
||||
ACPI_MEM_TRACKING(cache->hits++);
|
||||
ACPI_MEM_TRACKING(ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
|
||||
"Object %p from %s cache\n",
|
||||
object, cache->list_name)));
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
|
||||
"Object %p from %s cache\n", object,
|
||||
cache->list_name));
|
||||
|
||||
status = acpi_ut_release_mutex(ACPI_MTX_CACHES);
|
||||
if (ACPI_FAILURE(status)) {
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user