Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 91614
b: refs/heads/master
c: 1af9fa8
h: refs/heads/master
v: v3
  • Loading branch information
Michael Ellerman authored and Paul Mackerras committed Apr 18, 2008
1 parent d5ca9a3 commit 41b9b72
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 28 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f01567d6d5688f8f613cd23da31aaf02d9538525
refs/heads/master: 1af9fa8994a049359c2bb9093a2f33775e28e7ea
39 changes: 12 additions & 27 deletions trunk/arch/powerpc/platforms/pseries/xics.c
Original file line number Diff line number Diff line change
Expand Up @@ -516,6 +516,8 @@ static struct irq_chip xics_pic_lpar = {
.set_affinity = xics_set_affinity
};

/* Points to the irq_chip we're actually using */
static struct irq_chip *xics_irq_chip;

static int xics_host_match(struct irq_host *h, struct device_node *node)
{
Expand All @@ -526,23 +528,13 @@ static int xics_host_match(struct irq_host *h, struct device_node *node)
return !of_device_is_compatible(node, "chrp,iic");
}

static int xics_host_map_direct(struct irq_host *h, unsigned int virq,
irq_hw_number_t hw)
static int xics_host_map(struct irq_host *h, unsigned int virq,
irq_hw_number_t hw)
{
pr_debug("xics: map_direct virq %d, hwirq 0x%lx\n", virq, hw);
pr_debug("xics: map virq %d, hwirq 0x%lx\n", virq, hw);

get_irq_desc(virq)->status |= IRQ_LEVEL;
set_irq_chip_and_handler(virq, &xics_pic_direct, handle_fasteoi_irq);
return 0;
}

static int xics_host_map_lpar(struct irq_host *h, unsigned int virq,
irq_hw_number_t hw)
{
pr_debug("xics: map_direct virq %d, hwirq 0x%lx\n", virq, hw);

get_irq_desc(virq)->status |= IRQ_LEVEL;
set_irq_chip_and_handler(virq, &xics_pic_lpar, handle_fasteoi_irq);
set_irq_chip_and_handler(virq, xics_irq_chip, handle_fasteoi_irq);
return 0;
}

Expand All @@ -561,27 +553,20 @@ static int xics_host_xlate(struct irq_host *h, struct device_node *ct,
return 0;
}

static struct irq_host_ops xics_host_direct_ops = {
static struct irq_host_ops xics_host_ops = {
.match = xics_host_match,
.map = xics_host_map_direct,
.xlate = xics_host_xlate,
};

static struct irq_host_ops xics_host_lpar_ops = {
.match = xics_host_match,
.map = xics_host_map_lpar,
.map = xics_host_map,
.xlate = xics_host_xlate,
};

static void __init xics_init_host(void)
{
struct irq_host_ops *ops;

if (firmware_has_feature(FW_FEATURE_LPAR))
ops = &xics_host_lpar_ops;
xics_irq_chip = &xics_pic_lpar;
else
ops = &xics_host_direct_ops;
xics_host = irq_alloc_host(NULL, IRQ_HOST_MAP_TREE, 0, ops,
xics_irq_chip = &xics_pic_direct;

xics_host = irq_alloc_host(NULL, IRQ_HOST_MAP_TREE, 0, &xics_host_ops,
XICS_IRQ_SPURIOUS);
BUG_ON(xics_host == NULL);
irq_set_default_host(xics_host);
Expand Down

0 comments on commit 41b9b72

Please sign in to comment.