mirror of
https://github.com/genodelabs/genode.git
synced 2025-04-15 06:57:12 +00:00
platform_drv: move add_range calls from base class
The virtual add_range()-method must not be called from the base-class constructor since the derived class is not be fully initialized at this point. genodelabs/genode#5002
This commit is contained in:
parent
022762605b
commit
d7b9cd0654
repos/os/src/drivers/platform
@ -154,4 +154,7 @@ Device_pd::Device_pd(Env & env,
|
||||
_address_space(env, _pd, ram_guard, cap_guard)
|
||||
{
|
||||
_pd.ref_account(env.pd_session_cap());
|
||||
|
||||
buffer_registry.for_each([&] (Dma_buffer const & buf) {
|
||||
add_range({ buf.dma_addr, buf.size }, buf.cap); });
|
||||
}
|
||||
|
@ -88,15 +88,10 @@ class Driver::Io_mmu : private Io_mmu_devices::Element
|
||||
virtual void remove_range(Range const &) = 0;
|
||||
|
||||
Domain(Io_mmu & io_mmu,
|
||||
Allocator & md_alloc,
|
||||
Registry<Dma_buffer> const & buffer_registry)
|
||||
Allocator & md_alloc)
|
||||
: Registry<Domain>::Element(io_mmu._domains, *this),
|
||||
_io_mmu(io_mmu), _md_alloc(md_alloc)
|
||||
{
|
||||
/* we always need to add existing buffers when creating a new domain */
|
||||
buffer_registry.for_each([&] (Dma_buffer const & buf) {
|
||||
add_range({ buf.dma_addr, buf.size }, buf.cap); });
|
||||
}
|
||||
{ }
|
||||
|
||||
virtual ~Domain() { }
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user