mirror of
https://github.com/genodelabs/genode.git
synced 2024-12-21 14:37:50 +00:00
parent
0cf8d75346
commit
828ae3800d
@ -201,9 +201,22 @@ struct Pci_driver
|
||||
using namespace Genode;
|
||||
|
||||
/* trigger that the device gets assigned to this driver */
|
||||
_pci.config_extended(_cap);
|
||||
Ram_dataspace_capability ram_cap;
|
||||
ram_cap = _pci.alloc_dma_buffer(size);
|
||||
for (unsigned i = 0; i < 2; i++) {
|
||||
try {
|
||||
_pci.config_extended(_cap);
|
||||
break;
|
||||
} 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.base = Dataspace_client(ram_cap).phys_addr();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user