mirror of
https://github.com/genodelabs/genode.git
synced 2025-06-18 07:08:18 +00:00
Remove blocking calls from root and parent RPCs
This is a redesign of the root and parent interfaces to eliminate blocking RPC calls. - New session representation at the parent (base/session_state.h) - base-internal root proxy mechanism as migration path - Redesign of base/service.h - Removes ancient 'Connection::KEEP_OPEN' feature - Interface change of 'Child', 'Child_policy', 'Slave', 'Slave_policy' - New 'Slave::Connection' - Changed child-construction procedure to be compatible with the non-blocking parent interface and to be easier to use - The child's initial LOG session, its binary ROM session, and the linker ROM session have become part of the child's envirenment. - Session upgrading must now be performed via 'env.upgrade' instead of performing a sole RPC call the parent. To make RAM upgrades easier, the 'Connection' provides a new 'upgrade_ram' method. Issue #2120
This commit is contained in:
committed by
Christian Helmuth
parent
3cc2a3f085
commit
cfdbccc5c2
@ -75,14 +75,32 @@ struct Linker::File
|
||||
*/
|
||||
struct Linker::Elf_file : File
|
||||
{
|
||||
Env &env;
|
||||
Rom_connection rom;
|
||||
Ram_dataspace_capability ram_cap[Phdr::MAX_PHDR];
|
||||
bool const loaded;
|
||||
Env &env;
|
||||
Lazy_volatile_object<Rom_connection> rom_connection;
|
||||
Rom_session_client rom;
|
||||
Ram_dataspace_capability ram_cap[Phdr::MAX_PHDR];
|
||||
bool const loaded;
|
||||
|
||||
typedef String<64> Name;
|
||||
|
||||
Rom_session_capability _rom_cap(Name const &name)
|
||||
{
|
||||
/* request the linker and binary from the component environment */
|
||||
Session_capability cap;
|
||||
if (name == binary_name())
|
||||
cap = env.parent().session_cap(Parent::Env::binary());
|
||||
if (name == linker_name())
|
||||
cap = env.parent().session_cap(Parent::Env::linker());
|
||||
if (cap.valid())
|
||||
return reinterpret_cap_cast<Rom_session>(cap);
|
||||
|
||||
rom_connection.construct(env, name.string());
|
||||
return *rom_connection;
|
||||
}
|
||||
|
||||
Elf_file(Env &env, Allocator &md_alloc, char const *name, bool load)
|
||||
:
|
||||
env(env), rom(env, name), loaded(load)
|
||||
env(env), rom(_rom_cap(name)), loaded(load)
|
||||
{
|
||||
load_phdr();
|
||||
|
||||
|
@ -103,12 +103,6 @@ namespace Linker {
|
||||
* Global ELF access lock
|
||||
*/
|
||||
Lock &lock();
|
||||
|
||||
/**
|
||||
* Invariants
|
||||
*/
|
||||
constexpr char const *binary_name() { return "binary"; }
|
||||
constexpr char const *linker_name() { return "ld.lib.so"; }
|
||||
}
|
||||
|
||||
|
||||
|
@ -96,7 +96,7 @@ class Linker::Region_map
|
||||
[&] () {
|
||||
return _rm.attach_at(ds, local_addr - _base, size, offset);
|
||||
},
|
||||
[&] () { _env.parent().upgrade(_env.pd_session_cap(), "ram_quota=8K"); });
|
||||
[&] () { _env.upgrade(Parent::Env::pd(), "ram_quota=8K"); });
|
||||
}
|
||||
|
||||
/**
|
||||
@ -109,7 +109,7 @@ class Linker::Region_map
|
||||
[&] () {
|
||||
return _rm.attach_executable(ds, local_addr - _base, size, offset);
|
||||
},
|
||||
[&] () { _env.parent().upgrade(_env.pd_session_cap(), "ram_quota=8K"); });
|
||||
[&] () { _env.upgrade(Parent::Env::pd(), "ram_quota=8K"); });
|
||||
}
|
||||
|
||||
void detach(Local_addr local_addr) { _rm.detach((addr_t)local_addr - _base); }
|
||||
|
@ -38,6 +38,12 @@ namespace Linker {
|
||||
|
||||
enum Bind { BIND_LAZY = Shared_object::BIND_LAZY,
|
||||
BIND_NOW = Shared_object::BIND_NOW };
|
||||
|
||||
/**
|
||||
* Invariants
|
||||
*/
|
||||
constexpr char const *binary_name() { return "binary"; }
|
||||
constexpr char const *linker_name() { return "ld.lib.so"; }
|
||||
}
|
||||
|
||||
#endif /* _INCLUDE__TYPES_H_ */
|
||||
|
Reference in New Issue
Block a user