From: Nikhil Devshatwar <[email protected]> Generalize the ivshmem-demo to work on different platforms with different number of peers.
Parse the target interrupt number from command line to allow to launch the demo with capability to select the target interrupt. Default value for target = 0 since root cell is always available. Signed-off-by: Nikhil Devshatwar <[email protected]> --- inmates/demos/ivshmem-demo.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/inmates/demos/ivshmem-demo.c b/inmates/demos/ivshmem-demo.c index e7a7f711..188c8af3 100644 --- a/inmates/demos/ivshmem-demo.c +++ b/inmates/demos/ivshmem-demo.c @@ -36,7 +36,7 @@ static int irq_counter[MAX_VECTORS]; static struct ivshmem_dev_data dev; -static unsigned int irq_base, vectors; +static unsigned int irq_base, vectors, target; struct ivshm_regs { u32 id; @@ -173,7 +173,6 @@ static void init_device(struct ivshmem_dev_data *d) static void send_irq(struct ivshmem_dev_data *d) { u32 int_no = d->msix_cap > 0 ? (d->id + 1) : 0; - u32 target = d->id < 2 ? (d->id + 1) : 0; disable_irqs(); printk("\nIVSHMEM: sending IRQ %d to peer %d\n", int_no, target); @@ -187,6 +186,7 @@ void inmate_main(void) int bdf; irq_base = cmdline_parse_int("irq_base", DEFAULT_IRQ_BASE); + target = cmdline_parse_int("target", 0); irq_init(irq_handler); pci_init(); -- 2.17.1 -- You received this message because you are subscribed to the Google Groups "Jailhouse" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/jailhouse-dev/20200608104255.18358-9-nikhil.nd%40ti.com.
