noux: keep cap of last pager

This commit is contained in:
Christian Prochaska 2016-04-14 15:14:53 +02:00 committed by Christian Helmuth
parent df272c90ec
commit cdf57b60f9

View File

@ -93,6 +93,16 @@ class Noux::Rm_session_component : public Rpc_object<Rm_session>
Dataspace_registry &_ds_registry;
/**
* Remember last pager capability returned by add_client
*
* On NOVA, we need to preserve a local copy of the pager capability
* until we have passed to a call of 'Cpu_session::set_pager'.
* Otherwise, NOVA would transitively revoke the capability that we
* handed out to our child.
*/
Pager_capability _last_pager;
public:
/**
@ -329,8 +339,11 @@ class Noux::Rm_session_component : public Rpc_object<Rm_session>
Pager_capability add_client(Thread_capability thread)
{
return retry<Rm_session::Out_of_metadata>(
[&] () { return _rm.add_client(thread); },
[&] () { Genode::env()->parent()->upgrade(_rm, "ram_quota=8192"); });
[&] () {
Pager_capability cap = _rm.add_client(thread);
_last_pager = cap;
return cap;
}, [&] () { Genode::env()->parent()->upgrade(_rm, "ram_quota=8192"); });
}
void remove_client(Pager_capability pager)