Module Name: src Committed By: jruoho Date: Mon Jun 6 07:42:33 UTC 2011
Modified Files: src/sys/arch/x86/acpi: acpi_cpu_md.c Log Message: When getting the frequency, use APERF/MPERF as a fallback method. To generate a diff of this commit: cvs rdiff -u -r1.59 -r1.60 src/sys/arch/x86/acpi/acpi_cpu_md.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/arch/x86/acpi/acpi_cpu_md.c diff -u src/sys/arch/x86/acpi/acpi_cpu_md.c:1.59 src/sys/arch/x86/acpi/acpi_cpu_md.c:1.60 --- src/sys/arch/x86/acpi/acpi_cpu_md.c:1.59 Tue May 31 14:45:36 2011 +++ src/sys/arch/x86/acpi/acpi_cpu_md.c Mon Jun 6 07:42:32 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: acpi_cpu_md.c,v 1.59 2011/05/31 14:45:36 jruoho Exp $ */ +/* $NetBSD: acpi_cpu_md.c,v 1.60 2011/06/06 07:42:32 jruoho Exp $ */ /*- * Copyright (c) 2010, 2011 Jukka Ruohonen <jruoho...@iki.fi> @@ -27,7 +27,7 @@ * SUCH DAMAGE. */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: acpi_cpu_md.c,v 1.59 2011/05/31 14:45:36 jruoho Exp $"); +__KERNEL_RCSID(0, "$NetBSD: acpi_cpu_md.c,v 1.60 2011/06/06 07:42:32 jruoho Exp $"); #include <sys/param.h> #include <sys/bus.h> @@ -755,6 +755,18 @@ } } + /* + * If the value was not found, try APERF/MPERF. + * The state is P0 if the return value is 100 %. + */ + if ((sc->sc_flags & ACPICPU_FLAG_P_HWF) != 0) { + + if (acpicpu_md_pstate_hwf(sc->sc_ci) == 100) { + *freq = sc->sc_pstate[0].ps_freq; + return 0; + } + } + return EIO; }