sel4: implementation of Rm_client::unmap

This commit is contained in:
Norman Feske 2015-05-17 22:24:47 +02:00 committed by Christian Helmuth
parent da2db02ebd
commit a748dfbc5c
5 changed files with 22 additions and 6 deletions

View File

@ -39,7 +39,7 @@ class Genode::Core_rm_session : public Rm_session
Local_addr local_addr = 0,
bool executable = false) override;
void detach(Local_addr) override { PDBG("not implemented"); }
void detach(Local_addr) override { }
Pager_capability add_client(Thread_capability) override {
return Pager_capability(); }

View File

@ -51,6 +51,8 @@ class Genode::Page_table_registry
addr_t const addr;
static constexpr bool verbose = false;
private:
List<Entry> _entries;
@ -101,7 +103,8 @@ class Genode::Page_table_registry
_entries.remove(&entry);
destroy(entry_slab, &entry);
} catch (Lookup_failed) {
PWRN("trying to remove non-existing page frame for 0x%lx", addr);
if (verbose)
PWRN("trying to remove non-existing page frame for 0x%lx", addr);
}
}
};
@ -148,6 +151,8 @@ class Genode::Page_table_registry
throw Lookup_failed();
}
static constexpr bool verbose = false;
public:
/**
@ -204,7 +209,8 @@ class Genode::Page_table_registry
Page_table &page_table = _lookup(addr);
page_table.remove_entry(_page_table_entry_slab, addr);
} catch (...) {
PDBG("no PT entry found for virtual address 0x%lx", addr);
if (verbose)
PDBG("no PT entry found for virtual address 0x%lx", addr);
}
}
@ -225,7 +231,8 @@ class Genode::Page_table_registry
fn(entry.sel);
} catch (...) {
PDBG("no PT entry found for virtual address 0x%lx", addr);
if (verbose)
PDBG("no PT entry found for virtual address 0x%lx", addr);
}
}
};

View File

@ -101,7 +101,7 @@ class Genode::Platform_pd : public Address_space
** Address-space interface **
*****************************/
void flush(addr_t, size_t) { PDBG("not implemented"); }
void flush(addr_t, size_t);
/*****************************

View File

@ -133,6 +133,12 @@ void Platform_pd::install_mapping(Mapping const &mapping)
}
void Platform_pd::flush(addr_t virt_addr, size_t size)
{
_vm_space.unmap(virt_addr, round_page(size) >> get_page_size_log2());
}
Platform_pd::Platform_pd(Allocator * md_alloc, size_t ram_quota,
char const *, signed pd_id, bool create)
:

View File

@ -19,5 +19,8 @@ using namespace Genode;
void Rm_client::unmap(addr_t core_local_base, addr_t virt_base, size_t size)
{
PDBG("not implemented");
Locked_ptr<Address_space> locked_address_space(_address_space);
if (locked_address_space.is_valid())
locked_address_space->flush(virt_base, size);
}