summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMatthew Wilcox <matthew@wil.cx>2005-01-15 00:09:15 -0800
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-01-15 00:09:15 -0800
commit8953e8023c8c32a476d0923e145203b9b01f6ebd (patch)
treee08e9cf54ba0b667dcc74bbfa823afec0d6c5882 /include
parentad8c410c23d3933ac1b14abb6be86b6d74b3866f (diff)
[PATCH] Generic IRQ support for PA-RISC
Make PA-RISC use the generic interrupt handling code. We need one tiny change to the generic code -- the addition of a data pointer to irq_desc. This shouldn't be a problem in terms of increasing size of irq_desc for other architectures as the struct is cacheline aligned. It's now 32 bytes on 32-bit platforms and 44/48 bytes on 64-bit platforms (assuming spinlock_t is 4 bytes on 32-bit and 4 or 8 bytes on 64-bit). Signed-off-by: Matthew Wilcox <matthew@wil.cx> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include')
-rw-r--r--include/asm-parisc/hardirq.h7
-rw-r--r--include/asm-parisc/hw_irq.h2
-rw-r--r--include/asm-parisc/irq.h95
-rw-r--r--include/asm-parisc/superio.h6
-rw-r--r--include/linux/irq.h3
5 files changed, 31 insertions, 82 deletions
diff --git a/include/asm-parisc/hardirq.h b/include/asm-parisc/hardirq.h
index 1c66f5fd6bb2..58d92ade386a 100644
--- a/include/asm-parisc/hardirq.h
+++ b/include/asm-parisc/hardirq.h
@@ -18,6 +18,7 @@
#include <linux/config.h>
#include <linux/threads.h>
#include <linux/cache.h>
+#include <linux/irq.h>
typedef struct {
unsigned long __softirq_pending; /* set_bit is used on this */
@@ -28,11 +29,13 @@ typedef struct {
#define HARDIRQ_BITS 16
/*
- * The hardirq mask has to be large enough to have space for potentially all IRQ sources
- * in the system nesting on a single CPU:
+ * The hardirq mask has to be large enough to have space for potentially all
+ * IRQ sources in the system nesting on a single CPU:
*/
#if (1 << HARDIRQ_BITS) < NR_IRQS
# error HARDIRQ_BITS is too low!
#endif
+void ack_bad_irq(unsigned int irq);
+
#endif /* _PARISC_HARDIRQ_H */
diff --git a/include/asm-parisc/hw_irq.h b/include/asm-parisc/hw_irq.h
index f35c91da6036..151426e27521 100644
--- a/include/asm-parisc/hw_irq.h
+++ b/include/asm-parisc/hw_irq.h
@@ -12,6 +12,6 @@
* <tomsoft@informatik.tu-chemnitz.de>
*/
-#include <asm/irq.h>
+extern void hw_resend_irq(struct hw_interrupt_type *, unsigned int);
#endif
diff --git a/include/asm-parisc/irq.h b/include/asm-parisc/irq.h
index b7acca7de670..4e5fad213c39 100644
--- a/include/asm-parisc/irq.h
+++ b/include/asm-parisc/irq.h
@@ -1,102 +1,53 @@
/*
- * linux/include/asm-parisc/irq.h
+ * include/asm-parisc/irq.h
*
- * (C) 1992, 1993 Linus Torvalds, (C) 1997 Ingo Molnar,
- * Copyright 1999 SuSE GmbH
- *
- * IRQ/IPI changes taken from work by Thomas Radke
- * <tomsoft@informatik.tu-chemnitz.de>
+ * Copyright 2005 Matthew Wilcox <matthew@wil.cx>
*/
#ifndef _ASM_PARISC_IRQ_H
#define _ASM_PARISC_IRQ_H
-#include <asm/ptrace.h>
-#include <asm/types.h>
-#include <asm/errno.h>
-
-#include <linux/string.h>
-#include <linux/interrupt.h>
#include <linux/config.h>
+#include <asm/types.h>
+#define NO_IRQ (-1)
-#define CPU_IRQ_REGION 1
-#define TIMER_IRQ (IRQ_FROM_REGION(CPU_IRQ_REGION) | 0)
-#define IPI_IRQ (IRQ_FROM_REGION(CPU_IRQ_REGION) | 1)
-
-/* This should be 31 for PA1.1 binaries and 63 for PA-2.0 wide mode */
-#define MAX_CPU_IRQ (BITS_PER_LONG - 1)
-
-#if BITS_PER_LONG == 32
-# define IRQ_REGION_SHIFT 5
+#ifdef CONFIG_GSC
+#define GSC_IRQ_BASE 16
+#define GSC_IRQ_MAX 63
+#define CPU_IRQ_BASE 64
#else
-# define IRQ_REGION_SHIFT 6
+#define CPU_IRQ_BASE 16
#endif
-#define IRQ_PER_REGION (1 << IRQ_REGION_SHIFT)
-#define NR_IRQ_REGS 16
-#define NR_IRQS (NR_IRQ_REGS * IRQ_PER_REGION)
-
-#define IRQ_REGION(irq) ((irq) >> IRQ_REGION_SHIFT)
-#define IRQ_OFFSET(irq) ((irq) & ((1<<IRQ_REGION_SHIFT)-1))
-#define IRQ_FROM_REGION(reg) ((reg) << IRQ_REGION_SHIFT)
-
-#define EISA_IRQ_REGION 0 /* region 0 needs to be reserved for EISA */
-#define EISA_MAX_IRQS 16 /* max. (E)ISA irq line */
-
-struct irq_region_ops {
- void (*disable_irq)(void *dev, int irq);
- void (* enable_irq)(void *dev, int irq);
- void (* mask_irq)(void *dev, int irq);
- void (* unmask_irq)(void *dev, int irq);
-};
-
-struct irq_region_data {
- void *dev;
- const char *name;
- int irqbase;
- unsigned int status[IRQ_PER_REGION]; /* IRQ status */
-};
+#define TIMER_IRQ (CPU_IRQ_BASE + 0)
+#define IPI_IRQ (CPU_IRQ_BASE + 1)
+#define CPU_IRQ_MAX (CPU_IRQ_BASE + (BITS_PER_LONG - 1))
-struct irq_region {
- struct irq_region_ops ops;
- struct irq_region_data data;
-
- struct irqaction *action;
-};
-
-extern struct irq_region *irq_region[NR_IRQ_REGS];
+#define NR_IRQS (CPU_IRQ_MAX + 1)
static __inline__ int irq_canonicalize(int irq)
{
-#ifdef CONFIG_EISA
- return (irq == (IRQ_FROM_REGION(EISA_IRQ_REGION)+2)
- ? (IRQ_FROM_REGION(EISA_IRQ_REGION)+9) : irq);
-#else
- return irq;
-#endif
+ return (irq == 2) ? 9 : irq;
}
-extern void disable_irq(int);
-#define disable_irq_nosync(i) disable_irq(i)
-extern void enable_irq(int);
-
-extern void do_irq(struct irqaction *a, int i, struct pt_regs *p);
-extern void do_irq_mask(unsigned long mask, struct irq_region *region,
- struct pt_regs *regs);
+struct hw_interrupt_type;
-extern struct irq_region *alloc_irq_region(int count, struct irq_region_ops *ops,
- const char *name, void *dev);
+/*
+ * Some useful "we don't have to do anything here" handlers. Should
+ * probably be provided by the generic code.
+ */
+void no_ack_irq(unsigned int irq);
+void no_end_irq(unsigned int irq);
extern int txn_alloc_irq(void);
extern int txn_claim_irq(int);
extern unsigned int txn_alloc_data(int, unsigned int);
extern unsigned long txn_alloc_addr(int);
+extern int cpu_claim_irq(unsigned int irq, struct hw_interrupt_type *, void *);
+
/* soft power switch support (power.c) */
extern struct tasklet_struct power_tasklet;
-struct irqaction;
-int handle_IRQ_event(unsigned int, struct pt_regs *, struct irqaction *);
-
#endif /* _ASM_PARISC_IRQ_H */
diff --git a/include/asm-parisc/superio.h b/include/asm-parisc/superio.h
index c0a04ea90905..6598acb4d46d 100644
--- a/include/asm-parisc/superio.h
+++ b/include/asm-parisc/superio.h
@@ -56,7 +56,6 @@ struct superio_device {
u32 pp_base;
u32 acpi_base;
int suckyio_irq_enabled;
- struct irq_region *irq_region;
struct pci_dev *lio_pdev; /* pci device for legacy IO (fn 1) */
struct pci_dev *usb_pdev; /* pci device for USB (fn 2) */
};
@@ -81,11 +80,6 @@ struct superio_device {
|| ((x)->device == PCI_DEVICE_ID_NS_87560_LIO) \
|| ((x)->device == PCI_DEVICE_ID_NS_87560_USB) ) )
-struct hwif_s;
-
-extern void superio_inform_irq(int irq);
-extern void superio_serial_init(void); /* called by rs_init() */
extern int superio_fixup_irq(struct pci_dev *pcidev); /* called by iosapic */
-extern void superio_fixup_pci(struct pci_dev *pdev);
#endif /* _PARISC_SUPERIO_H */
diff --git a/include/linux/irq.h b/include/linux/irq.h
index 20b1d9558a2b..c3ff4d101667 100644
--- a/include/linux/irq.h
+++ b/include/linux/irq.h
@@ -59,9 +59,10 @@ typedef struct hw_interrupt_type hw_irq_controller;
* Pad this out to 32 bytes for cache and indexing reasons.
*/
typedef struct irq_desc {
- unsigned int status; /* IRQ status */
hw_irq_controller *handler;
+ void *handler_data;
struct irqaction *action; /* IRQ action list */
+ unsigned int status; /* IRQ status */
unsigned int depth; /* nested irq disables */
unsigned int irq_count; /* For detecting broken interrupts */
unsigned int irqs_unhandled;