parent
82e35326b7
commit
cec3ca6a70
|
@ -41,9 +41,10 @@ class Platform::Device_pd_policy : public Genode::Slave_policy
|
||||||
|
|
||||||
Device_pd_policy(Genode::Rpc_entrypoint &slave_ep,
|
Device_pd_policy(Genode::Rpc_entrypoint &slave_ep,
|
||||||
Genode::Ram_session_capability ram_ref_cap,
|
Genode::Ram_session_capability ram_ref_cap,
|
||||||
Genode::addr_t device_pd_ram_quota)
|
Genode::addr_t device_pd_ram_quota,
|
||||||
|
const char * label)
|
||||||
:
|
:
|
||||||
Slave_policy("device_pd", slave_ep),
|
Slave_policy(label, slave_ep, nullptr, "device_pd"),
|
||||||
_lock(Genode::Lock::LOCKED),
|
_lock(Genode::Lock::LOCKED),
|
||||||
_ram_ref_cap(ram_ref_cap),
|
_ram_ref_cap(ram_ref_cap),
|
||||||
_device_pd_slave(slave_ep, *this, device_pd_ram_quota, ram_ref_cap)
|
_device_pd_slave(slave_ep, *this, device_pd_ram_quota, ram_ref_cap)
|
||||||
|
|
|
@ -147,6 +147,9 @@ void Platform::Device_pd_component::assign_pci(Genode::Io_mem_dataspace_capabili
|
||||||
PERR("assignment of PCI device %x:%x.%x failed phys=%lx virt=%lx",
|
PERR("assignment of PCI device %x:%x.%x failed phys=%lx virt=%lx",
|
||||||
rid >> 8, (rid >> 3) & 0x1f, rid & 0x7,
|
rid >> 8, (rid >> 3) & 0x1f, rid & 0x7,
|
||||||
ds_client.phys_addr(), page);
|
ds_client.phys_addr(), page);
|
||||||
|
else
|
||||||
|
PINF("assignment of %x:%x.%x succeeded",
|
||||||
|
rid >> 8, (rid >> 3) & 0x1f, rid & 0x7);
|
||||||
|
|
||||||
/* we don't need the mapping anymore */
|
/* we don't need the mapping anymore */
|
||||||
rm_session()->detach(page);
|
rm_session()->detach(page);
|
||||||
|
@ -156,8 +159,6 @@ int main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
using namespace Genode;
|
using namespace Genode;
|
||||||
|
|
||||||
Genode::printf("Device protection domain starting ...\n");
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Initialize server entry point
|
* Initialize server entry point
|
||||||
*/
|
*/
|
||||||
|
@ -177,8 +178,6 @@ int main(int argc, char **argv)
|
||||||
|
|
||||||
env()->parent()->announce(ep.manage(&root));
|
env()->parent()->announce(ep.manage(&root));
|
||||||
|
|
||||||
printf("Device protection domain started\n");
|
|
||||||
|
|
||||||
Genode::sleep_forever();
|
Genode::sleep_forever();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -145,7 +145,8 @@ namespace Platform {
|
||||||
|
|
||||||
Devicepd (Genode::Rpc_entrypoint &ep,
|
Devicepd (Genode::Rpc_entrypoint &ep,
|
||||||
Genode::Allocator_guard &md_alloc,
|
Genode::Allocator_guard &md_alloc,
|
||||||
Genode::Ram_session_capability ram_ref_cap)
|
Genode::Ram_session_capability ram_ref_cap,
|
||||||
|
const char * label)
|
||||||
:
|
:
|
||||||
policy(nullptr),
|
policy(nullptr),
|
||||||
child(Genode::reinterpret_cap_cast<Device_pd>(Genode::Native_capability())),
|
child(Genode::reinterpret_cap_cast<Device_pd>(Genode::Native_capability())),
|
||||||
|
@ -161,7 +162,7 @@ namespace Platform {
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
policy = new (md_alloc) Device_pd_policy(ep, ram_ref_cap, DEVICE_PD_RAM_QUOTA);
|
policy = new (md_alloc) Device_pd_policy(ep, ram_ref_cap, DEVICE_PD_RAM_QUOTA, label);
|
||||||
|
|
||||||
using Genode::Session_capability;
|
using Genode::Session_capability;
|
||||||
using Genode::Affinity;
|
using Genode::Affinity;
|
||||||
|
@ -199,11 +200,11 @@ namespace Platform {
|
||||||
bool valid() { return policy && policy->root().valid() && child.valid(); }
|
bool valid() { return policy && policy->root().valid() && child.valid(); }
|
||||||
};
|
};
|
||||||
|
|
||||||
Genode::Lazy_volatile_object<struct Devicepd> _device_pd;
|
|
||||||
|
|
||||||
Genode::Session_label _label;
|
Genode::Session_label _label;
|
||||||
Genode::Session_policy _policy;
|
Genode::Session_policy _policy;
|
||||||
|
|
||||||
|
Genode::Lazy_volatile_object<struct Devicepd> _device_pd;
|
||||||
|
|
||||||
enum { MAX_PCI_DEVICES = Device_config::MAX_BUSES *
|
enum { MAX_PCI_DEVICES = Device_config::MAX_BUSES *
|
||||||
Device_config::MAX_DEVICES *
|
Device_config::MAX_DEVICES *
|
||||||
Device_config::MAX_FUNCTIONS };
|
Device_config::MAX_FUNCTIONS };
|
||||||
|
@ -745,7 +746,8 @@ namespace Platform {
|
||||||
|
|
||||||
if (!_device_pd.is_constructed())
|
if (!_device_pd.is_constructed())
|
||||||
_device_pd.construct(_device_pd_ep, _md_alloc,
|
_device_pd.construct(_device_pd_ep, _md_alloc,
|
||||||
_resources.ram().cap());
|
_resources.ram().cap(),
|
||||||
|
_label.string());
|
||||||
|
|
||||||
if (!_device_pd->valid())
|
if (!_device_pd->valid())
|
||||||
return;
|
return;
|
||||||
|
@ -772,7 +774,8 @@ namespace Platform {
|
||||||
{
|
{
|
||||||
if (!_device_pd.is_constructed())
|
if (!_device_pd.is_constructed())
|
||||||
_device_pd.construct(_device_pd_ep, _md_alloc,
|
_device_pd.construct(_device_pd_ep, _md_alloc,
|
||||||
_resources.ram().cap());
|
_resources.ram().cap(),
|
||||||
|
_label.string());
|
||||||
|
|
||||||
if (!_md_alloc.withdraw(size))
|
if (!_md_alloc.withdraw(size))
|
||||||
throw Out_of_metadata();
|
throw Out_of_metadata();
|
||||||
|
|
Loading…
Reference in New Issue