1 /* $NetBSD: clockreg.h,v 1.9 2006/11/20 20:48:36 hauke Exp $ */ 2 3 /*- 4 * Copyright (C) 1993 Allen K. Briggs, Chris P. Caputo, 5 * Michael L. Finch, Bradley A. Grantham, and 6 * Lawrence A. Kesteloot 7 * All rights reserved. 8 * 9 * Redistribution and use in source and binary forms, with or without 10 * modification, are permitted provided that the following conditions 11 * are met: 12 * 1. Redistributions of source code must retain the above copyright 13 * notice, this list of conditions and the following disclaimer. 14 * 2. Redistributions in binary form must reproduce the above copyright 15 * notice, this list of conditions and the following disclaimer in the 16 * documentation and/or other materials provided with the distribution. 17 * 3. All advertising materials mentioning features or use of this software 18 * must display the following acknowledgement: 19 * This product includes software developed by the Alice Group. 20 * 4. The names of the Alice Group or any of its members may not be used 21 * to endorse or promote products derived from this software without 22 * specific prior written permission. 23 * 24 * THIS SOFTWARE IS PROVIDED BY THE ALICE GROUP ``AS IS'' AND ANY EXPRESS OR 25 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 26 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 27 * IN NO EVENT SHALL THE ALICE GROUP BE LIABLE FOR ANY DIRECT, INDIRECT, 28 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 29 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 30 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 31 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 32 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 33 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 34 * 35 */ 36 37 /* 38 * The Macintosh 6522 VIAs are provided with a 783360 Hz E clock that 39 * used to be 1/10 of the 68000 clock. On the Macintosh II family and 40 * later models, the E clock is not provided by the 68020+ cpu, but 41 * generated by the board chipset, in sync with CPU access. 42 * (Guide to the Macintosh Family Hardware, 2nd Ed., p.149) 43 */ 44 #define CLK_FREQ 783360 /* VIA clock frequency (Hz) */ 45 46 /* Clock needed to hit HZ ticks/sec. */ 47 #define CLK_INTERVAL ((unsigned int)(CLK_FREQ / hz)) 48 49 #define CLK_INTH ((CLK_INTERVAL >> 8) & 0xff) /* high byte */ 50 #define CLK_INTL (CLK_INTERVAL & 0xff) /* low byte */ 51 52 #if !defined(PRF_INTERVAL) 53 #define PRF_INTERVAL CLK_INTERVAL 54 #endif 55