Streamline exception types

This patch reduces the number of exception types by facilitating
globally defined exceptions for common usage patterns shared by most
services. In particular, RPC functions that demand a session-resource
upgrade not longer reflect this condition via a session-specific
exception but via the 'Out_of_ram' or 'Out_of_caps' types.

Furthermore, the 'Parent::Service_denied', 'Parent::Unavailable',
'Root::Invalid_args', 'Root::Unavailable', 'Service::Invalid_args',
'Service::Unavailable', and 'Local_service::Factory::Denied' types have
been replaced by the single 'Service_denied' exception type defined in
'session/session.h'.

This consolidation eases the error handling (there are fewer exceptions
to handle), alleviates the need to convert exceptions along the
session-creation call chain, and avoids possible aliasing problems
(catching the wrong type with the same name but living in a different
scope).
This commit is contained in:
Norman Feske
2017-05-07 22:03:22 +02:00
committed by Christian Helmuth
parent 1f4f119b1e
commit 4d442bca30
180 changed files with 932 additions and 834 deletions

View File

@@ -66,7 +66,7 @@ struct Vmm::Virtual_reservation : private Rm_connection, Region_map_client
env.rm().attach_at(Region_map_client::dataspace(), PAGE_SIZE, 0,
PAGE_SIZE);
} catch (Rm_session::Region_conflict) {
} catch (Region_map::Region_conflict) {
error("region conflict while attaching guest-physical memory");
}
}

View File

@@ -116,7 +116,7 @@ class Vmm::Vcpu_dispatcher : public T
Capability_space::import(T::native_thread().ec_sel);
Untyped_capability handler =
retry<Genode::Pd_session::Out_of_metadata>(
retry<Genode::Out_of_ram>(
[&] () {
/* manually define selector used for RPC result */
Thread::myself()->native_thread().client_rcv_sel = exc_base + EV;