Commit 27ca6aba authored by Geert Uytterhoeven's avatar Geert Uytterhoeven Committed by Linus Torvalds

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

M68k BVME6000: Update to the new irq API (from Roman Zippel and me) [5/20]
parent 606cd232
...@@ -21,14 +21,14 @@ ...@@ -21,14 +21,14 @@
#include <asm/irq.h> #include <asm/irq.h>
#include <asm/traps.h> #include <asm/traps.h>
static void bvme6000_defhand (int irq, void *dev_id, struct pt_regs *fp); static irqreturn_t bvme6000_defhand (int irq, void *dev_id, struct pt_regs *fp);
/* /*
* This should ideally be 4 elements only, for speed. * This should ideally be 4 elements only, for speed.
*/ */
static struct { static struct {
void (*handler)(int, void *, struct pt_regs *); irqreturn_t (*handler)(int, void *, struct pt_regs *);
unsigned long flags; unsigned long flags;
void *dev_id; void *dev_id;
const char *devname; const char *devname;
...@@ -60,7 +60,7 @@ void bvme6000_init_IRQ (void) ...@@ -60,7 +60,7 @@ void bvme6000_init_IRQ (void)
} }
int bvme6000_request_irq(unsigned int irq, int bvme6000_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)
{ {
if (irq > 255) { if (irq > 255) {
...@@ -117,14 +117,15 @@ void bvme6000_free_irq(unsigned int irq, void *dev_id) ...@@ -117,14 +117,15 @@ void bvme6000_free_irq(unsigned int irq, void *dev_id)
irq_tab[irq].devname = NULL; irq_tab[irq].devname = NULL;
} }
void bvme6000_process_int (unsigned long vec, struct pt_regs *fp) irqreturn_t bvme6000_process_int (unsigned long vec, struct pt_regs *fp)
{ {
if (vec > 255) if (vec > 255) {
printk ("bvme6000_process_int: Illegal vector %ld", vec); printk ("bvme6000_process_int: Illegal vector %ld", vec);
else return IRQ_NONE;
{ } else {
irq_tab[vec].count++; irq_tab[vec].count++;
irq_tab[vec].handler(vec, irq_tab[vec].dev_id, fp); irq_tab[vec].handler(vec, irq_tab[vec].dev_id, fp);
return IRQ_HANDLED;
} }
} }
...@@ -142,9 +143,10 @@ int show_bvme6000_interrupts(struct seq_file *p, void *v) ...@@ -142,9 +143,10 @@ int show_bvme6000_interrupts(struct seq_file *p, void *v)
} }
static void bvme6000_defhand (int irq, void *dev_id, struct pt_regs *fp) static irqreturn_t bvme6000_defhand (int irq, void *dev_id, struct pt_regs *fp)
{ {
printk ("Unknown interrupt 0x%02x\n", irq); printk ("Unknown interrupt 0x%02x\n", irq);
return IRQ_NONE;
} }
void bvme6000_enable_irq (unsigned int irq) void bvme6000_enable_irq (unsigned int irq)
......
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
#include <asm/machdep.h> #include <asm/machdep.h>
#include <asm/bvme6000hw.h> #include <asm/bvme6000hw.h>
extern void bvme6000_process_int (int level, struct pt_regs *regs); extern irqreturn_t bvme6000_process_int (int level, struct pt_regs *regs);
extern void bvme6000_init_IRQ (void); extern void bvme6000_init_IRQ (void);
extern void bvme6000_free_irq (unsigned int, void *); extern void bvme6000_free_irq (unsigned int, void *);
extern int show_bvme6000_interrupts(struct seq_file *, void *); extern int show_bvme6000_interrupts(struct seq_file *, void *);
...@@ -44,8 +44,8 @@ extern void bvme6000_enable_irq (unsigned int); ...@@ -44,8 +44,8 @@ extern void bvme6000_enable_irq (unsigned int);
extern void bvme6000_disable_irq (unsigned int); extern void bvme6000_disable_irq (unsigned int);
static void bvme6000_get_model(char *model); static void bvme6000_get_model(char *model);
static int bvme6000_get_hardware_list(char *buffer); static int bvme6000_get_hardware_list(char *buffer);
extern int bvme6000_request_irq(unsigned int irq, void (*handler)(int, void *, struct pt_regs *), unsigned long flags, const char *devname, void *dev_id); extern int bvme6000_request_irq(unsigned int irq, irqreturn_t (*handler)(int, void *, struct pt_regs *), unsigned long flags, const char *devname, void *dev_id);
extern void bvme6000_sched_init(void (*handler)(int, void *, struct pt_regs *)); extern void bvme6000_sched_init(irqreturn_t (*handler)(int, void *, struct pt_regs *));
extern unsigned long bvme6000_gettimeoffset (void); extern unsigned long bvme6000_gettimeoffset (void);
extern int bvme6000_hwclk (int, struct rtc_time *); extern int bvme6000_hwclk (int, struct rtc_time *);
extern int bvme6000_set_clock_mmss (unsigned long); extern int bvme6000_set_clock_mmss (unsigned long);
...@@ -59,7 +59,7 @@ static unsigned char bin2bcd (unsigned char b); ...@@ -59,7 +59,7 @@ static unsigned char bin2bcd (unsigned char b);
/* Save tick handler routine pointer, will point to do_timer() in /* Save tick handler routine pointer, will point to do_timer() in
* kernel/sched.c, called via bvme6000_process_int() */ * kernel/sched.c, called via bvme6000_process_int() */
static void (*tick_handler)(int, void *, struct pt_regs *); static irqreturn_t (*tick_handler)(int, void *, struct pt_regs *);
int bvme6000_parse_bootinfo(const struct bi_record *bi) int bvme6000_parse_bootinfo(const struct bi_record *bi)
...@@ -159,7 +159,7 @@ void __init config_bvme6000(void) ...@@ -159,7 +159,7 @@ void __init config_bvme6000(void)
} }
void bvme6000_abort_int (int irq, void *dev_id, struct pt_regs *fp) irqreturn_t bvme6000_abort_int (int irq, void *dev_id, struct pt_regs *fp)
{ {
unsigned long *new = (unsigned long *)vectors; unsigned long *new = (unsigned long *)vectors;
unsigned long *old = (unsigned long *)0xf8000000; unsigned long *old = (unsigned long *)0xf8000000;
...@@ -172,17 +172,18 @@ void bvme6000_abort_int (int irq, void *dev_id, struct pt_regs *fp) ...@@ -172,17 +172,18 @@ void bvme6000_abort_int (int irq, void *dev_id, struct pt_regs *fp)
*(new+9) = *(old+9); /* Trace */ *(new+9) = *(old+9); /* Trace */
*(new+47) = *(old+47); /* Trap #15 */ *(new+47) = *(old+47); /* Trap #15 */
*(new+0x1f) = *(old+0x1f); /* ABORT switch */ *(new+0x1f) = *(old+0x1f); /* ABORT switch */
return IRQ_HANDLED;
} }
static void bvme6000_timer_int (int irq, void *dev_id, struct pt_regs *fp) static irqreturn_t bvme6000_timer_int (int irq, void *dev_id, struct pt_regs *fp)
{ {
volatile RtcPtr_t rtc = (RtcPtr_t)BVME_RTC_BASE; volatile RtcPtr_t rtc = (RtcPtr_t)BVME_RTC_BASE;
unsigned char msr = rtc->msr & 0xc0; unsigned char msr = rtc->msr & 0xc0;
rtc->msr = msr | 0x20; /* Ack the interrupt */ rtc->msr = msr | 0x20; /* Ack the interrupt */
tick_handler(irq, dev_id, fp); return tick_handler(irq, dev_id, fp);
} }
/* /*
...@@ -194,7 +195,7 @@ static void bvme6000_timer_int (int irq, void *dev_id, struct pt_regs *fp) ...@@ -194,7 +195,7 @@ static void bvme6000_timer_int (int irq, void *dev_id, struct pt_regs *fp)
* so divide by 8 to get the microsecond result. * so divide by 8 to get the microsecond result.
*/ */
void bvme6000_sched_init (void (*timer_routine)(int, void *, struct pt_regs *)) void bvme6000_sched_init (irqreturn_t (*timer_routine)(int, void *, struct pt_regs *))
{ {
volatile RtcPtr_t rtc = (RtcPtr_t)BVME_RTC_BASE; volatile RtcPtr_t rtc = (RtcPtr_t)BVME_RTC_BASE;
unsigned char msr = rtc->msr & 0xc0; unsigned char msr = rtc->msr & 0xc0;
......
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