noux: upgrade RM session for client (fix #1138)

This commit is contained in:
Stefan Kalkowski 2014-05-05 15:57:41 +02:00 committed by Norman Feske
parent 6553e9d79f
commit 42cce8668b
2 changed files with 12 additions and 7 deletions

View File

@ -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,

View File

@ -261,8 +261,15 @@ class Noux::Rm_session_component : public Rpc_object<Rm_session>
*/
if (size == 0) size = Dataspace_client(ds).size() - offset;
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);