-/* Called from second level IRQ regions: eg dino or iosapic. */
-void do_irq_mask(unsigned long mask, struct irq_region *region, struct pt_regs *regs)
-{
- unsigned long bit;
- unsigned int irq;
-
-#ifdef DEBUG_IRQ
- if (mask != (1L<<MAX_CPU_IRQ))
- printk(KERN_DEBUG "do_irq_mask %08lx %p %p\n", mask, region, regs);
-#endif
-
- for (bit = (1L<<MAX_CPU_IRQ), irq = 0; mask && bit; bit>>=1, irq++) {
- unsigned int irq_num;
- if (!(bit&mask))
- continue;
-
- mask &= ~bit; /* clear bit in mask - can exit loop sooner */
- irq_num = region->data.irqbase + irq;
-
- mask_irq(irq_num);
- do_irq(®ion->action[irq], irq_num, regs);
- unmask_irq(irq_num);
- }
-}
-
-
-static inline int find_free_region(void)
-{
- int irqreg;
-
- for (irqreg=1; irqreg <= (NR_IRQ_REGS); irqreg++) {
- if (irq_region[irqreg] == NULL)
- return irqreg;
- }
-
- return 0;
-}
-
-
-/*****
- * alloc_irq_region - allocate/init a new IRQ region
- * @count: number of IRQs in this region.
- * @ops: function table with request/release/mask/unmask/etc.. entries.
- * @name: name of region owner for /proc/interrupts output.
- * @dev: private data to associate with the new IRQ region.
- *
- * Every IRQ must become a MMIO write to the CPU's EIRR in
- * order to get CPU service. The IRQ region represents the
- * number of unique events the region handler can (or must)
- * identify. For PARISC CPU, that's the width of the EIR Register.
- * IRQ regions virtualize IRQs (eg EISA or PCI host bus controllers)
- * for line based devices.
- */
-struct irq_region *alloc_irq_region( int count, struct irq_region_ops *ops,
- const char *name, void *dev)
-{
- struct irq_region *region;
- int index;
-
- index = find_free_region();
- if (index == 0) {
- printk(KERN_ERR "Maximum number of irq regions exceeded. Increase NR_IRQ_REGS!\n");
- return NULL;
- }
-
- if ((IRQ_REGION(count-1)))
- return NULL;
-
- if (count < IRQ_PER_REGION) {
- DBG_IRQ(0, ("alloc_irq_region() using minimum of %d irq lines for %s (%d)\n",
- IRQ_PER_REGION, name, count));
- count = IRQ_PER_REGION;
- }
-
- /* if either mask *or* unmask is set, both have to be set. */
- if((ops->mask_irq || ops->unmask_irq) &&
- !(ops->mask_irq && ops->unmask_irq))
- return NULL;
-
- /* ditto for enable/disable */
- if( (ops->disable_irq || ops->enable_irq) &&
- !(ops->disable_irq && ops->enable_irq) )
- return NULL;
-
- region = kmalloc(sizeof(*region), GFP_ATOMIC);
- if (!region)
- return NULL;
- memset(region, 0, sizeof(*region));
-
- region->action = kmalloc(count * sizeof(*region->action), GFP_ATOMIC);
- if (!region->action) {
- kfree(region);
- return NULL;
- }
- memset(region->action, 0, count * sizeof(*region->action));
-
- region->ops = *ops;
- region->data.irqbase = IRQ_FROM_REGION(index);
- region->data.name = name;
- region->data.dev = dev;
-
- irq_region[index] = region;
-
- return irq_region[index];
-}
-
-/* FIXME: SMP, flags, bottom halves, rest */
-
-int request_irq(unsigned int irq,
- irqreturn_t (*handler)(int, void *, struct pt_regs *),
- unsigned long irqflags,
- const char * devname,
- void *dev_id)
-{
- struct irqaction * action;