1/* $NetBSD: irq.h,v 1.1 2002/03/24 15:47:03 bjh21 Exp $ */
2/*-
3 * Copyright (c) 2000 Ben Harris
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:
9 * 1. Redistributions of source code must retain the above copyright
10 *    notice, this list of conditions and the following disclaimer.
11 * 2. Redistributions in binary form must reproduce the above copyright
12 *    notice, this list of conditions and the following disclaimer in the
13 *    documentation and/or other materials provided with the distribution.
14 * 3. The name of the author may not be used to endorse or promote products
15 *    derived from this software without specific prior written permission.
16 *
17 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
18 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
19 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
20 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
21 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 */
28
29#ifndef _ARM26_IRQ_H
30#define _ARM26_IRQ_H
31#include <arch/acorn26/iobus/iocreg.h>
32
33/* return values from interrupt handlers */
34/* These are the same as arm32 uses */
35#define IRQ_HANDLED		1
36#define IRQ_NOT_HANDLED		0
37#define IRQ_MAYBE_HANDLED	-1
38
39/*
40 * These definitions specify how the devices are wired to the IOC
41 * interrupt lines.
42 */
43/* All systems */
44#define IRQ_PFIQ	IOC_IRQ_IL0	/* Podule FIQ request */
45#define	IRQ_SIRQ	IOC_IRQ_IL1	/* Sound buffer pointer used */
46#define IRQ_PIRQ	IOC_IRQ_IL5	/* Podule IRQ request */
47#define IRQ_VFLYBK	IOC_IRQ_IR	/* Start of display vertical flyback */
48/* Archimedes systems */
49#define IRQ_SLCI	IOC_IRQ_IL2	/* Serial line controller interrupt */
50#define IRQ_WIRQ	IOC_IRQ_IL3	/* Winchester interrupt request */
51#define IRQ_DCIRQ	IOC_IRQ_IL4	/* Disc change interrupt request */
52#define IRQ_PBSY	IOC_IRQ_IL6	/* Printer Busy Input */
53#define IRQ_RII		IOC_IRQ_IL7	/* Serial line ring indicator input */
54#define IRQ_PACK	IOC_IRQ_IF	/* Printer acknowledge input */
55/* IOEB systems */
56#define IRQ_SINTR	IOC_IRQ_IL2	/* Serial line interrupt */
57#define IRQ_IDEINTR	IOC_IRQ_IL3	/* IDE interrupt */
58#define IRQ_FINTR	IOC_IRQ_IL4	/* Floppy disc interrupt */
59#define IRQ_LPINTR	IOC_IRQ_IL6	/* Parallel port latched interrupt */
60#define IRQ_INDEX	IOC_IRQ_IF	/* Start of floppy disc index pulse */
61
62/* IRQ numbers above 15 are non-IOC IRQs */
63#define IRQ_UNIXBP_BASE	16
64
65struct irq_handler;
66struct evcnt;
67
68extern void irq_init(void);
69/* irq_handler is declared in machdep.h */
70/* splx, raisespl and lowerspl are declared in intr.h */
71extern struct irq_handler *irq_establish(int, int, int(*)(void *), void *,
72    struct evcnt *);
73extern char const *irq_string(struct irq_handler *);
74extern void irq_enable(struct irq_handler *);
75extern void irq_disable(struct irq_handler *);
76extern void irq_genmasks(void);
77extern void irq_stat(void (*)(const char *, ...));
78#endif
79