Пример #1
0
int request_irq(unsigned int irq, void (*handler)(int, void *, struct pt_regs *),
                unsigned long flags, const char *devname, void *dev_id)
{
	if (irq & IRQ_MACHSPEC)
		return mach_request_irq(IRQ_IDX(irq), handler, flags, devname, dev_id);

	if (irq < IRQ1 || irq > IRQ7) {
		printk("%s: Incorrect IRQ %d from %s\n", __FUNCTION__, irq, devname);
		return -ENXIO;
	}

	if (!(irq_list[irq].flags & IRQ_FLG_STD)) {
		if (irq_list[irq].flags & IRQ_FLG_LOCK) {
			printk("%s: IRQ %d from %s is not replaceable\n",
			       __FUNCTION__, irq, irq_list[irq].devname);
			return -EBUSY;
		}
		if (flags & IRQ_FLG_REPLACE) {
			printk("%s: %s can't replace IRQ %d from %s\n",
			       __FUNCTION__, devname, irq, irq_list[irq].devname);
			return -EBUSY;
		}
	}
	irq_list[irq].handler = handler;
	irq_list[irq].flags   = flags;
	irq_list[irq].dev_id  = dev_id;
	irq_list[irq].devname = devname;
	return 0;
}
Пример #2
0
int request_irq(unsigned int irq, void (*handler)(int, void *, struct pt_regs *),
                unsigned long flags, const char *devname, void *dev_id)
{
    if ((irq & IRQ_MACHSPEC) && mach_request_irq) {
        return mach_request_irq(IRQ_IDX(irq), handler, flags,
                                devname, dev_id);
    }

    if (irq < 0 || irq >= NR_IRQS) {
        printk("%s: Incorrect IRQ %d from %s\n", __FUNCTION__,
               irq, devname);
        return -ENXIO;
    }

    if (!(vec_list[irq].flags & IRQ_FLG_STD)) {
        if (vec_list[irq].flags & IRQ_FLG_LOCK) {
            printk("%s: IRQ %d from %s is not replaceable\n",
                   __FUNCTION__, irq, vec_list[irq].devname);
            return -EBUSY;
        }
        if (flags & IRQ_FLG_REPLACE) {
            printk("%s: %s can't replace IRQ %d from %s\n",
                   __FUNCTION__, devname, irq, vec_list[irq].devname);
            return -EBUSY;
        }
    }

    if (flags & IRQ_FLG_FAST) {
        extern asmlinkage void fasthandler(void);
        extern void set_evector(int vecnum, void (*handler)(void));
        set_evector(irq, fasthandler);
    }

    vec_list[irq].handler = handler;
    vec_list[irq].flags   = flags;
    vec_list[irq].dev_id  = dev_id;
    vec_list[irq].devname = devname;
    return 0;
}
Пример #3
0
/*
 * We will keep these functions until I have convinced Linus to move
 * the declaration of them from include/linux/sched.h to
 * include/asm/irq.h.
 */
int request_irq(unsigned int irq,
                void (*handler) (int, void *, struct pt_regs *),
                unsigned long flags, const char *devname, void *dev_id)
{
    return mach_request_irq(irq, handler, flags, devname, dev_id);
}