705 lines
26 KiB
Diff
705 lines
26 KiB
Diff
diff --git a/repos/base-linux/src/core/spec/linux/dataspace_component.cc b/repos/base-linux/src/core/spec/linux/dataspace_component.cc
|
|
index ad5c5c2929..45ce45333c 100644
|
|
--- a/repos/base-linux/src/core/spec/linux/dataspace_component.cc
|
|
+++ b/repos/base-linux/src/core/spec/linux/dataspace_component.cc
|
|
@@ -34,15 +34,15 @@ using namespace Genode;
|
|
|
|
Linux_dataspace::Filename Dataspace_component::_file_name(const char *args)
|
|
{
|
|
- Session_label const label = label_from_args(args);
|
|
+ auto name = rom_name_from_args(args);
|
|
Linux_dataspace::Filename fname;
|
|
|
|
- if (label.last_element().length() > sizeof(fname.buf)) {
|
|
- Genode::error("file name too long: ", label.last_element());
|
|
+ if (name.length() > sizeof(fname.buf)) {
|
|
+ Genode::error("file name too long: ", name);
|
|
throw Service_denied();
|
|
}
|
|
|
|
- copy_cstring(fname.buf, label.last_element().string(), sizeof(fname.buf));
|
|
+ copy_cstring(fname.buf, name.string(), sizeof(fname.buf));
|
|
|
|
/* only files inside the current working directory are allowed */
|
|
for (const char *c = fname.buf; *c; ++c)
|
|
diff --git a/repos/base-linux/src/core/spec/pc/dataspace_component.cc b/repos/base-linux/src/core/spec/pc/dataspace_component.cc
|
|
index d84132a596..a29b8da555 100644
|
|
--- a/repos/base-linux/src/core/spec/pc/dataspace_component.cc
|
|
+++ b/repos/base-linux/src/core/spec/pc/dataspace_component.cc
|
|
@@ -33,15 +33,15 @@ using namespace Genode;
|
|
|
|
Linux_dataspace::Filename Dataspace_component::_file_name(const char *args)
|
|
{
|
|
- Session_label const label = label_from_args(args);
|
|
+ auto name = rom_name_from_args(args);
|
|
Linux_dataspace::Filename fname;
|
|
|
|
- if (label.last_element().length() > sizeof(fname.buf)) {
|
|
- Genode::error("file name too long: ", label.last_element());
|
|
+ if (name.length() > sizeof(fname.buf)) {
|
|
+ Genode::error("file name too long: ", name);
|
|
throw Service_denied();
|
|
}
|
|
|
|
- copy_cstring(fname.buf, label.last_element().string(), sizeof(fname.buf));
|
|
+ copy_cstring(fname.buf, name.string(), sizeof(fname.buf));
|
|
|
|
/* only files inside the current working directory are allowed */
|
|
for (const char *c = fname.buf; *c; ++c)
|
|
diff --git a/repos/base/include/rom_session/connection.h b/repos/base/include/rom_session/connection.h
|
|
index ce1b9badf4..c4590ac1ed 100644
|
|
--- a/repos/base/include/rom_session/connection.h
|
|
+++ b/repos/base/include/rom_session/connection.h
|
|
@@ -39,8 +39,10 @@ struct Genode::Rom_connection : Connection<Rom_session>,
|
|
try :
|
|
Connection<Rom_session>(env,
|
|
session(env.parent(),
|
|
- "ram_quota=%ld, cap_quota=%ld, label=\"%s\"",
|
|
- RAM_QUOTA, CAP_QUOTA, label)),
|
|
+ "ram_quota=%ld, cap_quota=%ld, "
|
|
+ "name=\"%s\", label=\"%s\"",
|
|
+ RAM_QUOTA, CAP_QUOTA,
|
|
+ label, label)),
|
|
Rom_session_client(cap())
|
|
{ }
|
|
catch (...) {
|
|
diff --git a/repos/base/include/rom_session/rpc_object.h b/repos/base/include/rom_session/rpc_object.h
|
|
new file mode 100644
|
|
index 0000000000..dc9676c3a3
|
|
--- /dev/null
|
|
+++ b/repos/base/include/rom_session/rpc_object.h
|
|
@@ -0,0 +1,48 @@
|
|
+/*
|
|
+ * \brief Server-side ROM session object
|
|
+ * \author Emery Hemingway
|
|
+ * \date 2020-11-01
|
|
+ */
|
|
+
|
|
+/*
|
|
+ * Copyright (C) 2020 Genode Labs GmbH
|
|
+ *
|
|
+ * This file is part of the Genode OS framework, which is distributed
|
|
+ * under the terms of the GNU Affero General Public License version 3.
|
|
+ */
|
|
+
|
|
+#ifndef _INCLUDE__ROM_SESSION__RPC_OBJECT_H_
|
|
+#define _INCLUDE__ROM_SESSION__RPC_OBJECT_H_
|
|
+
|
|
+#include <rom_session/rom_session.h>
|
|
+#include <base/log.h>
|
|
+#include <base/rpc_server.h>
|
|
+#include <util/arg_string.h>
|
|
+
|
|
+namespace Genode {
|
|
+
|
|
+ typedef Rpc_object<Rom_session> Rom_rpc_object;
|
|
+
|
|
+ /**
|
|
+ * Extract ROM name from session arguments
|
|
+ */
|
|
+ inline Session_label rom_name_from_args(char const *args)
|
|
+ {
|
|
+ char buf[Session_label::capacity()];
|
|
+
|
|
+ Arg_string::find_arg(args, "name").string(buf, sizeof(buf), "");
|
|
+ Session_label const name{Cstring(buf)};
|
|
+
|
|
+ Arg_string::find_arg(args, "label").string(buf, sizeof(buf), "");
|
|
+ Session_label const label{Cstring(buf)};
|
|
+ Session_label const label_last = label.last_element();
|
|
+
|
|
+ if (name == "") return label_last;
|
|
+ if (name != label_last)
|
|
+ warning("ROM name mangled to \"", label, "\" from \"", name, "\"");
|
|
+ return name;
|
|
+ }
|
|
+
|
|
+}
|
|
+
|
|
+#endif /* _INCLUDE__ROM_SESSION__RPC_OBJECT_H_ */
|
|
diff --git a/repos/base/src/core/include/rom_session_component.h b/repos/base/src/core/include/rom_session_component.h
|
|
index c584701f5f..1a9e4e5bd3 100644
|
|
--- a/repos/base/src/core/include/rom_session_component.h
|
|
+++ b/repos/base/src/core/include/rom_session_component.h
|
|
@@ -17,12 +17,12 @@
|
|
#include <rom_fs.h>
|
|
#include <base/rpc_server.h>
|
|
#include <dataspace_component.h>
|
|
-#include <rom_session/rom_session.h>
|
|
+#include <rom_session/rpc_object.h>
|
|
#include <base/session_label.h>
|
|
|
|
namespace Genode {
|
|
|
|
- class Rom_session_component : public Rpc_object<Rom_session>
|
|
+ class Rom_session_component : public Rom_rpc_object
|
|
{
|
|
private:
|
|
|
|
@@ -33,11 +33,11 @@ namespace Genode {
|
|
|
|
Rom_module const &_find_rom(Rom_fs &rom_fs, const char *args)
|
|
{
|
|
- /* extract label */
|
|
- Session_label const label = label_from_args(args);
|
|
+ /* extract name of ROM */
|
|
+ auto name = rom_name_from_args(args);
|
|
|
|
- /* find ROM module for trailing label element */
|
|
- Rom_module const * rom = rom_fs.find(label.last_element().string());
|
|
+ /* find ROM module */
|
|
+ Rom_module const * rom = rom_fs.find(name.string());
|
|
if (rom)
|
|
return *rom;
|
|
|
|
diff --git a/repos/os/include/init/child_policy.h b/repos/os/include/init/child_policy.h
|
|
index 544b0730c9..d614fddce1 100644
|
|
--- a/repos/os/include/init/child_policy.h
|
|
+++ b/repos/os/include/init/child_policy.h
|
|
@@ -19,7 +19,7 @@
|
|
/* Genode includes */
|
|
#include <base/rpc_server.h>
|
|
#include <base/service.h>
|
|
-#include <rom_session/rom_session.h>
|
|
+#include <rom_session/rpc_object.h>
|
|
|
|
namespace Init {
|
|
class Child_policy_provide_rom_file;
|
|
@@ -79,15 +79,17 @@ class Init::Child_policy_provide_rom_file
|
|
Service *resolve_session_request_with_label(Service::Name const &name,
|
|
Session_label const &label)
|
|
{
|
|
- return (name == "ROM" && label.last_element() == _module_name)
|
|
+ return (name == Rom_session::service_name()
|
|
+ && label.last_element() == _module_name)
|
|
? &_service : nullptr;
|
|
}
|
|
|
|
Service *resolve_session_request(const char *service_name,
|
|
const char *args)
|
|
{
|
|
- return resolve_session_request_with_label(service_name,
|
|
- label_from_args(args));
|
|
+ return (service_name == Rom_session::service_name()
|
|
+ && rom_name_from_args(args) == _module_name)
|
|
+ ? &_service : nullptr;
|
|
}
|
|
};
|
|
|
|
diff --git a/repos/os/src/lib/sandbox/child.cc b/repos/os/src/lib/sandbox/child.cc
|
|
index e321df61fd..a2a538a002 100644
|
|
--- a/repos/os/src/lib/sandbox/child.cc
|
|
+++ b/repos/os/src/lib/sandbox/child.cc
|
|
@@ -11,6 +11,7 @@
|
|
* under the terms of the GNU Affero General Public License version 3.
|
|
*/
|
|
|
|
+#include <rom_session/rpc_object.h>
|
|
#include <vm_session/vm_session.h>
|
|
|
|
/* local includes */
|
|
@@ -448,6 +449,8 @@ Sandbox::Child::Route
|
|
Sandbox::Child::resolve_session_request(Service::Name const &service_name,
|
|
Session_label const &label)
|
|
{
|
|
+ auto no_filter = [] (Service &) -> bool { return false; };
|
|
+
|
|
/* check for "config" ROM request */
|
|
if (service_name == Rom_session::service_name() &&
|
|
label.last_element() == "config") {
|
|
@@ -464,21 +467,19 @@ Sandbox::Child::resolve_session_request(Service::Name const &service_name,
|
|
}
|
|
|
|
/*
|
|
- * Check for the binary's ROM request
|
|
- *
|
|
- * The binary is requested as a ROM with the child's unique
|
|
- * name ('Child_policy::binary_name' equals 'Child_policy::name').
|
|
- * If the binary name differs from the child's unique name,
|
|
- * we resolve the session request with the binary name as label.
|
|
- * Otherwise the regular routing is applied.
|
|
+ * Check for the "ld.lib.so" ROM request
|
|
*/
|
|
- if (service_name == Rom_session::service_name() &&
|
|
- label == _unique_name && _unique_name != _binary_name)
|
|
- return resolve_session_request(service_name, _binary_name);
|
|
-
|
|
- /* supply binary as dynamic linker if '<start ld="no">' */
|
|
- if (!_use_ld && service_name == Rom_session::service_name() && label == "ld.lib.so")
|
|
- return resolve_session_request(service_name, _binary_name);
|
|
+ if (service_name == Rom_session::service_name() && label == "ld.lib.so") {
|
|
+ if (_use_ld) {
|
|
+ /* forward request to parent */
|
|
+ return Route {
|
|
+ find_service(_parent_services, Rom_session::service_name(), no_filter),
|
|
+ Session_label("ld.lib.so"), Session::Diag { false} };
|
|
+ } else {
|
|
+ /* supply binary as dynamic linker if '<start ld="no">' */
|
|
+ return resolve_session_request(service_name, _binary_name);
|
|
+ }
|
|
+ }
|
|
|
|
/* check for "session_requests" ROM request */
|
|
if (service_name == Rom_session::service_name()
|
|
@@ -488,16 +489,21 @@ Sandbox::Child::resolve_session_request(Service::Name const &service_name,
|
|
|
|
try {
|
|
Xml_node route_node = _default_route_accessor.default_route();
|
|
+ route_node = _routes_accessor.routes(route_node);
|
|
try {
|
|
route_node = _start_node->xml().sub_node("route"); }
|
|
catch (...) { }
|
|
+
|
|
Xml_node service_node = route_node.sub_node();
|
|
|
|
+ /* <routes> is processed with the "«child» -> " prefix */
|
|
+ bool skip_prefix = route_node.type() != "routes";
|
|
+
|
|
for (; ; service_node = service_node.next()) {
|
|
|
|
bool service_wildcard = service_node.has_type("any-service");
|
|
|
|
- if (!service_node_matches(service_node, label, name(), service_name))
|
|
+ if (!service_node_matches(service_node, label, name(), service_name, skip_prefix))
|
|
continue;
|
|
|
|
Xml_node target = service_node.sub_node();
|
|
@@ -519,8 +525,6 @@ Sandbox::Child::resolve_session_request(Service::Name const &service_name,
|
|
Session::Diag const
|
|
target_diag { target.attribute_value("diag", false) };
|
|
|
|
- auto no_filter = [] (Service &) -> bool { return false; };
|
|
-
|
|
if (target.has_type("parent")) {
|
|
|
|
try {
|
|
@@ -641,6 +645,26 @@ void Sandbox::Child::filter_session_args(Service::Name const &service,
|
|
Arg_string::remove_arg(args, "managing_system");
|
|
}
|
|
}
|
|
+
|
|
+ if (service == Rom_session::service_name()) {
|
|
+ auto rom_name = rom_name_from_args(args);
|
|
+
|
|
+ /*
|
|
+ * Check for the binary's ROM request
|
|
+ *
|
|
+ * The binary is requested as a ROM with the child's unique
|
|
+ * name ('Child_policy::binary_name' equals 'Child_policy::name').
|
|
+ * If the binary name differs from the child's unique name,
|
|
+ * we resolve the session request with the binary name as label.
|
|
+ * Otherwise the regular routing is applied.
|
|
+ */
|
|
+ if (rom_name == _unique_name && _unique_name != _binary_name)
|
|
+ Arg_string::set_arg_string(args, args_len, "name", _binary_name.string());
|
|
+
|
|
+ /* supply binary as dynamic linker if '<start ld="no">' */
|
|
+ else if (!_use_ld && rom_name == "ld.lib.so")
|
|
+ Arg_string::set_arg_string(args, args_len, "name", _binary_name.string());
|
|
+ }
|
|
}
|
|
|
|
|
|
@@ -705,6 +729,7 @@ Sandbox::Child::Child(Env &env,
|
|
Report_update_trigger &report_update_trigger,
|
|
Xml_node start_node,
|
|
Default_route_accessor &default_route_accessor,
|
|
+ Routes_accessor &routes_accessor,
|
|
Default_caps_accessor &default_caps_accessor,
|
|
Name_registry &name_registry,
|
|
Ram_quota ram_limit,
|
|
@@ -722,6 +747,7 @@ Sandbox::Child::Child(Env &env,
|
|
_list_element(this),
|
|
_start_node(_alloc, start_node),
|
|
_default_route_accessor(default_route_accessor),
|
|
+ _routes_accessor(routes_accessor),
|
|
_default_caps_accessor(default_caps_accessor),
|
|
_ram_limit_accessor(ram_limit_accessor),
|
|
_cap_limit_accessor(cap_limit_accessor),
|
|
diff --git a/repos/os/src/lib/sandbox/child.h b/repos/os/src/lib/sandbox/child.h
|
|
index ae5f981435..f7b41ddd5b 100644
|
|
--- a/repos/os/src/lib/sandbox/child.h
|
|
+++ b/repos/os/src/lib/sandbox/child.h
|
|
@@ -52,6 +52,14 @@ class Sandbox::Child : Child_policy, Routed_service::Wakeup
|
|
struct Default_route_accessor : Interface { virtual Xml_node default_route() = 0; };
|
|
struct Default_caps_accessor : Interface { virtual Cap_quota default_caps() = 0; };
|
|
|
|
+ struct Routes_accessor : Interface
|
|
+ {
|
|
+ virtual Xml_node routes(Xml_node _default)
|
|
+ {
|
|
+ return _default;
|
|
+ }
|
|
+ };
|
|
+
|
|
template <typename QUOTA>
|
|
struct Resource_limit_accessor : Interface
|
|
{
|
|
@@ -98,6 +106,7 @@ class Sandbox::Child : Child_policy, Routed_service::Wakeup
|
|
bool const _use_ld = _start_node->xml().attribute_value("ld", true);
|
|
|
|
Default_route_accessor &_default_route_accessor;
|
|
+ Routes_accessor &_routes_accessor;
|
|
Default_caps_accessor &_default_caps_accessor;
|
|
Ram_limit_accessor &_ram_limit_accessor;
|
|
Cap_limit_accessor &_cap_limit_accessor;
|
|
@@ -472,6 +481,7 @@ class Sandbox::Child : Child_policy, Routed_service::Wakeup
|
|
Report_update_trigger &report_update_trigger,
|
|
Xml_node start_node,
|
|
Default_route_accessor &default_route_accessor,
|
|
+ Routes_accessor &route_accessor,
|
|
Default_caps_accessor &default_caps_accessor,
|
|
Name_registry &name_registry,
|
|
Ram_quota ram_limit,
|
|
diff --git a/repos/os/src/lib/sandbox/library.cc b/repos/os/src/lib/sandbox/library.cc
|
|
index 28b60c491f..30d0f2dfc1 100644
|
|
--- a/repos/os/src/lib/sandbox/library.cc
|
|
+++ b/repos/os/src/lib/sandbox/library.cc
|
|
@@ -23,6 +23,7 @@
|
|
|
|
struct Genode::Sandbox::Library : ::Sandbox::State_reporter::Producer,
|
|
::Sandbox::Child::Default_route_accessor,
|
|
+ ::Sandbox::Child::Routes_accessor,
|
|
::Sandbox::Child::Default_caps_accessor,
|
|
::Sandbox::Child::Ram_limit_accessor,
|
|
::Sandbox::Child::Cap_limit_accessor
|
|
@@ -52,6 +53,8 @@ struct Genode::Sandbox::Library : ::Sandbox::State_reporter::Producer,
|
|
|
|
Constructible<Buffered_xml> _default_route { };
|
|
|
|
+ Constructible<Buffered_xml> _routes { };
|
|
+
|
|
Cap_quota _default_caps { 0 };
|
|
|
|
unsigned _child_cnt = 0;
|
|
@@ -140,6 +143,12 @@ struct Genode::Sandbox::Library : ::Sandbox::State_reporter::Producer,
|
|
: Xml_node("<empty/>");
|
|
}
|
|
|
|
+ /**
|
|
+ * Routes_accessor interface
|
|
+ */
|
|
+ Xml_node routes(Xml_node _default) override {
|
|
+ return _routes.constructed() ? _routes->xml() : _default; }
|
|
+
|
|
/**
|
|
* Default_caps_accessor interface
|
|
*/
|
|
@@ -314,6 +323,9 @@ void Genode::Sandbox::Library::apply_config(Xml_node const &config)
|
|
_default_route.construct(_heap, config.sub_node("default-route")); }
|
|
catch (...) { }
|
|
|
|
+ try { _routes.construct(_heap, config.sub_node("routes")); }
|
|
+ catch (...) { }
|
|
+
|
|
_default_caps = Cap_quota { 0 };
|
|
try {
|
|
_default_caps = Cap_quota { config.sub_node("default")
|
|
@@ -404,7 +416,7 @@ void Genode::Sandbox::Library::apply_config(Xml_node const &config)
|
|
Child &child = *new (_heap)
|
|
Child(_env, _heap, *_verbose,
|
|
Child::Id { ++_child_cnt }, _state_reporter,
|
|
- start_node, *this, *this, _children,
|
|
+ start_node, *this, *this, *this, _children,
|
|
Ram_quota { avail_ram.value - used_ram.value },
|
|
Cap_quota { avail_caps.value - used_caps.value },
|
|
*this, *this, prio_levels, affinity_space,
|
|
diff --git a/repos/os/src/lib/sandbox/utils.h b/repos/os/src/lib/sandbox/utils.h
|
|
index 7afcaebf00..36aab737f2 100644
|
|
--- a/repos/os/src/lib/sandbox/utils.h
|
|
+++ b/repos/os/src/lib/sandbox/utils.h
|
|
@@ -59,7 +59,8 @@ namespace Sandbox {
|
|
inline bool service_node_matches(Xml_node const service_node,
|
|
Session_label const &label,
|
|
Child_policy::Name const &child_name,
|
|
- Service::Name const &service_name)
|
|
+ Service::Name const &service_name,
|
|
+ bool skip_child_prefix = true)
|
|
{
|
|
bool const service_matches =
|
|
service_node.has_type("any-service") ||
|
|
@@ -98,8 +99,9 @@ namespace Sandbox {
|
|
if (!route_depends_on_child_provided_label)
|
|
return true;
|
|
|
|
- char const * const scoped_label = skip_label_prefix(
|
|
- child_name.string(), label.string());
|
|
+ char const * const scoped_label = skip_child_prefix
|
|
+ ? skip_label_prefix(child_name.string(), label.string())
|
|
+ : label.string();
|
|
|
|
if (!scoped_label)
|
|
return false;
|
|
diff --git a/repos/os/src/server/cached_fs_rom/main.cc b/repos/os/src/server/cached_fs_rom/main.cc
|
|
index 9e4e4d0eee..8dfcb58d1e 100755
|
|
--- a/repos/os/src/server/cached_fs_rom/main.cc
|
|
+++ b/repos/os/src/server/cached_fs_rom/main.cc
|
|
@@ -15,7 +15,7 @@
|
|
#include <os/path.h>
|
|
#include <file_system_session/connection.h>
|
|
#include <file_system/util.h>
|
|
-#include <rom_session/rom_session.h>
|
|
+#include <rom_session/rpc_object.h>
|
|
#include <region_map/client.h>
|
|
#include <rm_session/connection.h>
|
|
#include <base/attached_ram_dataspace.h>
|
|
@@ -233,24 +233,21 @@ struct Cached_fs_rom::Transfer final
|
|
};
|
|
|
|
|
|
-class Cached_fs_rom::Session_component final : public Rpc_object<Rom_session>
|
|
+class Cached_fs_rom::Session_component final : public Rom_rpc_object
|
|
{
|
|
private:
|
|
|
|
Cached_rom &_cached_rom;
|
|
Cached_rom::Guard _cache_guard { _cached_rom };
|
|
Session_space::Element _sessions_elem;
|
|
- Session_label const _label;
|
|
|
|
public:
|
|
|
|
Session_component(Cached_rom &cached_rom,
|
|
- Session_space &space, Session_space::Id id,
|
|
- Session_label const &label)
|
|
+ Session_space &space, Session_space::Id id)
|
|
:
|
|
_cached_rom(cached_rom),
|
|
- _sessions_elem(*this, space, id),
|
|
- _label(label)
|
|
+ _sessions_elem(*this, space, id)
|
|
{ }
|
|
|
|
|
|
@@ -366,8 +363,9 @@ struct Cached_fs_rom::Main final : Genode::Session_request_handler
|
|
|
|
Session_space::Id const id { pid.value };
|
|
|
|
- Session_label const label = label_from_args(args.string());
|
|
- Path const path(label.last_element().string());
|
|
+ auto const label = label_from_args(args.string());
|
|
+ auto const rom_name = rom_name_from_args(args.string());
|
|
+ Path const path(rom_name.string());
|
|
|
|
Cached_rom *rom = nullptr;
|
|
|
|
@@ -393,7 +391,7 @@ struct Cached_fs_rom::Main final : Genode::Session_request_handler
|
|
if (rom->completed()) {
|
|
/* Create new RPC object */
|
|
Session_component *session = new (heap)
|
|
- Session_component(*rom, sessions, id, label);
|
|
+ Session_component(*rom, sessions, id);
|
|
if (session_diag_from_args(args.string()).enabled)
|
|
log("deliver ROM \"", label, "\"");
|
|
env.parent().deliver_session_cap(pid, env.ep().manage(*session));
|
|
diff --git a/repos/os/src/server/dynamic_rom/main.cc b/repos/os/src/server/dynamic_rom/main.cc
|
|
index 95d4175dab..efcc92b3f1 100644
|
|
--- a/repos/os/src/server/dynamic_rom/main.cc
|
|
+++ b/repos/os/src/server/dynamic_rom/main.cc
|
|
@@ -20,7 +20,7 @@
|
|
#include <base/log.h>
|
|
#include <base/attached_rom_dataspace.h>
|
|
#include <base/attached_ram_dataspace.h>
|
|
-#include <rom_session/rom_session.h>
|
|
+#include <rom_session/rpc_object.h>
|
|
#include <timer_session/connection.h>
|
|
#include <root/component.h>
|
|
|
|
@@ -221,7 +221,7 @@ class Dynamic_rom::Root : public Genode::Root_component<Session_component>
|
|
|
|
/* read name of ROM module from args */
|
|
Session_label const label = label_from_args(args);
|
|
- Session_label const module_name = label.last_element();
|
|
+ Session_label const module_name = rom_name_from_args(args);
|
|
|
|
try {
|
|
return new (md_alloc())
|
|
diff --git a/repos/os/src/server/fs_rom/main.cc b/repos/os/src/server/fs_rom/main.cc
|
|
index 2221af0363..4fbd54f3f5 100755
|
|
--- a/repos/os/src/server/fs_rom/main.cc
|
|
+++ b/repos/os/src/server/fs_rom/main.cc
|
|
@@ -13,7 +13,7 @@
|
|
*/
|
|
|
|
/* Genode includes */
|
|
-#include <rom_session/rom_session.h>
|
|
+#include <rom_session/rpc_object.h>
|
|
#include <file_system_session/connection.h>
|
|
#include <file_system/util.h>
|
|
#include <os/path.h>
|
|
@@ -44,7 +44,7 @@ namespace Fs_rom {
|
|
/**
|
|
* A 'Rom_session_component' exports a single file of the file system
|
|
*/
|
|
-class Fs_rom::Rom_session_component : public Rpc_object<Rom_session>
|
|
+class Fs_rom::Rom_session_component : public Rom_rpc_object
|
|
{
|
|
private:
|
|
|
|
@@ -519,8 +519,7 @@ class Fs_rom::Rom_root : public Root_component<Fs_rom::Rom_session_component>
|
|
|
|
Rom_session_component *_create_session(const char *args) override
|
|
{
|
|
- Session_label const label = label_from_args(args);
|
|
- Session_label const module_name = label.last_element();
|
|
+ auto module_name = rom_name_from_args(args);
|
|
|
|
/* create new session for the requested file */
|
|
return new (md_alloc())
|
|
diff --git a/repos/os/src/server/iso9660/main.cc b/repos/os/src/server/iso9660/main.cc
|
|
index fa41152716..a7f0e92558 100644
|
|
--- a/repos/os/src/server/iso9660/main.cc
|
|
+++ b/repos/os/src/server/iso9660/main.cc
|
|
@@ -22,7 +22,7 @@
|
|
#include <base/attached_ram_dataspace.h>
|
|
#include <base/session_label.h>
|
|
#include <block_session/connection.h>
|
|
-#include <rom_session/rom_session.h>
|
|
+#include <rom_session/rpc_object.h>
|
|
|
|
/* local includes */
|
|
#include "iso9660.h"
|
|
@@ -78,14 +78,14 @@ class Iso::File : public File_base
|
|
{
|
|
Iso::read_file(block, _info, 0, _ds.size(), _ds.local_addr<void>());
|
|
}
|
|
-
|
|
+
|
|
~File() { destroy(_alloc, _info); }
|
|
|
|
Dataspace_capability dataspace() { return _ds.cap(); }
|
|
};
|
|
|
|
|
|
-class Iso::Rom_component : public Genode::Rpc_object<Rom_session>
|
|
+class Iso::Rom_component : public Genode::Rom_rpc_object
|
|
{
|
|
private:
|
|
|
|
@@ -156,8 +156,8 @@ class Iso::Root : public Iso::Root_component
|
|
if (ram_quota < session_size)
|
|
throw Insufficient_ram_quota();
|
|
|
|
- Session_label const label = label_from_args(args);
|
|
- copy_cstring(_path, label.last_element().string(), sizeof(_path));
|
|
+ Session_label const name = rom_name_from_args(args);
|
|
+ copy_cstring(_path, name.string(), sizeof(_path));
|
|
|
|
if (verbose)
|
|
Genode::log("Request for file ", Cstring(_path), " len ", strlen(_path));
|
|
diff --git a/repos/os/src/server/loader/main.cc b/repos/os/src/server/loader/main.cc
|
|
index d2f5240c6a..d72f3f13ee 100644
|
|
--- a/repos/os/src/server/loader/main.cc
|
|
+++ b/repos/os/src/server/loader/main.cc
|
|
@@ -18,6 +18,7 @@
|
|
#include <loader_session/loader_session.h>
|
|
#include <root/component.h>
|
|
#include <os/session_policy.h>
|
|
+#include <rom_session/rpc_object.h>
|
|
|
|
/* local includes */
|
|
#include <child.h>
|
|
@@ -73,8 +74,7 @@ class Loader::Session_component : public Rpc_object<Session>
|
|
try {
|
|
Mutex::Guard guard(_mutex);
|
|
|
|
- Session_label const label = label_from_args(args.string());
|
|
- Session_label const name = label.last_element();
|
|
+ Session_label const name = rom_name_from_args(args.string());
|
|
|
|
Rom_module &module = _rom_modules.lookup_and_lock(name.string());
|
|
|
|
diff --git a/repos/os/src/server/rom_prefetcher/main.cc b/repos/os/src/server/rom_prefetcher/main.cc
|
|
index 7f1552ff57..e3bd89fea1 100644
|
|
--- a/repos/os/src/server/rom_prefetcher/main.cc
|
|
+++ b/repos/os/src/server/rom_prefetcher/main.cc
|
|
@@ -17,6 +17,7 @@
|
|
#include <base/log.h>
|
|
#include <base/heap.h>
|
|
#include <base/attached_rom_dataspace.h>
|
|
+#include <rom_session/rpc_object.h>
|
|
#include <timer_session/connection.h>
|
|
#include <base/session_label.h>
|
|
|
|
@@ -84,11 +85,11 @@ class Rom_prefetcher::Rom_root : public Genode::Root_component<Rom_session_compo
|
|
|
|
Rom_session_component *_create_session(const char *args) override
|
|
{
|
|
- Genode::Session_label const label = Genode::label_from_args(args);
|
|
+ Genode::Session_label const name = Genode::rom_name_from_args(args);
|
|
|
|
/* create new session for the requested file */
|
|
return new (md_alloc())
|
|
- Rom_session_component(_env, label.last_element());
|
|
+ Rom_session_component(_env, name);
|
|
}
|
|
|
|
public:
|
|
diff --git a/repos/os/src/server/tar_rom/main.cc b/repos/os/src/server/tar_rom/main.cc
|
|
index 00fd032c00..7d372d89de 100755
|
|
--- a/repos/os/src/server/tar_rom/main.cc
|
|
+++ b/repos/os/src/server/tar_rom/main.cc
|
|
@@ -13,6 +13,7 @@
|
|
*/
|
|
|
|
/* Genode includes */
|
|
+#include <rom_session/rpc_object.h>
|
|
#include <base/component.h>
|
|
#include <base/attached_rom_dataspace.h>
|
|
#include <base/heap.h>
|
|
@@ -32,7 +33,7 @@ namespace Tar_rom {
|
|
/**
|
|
* A 'Rom_session_component' exports a single file of the tar archive
|
|
*/
|
|
-class Tar_rom::Rom_session_component : public Rpc_object<Rom_session>
|
|
+class Tar_rom::Rom_session_component : public Rom_rpc_object
|
|
{
|
|
private:
|
|
|
|
@@ -197,8 +198,7 @@ class Tar_rom::Rom_root : public Root_component<Rom_session_component>
|
|
|
|
Rom_session_component *_create_session(const char *args) override
|
|
{
|
|
- Session_label const label = label_from_args(args);
|
|
- Session_label const module_name = label.last_element();
|
|
+ Session_label const module_name = rom_name_from_args(args);
|
|
log("connection for module '", module_name, "' requested");
|
|
|
|
/* create new session for the requested file */
|
|
diff --git a/repos/ports/src/app/gdb_monitor/rom.h b/repos/ports/src/app/gdb_monitor/rom.h
|
|
index d6163765b6..2b75bd5f51 100644
|
|
--- a/repos/ports/src/app/gdb_monitor/rom.h
|
|
+++ b/repos/ports/src/app/gdb_monitor/rom.h
|
|
@@ -19,6 +19,7 @@
|
|
#include <dataspace/client.h>
|
|
#include <root/component.h>
|
|
#include <rom_session/connection.h>
|
|
+#include <rom_session/rpc_object.h>
|
|
#include <util/arg_string.h>
|
|
|
|
|
|
@@ -35,7 +36,7 @@ namespace Gdb_monitor
|
|
/**
|
|
* ROM session backed by RAM dataspace copy of original ROM
|
|
*/
|
|
-class Gdb_monitor::Rom_session_component : public Rpc_object<Rom_session>
|
|
+class Gdb_monitor::Rom_session_component : public Rom_rpc_object
|
|
{
|
|
private:
|
|
|
|
@@ -120,12 +121,12 @@ class Gdb_monitor::Local_rom_factory : public Rom_service::Factory
|
|
|
|
Rom_session_component &create(Args const &args, Affinity) override
|
|
{
|
|
- Session_label const label = label_from_args(args.string());
|
|
+ Session_label const name = rom_name_from_args(args.string());
|
|
|
|
return *new (_alloc)
|
|
Rom_session_component(_env,
|
|
_ep,
|
|
- label.last_element().string());
|
|
+ name.string());
|
|
}
|
|
|
|
void upgrade(Rom_session_component &, Args const &) override { }
|