mirror of
https://github.com/genodelabs/genode.git
synced 2024-12-18 21:27:56 +00:00
noux: upgrade RM session for client (fix #1138)
This commit is contained in:
parent
6553e9d79f
commit
42cce8668b
@ -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,
|
||||
|
@ -261,8 +261,15 @@ class Noux::Rm_session_component : public Rpc_object<Rm_session>
|
||||
*/
|
||||
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);
|
||||
|
Loading…
Reference in New Issue
Block a user