gems: remove the use of deprecated APIs

This patch also updates os/slave.h because the app/launcher cannot be
reasonably updated without it.

Issue #1987
Issue #3125
This commit is contained in:
Norman Feske 2019-01-21 15:46:48 +01:00
parent f23579532e
commit ba2b0b8360
63 changed files with 371 additions and 475 deletions

View File

@ -53,27 +53,12 @@ class Chunky_texture : Genode::Attached_ram_dataspace, public Genode::Texture<PT
public: public:
Chunky_texture(Genode::Ram_session &ram, Genode::Region_map &rm, Chunky_texture(Genode::Ram_allocator &ram, Genode::Region_map &rm,
Genode::Surface_base::Area size) Genode::Surface_base::Area size)
: :
Genode::Attached_ram_dataspace(ram, rm, _num_bytes(size)), Genode::Attached_ram_dataspace(ram, rm, _num_bytes(size)),
Genode::Texture<PT>(_pixel(), _alpha(size), size) Genode::Texture<PT>(_pixel(), _alpha(size), size)
{ } { }
/**
* Constructor
*
* \deprecated
* \noapi
*
* This variant is solely meant to be used by deprecated functions.
* It will be removed if those functions are gone.
*/
Chunky_texture(Genode::Ram_session &ram, Genode::Surface_base::Area size) __attribute__((deprecated))
:
Genode::Attached_ram_dataspace(ram, *Genode::env_deprecated()->rm_session(), _num_bytes(size)),
Genode::Texture<PT>(_pixel(), _alpha(size), size)
{ }
}; };
#endif /* _INCLUDE__GEMS__CHUNKY_TEXTURE_H_ */ #endif /* _INCLUDE__GEMS__CHUNKY_TEXTURE_H_ */

View File

@ -15,7 +15,7 @@
#define _INCLUDE__GEMS__NITPICKER_BUFFER_H_ #define _INCLUDE__GEMS__NITPICKER_BUFFER_H_
/* Genode includes */ /* Genode includes */
#include <ram_session/ram_session.h> #include <base/ram_allocator.h>
#include <nitpicker_session/connection.h> #include <nitpicker_session/connection.h>
#include <base/attached_dataspace.h> #include <base/attached_dataspace.h>
#include <base/attached_ram_dataspace.h> #include <base/attached_ram_dataspace.h>
@ -43,7 +43,7 @@ struct Nitpicker_buffer
typedef Genode::Attached_ram_dataspace Ram_ds; typedef Genode::Attached_ram_dataspace Ram_ds;
Genode::Ram_session &ram; Genode::Ram_allocator &ram;
Genode::Region_map &rm; Genode::Region_map &rm;
Nitpicker::Connection &nitpicker; Nitpicker::Connection &nitpicker;
@ -85,7 +85,7 @@ struct Nitpicker_buffer
* Constructor * Constructor
*/ */
Nitpicker_buffer(Nitpicker::Connection &nitpicker, Area size, Nitpicker_buffer(Nitpicker::Connection &nitpicker, Area size,
Genode::Ram_session &ram, Genode::Region_map &rm) Genode::Ram_allocator &ram, Genode::Region_map &rm)
: :
ram(ram), rm(rm), nitpicker(nitpicker), ram(ram), rm(rm), nitpicker(nitpicker),
mode(Genode::max(1UL, size.w()), Genode::max(1UL, size.h()), mode(Genode::max(1UL, size.w()), Genode::max(1UL, size.h()),
@ -94,20 +94,6 @@ struct Nitpicker_buffer
reset_surface(); reset_surface();
} }
/**
* Constructor
*
* \deprecated
* \noapi
*/
Nitpicker_buffer(Nitpicker::Connection &nitpicker, Area size,
Genode::Ram_session &ram) __attribute__((deprecated))
:
ram(ram), rm(*Genode::env_deprecated()->rm_session()), nitpicker(nitpicker),
mode(Genode::max(1UL, size.w()), Genode::max(1UL, size.h()),
nitpicker.mode().format())
{ }
/** /**
* Return size of virtual framebuffer * Return size of virtual framebuffer
*/ */

View File

@ -45,7 +45,7 @@ class Png_image
return arg; return arg;
}; };
Genode::Ram_session &_ram; Genode::Ram_allocator &_ram;
Genode::Region_map &_rm; Genode::Region_map &_rm;
Genode::Allocator &_alloc; Genode::Allocator &_alloc;
@ -173,26 +173,12 @@ class Png_image
* \throw Read_struct_failed * \throw Read_struct_failed
* \throw Info_failed * \throw Info_failed
*/ */
Png_image(Genode::Ram_session &ram, Genode::Region_map &rm, Png_image(Genode::Ram_allocator &ram, Genode::Region_map &rm,
Genode::Allocator &alloc, void *data) Genode::Allocator &alloc, void *data)
: :
_ram(ram), _rm(rm), _alloc(alloc), _read_struct(data) _ram(ram), _rm(rm), _alloc(alloc), _read_struct(data)
{ } { }
/**
* Constructor
*
* \deprecated
* \noapi
*/
Png_image(void *data) __attribute__((deprecated))
:
_ram(*Genode::env_deprecated()->ram_session()),
_rm(*Genode::env_deprecated()->rm_session()),
_alloc(*Genode::env_deprecated()->heap()),
_read_struct(data)
{ }
/** /**
* Return size of PNG image * Return size of PNG image
*/ */

View File

@ -26,14 +26,18 @@ class Report_rom_slave : public Genode::Noncopyable
{ {
private: private:
class Policy struct Policy_base
: {
private Genode::Static_parent_services<Genode::Rom_session, Genode::Static_parent_services<Genode::Rom_session,
Genode::Cpu_session, Genode::Cpu_session,
Genode::Pd_session, Genode::Pd_session,
Genode::Ram_session, Genode::Log_session>
Genode::Log_session>, _parent_services;
public Genode::Slave::Policy
Policy_base(Genode::Env &env) : _parent_services(env) { }
};
class Policy : Policy_base, public Genode::Slave::Policy
{ {
private: private:
@ -41,24 +45,20 @@ class Report_rom_slave : public Genode::Noncopyable
Genode::Root_capability _rom_root_cap; Genode::Root_capability _rom_root_cap;
bool _announced; bool _announced;
protected:
static Name _name() { return "report_rom"; } static Name _name() { return "report_rom"; }
static Genode::Ram_quota _quota() { return { 1024*1024 }; } static Genode::Ram_quota _quota() { return { 1024*1024 }; }
static Genode::Cap_quota _caps() { return { 75 }; } static Genode::Cap_quota _caps() { return { 75 }; }
public: public:
Policy(Genode::Rpc_entrypoint &ep, Policy(Genode::Env &env,
Genode::Region_map &rm, Genode::Rpc_entrypoint &ep,
Genode::Pd_session &ref_pd,
Genode::Pd_session_capability ref_pd_cap,
Genode::Ram_session &ref_ram,
Genode::Ram_session_capability ref_ram_cap,
const char *config) const char *config)
: :
Genode::Slave::Policy(_name(), _name(), *this, ep, rm, Policy_base(env),
ref_pd, ref_pd_cap, _caps(), _quota()) Genode::Slave::Policy(env, _name(), _name(),
Policy_base::_parent_services,
ep, _caps(), _quota())
{ {
if (config) if (config)
configure(config); configure(config);
@ -76,19 +76,12 @@ class Report_rom_slave : public Genode::Noncopyable
* Constructor * Constructor
* *
* \param ep entrypoint used for child thread * \param ep entrypoint used for child thread
* \param ram RAM session used to allocate the configuration
* dataspace
*/ */
Report_rom_slave(Genode::Region_map &rm, Report_rom_slave(Genode::Env &env, char const *config)
Genode::Pd_session &pd,
Genode::Pd_session_capability pd_cap,
Genode::Ram_session &ram,
Genode::Ram_session_capability ram_cap,
char const *config)
: :
_ep(&pd, _ep_stack_size, "report_rom"), _ep(&env.pd(), _ep_stack_size, "report_rom"),
_policy(_ep, rm, pd, pd_cap, ram, ram_cap, config), _policy(env, _ep, config),
_child(rm, _ep, _policy) _child(env.rm(), _ep, _policy)
{ } { }
Genode::Slave::Policy &policy() { return _policy; } Genode::Slave::Policy &policy() { return _policy; }

View File

@ -58,18 +58,6 @@ static void scale(Genode::Texture<PT> const &src, Genode::Texture<PT> &dst,
} }
/*
* \deprecated
*/
template <typename PT>
static void scale(Genode::Texture<PT> const &src, Genode::Texture<PT> &dst) __attribute__ ((deprecated));
template <typename PT>
static void scale(Genode::Texture<PT> const &src, Genode::Texture<PT> &dst)
{
scale(src, dst, *Genode::env_deprecated()->heap());
}
template <typename SRC_PT, typename DST_PT> template <typename SRC_PT, typename DST_PT>
static void convert_pixel_format(Genode::Texture<SRC_PT> const &src, static void convert_pixel_format(Genode::Texture<SRC_PT> const &src,
Genode::Texture<DST_PT> &dst, Genode::Texture<DST_PT> &dst,
@ -108,20 +96,4 @@ static void convert_pixel_format(Genode::Texture<SRC_PT> const &src,
alloc.free(row, row_num_bytes); alloc.free(row, row_num_bytes);
} }
/*
* deprecated
*/
template <typename SRC_PT, typename DST_PT>
static void convert_pixel_format(Genode::Texture<SRC_PT> const &src,
Genode::Texture<DST_PT> &dst,
unsigned alpha) __attribute__((deprecated));
template <typename SRC_PT, typename DST_PT>
static void convert_pixel_format(Genode::Texture<SRC_PT> const &src,
Genode::Texture<DST_PT> &dst,
unsigned alpha)
{
convert_pixel_format(src, dst, alpha, *Genode::env_deprecated()->heap());
}
#endif /* _INCLUDE__GEMS__TEXTURE_UTILS_H_ */ #endif /* _INCLUDE__GEMS__TEXTURE_UTILS_H_ */

View File

@ -1 +1 @@
2019-01-02 e565ac94881a3f40c03e13e2db9965360f6277bb 2019-01-20 c5ebfed2e8d91d7a1462e65cb832b5daa24db8cd

View File

@ -1 +1 @@
2019-01-13 6c5be1b6c948d0923456df9b31119e87b2e10d22 2019-01-20 929541cb5097e084d18f5f5dd24e0cf49599923d

View File

@ -1 +1 @@
2019-01-13 42c526209e1eb46f33ae9dc497ee6b6d91e30b8e 2019-01-20 da5fd0f48c66e68e850dc77b2e94b89a10a86d05

View File

@ -1 +1 @@
2019-01-13 19e0883b69673ecf033775cd127d40bfc1c13997 2019-01-19-b 546d94be3e5127a925e59a82ebc1043f250ab0aa

View File

@ -1 +1 @@
2019-01-13 49a6661cefac6aaa0087b8d2969b62aacd7a6f5f 2019-01-20 170001467dbeca318f758ed7274a6247f9d01866

View File

@ -1 +1 @@
2019-01-13 d23d2ab4ad486f72fe8e78786bfa9695bfbdda8d 2019-01-20 f30c43e1f1b349150711a1357dbcd2fd3233e3c1

View File

@ -1 +1 @@
2019-01-13 d866fa9f3545e8fd674b259854baffd31e074208 2019-01-20-a 6eed5cb491f02c2308f0a084363dcb9b6bf01625

View File

@ -1 +1 @@
2019-01-13 51bce6f7f3580912d2f31bafaa7671ad209734e8 2019-01-19-b 930fa22ed77135f767389d548667e13198b37743

View File

@ -1 +1 @@
2019-01-13 4aee51adcf3f2c9d4623714189302a8493967fbe 2019-01-19-b 996e2bfa79e3b40788b525f6784a3e31385613b4

View File

@ -1 +1 @@
2019-01-13 60231dc7f56f07135c0fd00d32974fa5a5282c93 2019-01-20 2da6488a81ffeae411a73cb4d9267837ce198286

View File

@ -1 +1 @@
2019-01-13 778c0fdd683db79df583c53b62e635f774e3d413 2019-01-20 f857608bdf30f30df0f6b5260d587d0ae31886f6

View File

@ -242,11 +242,10 @@ void Backdrop::Main::_apply_image(Xml_node operation)
return; return;
} }
char png_file_name[256]; typedef String<256> File_name;
png_file_name[0] = 0; File_name const png_file_name = operation.attribute_value("png", File_name());
operation.attribute("png").value(png_file_name, sizeof(png_file_name));
File file(png_file_name, _heap); File file(png_file_name.string(), _heap);
Anchor anchor(operation); Anchor anchor(operation);
@ -277,7 +276,7 @@ void Backdrop::Main::_apply_image(Xml_node operation)
bool const tiled = operation.attribute_value("tiled", false); bool const tiled = operation.attribute_value("tiled", false);
unsigned alpha = Decorator::attribute(operation, "alpha", 256U); unsigned alpha = operation.attribute_value("alpha", 256U);
/* obtain texture containing the pixels of the PNG image */ /* obtain texture containing the pixels of the PNG image */
Texture<Pixel_rgb888> *png_texture = png_image.texture<Pixel_rgb888>(); Texture<Pixel_rgb888> *png_texture = png_image.texture<Pixel_rgb888>();
@ -313,7 +312,7 @@ void Backdrop::Main::_apply_fill(Xml_node operation)
/* create texture with down-sampled scaled image */ /* create texture with down-sampled scaled image */
typedef Pixel_rgb565 PT; typedef Pixel_rgb565 PT;
Color const color = Decorator::attribute(operation, "color", Color(0, 0, 0)); Color const color = operation.attribute_value("color", Color(0, 0, 0));
_buffer->apply_to_surface<PT>([&] (Surface<PT> &surface) { _buffer->apply_to_surface<PT>([&] (Surface<PT> &surface) {
Box_painter::paint(surface, Surface_base::Rect(Surface_base::Point(0, 0), Box_painter::paint(surface, Surface_base::Rect(Surface_base::Point(0, 0),

View File

@ -131,8 +131,8 @@ class Cpu_load_display::Cpu : public Genode::List<Cpu>::Element
{ {
unsigned long const subject_id = subject.attribute_value("id", 0UL); unsigned long const subject_id = subject.attribute_value("id", 0UL);
char label[sizeof(Timeline::Label)]; Timeline::Label const label =
subject.attribute("label").value(label, sizeof(label)); subject.attribute_value("label", Timeline::Label());
for (Timeline *t = _timelines.first(); t; t = t->next()) { for (Timeline *t = _timelines.first(); t; t = t->next()) {
if (t->has_subject_id(subject_id)) if (t->has_subject_id(subject_id))
@ -140,7 +140,7 @@ class Cpu_load_display::Cpu : public Genode::List<Cpu>::Element
} }
/* add new timeline */ /* add new timeline */
Timeline *t = new (_heap) Timeline(subject_id, Genode::Cstring(label)); Timeline *t = new (_heap) Timeline(subject_id, label);
_timelines.insert(t); _timelines.insert(t);
return t; return t;
} }

View File

@ -35,7 +35,7 @@ namespace Decorator {
}; };
Genode::Texture_base const &texture_by_id(Texture_id, Genode::Texture_base const &texture_by_id(Texture_id,
Genode::Ram_session &, Genode::Ram_allocator &,
Genode::Region_map &); Genode::Region_map &);
class Canvas_base; class Canvas_base;
@ -62,13 +62,13 @@ class Decorator::Canvas : public Decorator::Canvas_base
{ {
private: private:
Genode::Ram_session &_ram; Genode::Ram_allocator &_ram;
Genode::Region_map &_rm; Genode::Region_map &_rm;
Genode::Surface<PT> _surface; Genode::Surface<PT> _surface;
public: public:
Canvas(PT *base, Area size, Genode::Ram_session &ram, Genode::Region_map &rm) Canvas(PT *base, Area size, Genode::Ram_allocator &ram, Genode::Region_map &rm)
: _ram(ram), _rm(rm), _surface(base, size) { } : _ram(ram), _rm(rm), _surface(base, size) { }
Rect clip() const override { return _surface.clip(); } Rect clip() const override { return _surface.clip(); }

View File

@ -186,8 +186,8 @@ struct Decorator::Main : Window_factory_base
for (unsigned retry = 0 ; retry < 2; retry ++) { for (unsigned retry = 0 ; retry < 2; retry ++) {
try { try {
return new (_heap) return new (_heap)
Window(attribute(window_node, "id", 0UL), _nitpicker, Window(window_node.attribute_value("id", 0UL),
_animator, _decorator_config); _nitpicker, _animator, _decorator_config);
} }
catch (Genode::Out_of_ram) { catch (Genode::Out_of_ram) {
Genode::log("Handle Out_of_ram of nitpicker session - upgrade by 8K"); Genode::log("Handle Out_of_ram of nitpicker session - upgrade by 8K");

View File

@ -33,7 +33,7 @@ class Icon_texture : public Chunky_texture<PT>
*/ */
enum { WIDTH = 14, HEIGHT = 14 }; enum { WIDTH = 14, HEIGHT = 14 };
Icon_texture(Ram_session &ram, Region_map &rm, Icon_texture(Ram_allocator &ram, Region_map &rm,
unsigned char rgba_data[]) unsigned char rgba_data[])
: :
Chunky_texture<PT>(ram, rm, Surface_base::Area(WIDTH, HEIGHT)) Chunky_texture<PT>(ram, rm, Surface_base::Area(WIDTH, HEIGHT))
@ -60,7 +60,7 @@ extern unsigned char _binary_windowed_rgba_start[];
* Return texture for the specified texture ID * Return texture for the specified texture ID
*/ */
Texture_base const & Texture_base const &
Decorator::texture_by_id(Texture_id id, Ram_session &ram, Region_map &rm) Decorator::texture_by_id(Texture_id id, Ram_allocator &ram, Region_map &rm)
{ {
static Icon_texture<Pixel_rgb565> const icons[4] { static Icon_texture<Pixel_rgb565> const icons[4] {
{ ram, rm, _binary_closer_rgba_start }, { ram, rm, _binary_closer_rgba_start },

View File

@ -216,8 +216,8 @@ bool Decorator::Window::update(Genode::Xml_node window_node)
_focused = window_node.attribute_value( "focused", false); _focused = window_node.attribute_value( "focused", false);
_has_alpha = window_node.attribute_value("has_alpha", false); _has_alpha = window_node.attribute_value("has_alpha", false);
Window_title title = Decorator::string_attribute(window_node, "title", Window_title const title =
Window_title("<untitled>")); window_node.attribute_value("title", Window_title("<untitled>"));
updated |= !(title == _title); updated |= !(title == _title);
_title = title; _title = title;

View File

@ -196,7 +196,8 @@ void Child::_gen_routes(Xml_generator &xml,
*/ */
if (_start_xml->xml().has_sub_node("route")) { if (_start_xml->xml().has_sub_node("route")) {
Xml_node const route = _start_xml->xml().sub_node("route"); Xml_node const route = _start_xml->xml().sub_node("route");
xml.append(route.content_base(), route.content_size()); route.with_raw_content([&] (char const *start, size_t length) {
xml.append(start, length); });
} }
/* /*
@ -204,7 +205,8 @@ void Child::_gen_routes(Xml_generator &xml,
*/ */
if (_launcher_xml.constructed() && _launcher_xml->xml().has_sub_node("route")) { if (_launcher_xml.constructed() && _launcher_xml->xml().has_sub_node("route")) {
Xml_node const route = _launcher_xml->xml().sub_node("route"); Xml_node const route = _launcher_xml->xml().sub_node("route");
xml.append(route.content_base(), route.content_size()); route.with_raw_content([&] (char const *start, size_t length) {
xml.append(start, length); });
} }
/** /**
@ -255,7 +257,8 @@ void Child::_gen_routes(Xml_generator &xml,
/* /*
* Add common routes as defined in our config. * Add common routes as defined in our config.
*/ */
xml.append(common.content_base(), common.content_size()); common.with_raw_content([&] (char const *start, size_t length) {
xml.append(start, length); });
/* /*
* Add ROM routing rule with the label rewritten to the path within the * Add ROM routing rule with the label rewritten to the path within the
@ -357,7 +360,8 @@ void Child::_gen_copy_of_sub_node(Xml_generator &xml,
return; return;
Xml_node const sub_node = from_node.sub_node(sub_node_type.string()); Xml_node const sub_node = from_node.sub_node(sub_node_type.string());
xml.append(sub_node.addr(), sub_node.size()); sub_node.with_raw_node([&] (char const *start, size_t length) {
xml.append(start, length); });
} }
@ -592,19 +596,10 @@ void Child::log_session_write(Log_event::Line const &log_line)
void Child::apply_config(Xml_node start_node) void Child::apply_config(Xml_node start_node)
{ {
if (_skip) { if (_skip)
return; } return;
/* if (!start_node.differs_from(_start_xml->xml()))
* String-compare new with current start node to quicky skip
* the start nodes that have not changed.
*/
bool const start_node_changed =
(start_node.size() != _start_xml->xml().size()) ||
(strcmp(start_node.addr(), _start_xml->xml().addr(),
start_node.size()) != 0);
if (!start_node_changed)
return; return;
Archive::Path const old_pkg_path = _config_pkg_path(); Archive::Path const old_pkg_path = _config_pkg_path();
@ -657,8 +652,8 @@ void Child::apply_blueprint(Xml_node pkg)
void Child::apply_launcher(Launcher_name const &name, void Child::apply_launcher(Launcher_name const &name,
Xml_node launcher) Xml_node launcher)
{ {
if (_skip) { if (_skip)
return; } return;
if (!_defined_by_launcher()) if (!_defined_by_launcher())
return; return;
@ -666,15 +661,8 @@ void Child::apply_launcher(Launcher_name const &name,
if (_launcher_name() != name) if (_launcher_name() != name)
return; return;
if (_launcher_xml.constructed()) { if (_launcher_xml.constructed() && !launcher.differs_from(_launcher_xml->xml()))
bool const launcher_changed =
(launcher.size() != _launcher_xml->xml().size()) ||
(strcmp(launcher.addr(), _launcher_xml->xml().addr(),
launcher.size()) != 0);
if (!launcher_changed)
return; return;
}
_launcher_xml.construct(_alloc, launcher); _launcher_xml.construct(_alloc, launcher);
@ -887,14 +875,30 @@ void Timeout_event::_handle_timeout(Duration)
** Log_event ** ** Log_event **
***************/ ***************/
static char const *xml_content_base(Xml_node node)
{
char const *result = nullptr;
node.with_raw_content([&] (char const *start, size_t) { result = start; });
return result;
}
static size_t xml_content_size(Xml_node node)
{
size_t result = 0;
node.with_raw_content([&] (char const *, size_t length) { result = length; });
return result;
}
Log_event::Log_event(Xml_node const &xml) Log_event::Log_event(Xml_node const &xml)
: :
Event { xml, Type::LOG }, Event { xml, Type::LOG },
_base { xml.content_base() }, _base { xml_content_base(xml) },
_size { xml.content_size() }, _size { xml_content_size(xml) },
_remaining_base { xml.content_base() }, _remaining_base { xml_content_base(xml) },
_remaining_end { _remaining_base + xml.content_size() }, _remaining_end { _remaining_base + xml_content_size(xml) },
_reset_to { xml.content_base() } _reset_to { xml_content_base(xml) }
{ } { }

View File

@ -147,7 +147,8 @@ struct Depot_deploy::Main
bool finished; bool finished;
_init_config_reporter.generate([&] (Xml_generator &xml) { _init_config_reporter.generate([&] (Xml_generator &xml) {
Xml_node static_config = config.sub_node("static"); Xml_node static_config = config.sub_node("static");
xml.append(static_config.content_base(), static_config.content_size()); static_config.with_raw_content([&] (char const *start, size_t length) {
xml.append(start, length); });
Child::Depot_rom_server const parent { }; Child::Depot_rom_server const parent { };
finished = _children.gen_start_nodes(xml, config.sub_node("common_routes"), finished = _children.gen_start_nodes(xml, config.sub_node("common_routes"),
parent, parent); parent, parent);
@ -189,9 +190,9 @@ struct Depot_deploy::Main
log("\n--- Finished after ", time_sec + previous_time_sec, ".", time_ms < 10 ? "00" : time_ms < 100 ? "0" : "", time_ms, " sec ---\n"); log("\n--- Finished after ", time_sec + previous_time_sec, ".", time_ms < 10 ? "00" : time_ms < 100 ? "0" : "", time_ms, " sec ---\n");
if (config.has_sub_node("previous-results")) { if (config.has_sub_node("previous-results")) {
Xml_node const previous_results = config.sub_node("previous-results"); Xml_node const previous_results = config.sub_node("previous-results");
if (previous_results.content_size()) { previous_results.with_raw_content([&] (char const *start, size_t length) {
log(Cstring(previous_results.content_base(), previous_results.content_size())); if (length)
} log(Cstring(start, length)); });
} }
_children.print_conclusion(); _children.print_conclusion();
log(""); log("");

View File

@ -132,7 +132,8 @@ class Depot_deploy::Child : public List_model<Child>::Element
return; return;
Xml_node const sub_node = from_node.sub_node(sub_node_type.string()); Xml_node const sub_node = from_node.sub_node(sub_node_type.string());
xml.append(sub_node.addr(), sub_node.size()); sub_node.with_raw_node([&] (char const *start, size_t length) {
xml.append(start, length); });
} }
public: public:
@ -148,16 +149,7 @@ class Depot_deploy::Child : public List_model<Child>::Element
void apply_config(Xml_node start_node) void apply_config(Xml_node start_node)
{ {
/* if (!start_node.differs_from(_start_xml->xml()))
* String-compare new with current start node to quicky skip
* the start nodes that have not changed.
*/
bool const start_node_changed =
(start_node.size() != _start_xml->xml().size()) ||
(strcmp(start_node.addr(), _start_xml->xml().addr(),
start_node.size()) != 0);
if (!start_node_changed)
return; return;
Archive::Path const old_pkg_path = _config_pkg_path(); Archive::Path const old_pkg_path = _config_pkg_path();
@ -205,15 +197,8 @@ class Depot_deploy::Child : public List_model<Child>::Element
if (_launcher_name() != name) if (_launcher_name() != name)
return; return;
if (_launcher_xml.constructed()) { if (_launcher_xml.constructed() && !launcher.differs_from(_launcher_xml->xml()))
bool const launcher_changed =
(launcher.size() != _launcher_xml->xml().size()) ||
(strcmp(launcher.addr(), _launcher_xml->xml().addr(),
launcher.size()) != 0);
if (!launcher_changed)
return; return;
}
_launcher_xml.construct(_alloc, launcher); _launcher_xml.construct(_alloc, launcher);
@ -426,7 +411,8 @@ void Depot_deploy::Child::_gen_routes(Xml_generator &xml, Xml_node common,
*/ */
if (_start_xml->xml().has_sub_node("route")) { if (_start_xml->xml().has_sub_node("route")) {
Xml_node const route = _start_xml->xml().sub_node("route"); Xml_node const route = _start_xml->xml().sub_node("route");
xml.append(route.content_base(), route.content_size()); route.with_raw_content([&] (char const *start, size_t length) {
xml.append(start, length); });
} }
/* /*
@ -434,7 +420,8 @@ void Depot_deploy::Child::_gen_routes(Xml_generator &xml, Xml_node common,
*/ */
if (_launcher_xml.constructed() && _launcher_xml->xml().has_sub_node("route")) { if (_launcher_xml.constructed() && _launcher_xml->xml().has_sub_node("route")) {
Xml_node const route = _launcher_xml->xml().sub_node("route"); Xml_node const route = _launcher_xml->xml().sub_node("route");
xml.append(route.content_base(), route.content_size()); route.with_raw_content([&] (char const *start, size_t length) {
xml.append(start, length); });
} }
/** /**
@ -485,7 +472,8 @@ void Depot_deploy::Child::_gen_routes(Xml_generator &xml, Xml_node common,
/* /*
* Add common routes as defined in our config. * Add common routes as defined in our config.
*/ */
xml.append(common.content_base(), common.content_size()); common.with_raw_content([&] (char const *start, size_t length) {
xml.append(start, length); });
/* /*
* Add ROM routing rule with the label rewritten to the path within the * Add ROM routing rule with the label rewritten to the path within the

View File

@ -62,7 +62,8 @@ struct Depot_deploy::Main
/* generate init config containing all configured start nodes */ /* generate init config containing all configured start nodes */
_init_config_reporter.generate([&] (Xml_generator &xml) { _init_config_reporter.generate([&] (Xml_generator &xml) {
Xml_node static_config = config.sub_node("static"); Xml_node static_config = config.sub_node("static");
xml.append(static_config.content_base(), static_config.content_size()); static_config.with_raw_content([&] (char const *start, size_t length) {
xml.append(start, length); });
Child::Depot_rom_server const parent { }; Child::Depot_rom_server const parent { };
_children.gen_start_nodes(xml, config.sub_node("common_routes"), _children.gen_start_nodes(xml, config.sub_node("common_routes"),
parent, parent); parent, parent);

View File

@ -472,7 +472,8 @@ void Depot_query::Main::_query_blueprint(Directory::Path const &pkg_path, Xml_ge
String<160> comment("\n\n<!-- content of '", pkg_path, "/runtime' -->\n"); String<160> comment("\n\n<!-- content of '", pkg_path, "/runtime' -->\n");
xml.append(comment.string()); xml.append(comment.string());
xml.append(node.addr(), node.size()); node.with_raw_node([&] (char const *start, size_t length) {
xml.append(start, length); });
xml.append("\n"); xml.append("\n");
}); });
}); });

View File

@ -669,7 +669,8 @@ void Driver_manager::Main::_generate_usb_drv_config(Reporter &usb_drv_config,
xml.node("report", [&] () { xml.attribute("devices", true); }); xml.node("report", [&] () { xml.attribute("devices", true); });
/* incorporate user-managed policy */ /* incorporate user-managed policy */
xml.append(policy.content_base(), policy.content_size()); policy.with_raw_content([&] (char const *start, size_t length) {
xml.append(start, length); });
devices.for_each_sub_node("device", [&] (Xml_node device) { devices.for_each_sub_node("device", [&] (Xml_node device) {

View File

@ -48,7 +48,8 @@ struct Fs_query::Watched_file
if (!node.has_type("empty")) { if (!node.has_type("empty")) {
xml.attribute("xml", "yes"); xml.attribute("xml", "yes");
xml.append("\n"); xml.append("\n");
xml.append(node.addr(), node.size()); node.with_raw_node([&] (char const *start, size_t length) {
xml.append(start, length); });
content_is_xml = true; content_is_xml = true;
} }
}); });

View File

@ -150,8 +150,7 @@ class Launcher::Context_dialog : Input_event_handler, Dialog_generator,
for (Element *e = _elements.first(); e; e = e->next()) { for (Element *e = _elements.first(); e; e = e->next()) {
Label const label = Label const label = button.attribute_value("name", Label(""));
Decorator::string_attribute(button, "name", Label(""));
if (e->label == label) if (e->label == label)
e->hovered = true; e->hovered = true;

View File

@ -187,7 +187,7 @@ class Launcher::Fading_dialog : private Input_event_handler
_hover_rom(report_rom_slave.policy(), Slave::Args("label=", hover_name)), _hover_rom(report_rom_slave.policy(), Slave::Args("label=", hover_name)),
_hover_report(report_rom_slave.policy(), _hover_report(report_rom_slave.policy(),
Slave::Args("label=", hover_name, ", buffer_size=4096")), Slave::Args("label=", hover_name, ", buffer_size=4096")),
_dialog_reporter(env.rm(), "dialog", _dialog_report), _dialog_reporter(env.rm(), "dialog", _dialog_report.rpc_cap()),
_dialog_input_event_handler(input_event_handler), _dialog_input_event_handler(input_event_handler),
_hover_handler(hover_handler), _hover_handler(hover_handler),
_dialog_generator(dialog_generator), _dialog_generator(dialog_generator),
@ -196,12 +196,11 @@ class Launcher::Fading_dialog : private Input_event_handler
_fader_slave_ep(&env.pd(), _fader_slave_ep_stack_size, "nit_fader"), _fader_slave_ep(&env.pd(), _fader_slave_ep_stack_size, "nit_fader"),
_nitpicker_connection(env, "menu"), _nitpicker_connection(env, "menu"),
_nitpicker_session(env, _nitpicker_connection, env.ep(), _fader_slave_ep, *this), _nitpicker_session(env, _nitpicker_connection, env.ep(), _fader_slave_ep, *this),
_nit_fader_slave(_fader_slave_ep, env.rm(), env.pd(), env.pd_session_cap(), _nit_fader_slave(env, _fader_slave_ep, _nitpicker_service),
_nitpicker_service),
_nit_fader_connection(env.rm(), _nit_fader_slave.policy(), Slave::Args("label=menu")), _nit_fader_connection(env.rm(), _nit_fader_slave.policy(), Slave::Args("label=menu")),
_menu_view_slave(env.rm(), env.pd(), env.pd_session_cap(), _menu_view_slave(env, _nit_fader_connection.rpc_cap(),
_nit_fader_connection, _dialog_rom.rpc_cap(), _hover_report.rpc_cap(),
_dialog_rom, _hover_report, initial_position) initial_position)
{ {
Rom_session_client(_hover_rom).sigh(_hover_update_handler); Rom_session_client(_hover_rom).sigh(_hover_update_handler);
} }

View File

@ -42,9 +42,7 @@ struct Launcher::Main
" <policy label=\"context_hover\" report=\"context_hover\"/>" " <policy label=\"context_hover\" report=\"context_hover\"/>"
"</config>"; "</config>";
Report_rom_slave _report_rom_slave { Report_rom_slave _report_rom_slave { _env, _report_rom_config };
_env.rm(), _env.pd(), _env.pd_session_cap(), _env.ram(), _env.ram_session_cap(),
_report_rom_config };
/** /**
* Nitpicker session used to perform session-control operations on the * Nitpicker session used to perform session-control operations on the

View File

@ -56,8 +56,8 @@ class Launcher::Menu_dialog : Input_event_handler, Dialog_generator,
Element(Xml_node node) Element(Xml_node node)
: :
label(Decorator::string_attribute(node, "name", Label(""))), label(node.attribute_value("name", Label(""))),
title(Decorator::string_attribute(node, "title", Title(label.string()))) title(node.attribute_value("title", Title(label.string())))
{ } { }
}; };
@ -163,8 +163,7 @@ class Launcher::Menu_dialog : Input_event_handler, Dialog_generator,
for (Element *e = _elements.first(); e; e = e->next()) { for (Element *e = _elements.first(); e; e = e->next()) {
Label const label = Label const label = button.attribute_value("name", Label(""));
Decorator::string_attribute(button, "name", Label(""));
if (e->label == label) { if (e->label == label) {
e->hovered = true; e->hovered = true;

View File

@ -37,16 +37,20 @@ class Launcher::Menu_view_slave
private: private:
class Policy struct Policy_base
: {
private Genode::Static_parent_services<Genode::Cpu_session, Genode::Static_parent_services<Genode::Cpu_session,
Genode::Pd_session, Genode::Pd_session,
Genode::Ram_session,
Genode::Rom_session, Genode::Rom_session,
Genode::Log_session, Genode::Log_session,
File_system::Session, File_system::Session,
Timer::Session>, Timer::Session>
public Genode::Slave::Policy _parent_services;
Policy_base(Env &env) : _parent_services(env) { }
};
class Policy : Policy_base, public Genode::Slave::Policy
{ {
private: private:
@ -80,20 +84,35 @@ class Launcher::Menu_view_slave
static Genode::Ram_quota _quota() { return { 6*1024*1024 }; } static Genode::Ram_quota _quota() { return { 6*1024*1024 }; }
static Genode::Cap_quota _caps() { return { 100 }; } static Genode::Cap_quota _caps() { return { 100 }; }
Service &_matching_service(Genode::Service::Name const &service,
Genode::Session_label const &label)
{
if (service == "Nitpicker")
return _nitpicker.service();
if ((service == "ROM") && (label == "menu_view -> dialog"))
return _dialog_rom.service();
if ((service == "Report") && (label == "menu_view -> hover"))
return _hover_report.service();
throw Genode::Service_denied();
}
public: public:
Policy(Genode::Rpc_entrypoint &ep, Policy(Genode::Env &env,
Genode::Region_map &rm, Genode::Rpc_entrypoint &ep,
Genode::Pd_session &ref_pd,
Genode::Pd_session_capability ref_pd_cap,
Capability<Nitpicker::Session> nitpicker_session, Capability<Nitpicker::Session> nitpicker_session,
Capability<Rom_session> dialog_rom_session, Capability<Rom_session> dialog_rom_session,
Capability<Report::Session> hover_report_session, Capability<Report::Session> hover_report_session,
Position position) Position position)
: :
Genode::Slave::Policy(_name(), _name(), *this, ep, rm, Policy_base(env),
ref_pd, ref_pd_cap, _caps(), _quota()), Genode::Slave::Policy(env, _name(), _name(),
_nitpicker(rm, nitpicker_session), Policy_base::_parent_services,
ep, _caps(), _quota()),
_nitpicker(env.rm(), nitpicker_session),
_dialog_rom(dialog_rom_session), _dialog_rom(dialog_rom_session),
_hover_report(hover_report_session), _hover_report(hover_report_session),
_position(position) _position(position)
@ -103,21 +122,17 @@ class Launcher::Menu_view_slave
void position(Position pos) { _configure(pos); } void position(Position pos) { _configure(pos); }
Genode::Service &resolve_session_request(Genode::Service::Name const &service, Route resolve_session_request(Genode::Service::Name const &name,
Genode::Session_state::Args const &args) override Genode::Session_label const &label) override
{ {
if (service == "Nitpicker") try {
return _nitpicker.service(); return Route { .service = _matching_service(name, label),
.label = label,
.diag = Genode::Session::Diag() };
}
catch (Genode::Service_denied) { }
Genode::Session_label const label(label_from_args(args.string())); return Genode::Slave::Policy::resolve_session_request(name, label);
if ((service == "ROM") && (label == "menu_view -> dialog"))
return _dialog_rom.service();
if ((service == "Report") && (label == "menu_view -> hover"))
return _hover_report.service();
return Genode::Slave::Policy::resolve_session_request(service, args);
} }
}; };
@ -131,19 +146,17 @@ class Launcher::Menu_view_slave
/** /**
* Constructor * Constructor
*/ */
Menu_view_slave(Genode::Region_map &rm, Menu_view_slave(Genode::Env &env,
Genode::Pd_session &ref_pd,
Genode::Pd_session_capability ref_pd_cap,
Capability<Nitpicker::Session> nitpicker_session, Capability<Nitpicker::Session> nitpicker_session,
Capability<Rom_session> dialog_rom_session, Capability<Rom_session> dialog_rom_session,
Capability<Report::Session> hover_report_session, Capability<Report::Session> hover_report_session,
Position initial_position) Position initial_position)
: :
_ep(&ref_pd, _ep_stack_size, "nit_fader"), _ep(&env.pd(), _ep_stack_size, "nit_fader"),
_policy(_ep, rm, ref_pd, ref_pd_cap, _policy(env, _ep,
nitpicker_session, dialog_rom_session, nitpicker_session, dialog_rom_session,
hover_report_session, initial_position), hover_report_session, initial_position),
_child(rm, _ep, _policy) _child(env.rm(), _ep, _policy)
{ } { }
void position(Position position) { _policy.position(position); } void position(Position position) { _policy.position(position); }

View File

@ -29,15 +29,19 @@ class Launcher::Nit_fader_slave
{ {
private: private:
class Policy struct Policy_base
: {
private Genode::Static_parent_services<Genode::Ram_session, Genode::Static_parent_services<Genode::Cpu_session,
Genode::Cpu_session,
Genode::Pd_session, Genode::Pd_session,
Genode::Rom_session, Genode::Rom_session,
Genode::Log_session, Genode::Log_session,
Timer::Session>, Timer::Session>
public Slave::Policy _parent_services;
Policy_base(Env &env) : _parent_services(env) { }
};
class Policy : Policy_base, public Slave::Policy
{ {
private: private:
@ -51,14 +55,14 @@ class Launcher::Nit_fader_slave
public: public:
Policy(Rpc_entrypoint &ep, Policy(Env &env,
Region_map &rm, Rpc_entrypoint &ep,
Pd_session &ref_pd,
Pd_session_capability ref_pd_cap,
Genode::Service &nitpicker_service) Genode::Service &nitpicker_service)
: :
Genode::Slave::Policy(_name(), _name(), *this, ep, rm, Policy_base(env),
ref_pd, ref_pd_cap, _caps(), _quota()), Genode::Slave::Policy(env, _name(), _name(),
Policy_base::_parent_services,
ep, _caps(), _quota()),
_nitpicker_service(nitpicker_service) _nitpicker_service(nitpicker_service)
{ {
visible(false); visible(false);
@ -72,13 +76,15 @@ class Launcher::Nit_fader_slave
configure(config, strlen(config) + 1); configure(config, strlen(config) + 1);
} }
Genode::Service &resolve_session_request(Genode::Service::Name const &service, Route resolve_session_request(Genode::Service::Name const &service,
Genode::Session_state::Args const &args) override Genode::Session_label const &label) override
{ {
if (service == Nitpicker::Session::service_name()) if (service == Nitpicker::Session::service_name())
return _nitpicker_service; return Route { .service = _nitpicker_service,
.label = label,
.diag = Session::Diag() };
return Genode::Slave::Policy::resolve_session_request(service, args); return Genode::Slave::Policy::resolve_session_request(service, label);
} }
}; };
@ -91,17 +97,13 @@ class Launcher::Nit_fader_slave
* Constructor * Constructor
* *
* \param ep entrypoint used for nitpicker child thread * \param ep entrypoint used for nitpicker child thread
* \param ref_ram RAM session used to allocate the configuration
* dataspace and child memory
*/ */
Nit_fader_slave(Rpc_entrypoint &ep, Nit_fader_slave(Env &env,
Genode::Region_map &rm, Rpc_entrypoint &ep,
Pd_session &ref_pd,
Pd_session_capability ref_pd_cap,
Genode::Service &nitpicker_service) Genode::Service &nitpicker_service)
: :
_policy(ep, rm, ref_pd, ref_pd_cap, nitpicker_service), _policy(env, ep, nitpicker_service),
_child(rm, ep, _policy) _child(env.rm(), ep, _policy)
{ {
visible(false); visible(false);
} }

View File

@ -323,8 +323,7 @@ class Launcher::Panel_dialog : Input_event_handler, Dialog_generator,
for (Element *e = _elements.first(); e; e = e->next()) { for (Element *e = _elements.first(); e; e = e->next()) {
Label const label = Label const label = button.attribute_value("name", Label(""));
Decorator::string_attribute(button, "name", Label(""));
if (e->label == label) { if (e->label == label) {
e->hovered = true; e->hovered = true;

View File

@ -24,7 +24,6 @@
namespace Launcher { namespace Launcher {
class Subsystem_manager; class Subsystem_manager;
using Decorator::string_attribute;
using Cli_monitor::Ram; using Cli_monitor::Ram;
using namespace Genode; using namespace Genode;
} }
@ -107,8 +106,8 @@ class Launcher::Subsystem_manager
Genode::Signal_context_capability _exited_child_sig_cap; Genode::Signal_context_capability _exited_child_sig_cap;
Ram _ram { _env.ram(), Ram _ram { _env.pd(),
_env.ram_session_cap(), _env.pd_session_cap(),
_ram_preservation, _ram_preservation,
_yield_broadcast_handler, _yield_broadcast_handler,
_resource_avail_handler }; _resource_avail_handler };
@ -116,8 +115,8 @@ class Launcher::Subsystem_manager
static Child::Binary_name _binary_name(Xml_node subsystem) static Child::Binary_name _binary_name(Xml_node subsystem)
{ {
try { try {
return string_attribute(subsystem.sub_node("binary"), return subsystem.sub_node("binary")
"name", Child::Binary_name("")); .attribute_value("name", Child::Binary_name());
} catch (Xml_node::Nonexistent_sub_node) { } catch (Xml_node::Nonexistent_sub_node) {
Genode::error("missing <binary> definition"); Genode::error("missing <binary> definition");
throw Invalid_config(); throw Invalid_config();
@ -133,10 +132,10 @@ class Launcher::Subsystem_manager
subsystem.for_each_sub_node("resource", [&] (Xml_node rsc) { subsystem.for_each_sub_node("resource", [&] (Xml_node rsc) {
if (rsc.attribute("name").has_value("RAM")) { if (rsc.attribute("name").has_value("RAM")) {
rsc.attribute("quantum").value(&quantum); rsc.attribute("quantum").value(quantum);
if (rsc.has_attribute("limit")) if (rsc.has_attribute("limit"))
rsc.attribute("limit").value(&limit); rsc.attribute("limit").value(limit);
} }
}); });
} catch (...) { } catch (...) {
@ -178,7 +177,7 @@ class Launcher::Subsystem_manager
{ {
Child::Binary_name const binary_name = _binary_name(subsystem); Child::Binary_name const binary_name = _binary_name(subsystem);
Label const label = string_attribute(subsystem, "name", Label("")); Label const label = subsystem.attribute_value("name", Label(""));
Ram_config const ram_config = _ram_config(subsystem); Ram_config const ram_config = _ram_config(subsystem);
@ -186,33 +185,38 @@ class Launcher::Subsystem_manager
try { try {
Child *child = new (_heap) Child *child = new (_heap)
Child(_ram, _heap, label, binary_name.string(), Child(_env, _ram, _heap, label, binary_name.string(),
_env.pd(), _env.pd(),
_env.pd_session_cap(), _env.pd_session_cap(),
_env.ram(),
_env.ram_session_cap(),
_env.rm(), _env.rm(),
_caps_config(subsystem), _caps_config(subsystem),
ram_config.quantum, ram_config.limit, ram_config.quantum, ram_config.limit,
_yield_broadcast_handler, _yield_broadcast_handler,
_exited_child_sig_cap); _exited_child_sig_cap);
auto configure_with_xml = [&] (Xml_node config)
{
config.with_raw_node([&] (char const *start, size_t length) {
child->configure(start, length); });
};
/* configure child */ /* configure child */
try { try {
if (subsystem.has_sub_node("configfile")) { if (subsystem.has_sub_node("configfile")) {
Genode::String<96> name; Xml_node const node = subsystem.sub_node("configfile");
Xml_node node = subsystem.sub_node("configfile");
Xml_attribute attr = node.attribute("name"); typedef Genode::String<96> Name;
attr.value(&name); Name const name = node.attribute_value("name", Name());
Attached_rom_dataspace rom(_env, name.string()); Attached_rom_dataspace rom(_env, name.string());
Xml_node config_node = rom.xml(); configure_with_xml(rom.xml());
child->configure(config_node.addr(), config_node.size());
} else if (subsystem.has_sub_node("config")) {
configure_with_xml(subsystem.sub_node("config"));
} else { } else {
Xml_node config_node = subsystem.sub_node("config"); configure_with_xml(Xml_node("<config/>"));
child->configure(config_node.addr(), config_node.size());
} }
} catch (...) { } } catch (...) { warning("failed to configure child ", label); }
_children.insert(child); _children.insert(child);

View File

@ -36,7 +36,7 @@ struct Menu_view::Label_widget : Widget
void update(Xml_node node) void update(Xml_node node)
{ {
font = _factory.styles.font(node); font = _factory.styles.font(node);
text = Decorator::string_attribute(node, "text", Text("")); text = node.attribute_value("text", Text(""));
} }
Area min_size() const override Area min_size() const override

View File

@ -48,7 +48,7 @@ class Menu_view::Style_database
* *
* \throw Reading_failed * \throw Reading_failed
*/ */
Texture_entry(Ram_session &ram, Region_map &rm, Texture_entry(Ram_allocator &ram, Region_map &rm,
Allocator &alloc, Path const &path) Allocator &alloc, Path const &path)
: :
path(path), path(path),
@ -82,7 +82,7 @@ class Menu_view::Style_database
catch (...) { throw Reading_failed(); } catch (...) { throw Reading_failed(); }
}; };
Ram_session &_ram; Ram_allocator &_ram;
Region_map &_rm; Region_map &_rm;
Allocator &_alloc; Allocator &_alloc;
Directory const &_fonts_dir; Directory const &_fonts_dir;
@ -118,7 +118,7 @@ class Menu_view::Style_database
public: public:
Style_database(Ram_session &ram, Region_map &rm, Allocator &alloc, Style_database(Ram_allocator &ram, Region_map &rm, Allocator &alloc,
Directory const &fonts_dir) Directory const &fonts_dir)
: :
_ram(ram), _rm(rm), _alloc(alloc), _fonts_dir(fonts_dir) _ram(ram), _rm(rm), _alloc(alloc), _fonts_dir(fonts_dir)

View File

@ -83,17 +83,9 @@ class Menu_view::Widget : List_model<Widget>::Element
bool valid() const { return value != 0; } bool valid() const { return value != 0; }
}; };
static Type_name node_type_name(Xml_node node)
{
char type[NAME_MAX_LEN];
node.type_name(type, sizeof(type));
return Type_name(Cstring(type));
}
static Name node_name(Xml_node node) static Name node_name(Xml_node node)
{ {
return Decorator::string_attribute(node, "name", node_type_name(node)); return node.attribute_value("name", Name(node.type()));
} }
private: private:
@ -204,7 +196,7 @@ class Menu_view::Widget : List_model<Widget>::Element
Widget(Widget_factory &factory, Xml_node node, Unique_id unique_id) Widget(Widget_factory &factory, Xml_node node, Unique_id unique_id)
: :
_type_name(node_type_name(node)), _type_name(node.type()),
_name(node_name(node)), _name(node_name(node)),
_unique_id(unique_id), _unique_id(unique_id),
_factory(factory) _factory(factory)

View File

@ -177,7 +177,8 @@ void Sculpt::Deploy::gen_runtime_start_nodes(Xml_generator &xml) const
/* insert content of '<static>' node as is */ /* insert content of '<static>' node as is */
if (managed_deploy.has_sub_node("static")) { if (managed_deploy.has_sub_node("static")) {
Xml_node static_config = managed_deploy.sub_node("static"); Xml_node static_config = managed_deploy.sub_node("static");
xml.append(static_config.content_base(), static_config.content_size()); static_config.with_raw_content([&] (char const *start, size_t length) {
xml.append(start, length); });
} }
/* generate start nodes for deployed packages */ /* generate start nodes for deployed packages */

View File

@ -81,7 +81,8 @@ struct Sculpt::Deploy
auto append_xml_node = [&] (Xml_node node) { auto append_xml_node = [&] (Xml_node node) {
xml.append("\t"); xml.append("\t");
xml.append(node.addr(), node.size()); node.with_raw_node([&] (char const *start, size_t length) {
xml.append(start, length); });
xml.append("\n"); xml.append("\n");
}; };

View File

@ -166,8 +166,8 @@ struct Decorator::Main : Window_factory_base
Window_base *create(Xml_node window_node) override Window_base *create(Xml_node window_node) override
{ {
return new (_heap) return new (_heap)
Window(_env, attribute(window_node, "id", 0UL), _nitpicker, _animator, Window(_env, window_node.attribute_value("id", 0UL),
_theme, _decorator_config); _nitpicker, _animator, _theme, _decorator_config);
} }
/** /**

View File

@ -39,7 +39,7 @@ struct Texture_from_png_file
Png_image png_image; Png_image png_image;
Texture &texture { *png_image.texture<Genode::Pixel_rgb888>() }; Texture &texture { *png_image.texture<Genode::Pixel_rgb888>() };
Texture_from_png_file(Genode::Ram_session &ram, Genode::Region_map &rm, Texture_from_png_file(Genode::Ram_allocator &ram, Genode::Region_map &rm,
Genode::Allocator &alloc, char const *path) Genode::Allocator &alloc, char const *path)
: :
png_file(path, alloc), png_image(ram, rm, alloc, png_file.data<void>()) png_file(path, alloc), png_image(ram, rm, alloc, png_file.data<void>())
@ -48,7 +48,7 @@ struct Texture_from_png_file
static Genode::Texture<Genode::Pixel_rgb888> const & static Genode::Texture<Genode::Pixel_rgb888> const &
texture_by_id(Genode::Ram_session &ram, Genode::Region_map &rm, texture_by_id(Genode::Ram_allocator &ram, Genode::Region_map &rm,
Genode::Allocator &alloc, Texture_id texture_id) Genode::Allocator &alloc, Texture_id texture_id)
{ {
if (texture_id == TEXTURE_ID_DEFAULT) { if (texture_id == TEXTURE_ID_DEFAULT) {
@ -72,7 +72,7 @@ texture_by_id(Genode::Ram_session &ram, Genode::Region_map &rm,
static Genode::Texture<Genode::Pixel_rgb888> const & static Genode::Texture<Genode::Pixel_rgb888> const &
texture_by_element_type(Genode::Ram_session &ram, Genode::Region_map &rm, texture_by_element_type(Genode::Ram_allocator &ram, Genode::Region_map &rm,
Genode::Allocator &alloc, Decorator::Theme::Element_type type) Genode::Allocator &alloc, Decorator::Theme::Element_type type)
{ {
switch (type) { switch (type) {
@ -157,7 +157,7 @@ Decorator::Rect Decorator::Theme::title_geometry() const
static Decorator::Rect static Decorator::Rect
element_geometry(Genode::Ram_session &ram, Genode::Region_map &rm, element_geometry(Genode::Ram_allocator &ram, Genode::Region_map &rm,
Genode::Allocator &alloc, char const *sub_node_type, Genode::Allocator &alloc, char const *sub_node_type,
Texture_id texture_id) Texture_id texture_id)
{ {

View File

@ -41,7 +41,7 @@ class Decorator::Theme
{ {
private: private:
Genode::Ram_session &_ram; Genode::Ram_allocator &_ram;
Genode::Region_map &_rm; Genode::Region_map &_rm;
Genode::Allocator &_alloc; Genode::Allocator &_alloc;
@ -56,7 +56,7 @@ class Decorator::Theme
enum Element_type { ELEMENT_TYPE_CLOSER, ELEMENT_TYPE_MAXIMIZER }; enum Element_type { ELEMENT_TYPE_CLOSER, ELEMENT_TYPE_MAXIMIZER };
Theme(Genode::Ram_session &ram, Genode::Region_map &rm, Genode::Allocator &alloc) Theme(Genode::Ram_allocator &ram, Genode::Region_map &rm, Genode::Allocator &alloc)
: _ram(ram), _rm(rm), _alloc(alloc) { } : _ram(ram), _rm(rm), _alloc(alloc) { }
Area background_size() const; Area background_size() const;

View File

@ -15,7 +15,7 @@
#define _WINDOW_H_ #define _WINDOW_H_
/* Genode includes */ /* Genode includes */
#include <ram_session/ram_session.h> #include <base/ram_allocator.h>
#include <decorator/window.h> #include <decorator/window.h>
#include <nitpicker_session/connection.h> #include <nitpicker_session/connection.h>
#include <base/attached_dataspace.h> #include <base/attached_dataspace.h>

View File

@ -554,7 +554,7 @@ void Window_layouter::Main::_handle_hover()
try { try {
Xml_node const hover_window_xml = _hover.xml().sub_node("window"); Xml_node const hover_window_xml = _hover.xml().sub_node("window");
_user_state.hover(attribute(hover_window_xml, "id", 0UL), _user_state.hover(hover_window_xml.attribute_value("id", 0UL),
_element_from_hover_model(hover_window_xml)); _element_from_hover_model(hover_window_xml));
} }

View File

@ -226,7 +226,8 @@ class Window_layouter::Target_list
return; return;
_rules->xml().for_each_sub_node("screen", [&] (Xml_node screen) { _rules->xml().for_each_sub_node("screen", [&] (Xml_node screen) {
xml.append(screen.addr(), screen.size()); screen.with_raw_node([&] (char const *start, size_t length) {
xml.append(start, length); });
xml.append("\n"); xml.append("\n");
}); });
} }

View File

@ -26,8 +26,6 @@ namespace Window_layouter {
typedef Decorator::Area Area; typedef Decorator::Area Area;
typedef Decorator::Rect Rect; typedef Decorator::Rect Rect;
using Decorator::attribute;
using Decorator::string_attribute;
using Decorator::area_attribute; using Decorator::area_attribute;
using Decorator::point_attribute; using Decorator::point_attribute;

View File

@ -87,7 +87,7 @@ class Window_layouter::Window_list
void update_element(Window &win, Xml_node node) void update_element(Window &win, Xml_node node)
{ {
win.client_size(area_attribute(node)); win.client_size(area_attribute(node));
win.title(string_attribute(node, "title", Window::Title(""))); win.title (node.attribute_value("title", Window::Title("")));
win.has_alpha (node.attribute_value("has_alpha", false)); win.has_alpha (node.attribute_value("has_alpha", false));
win.hidden (node.attribute_value("hidden", false)); win.hidden (node.attribute_value("hidden", false));
win.resizeable (node.attribute_value("resizeable", false)); win.resizeable (node.attribute_value("resizeable", false));

View File

@ -68,7 +68,7 @@ class Cpu_sampler::Cpu_thread_component : public Rpc_object<Cpu_thread>
Cpu_session_component const *cpu_session_component() const Cpu_session_component const *cpu_session_component() const
{ return &_cpu_session_component; } { return &_cpu_session_component; }
Thread_capability parent_thread() { return _parent_cpu_thread; } Thread_capability parent_thread() { return _parent_cpu_thread.rpc_cap(); }
Session_label &label() { return _label; } Session_label &label() { return _label; }
void take_sample(); void take_sample();

View File

@ -237,29 +237,25 @@ namespace Terminal {
Session_component *_create_session(const char *args) Session_component *_create_session(const char *args)
{ {
Genode::size_t io_buffer_size = 4096; using namespace Genode;
try { Session_label const label = label_from_args(args);
Genode::Session_label label = Genode::label_from_args(args); Session_policy const policy(label, _config);
Genode::Session_policy policy(label, _config);
char filename[256]; if (!policy.has_attribute("filename")) {
policy.attribute("filename").value(filename, sizeof(filename)); error("missing \"filename\" attribute in policy definition");
throw Service_denied();
}
if (policy.has_attribute("io_buffer_size")) typedef String<256> File_name;
policy.attribute("io_buffer_size").value(&io_buffer_size); File_name const file_name =
policy.attribute_value("filename", File_name());
size_t const io_buffer_size =
policy.attribute_value("io_buffer_size", 4096UL);
return new (md_alloc()) return new (md_alloc())
Session_component(_env, io_buffer_size, filename); Session_component(_env, io_buffer_size, file_name.string());
}
catch (Genode::Xml_node::Nonexistent_attribute) {
Genode::error("missing \"filename\" attribute in policy definition");
throw Genode::Service_denied();
}
catch (Genode::Session_policy::No_policy_defined) {
Genode::error("invalid session request, no matching policy");
throw Genode::Service_denied();
}
} }
public: public:

View File

@ -177,7 +177,7 @@ void Http::do_read(void * buf, size_t size)
} }
Http::Http(Genode::Heap &heap, ::String &uri) Http::Http(Genode::Heap &heap, ::String const &uri)
: _heap(heap), _port((char *)"80") : _heap(heap), _port((char *)"80")
{ {
_heap.alloc(HTTP_BUF, (void**)&_http_buf); _heap.alloc(HTTP_BUF, (void**)&_http_buf);
@ -205,7 +205,7 @@ Http::~Http()
} }
void Http::parse_uri(::String & u) void Http::parse_uri(::String const &u)
{ {
/* strip possible http prefix */ /* strip possible http prefix */
const char *http = "http://"; const char *http = "http://";

View File

@ -56,7 +56,7 @@ class Http
/* /*
* Set URI of remote file * Set URI of remote file
*/ */
void parse_uri(::String &uri); void parse_uri(::String const &uri);
/* /*
* Resolve host * Resolve host
@ -83,7 +83,7 @@ class Http
/* /*
* Constructor (default host port is 80 * Constructor (default host port is 80
*/ */
Http(Genode::Heap &heap, ::String &uri); Http(Genode::Heap &heap, ::String const &uri);
/* /*
* Destructor * Destructor

View File

@ -32,8 +32,8 @@ class Driver : public Block::Driver
public: public:
Driver(Heap &heap, Ram_session &ram, Driver(Heap &heap, Ram_allocator &ram,
size_t block_size, ::String &uri) size_t block_size, ::String const &uri)
: Block::Driver(ram), : Block::Driver(ram),
_block_size(block_size), _http(heap, uri) {} _block_size(block_size), _http(heap, uri) {}
@ -71,20 +71,17 @@ class Factory : public Block::Driver_factory
Env &_env; Env &_env;
Heap &_heap; Heap &_heap;
Attached_rom_dataspace _config { _env, "config" }; Attached_rom_dataspace _config { _env, "config" };
::String _uri; ::String const _uri;
size_t _blk_sz; size_t const _blk_sz;
public: public:
Factory(Env &env, Heap &heap) Factory(Env &env, Heap &heap)
: _env(env), _heap(heap), _blk_sz(512) :
_env(env), _heap(heap),
_uri (_config.xml().attribute_value("uri", ::String())),
_blk_sz(_config.xml().attribute_value("block_size", 512U))
{ {
try {
_config.xml().attribute("uri").value(&_uri);
_config.xml().attribute("block_size").value(&_blk_sz);
}
catch (...) { }
log("Using file=", _uri, " as device with block size ", log("Using file=", _uri, " as device with block size ",
Hex(_blk_sz, Hex::OMIT_PREFIX), "."); Hex(_blk_sz, Hex::OMIT_PREFIX), ".");
} }

View File

@ -42,7 +42,6 @@ namespace Nit_fader {
typedef Genode::Surface_base::Rect Rect; typedef Genode::Surface_base::Rect Rect;
using Genode::size_t; using Genode::size_t;
using Genode::env;
using Genode::Xml_node; using Genode::Xml_node;
using Genode::Dataspace_capability; using Genode::Dataspace_capability;
using Genode::Attached_ram_dataspace; using Genode::Attached_ram_dataspace;
@ -498,7 +497,7 @@ void Nit_fader::Main::handle_config_update()
unsigned long new_alpha = alpha; unsigned long new_alpha = alpha;
if (config_xml.has_attribute("alpha")) if (config_xml.has_attribute("alpha"))
config_xml.attribute("alpha").value(&new_alpha); config_xml.attribute("alpha").value(new_alpha);
/* respond to state change */ /* respond to state change */
if (new_alpha != alpha) { if (new_alpha != alpha) {

View File

@ -525,27 +525,22 @@ class Terminal::Root_component : public Genode::Root_component<Session_component
*/ */
Genode::size_t io_buffer_size = 4096; Genode::size_t io_buffer_size = 4096;
try {
Session_label const label = label_from_args(args); Session_label const label = label_from_args(args);
Session_policy policy(label, _config); Session_policy const policy(label, _config);
unsigned tcp_port = 0; if (!policy.has_attribute("port")) {
policy.attribute("port").value(&tcp_port);
Session_component *session = nullptr;
Libc::with_libc([&] () {
session = new (md_alloc())
Session_component(_env, io_buffer_size, tcp_port);
});
return session;
}
catch (Xml_node::Nonexistent_attribute) {
error("Missing \"port\" attribute in policy definition"); error("Missing \"port\" attribute in policy definition");
throw Service_denied(); throw Service_denied();
} }
catch (Session_policy::No_policy_defined) {
error("Invalid session request, no matching policy"); unsigned const tcp_port = policy.attribute_value("port", 0U);
throw Service_denied();
} Session_component *session = nullptr;
Libc::with_libc([&] () {
session = new (md_alloc())
Session_component(_env, io_buffer_size, tcp_port); });
return session;
} }
public: public:

View File

@ -162,7 +162,7 @@ struct Wm::Decorator_nitpicker_session : Genode::Rpc_object<Nitpicker::Session>,
Genode::Heap _heap { _env.ram(), _env.rm() }; Genode::Heap _heap { _env.ram(), _env.rm() };
Genode::Ram_session &_ram; Genode::Ram_allocator &_ram;
Nitpicker::Connection _nitpicker_session { _env, "decorator" }; Nitpicker::Connection _nitpicker_session { _env, "decorator" };
@ -205,7 +205,7 @@ struct Wm::Decorator_nitpicker_session : Genode::Rpc_object<Nitpicker::Session>,
* \param ep entrypoint used for dispatching signals * \param ep entrypoint used for dispatching signals
*/ */
Decorator_nitpicker_session(Genode::Env &env, Decorator_nitpicker_session(Genode::Env &env,
Genode::Ram_session &ram, Genode::Ram_allocator &ram,
Allocator &md_alloc, Allocator &md_alloc,
Reporter &pointer_reporter, Reporter &pointer_reporter,
Last_motion &last_motion, Last_motion &last_motion,

View File

@ -28,7 +28,6 @@ namespace Wm {
class Main; class Main;
using Genode::size_t; using Genode::size_t;
using Genode::env;
using Genode::Rom_session_client; using Genode::Rom_session_client;
using Genode::Rom_connection; using Genode::Rom_connection;
using Genode::Xml_node; using Genode::Xml_node;
@ -76,7 +75,7 @@ struct Wm::Main
unsigned long win_id = 0; unsigned long win_id = 0;
Xml_node(focus_rom.local_addr<char>()).sub_node("window") Xml_node(focus_rom.local_addr<char>()).sub_node("window")
.attribute("id").value(&win_id); .attribute("id").value(win_id);
if (win_id) { if (win_id) {
Nitpicker::Session_capability session_cap = Nitpicker::Session_capability session_cap =
@ -95,32 +94,17 @@ struct Wm::Main
void handle_resize_request_update() void handle_resize_request_update()
{ {
try {
resize_request_rom.update(); resize_request_rom.update();
if (!resize_request_rom.valid())
return;
char const * const node_type = "window"; resize_request_rom.xml().for_each_sub_node("window", [&] (Xml_node window) {
Xml_node window = unsigned long const
Xml_node(resize_request_rom.local_addr<char>()).sub_node(node_type); win_id = window.attribute_value("id", 0UL),
width = window.attribute_value("width", 0UL),
for (;;) { height = window.attribute_value("height", 0UL);
unsigned long win_id = 0, width = 0, height = 0;
window.attribute("id") .value(&win_id);
window.attribute("width") .value(&width);
window.attribute("height").value(&height);
nitpicker_root.request_resize(win_id, Area(width, height)); nitpicker_root.request_resize(win_id, Area(width, height));
});
if (window.last(node_type))
break;
window = window.next(node_type);
}
} catch (...) { /* no resize-request model available */ }
} }
Genode::Signal_handler<Main> resize_request_handler = Genode::Signal_handler<Main> resize_request_handler =

View File

@ -42,7 +42,6 @@ namespace Wm {
using Genode::Affinity; using Genode::Affinity;
using Genode::static_cap_cast; using Genode::static_cap_cast;
using Genode::Signal_handler; using Genode::Signal_handler;
using Genode::Ram_session_capability;
using Genode::Weak_ptr; using Genode::Weak_ptr;
using Genode::Locked_ptr; using Genode::Locked_ptr;
using Genode::Tslab; using Genode::Tslab;
@ -454,7 +453,7 @@ class Wm::Nitpicker::Session_component : public Rpc_object<Nitpicker::Session>,
Genode::Env &_env; Genode::Env &_env;
Session_label _session_label; Session_label _session_label;
Genode::Ram_session &_ram; Genode::Ram_allocator &_ram;
Nitpicker::Connection _session { _env, _session_label.string() }; Nitpicker::Connection _session { _env, _session_label.string() };
Window_registry &_window_registry; Window_registry &_window_registry;
@ -730,7 +729,7 @@ class Wm::Nitpicker::Session_component : public Rpc_object<Nitpicker::Session>,
* \param ep entrypoint used for managing the views * \param ep entrypoint used for managing the views
*/ */
Session_component(Genode::Env &env, Session_component(Genode::Env &env,
Genode::Ram_session &ram, Genode::Ram_allocator &ram,
Window_registry &window_registry, Window_registry &window_registry,
Allocator &session_alloc, Allocator &session_alloc,
Session_label const &session_label, Session_label const &session_label,
@ -848,7 +847,7 @@ class Wm::Nitpicker::Session_component : public Rpc_object<Nitpicker::Session>,
/** /**
* Return session capability to real nitpicker session * Return session capability to real nitpicker session
*/ */
Capability<Session> session() { return _session; } Capability<Session> session() { return _session.rpc_cap(); }
/********************************* /*********************************
@ -1019,7 +1018,7 @@ class Wm::Nitpicker::Root : public Genode::Rpc_object<Genode::Typed_root<Session
Allocator &_md_alloc; Allocator &_md_alloc;
Genode::Ram_session &_ram; Genode::Ram_allocator &_ram;
enum { STACK_SIZE = 1024*sizeof(long) }; enum { STACK_SIZE = 1024*sizeof(long) };
@ -1109,7 +1108,7 @@ class Wm::Nitpicker::Root : public Genode::Rpc_object<Genode::Typed_root<Session
*/ */
Root(Genode::Env &env, Root(Genode::Env &env,
Window_registry &window_registry, Allocator &md_alloc, Window_registry &window_registry, Allocator &md_alloc,
Genode::Ram_session &ram, Genode::Ram_allocator &ram,
Reporter &pointer_reporter, Reporter &focus_request_reporter, Reporter &pointer_reporter, Reporter &focus_request_reporter,
Nitpicker::Session &focus_nitpicker_session) Nitpicker::Session &focus_nitpicker_session)
: :

View File

@ -64,6 +64,34 @@ class Genode::Slave::Policy : public Child_policy
Child_policy_dynamic_rom_file _config_policy; Child_policy_dynamic_rom_file _config_policy;
Session_requester _session_requester; Session_requester _session_requester;
Service &_matching_service(Service::Name const &service_name,
Session_label const &label)
{
/* check for config file request */
if (Service *s = _config_policy.resolve_session_request(service_name, label))
return *s;
if (service_name == "ROM") {
Session_label const rom_name(label.last_element());
if (rom_name == _binary_name) return _binary_service;
if (rom_name == "session_requests") return _session_requester.service();
}
/* fill parent service registry on demand */
Parent_service *service = nullptr;
_parent_services.for_each([&] (Parent_service &s) {
if (!service && s.name() == service_name)
service = &s; });
if (!service) {
error(name(), ": illegal session request of "
"service \"", service_name, "\" (", label, ")");
throw Service_denied();
}
return *service;
}
public: public:
class Connection; class Connection;
@ -73,29 +101,25 @@ class Genode::Slave::Policy : public Child_policy
* *
* \param ep entrypoint used to provide local services * \param ep entrypoint used to provide local services
* such as the config ROM service * such as the config ROM service
* \param local_rm local address space, needed to populate dataspaces
* provided to the child (config, session_requests)
* *
* \throw Out_of_ram by 'Child_policy_dynamic_rom_file' * \throw Out_of_ram by 'Child_policy_dynamic_rom_file'
* \throw Out_of_caps by 'Child_policy_dynamic_rom_file' * \throw Out_of_caps by 'Child_policy_dynamic_rom_file'
*/ */
Policy(Label const &label, Policy(Env &env,
Label const &label,
Name const &binary_name, Name const &binary_name,
Parent_services &parent_services, Parent_services &parent_services,
Rpc_entrypoint &ep, Rpc_entrypoint &ep,
Region_map &rm,
Pd_session &ref_pd,
Pd_session_capability ref_pd_cap,
Cap_quota cap_quota, Cap_quota cap_quota,
Ram_quota ram_quota) Ram_quota ram_quota)
: :
_label(label), _binary_name(binary_name), _label(label), _binary_name(binary_name),
_ref_pd(ref_pd), _ref_pd_cap(ref_pd_cap), _ref_pd(env.pd()), _ref_pd_cap(env.pd_session_cap()),
_binary_service(Rom_session::service_name()), _binary_service(env, Rom_session::service_name()),
_cap_quota(cap_quota), _ram_quota(ram_quota), _cap_quota(cap_quota), _ram_quota(ram_quota),
_parent_services(parent_services), _ep(ep), _parent_services(parent_services), _ep(ep),
_config_policy(rm, "config", _ep, &_ref_pd), _config_policy(env.rm(), "config", _ep, &env.pd()),
_session_requester(ep, _ref_pd, rm) _session_requester(ep, env.pd(), env.rm())
{ {
configure("<config/>"); configure("<config/>");
} }
@ -139,32 +163,12 @@ class Genode::Slave::Policy : public Child_policy
_ref_pd.transfer_quota(cap, _ram_quota); _ref_pd.transfer_quota(cap, _ram_quota);
} }
Service &resolve_session_request(Service::Name const &service_name, Route resolve_session_request(Service::Name const &name,
Session_state::Args const &args) Session_label const &label) override
{ {
/* check for config file request */ return Route { .service = _matching_service(name, label),
if (Service *s = _config_policy.resolve_session_request(service_name.string(), args.string())) .label = label,
return *s; .diag = Session::Diag() };
if (service_name == "ROM") {
Session_label const rom_name(label_from_args(args.string()).last_element());
if (rom_name == _binary_name) return _binary_service;
if (rom_name == "session_requests") return _session_requester.service();
}
/* fill parent service registry on demand */
Parent_service *service = nullptr;
_parent_services.for_each([&] (Parent_service &s) {
if (!service && s.name() == service_name)
service = &s; });
if (!service) {
error(name(), ": illegal session request of "
"service \"", service_name, "\" (", args, ")");
throw Service_denied();
}
return *service;
} }
Id_space<Parent::Server> &server_id_space() override { Id_space<Parent::Server> &server_id_space() override {
@ -247,7 +251,7 @@ class Genode::Slave::Connection_base
/** /**
* Service ('Ram_transfer::Account') interface * Service ('Ram_transfer::Account') interface
*/ */
void transfer(Ram_session_capability to, Ram_quota amount) override void transfer(Pd_session_capability to, Ram_quota amount) override
{ {
if (to.valid()) _policy.ref_pd().transfer_quota(to, amount); if (to.valid()) _policy.ref_pd().transfer_quota(to, amount);
} }

View File

@ -36,8 +36,7 @@ struct Test::Policy
Policy(Env &env, Name const &name) Policy(Env &env, Name const &name)
: :
Static_parent_services(env), Static_parent_services(env),
Slave::Policy(name, name, *this, env.ep().rpc_ep(), env.rm(), Slave::Policy(env, name, name, *this, env.ep().rpc_ep(),
env.pd(), env.pd_session_cap(),
Cap_quota{100}, Ram_quota{1024*1024}) Cap_quota{100}, Ram_quota{1024*1024})
{ } { }
}; };

View File

@ -294,9 +294,8 @@ class Test::Parent
Policy(Parent &parent, Env &env) Policy(Parent &parent, Env &env)
: :
Static_parent_services(env), Static_parent_services(env),
Slave::Policy(Label("child"), "test-resource_yield", Slave::Policy(env, Label("child"), "test-resource_yield",
*this, env.ep().rpc_ep(), env.rm(), *this, env.ep().rpc_ep(),
env.pd(), env.pd_session_cap(),
Cap_quota{SLAVE_CAPS}, Ram_quota{SLAVE_RAM}), Cap_quota{SLAVE_CAPS}, Ram_quota{SLAVE_RAM}),
_parent(parent) _parent(parent)
{ {