mirror of
https://github.com/genodelabs/genode.git
synced 2025-01-03 04:26:45 +00:00
base-hw: let upgrade_cap_slab reflect Out_of_caps
This patch reflects the Out_of_caps exception from core to the client, in addition to the already covered Out_of_ram exception. It thereby eliminates a potential abort in core, which I observed with the tool_chain_auto.run script: Kernel: RPC upgrade_cap_slab Error: Uncaught exception of type 'Genode::Quota_guard<Genode::Cap_quota>::Limit_exceeded' Warning: abort called - thread: entrypoint In addition to propagating the exception, the patch add the client-side exception-handling code to the base library. Fixes #3703
This commit is contained in:
parent
208294b0d3
commit
0f3ac4cb9f
@ -30,7 +30,7 @@ struct Genode::Hw_native_pd : Pd_session::Native_pd
|
|||||||
*********************/
|
*********************/
|
||||||
|
|
||||||
GENODE_RPC_THROW(Rpc_upgrade_cap_slab, void, upgrade_cap_slab,
|
GENODE_RPC_THROW(Rpc_upgrade_cap_slab, void, upgrade_cap_slab,
|
||||||
GENODE_TYPE_LIST(Out_of_ram));
|
GENODE_TYPE_LIST(Out_of_ram, Out_of_caps));
|
||||||
GENODE_RPC_INTERFACE(Rpc_upgrade_cap_slab);
|
GENODE_RPC_INTERFACE(Rpc_upgrade_cap_slab);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -61,13 +61,28 @@ void Genode::upgrade_capability_slab()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
auto request_resources_from_parent = [&] (Ram_quota ram, Cap_quota caps)
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
* The call of 'resource_request' is handled synchronously by
|
||||||
|
* 'Expanding_parent_client'.
|
||||||
|
*/
|
||||||
|
String<100> const args("ram_quota=", ram, ", cap_quota=", caps);
|
||||||
|
internal_env().parent().resource_request(args.string());
|
||||||
|
};
|
||||||
|
|
||||||
|
retry<Genode::Out_of_caps>(
|
||||||
|
[&] () {
|
||||||
retry<Genode::Out_of_ram>(
|
retry<Genode::Out_of_ram>(
|
||||||
[&] () {
|
[&] () {
|
||||||
Genode::Hw_native_pd_client pd(native_pd_cap);
|
Genode::Hw_native_pd_client pd(native_pd_cap);
|
||||||
pd.upgrade_cap_slab();
|
pd.upgrade_cap_slab();
|
||||||
},
|
},
|
||||||
[&] () {
|
[&] () {
|
||||||
internal_env().upgrade(Parent::Env::pd(),
|
request_resources_from_parent(Ram_quota{8192}, Cap_quota{0});
|
||||||
String<100>("ram_quota=", 8192).string());
|
});
|
||||||
|
},
|
||||||
|
[&] () {
|
||||||
|
request_resources_from_parent(Ram_quota{0}, Cap_quota{2});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user