From c7aae8cbf0e428276ce28214df5fd215b88285c8 Mon Sep 17 00:00:00 2001 From: kettenis Date: Mon, 11 Aug 2008 19:53:33 +0000 Subject: [PATCH] Add hw.cupspeed cupport for all CPU types. --- sys/arch/sparc64/sparc64/cpu.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) 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 /* -- 2.20.1