icu.h revision 122572
155682Smarkm/*- 2178825Sdfr * Copyright (c) 1990 The Regents of the University of California. 355682Smarkm * All rights reserved. 455682Smarkm * 555682Smarkm * This code is derived from software contributed to Berkeley by 655682Smarkm * William Jolitz. 755682Smarkm * 855682Smarkm * Redistribution and use in source and binary forms, with or without 955682Smarkm * modification, are permitted provided that the following conditions 1055682Smarkm * are met: 1155682Smarkm * 1. Redistributions of source code must retain the above copyright 1255682Smarkm * notice, this list of conditions and the following disclaimer. 1355682Smarkm * 2. Redistributions in binary form must reproduce the above copyright 1455682Smarkm * notice, this list of conditions and the following disclaimer in the 1555682Smarkm * documentation and/or other materials provided with the distribution. 1655682Smarkm * 3. All advertising materials mentioning features or use of this software 1755682Smarkm * must display the following acknowledgement: 1855682Smarkm * This product includes software developed by the University of 1955682Smarkm * California, Berkeley and its contributors. 2055682Smarkm * 4. Neither the name of the University nor the names of its contributors 2155682Smarkm * may be used to endorse or promote products derived from this software 2255682Smarkm * without specific prior written permission. 2355682Smarkm * 2455682Smarkm * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 2555682Smarkm * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 2655682Smarkm * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 2755682Smarkm * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 2855682Smarkm * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 2955682Smarkm * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 3055682Smarkm * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 3155682Smarkm * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 3255682Smarkm * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 3355682Smarkm * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 3455682Smarkm * SUCH DAMAGE. 3555682Smarkm * 36178825Sdfr * from: @(#)icu.h 5.6 (Berkeley) 5/9/91 3755682Smarkm * $FreeBSD: head/sys/i386/isa/icu.h 122572 2003-11-12 18:13:57Z jhb $ 38178825Sdfr */ 39178825Sdfr 40178825Sdfr/* 41178825Sdfr * AT/386 Interrupt Control constants 42178825Sdfr * W. Jolitz 8/89 43178825Sdfr */ 44178825Sdfr 45178825Sdfr#ifndef _I386_ISA_ICU_H_ 46178825Sdfr#define _I386_ISA_ICU_H_ 47178825Sdfr 48178825Sdfr/* 49178825Sdfr * Interrupt enable bits - in normal order of priority (which we change) 50178825Sdfr */ 51178825Sdfr#ifdef PC98 52178825Sdfr#define IRQ0 0x0001 53178825Sdfr#define IRQ1 0x0002 54178825Sdfr#define IRQ2 0x0004 55178825Sdfr#define IRQ3 0x0008 56178825Sdfr#define IRQ4 0x0010 57178825Sdfr#define IRQ5 0x0020 58178825Sdfr#define IRQ6 0x0040 59178825Sdfr#define IRQ7 0x0080 60178825Sdfr#define IRQ_SLAVE 0x0080 61178825Sdfr#define IRQ8 0x0100 62178825Sdfr#define IRQ9 0x0200 63178825Sdfr#define IRQ10 0x0400 64178825Sdfr#define IRQ11 0x0800 65178825Sdfr#define IRQ12 0x1000 66178825Sdfr#define IRQ13 0x2000 67178825Sdfr#define IRQ14 0x4000 68178825Sdfr#define IRQ15 0x8000 69178825Sdfr#else 70178825Sdfr#define IRQ0 0x0001 /* highest priority - timer */ 71178825Sdfr#define IRQ1 0x0002 72178825Sdfr#define IRQ_SLAVE 0x0004 73178825Sdfr#define IRQ8 0x0100 74178825Sdfr#define IRQ9 0x0200 75178825Sdfr#define IRQ2 IRQ9 76178825Sdfr#define IRQ10 0x0400 77178825Sdfr#define IRQ11 0x0800 78178825Sdfr#define IRQ12 0x1000 79178825Sdfr#define IRQ13 0x2000 80178825Sdfr#define IRQ14 0x4000 81178825Sdfr#define IRQ15 0x8000 82178825Sdfr#define IRQ3 0x0008 /* this is highest after rotation */ 83178825Sdfr#define IRQ4 0x0010 84178825Sdfr#define IRQ5 0x0020 85178825Sdfr#define IRQ6 0x0040 86178825Sdfr#define IRQ7 0x0080 /* lowest - parallel printer */ 87178825Sdfr#endif 88178825Sdfr 89178825Sdfr/* 90178825Sdfr * Interrupt Control offset into Interrupt descriptor table (IDT) 91178825Sdfr */ 92178825Sdfr#define ICU_OFFSET 32 /* 0-31 are processor exceptions */ 93178825Sdfr#define ICU_LEN 16 /* 32-47 are ISA interrupts */ 94178825Sdfr 95178825Sdfr#ifdef PC98 96178825Sdfr#define ICU_IMR_OFFSET 2 97178825Sdfr#define ICU_SLAVEID 7 98178825Sdfr#else 99178825Sdfr#define ICU_IMR_OFFSET 1 100178825Sdfr#define ICU_SLAVEID 2 101178825Sdfr#endif 102178825Sdfr 10355682Smarkm#define ICU_EOI 0x20 10455682Smarkm#define HWI_MASK 0xffff /* bits for h/w interrupts */ 10555682Smarkm 10655682Smarkm#ifndef LOCORE 10755682Smarkmvoid atpic_handle_intr(struct intrframe iframe); 10855682Smarkmvoid atpic_startup(void); 10972445Sassar#endif 11072445Sassar 11155682Smarkm#endif /* !_I386_ISA_ICU_H_ */ 112178825Sdfr