mirror of
https://github.com/genodelabs/genode.git
synced 2024-12-23 15:32:25 +00:00
os: extend ARM Platform::Device constructor
Enable construction by explicitely naming a specific device, if more than one device of the same type exist. Ref #4297
This commit is contained in:
parent
8679f32d0b
commit
98400a68c9
@ -70,6 +70,11 @@ class Platform::Device : Interface, Noncopyable
|
||||
_platform(platform), _cap(platform.device_by_type(type.name.string()))
|
||||
{ }
|
||||
|
||||
Device(Connection &platform, Name name)
|
||||
:
|
||||
_platform(platform), _cap(platform.acquire_device(name))
|
||||
{ }
|
||||
|
||||
~Device() { _platform.release_device(_cap); }
|
||||
};
|
||||
|
||||
|
@ -35,7 +35,8 @@ struct Virtio_mmio_nic::Main
|
||||
Env & env;
|
||||
Heap heap { env.ram(), env.rm() };
|
||||
Platform::Connection platform { env };
|
||||
Platform::Device platform_device { platform, { "nic" } };
|
||||
Platform::Device platform_device { platform,
|
||||
Platform::Device::Type { "nic" } };
|
||||
Virtio::Device device { platform_device };
|
||||
Attached_rom_dataspace config_rom { env, "config" };
|
||||
Constructible<Virtio_nic::Root> root { };
|
||||
|
Loading…
Reference in New Issue
Block a user