コード例 #1
0
ファイル: acpidev_memory.c プロジェクト: apprisi/illumos-gate
static ACPI_STATUS
acpidev_memory_probe(acpidev_walk_info_t *infop)
{
	ACPI_STATUS rc = AE_OK;
	int flags;

	ASSERT(infop != NULL);
	ASSERT(infop->awi_hdl != NULL);
	ASSERT(infop->awi_info != NULL);
	if (infop->awi_info->Type != ACPI_TYPE_DEVICE ||
	    acpidev_match_device_id(infop->awi_info,
	    ACPIDEV_ARRAY_PARAM(acpidev_memory_device_ids)) == 0) {
		return (AE_OK);
	}

	flags = ACPIDEV_PROCESS_FLAG_SCAN;
	switch (infop->awi_op_type) {
	case ACPIDEV_OP_BOOT_PROBE:
		if (acpica_get_devcfg_feature(ACPI_DEVCFG_MEMORY)) {
			flags |= ACPIDEV_PROCESS_FLAG_CREATE;
			acpidev_dr_check(infop);
		}
		break;

	case ACPIDEV_OP_BOOT_REPROBE:
		break;

	case ACPIDEV_OP_HOTPLUG_PROBE:
		if (acpica_get_devcfg_feature(ACPI_DEVCFG_MEMORY)) {
			flags |= ACPIDEV_PROCESS_FLAG_CREATE |
			    ACPIDEV_PROCESS_FLAG_SYNCSTATUS |
			    ACPIDEV_PROCESS_FLAG_HOLDBRANCH;
		}
		break;

	default:
		ACPIDEV_DEBUG(CE_WARN, "!acpidev: unknown operation type %u "
		    "in acpidev_memory_probe.", infop->awi_op_type);
		rc = AE_BAD_PARAMETER;
		break;
	}

	if (rc == AE_OK) {
		rc = acpidev_process_object(infop, flags);
	}
	if (ACPI_FAILURE(rc) && rc != AE_NOT_EXIST && rc != AE_ALREADY_EXISTS) {
		cmn_err(CE_WARN,
		    "!acpidev: failed to process memory object %s.",
		    infop->awi_name);
	} else {
		rc = AE_OK;
	}

	return (rc);
}
コード例 #2
0
static ACPI_STATUS
acpidev_scope_probe(acpidev_walk_info_t *infop)
{
	ACPI_STATUS rc;
	int flags;

	ASSERT(infop != NULL);
	ASSERT(infop->awi_hdl != NULL);
	ASSERT(infop->awi_info != NULL);
	if (infop->awi_info->Type != ACPI_TYPE_LOCAL_SCOPE) {
		return (AE_OK);
	}

	if (infop->awi_op_type == ACPIDEV_OP_BOOT_PROBE) {
		flags = ACPIDEV_PROCESS_FLAG_SCAN | ACPIDEV_PROCESS_FLAG_CREATE;
		rc = acpidev_process_object(infop, flags);
	} else if (infop->awi_op_type == ACPIDEV_OP_BOOT_REPROBE) {
		flags = ACPIDEV_PROCESS_FLAG_SCAN;
		rc = acpidev_process_object(infop, flags);
	} else if (infop->awi_op_type == ACPIDEV_OP_HOTPLUG_PROBE) {
		flags = ACPIDEV_PROCESS_FLAG_SCAN;
		rc = acpidev_process_object(infop, flags);
	} else {
		ACPIDEV_DEBUG(CE_WARN, "acpidev: unknown operation type %u "
		    "in acpidev_scope_probe().", infop->awi_op_type);
		rc = AE_BAD_PARAMETER;
	}
	if (ACPI_FAILURE(rc) && rc != AE_NOT_EXIST && rc != AE_ALREADY_EXISTS) {
		cmn_err(CE_WARN,
		    "!acpidev: failed to process scope object %s.",
		    infop->awi_name);
	} else {
		rc = AE_OK;
	}

	return (rc);
}
コード例 #3
0
ファイル: acpidev_cpu.c プロジェクト: apprisi/illumos-gate
static ACPI_STATUS
acpidev_cpu_probe(acpidev_walk_info_t *infop)
{
	ACPI_STATUS rc = AE_OK;
	int flags;

	ASSERT(infop != NULL);
	ASSERT(infop->awi_hdl != NULL);
	ASSERT(infop->awi_info != NULL);
	ASSERT(infop->awi_class_curr == &acpidev_class_cpu);
	if (infop->awi_info->Type != ACPI_TYPE_PROCESSOR &&
	    (infop->awi_info->Type != ACPI_TYPE_DEVICE ||
	    acpidev_match_device_id(infop->awi_info,
	    ACPIDEV_ARRAY_PARAM(acpidev_processor_device_ids)) == 0)) {
		return (AE_OK);
	}

	flags = ACPIDEV_PROCESS_FLAG_SCAN;
	switch (infop->awi_op_type) {
	case  ACPIDEV_OP_BOOT_PROBE:
		/*
		 * Mark device as offline. It will be changed to online state
		 * when the corresponding CPU starts up.
		 */
		if (acpica_get_devcfg_feature(ACPI_DEVCFG_CPU)) {
			flags |= ACPIDEV_PROCESS_FLAG_CREATE |
			    ACPIDEV_PROCESS_FLAG_OFFLINE;
		}
		break;

	case ACPIDEV_OP_BOOT_REPROBE:
		break;

	case ACPIDEV_OP_HOTPLUG_PROBE:
		if (acpica_get_devcfg_feature(ACPI_DEVCFG_CPU)) {
			flags |= ACPIDEV_PROCESS_FLAG_CREATE |
			    ACPIDEV_PROCESS_FLAG_OFFLINE |
			    ACPIDEV_PROCESS_FLAG_SYNCSTATUS |
			    ACPIDEV_PROCESS_FLAG_HOLDBRANCH;
		}
		break;

	default:
		ACPIDEV_DEBUG(CE_WARN, "!acpidev: unknown operation type %u in "
		    "acpidev_cpu_probe().", infop->awi_op_type);
		rc = AE_BAD_PARAMETER;
		break;
	}

	if (rc == AE_OK) {
		rc = acpidev_process_object(infop, flags);
	}
	if (ACPI_FAILURE(rc) && rc != AE_NOT_EXIST && rc != AE_ALREADY_EXISTS) {
		cmn_err(CE_WARN,
		    "!acpidev: failed to process processor object %s.",
		    infop->awi_name);
	} else {
		rc = AE_OK;
	}

	return (rc);
}