Ejemplo n.º 1
0
int bvme6000_request_irq(unsigned int irq,
		irqreturn_t (*handler)(int, void *, struct pt_regs *),
                unsigned long flags, const char *devname, void *dev_id)
{
	if (irq > 255) {
		printk("%s: Incorrect IRQ %d from %s\n", __FUNCTION__, irq, devname);
		return -ENXIO;
	}
#if 0
	/* Nothing special about auto-vectored devices for the BVME6000,
	 * but treat it specially to avoid changes elsewhere.
	 */

	if (irq >= VEC_INT1 && irq <= VEC_INT7)
		return cpu_request_irq(irq - VEC_SPUR, handler, flags,
						devname, dev_id);
#endif
	if (!(irq_tab[irq].flags & IRQ_FLG_STD)) {
		if (irq_tab[irq].flags & IRQ_FLG_LOCK) {
			printk("%s: IRQ %d from %s is not replaceable\n",
			       __FUNCTION__, irq, irq_tab[irq].devname);
			return -EBUSY;
		}
		if (flags & IRQ_FLG_REPLACE) {
			printk("%s: %s can't replace IRQ %d from %s\n",
			       __FUNCTION__, devname, irq, irq_tab[irq].devname);
			return -EBUSY;
		}
	}
	irq_tab[irq].handler = handler;
	irq_tab[irq].flags   = flags;
	irq_tab[irq].dev_id  = dev_id;
	irq_tab[irq].devname = devname;
	return 0;
}
Ejemplo n.º 2
0
void __init via_register_interrupts(void)
{
	if (via_alt_mapping) {
		cpu_request_irq(IRQ_AUTO_1, via1_irq,
				IRQ_FLG_LOCK|IRQ_FLG_FAST, "software",
				(void *) via1);
		cpu_request_irq(IRQ_AUTO_6, via1_irq,
				IRQ_FLG_LOCK|IRQ_FLG_FAST, "via1",
				(void *) via1);
	} else {
		cpu_request_irq(IRQ_AUTO_1, via1_irq,
				IRQ_FLG_LOCK|IRQ_FLG_FAST, "via1",
				(void *) via1);
#if 0 /* interferes with serial on some machines */
		if (!psc_present) {
			cpu_request_irq(IRQ_AUTO_6, mac_bang, IRQ_FLG_LOCK,
					"Off Switch", mac_bang);
		}
#endif
	}
	cpu_request_irq(IRQ_AUTO_2, via2_irq, IRQ_FLG_LOCK|IRQ_FLG_FAST,
			"via2", (void *) via2);
	if (!psc_present) {
		cpu_request_irq(IRQ_AUTO_4, mac_scc_dispatch, IRQ_FLG_LOCK,
				"scc", mac_scc_dispatch);
	}
	request_irq(IRQ_MAC_NUBUS, via_nubus_irq, IRQ_FLG_LOCK|IRQ_FLG_FAST,
			"nubus", (void *) via2);
}
Ejemplo n.º 3
0
void mac_init_IRQ(void)
{
        int i;

#ifdef DEBUG_MACINTS
	printk("mac_init_IRQ(): Setting things up...\n");
#endif
	/* Initialize the IRQ handler lists. Initially each list is empty, */

	for (i = 0; i < NUM_MAC_SOURCES; i++) {
		mac_irq_list[i] = NULL;
	}

	scc_mask = 0;

	/* Make sure the SONIC interrupt is cleared or things get ugly */
#ifdef SHUTUP_SONIC
	printk("Killing onboard sonic... ");
	/* This address should hopefully be mapped already */
	if (hwreg_present((void*)(0x50f0a000))) {
		*(long *)(0x50f0a014) = 0x7fffL;
		*(long *)(0x50f0a010) = 0L;
	}
	printk("Done.\n");
#endif /* SHUTUP_SONIC */

	/*
	 * Now register the handlers for the master IRQ handlers
	 * at levels 1-7. Most of the work is done elsewhere.
	 */

	if (oss_present) {
		oss_register_interrupts();
	} else {
		via_register_interrupts();
	}
	if (psc_present) psc_register_interrupts();
	if (baboon_present) baboon_register_interrupts();
	iop_register_interrupts();
	cpu_request_irq(7, mac_nmi_handler, IRQ_FLG_LOCK, "NMI",
			mac_nmi_handler);
#ifdef DEBUG_MACINTS
	printk("mac_init_IRQ(): Done!\n");
#endif
}
Ejemplo n.º 4
0
void sun3_init_IRQ(void)
{
	int i;

	*sun3_intreg = 1;

	for(i = 0; i < SYS_IRQS; i++)
	{
		if(dev_names[i])
			cpu_request_irq(i, sun3_default_handler[i], 0,
					dev_names[i], NULL);
	}

	for(i = 0; i < 192; i++)
		sun3_vechandler[i] = NULL;

	sun3_vechandler[191] = sun3_vec255;
}
Ejemplo n.º 5
0
int sun3_request_irq(unsigned int irq, irqreturn_t (*handler)(int, void *, struct pt_regs *),
                      unsigned long flags, const char *devname, void *dev_id)
{

	if(irq < SYS_IRQS) {
		if(sun3_inthandler[irq] != NULL) {
			printk("sun3_request_irq: request for irq %d -- already taken!\n", irq);
			return 1;
		}

		sun3_inthandler[irq] = handler;
		dev_ids[irq] = dev_id;
		dev_names[irq] = devname;

		/* setting devname would be nice */
		cpu_request_irq(irq, sun3_default_handler[irq], 0, devname,
				NULL);

		return 0;
	} else {
		if((irq >= 64) && (irq <= 255)) {
		        int vec;

			vec = irq - 64;
			if(sun3_vechandler[vec] != NULL) {
				printk("sun3_request_irq: request for vec %d -- already taken!\n", irq);
				return 1;
			}

			sun3_vechandler[vec] = handler;
			vec_ids[vec] = dev_id;
			vec_names[vec] = devname;
			vec_ints[vec] = 0;

			return 0;
		}
	}

	printk("sun3_request_irq: invalid irq %d\n", irq);
	return 1;

}
Ejemplo n.º 6
0
Archivo: irq.c Proyecto: bietje/etaos
/**
 * @brief Request an IRQ.
 * @param irq IRQ vector which is to be requested.
 * @param vector IRQ handler.
 * @param flags IRQ flags.
 * @param priv Private IRQ data.
 */
int irq_request(int irq, irq_vector_t vector, unsigned long flags,
		void *priv)
{
	struct irq_data *data;
	int err;

#ifdef CONFIG_IRQ_THREAD
	struct irq_thread_data *idata;
	if(test_bit(IRQ_THREADED_FLAG, &flags)) {
		idata = kzalloc(sizeof(*data));
		if(!idata)
			return -ENOMEM;

		data = &idata->idata;
		err = irq_request_threaded_irq(idata);
		if(err) {
			kfree(idata);
			return err;
		}
	} else {
		data = kzalloc(sizeof(*data));
	}
#else
	data = kzalloc(sizeof(*data));
#endif

	if(!data)
		return -ENOMEM;

	data->irq = irq;
	data->handler = vector;
	data->flags = flags;
	data->private_data = priv;
	data->chip = arch_get_irq_chip();
	err = irq_chip_add_irq(data->chip, data);
	irq_store_data(irq, data);
	cpu_request_irq(data);

	set_bit(IRQ_ENABLE_FLAG, &data->flags);
	return err;
}
Ejemplo n.º 7
0
int mac_request_irq(unsigned int irq,
		    irqreturn_t (*handler)(int, void *, struct pt_regs *),
		    unsigned long flags, const char *devname, void *dev_id)
{
	irq_node_t *node;

#ifdef DEBUG_MACINTS
	printk ("%s: irq %d requested for %s\n", __FUNCTION__, irq, devname);
#endif

	if (irq < VIA1_SOURCE_BASE) {
		return cpu_request_irq(irq, handler, flags, devname, dev_id);
	}

	if (irq >= NUM_MAC_SOURCES) {
		printk ("%s: unknown irq %d requested by %s\n",
		        __FUNCTION__, irq, devname);
	}

	/* Get a node and stick it onto the right list */

	if (!(node = new_irq_node())) return -ENOMEM;

	node->handler	= handler;
	node->flags	= flags;
	node->dev_id	= dev_id;
	node->devname	= devname;
	node->next	= NULL;
	mac_insert_irq(&mac_irq_list[irq], node);

	/* Now enable the IRQ source */

	mac_enable_irq(irq);

	return 0;
}