parent
0cf8d75346
commit
828ae3800d
|
@ -201,9 +201,22 @@ struct Pci_driver
|
||||||
using namespace Genode;
|
using namespace Genode;
|
||||||
|
|
||||||
/* trigger that the device gets assigned to this driver */
|
/* trigger that the device gets assigned to this driver */
|
||||||
|
for (unsigned i = 0; i < 2; i++) {
|
||||||
|
try {
|
||||||
_pci.config_extended(_cap);
|
_pci.config_extended(_cap);
|
||||||
Ram_dataspace_capability ram_cap;
|
break;
|
||||||
ram_cap = _pci.alloc_dma_buffer(size);
|
} catch (Pci::Device::Quota_exceeded) {
|
||||||
|
Genode::env()->parent()->upgrade(_pci.cap(), "ram_quota=4096");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* transfer quota to pci driver, otherwise it will give us a exception */
|
||||||
|
char buf[32];
|
||||||
|
Genode::snprintf(buf, sizeof(buf), "ram_quota=%zd", size);
|
||||||
|
Genode::env()->parent()->upgrade(_pci.cap(), buf);
|
||||||
|
|
||||||
|
Ram_dataspace_capability ram_cap = _pci.alloc_dma_buffer(size);
|
||||||
|
|
||||||
_region.mapped_base = (Genode::addr_t)env()->rm_session()->attach(ram_cap);
|
_region.mapped_base = (Genode::addr_t)env()->rm_session()->attach(ram_cap);
|
||||||
_region.base = Dataspace_client(ram_cap).phys_addr();
|
_region.base = Dataspace_client(ram_cap).phys_addr();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue