summaryrefslogtreecommitdiff
path: root/sys/arch
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2008-08-17 15:55:56 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2008-08-17 15:55:56 +0000
commitd264cabbd1355795747bc8a3e1213c91a1c18a5a (patch)
treed14a5331134e9c49db48be760f2bf078563c5f35 /sys/arch
parentb1361f1b0a19418bf243bd22c7ec8e3d999642c3 (diff)
Scale down cpu_clockrate[1] when we scale down the cpu clock frequency such
that delay(9) continues to do the right thing.
Diffstat (limited to 'sys/arch')
-rw-r--r--sys/arch/sparc64/sparc64/cpu.c19
1 files changed, 3 insertions, 16 deletions
diff --git a/sys/arch/sparc64/sparc64/cpu.c b/sys/arch/sparc64/sparc64/cpu.c
index 4758304be79..adf48401b8d 100644
--- a/sys/arch/sparc64/sparc64/cpu.c
+++ b/sys/arch/sparc64/sparc64/cpu.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cpu.c,v 1.48 2008/08/11 19:53:33 kettenis Exp $ */
+/* $OpenBSD: cpu.c,v 1.49 2008/08/17 15:55:55 kettenis Exp $ */
/* $NetBSD: cpu.c,v 1.13 2001/05/26 21:27:15 chs Exp $ */
/*
@@ -107,7 +107,6 @@ void hummingbird_enable_self_refresh(void);
void hummingbird_disable_self_refresh(void);
void hummingbird_set_refresh_count(int, int);
void hummingbird_setperf(int);
-int hummingbird_cpuspeed(int *);
void hummingbird_init(struct cpu_info *ci);
#define IU_IMPL(v) ((((u_int64_t)(v))&VER_IMPL) >> VER_IMPL_SHIFT)
@@ -592,6 +591,7 @@ hummingbird_set_refresh_count(int div, int new_div)
void
hummingbird_setperf(int level)
{
+ extern u_int64_t cpu_clockrate[];
uint64_t estar_mode, new_estar_mode;
uint64_t reg, s;
int div, new_div, i;
@@ -660,22 +660,10 @@ hummingbird_setperf(int level)
delay(1);
hummingbird_set_refresh_count(div, new_div);
}
+ cpu_clockrate[1] = cpu_clockrate[0] / (new_div * 1000000);
intr_restore(s);
}
-int
-hummingbird_cpuspeed(int *freq)
-{
- extern u_int64_t cpu_clockrate[];
- uint64_t reg;
- int div;
-
- reg = ldxa(HB_ESTAR, ASI_PHYS_NON_CACHED);
- div = hummingbird_div(reg & HB_ESTAR_MODE_MASK);
- *freq = cpu_clockrate[1] / div;
- return (0);
-}
-
void
hummingbird_init(struct cpu_info *ci)
{
@@ -688,7 +676,6 @@ hummingbird_init(struct cpu_info *ci)
return;
cpu_setperf = hummingbird_setperf;
- cpu_cpuspeed = hummingbird_cpuspeed;
}
#endif