]> err.no Git - linux-2.6/blobdiff - arch/powerpc/platforms/cell/interrupt.c
[POWERPC] spu sched: static timeslicing for SCHED_RR contexts
[linux-2.6] / arch / powerpc / platforms / cell / interrupt.c
index a914c12b4060a2072d77a7bfc08e7c18c3265467..6666d037eb443c763fc9413f460f2ef5a275c86d 100644 (file)
@@ -396,3 +396,19 @@ void __init iic_init_IRQ(void)
        /* Enable on current CPU */
        iic_setup_cpu();
 }
+
+void iic_set_interrupt_routing(int cpu, int thread, int priority)
+{
+       struct cbe_iic_regs __iomem *iic_regs = cbe_get_cpu_iic_regs(cpu);
+       u64 iic_ir = 0;
+       int node = cpu >> 1;
+
+       /* Set which node and thread will handle the next interrupt */
+       iic_ir |= CBE_IIC_IR_PRIO(priority) |
+                 CBE_IIC_IR_DEST_NODE(node);
+       if (thread == 0)
+               iic_ir |= CBE_IIC_IR_DEST_UNIT(CBE_IIC_IR_PT_0);
+       else
+               iic_ir |= CBE_IIC_IR_DEST_UNIT(CBE_IIC_IR_PT_1);
+       out_be64(&iic_regs->iic_ir, iic_ir);
+}