hw: implement 'Address_space' interface

Ref #595
Ref #1443
This commit is contained in:
Stefan Kalkowski 2015-04-10 12:35:30 +02:00 committed by Christian Helmuth
parent 554146d39c
commit d4c55bec2a
3 changed files with 16 additions and 24 deletions

View File

@ -158,7 +158,7 @@ namespace Genode
** Address-space interface ** ** Address-space interface **
*****************************/ *****************************/
void flush(addr_t, size_t) { PDBG("not implemented"); } void flush(addr_t, size_t);
}; };
} }

View File

@ -6,7 +6,7 @@
*/ */
/* /*
* Copyright (C) 2012-2013 Genode Labs GmbH * Copyright (C) 2012-2015 Genode Labs GmbH
* *
* This file is part of the Genode OS framework, which is distributed * This file is part of the Genode OS framework, which is distributed
* under the terms of the GNU General Public License version 2. * under the terms of the GNU General Public License version 2.
@ -17,6 +17,17 @@
using namespace Genode; using namespace Genode;
void Platform_pd::flush(addr_t virt_base, size_t size)
{
Lock::Guard guard(*lock());
if (_tt) _tt->remove_translation(virt_base, size, page_slab());
/* update translation caches */
Kernel::update_pd(kernel_pd());
}
Platform_pd::~Platform_pd() Platform_pd::~Platform_pd()
{ {
Lock::Guard guard(_lock); Lock::Guard guard(_lock);

View File

@ -31,29 +31,10 @@ using namespace Genode;
void Rm_client::unmap(addr_t, addr_t virt_base, size_t size) void Rm_client::unmap(addr_t, addr_t virt_base, size_t size)
{ {
/* determine and lock PD */ Locked_ptr<Address_space> locked_address_space(_address_space);
Platform_thread * const pt = (Platform_thread *)badge();
if (!pt) {
PERR("failed to get thread of RM client");
return;
}
Platform_pd * const pd = pt->pd();
if (!pd) {
PERR("failed to get PD of RM client");
return;
}
Lock::Guard guard(*pd->lock());
/* update translation table of the PD */ if (locked_address_space.is_valid())
Translation_table * const tt = pd->translation_table(); locked_address_space->flush(virt_base, size);
if (!tt) {
PERR("failed to get translation table of RM client");
return;
}
tt->remove_translation(virt_base, size, pd->page_slab());
/* update translation caches */
Kernel::update_pd(pd->kernel_pd());
} }