summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2008-03-10 22:00:35 +0000
committerjhb <jhb@FreeBSD.org>2008-03-10 22:00:35 +0000
commite0c2a8245edf31dd9da5a9938c1ab8be11802de9 (patch)
tree3e074f4f2db1a979701fa42bd2352bcff2251286
parent700cab4d419ce401eaa24ae56ec777116be7e931 (diff)
downloadFreeBSD-src-e0c2a8245edf31dd9da5a9938c1ab8be11802de9.zip
FreeBSD-src-e0c2a8245edf31dd9da5a9938c1ab8be11802de9.tar.gz
- Don't execute cpuid to fetch the features. We already have the features
present in cpu_feature2. Also, use CPUID2_EST rather than a magic number. - Don't free the ACPI settings list in detach if we are going to fail the request. Otherwise an attempt to kldunload est would free the array but the driver would keep trying to use it. MFC after: 1 week
-rw-r--r--sys/i386/cpufreq/est.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/sys/i386/cpufreq/est.c b/sys/i386/cpufreq/est.c
index 7383e92..44aa57b 100644
--- a/sys/i386/cpufreq/est.c
+++ b/sys/i386/cpufreq/est.c
@@ -39,6 +39,7 @@ __FBSDID("$FreeBSD$");
#include "cpufreq_if.h"
#include <machine/md_var.h>
+#include <machine/specialreg.h>
#include <contrib/dev/acpica/acpi.h>
#include <dev/acpica/acpivar.h>
@@ -946,7 +947,6 @@ static void
est_identify(driver_t *driver, device_t parent)
{
device_t child;
- u_int p[4];
/* Make sure we're not being doubly invoked. */
if (device_find_child(parent, "est", -1) != NULL)
@@ -958,11 +958,9 @@ est_identify(driver_t *driver, device_t parent)
return;
/*
- * Read capability bits and check if the CPU supports EST.
- * This is indicated by bit 7 of ECX.
+ * Check if the CPU supports EST.
*/
- do_cpuid(1, p);
- if ((p[2] & 0x80) == 0)
+ if (!(cpu_feature2 & CPUID2_EST))
return;
/*
@@ -1033,11 +1031,13 @@ est_attach(device_t dev)
static int
est_detach(device_t dev)
{
+#if 0
struct est_softc *sc;
sc = device_get_softc(dev);
if (sc->acpi_settings)
free(sc->freq_list, M_DEVBUF);
+#endif
return (ENXIO);
}
OpenPOWER on IntegriCloud