mirror of
https://github.com/genodelabs/genode.git
synced 2025-01-03 04:26:45 +00:00
Propagate loader-session errors as exceptions
This commit is contained in:
parent
7a965bd877
commit
17b60f8d41
@ -108,6 +108,9 @@ namespace Loader {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Start subsystem
|
* Start subsystem
|
||||||
|
*
|
||||||
|
* \throw Rom_module_does_not_exist if the specified binary could
|
||||||
|
* not obtained as ROM module
|
||||||
*/
|
*/
|
||||||
virtual void start(Name const &binary, Name const &label = "") = 0;
|
virtual void start(Name const &binary, Name const &label = "") = 0;
|
||||||
|
|
||||||
@ -132,12 +135,17 @@ namespace Loader {
|
|||||||
|
|
||||||
GENODE_RPC(Rpc_alloc_rom_module, Dataspace_capability, alloc_rom_module,
|
GENODE_RPC(Rpc_alloc_rom_module, Dataspace_capability, alloc_rom_module,
|
||||||
Name const &, size_t);
|
Name const &, size_t);
|
||||||
GENODE_RPC(Rpc_commit_rom_module, void, commit_rom_module, Name const &);
|
GENODE_RPC_THROW(Rpc_commit_rom_module, void, commit_rom_module,
|
||||||
|
GENODE_TYPE_LIST(Rom_module_does_not_exist),
|
||||||
|
Name const &);
|
||||||
GENODE_RPC(Rpc_ram_quota, void, ram_quota, size_t);
|
GENODE_RPC(Rpc_ram_quota, void, ram_quota, size_t);
|
||||||
GENODE_RPC(Rpc_constrain_geometry, void, constrain_geometry, int, int);
|
GENODE_RPC(Rpc_constrain_geometry, void, constrain_geometry, int, int);
|
||||||
GENODE_RPC(Rpc_view_ready_sigh, void, view_ready_sigh, Signal_context_capability);
|
GENODE_RPC(Rpc_view_ready_sigh, void, view_ready_sigh, Signal_context_capability);
|
||||||
GENODE_RPC(Rpc_start, void, start, Name const &, Name const &);
|
GENODE_RPC_THROW(Rpc_start, void, start,
|
||||||
GENODE_RPC(Rpc_view, Nitpicker::View_capability, view);
|
GENODE_TYPE_LIST(Rom_module_does_not_exist),
|
||||||
|
Name const &, Name const &);
|
||||||
|
GENODE_RPC_THROW(Rpc_view, Nitpicker::View_capability, view,
|
||||||
|
GENODE_TYPE_LIST(View_does_not_exist));
|
||||||
GENODE_RPC(Rpc_view_geometry, View_geometry, view_geometry);
|
GENODE_RPC(Rpc_view_geometry, View_geometry, view_geometry);
|
||||||
|
|
||||||
GENODE_RPC_INTERFACE(Rpc_alloc_rom_module, Rpc_commit_rom_module,
|
GENODE_RPC_INTERFACE(Rpc_alloc_rom_module, Rpc_commit_rom_module,
|
||||||
|
@ -79,9 +79,14 @@ namespace Loader {
|
|||||||
|
|
||||||
Rom_session_capability _rom_session(char const *name)
|
Rom_session_capability _rom_session(char const *name)
|
||||||
{
|
{
|
||||||
|
try {
|
||||||
char args[Session::Name::MAX_SIZE];
|
char args[Session::Name::MAX_SIZE];
|
||||||
snprintf(args, sizeof(args), "ram_quota=4K, filename=\"%s\"", name);
|
snprintf(args, sizeof(args), "ram_quota=4K, filename=\"%s\"", name);
|
||||||
return static_cap_cast<Rom_session>(_local_rom_service.session(args));
|
return static_cap_cast<Rom_session>(_local_rom_service.session(args));
|
||||||
|
} catch (Genode::Parent::Service_denied) {
|
||||||
|
PERR("Lookup for ROM module \"%s\" failed", name);
|
||||||
|
throw;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
@ -255,11 +255,15 @@ namespace Loader {
|
|||||||
min(_subsystem_ram_quota_limit, _ram_session_client.avail()) :
|
min(_subsystem_ram_quota_limit, _ram_session_client.avail()) :
|
||||||
_ram_session_client.avail();
|
_ram_session_client.avail();
|
||||||
|
|
||||||
|
try {
|
||||||
_child = new (&_md_alloc)
|
_child = new (&_md_alloc)
|
||||||
Child(binary_name.string(), label.string(), _ep,
|
Child(binary_name.string(), label.string(), _ep,
|
||||||
_ram_session_client, ram_quota, _parent_services,
|
_ram_session_client, ram_quota, _parent_services,
|
||||||
_rom_service, _nitpicker_service, _width, _height);
|
_rom_service, _nitpicker_service, _width, _height);
|
||||||
}
|
}
|
||||||
|
catch (Genode::Parent::Service_denied) {
|
||||||
|
throw Rom_module_does_not_exist(); }
|
||||||
|
}
|
||||||
|
|
||||||
Nitpicker::View_capability view()
|
Nitpicker::View_capability view()
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user