1*c1cc27a7Sgkoehler /* $OpenBSD: cpu.h,v 1.15 2022/10/21 22:42:36 gkoehler Exp $ */ 252c13d20Sdrahn /* $NetBSD: cpu.h,v 1.1 1996/09/30 16:34:21 ws Exp $ */ 352c13d20Sdrahn 452c13d20Sdrahn /* 552c13d20Sdrahn * Copyright (C) 1995, 1996 Wolfgang Solfrank. 652c13d20Sdrahn * Copyright (C) 1995, 1996 TooLs GmbH. 752c13d20Sdrahn * All rights reserved. 852c13d20Sdrahn * 952c13d20Sdrahn * Redistribution and use in source and binary forms, with or without 1052c13d20Sdrahn * modification, are permitted provided that the following conditions 1152c13d20Sdrahn * are met: 1252c13d20Sdrahn * 1. Redistributions of source code must retain the above copyright 1352c13d20Sdrahn * notice, this list of conditions and the following disclaimer. 1452c13d20Sdrahn * 2. Redistributions in binary form must reproduce the above copyright 1552c13d20Sdrahn * notice, this list of conditions and the following disclaimer in the 1652c13d20Sdrahn * documentation and/or other materials provided with the distribution. 1752c13d20Sdrahn * 3. All advertising materials mentioning features or use of this software 1852c13d20Sdrahn * must display the following acknowledgement: 1952c13d20Sdrahn * This product includes software developed by TooLs GmbH. 2052c13d20Sdrahn * 4. The name of TooLs GmbH may not be used to endorse or promote products 2152c13d20Sdrahn * derived from this software without specific prior written permission. 2252c13d20Sdrahn * 2352c13d20Sdrahn * THIS SOFTWARE IS PROVIDED BY TOOLS GMBH ``AS IS'' AND ANY EXPRESS OR 2452c13d20Sdrahn * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 2552c13d20Sdrahn * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 2652c13d20Sdrahn * IN NO EVENT SHALL TOOLS GMBH BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 2752c13d20Sdrahn * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 2852c13d20Sdrahn * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 2952c13d20Sdrahn * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 3052c13d20Sdrahn * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 3152c13d20Sdrahn * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 3252c13d20Sdrahn * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 3352c13d20Sdrahn */ 3452c13d20Sdrahn #ifndef _MACHINE_CPU_H_ 3552c13d20Sdrahn #define _MACHINE_CPU_H_ 3652c13d20Sdrahn 378b9af3c1Smatthieu /* 388b9af3c1Smatthieu * CTL_MACHDEP definitions. 398b9af3c1Smatthieu */ 408b9af3c1Smatthieu #define CPU_ALLOWAPERTURE 1 /* allow mmap of /dev/xf86 */ 41e67f9872Sdrahn #define CPU_ALTIVEC 2 /* altivec is present */ 42*c1cc27a7Sgkoehler #define CPU_LIDACTION 3 /* action caused by lid close */ 43*c1cc27a7Sgkoehler #define CPU_PWRACTION 4 /* action caused by power button */ 44*c1cc27a7Sgkoehler #define CPU_MAXID 5 /* number of valid machdep ids */ 458b9af3c1Smatthieu 468b9af3c1Smatthieu #define CTL_MACHDEP_NAMES { \ 478b9af3c1Smatthieu { 0, 0 }, \ 488b9af3c1Smatthieu { "allowaperture", CTLTYPE_INT }, \ 49e67f9872Sdrahn { "altivec", CTLTYPE_INT }, \ 50*c1cc27a7Sgkoehler { "lidaction", CTLTYPE_INT }, \ 51*c1cc27a7Sgkoehler { "pwraction", CTLTYPE_INT }, \ 528b9af3c1Smatthieu } 5373db7f87Smiod 543a3f25c3Skettenis #ifdef _KERNEL 553a3f25c3Skettenis 563a3f25c3Skettenis #include <powerpc/cpu.h> 573a3f25c3Skettenis 580541c039Smpi /* Frequency scaling */ 590541c039Smpi #define FREQ_FULL 0 600541c039Smpi #define FREQ_HALF 1 61c20630d5Smpi #define FREQ_QUARTER 2 /* Supported only on IBM 970MP */ 620541c039Smpi 630541c039Smpi extern u_int32_t ppc_curfreq; 640541c039Smpi extern u_int32_t ppc_maxfreq; 65e67f9872Sdrahn extern int ppc_altivec; 66e67f9872Sdrahn 672de617c1Skettenis extern void (*ppc64_slew_voltage)(u_int); 682de617c1Skettenis 69425bdff6Smpi extern u_int32_t ticks_per_sec; 70d73ca414Smpi extern u_int32_t ns_per_tick; 71425bdff6Smpi 72*c1cc27a7Sgkoehler extern int lid_action; 73*c1cc27a7Sgkoehler extern int pwr_action; 74*c1cc27a7Sgkoehler 753a3f25c3Skettenis #endif /* _KERNEL */ 7652c13d20Sdrahn #endif /* _MACHINE_CPU_H_ */ 77