aboutsummaryrefslogtreecommitdiffstats
path: root/arch/m68k/mac/baboon.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/m68k/mac/baboon.c')
-rw-r--r--arch/m68k/mac/baboon.c32
1 files changed, 15 insertions, 17 deletions
diff --git a/arch/m68k/mac/baboon.c b/arch/m68k/mac/baboon.c
index a1c7ec706741..673a1085984d 100644
--- a/arch/m68k/mac/baboon.c
+++ b/arch/m68k/mac/baboon.c
@@ -22,7 +22,7 @@
22/* #define DEBUG_BABOON */ 22/* #define DEBUG_BABOON */
23/* #define DEBUG_IRQS */ 23/* #define DEBUG_IRQS */
24 24
25int baboon_present,baboon_active; 25int baboon_present;
26volatile struct baboon *baboon; 26volatile struct baboon *baboon;
27 27
28irqreturn_t baboon_irq(int, void *); 28irqreturn_t baboon_irq(int, void *);
@@ -45,7 +45,6 @@ void __init baboon_init(void)
45 45
46 baboon = (struct baboon *) BABOON_BASE; 46 baboon = (struct baboon *) BABOON_BASE;
47 baboon_present = 1; 47 baboon_present = 1;
48 baboon_active = 0;
49 48
50 printk("Baboon detected at %p\n", baboon); 49 printk("Baboon detected at %p\n", baboon);
51} 50}
@@ -66,26 +65,28 @@ void __init baboon_register_interrupts(void)
66 65
67irqreturn_t baboon_irq(int irq, void *dev_id) 66irqreturn_t baboon_irq(int irq, void *dev_id)
68{ 67{
69 int irq_bit,i; 68 int irq_bit, irq_num;
70 unsigned char events; 69 unsigned char events;
71 70
72#ifdef DEBUG_IRQS 71#ifdef DEBUG_IRQS
73 printk("baboon_irq: mb_control %02X mb_ifr %02X mb_status %02X active %02X\n", 72 printk("baboon_irq: mb_control %02X mb_ifr %02X mb_status %02X\n",
74 (uint) baboon->mb_control, (uint) baboon->mb_ifr, 73 (uint) baboon->mb_control, (uint) baboon->mb_ifr,
75 (uint) baboon->mb_status, baboon_active); 74 (uint) baboon->mb_status);
76#endif 75#endif
77 76
78 if (!(events = baboon->mb_ifr & 0x07)) 77 if (!(events = baboon->mb_ifr & 0x07))
79 return IRQ_NONE; 78 return IRQ_NONE;
80 79
81 for (i = 0, irq_bit = 1 ; i < 3 ; i++, irq_bit <<= 1) { 80 irq_num = IRQ_BABOON_0;
82 if (events & irq_bit/* & baboon_active*/) { 81 irq_bit = 1;
83 baboon_active &= ~irq_bit; 82 do {
84 m68k_handle_int(IRQ_BABOON_0 + i); 83 if (events & irq_bit) {
85 baboon_active |= irq_bit;
86 baboon->mb_ifr &= ~irq_bit; 84 baboon->mb_ifr &= ~irq_bit;
85 m68k_handle_int(irq_num);
87 } 86 }
88 } 87 irq_bit <<= 1;
88 irq_num++;
89 } while(events >= irq_bit);
89#if 0 90#if 0
90 if (baboon->mb_ifr & 0x02) macide_ack_intr(NULL); 91 if (baboon->mb_ifr & 0x02) macide_ack_intr(NULL);
91 /* for now we need to smash all interrupts */ 92 /* for now we need to smash all interrupts */
@@ -95,21 +96,18 @@ irqreturn_t baboon_irq(int irq, void *dev_id)
95} 96}
96 97
97void baboon_irq_enable(int irq) { 98void baboon_irq_enable(int irq) {
98 int irq_idx = IRQ_IDX(irq);
99
100#ifdef DEBUG_IRQUSE 99#ifdef DEBUG_IRQUSE
101 printk("baboon_irq_enable(%d)\n", irq); 100 printk("baboon_irq_enable(%d)\n", irq);
102#endif 101#endif
103 baboon_active |= (1 << irq_idx); 102 /* FIXME: figure out how to mask and unmask baboon interrupt sources */
103 enable_irq(IRQ_NUBUS_C);
104} 104}
105 105
106void baboon_irq_disable(int irq) { 106void baboon_irq_disable(int irq) {
107 int irq_idx = IRQ_IDX(irq);
108
109#ifdef DEBUG_IRQUSE 107#ifdef DEBUG_IRQUSE
110 printk("baboon_irq_disable(%d)\n", irq); 108 printk("baboon_irq_disable(%d)\n", irq);
111#endif 109#endif
112 baboon_active &= ~(1 << irq_idx); 110 disable_irq(IRQ_NUBUS_C);
113} 111}
114 112
115void baboon_irq_clear(int irq) { 113void baboon_irq_clear(int irq) {