platform_drv: add RMRR region before assign pci

This commit is contained in:
Alexander Boettcher 2018-06-28 13:47:30 +02:00 committed by Christian Helmuth
parent 82075a340d
commit ed01c57677
2 changed files with 5 additions and 4 deletions

View File

@ -84,8 +84,8 @@ void Platform::Device_pd::assign_pci(Genode::Io_mem_dataspace_capability const i
{
using Genode::print;
using Genode::Hex;
print(out, Hex(v >> 8, Hex::Prefix::OMIT_PREFIX), ":",
Hex((v >> 3) & 0x1f, Hex::Prefix::OMIT_PREFIX), ".",
print(out, Hex((uint8_t)(v >> 8), Hex::Prefix::OMIT_PREFIX, Hex::PAD), ":",
Hex((uint8_t)((v >> 3) & 0x1f), Hex::Prefix::OMIT_PREFIX, Hex::PAD), ".",
Hex(v & 0x7, Hex::Prefix::OMIT_PREFIX));
}
};

View File

@ -777,13 +777,14 @@ class Platform::Session_component : public Genode::Rpc_object<Session>
if (base_ecam + base_offset != device->config_space())
throw 1;
_device_pd.assign_pci(_pciconf.cap(), base_offset, device->config().bdf());
for (Rmrr *r = Rmrr::list()->first(); r; r = r->next()) {
Io_mem_dataspace_capability rmrr_cap = r->match(_env, device->config());
if (rmrr_cap.valid())
_device_pd.attach_dma_mem(rmrr_cap);
}
_device_pd.assign_pci(_pciconf.cap(), base_offset, device->config().bdf());
} catch (...) {
Genode::error("assignment to device pd or of RMRR region failed");
}