diff options
author | Ted Unangst <tedu@cvs.openbsd.org> | 2003-05-14 22:08:05 +0000 |
---|---|---|
committer | Ted Unangst <tedu@cvs.openbsd.org> | 2003-05-14 22:08:05 +0000 |
commit | 5829392611ebaa28c0d78fa2c46ad258b774617f (patch) | |
tree | 93b8cd6745874dc4fed879a6d37998ad42a92ae3 /sys/arch/i386/include | |
parent | 2f25b15a613b38d852779ea6db235d2366294d5f (diff) |
Support for Transmeta CPU power management, called LongRun.
option LONGRUN enables a new sysctl, allowing a userland program
to read the current CPU frequency and voltage and also set
the mininum and maximum frequencies to operate between, and switch
between performance mode and battery mode.
ok mickey@
Diffstat (limited to 'sys/arch/i386/include')
-rw-r--r-- | sys/arch/i386/include/cpu.h | 6 | ||||
-rw-r--r-- | sys/arch/i386/include/longrun.h | 41 |
2 files changed, 45 insertions, 2 deletions
diff --git a/sys/arch/i386/include/cpu.h b/sys/arch/i386/include/cpu.h index 20d694e7e24..9b6894f0c44 100644 --- a/sys/arch/i386/include/cpu.h +++ b/sys/arch/i386/include/cpu.h @@ -1,4 +1,4 @@ -/* $OpenBSD: cpu.h,v 1.46 2003/03/28 00:49:13 miod Exp $ */ +/* $OpenBSD: cpu.h,v 1.47 2003/05/14 22:08:04 tedu Exp $ */ /* $NetBSD: cpu.h,v 1.35 1996/05/05 19:29:26 christos Exp $ */ /*- @@ -240,7 +240,8 @@ void setconf(void); #define CPU_KBDRESET 10 /* keyboard reset under pcvt */ #define CPU_APMHALT 11 /* halt -p hack */ #define CPU_USERLDT 12 -#define CPU_MAXID 13 /* number of valid machdep ids */ +#define CPU_LONGRUN 13 /* LongRun status */ +#define CPU_MAXID 14 /* number of valid machdep ids */ #define CTL_MACHDEP_NAMES { \ { 0, 0 }, \ @@ -256,6 +257,7 @@ void setconf(void); { "kbdreset", CTLTYPE_INT }, \ { "apmhalt", CTLTYPE_INT }, \ { "userldt", CTLTYPE_INT }, \ + { "longrun", CTLTYPE_STRUCT }, \ } #endif /* !_I386_CPU_H_ */ diff --git a/sys/arch/i386/include/longrun.h b/sys/arch/i386/include/longrun.h new file mode 100644 index 00000000000..a0388f894d3 --- /dev/null +++ b/sys/arch/i386/include/longrun.h @@ -0,0 +1,41 @@ +/* $OpenBSD: longrun.h,v 1.1 2003/05/14 22:08:04 tedu Exp $ */ +/* + * Copyright (c) 2003 Ted Unangst + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef LONGRUN_H +#define LONGRUN_H + +struct longrun { + u_int32_t low; + u_int32_t high; + u_int32_t mode; + u_int32_t freq; + u_int32_t voltage; + u_int32_t percent; +}; + +#endif |