From 28d7170f1c5dce117802ac079f5caa7cbd7c707d Mon Sep 17 00:00:00 2001 From: Nate Lawson Date: Sat, 19 Feb 2005 06:13:26 +0000 Subject: [PATCH] Add a new field to struct cf_setting for special values. These are driver- specific values that other components may want to use. Add support to acpi_perf(4) to export the control and status values via this field. --- sys/dev/acpica/acpi_perf.c | 8 +++++++- sys/sys/cpu.h | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/sys/dev/acpica/acpi_perf.c b/sys/dev/acpica/acpi_perf.c index 539a06a047f..040f2d54c51 100644 --- a/sys/dev/acpica/acpi_perf.c +++ b/sys/dev/acpica/acpi_perf.c @@ -64,7 +64,11 @@ struct acpi_px { uint32_t sts_val; }; -#define MAX_PX_STATES 16 +/* Offsets in struct cf_setting array for storing driver-specific values. */ +#define PX_SPEC_CONTROL 0 +#define PX_SPEC_STATUS 1 + +#define MAX_PX_STATES 16 struct acpi_perf_softc { device_t dev; @@ -389,6 +393,8 @@ acpi_px_to_set(device_t dev, struct acpi_px *px, struct cf_setting *set) set->lat = px->trans_lat; set->volts = CPUFREQ_VAL_UNKNOWN; set->dev = dev; + set->spec[PX_SPEC_CONTROL] = px->ctrl_val; + set->spec[PX_SPEC_STATUS] = px->sts_val; return (0); } diff --git a/sys/sys/cpu.h b/sys/sys/cpu.h index 99304b2d6cd..e2337ab020f 100644 --- a/sys/sys/cpu.h +++ b/sys/sys/cpu.h @@ -53,6 +53,7 @@ struct cf_setting { int power; /* Power consumed in mW. */ int lat; /* Transition latency in us. */ device_t dev; /* Driver providing this setting. */ + int spec[4];/* Driver-specific storage for non-standard info. */ }; /* Maximum number of settings a given driver can have. */