switch (walk_state->opcode) { case AML_FIELD_OP: case AML_BANK_FIELD_OP: case AML_INDEX_FIELD_OP:
node = NULL;
status = AE_OK; break;
case AML_INT_NAMEPATH_OP: /* *Thename_pathisanobjectreferencetoanexistingobject. *Don'tenterthenameintothenamespace,butlookitup *foruselater.
*/
status =
acpi_ns_lookup(walk_state->scope_info, buffer_ptr,
object_type, ACPI_IMODE_EXECUTE,
ACPI_NS_SEARCH_PARENT, walk_state, &(node)); break;
case AML_SCOPE_OP:
/* Special case for Scope(\) -> refers to the Root node */
if (op && (op->named.node == acpi_gbl_root_node)) {
node = op->named.node;
status =
acpi_ds_scope_stack_push(node, object_type,
walk_state); if (ACPI_FAILURE(status)) {
return_ACPI_STATUS(status);
}
} else { /* *ThePathisanobjectreferencetoanexistingobject. *Don'tenterthenameintothenamespace,butlookitup *foruselater.
*/
status =
acpi_ns_lookup(walk_state->scope_info, buffer_ptr,
object_type, ACPI_IMODE_EXECUTE,
ACPI_NS_SEARCH_PARENT, walk_state,
&(node)); if (ACPI_FAILURE(status)) { #ifdef ACPI_ASL_COMPILER if (status == AE_NOT_FOUND) {
status = AE_OK;
} else {
ACPI_ERROR_NAMESPACE(walk_state->
scope_info,
buffer_ptr,
status);
} #else
ACPI_ERROR_NAMESPACE(walk_state->scope_info,
buffer_ptr, status); #endif
return_ACPI_STATUS(status);
}
}
/* *Wemustchecktomakesurethatthetargetis *oneoftheopcodesthatactuallyopensascope
*/ switch (node->type) { case ACPI_TYPE_ANY: case ACPI_TYPE_LOCAL_SCOPE: /* Scope */ case ACPI_TYPE_DEVICE: case ACPI_TYPE_POWER: case ACPI_TYPE_PROCESSOR: case ACPI_TYPE_THERMAL:
/* These are acceptable types */ break;
case ACPI_TYPE_INTEGER: case ACPI_TYPE_STRING: case ACPI_TYPE_BUFFER:
/* *Thesetypeswewillallow,butwewillchangethetype. *Thisenablessomeexistingcodeoftheform: * *Name(DEB,0) *Scope(DEB){...}
*/
ACPI_WARNING((AE_INFO, "Type override - [%4.4s] had invalid type (%s) " "for Scope operator, changed to type ANY",
acpi_ut_get_node_name(node),
acpi_ut_get_type_name(node->type)));
ACPI_ERROR((AE_INFO, "Invalid type (%s) for target of " "Scope operator [%4.4s] (Cannot override)",
acpi_ut_get_type_name(node->type),
acpi_ut_get_node_name(node)));
return_ACPI_STATUS(AE_AML_OPERAND_TYPE);
} break;
default:
/* All other opcodes */
if (op && op->common.node) {
/* This op/node was previously entered into the namespace */
node = op->common.node;
if (acpi_ns_opens_scope(object_type)) {
status =
acpi_ds_scope_stack_push(node, object_type,
walk_state); if (ACPI_FAILURE(status)) {
return_ACPI_STATUS(status);
}
}
case AML_TYPE_CREATE_FIELD: /* *Createthefieldobject,butthefieldbufferandindexmust *beevaluatedlaterduringtheexecutionphase
*/
status = acpi_ds_create_buffer_field(op, walk_state); if (ACPI_FAILURE(status)) {
ACPI_EXCEPTION((AE_INFO, status, "CreateBufferField failure")); goto cleanup;
} break;
case AML_TYPE_NAMED_FIELD: /* *Ifweareexecutingamethod,initializethefield
*/ if (walk_state->method_node) {
status = acpi_ds_init_field_objects(op, walk_state);
}
switch (op->common.aml_opcode) { case AML_INDEX_FIELD_OP:
status =
acpi_ds_create_index_field(op,
(acpi_handle)arg->common.
node, walk_state); break;
case AML_BANK_FIELD_OP:
status =
acpi_ds_create_bank_field(op, arg->common.node,
walk_state); break;
case AML_FIELD_OP:
status =
acpi_ds_create_field(op, arg->common.node,
walk_state); break;
default:
/* All NAMED_FIELD opcodes must be handled above */ break;
} break;
case AML_TYPE_NAMED_SIMPLE:
status = acpi_ds_create_operands(walk_state, arg); if (ACPI_FAILURE(status)) { goto cleanup;
}
switch (op->common.aml_opcode) { case AML_PROCESSOR_OP:
status = acpi_ex_create_processor(walk_state); break;
case AML_POWER_RESOURCE_OP:
status = acpi_ex_create_power_resource(walk_state); break;
case AML_MUTEX_OP:
status = acpi_ex_create_mutex(walk_state); break;
case AML_EVENT_OP:
status = acpi_ex_create_event(walk_state); break;
case AML_ALIAS_OP:
status = acpi_ex_create_alias(walk_state); break;
default:
/* Unknown opcode */
status = AE_OK; goto cleanup;
}
/* Delete operands */
for (i = 1; i < walk_state->num_operands; i++) {
acpi_ut_remove_reference(walk_state->operands[i]);
walk_state->operands[i] = NULL;
}
break;
case AML_TYPE_NAMED_COMPLEX:
switch (op->common.aml_opcode) { case AML_REGION_OP: case AML_DATA_REGION_OP:
/* *LookupthemethodnameandsavetheNode
*/
status =
acpi_ns_lookup(walk_state->scope_info,
arg->common.value.string, ACPI_TYPE_ANY,
ACPI_IMODE_LOAD_PASS2,
ACPI_NS_SEARCH_PARENT |
ACPI_NS_DONT_OPEN_SCOPE, walk_state,
&(new_node)); if (ACPI_SUCCESS(status)) { /* *Makesurethatwhatwefoundisindeedamethod *Wedidn'tsearchforamethodonpurpose,toseeifthename *wouldresolve
*/ if (new_node->type != ACPI_TYPE_METHOD) {
status = AE_AML_OPERAND_TYPE;
}
/* We could put the returned object (Node) on the object stack for *later,butfornow,wewillputitinthe"op"objectthatthe *parseruses,sowecangetitagainattheendofthisscope
*/
op->common.node = new_node;
} else {
ACPI_ERROR_NAMESPACE(walk_state->scope_info,
arg->common.value.string, status);
} break;
default:
break;
}
cleanup:
/* Remove the Node pushed at the very beginning */
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.