void
Gicv3::init()
{
- distRange = RangeSize(params()->dist_addr,
- Gicv3Distributor::ADDR_RANGE_SIZE - 1);
- redistRange = RangeSize(params()->redist_addr,
- Gicv3Redistributor::ADDR_RANGE_SIZE * sys->numContexts() - 1);
- addrRanges = {distRange, redistRange};
- BaseGic::init();
distributor = new Gicv3Distributor(this, params()->it_lines);
redistributors.resize(sys->numContexts(), nullptr);
cpuInterfaces.resize(sys->numContexts(), nullptr);
cpuInterfaces[i] = new Gicv3CPUInterface(this, i);
}
+ distRange = RangeSize(params()->dist_addr,
+ Gicv3Distributor::ADDR_RANGE_SIZE - 1);
+
+ redistSize = redistributors[0]->addrRangeSize;
+ redistRange = RangeSize(params()->redist_addr,
+ redistSize * sys->numContexts() - 1);
+
+ addrRanges = {distRange, redistRange};
+
distributor->init();
for (int i = 0; i < sys->numContexts(); i++) {
redistributors[i]->init();
cpuInterfaces[i]->init();
}
+
+ BaseGic::init();
}
void
} else if (redistRange.contains(addr)) {
Addr daddr = addr - redistRange.start();
uint32_t redistributor_id =
- daddr / Gicv3Redistributor::ADDR_RANGE_SIZE;
- daddr = daddr % Gicv3Redistributor::ADDR_RANGE_SIZE;
+ daddr / redistSize;
+ daddr = daddr % redistSize;
panic_if(redistributor_id >= redistributors.size(),
"Invalid redistributor_id!");
panic_if(!redistributors[redistributor_id], "Redistributor is null!");
} else if (redistRange.contains(addr)) {
Addr daddr = addr - redistRange.start();
uint32_t redistributor_id =
- daddr / Gicv3Redistributor::ADDR_RANGE_SIZE;
- daddr = daddr % Gicv3Redistributor::ADDR_RANGE_SIZE;
+ daddr / redistSize;
+ daddr = daddr % redistSize;
panic_if(redistributor_id >= redistributors.size(),
"Invalid redistributor_id!");
panic_if(!redistributors[redistributor_id], "Redistributor is null!");