ARM and x86 use a different hypercall to map an IRQ to a domain.
The hypercall to give IRQ permission to the domain has also been moved
to be an x86 specific function as ARM guest won't be able to manage the IRQ.
We may want to support it later.
Signed-off-by: Julien Grall <julien.grall@linaro.org>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: Wei Liu <wei.liu2@citrix.com>
uint32_t domid,
libxl_domain_build_info *b_info,
libxl__domain_build_state *state);
+
+/* arch specific irq map function */
+int libxl__arch_domain_map_irq(libxl__gc *gc, uint32_t domid, int irq);
+
#endif
return libxl__vnuma_build_vmemrange_pv_generic(gc, domid, info, state);
}
+int libxl__arch_domain_map_irq(libxl__gc *gc, uint32_t domid, int irq)
+{
+ return xc_domain_bind_pt_spi_irq(CTX->xch, domid, irq, irq);
+}
+
/*
* Local variables:
* mode: C
LOG(DEBUG, "dom%d irq %d", domid, irq);
- ret = irq >= 0 ? xc_physdev_map_pirq(CTX->xch, domid, irq, &irq)
+ ret = irq >= 0 ? libxl__arch_domain_map_irq(gc, domid, irq)
: -EOVERFLOW;
- if (!ret)
- ret = xc_domain_irq_permission(CTX->xch, domid, irq, 1);
- if (ret < 0) {
+ if (ret) {
LOGE(ERROR, "failed give dom%d access to irq %d", domid, irq);
ret = ERROR_FAIL;
goto error_out;
return rc;
}
+int libxl__arch_domain_map_irq(libxl__gc *gc, uint32_t domid, int irq)
+{
+ int ret;
+
+ ret = xc_physdev_map_pirq(CTX->xch, domid, irq, &irq);
+ if (ret)
+ return ret;
+
+ ret = xc_domain_irq_permission(CTX->xch, domid, irq, 1);
+
+ return ret;
+}
+
/*
* Local variables:
* mode: C