diff --git a/repos/dde_bsd/src/drivers/audio/main.cc b/repos/dde_bsd/src/drivers/audio/main.cc
index 289ee1529c..260f07033a 100644
--- a/repos/dde_bsd/src/drivers/audio/main.cc
+++ b/repos/dde_bsd/src/drivers/audio/main.cc
@@ -124,7 +124,7 @@ class Audio_out::Out
/* convert float to S16LE */
static short data[Audio_out::PERIOD * Audio_out::MAX_CHANNELS];
- for (int i = 0; i < Audio_out::PERIOD * Audio_out::MAX_CHANNELS; i += 2) {
+ for (unsigned i = 0; i < Audio_out::PERIOD * Audio_out::MAX_CHANNELS; i += 2) {
data[i] = p_left->content()[i / 2] * 32767;
data[i + 1] = p_right->content()[i / 2] * 32767;
}
@@ -494,7 +494,7 @@ struct Main
void handle_config_update()
{
config.update();
- if (!config.is_valid()) { return; }
+ if (!config.valid()) { return; }
Audio::update_config(env, config.xml());
}
diff --git a/repos/dde_bsd/src/lib/audio/driver.cc b/repos/dde_bsd/src/lib/audio/driver.cc
index 5f38437317..2636f9a812 100644
--- a/repos/dde_bsd/src/lib/audio/driver.cc
+++ b/repos/dde_bsd/src/lib/audio/driver.cc
@@ -334,17 +334,17 @@ static void configure_mixer(Genode::Env &env, Mixer &mixer, Genode::Xml_node con
mixer_reporter.enabled(v);
config.for_each_sub_node("mixer", [&] (Xml_node node) {
- char field[32];
- char value[16];
- try {
- node.attribute("field").value(field, sizeof(field));
- node.attribute("value").value(value, sizeof(value));
- set_mixer_value(mixer, field, value);
- } catch (Xml_attribute::Nonexistent_attribute) { }
+ typedef String<32> Field;
+ typedef String<16> Value;
+
+ Field const field = node.attribute_value("field", Field());
+ Value const value = node.attribute_value("value", Value());
+
+ set_mixer_value(mixer, field.string(), value.string());
});
- if (mixer_reporter.is_enabled()) try {
+ if (mixer_reporter.enabled()) try {
Genode::Reporter::Xml_generator xml(mixer_reporter, [&]() {
for (unsigned i = 0; i < mixer.num; i++) {
diff --git a/repos/dde_bsd/src/lib/audio/mem.cc b/repos/dde_bsd/src/lib/audio/mem.cc
index bdc1433a74..9c8f956316 100644
--- a/repos/dde_bsd/src/lib/audio/mem.cc
+++ b/repos/dde_bsd/src/lib/audio/mem.cc
@@ -57,7 +57,7 @@ class Bsd::Slab_backend_alloc : public Genode::Allocator,
addr_t _ds_phys[ELEMENTS]; /* physical bases of dataspaces */
int _index; /* current index in ds_cap */
Genode::Allocator_avl _range; /* manage allocations */
- Genode::Ram_session &_ram; /* ram session to allocate ds from */
+ Genode::Ram_allocator &_ram; /* allocator to allocate ds from */
bool _alloc_block()
{
@@ -81,7 +81,7 @@ class Bsd::Slab_backend_alloc : public Genode::Allocator,
public:
- Slab_backend_alloc(Genode::Env &env, Genode::Ram_session &ram,
+ Slab_backend_alloc(Genode::Env &env, Genode::Ram_allocator &ram,
Genode::Region_map &rm, Genode::Allocator &md_alloc)
:
Rm_connection(env),
diff --git a/repos/dde_bsd/src/lib/audio/misc.cc b/repos/dde_bsd/src/lib/audio/misc.cc
index b12b37a74c..1057ec277a 100644
--- a/repos/dde_bsd/src/lib/audio/misc.cc
+++ b/repos/dde_bsd/src/lib/audio/misc.cc
@@ -12,7 +12,6 @@
*/
/* Genode includes */
-#include
#include
#include
#include
@@ -40,27 +39,36 @@ void mtx_leave(struct mutex *mtx) {
** sys/systm.h **
*****************/
-extern "C" void panic(const char *fmt, ...)
+static int _vprintf(char const *format, va_list list)
{
- va_list va;
+ char buf[128] { };
+ Genode::String_console sc(buf, sizeof(buf));
+ sc.vprintf(format, list);
+ return sc.len();
+}
- va_start(va, fmt);
- Genode::vprintf(fmt, va);
- va_end(va);
+
+extern "C" void panic(char const *format, ...)
+{
+ va_list list;
+
+ va_start(list, format);
+ _vprintf(format, list);
+ va_end(list);
Genode::sleep_forever();
}
-extern "C" int printf(const char *fmt, ...)
+extern "C" int printf(const char *format, ...)
{
- va_list va;
+ va_list list;
- va_start(va, fmt);
- Genode::vprintf(fmt, va);
- va_end(va);
+ va_start(list, format);
+ int const result = _vprintf(format, list);
+ va_end(list);
- return 0; /* XXX proper return value */
+ return result;
}
diff --git a/repos/dde_bsd/src/lib/audio/scheduler.cc b/repos/dde_bsd/src/lib/audio/scheduler.cc
index f5e54bb90c..e23e9f1283 100644
--- a/repos/dde_bsd/src/lib/audio/scheduler.cc
+++ b/repos/dde_bsd/src/lib/audio/scheduler.cc
@@ -18,6 +18,7 @@
/* Genode includes */
#include
#include
+#include
/* local includes */
#include
diff --git a/repos/dde_ipxe/src/lib/dde_ipxe/dde_support.cc b/repos/dde_ipxe/src/lib/dde_ipxe/dde_support.cc
index c7fbe57f81..ed9f1f13d6 100644
--- a/repos/dde_ipxe/src/lib/dde_ipxe/dde_support.cc
+++ b/repos/dde_ipxe/src/lib/dde_ipxe/dde_support.cc
@@ -22,7 +22,6 @@
/* Genode includes */
#include
#include
-#include
#include
#include
#include
@@ -72,8 +71,14 @@ extern "C" int dde_support_initialized(void)
** printf **
************/
-extern "C" void dde_vprintf(const char *fmt, va_list va) {
- Genode::vprintf(fmt, va); }
+extern "C" void dde_vprintf(const char *format, va_list list)
+{
+ using namespace Genode;
+
+ char buf[128] { };
+ String_console(buf, sizeof(buf)).vprintf(format, list);
+ log(Cstring(buf));
+}
extern "C" void dde_printf(const char *fmt, ...)
@@ -467,7 +472,7 @@ struct Slab_backend_alloc : public Genode::Allocator,
Genode::Ram_dataspace_capability _ds_cap[ELEMENTS];
int _index;
Genode::Allocator_avl _range;
- Genode::Ram_session &_ram;
+ Genode::Ram_allocator &_ram;
bool _alloc_block()
{
@@ -492,7 +497,7 @@ struct Slab_backend_alloc : public Genode::Allocator,
}
Slab_backend_alloc(Genode::Env &env, Genode::Region_map &rm,
- Genode::Ram_session &ram,
+ Genode::Ram_allocator &ram,
Genode::Allocator &md_alloc)
:
Rm_connection(env),
diff --git a/repos/dde_linux/recipes/src/usb_drv/hash b/repos/dde_linux/recipes/src/usb_drv/hash
index 81c7dc6c4e..ccdaf76b2a 100644
--- a/repos/dde_linux/recipes/src/usb_drv/hash
+++ b/repos/dde_linux/recipes/src/usb_drv/hash
@@ -1 +1 @@
-2019-01-13 f7ccf2c2c0820f4e9b2153f6aeb7fe6a5194e309
+2019-01-19-b ae0b702188012c3d8c790eb087706823ea81c7ae
diff --git a/repos/dde_linux/src/drivers/framebuffer/intel/include/component.h b/repos/dde_linux/src/drivers/framebuffer/intel/include/component.h
index e86aa0c8d5..b3916c5b9e 100644
--- a/repos/dde_linux/src/drivers/framebuffer/intel/include/component.h
+++ b/repos/dde_linux/src/drivers/framebuffer/intel/include/component.h
@@ -113,7 +113,7 @@ class Framebuffer::Session_component : public Genode::Rpc_object
Genode::Attached_rom_dataspace &_config;
Genode::Signal_context_capability _mode_sigh;
Timer::Connection _timer;
- Genode::Ram_session &_ram;
+ Genode::Ram_allocator &_ram;
Genode::Attached_ram_dataspace _ds;
bool _in_mode_change = true;
diff --git a/repos/dde_linux/src/drivers/framebuffer/intel/lx_emul.cc b/repos/dde_linux/src/drivers/framebuffer/intel/lx_emul.cc
index bb4b787ba8..604ee1f2c3 100644
--- a/repos/dde_linux/src/drivers/framebuffer/intel/lx_emul.cc
+++ b/repos/dde_linux/src/drivers/framebuffer/intel/lx_emul.cc
@@ -106,9 +106,9 @@ Framebuffer::Driver::_preferred_mode(drm_connector *connector,
if (!xn.has_type("connector"))
continue;
- String<64> con_policy;
- xn.attribute("name").value(&con_policy);
- if (Genode::strcmp(con_policy.string(), connector->name) != 0)
+ typedef String<64> Name;
+ Name const con_policy = xn.attribute_value("name", Name());
+ if (con_policy != connector->name)
continue;
bool enabled = xn.attribute_value("enabled", true);
@@ -118,11 +118,9 @@ Framebuffer::Driver::_preferred_mode(drm_connector *connector,
brightness = xn.attribute_value("brightness",
(unsigned)MAX_BRIGHTNESS + 1);
- unsigned long width = 0;
- unsigned long height = 0;
- long hz = xn.attribute_value("hz", 0L);
- xn.attribute("width").value(&width);
- xn.attribute("height").value(&height);
+ unsigned long const width = xn.attribute_value("width", 0UL);
+ unsigned long const height = xn.attribute_value("height", 0UL);
+ long const hz = xn.attribute_value("hz", 0L);
struct drm_display_mode *mode;
list_for_each_entry(mode, &connector->modes, head) {
@@ -275,7 +273,7 @@ void Framebuffer::Driver::generate_report()
} catch (...) {
_reporter.enabled(false);
}
- if (!_reporter.is_enabled()) return;
+ if (!_reporter.enabled()) return;
/* write new report */
try {
diff --git a/repos/dde_linux/src/drivers/nic/fec/platform.cc b/repos/dde_linux/src/drivers/nic/fec/platform.cc
index a4a46dc0b7..e340212ba8 100644
--- a/repos/dde_linux/src/drivers/nic/fec/platform.cc
+++ b/repos/dde_linux/src/drivers/nic/fec/platform.cc
@@ -23,7 +23,7 @@
** lx_kit/backend_alloc.h **
****************************/
-void backend_alloc_init(Genode::Env&, Genode::Ram_session&,
+void backend_alloc_init(Genode::Env&, Genode::Ram_allocator&,
Genode::Allocator&)
{
/* intentionally left blank */
diff --git a/repos/dde_linux/src/drivers/usb_hid/main.cc b/repos/dde_linux/src/drivers/usb_hid/main.cc
index 093e81ad24..8f61f6301f 100644
--- a/repos/dde_linux/src/drivers/usb_hid/main.cc
+++ b/repos/dde_linux/src/drivers/usb_hid/main.cc
@@ -172,8 +172,8 @@ void Driver::main_task_entry(void * arg)
try {
Genode::Xml_node config_node = Lx_kit::env().config_rom().xml();
use_report = config_node.attribute_value("use_report", false);
- config_node.attribute("width").value(&screen_x);
- config_node.attribute("height").value(&screen_y);
+ config_node.attribute("width").value(screen_x);
+ config_node.attribute("height").value(screen_y);
multi_touch = config_node.attribute_value("multitouch", false);
} catch(...) { }
@@ -211,11 +211,11 @@ void Driver::scan_report()
report_node.for_each_sub_node([&] (Genode::Xml_node & dev_node)
{
unsigned long c = 0;
- dev_node.attribute("class").value(&c);
+ dev_node.attribute("class").value(c);
if (c != USB_CLASS_HID) return;
Label label;
- dev_node.attribute("label").value(&label);
+ dev_node.attribute("label").value(label);
bool found = false;
diff --git a/repos/dde_linux/src/drivers/usb_host/platform.h b/repos/dde_linux/src/drivers/usb_host/platform.h
index f65730191b..b1de5191a3 100644
--- a/repos/dde_linux/src/drivers/usb_host/platform.h
+++ b/repos/dde_linux/src/drivers/usb_host/platform.h
@@ -42,7 +42,7 @@ struct Services
}
};
-void backend_alloc_init(Genode::Env &env, Genode::Ram_session &ram, Genode::Allocator &alloc);
+void backend_alloc_init(Genode::Env &env, Genode::Ram_allocator &ram, Genode::Allocator &alloc);
void platform_hcd_init(Services *services);
Genode::Irq_session_capability platform_irq_activate(int irq);
diff --git a/repos/dde_linux/src/drivers/usb_host/raw.cc b/repos/dde_linux/src/drivers/usb_host/raw.cc
index 8b87397324..03c2a5cdeb 100644
--- a/repos/dde_linux/src/drivers/usb_host/raw.cc
+++ b/repos/dde_linux/src/drivers/usb_host/raw.cc
@@ -960,7 +960,8 @@ class Usb::Root : public Genode::Root_component
if (xhci) xml.attribute("xhci", "yes");
if (ohci) xml.attribute("ohci", "yes");
- xml.append(config.content_base(), config.content_size());
+ config.with_raw_content([&] (char const *start, size_t length) {
+ xml.append(start, length); });
});
}
diff --git a/repos/dde_linux/src/drivers/usb_host/signal.h b/repos/dde_linux/src/drivers/usb_host/signal.h
index 632aca8835..039b28416d 100644
--- a/repos/dde_linux/src/drivers/usb_host/signal.h
+++ b/repos/dde_linux/src/drivers/usb_host/signal.h
@@ -38,7 +38,7 @@ class Signal_helper
Genode::Signal_transmitter &sender() { return _sender; }
Genode::Parent &parent() { return _env.parent(); }
Genode::Env &env() { return _env; }
- Genode::Ram_session &ram() { return _env.ram(); }
+ Genode::Ram_allocator &ram() { return _env.ram(); }
Genode::Region_map &rm() { return _env.rm(); }
};
diff --git a/repos/dde_linux/src/drivers/usb_host/spec/arm/platform.cc b/repos/dde_linux/src/drivers/usb_host/spec/arm/platform.cc
index b49ca42f5e..553f76ea8c 100644
--- a/repos/dde_linux/src/drivers/usb_host/spec/arm/platform.cc
+++ b/repos/dde_linux/src/drivers/usb_host/spec/arm/platform.cc
@@ -25,7 +25,7 @@
** lx_kit/backend_alloc.h **
****************************/
-void backend_alloc_init(Genode::Env&, Genode::Ram_session&,
+void backend_alloc_init(Genode::Env&, Genode::Ram_allocator&,
Genode::Allocator&)
{
/* intentionally left blank */
diff --git a/repos/dde_linux/src/drivers/usb_host/spec/x86/platform.cc b/repos/dde_linux/src/drivers/usb_host/spec/x86/platform.cc
index 95504f5fac..e4f6302e80 100644
--- a/repos/dde_linux/src/drivers/usb_host/spec/x86/platform.cc
+++ b/repos/dde_linux/src/drivers/usb_host/spec/x86/platform.cc
@@ -198,7 +198,7 @@ int request_irq(unsigned int irq, irq_handler_t handler, unsigned long flags,
** Platform backend alloc init **
*********************************/
-void backend_alloc_init(Genode::Env &env, Genode::Ram_session &ram,
+void backend_alloc_init(Genode::Env &env, Genode::Ram_allocator &ram,
Genode::Allocator &alloc)
{
Lx::pci_init(env, ram, alloc);
diff --git a/repos/dde_linux/src/drivers/usb_net/lx_emul.cc b/repos/dde_linux/src/drivers/usb_net/lx_emul.cc
index e6fa4b3350..df114c3929 100644
--- a/repos/dde_linux/src/drivers/usb_net/lx_emul.cc
+++ b/repos/dde_linux/src/drivers/usb_net/lx_emul.cc
@@ -300,7 +300,7 @@ static void random_ether_addr(u8 *addr)
/* try using configured mac */
try {
Xml_node::Attribute mac_node = config_node.attribute("mac");
- mac_node.value(&mac);
+ mac_node.value(mac);
} catch (...) {
/* use fallback mac */
snprint_mac(str, fallback);
diff --git a/repos/dde_linux/src/include/lx_kit/env.h b/repos/dde_linux/src/include/lx_kit/env.h
index 675ef98150..cff82a65cd 100644
--- a/repos/dde_linux/src/include/lx_kit/env.h
+++ b/repos/dde_linux/src/include/lx_kit/env.h
@@ -42,7 +42,7 @@ class Lx_kit::Env
Genode::Env &env() { return _env; }
Genode::Heap &heap() { return _heap; }
Genode::Attached_rom_dataspace &config_rom() { return _config; }
- Genode::Ram_session &ram() { return _env.ram(); }
+ Genode::Ram_allocator &ram() { return _env.ram(); }
Genode::Region_map &rm() { return _env.rm(); }
};
diff --git a/repos/dde_linux/src/include/lx_kit/pci.h b/repos/dde_linux/src/include/lx_kit/pci.h
index 7a3015635c..fca1985dff 100644
--- a/repos/dde_linux/src/include/lx_kit/pci.h
+++ b/repos/dde_linux/src/include/lx_kit/pci.h
@@ -16,11 +16,12 @@
/* Genode includes */
#include
+#include
namespace Lx {
- void pci_init(Genode::Env&, Genode::Ram_session&, Genode::Allocator&);
+ void pci_init(Genode::Env&, Genode::Ram_allocator&, Genode::Allocator&);
}
#endif /* _LX_KIT__PCI_H_ */
diff --git a/repos/dde_linux/src/include/lx_kit/timer.h b/repos/dde_linux/src/include/lx_kit/timer.h
index e5a06f76b8..aaa539d8ec 100644
--- a/repos/dde_linux/src/include/lx_kit/timer.h
+++ b/repos/dde_linux/src/include/lx_kit/timer.h
@@ -18,6 +18,7 @@
/* Genode includes */
#include
+#include
namespace Lx {
diff --git a/repos/dde_linux/src/lib/libc_lxip/plugin.cc b/repos/dde_linux/src/lib/libc_lxip/plugin.cc
index 7ade74fbc5..3676f6332d 100644
--- a/repos/dde_linux/src/lib/libc_lxip/plugin.cc
+++ b/repos/dde_linux/src/lib/libc_lxip/plugin.cc
@@ -195,38 +195,30 @@ Plugin::Plugin()
void Plugin::init(Genode::Env &env)
{
- char ip_addr_str[16] = {0};
- char netmask_str[16] = {0};
- char gateway_str[16] = {0};
Genode::Attached_rom_dataspace config { env, "config"} ;
try {
Genode::Xml_node libc_node = config.xml().sub_node("libc");
- try {
- libc_node.attribute("ip_addr").value(ip_addr_str, sizeof(ip_addr_str));
- } catch(...) { }
+ typedef Genode::String<20> Ip_addr;
- try {
- libc_node.attribute("netmask").value(netmask_str, sizeof(netmask_str));
- } catch(...) { }
-
- try {
- libc_node.attribute("gateway").value(gateway_str, sizeof(gateway_str));
- } catch(...) { }
+ Ip_addr const ip_addr = libc_node.attribute_value("ip_addr", Ip_addr());
+ Ip_addr const netmask = libc_node.attribute_value("netmask", Ip_addr());
+ Ip_addr const gateway = libc_node.attribute_value("gateway", Ip_addr());
/* either none or all 3 interface attributes must exist */
- if ((Genode::strlen(ip_addr_str) != 0) ||
- (Genode::strlen(netmask_str) != 0) ||
- (Genode::strlen(gateway_str) != 0)) {
- if (Genode::strlen(ip_addr_str) == 0) {
+ if (ip_addr.valid() || netmask.valid() || gateway.valid()) {
+
+ if (!ip_addr.valid()) {
Genode::error("missing \"ip_addr\" attribute. Ignoring network interface config.");
throw Genode::Xml_node::Nonexistent_attribute();
- } else if (Genode::strlen(netmask_str) == 0) {
+ }
+ if (!netmask.valid()) {
Genode::error("missing \"netmask\" attribute. Ignoring network interface config.");
throw Genode::Xml_node::Nonexistent_attribute();
- } else if (Genode::strlen(gateway_str) == 0) {
+ }
+ if (!gateway.valid()) {
Genode::error("missing \"gateway\" attribute. Ignoring network interface config.");
throw Genode::Xml_node::Nonexistent_attribute();
}
@@ -234,15 +226,19 @@ void Plugin::init(Genode::Env &env)
throw -1;
Genode::log("static network interface: ",
- "ip_addr=", Genode::Cstring(ip_addr_str), " "
- "netmask=", Genode::Cstring(netmask_str), " "
- "gateway=", Genode::Cstring(gateway_str));
+ "ip_addr=", ip_addr, " "
+ "netmask=", netmask, " "
+ "gateway=", gateway);
+
+ socketconstruct.construct(env, ip_addr.string(),
+ netmask.string(),
+ gateway.string());
}
catch (...) {
Genode::log("Using DHCP for interface configuration.");
}
- socketconstruct.construct(env, ip_addr_str, netmask_str, gateway_str);
+ socketconstruct.construct(env, "", "", "");
};
/* TODO shameful copied from lwip... generalize this */
diff --git a/repos/dde_linux/src/lib/lxip/socket_handler.cc b/repos/dde_linux/src/lib/lxip/socket_handler.cc
index 5cb1f87a0e..1b747aefa5 100644
--- a/repos/dde_linux/src/lib/lxip/socket_handler.cc
+++ b/repos/dde_linux/src/lib/lxip/socket_handler.cc
@@ -13,6 +13,7 @@
/* Genode includes */
#include
+#include
#include
#include
#include
diff --git a/repos/dde_linux/src/lib/usb/include/platform.h b/repos/dde_linux/src/lib/usb/include/platform.h
index 492fb55a4b..c6b4bfcd43 100644
--- a/repos/dde_linux/src/lib/usb/include/platform.h
+++ b/repos/dde_linux/src/lib/usb/include/platform.h
@@ -61,8 +61,8 @@ struct Services
try {
Genode::Xml_node node_screen = node_hid.sub_node("touchscreen");
- node_screen.attribute("width").value(&screen_width);
- node_screen.attribute("height").value(&screen_height);
+ node_screen.attribute("width").value(screen_width);
+ node_screen.attribute("height").value(screen_height);
multitouch = node_screen.attribute_value("multitouch", false);
} catch (...) {
screen_width = screen_height = 0;
@@ -127,7 +127,7 @@ struct Services
}
};
-void backend_alloc_init(Genode::Env &env, Genode::Ram_session &ram, Genode::Allocator &alloc);
+void backend_alloc_init(Genode::Env &env, Genode::Ram_allocator &ram, Genode::Allocator &alloc);
void platform_hcd_init(Services *services);
Genode::Irq_session_capability platform_irq_activate(int irq);
diff --git a/repos/dde_linux/src/lib/usb/include/signal.h b/repos/dde_linux/src/lib/usb/include/signal.h
index 5b0ed213c8..70e30b1ea2 100644
--- a/repos/dde_linux/src/lib/usb/include/signal.h
+++ b/repos/dde_linux/src/lib/usb/include/signal.h
@@ -38,7 +38,7 @@ class Signal_helper
Genode::Signal_transmitter &sender() { return _sender; }
Genode::Parent &parent() { return _env.parent(); }
Genode::Env &env() { return _env; }
- Genode::Ram_session &ram() { return _env.ram(); }
+ Genode::Ram_allocator &ram() { return _env.ram(); }
Genode::Region_map &rm() { return _env.rm(); }
};
diff --git a/repos/dde_linux/src/lib/usb/nic/nic.cc b/repos/dde_linux/src/lib/usb/nic/nic.cc
index 269fbe9955..cb571ac0a1 100644
--- a/repos/dde_linux/src/lib/usb/nic/nic.cc
+++ b/repos/dde_linux/src/lib/usb/nic/nic.cc
@@ -708,7 +708,7 @@ void random_ether_addr(u8 *addr)
try {
Xml_node nic_config = config_node.sub_node("nic");
Xml_node::Attribute mac_node = nic_config.attribute("mac");
- mac_node.value(&mac);
+ mac_node.value(mac);
} catch (...) {
/* use fallback mac */
snprint_mac(str, fallback);
diff --git a/repos/dde_linux/src/lib/usb/raw/raw.cc b/repos/dde_linux/src/lib/usb/raw/raw.cc
index 239904c8be..dea5d7c20a 100644
--- a/repos/dde_linux/src/lib/usb/raw/raw.cc
+++ b/repos/dde_linux/src/lib/usb/raw/raw.cc
@@ -932,7 +932,8 @@ class Usb::Root : public Genode::Root_component
if (xhci) xml.attribute("xhci", "yes");
if (ohci) xml.attribute("ohci", "yes");
- xml.append(config.content_base(), config.content_size());
+ config.with_raw_content([&] (char const *start, size_t length) {
+ xml.append(start, length); });
});
}
diff --git a/repos/dde_linux/src/lib/usb/spec/arm/platform_generic.cc b/repos/dde_linux/src/lib/usb/spec/arm/platform_generic.cc
index 16769998e5..d925bed62a 100644
--- a/repos/dde_linux/src/lib/usb/spec/arm/platform_generic.cc
+++ b/repos/dde_linux/src/lib/usb/spec/arm/platform_generic.cc
@@ -22,7 +22,7 @@
** lx_kit/backend_alloc.h **
****************************/
-void backend_alloc_init(Genode::Env&, Genode::Ram_session&,
+void backend_alloc_init(Genode::Env&, Genode::Ram_allocator&,
Genode::Allocator&)
{
/* intentionally left blank */
diff --git a/repos/dde_linux/src/lib/usb/spec/x86/pci_driver.cc b/repos/dde_linux/src/lib/usb/spec/x86/pci_driver.cc
index d982eaec19..17252159b8 100644
--- a/repos/dde_linux/src/lib/usb/spec/x86/pci_driver.cc
+++ b/repos/dde_linux/src/lib/usb/spec/x86/pci_driver.cc
@@ -191,7 +191,7 @@ int request_irq(unsigned int irq, irq_handler_t handler, unsigned long flags,
** Platform backend alloc init **
*********************************/
-void backend_alloc_init(Genode::Env &env, Genode::Ram_session &ram,
+void backend_alloc_init(Genode::Env &env, Genode::Ram_allocator &ram,
Genode::Allocator &alloc)
{
Lx::pci_init(env, ram, alloc);
diff --git a/repos/dde_linux/src/lib/usb/storage/storage.cc b/repos/dde_linux/src/lib/usb/storage/storage.cc
index c1650ac977..db06b29354 100644
--- a/repos/dde_linux/src/lib/usb/storage/storage.cc
+++ b/repos/dde_linux/src/lib/usb/storage/storage.cc
@@ -137,7 +137,7 @@ class Storage_device : public Genode::List::Element,
public:
- Storage_device(Genode::Ram_session &ram, struct scsi_device *sdev)
+ Storage_device(Genode::Ram_allocator &ram, struct scsi_device *sdev)
: Block::Driver(ram), _sdev(sdev)
{
/* read device capacity */
@@ -185,7 +185,7 @@ struct Factory : Block::Driver_factory
{
Storage_device device;
- Factory(Genode::Ram_session &ram, struct scsi_device *sdev)
+ Factory(Genode::Ram_allocator &ram, struct scsi_device *sdev)
: device(ram, sdev) {}
Block::Driver *create() { return &device; }
diff --git a/repos/dde_linux/src/lib/wifi/lx.h b/repos/dde_linux/src/lib/wifi/lx.h
index 88ad334a7f..82e25a6fd9 100644
--- a/repos/dde_linux/src/lib/wifi/lx.h
+++ b/repos/dde_linux/src/lib/wifi/lx.h
@@ -14,6 +14,9 @@
#ifndef _LX_H_
#define _LX_H_
+/* Genode includes */
+#include
+
/* local includes */
#include
diff --git a/repos/dde_linux/src/lx_kit/pci.cc b/repos/dde_linux/src/lx_kit/pci.cc
index 072165e601..6d308f8df6 100644
--- a/repos/dde_linux/src/lx_kit/pci.cc
+++ b/repos/dde_linux/src/lx_kit/pci.cc
@@ -53,9 +53,9 @@ struct Lx_kit::Memory_object_base : Genode::Object_pool::Ent
struct Lx_kit::Ram_object : Memory_object_base
{
- Genode::Ram_session &_ram;
+ Genode::Ram_allocator &_ram;
- Ram_object(Genode::Ram_session &ram,
+ Ram_object(Genode::Ram_allocator &ram,
Genode::Ram_dataspace_capability cap)
: Memory_object_base(cap), _ram(ram) {}
@@ -80,11 +80,11 @@ struct Lx_kit::Dma_object : Memory_object_base
********************/
static Genode::Constructible _global_pci;
-static Genode::Allocator *_global_md_alloc;
-static Genode::Ram_session *_global_ram;
+static Genode::Allocator *_global_md_alloc;
+static Genode::Ram_allocator *_global_ram;
-void Lx::pci_init(Genode::Env &env, Genode::Ram_session &ram,
+void Lx::pci_init(Genode::Env &env, Genode::Ram_allocator &ram,
Genode::Allocator &md_alloc)
{
_global_pci.construct(env);
diff --git a/repos/dde_linux/src/test/framebuffer/intel/main.cc b/repos/dde_linux/src/test/framebuffer/intel/main.cc
index 607ffc3955..ece87771d3 100644
--- a/repos/dde_linux/src/test/framebuffer/intel/main.cc
+++ b/repos/dde_linux/src/test/framebuffer/intel/main.cc
@@ -36,7 +36,7 @@ struct Framebuffer_controller
Signal_handler timer_handler;
void update_connector_config(Xml_generator & xml, Xml_node & node);
- void update_fb_config(Xml_node & report);
+ void update_fb_config(Xml_node const &report);
void report_changed();
void handle_timer();
@@ -66,9 +66,8 @@ void Framebuffer_controller::update_connector_config(Xml_generator & xml,
Xml_node & node)
{
xml.node("connector", [&] {
- String<64> name;
- node.attribute("name").value(&name);
- xml.attribute("name", name.string());
+
+ xml.attribute("name", node.attribute_value("name", String<64>()));
bool connected = node.attribute_value("connected", false);
xml.attribute("enabled", connected ? "true" : "false");
@@ -97,7 +96,7 @@ void Framebuffer_controller::update_connector_config(Xml_generator & xml,
}
-void Framebuffer_controller::update_fb_config(Xml_node & report)
+void Framebuffer_controller::update_fb_config(Xml_node const &report)
{
try {
static char buf[4096];
@@ -128,21 +127,15 @@ void Framebuffer_controller::update_fb_config(Xml_node & report)
void Framebuffer_controller::report_changed()
{
rom.update();
- if (!rom.is_valid()) return;
- Xml_node report(rom.local_addr(), rom.size());
- update_fb_config(report);
+ update_fb_config(rom.xml());
}
void Framebuffer_controller::handle_timer()
{
- if (!rom.is_valid())
- return;
-
/* artificial update */
- Xml_node report(rom.local_addr(), rom.size());
- update_fb_config(report);
+ update_fb_config(rom.xml());
}
diff --git a/repos/dde_rump/src/lib/rump/io.cc b/repos/dde_rump/src/lib/rump/io.cc
index ba9a053812..034575b001 100644
--- a/repos/dde_rump/src/lib/rump/io.cc
+++ b/repos/dde_rump/src/lib/rump/io.cc
@@ -13,7 +13,6 @@
#include "sched.h"
#include
-#include
#include
#include
#include
@@ -176,12 +175,14 @@ void rump_io_backend_init()
}
-void rumpuser_dprintf(const char *fmt, ...)
+void rumpuser_dprintf(const char *format, ...)
{
va_list list;
- va_start(list, fmt);
+ va_start(list, format);
- Genode::vprintf(fmt, list);
+ char buf[128] { };
+ Genode::String_console(buf, sizeof(buf)).vprintf(format, list);
+ Genode::log(Genode::Cstring(buf));
va_end(list);
}
diff --git a/repos/dde_rump/src/server/rump_fs/file_system.cc b/repos/dde_rump/src/server/rump_fs/file_system.cc
index ba09fd4ace..de5f4c93ea 100644
--- a/repos/dde_rump/src/server/rump_fs/file_system.cc
+++ b/repos/dde_rump/src/server/rump_fs/file_system.cc
@@ -89,7 +89,7 @@ void File_system::init()
Genode::log("Using ", fs_type, " as file system");
- size_t const avail = Rump::env().env().ram().avail_ram().value;
+ size_t const avail = Rump::env().env().pd().avail_ram().value;
rump_set_memlimit(avail);
/* start rump kernel */
diff --git a/repos/dde_rump/src/server/rump_fs/main.cc b/repos/dde_rump/src/server/rump_fs/main.cc
index b5abae6617..924999bf91 100644
--- a/repos/dde_rump/src/server/rump_fs/main.cc
+++ b/repos/dde_rump/src/server/rump_fs/main.cc
@@ -484,30 +484,27 @@ class Rump_fs::Root : public Root_component
}
ram_quota -= session_size;
- char tmp[MAX_PATH_LEN];
- try {
- Session_policy policy(label, _config.xml());
+ Session_policy const policy(label, _config.xml());
- /* determine policy root offset */
- try {
- policy.attribute("root").value(tmp, sizeof(tmp));
- session_root.import(tmp, "/mnt");
- } catch (Xml_node::Nonexistent_attribute) { }
+ /* determine policy root offset */
+ typedef String Root;
+ session_root.import(policy.attribute_value("root", Root()).string(), "/mnt");
- /*
- * Determine if the session is writeable.
- * Policy overrides client argument, both default to false.
- */
- if (policy.attribute_value("writeable", false))
- writeable = Arg_string::find_arg(args, "writeable").bool_value(false);
- }
- catch (Session_policy::No_policy_defined) { throw Service_denied(); }
+ /*
+ * Determine if the session is writeable.
+ * Policy overrides client argument, both default to false.
+ */
+ if (policy.attribute_value("writeable", false))
+ writeable = Arg_string::find_arg(args, "writeable").bool_value(false);
/* apply client's root offset */
- Arg_string::find_arg(args, "root").string(tmp, sizeof(tmp), "/");
- if (Genode::strcmp("/", tmp, sizeof(tmp))) {
- session_root.append("/");
- session_root.append(tmp);
+ {
+ char tmp[MAX_PATH_LEN] { };
+ Arg_string::find_arg(args, "root").string(tmp, sizeof(tmp), "/");
+ if (Genode::strcmp("/", tmp, sizeof(tmp))) {
+ session_root.append("/");
+ session_root.append(tmp);
+ }
}
session_root.remove_trailing('/');