* Remove the WRITE_FIDVID macro from powernow.h and use it in in the

powernow_k8 driver (much better than undeffing and write it again).
* Fix the WRITE_FIDVID macro, I changed it to use the third argument
  for the bitmask, but it's not correct.

Last change should fix the problem reported by FUKUMOTO Atsushi.
This commit is contained in:
xtraeme 2007-03-24 15:35:15 +00:00
parent 881e272543
commit 0a3943cb24
2 changed files with 6 additions and 17 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: powernow.h,v 1.8 2007/03/18 07:21:40 xtraeme Exp $ */
/* $NetBSD: powernow.h,v 1.9 2007/03/24 15:35:15 xtraeme Exp $ */
/*-
* Copyright (c) 2004 Martin Végiard.
@ -132,11 +132,6 @@
#define ACPI_PN8_CTRL_TO_RVO(x) (((x) >> 28) & 0x03)
#define ACPI_PN8_CTRL_TO_IRT(x) (((x) >> 30) & 0x03)
#define WRITE_FIDVID(fid, vid, ctrl) \
wrmsr(MSR_AMDK7_FIDVID_CTL, \
(((ctrl) << 32) | (1ULL << 16) | ((vid) << 8) | (fid)))
#define POWERNOW_MAX_STATES 16
struct powernow_state {

View File

@ -1,4 +1,4 @@
/* $NetBSD: powernow_k8.c,v 1.16 2007/03/21 22:52:14 xtraeme Exp $ */
/* $NetBSD: powernow_k8.c,v 1.17 2007/03/24 15:35:15 xtraeme Exp $ */
/* $OpenBSD: powernow-k8.c,v 1.8 2006/06/16 05:58:50 gwk Exp $ */
/*-
@ -66,7 +66,7 @@
/* AMD POWERNOW K8 driver */
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: powernow_k8.c,v 1.16 2007/03/21 22:52:14 xtraeme Exp $");
__KERNEL_RCSID(0, "$NetBSD: powernow_k8.c,v 1.17 2007/03/24 15:35:15 xtraeme Exp $");
#include <sys/types.h>
#include <sys/param.h>
@ -85,15 +85,9 @@ __KERNEL_RCSID(0, "$NetBSD: powernow_k8.c,v 1.16 2007/03/21 22:52:14 xtraeme Exp
#include <machine/cpufunc.h>
#include <machine/bus.h>
/*
* Overwrite our previous WRITE_FIDVID macro with the one used by
* the msr_cpu_broadcast framework, which will work in UP and SMP.
*/
#undef WRITE_FIDVID
#define WRITE_FIDVID(fid, vid, ctrl) \
mcb.msr_mask = ((ctrl) << 32); \
mcb.msr_value = ((1ULL << 16) | ((vid) << 8) | (fid)); \
mcb.msr_type = MSR_AMDK7_FIDVID_CTL; \
#define WRITE_FIDVID(fid, vid, ctrl) \
mcb.msr_value = (((ctrl) << 32) | (1ULL << 16) | ((vid) << 8) | (fid)); \
mcb.msr_type = MSR_AMDK7_FIDVID_CTL; \
msr_cpu_broadcast(&mcb);
#ifdef _LKM