Exemplo n.º 1
0
unsigned char cia_able_irq(unsigned int irq, int enable)
{
	struct ciabase *base;
	unsigned char mask;

	if (irq >= IRQ_AMIGA_CIAB)
		mask = (1 << (irq - IRQ_AMIGA_CIAB));
	else
		mask = (1 << (irq - IRQ_AMIGA_CIAA));
	mask |= (enable) ? CIA_ICR_SETCLR : 0;

	CIA_SET_BASE_ADJUST_IRQ(base, irq);

	return cia_able_irq_private(base, mask);
}
Exemplo n.º 2
0
void cia_free_irq(unsigned int irq, void *dev_id)
{
	struct ciabase *base;

	CIA_SET_BASE_ADJUST_IRQ(base, irq);

	if (base->irq_list[irq].dev_id != dev_id)
		printk("%s: removing probably wrong IRQ %i from %s\n",
		       __FUNCTION__, base->cia_irq + irq,
		       base->irq_list[irq].devname);

	base->irq_list[irq].handler = NULL;
	base->irq_list[irq].flags   = 0;

	cia_able_irq_private(base, 1 << irq);
}
Exemplo n.º 3
0
void __init cia_init_IRQ(struct ciabase *base)
{
	extern struct irqaction amiga_sys_irqaction[AUTO_IRQS];
	struct irqaction *action;

	/* clear any pending interrupt and turn off all interrupts */
	cia_set_irq_private(base, CIA_ICR_ALL);
	cia_able_irq_private(base, CIA_ICR_ALL);

	/* install CIA handler */
	action = &amiga_sys_irqaction[base->handler_irq-IRQ_AMIGA_AUTO];
	action->handler = cia_handler;
	action->dev_id = base;
	action->name = base->name;
	setup_irq(base->handler_irq, &amiga_sys_irqaction[base->handler_irq-IRQ_AMIGA_AUTO]);

	amiga_custom.intena = IF_SETCLR | base->int_mask;
}
Exemplo n.º 4
0
void __init cia_init_IRQ(struct ciabase *base)
{
	int i;

	/* init isr handlers */
	for (i = 0; i < CIA_IRQS; i++) {
		base->irq_list[i].handler = NULL;
		base->irq_list[i].flags   = 0;
	}

	/* clear any pending interrupt and turn off all interrupts */
	cia_set_irq_private(base, CIA_ICR_ALL);
	cia_able_irq_private(base, CIA_ICR_ALL);

	/* install CIA handler */
	request_irq(base->handler_irq, cia_handler, 0, base->name, base);

	custom.intena = IF_SETCLR | base->int_mask;
}
Exemplo n.º 5
0
int cia_request_irq(unsigned int irq,
                    void (*handler)(int, void *, struct pt_regs *),
                    unsigned long flags, const char *devname, void *dev_id)
{
	u_char mask;
	struct ciabase *base;

	CIA_SET_BASE_ADJUST_IRQ(base, irq);

	base->irq_list[irq].handler = handler;
	base->irq_list[irq].flags   = flags;
	base->irq_list[irq].dev_id  = dev_id;
	base->irq_list[irq].devname = devname;

	/* enable the interrupt */
	mask = 1 << irq;
	cia_set_irq_private(base, mask);
	cia_able_irq_private(base, CIA_ICR_SETCLR | mask);
	return 0;
}