15 #include <linux/module.h>
22 #include <arch/spr_def.h>
23 #include <asm/traps.h>
26 #define IS_HW_CLEARED 1
48 ____cacheline_internodealigned_in_smp;
64 #define mask_irqs(irq_mask) __insn_mtspr(SPR_IPI_MASK_SET_K, irq_mask)
65 #define unmask_irqs(irq_mask) __insn_mtspr(SPR_IPI_MASK_RESET_K, irq_mask)
66 #define clear_irqs(irq_mask) __insn_mtspr(SPR_IPI_EVENT_RESET_K, irq_mask)
69 #define mask_irqs(irq_mask) hv_disable_intr(irq_mask)
70 #define unmask_irqs(irq_mask) hv_enable_intr(irq_mask)
71 #define clear_irqs(irq_mask) hv_clear_intr(irq_mask)
81 unsigned long original_irqs;
82 unsigned long remaining_irqs;
92 unsigned long masked = __insn_mfspr(SPR_IPI_MASK_K);
93 original_irqs = __insn_mfspr(SPR_IPI_EVENT_K) & ~masked;
94 __insn_mtspr(SPR_IPI_MASK_SET_K, original_irqs);
103 remaining_irqs = original_irqs;
106 old_regs = set_irq_regs(regs);
109 #ifdef CONFIG_DEBUG_STACKOVERFLOW
115 "stack overflow: %ld\n",
121 while (remaining_irqs) {
122 unsigned long irq =
__ffs(remaining_irqs);
123 remaining_irqs &= ~(1
UL << irq);
147 set_irq_regs(old_regs);
155 static void tile_irq_chip_enable(
struct irq_data *
d)
169 static void tile_irq_chip_disable(
struct irq_data *d)
177 static void tile_irq_chip_mask(
struct irq_data *d)
183 static void tile_irq_chip_unmask(
struct irq_data *d)
192 static void tile_irq_chip_ack(
struct irq_data *d)
194 if ((
unsigned long)irq_data_get_irq_chip_data(d) !=
IS_HW_CLEARED)
202 static void tile_irq_chip_eoi(
struct irq_data *d)
208 static struct irq_chip tile_irq_chip = {
209 .name =
"tile_irq_chip",
210 .irq_enable = tile_irq_chip_enable,
211 .irq_disable = tile_irq_chip_disable,
212 .irq_ack = tile_irq_chip_ack,
213 .irq_eoi = tile_irq_chip_eoi,
214 .irq_mask = tile_irq_chip_mask,
215 .irq_unmask = tile_irq_chip_unmask,
244 irq_set_chip_and_handler(irq, &tile_irq_chip, handle);
258 pr_err(
"unexpected IRQ trap at vector %02x\n", irq);
272 if (available_irqs == 0)
275 result =
__ffs(available_irqs);
277 dynamic_irq_init(result);
279 spin_unlock_irqrestore(&available_irqs_lock, flags);
290 available_irqs |= (1
UL << irq);
292 spin_unlock_irqrestore(&available_irqs_lock, flags);