📄 dsfield.c
字号:
} info->field_bit_position += info->field_bit_length; break; default: ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid opcode in field list: %X\n", arg->common.aml_opcode)); return_ACPI_STATUS(AE_AML_BAD_OPCODE); } arg = arg->common.next; } return_ACPI_STATUS(AE_OK);}/******************************************************************************* * * FUNCTION: acpi_ds_create_field * * PARAMETERS: Op - Op containing the Field definition and args * region_node - Object for the containing Operation Region * ` walk_state - Current method state * * RETURN: Status * * DESCRIPTION: Create a new field in the specified operation region * ******************************************************************************/acpi_statusacpi_ds_create_field(union acpi_parse_object *op, struct acpi_namespace_node *region_node, struct acpi_walk_state *walk_state){ acpi_status status; union acpi_parse_object *arg; struct acpi_create_field_info info; ACPI_FUNCTION_TRACE_PTR("ds_create_field", op); /* First arg is the name of the parent op_region (must already exist) */ arg = op->common.value.arg; if (!region_node) { status = acpi_ns_lookup(walk_state->scope_info, arg->common.value.name, ACPI_TYPE_REGION, ACPI_IMODE_EXECUTE, ACPI_NS_SEARCH_PARENT, walk_state, ®ion_node); if (ACPI_FAILURE(status)) { ACPI_REPORT_NSERROR(arg->common.value.name, status); return_ACPI_STATUS(status); } } /* Second arg is the field flags */ arg = arg->common.next; info.field_flags = (u8) arg->common.value.integer; info.attribute = 0; /* Each remaining arg is a Named Field */ info.field_type = ACPI_TYPE_LOCAL_REGION_FIELD; info.region_node = region_node; status = acpi_ds_get_field_names(&info, walk_state, arg->common.next); return_ACPI_STATUS(status);}/******************************************************************************* * * FUNCTION: acpi_ds_init_field_objects * * PARAMETERS: Op - Op containing the Field definition and args * ` walk_state - Current method state * * RETURN: Status * * DESCRIPTION: For each "Field Unit" name in the argument list that is * part of the field declaration, enter the name into the * namespace. * ******************************************************************************/acpi_statusacpi_ds_init_field_objects(union acpi_parse_object *op, struct acpi_walk_state *walk_state){ acpi_status status; union acpi_parse_object *arg = NULL; struct acpi_namespace_node *node; u8 type = 0; ACPI_FUNCTION_TRACE_PTR("ds_init_field_objects", op); switch (walk_state->opcode) { case AML_FIELD_OP: arg = acpi_ps_get_arg(op, 2); type = ACPI_TYPE_LOCAL_REGION_FIELD; break; case AML_BANK_FIELD_OP: arg = acpi_ps_get_arg(op, 4); type = ACPI_TYPE_LOCAL_BANK_FIELD; break; case AML_INDEX_FIELD_OP: arg = acpi_ps_get_arg(op, 3); type = ACPI_TYPE_LOCAL_INDEX_FIELD; break; default: return_ACPI_STATUS(AE_BAD_PARAMETER); } /* * Walk the list of entries in the field_list */ while (arg) { /* Ignore OFFSET and ACCESSAS terms here */ if (arg->common.aml_opcode == AML_INT_NAMEDFIELD_OP) { status = acpi_ns_lookup(walk_state->scope_info, (char *)&arg->named.name, type, ACPI_IMODE_LOAD_PASS1, ACPI_NS_NO_UPSEARCH | ACPI_NS_DONT_OPEN_SCOPE | ACPI_NS_ERROR_IF_FOUND, walk_state, &node); if (ACPI_FAILURE(status)) { ACPI_REPORT_NSERROR((char *)&arg->named.name, status); if (status != AE_ALREADY_EXISTS) { return_ACPI_STATUS(status); } /* Name already exists, just ignore this error */ status = AE_OK; } arg->common.node = node; } /* Move to next field in the list */ arg = arg->common.next; } return_ACPI_STATUS(AE_OK);}/******************************************************************************* * * FUNCTION: acpi_ds_create_bank_field * * PARAMETERS: Op - Op containing the Field definition and args * region_node - Object for the containing Operation Region * ` walk_state - Current method state * * RETURN: Status * * DESCRIPTION: Create a new bank field in the specified operation region * ******************************************************************************/acpi_statusacpi_ds_create_bank_field(union acpi_parse_object *op, struct acpi_namespace_node *region_node, struct acpi_walk_state *walk_state){ acpi_status status; union acpi_parse_object *arg; struct acpi_create_field_info info; ACPI_FUNCTION_TRACE_PTR("ds_create_bank_field", op); /* First arg is the name of the parent op_region (must already exist) */ arg = op->common.value.arg; if (!region_node) { status = acpi_ns_lookup(walk_state->scope_info, arg->common.value.name, ACPI_TYPE_REGION, ACPI_IMODE_EXECUTE, ACPI_NS_SEARCH_PARENT, walk_state, ®ion_node); if (ACPI_FAILURE(status)) { ACPI_REPORT_NSERROR(arg->common.value.name, status); return_ACPI_STATUS(status); } } /* Second arg is the Bank Register (Field) (must already exist) */ arg = arg->common.next; status = acpi_ns_lookup(walk_state->scope_info, arg->common.value.string, ACPI_TYPE_ANY, ACPI_IMODE_EXECUTE, ACPI_NS_SEARCH_PARENT, walk_state, &info.register_node); if (ACPI_FAILURE(status)) { ACPI_REPORT_NSERROR(arg->common.value.string, status); return_ACPI_STATUS(status); } /* Third arg is the bank_value */ arg = arg->common.next; info.bank_value = (u32) arg->common.value.integer; /* Fourth arg is the field flags */ arg = arg->common.next; info.field_flags = (u8) arg->common.value.integer; /* Each remaining arg is a Named Field */ info.field_type = ACPI_TYPE_LOCAL_BANK_FIELD; info.region_node = region_node; status = acpi_ds_get_field_names(&info, walk_state, arg->common.next); return_ACPI_STATUS(status);}/******************************************************************************* * * FUNCTION: acpi_ds_create_index_field * * PARAMETERS: Op - Op containing the Field definition and args * region_node - Object for the containing Operation Region * ` walk_state - Current method state * * RETURN: Status * * DESCRIPTION: Create a new index field in the specified operation region * ******************************************************************************/acpi_statusacpi_ds_create_index_field(union acpi_parse_object *op, struct acpi_namespace_node *region_node, struct acpi_walk_state *walk_state){ acpi_status status; union acpi_parse_object *arg; struct acpi_create_field_info info; ACPI_FUNCTION_TRACE_PTR("ds_create_index_field", op); /* First arg is the name of the Index register (must already exist) */ arg = op->common.value.arg; status = acpi_ns_lookup(walk_state->scope_info, arg->common.value.string, ACPI_TYPE_ANY, ACPI_IMODE_EXECUTE, ACPI_NS_SEARCH_PARENT, walk_state, &info.register_node); if (ACPI_FAILURE(status)) { ACPI_REPORT_NSERROR(arg->common.value.string, status); return_ACPI_STATUS(status); } /* Second arg is the data register (must already exist) */ arg = arg->common.next; status = acpi_ns_lookup(walk_state->scope_info, arg->common.value.string, ACPI_TYPE_ANY, ACPI_IMODE_EXECUTE, ACPI_NS_SEARCH_PARENT, walk_state, &info.data_register_node); if (ACPI_FAILURE(status)) { ACPI_REPORT_NSERROR(arg->common.value.string, status); return_ACPI_STATUS(status); } /* Next arg is the field flags */ arg = arg->common.next; info.field_flags = (u8) arg->common.value.integer; /* Each remaining arg is a Named Field */ info.field_type = ACPI_TYPE_LOCAL_INDEX_FIELD; info.region_node = region_node; status = acpi_ds_get_field_names(&info, walk_state, arg->common.next); return_ACPI_STATUS(status);}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -