From e4cefe58d55a188e50814d19aaccae6eddffc264 Mon Sep 17 00:00:00 2001 From: Norman Feske Date: Wed, 15 Feb 2012 22:36:54 +0100 Subject: [PATCH] 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. --- base/include/base/child.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/base/include/base/child.h b/base/include/base/child.h index 7946f70e64..6a1beecac6 100644 --- a/base/include/base/child.h +++ b/base/include/base/child.h @@ -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);