Commit e798a41d authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] m68k: interrupt management cleanups

From: Geert Uytterhoeven <geert@linux-m68k.org>

M68k interrupt management: rename routines to not confuse them with
syscalls

- sys_{request,free}_irq() -> cpu_{request,free}_irq()

- q40_sys_default_handler[] -> q40_default_handler

- sys_default_handler() -> default_handler()
parent 4edbed7b
...@@ -197,7 +197,7 @@ int amiga_request_irq(unsigned int irq, ...@@ -197,7 +197,7 @@ int amiga_request_irq(unsigned int irq,
} }
if (irq >= IRQ_AMIGA_AUTO) if (irq >= IRQ_AMIGA_AUTO)
return sys_request_irq(irq - IRQ_AMIGA_AUTO, handler, return cpu_request_irq(irq - IRQ_AMIGA_AUTO, handler,
flags, devname, dev_id); flags, devname, dev_id);
if (irq >= IRQ_AMIGA_CIAB) if (irq >= IRQ_AMIGA_CIAB)
...@@ -244,7 +244,7 @@ void amiga_free_irq(unsigned int irq, void *dev_id) ...@@ -244,7 +244,7 @@ void amiga_free_irq(unsigned int irq, void *dev_id)
} }
if (irq >= IRQ_AMIGA_AUTO) if (irq >= IRQ_AMIGA_AUTO)
sys_free_irq(irq - IRQ_AMIGA_AUTO, dev_id); cpu_free_irq(irq - IRQ_AMIGA_AUTO, dev_id);
if (irq >= IRQ_AMIGA_CIAB) { if (irq >= IRQ_AMIGA_CIAB) {
cia_free_irq(&ciab_base, irq - IRQ_AMIGA_CIAB, dev_id); cia_free_irq(&ciab_base, irq - IRQ_AMIGA_CIAB, dev_id);
......
...@@ -73,7 +73,7 @@ int bvme6000_request_irq(unsigned int irq, ...@@ -73,7 +73,7 @@ int bvme6000_request_irq(unsigned int irq,
*/ */
if (irq >= VEC_INT1 && irq <= VEC_INT7) if (irq >= VEC_INT1 && irq <= VEC_INT7)
return sys_request_irq(irq - VEC_SPUR, handler, flags, return cpu_request_irq(irq - VEC_SPUR, handler, flags,
devname, dev_id); devname, dev_id);
#endif #endif
if (!(irq_tab[irq].flags & IRQ_FLG_STD)) { if (!(irq_tab[irq].flags & IRQ_FLG_STD)) {
...@@ -103,7 +103,7 @@ void bvme6000_free_irq(unsigned int irq, void *dev_id) ...@@ -103,7 +103,7 @@ void bvme6000_free_irq(unsigned int irq, void *dev_id)
} }
#if 0 #if 0
if (irq >= VEC_INT1 && irq <= VEC_INT7) { if (irq >= VEC_INT1 && irq <= VEC_INT7) {
sys_free_irq(irq - VEC_SPUR, dev_id); cpu_free_irq(irq - VEC_SPUR, dev_id);
return; return;
} }
#endif #endif
......
...@@ -68,7 +68,7 @@ void __init hp300_sched_init(irqreturn_t (*vector)(int, void *, struct pt_regs * ...@@ -68,7 +68,7 @@ void __init hp300_sched_init(irqreturn_t (*vector)(int, void *, struct pt_regs *
asm volatile(" movpw %0,%1@(5)" : : "d" (INTVAL), "a" (CLOCKBASE)); asm volatile(" movpw %0,%1@(5)" : : "d" (INTVAL), "a" (CLOCKBASE));
sys_request_irq(6, hp300_tick, IRQ_FLG_STD, "timer tick", vector); cpu_request_irq(6, hp300_tick, IRQ_FLG_STD, "timer tick", vector);
out_8(CLOCKBASE + CLKCR2, 0x1); /* select CR1 */ out_8(CLOCKBASE + CLKCR2, 0x1); /* select CR1 */
out_8(CLOCKBASE + CLKCR1, 0x40); /* enable irq */ out_8(CLOCKBASE + CLKCR1, 0x40); /* enable irq */
......
...@@ -137,8 +137,8 @@ void free_irq(unsigned int irq, void *dev_id) ...@@ -137,8 +137,8 @@ void free_irq(unsigned int irq, void *dev_id)
EXPORT_SYMBOL(free_irq); EXPORT_SYMBOL(free_irq);
int sys_request_irq(unsigned int irq, int cpu_request_irq(unsigned int irq,
irqreturn_t (*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 < IRQ1 || irq > IRQ7) { if (irq < IRQ1 || irq > IRQ7) {
...@@ -169,7 +169,7 @@ int sys_request_irq(unsigned int irq, ...@@ -169,7 +169,7 @@ int sys_request_irq(unsigned int irq,
return 0; return 0;
} }
void sys_free_irq(unsigned int irq, void *dev_id) void cpu_free_irq(unsigned int irq, void *dev_id)
{ {
if (irq < IRQ1 || irq > IRQ7) { if (irq < IRQ1 || irq > IRQ7) {
printk("%s: Incorrect IRQ %d\n", __FUNCTION__, irq); printk("%s: Incorrect IRQ %d\n", __FUNCTION__, irq);
......
...@@ -317,7 +317,7 @@ void __init iop_register_interrupts(void) ...@@ -317,7 +317,7 @@ void __init iop_register_interrupts(void)
{ {
if (iop_ism_present) { if (iop_ism_present) {
if (oss_present) { if (oss_present) {
sys_request_irq(OSS_IRQLEV_IOPISM, iop_ism_irq, cpu_request_irq(OSS_IRQLEV_IOPISM, iop_ism_irq,
IRQ_FLG_LOCK, "ISM IOP", IRQ_FLG_LOCK, "ISM IOP",
(void *) IOP_NUM_ISM); (void *) IOP_NUM_ISM);
oss_irq_enable(IRQ_MAC_ADB); oss_irq_enable(IRQ_MAC_ADB);
......
...@@ -261,7 +261,8 @@ void mac_init_IRQ(void) ...@@ -261,7 +261,8 @@ void mac_init_IRQ(void)
if (psc_present) psc_register_interrupts(); if (psc_present) psc_register_interrupts();
if (baboon_present) baboon_register_interrupts(); if (baboon_present) baboon_register_interrupts();
iop_register_interrupts(); iop_register_interrupts();
sys_request_irq(7, mac_nmi_handler, IRQ_FLG_LOCK, "NMI", mac_nmi_handler); cpu_request_irq(7, mac_nmi_handler, IRQ_FLG_LOCK, "NMI",
mac_nmi_handler);
#ifdef DEBUG_MACINTS #ifdef DEBUG_MACINTS
printk("mac_init_IRQ(): Done!\n"); printk("mac_init_IRQ(): Done!\n");
#endif #endif
...@@ -507,7 +508,7 @@ int mac_request_irq(unsigned int irq, ...@@ -507,7 +508,7 @@ int mac_request_irq(unsigned int irq,
#endif #endif
if (irq < VIA1_SOURCE_BASE) { if (irq < VIA1_SOURCE_BASE) {
return sys_request_irq(irq, handler, flags, devname, dev_id); return cpu_request_irq(irq, handler, flags, devname, dev_id);
} }
if (irq >= NUM_MAC_SOURCES) { if (irq >= NUM_MAC_SOURCES) {
...@@ -544,7 +545,7 @@ void mac_free_irq(unsigned int irq, void *dev_id) ...@@ -544,7 +545,7 @@ void mac_free_irq(unsigned int irq, void *dev_id)
#endif #endif
if (irq < VIA1_SOURCE_BASE) { if (irq < VIA1_SOURCE_BASE) {
return sys_free_irq(irq, dev_id); return cpu_free_irq(irq, dev_id);
} }
if (irq >= NUM_MAC_SOURCES) { if (irq >= NUM_MAC_SOURCES) {
......
...@@ -67,15 +67,15 @@ void __init oss_init(void) ...@@ -67,15 +67,15 @@ void __init oss_init(void)
void __init oss_register_interrupts(void) void __init oss_register_interrupts(void)
{ {
sys_request_irq(OSS_IRQLEV_SCSI, oss_irq, IRQ_FLG_LOCK, cpu_request_irq(OSS_IRQLEV_SCSI, oss_irq, IRQ_FLG_LOCK,
"scsi", (void *) oss); "scsi", (void *) oss);
sys_request_irq(OSS_IRQLEV_IOPSCC, mac_scc_dispatch, IRQ_FLG_LOCK, cpu_request_irq(OSS_IRQLEV_IOPSCC, mac_scc_dispatch, IRQ_FLG_LOCK,
"scc", mac_scc_dispatch); "scc", mac_scc_dispatch);
sys_request_irq(OSS_IRQLEV_NUBUS, oss_nubus_irq, IRQ_FLG_LOCK, cpu_request_irq(OSS_IRQLEV_NUBUS, oss_nubus_irq, IRQ_FLG_LOCK,
"nubus", (void *) oss); "nubus", (void *) oss);
sys_request_irq(OSS_IRQLEV_SOUND, oss_irq, IRQ_FLG_LOCK, cpu_request_irq(OSS_IRQLEV_SOUND, oss_irq, IRQ_FLG_LOCK,
"sound", (void *) oss); "sound", (void *) oss);
sys_request_irq(OSS_IRQLEV_VIA1, via1_irq, IRQ_FLG_LOCK, cpu_request_irq(OSS_IRQLEV_VIA1, via1_irq, IRQ_FLG_LOCK,
"via1", (void *) via1); "via1", (void *) via1);
} }
......
...@@ -117,14 +117,10 @@ void __init psc_init(void) ...@@ -117,14 +117,10 @@ void __init psc_init(void)
void __init psc_register_interrupts(void) void __init psc_register_interrupts(void)
{ {
sys_request_irq(3, psc_irq, IRQ_FLG_LOCK, "psc3", cpu_request_irq(3, psc_irq, IRQ_FLG_LOCK, "psc3", (void *) 0x30);
(void *) 0x30); cpu_request_irq(4, psc_irq, IRQ_FLG_LOCK, "psc4", (void *) 0x40);
sys_request_irq(4, psc_irq, IRQ_FLG_LOCK, "psc4", cpu_request_irq(5, psc_irq, IRQ_FLG_LOCK, "psc5", (void *) 0x50);
(void *) 0x40); cpu_request_irq(6, psc_irq, IRQ_FLG_LOCK, "psc6", (void *) 0x60);
sys_request_irq(5, psc_irq, IRQ_FLG_LOCK, "psc5",
(void *) 0x50);
sys_request_irq(6, psc_irq, IRQ_FLG_LOCK, "psc6",
(void *) 0x60);
} }
/* /*
......
...@@ -260,24 +260,27 @@ void __init via_init_clock(irqreturn_t (*func)(int, void *, struct pt_regs *)) ...@@ -260,24 +260,27 @@ void __init via_init_clock(irqreturn_t (*func)(int, void *, struct pt_regs *))
void __init via_register_interrupts(void) void __init via_register_interrupts(void)
{ {
if (via_alt_mapping) { if (via_alt_mapping) {
sys_request_irq(IRQ_AUTO_1, via1_irq, IRQ_FLG_LOCK|IRQ_FLG_FAST, cpu_request_irq(IRQ_AUTO_1, via1_irq,
"software", (void *) via1); IRQ_FLG_LOCK|IRQ_FLG_FAST, "software",
sys_request_irq(IRQ_AUTO_6, via1_irq, IRQ_FLG_LOCK|IRQ_FLG_FAST, (void *) via1);
"via1", (void *) via1); cpu_request_irq(IRQ_AUTO_6, via1_irq,
IRQ_FLG_LOCK|IRQ_FLG_FAST, "via1",
(void *) via1);
} else { } else {
sys_request_irq(IRQ_AUTO_1, via1_irq, IRQ_FLG_LOCK|IRQ_FLG_FAST, cpu_request_irq(IRQ_AUTO_1, via1_irq,
"via1", (void *) via1); IRQ_FLG_LOCK|IRQ_FLG_FAST, "via1",
(void *) via1);
#if 0 /* interferes with serial on some machines */ #if 0 /* interferes with serial on some machines */
if (!psc_present) { if (!psc_present) {
sys_request_irq(IRQ_AUTO_6, mac_bang, IRQ_FLG_LOCK, cpu_request_irq(IRQ_AUTO_6, mac_bang, IRQ_FLG_LOCK,
"Off Switch", mac_bang); "Off Switch", mac_bang);
} }
#endif #endif
} }
sys_request_irq(IRQ_AUTO_2, via2_irq, IRQ_FLG_LOCK|IRQ_FLG_FAST, cpu_request_irq(IRQ_AUTO_2, via2_irq, IRQ_FLG_LOCK|IRQ_FLG_FAST,
"via2", (void *) via2); "via2", (void *) via2);
if (!psc_present) { if (!psc_present) {
sys_request_irq(IRQ_AUTO_4, mac_scc_dispatch, IRQ_FLG_LOCK, cpu_request_irq(IRQ_AUTO_4, mac_scc_dispatch, IRQ_FLG_LOCK,
"scc", mac_scc_dispatch); "scc", mac_scc_dispatch);
} }
request_irq(IRQ_MAC_NUBUS, via_nubus_irq, IRQ_FLG_LOCK|IRQ_FLG_FAST, request_irq(IRQ_MAC_NUBUS, via_nubus_irq, IRQ_FLG_LOCK|IRQ_FLG_FAST,
......
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
extern void floppy_setup(char *str, int *ints); extern void floppy_setup(char *str, int *ints);
extern irqreturn_t q40_process_int (int level, struct pt_regs *regs); extern irqreturn_t q40_process_int (int level, struct pt_regs *regs);
extern irqreturn_t (*q40_sys_default_handler[]) (int, void *, struct pt_regs *); /* added just for debugging */ extern irqreturn_t (*q40_default_handler[]) (int, void *, struct pt_regs *); /* added just for debugging */
extern void q40_init_IRQ (void); extern void q40_init_IRQ (void);
extern void q40_free_irq (unsigned int, void *); extern void q40_free_irq (unsigned int, void *);
extern int show_q40_interrupts (struct seq_file *, void *); extern int show_q40_interrupts (struct seq_file *, void *);
...@@ -185,7 +185,7 @@ void __init config_q40(void) ...@@ -185,7 +185,7 @@ void __init config_q40(void)
mach_request_irq = q40_request_irq; mach_request_irq = q40_request_irq;
enable_irq = q40_enable_irq; enable_irq = q40_enable_irq;
disable_irq = q40_disable_irq; disable_irq = q40_disable_irq;
mach_default_handler = &q40_sys_default_handler; mach_default_handler = &q40_default_handler;
mach_get_model = q40_get_model; mach_get_model = q40_get_model;
mach_get_hardware_list = q40_get_hardware_list; mach_get_hardware_list = q40_get_hardware_list;
......
...@@ -46,10 +46,8 @@ extern int ints_inited; ...@@ -46,10 +46,8 @@ extern int ints_inited;
irqreturn_t q40_irq2_handler (int, void *, struct pt_regs *fp); irqreturn_t q40_irq2_handler (int, void *, struct pt_regs *fp);
extern irqreturn_t (*q40_sys_default_handler[]) (int, void *, struct pt_regs *);
static irqreturn_t q40_defhand (int irq, void *dev_id, struct pt_regs *fp); static irqreturn_t q40_defhand (int irq, void *dev_id, struct pt_regs *fp);
static irqreturn_t sys_default_handler(int lev, void *dev_id, struct pt_regs *regs); static irqreturn_t default_handler(int lev, void *dev_id, struct pt_regs *regs);
#define DEVNAME_SIZE 24 #define DEVNAME_SIZE 24
...@@ -96,7 +94,8 @@ void q40_init_IRQ (void) ...@@ -96,7 +94,8 @@ void q40_init_IRQ (void)
} }
/* setup handler for ISA ints */ /* setup handler for ISA ints */
sys_request_irq(IRQ2,q40_irq2_handler, 0, "q40 ISA and master chip", NULL); cpu_request_irq(IRQ2, q40_irq2_handler, 0, "q40 ISA and master chip",
NULL);
/* now enable some ints.. */ /* now enable some ints.. */
master_outb(1,EXT_ENABLE_REG); /* ISA IRQ 5-15 */ master_outb(1,EXT_ENABLE_REG); /* ISA IRQ 5-15 */
...@@ -153,8 +152,8 @@ int q40_request_irq(unsigned int irq, ...@@ -153,8 +152,8 @@ int q40_request_irq(unsigned int irq,
} }
else { else {
/* Q40_IRQ_SAMPLE :somewhat special actions required here ..*/ /* Q40_IRQ_SAMPLE :somewhat special actions required here ..*/
sys_request_irq(4,handler,flags,devname,dev_id); cpu_request_irq(4, handler, flags, devname, dev_id);
sys_request_irq(6,handler,flags,devname,dev_id); cpu_request_irq(6, handler, flags, devname, dev_id);
return 0; return 0;
} }
} }
...@@ -192,8 +191,8 @@ void q40_free_irq(unsigned int irq, void *dev_id) ...@@ -192,8 +191,8 @@ void q40_free_irq(unsigned int irq, void *dev_id)
} }
else else
{ /* == Q40_IRQ_SAMPLE */ { /* == Q40_IRQ_SAMPLE */
sys_free_irq(4,dev_id); cpu_free_irq(4, dev_id);
sys_free_irq(6,dev_id); cpu_free_irq(6, dev_id);
} }
} }
...@@ -417,16 +416,16 @@ static irqreturn_t q40_defhand (int irq, void *dev_id, struct pt_regs *fp) ...@@ -417,16 +416,16 @@ static irqreturn_t q40_defhand (int irq, void *dev_id, struct pt_regs *fp)
else master_outb(-1,KEYBOARD_UNLOCK_REG); else master_outb(-1,KEYBOARD_UNLOCK_REG);
return IRQ_NONE; return IRQ_NONE;
} }
static irqreturn_t sys_default_handler(int lev, void *dev_id, struct pt_regs *regs) static irqreturn_t default_handler(int lev, void *dev_id, struct pt_regs *regs)
{ {
printk ("Uninitialised interrupt level %d\n", lev); printk ("Uninitialised interrupt level %d\n", lev);
return IRQ_NONE; return IRQ_NONE;
} }
irqreturn_t (*q40_sys_default_handler[SYS_IRQS]) (int, void *, struct pt_regs *) = { irqreturn_t (*q40_default_handler[SYS_IRQS])(int, void *, struct pt_regs *) = {
sys_default_handler,sys_default_handler,sys_default_handler,sys_default_handler, default_handler, default_handler, default_handler, default_handler,
sys_default_handler,sys_default_handler,sys_default_handler,sys_default_handler default_handler, default_handler, default_handler, default_handler
}; };
void q40_enable_irq (unsigned int irq) void q40_enable_irq (unsigned int irq)
......
...@@ -153,8 +153,8 @@ void sun3_init_IRQ(void) ...@@ -153,8 +153,8 @@ void sun3_init_IRQ(void)
for(i = 0; i < SYS_IRQS; i++) for(i = 0; i < SYS_IRQS; i++)
{ {
if(dev_names[i]) if(dev_names[i])
sys_request_irq(i, sun3_default_handler[i], cpu_request_irq(i, sun3_default_handler[i], 0,
0, dev_names[i], NULL); dev_names[i], NULL);
} }
for(i = 0; i < 192; i++) for(i = 0; i < 192; i++)
...@@ -178,7 +178,8 @@ int sun3_request_irq(unsigned int irq, irqreturn_t (*handler)(int, void *, struc ...@@ -178,7 +178,8 @@ int sun3_request_irq(unsigned int irq, irqreturn_t (*handler)(int, void *, struc
dev_names[irq] = devname; dev_names[irq] = devname;
/* setting devname would be nice */ /* setting devname would be nice */
sys_request_irq(irq, sun3_default_handler[irq], 0, devname, NULL); cpu_request_irq(irq, sun3_default_handler[irq], 0, devname,
NULL);
return 0; return 0;
} else { } else {
......
...@@ -76,10 +76,10 @@ extern void (*disable_irq)(unsigned int); ...@@ -76,10 +76,10 @@ extern void (*disable_irq)(unsigned int);
struct pt_regs; struct pt_regs;
extern int sys_request_irq(unsigned int, extern int cpu_request_irq(unsigned int,
irqreturn_t (*)(int, void *, struct pt_regs *), irqreturn_t (*)(int, void *, struct pt_regs *),
unsigned long, const char *, void *); unsigned long, const char *, void *);
extern void sys_free_irq(unsigned int, void *); extern void cpu_free_irq(unsigned int, void *);
/* /*
* various flags for request_irq() - the Amiga now uses the standard * various flags for request_irq() - the Amiga now uses the standard
......
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