Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/x86/acpi Be more intelligent; read the MSR_CMPHALT ...
details: https://anonhg.NetBSD.org/src/rev/f1b5f0e95945
branches: trunk
changeset: 769813:f1b5f0e95945
user: jruoho <jruoho%NetBSD.org@localhost>
date: Sat Sep 24 11:17:25 2011 +0000
description:
Be more intelligent; read the MSR_CMPHALT with rdmsr_safe() and set the
C1E-flag based on this. Pointed out by jmcneill@.
diffstat:
sys/arch/x86/acpi/acpi_cpu_md.c | 13 ++++++++-----
1 files changed, 8 insertions(+), 5 deletions(-)
diffs (48 lines):
diff -r 2b4985cb9b1b -r f1b5f0e95945 sys/arch/x86/acpi/acpi_cpu_md.c
--- a/sys/arch/x86/acpi/acpi_cpu_md.c Sat Sep 24 10:59:02 2011 +0000
+++ b/sys/arch/x86/acpi/acpi_cpu_md.c Sat Sep 24 11:17:25 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: acpi_cpu_md.c,v 1.65 2011/09/24 10:59:02 jruoho Exp $ */
+/* $NetBSD: acpi_cpu_md.c,v 1.66 2011/09/24 11:17:25 jruoho Exp $ */
/*-
* Copyright (c) 2010, 2011 Jukka Ruohonen <jruohonen%iki.fi@localhost>
@@ -27,7 +27,7 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: acpi_cpu_md.c,v 1.65 2011/09/24 10:59:02 jruoho Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi_cpu_md.c,v 1.66 2011/09/24 11:17:25 jruoho Exp $");
#include <sys/param.h>
#include <sys/bus.h>
@@ -147,6 +147,7 @@
struct pci_attach_args pa;
uint32_t family, val = 0;
uint32_t regs[4];
+ uint64_t msr;
if (acpi_md_ncpus() == 1)
val |= ACPICPU_FLAG_C_BM;
@@ -265,7 +266,10 @@
case 0x10:
case 0x11:
- val |= ACPICPU_FLAG_C_C1E;
+
+ if (rdmsr_safe(MSR_CMPHALT, &msr) != EFAULT)
+ val |= ACPICPU_FLAG_C_C1E;
+
/* FALLTHROUGH */
case 0x14: /* AMD Fusion */
@@ -336,8 +340,7 @@
const uint64_t c1e = MSR_CMPHALT_SMI | MSR_CMPHALT_C1E;
uint64_t val;
- if (__predict_false(rdmsr_safe(MSR_CMPHALT, &val) == EFAULT))
- return;
+ val = rdmsr(MSR_CMPHALT);
if ((val & c1e) != 0)
wrmsr(MSR_CMPHALT, val & ~c1e);
Home |
Main Index |
Thread Index |
Old Index