dsfield.c

来自「是关于linux2.5.1的完全源码」· C语言 代码 · 共 563 行 · 第 1/2 页

C
563
字号
		arg = arg->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 (	acpi_parse_object       *op,	acpi_namespace_node     *region_node,	acpi_walk_state         *walk_state){	acpi_status             status = AE_AML_ERROR;	acpi_parse_object       *arg;	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->value.arg;	if (!region_node) {		status = acpi_ns_lookup (walk_state->scope_info, arg->value.name,				  ACPI_TYPE_REGION, ACPI_IMODE_EXECUTE,				  ACPI_NS_SEARCH_PARENT, walk_state, &region_node);		if (ACPI_FAILURE (status)) {			return_ACPI_STATUS (status);		}	}	/* Second arg is the field flags */	arg = arg->next;	info.field_flags = arg->value.integer8;	info.attribute = 0;	/* Each remaining arg is a Named Field */	info.field_type = INTERNAL_TYPE_REGION_FIELD;	info.region_node = region_node;	status = acpi_ds_get_field_names (&info, walk_state, arg->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 (	acpi_parse_object       *op,	acpi_walk_state         *walk_state){	acpi_status             status = AE_AML_ERROR;	acpi_parse_object       *arg = NULL;	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 = INTERNAL_TYPE_REGION_FIELD;		break;	case AML_BANK_FIELD_OP:		arg = acpi_ps_get_arg (op, 4);		type = INTERNAL_TYPE_BANK_FIELD;		break;	case AML_INDEX_FIELD_OP:		arg = acpi_ps_get_arg (op, 3);		type = INTERNAL_TYPE_INDEX_FIELD;		break;	}	/*	 * Walk the list of entries in the Field_list	 */	while (arg) {		/* Ignore OFFSET and ACCESSAS terms here */		if (arg->opcode == AML_INT_NAMEDFIELD_OP) {			status = acpi_ns_lookup (walk_state->scope_info,					  (NATIVE_CHAR *) &((acpi_parse2_object *)arg)->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)) {				if (status != AE_ALREADY_EXISTS) {					return_ACPI_STATUS (status);				}				ACPI_REPORT_ERROR (("Field name [%4.4s] already exists in current scope\n",						  &((acpi_parse2_object *)arg)->name));			}			arg->node = node;		}		/* Move to next field in the list */		arg = arg->next;	}	return_ACPI_STATUS (status);}/******************************************************************************* * * 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 (	acpi_parse_object       *op,	acpi_namespace_node     *region_node,	acpi_walk_state         *walk_state){	acpi_status             status = AE_AML_ERROR;	acpi_parse_object       *arg;	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->value.arg;	if (!region_node) {		status = acpi_ns_lookup (walk_state->scope_info, arg->value.name,				  ACPI_TYPE_REGION, ACPI_IMODE_EXECUTE,				  ACPI_NS_SEARCH_PARENT, walk_state, &region_node);		if (ACPI_FAILURE (status)) {			return_ACPI_STATUS (status);		}	}	/* Second arg is the Bank Register (must already exist) */	arg = arg->next;	status = acpi_ns_lookup (walk_state->scope_info, arg->value.string,			  INTERNAL_TYPE_BANK_FIELD_DEFN, ACPI_IMODE_EXECUTE,			  ACPI_NS_SEARCH_PARENT, walk_state, &info.register_node);	if (ACPI_FAILURE (status)) {		return_ACPI_STATUS (status);	}	/* Third arg is the Bank_value */	arg = arg->next;	info.bank_value = arg->value.integer32;	/* Fourth arg is the field flags */	arg = arg->next;	info.field_flags = arg->value.integer8;	/* Each remaining arg is a Named Field */	info.field_type = INTERNAL_TYPE_BANK_FIELD;	info.region_node = region_node;	status = acpi_ds_get_field_names (&info, walk_state, arg->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 (	acpi_parse_object       *op,	acpi_namespace_node     *region_node,	acpi_walk_state         *walk_state){	acpi_status             status;	acpi_parse_object       *arg;	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->value.arg;	status = acpi_ns_lookup (walk_state->scope_info, arg->value.string,			  ACPI_TYPE_ANY, ACPI_IMODE_EXECUTE,			  ACPI_NS_SEARCH_PARENT, walk_state, &info.register_node);	if (ACPI_FAILURE (status)) {		return_ACPI_STATUS (status);	}	/* Second arg is the data register (must already exist) */	arg = arg->next;	status = acpi_ns_lookup (walk_state->scope_info, arg->value.string,			  INTERNAL_TYPE_INDEX_FIELD_DEFN, ACPI_IMODE_EXECUTE,			  ACPI_NS_SEARCH_PARENT, walk_state, &info.data_register_node);	if (ACPI_FAILURE (status)) {		return_ACPI_STATUS (status);	}	/* Next arg is the field flags */	arg = arg->next;	info.field_flags = arg->value.integer8;	/* Each remaining arg is a Named Field */	info.field_type = INTERNAL_TYPE_INDEX_FIELD;	info.region_node = region_node;	status = acpi_ds_get_field_names (&info, walk_state, arg->next);	return_ACPI_STATUS (status);}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?