dist_addr = Param.Addr(0x1f001000, "Address for distributor")
cpu_addr = Param.Addr(0x1f000100, "Address for cpu")
+ it_lines = Param.UInt32(128, "Number of interrupt lines supported")
system = Param.System(Parent.any,
'System this interrupt controller belongs to')
#include "debug/Interrupt.hh"
#include "params/KvmGic.hh"
-
-KvmKernelGicV2::KvmKernelGicV2(KvmVM &_vm, Addr cpu_addr, Addr dist_addr)
+KvmKernelGicV2::KvmKernelGicV2(KvmVM &_vm, Addr cpu_addr, Addr dist_addr,
+ unsigned it_lines)
: cpuRange(RangeSize(cpu_addr, KVM_VGIC_V2_CPU_SIZE)),
distRange(RangeSize(dist_addr, KVM_VGIC_V2_DIST_SIZE)),
vm(_vm),
KVM_DEV_ARM_VGIC_GRP_ADDR, KVM_VGIC_V2_ADDR_TYPE_DIST, dist_addr);
kdev.setAttr<uint64_t>(
KVM_DEV_ARM_VGIC_GRP_ADDR, KVM_VGIC_V2_ADDR_TYPE_CPU, cpu_addr);
+
+ kdev.setAttr<uint32_t>(KVM_DEV_ARM_VGIC_GRP_NR_IRQS, 0, it_lines);
}
KvmKernelGicV2::~KvmKernelGicV2()
KvmGic::KvmGic(const KvmGicParams *p)
: BaseGic(p),
system(*p->system),
- kernelGic(*p->kvmVM, p->cpu_addr, p->dist_addr),
+ kernelGic(*p->kvmVM, p->cpu_addr, p->dist_addr, p->it_lines),
addrRanges{kernelGic.distRange, kernelGic.cpuRange}
{
}
* @param vm KVM VM representing this system
* @param cpu_addr GIC CPU interface base address
* @param dist_addr GIC distributor base address
+ * @param it_liens Number of interrupt lines to support
*/
- KvmKernelGicV2(KvmVM &vm, Addr cpu_addr, Addr dist_addr);
+ KvmKernelGicV2(KvmVM &vm, Addr cpu_addr, Addr dist_addr,
+ unsigned it_lines);
virtual ~KvmKernelGicV2();
KvmKernelGicV2(const KvmKernelGicV2 &other) = delete;