int request_bridge_irq(struct bridge_controller *bc)
{
	int irq = allocate_irqno();
	int swlevel, cpu;
	nasid_t nasid;

	if (irq < 0)
		return irq;

	/*
	 * "map" irq to a swlevel greater than 6 since the first 6 bits
	 * of INT_PEND0 are taken
	 */
	cpu = bc->irq_cpu;
	swlevel = alloc_level(cpu, irq);
	if (unlikely(swlevel < 0)) {
		free_irqno(irq);

		return -EAGAIN;
	}

	/* Make sure it's not already pending when we connect it. */
	nasid = COMPACT_TO_NASID_NODEID(cpu_to_node(cpu));
	REMOTE_HUB_CLR_INTR(nasid, swlevel);

	intr_connect_level(cpu, swlevel);

	register_bridge_irq(irq);

	return irq;
}
Example #2
0
static void __init hub_rt_clock_event_global_init(void)
{
	unsigned int irq;

	do {
		smp_wmb();
		irq = rt_timer_irq;
		if (irq)
			break;

		irq = allocate_irqno();
		if (irq < 0)
			panic("Allocation of irq number for timer failed");
	} while (xchg(&rt_timer_irq, irq));

	set_irq_chip_and_handler(irq, &rt_irq_type, handle_percpu_irq);
	setup_irq(irq, &hub_rt_irqaction);
}
Example #3
0
void __init plat_timer_setup(struct irqaction *irq)
{
    int irqno  = allocate_irqno();

    if (irqno < 0)
        panic("Can't allocate interrupt number for timer interrupt");

    set_irq_chip_and_handler(irqno, &rt_irq_type, handle_percpu_irq);

    /* over-write the handler, we use our own way */
    irq->handler = no_action;

    /* setup irqaction */
    irq_desc[irqno].status |= IRQ_PER_CPU;

    rt_timer_irq = irqno;
    /*
     * Only needed to get /proc/interrupt to display timer irq stats
     */
    setup_irq(irqno, &rt_irqaction);
}