14 #include <linux/kernel.h>
15 #include <linux/bitops.h>
33 #define get_current_vpe() \
34 ((read_c0_tcbind() >> TCBIND_CURVPE_SHIFT) & TCBIND_CURVPE)
38 #define LOCK_VPE(flags, mtflags) \
40 local_irq_save(flags); \
44 #define UNLOCK_VPE(flags, mtflags) \
47 local_irq_restore(flags);\
50 #define LOCK_CORE(flags, mtflags) \
52 local_irq_save(flags); \
56 #define UNLOCK_CORE(flags, mtflags) \
59 local_irq_restore(flags);\
64 #define LOCK_VPE(flags, mtflags)
65 #define UNLOCK_VPE(flags, mtflags)
69 static inline void cic_wmb(
void)
72 volatile u32 dummy_read;
79 static void unmask_cic_irq(
struct irq_data *
d)
102 static void mask_cic_irq(
struct irq_data *d)
107 unsigned long flags, mtflags;
114 static void msp_cic_irq_ack(
struct irq_data *d)
123 smtc_im_ack_irq(d->
irq);
128 #ifdef CONFIG_MIPS_MT_SMP
129 static int msp_cic_irq_set_affinity(
struct irq_data *d,
134 unsigned int mtflags;
141 LOCK_CORE(flags, mtflags);
145 cic_mask[
cpu] |= imask;
147 cic_mask[
cpu] &= ~imask;
151 UNLOCK_CORE(flags, mtflags);
157 static struct irq_chip msp_cic_irq_controller = {
159 .irq_mask = mask_cic_irq,
160 .irq_mask_ack = msp_cic_irq_ack,
161 .irq_unmask = unmask_cic_irq,
162 .irq_ack = msp_cic_irq_ack,
163 #ifdef CONFIG_MIPS_MT_SMP
164 .irq_set_affinity = msp_cic_irq_set_affinity,
184 irq_set_chip_and_handler(i, &msp_cic_irq_controller,
186 #ifdef CONFIG_MIPS_MT_SMTC
204 pending = cic_status & cic_mask;
211 }
else if (pending) {