mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 02:01:24 +01:00
xen/riscv: introduce (de)initialization helpers for vINTC
Add common helpers domain_vintc_init() and domain_vintc_deinit() to allocate and deallocate a virtual interrupt controller (vINTC) structure and initialize basic virtual interrupt controller registers. domain_vintc_deinit() isn't called at the moment as arch_domain_destroy() is implemented as stub at the moment. Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com> Acked-by: Jan Beulich <jbeulich@suse.com>
This commit is contained in:
1 parent
9164a97efb
commit
68ca2185e0
3 files changed
+44
-1
No files matched your search
@@ -291,7 +291,9 @@ int arch_sanitise_domain_config(struct xen_domctl_createdomain *config)
|
||||
|
||||
void arch_domain_destroy(struct domain *d)
|
||||
{
|
||||
printk(XENLOG_WARNING "%s: unimplemented\n", __func__);
|
||||
printk(XENLOG_WARNING "%s: not fully implemented\n", __func__);
|
||||
|
||||
domain_vintc_deinit(d);
|
||||
}
|
||||
|
||||
int arch_domain_create(struct domain *d,
|
||||
@@ -308,6 +310,9 @@ int arch_domain_create(struct domain *d,
|
||||
if ( (rc = p2m_init(d, config)) != 0)
|
||||
goto fail;
|
||||
|
||||
if ( (rc = domain_vintc_init(d)) )
|
||||
goto fail;
|
||||
|
||||
return rc;
|
||||
|
||||
fail:
|
||||
|
||||
@@ -79,4 +79,7 @@ void intc_route_irq_to_xen(struct irq_desc *desc, unsigned int priority);
|
||||
|
||||
void intc_handle_external_irqs(struct cpu_user_regs *regs);
|
||||
|
||||
int domain_vintc_init(struct domain *d);
|
||||
void domain_vintc_deinit(struct domain *d);
|
||||
|
||||
#endif /* ASM__RISCV__INTERRUPT_CONTOLLER_H */
|
||||
@@ -11,6 +11,7 @@
|
||||
|
||||
#include <asm/aia.h>
|
||||
#include <asm/intc.h>
|
||||
#include <asm/vaplic.h>
|
||||
|
||||
static const struct intc_hw_operations *__ro_after_init intc_hw_ops;
|
||||
|
||||
@@ -83,3 +84,37 @@ int __init make_intc_domU_node(struct kernel_info *kinfo)
|
||||
|
||||
return vintc->init_ops->make_domu_dt_node(kinfo);
|
||||
}
|
||||
|
||||
int domain_vintc_init(struct domain *d)
|
||||
{
|
||||
int ret = -EOPNOTSUPP;
|
||||
const enum intc_variant variant = intc_hw_ops->info->hw_variant;
|
||||
|
||||
switch ( variant )
|
||||
{
|
||||
case INTC_APLIC:
|
||||
ret = domain_vaplic_init(d);
|
||||
break;
|
||||
|
||||
default:
|
||||
printk_once("vintc (variant:%d) isn't implemented\n", variant);
|
||||
break;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
void domain_vintc_deinit(struct domain *d)
|
||||
{
|
||||
const enum intc_variant variant = intc_hw_ops->info->hw_variant;
|
||||
|
||||
switch ( variant )
|
||||
{
|
||||
case INTC_APLIC:
|
||||
domain_vaplic_deinit(d);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||