Commit 07843e17 authored by Geert Uytterhoeven's avatar Geert Uytterhoeven Committed by Linus Torvalds

[PATCH] M68k IRQ API updates [11/20]

M68k Sun-3: Update to the new irq API (from Roman Zippel and me) [11/20]
parent bfe278e0
...@@ -37,7 +37,7 @@ char sun3_reserved_pmeg[SUN3_PMEGS_NUM]; ...@@ -37,7 +37,7 @@ char sun3_reserved_pmeg[SUN3_PMEGS_NUM];
extern unsigned long sun3_gettimeoffset(void); extern unsigned long sun3_gettimeoffset(void);
extern int show_sun3_interrupts (struct seq_file *, void *); extern int show_sun3_interrupts (struct seq_file *, void *);
extern void sun3_sched_init(void (*handler)(int, void *, struct pt_regs *)); extern void sun3_sched_init(irqreturn_t (*handler)(int, void *, struct pt_regs *));
extern void sun3_get_model (char* model); extern void sun3_get_model (char* model);
extern void idprom_init (void); extern void idprom_init (void);
extern int sun3_hwclk(int set, struct rtc_time *t); extern int sun3_hwclk(int set, struct rtc_time *t);
...@@ -174,7 +174,7 @@ void __init config_sun3(void) ...@@ -174,7 +174,7 @@ void __init config_sun3(void)
sun3_bootmem_alloc(memory_start, memory_end); sun3_bootmem_alloc(memory_start, memory_end);
} }
void __init sun3_sched_init(void (*timer_routine)(int, void *, struct pt_regs *)) void __init sun3_sched_init(irqreturn_t (*timer_routine)(int, void *, struct pt_regs *))
{ {
sun3_disable_interrupts(); sun3_disable_interrupts();
intersil_clock->cmd_reg=(INTERSIL_RUN|INTERSIL_INT_DISABLE|INTERSIL_24H_MODE); intersil_clock->cmd_reg=(INTERSIL_RUN|INTERSIL_INT_DISABLE|INTERSIL_24H_MODE);
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
#include <linux/seq_file.h> #include <linux/seq_file.h>
extern void sun3_leds (unsigned char); extern void sun3_leds (unsigned char);
static void sun3_inthandle(int irq, void *dev_id, struct pt_regs *fp); static irqreturn_t sun3_inthandle(int irq, void *dev_id, struct pt_regs *fp);
void sun3_disable_interrupts(void) void sun3_disable_interrupts(void)
{ {
...@@ -64,15 +64,16 @@ inline void sun3_do_irq(int irq, struct pt_regs *fp) ...@@ -64,15 +64,16 @@ inline void sun3_do_irq(int irq, struct pt_regs *fp)
*sun3_intreg |= (1<<irq); *sun3_intreg |= (1<<irq);
} }
static void sun3_int7(int irq, void *dev_id, struct pt_regs *fp) static irqreturn_t sun3_int7(int irq, void *dev_id, struct pt_regs *fp)
{ {
sun3_do_irq(irq,fp); sun3_do_irq(irq,fp);
if(!(kstat_cpu(0).irqs[SYS_IRQS + irq] % 2000)) if(!(kstat_cpu(0).irqs[SYS_IRQS + irq] % 2000))
sun3_leds(led_pattern[(kstat_cpu(0).irqs[SYS_IRQS+irq]%16000) sun3_leds(led_pattern[(kstat_cpu(0).irqs[SYS_IRQS+irq]%16000)
/2000]); /2000]);
return IRQ_HANDLED;
} }
static void sun3_int5(int irq, void *dev_id, struct pt_regs *fp) static irqreturn_t sun3_int5(int irq, void *dev_id, struct pt_regs *fp)
{ {
kstat_cpu(0).irqs[SYS_IRQS + irq]++; kstat_cpu(0).irqs[SYS_IRQS + irq]++;
#ifdef CONFIG_SUN3 #ifdef CONFIG_SUN3
...@@ -87,11 +88,12 @@ static void sun3_int5(int irq, void *dev_id, struct pt_regs *fp) ...@@ -87,11 +88,12 @@ static void sun3_int5(int irq, void *dev_id, struct pt_regs *fp)
if(!(kstat_cpu(0).irqs[SYS_IRQS + irq] % 20)) if(!(kstat_cpu(0).irqs[SYS_IRQS + irq] % 20))
sun3_leds(led_pattern[(kstat_cpu(0).irqs[SYS_IRQS+irq]%160) sun3_leds(led_pattern[(kstat_cpu(0).irqs[SYS_IRQS+irq]%160)
/20]); /20]);
return IRQ_HANDLED;
} }
/* handle requested ints, excepting 5 and 7, which always do the same /* handle requested ints, excepting 5 and 7, which always do the same
thing */ thing */
void (*sun3_default_handler[SYS_IRQS])(int, void *, struct pt_regs *) = { irqreturn_t (*sun3_default_handler[SYS_IRQS])(int, void *, struct pt_regs *) = {
sun3_inthandle, sun3_inthandle, sun3_inthandle, sun3_inthandle, sun3_inthandle, sun3_inthandle, sun3_inthandle, sun3_inthandle,
sun3_inthandle, sun3_int5, sun3_inthandle, sun3_int7 sun3_inthandle, sun3_int5, sun3_inthandle, sun3_int7
}; };
...@@ -99,10 +101,10 @@ void (*sun3_default_handler[SYS_IRQS])(int, void *, struct pt_regs *) = { ...@@ -99,10 +101,10 @@ void (*sun3_default_handler[SYS_IRQS])(int, void *, struct pt_regs *) = {
static const char *dev_names[SYS_IRQS] = { NULL, NULL, NULL, NULL, static const char *dev_names[SYS_IRQS] = { NULL, NULL, NULL, NULL,
NULL, "timer", NULL, "int7 handler" }; NULL, "timer", NULL, "int7 handler" };
static void *dev_ids[SYS_IRQS]; static void *dev_ids[SYS_IRQS];
static void (*sun3_inthandler[SYS_IRQS])(int, void *, struct pt_regs *) = { static irqreturn_t (*sun3_inthandler[SYS_IRQS])(int, void *, struct pt_regs *) = {
NULL, NULL, NULL, NULL, NULL, sun3_int5, NULL, sun3_int7 NULL, NULL, NULL, NULL, NULL, sun3_int5, NULL, sun3_int7
}; };
static void (*sun3_vechandler[SUN3_INT_VECS])(int, void *, struct pt_regs *); static irqreturn_t (*sun3_vechandler[SUN3_INT_VECS])(int, void *, struct pt_regs *);
static void *vec_ids[SUN3_INT_VECS]; static void *vec_ids[SUN3_INT_VECS];
static const char *vec_names[SUN3_INT_VECS]; static const char *vec_names[SUN3_INT_VECS];
static int vec_ints[SUN3_INT_VECS]; static int vec_ints[SUN3_INT_VECS];
...@@ -124,7 +126,7 @@ int show_sun3_interrupts(struct seq_file *p, void *v) ...@@ -124,7 +126,7 @@ int show_sun3_interrupts(struct seq_file *p, void *v)
return 0; return 0;
} }
static void sun3_inthandle(int irq, void *dev_id, struct pt_regs *fp) static irqreturn_t sun3_inthandle(int irq, void *dev_id, struct pt_regs *fp)
{ {
if(sun3_inthandler[irq] == NULL) if(sun3_inthandler[irq] == NULL)
panic ("bad interrupt %d received (id %p)\n",irq, dev_id); panic ("bad interrupt %d received (id %p)\n",irq, dev_id);
...@@ -133,11 +135,13 @@ static void sun3_inthandle(int irq, void *dev_id, struct pt_regs *fp) ...@@ -133,11 +135,13 @@ static void sun3_inthandle(int irq, void *dev_id, struct pt_regs *fp)
*sun3_intreg &= ~(1<<irq); *sun3_intreg &= ~(1<<irq);
sun3_inthandler[irq](irq, dev_ids[irq], fp); sun3_inthandler[irq](irq, dev_ids[irq], fp);
return IRQ_HANDLED;
} }
static void sun3_vec255(int irq, void *dev_id, struct pt_regs *fp) static irqreturn_t sun3_vec255(int irq, void *dev_id, struct pt_regs *fp)
{ {
// intersil_clear(); // intersil_clear();
return IRQ_HANDLED;
} }
void sun3_init_IRQ(void) void sun3_init_IRQ(void)
...@@ -159,7 +163,7 @@ void sun3_init_IRQ(void) ...@@ -159,7 +163,7 @@ void sun3_init_IRQ(void)
sun3_vechandler[191] = sun3_vec255; sun3_vechandler[191] = sun3_vec255;
} }
int sun3_request_irq(unsigned int irq, void (*handler)(int, void *, struct pt_regs *), int sun3_request_irq(unsigned int irq, irqreturn_t (*handler)(int, void *, struct pt_regs *),
unsigned long flags, const char *devname, void *dev_id) unsigned long flags, const char *devname, void *dev_id)
{ {
...@@ -228,7 +232,7 @@ void sun3_free_irq(unsigned int irq, void *dev_id) ...@@ -228,7 +232,7 @@ void sun3_free_irq(unsigned int irq, void *dev_id)
} }
} }
void sun3_process_int(int irq, struct pt_regs *regs) irqreturn_t sun3_process_int(int irq, struct pt_regs *regs)
{ {
if((irq >= 64) && (irq <= 255)) { if((irq >= 64) && (irq <= 255)) {
...@@ -239,8 +243,7 @@ void sun3_process_int(int irq, struct pt_regs *regs) ...@@ -239,8 +243,7 @@ void sun3_process_int(int irq, struct pt_regs *regs)
panic ("bad interrupt vector %d received\n",irq); panic ("bad interrupt vector %d received\n",irq);
vec_ints[vec]++; vec_ints[vec]++;
sun3_vechandler[vec](irq, vec_ids[vec], regs); return sun3_vechandler[vec](irq, vec_ids[vec], regs);
return;
} else { } else {
panic("sun3_process_int: unable to handle interrupt vector %d\n", panic("sun3_process_int: unable to handle interrupt vector %d\n",
irq); irq);
......
...@@ -26,17 +26,17 @@ ...@@ -26,17 +26,17 @@
void sun3_enable_irq(unsigned int irq); void sun3_enable_irq(unsigned int irq);
void sun3_disable_irq(unsigned int irq); void sun3_disable_irq(unsigned int irq);
int sun3_request_irq(unsigned int irq, int sun3_request_irq(unsigned int irq,
void (*handler)(int, void *, struct pt_regs *), irqreturn_t (*handler)(int, void *, struct pt_regs *),
unsigned long flags, const char *devname, void *dev_id unsigned long flags, const char *devname, void *dev_id
); );
extern void sun3_init_IRQ (void); extern void sun3_init_IRQ (void);
extern void (*sun3_default_handler[]) (int, void *, struct pt_regs *); extern irqreturn_t (*sun3_default_handler[]) (int, void *, struct pt_regs *);
extern void (*sun3_inthandler[]) (int, void *, struct pt_regs *); extern irqreturn_t (*sun3_inthandler[]) (int, void *, struct pt_regs *);
extern void sun3_free_irq (unsigned int irq, void *dev_id); extern void sun3_free_irq (unsigned int irq, void *dev_id);
extern void sun3_enable_interrupts (void); extern void sun3_enable_interrupts (void);
extern void sun3_disable_interrupts (void); extern void sun3_disable_interrupts (void);
extern int show_sun3_interrupts(struct seq_file *, void *); extern int show_sun3_interrupts(struct seq_file *, void *);
extern void sun3_process_int(int, struct pt_regs *); extern irqreturn_t sun3_process_int(int, struct pt_regs *);
extern volatile unsigned char* sun3_intreg; extern volatile unsigned char* sun3_intreg;
/* master list of VME vectors -- don't fuck with this */ /* master list of VME vectors -- don't fuck with this */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment