base: extend core_mem_alloc free by phys_addr

required by base-sel4 to turn used page frames back to untyped memory

Issue #2044
This commit is contained in:
Alexander Boettcher 2016-07-15 11:05:09 +02:00 committed by Christian Helmuth
parent 7501910c99
commit b5ff552460
6 changed files with 11 additions and 6 deletions

View File

@ -231,5 +231,6 @@ bool Mapped_mem_allocator::_map_local(addr_t virt_addr, addr_t phys_addr,
return ::map_local(phys_addr, virt_addr, size / get_page_size()); }
bool Mapped_mem_allocator::_unmap_local(addr_t virt_addr, unsigned size) {
bool Mapped_mem_allocator::_unmap_local(addr_t virt_addr, addr_t phys_addr,
unsigned size) {
return ::unmap_local(virt_addr, size / get_page_size()); }

View File

@ -772,7 +772,8 @@ bool Mapped_mem_allocator::_map_local(addr_t virt_addr, addr_t phys_addr,
}
bool Mapped_mem_allocator::_unmap_local(addr_t virt_addr, unsigned size)
bool Mapped_mem_allocator::_unmap_local(addr_t virt_addr, addr_t phys_addr,
unsigned size)
{
unmap_local((Utcb *)Thread::myself()->utcb(),
virt_addr, size / get_page_size());

View File

@ -62,7 +62,8 @@ bool Mapped_mem_allocator::_map_local(addr_t virt_addr, addr_t phys_addr,
return map_local(phys_addr, virt_addr, size / get_page_size()); }
bool Mapped_mem_allocator::_unmap_local(addr_t virt_addr, unsigned size) {
bool Mapped_mem_allocator::_unmap_local(addr_t virt_addr, addr_t phys_addr,
unsigned size) {
return unmap_local(virt_addr, size / get_page_size()); }

View File

@ -72,7 +72,8 @@ bool Mapped_mem_allocator::_map_local(addr_t virt_addr, addr_t phys_addr,
}
bool Mapped_mem_allocator::_unmap_local(addr_t virt_addr, unsigned size)
bool Mapped_mem_allocator::_unmap_local(addr_t virt_addr, addr_t phys_addr,
unsigned size)
{
return unmap_local(virt_addr, size / get_page_size());
}

View File

@ -83,7 +83,7 @@ void Mapped_mem_allocator::free(void *addr, size_t size)
Block *b = static_cast<Block *>(_virt_alloc->_find_by_address((addr_t)addr));
if (!b) return;
_unmap_local((addr_t)addr, b->size());
_unmap_local((addr_t)addr, (addr_t)b->map_addr, b->size());
_phys_alloc->free(b->map_addr, b->size());
_virt_alloc->free(addr, b->size());
}

View File

@ -136,9 +136,10 @@ class Genode::Mapped_mem_allocator : public Genode::Core_mem_translator
* Note: has to be implemented by platform specific code
*
* \param virt_addr start address of virtual range
* \param phys_addr start address of physical range
* \param size size of range
*/
bool _unmap_local(addr_t virt_addr, unsigned size);
bool _unmap_local(addr_t virt_addr, addr_t phys_addr, unsigned size);
/***********************************