Commit 9c5f4afd authored by Roman Zippel's avatar Roman Zippel Committed by Linus Torvalds

[PATCH] m68k: convert mac irq code

Signed-off-by: default avatarRoman Zippel <zippel@linux-m68k.org>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 35353bb8
...@@ -81,7 +81,7 @@ irqreturn_t baboon_irq(int irq, void *dev_id, struct pt_regs *regs) ...@@ -81,7 +81,7 @@ irqreturn_t baboon_irq(int irq, void *dev_id, struct pt_regs *regs)
for (i = 0, irq_bit = 1 ; i < 3 ; i++, irq_bit <<= 1) { for (i = 0, irq_bit = 1 ; i < 3 ; i++, irq_bit <<= 1) {
if (events & irq_bit/* & baboon_active*/) { if (events & irq_bit/* & baboon_active*/) {
baboon_active &= ~irq_bit; baboon_active &= ~irq_bit;
mac_do_irq_list(IRQ_BABOON_0 + i, regs); m68k_handle_int(IRQ_BABOON_0 + i, regs);
baboon_active |= irq_bit; baboon_active |= irq_bit;
baboon->mb_ifr &= ~irq_bit; baboon->mb_ifr &= ~irq_bit;
} }
......
...@@ -169,12 +169,7 @@ void __init config_mac(void) ...@@ -169,12 +169,7 @@ void __init config_mac(void)
mach_sched_init = mac_sched_init; mach_sched_init = mac_sched_init;
mach_init_IRQ = mac_init_IRQ; mach_init_IRQ = mac_init_IRQ;
mach_request_irq = mac_request_irq;
mach_free_irq = mac_free_irq;
enable_irq = mac_enable_irq;
disable_irq = mac_disable_irq;
mach_get_model = mac_get_model; mach_get_model = mac_get_model;
mach_get_irq_list = show_mac_interrupts;
mach_gettimeoffset = mac_gettimeoffset; mach_gettimeoffset = mac_gettimeoffset;
#warning move to adb/via init #warning move to adb/via init
#if 0 #if 0
......
...@@ -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) {
cpu_request_irq(OSS_IRQLEV_IOPISM, iop_ism_irq, 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);
......
This diff is collapsed.
...@@ -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)
{ {
cpu_request_irq(OSS_IRQLEV_SCSI, oss_irq, IRQ_FLG_LOCK, request_irq(OSS_IRQLEV_SCSI, oss_irq, IRQ_FLG_LOCK,
"scsi", (void *) oss); "scsi", (void *) oss);
cpu_request_irq(OSS_IRQLEV_IOPSCC, mac_scc_dispatch, IRQ_FLG_LOCK, request_irq(OSS_IRQLEV_IOPSCC, mac_scc_dispatch, IRQ_FLG_LOCK,
"scc", mac_scc_dispatch); "scc", mac_scc_dispatch);
cpu_request_irq(OSS_IRQLEV_NUBUS, oss_nubus_irq, IRQ_FLG_LOCK, request_irq(OSS_IRQLEV_NUBUS, oss_nubus_irq, IRQ_FLG_LOCK,
"nubus", (void *) oss); "nubus", (void *) oss);
cpu_request_irq(OSS_IRQLEV_SOUND, oss_irq, IRQ_FLG_LOCK, request_irq(OSS_IRQLEV_SOUND, oss_irq, IRQ_FLG_LOCK,
"sound", (void *) oss); "sound", (void *) oss);
cpu_request_irq(OSS_IRQLEV_VIA1, via1_irq, IRQ_FLG_LOCK, request_irq(OSS_IRQLEV_VIA1, via1_irq, IRQ_FLG_LOCK,
"via1", (void *) via1); "via1", (void *) via1);
} }
...@@ -113,7 +113,7 @@ irqreturn_t oss_irq(int irq, void *dev_id, struct pt_regs *regs) ...@@ -113,7 +113,7 @@ irqreturn_t oss_irq(int irq, void *dev_id, struct pt_regs *regs)
oss->irq_pending &= ~OSS_IP_SOUND; oss->irq_pending &= ~OSS_IP_SOUND;
} else if (events & OSS_IP_SCSI) { } else if (events & OSS_IP_SCSI) {
oss->irq_level[OSS_SCSI] = OSS_IRQLEV_DISABLED; oss->irq_level[OSS_SCSI] = OSS_IRQLEV_DISABLED;
mac_do_irq_list(IRQ_MAC_SCSI, regs); m68k_handle_int(IRQ_MAC_SCSI, regs);
oss->irq_pending &= ~OSS_IP_SCSI; oss->irq_pending &= ~OSS_IP_SCSI;
oss->irq_level[OSS_SCSI] = OSS_IRQLEV_SCSI; oss->irq_level[OSS_SCSI] = OSS_IRQLEV_SCSI;
} else { } else {
...@@ -146,7 +146,7 @@ irqreturn_t oss_nubus_irq(int irq, void *dev_id, struct pt_regs *regs) ...@@ -146,7 +146,7 @@ irqreturn_t oss_nubus_irq(int irq, void *dev_id, struct pt_regs *regs)
for (i = 0, irq_bit = 1 ; i < 6 ; i++, irq_bit <<= 1) { for (i = 0, irq_bit = 1 ; i < 6 ; i++, irq_bit <<= 1) {
if (events & irq_bit) { if (events & irq_bit) {
oss->irq_level[i] = OSS_IRQLEV_DISABLED; oss->irq_level[i] = OSS_IRQLEV_DISABLED;
mac_do_irq_list(NUBUS_SOURCE_BASE + i, regs); m68k_handle_int(NUBUS_SOURCE_BASE + i, regs);
oss->irq_pending &= ~irq_bit; oss->irq_pending &= ~irq_bit;
oss->irq_level[i] = OSS_IRQLEV_NUBUS; oss->irq_level[i] = OSS_IRQLEV_NUBUS;
} }
......
...@@ -117,10 +117,10 @@ void __init psc_init(void) ...@@ -117,10 +117,10 @@ void __init psc_init(void)
void __init psc_register_interrupts(void) void __init psc_register_interrupts(void)
{ {
cpu_request_irq(3, psc_irq, IRQ_FLG_LOCK, "psc3", (void *) 0x30); request_irq(IRQ_AUTO_3, psc_irq, 0, "psc3", (void *) 0x30);
cpu_request_irq(4, psc_irq, IRQ_FLG_LOCK, "psc4", (void *) 0x40); request_irq(IRQ_AUTO_4, psc_irq, 0, "psc4", (void *) 0x40);
cpu_request_irq(5, psc_irq, IRQ_FLG_LOCK, "psc5", (void *) 0x50); request_irq(IRQ_AUTO_5, psc_irq, 0, "psc5", (void *) 0x50);
cpu_request_irq(6, psc_irq, IRQ_FLG_LOCK, "psc6", (void *) 0x60); request_irq(IRQ_AUTO_6, psc_irq, 0, "psc6", (void *) 0x60);
} }
/* /*
...@@ -149,7 +149,7 @@ irqreturn_t psc_irq(int irq, void *dev_id, struct pt_regs *regs) ...@@ -149,7 +149,7 @@ irqreturn_t psc_irq(int irq, void *dev_id, struct pt_regs *regs)
for (i = 0, irq_bit = 1 ; i < 4 ; i++, irq_bit <<= 1) { for (i = 0, irq_bit = 1 ; i < 4 ; i++, irq_bit <<= 1) {
if (events & irq_bit) { if (events & irq_bit) {
psc_write_byte(pIER, irq_bit); psc_write_byte(pIER, irq_bit);
mac_do_irq_list(base_irq + i, regs); m68k_handle_int(base_irq + i, regs);
psc_write_byte(pIFR, irq_bit); psc_write_byte(pIFR, irq_bit);
psc_write_byte(pIER, irq_bit | 0x80); psc_write_byte(pIER, irq_bit | 0x80);
} }
......
...@@ -253,21 +253,21 @@ void __init via_init_clock(irqreturn_t (*func)(int, void *, struct pt_regs *)) ...@@ -253,21 +253,21 @@ 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) {
cpu_request_irq(IRQ_AUTO_1, via1_irq, request_irq(IRQ_AUTO_1, via1_irq,
IRQ_FLG_LOCK|IRQ_FLG_FAST, "software", IRQ_FLG_LOCK|IRQ_FLG_FAST, "software",
(void *) via1); (void *) via1);
cpu_request_irq(IRQ_AUTO_6, via1_irq, request_irq(IRQ_AUTO_6, via1_irq,
IRQ_FLG_LOCK|IRQ_FLG_FAST, "via1", IRQ_FLG_LOCK|IRQ_FLG_FAST, "via1",
(void *) via1); (void *) via1);
} else { } else {
cpu_request_irq(IRQ_AUTO_1, via1_irq, request_irq(IRQ_AUTO_1, via1_irq,
IRQ_FLG_LOCK|IRQ_FLG_FAST, "via1", IRQ_FLG_LOCK|IRQ_FLG_FAST, "via1",
(void *) via1); (void *) via1);
} }
cpu_request_irq(IRQ_AUTO_2, via2_irq, IRQ_FLG_LOCK|IRQ_FLG_FAST, 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) {
cpu_request_irq(IRQ_AUTO_4, mac_scc_dispatch, IRQ_FLG_LOCK, 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,
...@@ -424,7 +424,7 @@ irqreturn_t via1_irq(int irq, void *dev_id, struct pt_regs *regs) ...@@ -424,7 +424,7 @@ irqreturn_t via1_irq(int irq, void *dev_id, struct pt_regs *regs)
for (i = 0, irq_bit = 1 ; i < 7 ; i++, irq_bit <<= 1) for (i = 0, irq_bit = 1 ; i < 7 ; i++, irq_bit <<= 1)
if (events & irq_bit) { if (events & irq_bit) {
via1[vIER] = irq_bit; via1[vIER] = irq_bit;
mac_do_irq_list(VIA1_SOURCE_BASE + i, regs); m68k_handle_int(VIA1_SOURCE_BASE + i, regs);
via1[vIFR] = irq_bit; via1[vIFR] = irq_bit;
via1[vIER] = irq_bit | 0x80; via1[vIER] = irq_bit | 0x80;
} }
...@@ -439,7 +439,7 @@ irqreturn_t via1_irq(int irq, void *dev_id, struct pt_regs *regs) ...@@ -439,7 +439,7 @@ irqreturn_t via1_irq(int irq, void *dev_id, struct pt_regs *regs)
/* No, it won't be set. that's why we're doing this. */ /* No, it won't be set. that's why we're doing this. */
via_irq_disable(IRQ_MAC_NUBUS); via_irq_disable(IRQ_MAC_NUBUS);
via_irq_clear(IRQ_MAC_NUBUS); via_irq_clear(IRQ_MAC_NUBUS);
mac_do_irq_list(IRQ_MAC_NUBUS, regs); m68k_handle_int(IRQ_MAC_NUBUS, regs);
via_irq_enable(IRQ_MAC_NUBUS); via_irq_enable(IRQ_MAC_NUBUS);
} }
#endif #endif
...@@ -459,7 +459,7 @@ irqreturn_t via2_irq(int irq, void *dev_id, struct pt_regs *regs) ...@@ -459,7 +459,7 @@ irqreturn_t via2_irq(int irq, void *dev_id, struct pt_regs *regs)
if (events & irq_bit) { if (events & irq_bit) {
via2[gIER] = irq_bit; via2[gIER] = irq_bit;
via2[gIFR] = irq_bit | rbv_clear; via2[gIFR] = irq_bit | rbv_clear;
mac_do_irq_list(VIA2_SOURCE_BASE + i, regs); m68k_handle_int(VIA2_SOURCE_BASE + i, regs);
via2[gIER] = irq_bit | 0x80; via2[gIER] = irq_bit | 0x80;
} }
return IRQ_HANDLED; return IRQ_HANDLED;
...@@ -481,7 +481,7 @@ irqreturn_t via_nubus_irq(int irq, void *dev_id, struct pt_regs *regs) ...@@ -481,7 +481,7 @@ irqreturn_t via_nubus_irq(int irq, void *dev_id, struct pt_regs *regs)
for (i = 0, irq_bit = 1 ; i < 7 ; i++, irq_bit <<= 1) { for (i = 0, irq_bit = 1 ; i < 7 ; i++, irq_bit <<= 1) {
if (events & irq_bit) { if (events & irq_bit) {
via_irq_disable(NUBUS_SOURCE_BASE + i); via_irq_disable(NUBUS_SOURCE_BASE + i);
mac_do_irq_list(NUBUS_SOURCE_BASE + i, regs); m68k_handle_int(NUBUS_SOURCE_BASE + i, regs);
via_irq_enable(NUBUS_SOURCE_BASE + i); via_irq_enable(NUBUS_SOURCE_BASE + i);
} }
} }
......
...@@ -43,9 +43,6 @@ ...@@ -43,9 +43,6 @@
/* #define DEBUG_MAC_ESP */ /* #define DEBUG_MAC_ESP */
#define mac_turnon_irq(x) mac_enable_irq(x)
#define mac_turnoff_irq(x) mac_disable_irq(x)
extern void esp_handle(struct NCR_ESP *esp); extern void esp_handle(struct NCR_ESP *esp);
extern void mac_esp_intr(int irq, void *dev_id, struct pt_regs *pregs); extern void mac_esp_intr(int irq, void *dev_id, struct pt_regs *pregs);
...@@ -639,13 +636,13 @@ static void dma_init_write(struct NCR_ESP * esp, char * vaddress, int length) ...@@ -639,13 +636,13 @@ static void dma_init_write(struct NCR_ESP * esp, char * vaddress, int length)
static void dma_ints_off(struct NCR_ESP * esp) static void dma_ints_off(struct NCR_ESP * esp)
{ {
mac_turnoff_irq(esp->irq); disable_irq(esp->irq);
} }
static void dma_ints_on(struct NCR_ESP * esp) static void dma_ints_on(struct NCR_ESP * esp)
{ {
mac_turnon_irq(esp->irq); enable_irq(esp->irq);
} }
/* /*
......
...@@ -65,9 +65,6 @@ ...@@ -65,9 +65,6 @@
#define RESET_BOOT #define RESET_BOOT
#define DRIVER_SETUP #define DRIVER_SETUP
#define ENABLE_IRQ() mac_enable_irq( IRQ_MAC_SCSI );
#define DISABLE_IRQ() mac_disable_irq( IRQ_MAC_SCSI );
extern void via_scsi_clear(void); extern void via_scsi_clear(void);
#ifdef RESET_BOOT #ifdef RESET_BOOT
...@@ -351,7 +348,7 @@ static void mac_scsi_reset_boot(struct Scsi_Host *instance) ...@@ -351,7 +348,7 @@ static void mac_scsi_reset_boot(struct Scsi_Host *instance)
printk(KERN_INFO "Macintosh SCSI: resetting the SCSI bus..." ); printk(KERN_INFO "Macintosh SCSI: resetting the SCSI bus..." );
/* switch off SCSI IRQ - catch an interrupt without IRQ bit set else */ /* switch off SCSI IRQ - catch an interrupt without IRQ bit set else */
mac_disable_irq(IRQ_MAC_SCSI); disable_irq(IRQ_MAC_SCSI);
/* get in phase */ /* get in phase */
NCR5380_write( TARGET_COMMAND_REG, NCR5380_write( TARGET_COMMAND_REG,
...@@ -369,7 +366,7 @@ static void mac_scsi_reset_boot(struct Scsi_Host *instance) ...@@ -369,7 +366,7 @@ static void mac_scsi_reset_boot(struct Scsi_Host *instance)
barrier(); barrier();
/* switch on SCSI IRQ again */ /* switch on SCSI IRQ again */
mac_enable_irq(IRQ_MAC_SCSI); enable_irq(IRQ_MAC_SCSI);
printk(KERN_INFO " done\n" ); printk(KERN_INFO " done\n" );
} }
......
...@@ -69,12 +69,12 @@ ...@@ -69,12 +69,12 @@
#define OSS_IRQLEV_DISABLED 0 #define OSS_IRQLEV_DISABLED 0
#define OSS_IRQLEV_IOPISM 1 /* ADB? */ #define OSS_IRQLEV_IOPISM 1 /* ADB? */
#define OSS_IRQLEV_SCSI 2 #define OSS_IRQLEV_SCSI IRQ_AUTO_2
#define OSS_IRQLEV_NUBUS 3 /* keep this on its own level */ #define OSS_IRQLEV_NUBUS IRQ_AUTO_3 /* keep this on its own level */
#define OSS_IRQLEV_IOPSCC 4 /* matches VIA alternate mapping */ #define OSS_IRQLEV_IOPSCC IRQ_AUTO_4 /* matches VIA alternate mapping */
#define OSS_IRQLEV_SOUND 5 /* matches VIA alternate mapping */ #define OSS_IRQLEV_SOUND IRQ_AUTO_5 /* matches VIA alternate mapping */
#define OSS_IRQLEV_60HZ 6 /* matches VIA alternate mapping */ #define OSS_IRQLEV_60HZ 6 /* matches VIA alternate mapping */
#define OSS_IRQLEV_VIA1 6 /* matches VIA alternate mapping */ #define OSS_IRQLEV_VIA1 IRQ_AUTO_6 /* matches VIA alternate mapping */
#define OSS_IRQLEV_PARITY 7 /* matches VIA alternate mapping */ #define OSS_IRQLEV_PARITY 7 /* matches VIA alternate mapping */
#ifndef __ASSEMBLY__ #ifndef __ASSEMBLY__
......
...@@ -11,17 +11,7 @@ ...@@ -11,17 +11,7 @@
extern void mac_reset(void); extern void mac_reset(void);
extern void mac_poweroff(void); extern void mac_poweroff(void);
extern void mac_init_IRQ(void); extern void mac_init_IRQ(void);
extern int mac_request_irq (unsigned int, irqreturn_t (*)(int, void *,
struct pt_regs *),
unsigned long, const char *, void *);
extern void mac_free_irq(unsigned int, void *);
extern void mac_enable_irq(unsigned int);
extern void mac_disable_irq(unsigned int);
extern int mac_irq_pending(unsigned int); extern int mac_irq_pending(unsigned int);
extern int show_mac_interrupts(struct seq_file *, void *);
#if 0
extern void mac_default_handler(int irq);
#endif
extern void mac_identify(void); extern void mac_identify(void);
extern void mac_report_hardware(void); extern void mac_report_hardware(void);
extern void mac_debugging_penguin(int); extern void mac_debugging_penguin(int);
......
...@@ -152,7 +152,4 @@ ...@@ -152,7 +152,4 @@
#define INT_CLK 24576 /* CLK while int_clk =2.456MHz and divide = 100 */ #define INT_CLK 24576 /* CLK while int_clk =2.456MHz and divide = 100 */
#define INT_TICKS 246 /* to make sched_time = 99.902... HZ */ #define INT_TICKS 246 /* to make sched_time = 99.902... HZ */
extern irq_node_t *mac_irq_list[NUM_MAC_SOURCES];
extern void mac_do_irq_list(int irq, struct pt_regs *);
#endif /* asm/macints.h */ #endif /* asm/macints.h */
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