diff --git a/sys/arch/x86/acpi/acpi_cpu_md.c b/sys/arch/x86/acpi/acpi_cpu_md.c index 1adaa63633f6..e4ca00d1cde4 100644 --- a/sys/arch/x86/acpi/acpi_cpu_md.c +++ b/sys/arch/x86/acpi/acpi_cpu_md.c @@ -1,4 +1,4 @@ -/* $NetBSD: acpi_cpu_md.c,v 1.33 2010/08/24 10:29:53 jruoho Exp $ */ +/* $NetBSD: acpi_cpu_md.c,v 1.34 2010/08/25 05:07:43 jruoho Exp $ */ /*- * Copyright (c) 2010 Jukka Ruohonen @@ -27,7 +27,7 @@ * SUCH DAMAGE. */ #include -__KERNEL_RCSID(0, "$NetBSD: acpi_cpu_md.c,v 1.33 2010/08/24 10:29:53 jruoho Exp $"); +__KERNEL_RCSID(0, "$NetBSD: acpi_cpu_md.c,v 1.34 2010/08/25 05:07:43 jruoho Exp $"); #include #include @@ -188,13 +188,13 @@ acpicpu_md_quirks(void) x86_cpuid(0x06, regs); - if ((regs[2] & __BIT(0)) != 0) /* ECX.06[0] */ + if ((regs[2] & CPUID_DSPM_HWF) != 0) val |= ACPICPU_FLAG_P_HW; - if ((regs[0] & __BIT(1)) != 0) /* EAX.06[1] */ + if ((regs[0] & CPUID_DSPM_IDA) != 0) val |= ACPICPU_FLAG_P_TURBO; - if ((regs[0] & __BIT(2)) != 0) /* EAX.06[2] */ + if ((regs[0] & CPUID_DSPM_ARAT) != 0) val &= ~ACPICPU_FLAG_C_APIC; } diff --git a/sys/arch/x86/include/specialreg.h b/sys/arch/x86/include/specialreg.h index c8a9df231708..1b2181373fe5 100644 --- a/sys/arch/x86/include/specialreg.h +++ b/sys/arch/x86/include/specialreg.h @@ -1,4 +1,4 @@ -/* $NetBSD: specialreg.h,v 1.46 2010/08/21 02:59:18 jruoho Exp $ */ +/* $NetBSD: specialreg.h,v 1.47 2010/08/25 05:07:43 jruoho Exp $ */ /*- * Copyright (c) 1991 The Regents of the University of California. @@ -127,6 +127,27 @@ "\30MMX\31FXSR\32SSE\33SSE2\34SS\35HTT\36TM" \ "\37IA64\40SBF" +/* + * Intel Digital Thermal Sensor and + * Power Management, Fn0000_0006 - %eax. + */ +#define CPUID_DSPM_DTS 0x00000001 /* Digital Thermal Sensor */ +#define CPUID_DSPM_IDA 0x00000002 /* Intel Dynamic Acceleration */ +#define CPUID_DSPM_ARAT 0x00000004 /* Always Running APIC Timer */ +#define CPUID_DSPM_PLN 0x00000010 /* Power Limit Notification */ +#define CPUID_DSPM_CME 0x00000020 /* Clock Modulation Extension */ +#define CPUID_DSPM_PLTM 0x00000040 /* Package Level Thermal Management */ + +#define CPUID_DSPM_FLAGS "\20\1DTS\2IDA\3ARAT\5PLN\6CME\7PLTM" + +/* + * Intel Digital Thermal Sensor and + * Power Management, Fn0000_0006 - %ecx. + */ +#define CPUID_DSPM_HWF 0x00000001 /* MSR_APERF/MSR_MPERF available */ + +#define CPUID_DSPM_FLAGS1 "\20\1HWF" + /* Intel Fn80000001 extended features - %edx */ #define CPUID_SYSCALL 0x00000800 /* SYSCALL/SYSRET */ #define CPUID_XD 0x00100000 /* Execute Disable (like CPUID_NOX) */ @@ -190,7 +211,6 @@ * AMD Advanced Power Management * CPUID Fn8000_0007 %edx */ - #define CPUID_APM_TS 0x00000001 /* Temperature Sensor */ #define CPUID_APM_FID 0x00000002 /* Frequency ID control */ #define CPUID_APM_VID 0x00000004 /* Voltage ID control */ diff --git a/sys/arch/x86/x86/coretemp.c b/sys/arch/x86/x86/coretemp.c index 3359bd5b3462..f4c55e130273 100644 --- a/sys/arch/x86/x86/coretemp.c +++ b/sys/arch/x86/x86/coretemp.c @@ -1,4 +1,4 @@ -/* $NetBSD: coretemp.c,v 1.15 2010/08/15 08:45:20 mrg Exp $ */ +/* $NetBSD: coretemp.c,v 1.16 2010/08/25 05:07:43 jruoho Exp $ */ /*- * Copyright (c) 2007 Juan Romero Pardines. @@ -36,7 +36,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: coretemp.c,v 1.15 2010/08/15 08:45:20 mrg Exp $"); +__KERNEL_RCSID(0, "$NetBSD: coretemp.c,v 1.16 2010/08/25 05:07:43 jruoho Exp $"); #include #include @@ -80,7 +80,7 @@ coretemp_register(struct cpu_info *ci) * sensors. EBX[0:3] contains the number of sensors. */ x86_cpuid(0x06, regs); - if ((regs[0] & 0x1) != 1) + if ((regs[0] & CPUID_DSPM_DTS) == 0) return; sc = kmem_zalloc(sizeof(struct coretemp_softc), KM_NOSLEEP);