genode/base-okl4/src/core/rm_session_support.cc
Norman Feske 21de42c45d core: Introduce 'Address_space' interface
The new core-internal 'Address_space' interface enables cores RM service
to flush mappings of a PD in which a given 'Rm_client' thread resides.
Prior this patch, each platform invented their own way to flush mappings
in the respective 'rm_session_support.cc' implementation. However, those
implementations used to deal poorly with some corner cases. In
particular, if a PD session was destroyed prior a RM session, the RM
session would try to use no longer existing PD session. The new
'Address_space' uses the just added weak-pointer mechanism to deal with
this issue.

Furthermore, the generic 'Rm_session_component::detach' function has
been improved to avoid duplicated unmap operations for platforms that
implement the 'Address_space' interface. Therefore, it is related to
issue #595. Right now, this is OKL4 only, but other platforms will follow.
2013-03-12 21:53:08 +01:00

30 lines
648 B
C++

/*
* \brief OKL4-specific part of RM-session implementation
* \author Norman Feske
* \date 2009-04-10
*/
/*
* Copyright (C) 2009-2013 Genode Labs GmbH
*
* This file is part of the Genode OS framework, which is distributed
* under the terms of the GNU General Public License version 2.
*/
/* Genode includes */
#include <base/printf.h>
/* core includes */
#include <rm_session_component.h>
using namespace Genode;
void Rm_client::unmap(addr_t, addr_t virt_base, size_t size)
{
Locked_ptr<Address_space> locked_address_space(_address_space);
if (locked_address_space.is_valid())
locked_address_space->flush(virt_base, size);
}