diff options
author | Gordon Willem Klok <gwk@cvs.openbsd.org> | 2007-05-06 03:37:09 +0000 |
---|---|---|
committer | Gordon Willem Klok <gwk@cvs.openbsd.org> | 2007-05-06 03:37:09 +0000 |
commit | 1b2ae2b4f3c14eba0c4feb7613aee2680e95da48 (patch) | |
tree | 5fda8ab9ed6001ec707c053bb08d7070ab1f6000 /sys/arch/amd64/include/cpu.h | |
parent | d75a8852352203fde00f2db0d61476a4a5afd9dc (diff) |
Add the mp setperf mechanism to AMD64, like its i386 counterpart it allows
all cpus in a system supporting frequency and voltage scaling to be scaled
by the same amount corresponding to the user (or apmd on their behalf)
performance level.
This diff also teaches amd64 about acpi_hasprocfvs (ACPI has processor
frequency and voltage scaling).
It also moves initilization of the underlying setperf mechanism such
as powernow to mainbus from the cpu indentification and initilization
code inspired by similar changes dim@ made to i386 durring h2k6. This
is necessary to implement the AMD recommended method for retreiving
p_state data from the ACPI _PSS object (a diff comming soon). It will
also simplify the potential addition of enhanced speedstep as found
on newer intel processors with EMT64 capable of running OpenBSD/amd64.
MP setperf functionality verifed by myself and Johan M:son Lindman <tybolt
AT solace DOT miun DOT se> on opteron 265 and 270 systems respectively.
General testing done by many others thanks!
ok tedu, dim
Diffstat (limited to 'sys/arch/amd64/include/cpu.h')
-rw-r--r-- | sys/arch/amd64/include/cpu.h | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/sys/arch/amd64/include/cpu.h b/sys/arch/amd64/include/cpu.h index 55ef0ec6bd5..f07e3935b32 100644 --- a/sys/arch/amd64/include/cpu.h +++ b/sys/arch/amd64/include/cpu.h @@ -1,4 +1,4 @@ -/* $OpenBSD: cpu.h,v 1.26 2007/03/15 10:22:29 art Exp $ */ +/* $OpenBSD: cpu.h,v 1.27 2007/05/06 03:37:08 gwk Exp $ */ /* $NetBSD: cpu.h,v 1.1 2003/04/26 18:39:39 fvdl Exp $ */ /*- @@ -119,6 +119,12 @@ struct cpu_info { #define CI_DDB_ENTERDDB 3 #define CI_DDB_INDDB 4 + volatile int ci_setperf_state; +#define CI_SETPERF_READY 0 +#define CI_SETPERF_SHOULDSTOP 1 +#define CI_SETPERF_INTRANSIT 2 +#define CI_SETPERF_DONE 3 + struct x86_64_tss ci_doubleflt_tss; char *ci_doubleflt_stack; @@ -302,9 +308,14 @@ void x86_bus_space_init(void); void x86_bus_space_mallocok(void); /* powernow-k8.c */ -void k8_powernow_init(void); +void k8_powernow_init(struct cpu_info *); void k8_powernow_setperf(int); +#ifdef MULTIPROCESSOR +/* mp_setperf.c */ +void mp_setperf_init(void); +#endif + #endif /* _KERNEL */ /* |