intr.h revision 1.11
11.11Sgarbled/*	$NetBSD: intr.h,v 1.11 2007/10/17 19:55:01 garbled Exp $	*/
21.1Smatt
31.1Smatt/*-
41.1Smatt * Copyright (c) 1998 The NetBSD Foundation, Inc.
51.1Smatt * All rights reserved.
61.1Smatt *
71.1Smatt * This code is derived from software contributed to The NetBSD Foundation
81.1Smatt * by Charles M. Hannum.
91.1Smatt *
101.1Smatt * Redistribution and use in source and binary forms, with or without
111.1Smatt * modification, are permitted provided that the following conditions
121.1Smatt * are met:
131.1Smatt * 1. Redistributions of source code must retain the above copyright
141.1Smatt *    notice, this list of conditions and the following disclaimer.
151.1Smatt * 2. Redistributions in binary form must reproduce the above copyright
161.1Smatt *    notice, this list of conditions and the following disclaimer in the
171.1Smatt *    documentation and/or other materials provided with the distribution.
181.1Smatt * 3. All advertising materials mentioning features or use of this software
191.1Smatt *    must display the following acknowledgement:
201.1Smatt *        This product includes software developed by the NetBSD
211.1Smatt *        Foundation, Inc. and its contributors.
221.1Smatt * 4. Neither the name of The NetBSD Foundation nor the names of its
231.1Smatt *    contributors may be used to endorse or promote products derived
241.1Smatt *    from this software without specific prior written permission.
251.1Smatt *
261.1Smatt * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
271.1Smatt * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
281.1Smatt * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
291.1Smatt * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
301.1Smatt * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
311.1Smatt * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
321.1Smatt * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
331.1Smatt * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
341.1Smatt * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
351.1Smatt * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
361.1Smatt * POSSIBILITY OF SUCH DAMAGE.
371.1Smatt */
381.1Smatt
391.1Smatt#ifndef _IBMNWS_INTR_H_
401.1Smatt#define _IBMNWS_INTR_H_
411.1Smatt
421.11Sgarbled#include <powerpc/intr.h>
431.1Smatt
441.1Smatt#ifndef _LOCORE
451.11Sgarbled#include <machine/cpu.h>
461.6Srjs#include <sys/device.h>
471.6Srjs
481.1Smattvoid init_intr_ivr(void);
491.11Sgarbledvoid init_intr_openpic(void);
501.11Sgarbledvoid openpic_init(unsigned char *);
511.1Smattvoid enable_intr(void);
521.1Smattvoid disable_intr(void);
531.1Smatt
541.1Smattextern int imask[];
551.1Smattextern vaddr_t prep_intr_reg;
561.11Sgarbledextern uint32_t prep_intr_reg_off;
571.1Smatt
581.6Srjs#define	ICU_LEN			32
591.1Smatt
601.1Smatt#define	IRQ_SLAVE		2
611.1Smatt#define	LEGAL_IRQ(x)		((x) >= 0 && (x) < ICU_LEN && (x) != IRQ_SLAVE)
621.1Smatt#define	I8259_INTR_NUM		16
631.1Smatt
641.1Smatt#define	PREP_INTR_REG	0xbffff000
651.1Smatt#define	INTR_VECTOR_REG	0xff0
661.1Smatt
671.1Smatt#endif /* !_LOCORE */
681.1Smatt
691.1Smatt#endif /* !_IBMNWS_INTR_H_ */
70