mirror of
https://github.com/genodelabs/genode.git
synced 2025-04-09 04:15:52 +00:00
parent
d37d2bd737
commit
4ead4484ec
@ -303,6 +303,9 @@ extern "C" int pci_register_driver(struct pci_driver *drv)
|
||||
pci()->on_destruction(Pci::Connection::KEEP_OPEN);
|
||||
found++;
|
||||
|
||||
} catch (Pci::Device::Quota_exceeded) {
|
||||
Genode::env()->parent()->upgrade(pci()->cap(), "ram_quota=4096");
|
||||
continue;
|
||||
} catch (...) {
|
||||
destroy(env()->heap(), pci_drv);
|
||||
pci_drv = 0;
|
||||
@ -361,7 +364,7 @@ extern "C" void *pci_ioremap_bar(struct pci_dev *dev, int bar)
|
||||
try {
|
||||
io_mem = new (env()->heap()) Io_mem_connection(start, size, 0);
|
||||
} catch (...) {
|
||||
PERR("Failed to request I/O memory: [%zx,%lx)", start, start + size);
|
||||
PERR("Failed to request I/O memory: [%zx,%zx)", start, start + size);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -458,6 +461,11 @@ Lx::backend_alloc(Genode::addr_t size, Genode::Cache_attribute cached)
|
||||
cap = env()->ram_session()->alloc(size);
|
||||
o = new (env()->heap()) Ram_object(cap);
|
||||
} else {
|
||||
/* transfer quota to pci driver, otherwise it will give us a exception */
|
||||
char buf[32];
|
||||
Genode::snprintf(buf, sizeof(buf), "ram_quota=%ld", size);
|
||||
Genode::env()->parent()->upgrade(pci()->cap(), buf);
|
||||
|
||||
cap = pci()->alloc_dma_buffer(size);
|
||||
o = new (env()->heap()) Dma_object(cap);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user