static inline void DISABLE_IRQ(void) { if (IS_A_TT()) atari_disable_irq(IRQ_TT_MFP_SCSI); else atari_disable_irq(IRQ_MFP_FSCSI); }
static void atari_shutdown_irq(unsigned int irq) { atari_disable_irq(irq); atari_turnoff_irq(irq); m68k_irq_shutdown(irq); if (irq == IRQ_AUTO_4) vectors[VEC_INT4] = falcon_hblhandler; }
static void atari_irq_shutdown(struct irq_data *data) { unsigned int irq = data->irq; atari_disable_irq(irq); atari_turnoff_irq(irq); m68k_irq_shutdown(data); if (irq == IRQ_AUTO_4) vectors[VEC_INT4] = falcon_hblhandler; }
static void atakeyb_rep( unsigned long ignore ) { kbd_pt_regs = NULL; /* Disable keyboard for the time we call handle_scancode(), else a race * in the keyboard tty queue may happen */ atari_disable_irq( IRQ_MFP_ACIA ); del_timer( &atakeyb_rep_timer ); /* A keyboard int may have come in before we disabled the irq, so * double-check whether rep_scancode is still != 0 */ if (rep_scancode) { atakeyb_rep_timer.expires = jiffies + key_repeat_rate; atakeyb_rep_timer.prev = atakeyb_rep_timer.next = NULL; add_timer( &atakeyb_rep_timer ); handle_scancode(rep_scancode); } atari_enable_irq( IRQ_MFP_ACIA ); }
int atari_remove_isr(unsigned long source, isrfunc isr, void *data) { unsigned long flags; int vector; isr_node_t **p, *q; source &= ~IRQ_MACHSPEC; if (!IS_VALID_INTNO(source)) { printk("atari_remove_isr: Unknown irq %ld\n", source); return 0; } vector = IRQ_SOURCE_TO_VECTOR(source); if (vectors[vector] == bad_interrupt) goto not_found; save_flags(flags); cli(); if (irq_handler[source].isr != atari_call_isr_list) { /* It's the only handler for the interrupt */ if (irq_handler[source].isr != isr && irq_handler[source].data != data) { restore_flags(flags); goto not_found; } irq_handler[source].isr = NULL; irq_handler[source].data = NULL; irq_param[source].name = NULL; vectors[vector] = bad_interrupt; /* If MFP int, also disable it */ atari_disable_irq(source); atari_turnoff_irq(source); restore_flags(flags); return 1; } /* The interrupt is chained, find the isr on the list */ for( p = (isr_node_t **)&irq_handler[source].data; *p; p = &(*p)->next ) { if ((*p)->isr == isr) break; } if (!*p) { restore_flags(flags); goto not_found; } (*p)->isr = NULL; /* Mark it as free for reallocation */ *p = (*p)->next; /* If there's now only one handler, unchain the interrupt, i.e. plug in * the handler directly again and omit atari_call_isr_list */ q = (isr_node_t *)irq_handler[source].data; if (q && !q->next) { irq_handler[source].isr = q->isr; irq_handler[source].data = q->data; irq_param[source].name = q->name; q->isr = NULL; /* Mark it as free for reallocation */ } restore_flags(flags); return 1; not_found: printk("atari_remove_isr: isr %p not found on list!\n", isr); return 0; }
void atari_free_irq(unsigned int irq, void *dev_id) { unsigned long flags; int vector; irq_node_t **list, *node; if (!IS_VALID_INTNO(irq)) { printk("%s: Unknown irq %d\n", __FUNCTION__, irq); return; } vector = IRQ_SOURCE_TO_VECTOR(irq); if (vectors[vector] == bad_interrupt) goto not_found; save_flags(flags); cli(); if (irq_handler[irq].handler != atari_call_irq_list) { /* It's the only handler for the interrupt */ if (irq_handler[irq].dev_id != dev_id) { restore_flags(flags); goto not_found; } irq_handler[irq].handler = NULL; irq_handler[irq].dev_id = NULL; irq_param[irq].devname = NULL; vectors[vector] = bad_interrupt; /* If MFP int, also disable it */ atari_disable_irq(irq); atari_turnoff_irq(irq); restore_flags(flags); return; } /* The interrupt is chained, find the irq on the list */ for(list = (irq_node_t **)&irq_handler[irq].dev_id; *list; list = &(*list)->next) { if ((*list)->dev_id == dev_id) break; } if (!*list) { restore_flags(flags); goto not_found; } (*list)->handler = NULL; /* Mark it as free for reallocation */ *list = (*list)->next; /* If there's now only one handler, unchain the interrupt, i.e. plug in * the handler directly again and omit atari_call_irq_list */ node = (irq_node_t *)irq_handler[irq].dev_id; if (node && !node->next) { irq_handler[irq].handler = node->handler; irq_handler[irq].dev_id = node->dev_id; irq_param[irq].devname = node->devname; node->handler = NULL; /* Mark it as free for reallocation */ } restore_flags(flags); return; not_found: printk("%s: tried to remove invalid irq\n", __FUNCTION__); return; }
static void atari_irq_disable(struct irq_data *data) { atari_disable_irq(data->irq); }