From 42cce8668b95282edbd4da5ad38756a2419fb6ee Mon Sep 17 00:00:00 2001 From: Stefan Kalkowski Date: Mon, 5 May 2014 15:57:41 +0200 Subject: [PATCH] noux: upgrade RM session for client (fix #1138) --- base-linux/include/rm_session/client.h | 8 +++----- ports/src/noux/rm_session_component.h | 11 +++++++++-- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/base-linux/include/rm_session/client.h b/base-linux/include/rm_session/client.h index 42fcc5af93..a4c99d2a84 100644 --- a/base-linux/include/rm_session/client.h +++ b/base-linux/include/rm_session/client.h @@ -19,10 +19,8 @@ namespace Genode { - struct Rm_session_client : Rm_session + struct Rm_session_client : Rm_session, Rm_session_capability { - Rm_session_capability const _cap; - typedef Rm_session Rpc_interface; /** @@ -30,10 +28,10 @@ namespace Genode { * * \throw Local_interface::Non_local_capability */ - Rm_session *_local() const { return Rm_session_capability::deref(_cap); } + Rm_session *_local() const { return Rm_session_capability::deref(*this); } explicit Rm_session_client(Rm_session_capability session) - : _cap(session) { } + : Rm_session_capability(session) { } Local_addr attach(Dataspace_capability ds, size_t size = 0, off_t offset = 0, bool use_local_addr = false, diff --git a/ports/src/noux/rm_session_component.h b/ports/src/noux/rm_session_component.h index d60d7ac6d6..329955656e 100644 --- a/ports/src/noux/rm_session_component.h +++ b/ports/src/noux/rm_session_component.h @@ -261,8 +261,15 @@ class Noux::Rm_session_component : public Rpc_object */ if (size == 0) size = Dataspace_client(ds).size() - offset; - local_addr = _rm.attach(ds, size, offset, use_local_addr, - local_addr, executable); + for (;;) { + try { + local_addr = _rm.attach(ds, size, offset, use_local_addr, + local_addr, executable); + break; + } catch (Rm_session::Out_of_metadata) { + Genode::env()->parent()->upgrade(_rm, "ram_quota=8096"); + } + } Region * region = new (env()->heap()) Region(*this, ds, size, offset, local_addr);