Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 279839
b: refs/heads/master
c: 1558368
h: refs/heads/master
i:
  279837: a03e94b
  279835: a793a0d
  279831: 6a31b41
  279823: 948e4be
  279807: 4dbbc53
v: v3
  • Loading branch information
Jamie Iles authored and Marc Zyngier committed Nov 15, 2011
1 parent cb89549 commit bbc932a
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f9b28ccbc7139af656147dcbba9c5425d5706b7d
refs/heads/master: 1558368eb5d67a41d4199db32d3f5858660b44cf
38 changes: 38 additions & 0 deletions trunk/arch/arm/common/vic.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
#include <linux/device.h>
#include <linux/amba/bus.h>

#include <asm/exception.h>
#include <asm/mach/irq.h>
#include <asm/hardware/vic.h>

Expand Down Expand Up @@ -428,3 +429,40 @@ int __init vic_of_init(struct device_node *node, struct device_node *parent)
return -EIO;
}
#endif /* CONFIG OF */

#ifdef CONFIG_MULTI_IRQ_HANDLER
/*
* Handle each interrupt in a single VIC. Returns non-zero if we've
* handled at least one interrupt. This does a single read of the
* status register and handles all interrupts in order from LSB first.
*/
static int handle_one_vic(struct vic_device *vic, struct pt_regs *regs)
{
u32 stat, irq;
int handled = 0;

stat = readl_relaxed(vic->base + VIC_IRQ_STATUS);
while (stat) {
irq = ffs(stat) - 1;
handle_IRQ(irq_domain_to_irq(&vic->domain, irq), regs);
stat &= ~(1 << irq);
handled = 1;
}

return handled;
}

/*
* Keep iterating over all registered VIC's until there are no pending
* interrupts.
*/
asmlinkage void __exception_irq_entry vic_handle_irq(struct pt_regs *regs)
{
int i, handled;

do {
for (i = 0, handled = 0; i < vic_id; ++i)
handled |= handle_one_vic(&vic_devices[i], regs);
} while (handled);
}
#endif /* CONFIG_MULTI_IRQ_HANDLER */
3 changes: 3 additions & 0 deletions trunk/arch/arm/include/asm/hardware/vic.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,11 @@
#include <linux/types.h>

struct device_node;
struct pt_regs;

void vic_init(void __iomem *base, unsigned int irq_start, u32 vic_sources, u32 resume_sources);
int vic_of_init(struct device_node *node, struct device_node *parent);
void vic_handle_irq(struct pt_regs *regs);

#endif /* __ASSEMBLY__ */
#endif

0 comments on commit bbc932a

Please sign in to comment.