summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authornjl <njl@FreeBSD.org>2005-02-19 06:13:26 +0000
committernjl <njl@FreeBSD.org>2005-02-19 06:13:26 +0000
commit2aa2e45138653334db624932dcc1a0642cfb7a65 (patch)
tree8cd3ffdd88fafe4fa14363f30a75e38b08c917e1 /sys
parent699536634eb7d2f27e7186f8391a1793c18922b0 (diff)
downloadFreeBSD-src-2aa2e45138653334db624932dcc1a0642cfb7a65.zip
FreeBSD-src-2aa2e45138653334db624932dcc1a0642cfb7a65.tar.gz
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.
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/acpica/acpi_perf.c8
-rw-r--r--sys/sys/cpu.h1
2 files changed, 8 insertions, 1 deletions
diff --git a/sys/dev/acpica/acpi_perf.c b/sys/dev/acpica/acpi_perf.c
index 539a06a..040f2d5 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 99304b2..e2337ab 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. */
OpenPOWER on IntegriCloud