Make Child's reference RAM session configurable

The 'Child' framework used to perform the transfer of session quota
using 'env()->ram_session()' as hard-wired reference account. When
locally virtualizing the RAM session supplied to the 'Child', this
policy does not work. When closing a session, core would try to transfer
session quota to the virtualized RAM service, which is of course not
possible. This patch makes the reference RAM session configable via the
'Child_policy' interface.
This commit is contained in:
Norman Feske 2012-02-15 22:36:54 +01:00
parent 15f0879402
commit e4cefe58d5

View File

@ -84,6 +84,14 @@ namespace Genode {
{
PDBG("child exited with exit value %d", exit_value);
}
/**
* Reference RAM session
*
* The RAM session returned by this function is used for session-quota
* transfers.
*/
virtual Ram_session *ref_ram_session() { return env()->ram_session(); }
};
@ -333,7 +341,7 @@ namespace Genode {
_session_list.remove(s);
/* return session quota to the ram session of the child */
if (env()->ram_session()->transfer_quota(_ram, s->donated_ram_quota()))
if (_policy->ref_ram_session()->transfer_quota(_ram, s->donated_ram_quota()))
PERR("We ran out of our own quota");
destroy(heap(), s);