From ebba61d5b05ecfda388dd4c156bafdb78d398055 Mon Sep 17 00:00:00 2001 From: Roman Zippel Date: Sun, 25 Jun 2006 05:47:05 -0700 Subject: [PATCH] [PATCH] m68k: convert sun3 irq code Signed-off-by: Roman Zippel Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- arch/m68k/sun3/config.c | 8 -- arch/m68k/sun3/sun3ints.c | 208 +++++------------------------------- arch/m68k/sun3x/config.c | 7 -- include/asm-m68k/sun3ints.h | 22 +--- 4 files changed, 32 insertions(+), 213 deletions(-) diff --git a/arch/m68k/sun3/config.c b/arch/m68k/sun3/config.c index f1ca0dfbaa..553c304aa2 100644 --- a/arch/m68k/sun3/config.c +++ b/arch/m68k/sun3/config.c @@ -36,7 +36,6 @@ extern char _text, _end; char sun3_reserved_pmeg[SUN3_PMEGS_NUM]; extern unsigned long sun3_gettimeoffset(void); -extern int show_sun3_interrupts (struct seq_file *, void *); extern void sun3_sched_init(irqreturn_t (*handler)(int, void *, struct pt_regs *)); extern void sun3_get_model (char* model); extern void idprom_init (void); @@ -147,13 +146,6 @@ void __init config_sun3(void) mach_sched_init = sun3_sched_init; mach_init_IRQ = sun3_init_IRQ; - mach_default_handler = &sun3_default_handler; - mach_request_irq = sun3_request_irq; - mach_free_irq = sun3_free_irq; - enable_irq = sun3_enable_irq; - disable_irq = sun3_disable_irq; - mach_process_int = sun3_process_int; - mach_get_irq_list = show_sun3_interrupts; mach_reset = sun3_reboot; mach_gettimeoffset = sun3_gettimeoffset; mach_get_model = sun3_get_model; diff --git a/arch/m68k/sun3/sun3ints.c b/arch/m68k/sun3/sun3ints.c index e62a033cd4..0912435e9e 100644 --- a/arch/m68k/sun3/sun3ints.c +++ b/arch/m68k/sun3/sun3ints.c @@ -19,7 +19,6 @@ #include extern void sun3_leds (unsigned char); -static irqreturn_t sun3_inthandle(int irq, void *dev_id, struct pt_regs *fp); void sun3_disable_interrupts(void) { @@ -40,48 +39,30 @@ int led_pattern[8] = { volatile unsigned char* sun3_intreg; -void sun3_insert_irq(irq_node_t **list, irq_node_t *node) -{ -} - -void sun3_delete_irq(irq_node_t **list, void *dev_id) -{ -} - void sun3_enable_irq(unsigned int irq) { - *sun3_intreg |= (1<= 64) && (irq <= 255)) { - int vec; - - vec = irq - 64; - if(sun3_vechandler[vec] != NULL) { - printk("sun3_request_irq: request for vec %d -- already taken!\n", irq); - return 1; - } - - sun3_vechandler[vec] = handler; - vec_ids[vec] = dev_id; - vec_names[vec] = devname; - vec_ints[vec] = 0; - - return 0; - } - } - - printk("sun3_request_irq: invalid irq %d\n", irq); - return 1; + *sun3_intreg &= ~(1 << irq); + m68k_handle_int(irq, fp); } -void sun3_free_irq(unsigned int irq, void *dev_id) -{ - - if(irq < SYS_IRQS) { - if(sun3_inthandler[irq] == NULL) - panic("sun3_free_int: attempt to free unused irq %d\n", irq); - if(dev_ids[irq] != dev_id) - panic("sun3_free_int: incorrect dev_id for irq %d\n", irq); - - sun3_inthandler[irq] = NULL; - return; - } else if((irq >= 64) && (irq <= 255)) { - int vec; - - vec = irq - 64; - if(sun3_vechandler[vec] == NULL) - panic("sun3_free_int: attempt to free unused vector %d\n", irq); - if(vec_ids[irq] != dev_id) - panic("sun3_free_int: incorrect dev_id for vec %d\n", irq); - - sun3_vechandler[vec] = NULL; - return; - } else { - panic("sun3_free_irq: invalid irq %d\n", irq); - } -} +static struct irq_controller sun3_irq_controller = { + .name = "sun3", + .lock = SPIN_LOCK_UNLOCKED, + .startup = m68k_irq_startup, + .shutdown = m68k_irq_shutdown, + .enable = sun3_enable_irq, + .disable = sun3_disable_irq, +}; -irqreturn_t sun3_process_int(int irq, struct pt_regs *regs) +void sun3_init_IRQ(void) { + *sun3_intreg = 1; - if((irq >= 64) && (irq <= 255)) { - int vec; - - vec = irq - 64; - if(sun3_vechandler[vec] == NULL) - panic ("bad interrupt vector %d received\n",irq); + m68k_setup_auto_interrupt(sun3_inthandle); + m68k_setup_irq_controller(&sun3_irq_controller, IRQ_AUTO_1, 7); + m68k_setup_user_interrupt(VEC_USER, 192, NULL); - vec_ints[vec]++; - return sun3_vechandler[vec](irq, vec_ids[vec], regs); - } else { - panic("sun3_process_int: unable to handle interrupt vector %d\n", - irq); - } + request_irq(IRQ_AUTO_5, sun3_int5, 0, "int5", NULL); + request_irq(IRQ_AUTO_7, sun3_int7, 0, "int7", NULL); + request_irq(IRQ_USER+127, sun3_vec255, 0, "vec255", NULL); } diff --git a/arch/m68k/sun3x/config.c b/arch/m68k/sun3x/config.c index 0920f5d336..52fb174088 100644 --- a/arch/m68k/sun3x/config.c +++ b/arch/m68k/sun3x/config.c @@ -52,17 +52,10 @@ void __init config_sun3x(void) sun3x_prom_init(); - mach_get_irq_list = show_sun3_interrupts; mach_max_dma_address = 0xffffffff; /* we can DMA anywhere, whee */ - mach_default_handler = &sun3_default_handler; mach_sched_init = sun3x_sched_init; mach_init_IRQ = sun3_init_IRQ; - enable_irq = sun3_enable_irq; - disable_irq = sun3_disable_irq; - mach_request_irq = sun3_request_irq; - mach_free_irq = sun3_free_irq; - mach_process_int = sun3_process_int; mach_gettimeoffset = sun3x_gettimeoffset; mach_reset = sun3x_reboot; diff --git a/include/asm-m68k/sun3ints.h b/include/asm-m68k/sun3ints.h index bd038fccb6..de91fa071b 100644 --- a/include/asm-m68k/sun3ints.h +++ b/include/asm-m68k/sun3ints.h @@ -12,37 +12,25 @@ #define SUN3INTS_H #include -#include -#include -#include #include -#include -#include #include #include +#include #define SUN3_INT_VECS 192 void sun3_enable_irq(unsigned int irq); void sun3_disable_irq(unsigned int irq); -int sun3_request_irq(unsigned int irq, - irqreturn_t (*handler)(int, void *, struct pt_regs *), - unsigned long flags, const char *devname, void *dev_id - ); extern void sun3_init_IRQ (void); -extern irqreturn_t (*sun3_default_handler[]) (int, void *, struct pt_regs *); -extern void sun3_free_irq (unsigned int irq, void *dev_id); extern void sun3_enable_interrupts (void); extern void sun3_disable_interrupts (void); -extern int show_sun3_interrupts(struct seq_file *, void *); -extern irqreturn_t sun3_process_int(int, struct pt_regs *); extern volatile unsigned char* sun3_intreg; /* master list of VME vectors -- don't fuck with this */ -#define SUN3_VEC_FLOPPY 0x40 -#define SUN3_VEC_VMESCSI0 0x40 -#define SUN3_VEC_VMESCSI1 0x41 -#define SUN3_VEC_CG 0xA8 +#define SUN3_VEC_FLOPPY (IRQ_USER+0) +#define SUN3_VEC_VMESCSI0 (IRQ_USER+0) +#define SUN3_VEC_VMESCSI1 (IRQ_USER+1) +#define SUN3_VEC_CG (IRQ_USER+104) #endif /* SUN3INTS_H */ -- 2.39.5