Skip to content

Commit

Permalink
xive: Add helper to retrieve an IPI trigger port
Browse files Browse the repository at this point in the history
To be used by such things as VAS

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
  • Loading branch information
ozbenh authored and stewartsmith committed Nov 15, 2016
1 parent 5ca6fcd commit bd4eaed
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
19 changes: 19 additions & 0 deletions hw/xive.c
Original file line number Diff line number Diff line change
Expand Up @@ -1295,6 +1295,25 @@ uint32_t xive_alloc_ipi_irqs(uint32_t chip_id, uint32_t count, uint32_t align)
return base;
}

void *xive_get_trigger_port(uint32_t girq)
{
struct xive *x;
uint32_t idx;

/* Find XIVE on which the IVE resides */
x = xive_from_isn(girq);
if (!x)
return NULL;

/* Make sure it's an IPI on that chip */
if (girq < x->int_base ||
girq >= x->int_ipi_top)
return NULL;

idx = girq - x->int_base;
return x->esb_mmio + idx * 0x20000;
}

uint64_t xive_get_notify_port(uint32_t chip_id, uint32_t ent)
{
struct proc_chip *chip = get_chip(chip_id);
Expand Down
5 changes: 5 additions & 0 deletions include/xive.h
Original file line number Diff line number Diff line change
Expand Up @@ -382,4 +382,9 @@ void xive_register_source(uint32_t base, uint32_t count, uint32_t shift,

void xive_cpu_callin(struct cpu_thread *cpu);

/* Get the trigger page address for an interrupt allocated with
* xive_alloc_ipi_irqs()
*/
void *xive_get_trigger_port(uint32_t girq);

#endif /* __XIVE_H__ */

0 comments on commit bd4eaed

Please sign in to comment.