mirror of
https://github.com/genodelabs/genode.git
synced 2025-06-23 01:08:55 +00:00
Re-implementation of the loader service, ref #187
The original loader service was primarily motivated by the browser-plugin scenario presented on our live CD. The new version implements a more general session interface, which widens the application scope of the service and, at the same time, reduces its implementation complexity. The complexity reduction is achieved by removing the original limitation of supplying the new sub system as a single binary blob only. The server used to implement heuristics and functionality for dealing with different kinds of blobs such as ELF images or TAR archives. This has been replaced by a session-local ROM service, which can be equipped with an arbitrary number of ROM modules supplied by the loader client prior starting the new sub system. Even though the TAR support has been removed, a separate instance of the 'tar_rom' service can be used within the subsystem to provide the formerly built-in functionality.
This commit is contained in:
@ -21,35 +21,34 @@
|
||||
|
||||
namespace Loader {
|
||||
|
||||
struct Session_client : Genode::Rpc_client<Session>
|
||||
struct Session_client : Rpc_client<Session>
|
||||
{
|
||||
Session_client(Loader::Session_capability session)
|
||||
: Genode::Rpc_client<Session>(session) { }
|
||||
explicit Session_client(Loader::Session_capability session)
|
||||
: Rpc_client<Session>(session) { }
|
||||
|
||||
Dataspace_capability alloc_rom_module(Name const &name, size_t size) {
|
||||
return call<Rpc_alloc_rom_module>(name, size); }
|
||||
|
||||
/******************************
|
||||
** Loader-session interface **
|
||||
******************************/
|
||||
void commit_rom_module(Name const &name) {
|
||||
call<Rpc_commit_rom_module>(name); }
|
||||
|
||||
Genode::Dataspace_capability dataspace() {
|
||||
return call<Rpc_dataspace>(); }
|
||||
void ram_quota(size_t quantum) {
|
||||
call<Rpc_ram_quota>(quantum); }
|
||||
|
||||
void start(Start_args const &args,
|
||||
int max_width, int max_height,
|
||||
Genode::Alarm::Time timeout,
|
||||
Name const &name = "")
|
||||
{
|
||||
call<Rpc_start>(args, max_width, max_height, timeout, name);
|
||||
}
|
||||
void constrain_geometry(int width, int height) {
|
||||
call<Rpc_constrain_geometry>(width, height); }
|
||||
|
||||
Nitpicker::View_capability view(int *w, int *h, int *buf_x, int *buf_y)
|
||||
{
|
||||
int dummy = 0;
|
||||
return call<Rpc_view>(w ? w : &dummy,
|
||||
h ? h : &dummy,
|
||||
buf_x ? buf_x : &dummy,
|
||||
buf_y ? buf_y : &dummy);
|
||||
}
|
||||
void view_ready_sigh(Signal_context_capability sigh) {
|
||||
call<Rpc_view_ready_sigh>(sigh); }
|
||||
|
||||
void start(Name const &binary, Name const &label = "") {
|
||||
call<Rpc_start>(binary, label); }
|
||||
|
||||
Nitpicker::View_capability view() {
|
||||
return call<Rpc_view>(); }
|
||||
|
||||
View_geometry view_geometry() {
|
||||
return call<Rpc_view_geometry>(); }
|
||||
};
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user