diff options
author | 2012-04-17 09:23:14 +0000 | |
---|---|---|
committer | 2012-04-17 09:23:14 +0000 | |
commit | 2871b88ecbad97ea5ece25336db353a37ecd51db (patch) | |
tree | 59117bce1e53a7cd752f167ef07ad10124e0e476 | |
parent | Add type numbers for upcoming sgi work, forgotten during newport(4) import. (diff) | |
download | wireguard-openbsd-2871b88ecbad97ea5ece25336db353a37ecd51db.tar.xz wireguard-openbsd-2871b88ecbad97ea5ece25336db353a37ecd51db.zip |
Add sgi_cpuspeed() setting HW_CPUSPEED sysctl node. Tested on SGI Fuel.
ok miod@
-rw-r--r-- | sys/arch/sgi/sgi/machdep.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/sys/arch/sgi/sgi/machdep.c b/sys/arch/sgi/sgi/machdep.c index 1a5e21559f1..43b3ca1c23d 100644 --- a/sys/arch/sgi/sgi/machdep.c +++ b/sys/arch/sgi/sgi/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.119 2012/04/16 22:23:06 miod Exp $ */ +/* $OpenBSD: machdep.c,v 1.120 2012/04/17 09:23:14 landry Exp $ */ /* * Copyright (c) 2003-2004 Opsycon AB (www.opsycon.se / www.opsycon.com) @@ -131,6 +131,8 @@ boolean_t is_memory_range(paddr_t, psize_t, psize_t); void (*md_halt)(int) = arcbios_halt; +int sgi_cpuspeed(int *); + /* * Do all the stuff that locore normally does before calling main(). * Reset mapping and set up mapping to hardware and init "wired" reg. @@ -712,6 +714,8 @@ cpu_startup() printf("avail mem = %lu (%luMB)\n", ptoa((psize_t)uvmexp.free), ptoa((psize_t)uvmexp.free)/1024/1024); + cpu_cpuspeed = sgi_cpuspeed; + /* * Set up buffers, so they can be used to read disk labels. */ @@ -752,6 +756,16 @@ cpu_sysctl(name, namelen, oldp, oldlenp, newp, newlen, p) } } +int +sgi_cpuspeed(int *freq) +{ + /* + * XXX assumes all CPU have the same frequency + */ + *freq = curcpu()->ci_hw.clock / 1000000; + return (0); +} + int waittime = -1; void |