Adapt low-level components to new parent interface

This patch adjusts the components of the os repository as well as device
drivers to the new parent interface.

Issue #2120
This commit is contained in:
Norman Feske
2016-11-06 14:27:26 +01:00
committed by Christian Helmuth
parent cfdbccc5c2
commit 8bafb9d41b
50 changed files with 1764 additions and 1964 deletions

View File

@ -135,10 +135,7 @@ class Pci_driver : public Bsd::Bus_driver
return Genode::retry<Platform::Session::Out_of_metadata>(
[&] () { return _pci.alloc_dma_buffer(size); },
[&] () {
char quota[32];
Genode::snprintf(quota, sizeof(quota), "ram_quota=%zd",
donate);
_env.parent().upgrade(_pci.cap(), quota);
_pci.upgrade_ram(donate);
donate = donate * 2 > size ? 4096 : donate * 2;
});
}
@ -161,9 +158,7 @@ class Pci_driver : public Bsd::Bus_driver
int probe()
{
char buf[32];
Genode::snprintf(buf, sizeof(buf), "ram_quota=%u", 8192U);
_env.parent().upgrade(_pci.cap(), buf);
_pci.upgrade_ram(8*1024);
/*
* We hide ourself in the bus_dma_tag_t as well as
@ -404,10 +399,7 @@ extern "C" int pci_mapreg_map(struct pci_attach_args *pa,
[&] () { device.config_write(Pci_driver::CMD, cmd,
Platform::Device::ACCESS_16BIT); },
[&] () {
char quota[32];
Genode::snprintf(quota, sizeof(quota), "ram_quota=%ld",
donate);
drv->env().parent().upgrade(drv->pci().cap(), quota);
drv->pci().upgrade_ram(donate);
donate *= 2;
});