mirror of
https://github.com/genodelabs/genode.git
synced 2025-06-18 15:18:20 +00:00
Loader: reflect faults to client
With this patch, the loader installs an optional client-provided fault handler as default CPU exception handler and RM fault handler for all CPU and RM sessions of the loaded subsystem. This way, loader clients become able to respond to failures occuring within the subsystem. The new feature is provided via the added 'Loader::fault_handler' RPC function. The 'run/failsafe' test covers two cases related to the loader, which are faults produced by the immediate child of the loader and faults produced by indirect children.
This commit is contained in:
@ -116,6 +116,20 @@ namespace Loader {
|
||||
*/
|
||||
virtual void view_ready_sigh(Signal_context_capability sigh) = 0;
|
||||
|
||||
/**
|
||||
* Register signal handler notified when a failure occurs in the
|
||||
* loaded subsystem.
|
||||
*
|
||||
* This signal is delivered if any child process of the subsystem
|
||||
* produces an unresolvable page fault, exists, or triggers a CPU
|
||||
* exception. (e.g., division by zero) For more information about
|
||||
* the possible types of faults, please refer to the documentation of
|
||||
* 'Rm_session::fault_handler' and 'Cpu_session::exception_handler'.
|
||||
*
|
||||
* This function should not be called after the 'start' function.
|
||||
*/
|
||||
virtual void fault_sigh(Signal_context_capability sigh) = 0;
|
||||
|
||||
/**
|
||||
* Start subsystem
|
||||
*
|
||||
@ -152,6 +166,7 @@ namespace Loader {
|
||||
GENODE_RPC(Rpc_ram_quota, void, ram_quota, size_t);
|
||||
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_fault_sigh, void, fault_sigh, Signal_context_capability);
|
||||
GENODE_RPC_THROW(Rpc_start, void, start,
|
||||
GENODE_TYPE_LIST(Rom_module_does_not_exist),
|
||||
Name const &, Name const &, Native_pd_args const &);
|
||||
@ -161,8 +176,8 @@ namespace Loader {
|
||||
|
||||
GENODE_RPC_INTERFACE(Rpc_alloc_rom_module, Rpc_commit_rom_module,
|
||||
Rpc_ram_quota, Rpc_constrain_geometry,
|
||||
Rpc_view_ready_sigh, Rpc_start, Rpc_view,
|
||||
Rpc_view_geometry);
|
||||
Rpc_view_ready_sigh, Rpc_fault_sigh, Rpc_start,
|
||||
Rpc_view, Rpc_view_geometry);
|
||||
};
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user