diff options
author | Mark Kettenis <kettenis@cvs.openbsd.org> | 2008-08-11 19:53:34 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@cvs.openbsd.org> | 2008-08-11 19:53:34 +0000 |
commit | 137e4350af3978318d79e2e297a5207012c84b36 (patch) | |
tree | 1dd1e170fa4373be85147ed3fab94dde51bc0153 /sys/arch | |
parent | 6e6a8de3c64a3ec0a4431c18bc90d1fea9871926 (diff) |
Add hw.cupspeed cupport for all CPU types.
Diffstat (limited to 'sys/arch')
-rw-r--r-- | sys/arch/sparc64/sparc64/cpu.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/sys/arch/sparc64/sparc64/cpu.c b/sys/arch/sparc64/sparc64/cpu.c index 57140c329e8..4758304be79 100644 --- a/sys/arch/sparc64/sparc64/cpu.c +++ b/sys/arch/sparc64/sparc64/cpu.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cpu.c,v 1.47 2008/08/11 18:20:37 kettenis Exp $ */ +/* $OpenBSD: cpu.c,v 1.48 2008/08/11 19:53:33 kettenis Exp $ */ /* $NetBSD: cpu.c,v 1.13 2001/05/26 21:27:15 chs Exp $ */ /* @@ -99,6 +99,8 @@ struct cfattach cpu_ca = { void cpu_init(struct cpu_info *ci); void cpu_hatch(void); +int sparc64_cpuspeed(int *); + int hummingbird_div(uint64_t); uint64_t hummingbird_estar_mode(int); void hummingbird_enable_self_refresh(void); @@ -285,6 +287,8 @@ cpu_attach(parent, dev, aux) ma->ma_name, vers >> 4, vers & 0xf, clockfreq(clk)); printf(": %s\n", cpu_model); + cpu_cpuspeed = sparc64_cpuspeed; + if (ci->ci_upaid == cpu_myid()) cpu_init(ci); @@ -461,6 +465,15 @@ struct cfdriver cpu_cd = { NULL, "cpu", DV_DULL }; +int +sparc64_cpuspeed(int *freq) +{ + extern u_int64_t cpu_clockrate[]; + + *freq = cpu_clockrate[1]; + return (0); +} + #ifndef SMALL_KERNEL /* |