示例#1
0
inline unsigned long sun4m_get_irqmask(unsigned int irq)
{
	unsigned long mask;
    
	if (irq > 0x20) {
		/* OBIO/SBUS interrupts */
		irq &= 0x1f;
		mask = irq_mask[irq_xlate[irq]];
		if (!mask)
			printk("sun4m_get_irqmask: IRQ%d has no valid mask!\n",irq);
	} else {
		/* Soft Interrupts will come here.
		 * Currently there is no way to trigger them but I'm sure
		 * something could be cooked up.
		 */
		irq &= 0xf;
		mask = SUN4M_SOFT_INT(irq);
	}
	return mask;
}
static void sun4m_clear_ipi(int cpu, int level)
{
    sbus_writel(SUN4M_SOFT_INT(level), &sun4m_irq_percpu[cpu]->clear);
}
static void sun4m_send_ipi(int cpu, int level)
{
    sbus_writel(SUN4M_SOFT_INT(level), &sun4m_irq_percpu[cpu]->set);
}
#define SUN4M_INT_SBUS(x)	(1 << (x+7))
#define SUN4M_INT_VME(x)	(1 << (x))

/* Interrupt levels used by OBP */
#define	OBP_INT_LEVEL_SOFT	0x10
#define	OBP_INT_LEVEL_ONBOARD	0x20
#define	OBP_INT_LEVEL_SBUS	0x30
#define	OBP_INT_LEVEL_VME	0x40

#define SUN4M_TIMER_IRQ         (OBP_INT_LEVEL_ONBOARD | 10)
#define SUN4M_PROFILE_IRQ       (OBP_INT_LEVEL_ONBOARD | 14)

static unsigned long sun4m_imask[0x50] = {
    /* 0x00 - SMP */
    0,  SUN4M_SOFT_INT(1),
    SUN4M_SOFT_INT(2),  SUN4M_SOFT_INT(3),
    SUN4M_SOFT_INT(4),  SUN4M_SOFT_INT(5),
    SUN4M_SOFT_INT(6),  SUN4M_SOFT_INT(7),
    SUN4M_SOFT_INT(8),  SUN4M_SOFT_INT(9),
    SUN4M_SOFT_INT(10), SUN4M_SOFT_INT(11),
    SUN4M_SOFT_INT(12), SUN4M_SOFT_INT(13),
    SUN4M_SOFT_INT(14), SUN4M_SOFT_INT(15),
    /* 0x10 - soft */
    0,  SUN4M_SOFT_INT(1),
    SUN4M_SOFT_INT(2),  SUN4M_SOFT_INT(3),
    SUN4M_SOFT_INT(4),  SUN4M_SOFT_INT(5),
    SUN4M_SOFT_INT(6),  SUN4M_SOFT_INT(7),
    SUN4M_SOFT_INT(8),  SUN4M_SOFT_INT(9),
    SUN4M_SOFT_INT(10), SUN4M_SOFT_INT(11),
    SUN4M_SOFT_INT(12), SUN4M_SOFT_INT(13),