diff options
author | Landry Breuil <landry@cvs.openbsd.org> | 2012-04-17 09:23:15 +0000 |
---|---|---|
committer | Landry Breuil <landry@cvs.openbsd.org> | 2012-04-17 09:23:15 +0000 |
commit | 00e0d2dd3ef521d54d7db0aada8f8332b8d77ac0 (patch) | |
tree | fa59dcf630fe72893ef2b21a8ba714ade5203e3e /sys | |
parent | 4596cd5ae534c199f9a933188e91e109b94acc2e (diff) |
Add sgi_cpuspeed() setting HW_CPUSPEED sysctl node. Tested on SGI Fuel.
ok miod@
Diffstat (limited to 'sys')
-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 |