Fix some deprecated warnings

Issue #1987
This commit is contained in:
Christian Helmuth
2017-03-20 12:04:55 +01:00
parent 707f66e9a5
commit 88db3c0df7
50 changed files with 205 additions and 251 deletions

View File

@ -12,10 +12,9 @@
*/ */
/* Genode includes */ /* Genode includes */
#include <os/server.h>
#include <root/component.h>
#include <base/heap.h> #include <base/heap.h>
#include <base/component.h> #include <base/component.h>
#include <root/component.h>
/* local includes */ /* local includes */
#include <sync_session/connection.h> #include <sync_session/connection.h>

View File

@ -178,7 +178,6 @@ void Plugin::init(Genode::Env &env)
char ip_addr_str[16] = {0}; char ip_addr_str[16] = {0};
char netmask_str[16] = {0}; char netmask_str[16] = {0};
char gateway_str[16] = {0}; char gateway_str[16] = {0};
char address_buf[128];
Genode::Attached_rom_dataspace config { env, "config"} ; Genode::Attached_rom_dataspace config { env, "config"} ;

View File

@ -17,7 +17,6 @@
#include <base/env.h> #include <base/env.h>
#include <base/log.h> #include <base/log.h>
#include <base/tslab.h> #include <base/tslab.h>
#include <os/server.h>
#include <timer_session/connection.h> #include <timer_session/connection.h>
#include <util/reconstructible.h> #include <util/reconstructible.h>

View File

@ -220,6 +220,8 @@ static int test_connect_recv(char const *sock_root, char const *sock_fd)
ssize_t n = write(fd, host, sizeof(host)); ssize_t n = write(fd, host, sizeof(host));
(void)n; (void)n;
close(fd); close(fd);
return 0;
} }
@ -252,7 +254,7 @@ static void test_proto(char const *sock_root, char const *proto)
ls_socket_fs(sock_dir); ls_socket_fs(sock_dir);
test_bind_accept(sock_root, sock_path); test_bind_accept(sock_root, sock_path);
// test_connect_recv(proto_root, sock_fd); if (0) test_connect_recv(proto_root, sock_path);
ls_socket_fs(sock_dir); ls_socket_fs(sock_dir);

View File

@ -112,6 +112,7 @@ namespace Allocator {
Backend_alloc(Cache_attribute cached) Backend_alloc(Cache_attribute cached)
: :
Rm_connection(Rump::env().env()),
Region_map_client(Rm_connection::create(VM_SIZE)), Region_map_client(Rm_connection::create(VM_SIZE)),
_cached(cached), _cached(cached),
_range(&Rump::env().heap()) _range(&Rump::env().heap())

View File

@ -37,7 +37,7 @@ class Driver : public Block::Driver
public: public:
Driver(Server::Entrypoint &ep, Genode::Ram_session &ram) Driver(Genode::Entrypoint &ep, Genode::Ram_session &ram)
: :
Block::Driver(ram), Block::Driver(ram),
_blk_sz(0), _blk_cnt(0), _cgd_device(0) _blk_sz(0), _blk_cnt(0), _cgd_device(0)

View File

@ -444,7 +444,7 @@ Cgd::Device *Cgd::Device::configure(Genode::Allocator *alloc, Cgd::Params const
/** /**
* Initialize a new Cgd::Device * Initialize a new Cgd::Device
*/ */
Cgd::Device *Cgd::init(Genode::Allocator *alloc, Server::Entrypoint &ep) Cgd::Device *Cgd::init(Genode::Allocator *alloc, Genode::Entrypoint &ep)
{ {
/* start rumpkernel */ /* start rumpkernel */
rump_init(); rump_init();

View File

@ -15,7 +15,6 @@
#define _CGD_H_ #define _CGD_H_
#include <base/signal.h> #include <base/signal.h>
#include <os/server.h>
namespace Cgd { namespace Cgd {
@ -52,7 +51,7 @@ namespace Cgd {
}; };
Device *init(Genode::Allocator *alloc, Server::Entrypoint &ep); Device *init(Genode::Allocator *alloc, Genode::Entrypoint &ep);
void deinit(Genode::Allocator *alloc, Device *dev); void deinit(Genode::Allocator *alloc, Device *dev);
} }

View File

@ -13,7 +13,7 @@
/* Genode includes */ /* Genode includes */
#include <base/env.h> #include <base/env.h>
#include <os/server.h> #include <base/component.h>
/* local includes */ /* local includes */
#include "block_driver.h" #include "block_driver.h"

View File

@ -68,7 +68,7 @@ append_platform_drv_config
append_if [have_spec framebuffer] config { append_if [have_spec framebuffer] config {
<start name="fb_drv"> <start name="fb_drv">
<resource name="RAM" quantum="4M"/> <resource name="RAM" quantum="10M"/>
<provides><service name="Framebuffer"/></provides> <provides><service name="Framebuffer"/></provides>
<config buffered="yes"/> <config buffered="yes"/>
</start>} </start>}

View File

@ -13,6 +13,7 @@
/* Genode includes */ /* Genode includes */
#include <base/component.h> #include <base/component.h>
#include <base/heap.h>
#include <base/attached_rom_dataspace.h> #include <base/attached_rom_dataspace.h>
#include <polygon_gfx/shaded_polygon_painter.h> #include <polygon_gfx/shaded_polygon_painter.h>
#include <polygon_gfx/interpolate_rgb565.h> #include <polygon_gfx/interpolate_rgb565.h>
@ -122,6 +123,7 @@ class Cpu_load_display::Cpu : public Genode::List<Cpu>::Element
{ {
private: private:
Genode::Allocator &_heap;
Genode::Point<> const _pos; Genode::Point<> const _pos;
Genode::List<Timeline> _timelines; Genode::List<Timeline> _timelines;
@ -138,8 +140,7 @@ class Cpu_load_display::Cpu : public Genode::List<Cpu>::Element
} }
/* add new timeline */ /* add new timeline */
Timeline *t = new (Genode::env()->heap()) Timeline *t = new (_heap) Timeline(subject_id, Genode::Cstring(label));
Timeline(subject_id, Genode::Cstring(label));
_timelines.insert(t); _timelines.insert(t);
return t; return t;
} }
@ -156,7 +157,8 @@ class Cpu_load_display::Cpu : public Genode::List<Cpu>::Element
public: public:
Cpu(Genode::Point<> pos) : _pos(pos) { } Cpu(Genode::Allocator &heap, Genode::Point<> pos)
: _heap(heap), _pos(pos) { }
bool has_pos(Genode::Point<> pos) const bool has_pos(Genode::Point<> pos) const
{ {
@ -183,7 +185,7 @@ class Cpu_load_display::Cpu : public Genode::List<Cpu>::Element
if (t->idle()) { if (t->idle()) {
_timelines.remove(t); _timelines.remove(t);
Genode::destroy(Genode::env()->heap(), t); Genode::destroy(_heap, t);
} }
} }
} }
@ -211,6 +213,8 @@ class Cpu_load_display::Cpu_registry
{ {
private: private:
Genode::Allocator &_heap;
Genode::List<Cpu> _cpus; Genode::List<Cpu> _cpus;
static Genode::Point<> _cpu_pos(Xml_node subject) static Genode::Point<> _cpu_pos(Xml_node subject)
@ -234,7 +238,7 @@ class Cpu_load_display::Cpu_registry
} }
/* add new CPU */ /* add new CPU */
Cpu *cpu = new (Genode::env()->heap()) Cpu(cpu_pos); Cpu *cpu = new (_heap) Cpu(_heap, cpu_pos);
_cpus.insert(cpu); _cpus.insert(cpu);
return cpu; return cpu;
} }
@ -248,6 +252,8 @@ class Cpu_load_display::Cpu_registry
public: public:
Cpu_registry(Genode::Allocator &heap) : _heap(heap) { }
void import_trace_subjects(Xml_node node, unsigned now) void import_trace_subjects(Xml_node node, unsigned now)
{ {
node.for_each_sub_node("subject", [&] (Xml_node subject) { node.for_each_sub_node("subject", [&] (Xml_node subject) {
@ -284,11 +290,13 @@ class Cpu_load_display::Scene : public Nano3d::Scene<PT>
Genode::Signal_handler<Scene> _config_handler; Genode::Signal_handler<Scene> _config_handler;
Genode::Attached_rom_dataspace _trace_subjects { "trace_subjects" }; Genode::Attached_rom_dataspace _trace_subjects { _env, "trace_subjects" };
unsigned _now = 0; unsigned _now = 0;
Cpu_registry _cpu_registry; Genode::Heap _heap { _env.ram(), _env.rm() };
Cpu_registry _cpu_registry { _heap };
void _handle_trace_subjects() void _handle_trace_subjects()
{ {
@ -325,8 +333,7 @@ class Cpu_load_display::Scene : public Nano3d::Scene<PT>
private: private:
Polygon::Shaded_painter _shaded_painter { Polygon::Shaded_painter _shaded_painter { _heap, _size.h() };
*Genode::env()->heap(), _size.h() };
long _activity_sum[Timeline::HISTORY_LEN]; long _activity_sum[Timeline::HISTORY_LEN];
long _y_level[Timeline::HISTORY_LEN]; long _y_level[Timeline::HISTORY_LEN];

View File

@ -29,7 +29,7 @@ Cpu_sampler::Cpu_session_component::create_thread(Pd_session_capability pd,
addr_t utcb) addr_t utcb)
{ {
Cpu_thread_component *cpu_thread = new (_md_alloc) Cpu_thread_component *cpu_thread = new (_md_alloc)
Cpu_thread_component(*this, Cpu_thread_component(*this, _env,
_md_alloc, _md_alloc,
pd, pd,
name, name,

View File

@ -23,6 +23,7 @@ using namespace Genode;
Cpu_sampler::Cpu_thread_component::Cpu_thread_component( Cpu_sampler::Cpu_thread_component::Cpu_thread_component(
Cpu_session_component &cpu_session_component, Cpu_session_component &cpu_session_component,
Env &env,
Allocator &md_alloc, Allocator &md_alloc,
Pd_session_capability pd, Pd_session_capability pd,
Cpu_session::Name const &name, Cpu_session::Name const &name,
@ -31,7 +32,7 @@ Cpu_sampler::Cpu_thread_component::Cpu_thread_component(
addr_t utcb, addr_t utcb,
char const *thread_name, char const *thread_name,
unsigned int thread_id) unsigned int thread_id)
: _cpu_session_component(cpu_session_component), : _cpu_session_component(cpu_session_component), _env(env),
_md_alloc(md_alloc), _md_alloc(md_alloc),
_parent_cpu_thread( _parent_cpu_thread(
_cpu_session_component.parent_cpu_session().create_thread(pd, _cpu_session_component.parent_cpu_session().create_thread(pd,
@ -61,9 +62,6 @@ Cpu_sampler::Cpu_thread_component::~Cpu_thread_component()
{ {
flush(); flush();
if (_log)
destroy(_md_alloc, _log);
_cpu_session_component.thread_ep().dissolve(this); _cpu_session_component.thread_ep().dissolve(this);
} }
@ -111,8 +109,8 @@ void Cpu_sampler::Cpu_thread_component::flush()
if (_sample_buf_index == 0) if (_sample_buf_index == 0)
return; return;
if (!_log) if (!_log.constructed())
_log = new (_md_alloc) Log_connection(_log_session_label); _log.construct(_env, _log_session_label);
/* number of hex characters + newline + '\0' */ /* number of hex characters + newline + '\0' */
enum { SAMPLE_STRING_SIZE = 2 * sizeof(addr_t) + 1 + 1 }; enum { SAMPLE_STRING_SIZE = 2 * sizeof(addr_t) + 1 + 1 };

View File

@ -35,6 +35,7 @@ class Cpu_sampler::Cpu_thread_component : public Rpc_object<Cpu_thread>
enum { SAMPLE_BUF_SIZE = 1024 }; enum { SAMPLE_BUF_SIZE = 1024 };
Cpu_session_component &_cpu_session_component; Cpu_session_component &_cpu_session_component;
Env &_env;
Allocator &_md_alloc; Allocator &_md_alloc;
@ -48,11 +49,12 @@ class Cpu_sampler::Cpu_thread_component : public Rpc_object<Cpu_thread>
Genode::addr_t _sample_buf[SAMPLE_BUF_SIZE]; Genode::addr_t _sample_buf[SAMPLE_BUF_SIZE];
unsigned int _sample_buf_index = 0; unsigned int _sample_buf_index = 0;
Log_connection *_log = 0; Constructible<Log_connection> _log;
public: public:
Cpu_thread_component(Cpu_session_component &cpu_session_component, Cpu_thread_component(Cpu_session_component &cpu_session_component,
Env &env,
Allocator &md_alloc, Allocator &md_alloc,
Pd_session_capability pd, Pd_session_capability pd,
Cpu_session::Name const &name, Cpu_session::Name const &name,

View File

@ -17,7 +17,6 @@
#include <base/heap.h> #include <base/heap.h>
#include <cpu_session/cpu_session.h> #include <cpu_session/cpu_session.h>
#include <base/attached_dataspace.h> #include <base/attached_dataspace.h>
#include <os/server.h>
#include <os/session_policy.h> #include <os/session_policy.h>
#include <os/static_root.h> #include <os/static_root.h>
#include <timer_session/connection.h> #include <timer_session/connection.h>
@ -32,7 +31,6 @@
namespace Cpu_sampler { struct Main; } namespace Cpu_sampler { struct Main; }
static constexpr bool verbose = false; static constexpr bool verbose = false;
static constexpr bool verbose_missed_timeouts = false;
static constexpr bool verbose_sample_duration = true; static constexpr bool verbose_sample_duration = true;
@ -46,7 +44,7 @@ struct Cpu_sampler::Main : Thread_list_change_handler
Genode::Heap alloc; Genode::Heap alloc;
Cpu_root cpu_root; Cpu_root cpu_root;
Attached_rom_dataspace config; Attached_rom_dataspace config;
Timer::Connection timer; Timer::Connection timer { env };
Thread_list thread_list; Thread_list thread_list;
Thread_list selected_thread_list; Thread_list selected_thread_list;
@ -55,11 +53,8 @@ struct Cpu_sampler::Main : Thread_list_change_handler
unsigned int timeout_us; unsigned int timeout_us;
void handle_timeout(unsigned int num) void handle_timeout()
{ {
if (verbose_missed_timeouts && (num > 1))
Genode::log("missed ", num - 1, " timeouts");
auto lambda = [&] (Thread_element *cpu_thread_element) { auto lambda = [&] (Thread_element *cpu_thread_element) {
Cpu_thread_component *cpu_thread = cpu_thread_element->object(); Cpu_thread_component *cpu_thread = cpu_thread_element->object();
@ -82,11 +77,11 @@ struct Cpu_sampler::Main : Thread_list_change_handler
} }
Signal_rpc_member<Main> timeout_dispatcher = Signal_handler<Main> timeout_dispatcher =
{ env.ep(), *this, &Main::handle_timeout }; { env.ep(), *this, &Main::handle_timeout };
void handle_config_update(unsigned) void handle_config_update()
{ {
config.update(); config.update();
@ -111,7 +106,7 @@ struct Cpu_sampler::Main : Thread_list_change_handler
} }
Signal_rpc_member<Main> config_update_dispatcher = Signal_handler<Main> config_update_dispatcher =
{ env.ep(), *this, &Main::handle_config_update}; { env.ep(), *this, &Main::handle_config_update};
@ -184,7 +179,7 @@ struct Cpu_sampler::Main : Thread_list_change_handler
/* /*
* Apply initial configuration * Apply initial configuration
*/ */
handle_config_update(0); handle_config_update();
/* /*
* Announce service * Announce service

View File

@ -73,9 +73,8 @@ set config {
<resource name="RAM" quantum="4M"/> <resource name="RAM" quantum="4M"/>
<config ld_verbose="yes" reset="no" poweroff="no" report="yes" acpi_ready="yes"> <config ld_verbose="yes" reset="no" poweroff="no" report="yes" acpi_ready="yes">
<!-- required for "debug-acpica": <!-- required for "debug-acpica":
<libc stdout="/dev/log"> <vfs> <dir name="dev"> <log/> </dir> </vfs>
<vfs> <dir name="dev"> <log/> </dir> </vfs> <libc stdout="/dev/log"/>
</libc>
--> -->
</config> </config>
<route> <route>

View File

@ -93,12 +93,11 @@ append config {
<arg value="avplay"/> <arg value="avplay"/>
<arg value="mediafile"/> <arg value="mediafile"/>
<sdl_audio_volume value="100"/> <sdl_audio_volume value="100"/>
<libc stdout="/dev/log" stderr="/dev/log"> <vfs>
<vfs> <dir name="dev"> <log/> </dir>
<dir name="dev"> <log/> </dir> <rom name="mediafile"/>
<rom name="mediafile"/> </vfs>
</vfs> <libc stdout="/dev/log" stderr="/dev/log"/>
</libc>
</config> </config>
<route> <route>
<service name="Platform"> <any-child /> </service> <service name="Platform"> <any-child /> </service>

View File

@ -104,9 +104,8 @@ append config {
<resource name="RAM" quantum="1G"/> <resource name="RAM" quantum="1G"/>
<route><any-service> <parent /> <any-child/> </any-service></route> <route><any-service> <parent /> <any-child/> </any-service></route>
<config> <config>
<libc stdout="/dev/log"> <vfs> <dir name="dev"> <log/> </dir> </vfs>
<vfs> <dir name="dev"> <log/> </dir> </vfs> <libc stdout="/dev/log"/>
</libc>
</config> </config>
</start> </start>
</config> </config>

View File

@ -38,15 +38,14 @@ install_config {
<start name="test-expat"> <start name="test-expat">
<resource name="RAM" quantum="2M"/> <resource name="RAM" quantum="2M"/>
<config> <config>
<libc stdout="/dev/log"> <vfs>
<vfs> <inline name="config"><config>
<inline name="config"><config> <test_tag test_attribute="test_value" />
<test_tag test_attribute="test_value" /> </config>
</config> </inline>
</inline> <dir name="dev"> <log/> </dir>
<dir name="dev"> <log/> </dir> </vfs>
</vfs> <libc stdout="/dev/log"/>
</libc>
</config> </config>
</start> </start>
</config> </config>

View File

@ -22,9 +22,8 @@ install_config {
<start name="test-libc_pipe"> <start name="test-libc_pipe">
<resource name="RAM" quantum="4M"/> <resource name="RAM" quantum="4M"/>
<config> <config>
<libc stdout="/dev/log" stderr="/dev/log"> <vfs> <dir name="dev"> <log/> </dir> </vfs>
<vfs> <dir name="dev"> <log/> </dir> </vfs> <libc stdout="/dev/log" stderr="/dev/log"/>
</libc>
</config> </config>
</start> </start>
</config> </config>

View File

@ -41,14 +41,11 @@ set config {
append_if [have_include "power_on/qemu"] config { append_if [have_include "power_on/qemu"] config {
<write-read size="1M" buffer_size="8K"/>} <write-read size="1M" buffer_size="8K"/>}
append config { append config {
<libc stdout="/dev/log" cwd="/tmp" > <vfs>
<vfs> <dir name="tmp"> <fs/> </dir>
<dir name="tmp" > <dir name="dev"> <log/> </dir>
<fs/> </vfs>
</dir> <libc stdout="/dev/log" cwd="/tmp"/>
<dir name="dev"> <log/> </dir>
</vfs>
</libc>
</config> </config>
</start> </start>
</config> </config>

View File

@ -44,14 +44,11 @@ set config {
append_if [have_include "power_on/qemu"] config { append_if [have_include "power_on/qemu"] config {
<write-read size="1M" buffer_size="8K"/>} <write-read size="1M" buffer_size="8K"/>}
append config { append config {
<libc stdout="/dev/log" cwd="/tmp" > <vfs>
<vfs> <dir name="tmp"> <fs/> </dir>
<dir name="tmp" > <dir name="dev"> <log/> </dir>
<fs/> </vfs>
</dir> <libc stdout="/dev/log" cwd="/tmp"/>
<dir name="dev"> <log/> </dir>
</vfs>
</libc>
</config> </config>
</start> </start>
</config> </config>

View File

@ -39,14 +39,11 @@ set config {
append_if [have_include "power_on/qemu"] config { append_if [have_include "power_on/qemu"] config {
<write-read size="1M" buffer_size="8K"/>} <write-read size="1M" buffer_size="8K"/>}
append config { append config {
<libc stdout="/dev/log" cwd="/tmp" > <vfs>
<vfs> <dir name="tmp"> <ram/> </dir>
<dir name="tmp" > <dir name="dev"> <log/> </dir>
<ram/> </vfs>
</dir> <libc stdout="/dev/log" cwd="/tmp"/>
<dir name="dev"> <log/> </dir>
</vfs>
</libc>
</config> </config>
</start> </start>
</config> </config>

View File

@ -28,9 +28,8 @@ install_config {
<start name="test-moon"> <start name="test-moon">
<resource name="RAM" quantum="1G"/> <resource name="RAM" quantum="1G"/>
<config> <config>
<libc stdout="/dev/log"> <vfs> <dir name="dev"> <log/> </dir> </vfs>
<vfs> <dir name="dev"> <log/> </dir> </vfs> <libc stdout="/dev/log"/>
</libc>
</config> </config>
</start> </start>
</config> </config>

View File

@ -61,12 +61,11 @@ append config {
<start name="mupdf"> <start name="mupdf">
<resource name="RAM" quantum="1G"/> <resource name="RAM" quantum="1G"/>
<config> <config>
<libc stdout="/dev/log" stderr="/dev/log"> <vfs>
<vfs> <rom name="test.pdf" />
<rom name="test.pdf" /> <dir name="dev"> <log/> </dir>
<dir name="dev"> <log/> </dir> </vfs>
</vfs> <libc stdout="/dev/log" stderr="/dev/log"/>
</libc>
</config> </config>
</start> </start>
</config> </config>

View File

@ -69,11 +69,10 @@ append config {
<any-service> <parent/> <any-child/> </any-service> <any-service> <parent/> <any-child/> </any-service>
</route> </route>
<config port="80"> <config port="80">
<vfs> <dir name="dev"> <log/> </dir> </vfs>
<libc stdout="/dev/log" stderr="/dev/log" <libc stdout="/dev/log" stderr="/dev/log"
ip_addr="10.0.2.55" netmask="255.255.255.0" ip_addr="10.0.2.55" netmask="255.255.255.0"
gateway="10.0.2.1"> gateway="10.0.2.1"/>
<vfs> <dir name="dev"> <log/> </dir> </vfs>
</libc>
</config> </config>
</start> </start>
<start name="test-http_clnt"> <start name="test-http_clnt">
@ -83,9 +82,8 @@ append config {
<any-service> <parent/> <any-child/> </any-service> <any-service> <parent/> <any-child/> </any-service>
</route> </route>
<config server_ip="10.0.2.55" server_port="80"> <config server_ip="10.0.2.55" server_port="80">
<libc stdout="/dev/log" stderr="/dev/log"> <vfs> <dir name="dev"> <log/> </dir> </vfs>
<vfs> <dir name="dev"> <log/> </dir> </vfs> <libc stdout="/dev/log" stderr="/dev/log"/>
</libc>
</config> </config>
</start> </start>
</config>} </config>}

View File

@ -22,9 +22,8 @@ install_config {
<start name="test-pthread"> <start name="test-pthread">
<resource name="RAM" quantum="64M"/> <resource name="RAM" quantum="64M"/>
<config> <config>
<libc stdout="/dev/log"> <vfs> <dir name="dev"> <log/> </dir> </vfs>
<vfs> <dir name="dev"> <log/> </dir> </vfs> <libc stdout="/dev/log"/>
</libc>
</config> </config>
</start> </start>
</config> </config>

View File

@ -39,10 +39,9 @@ set config {
<resource name="RAM" quantum="3M"/> <resource name="RAM" quantum="3M"/>
<config> <config>
<script name="hello.py"/> <script name="hello.py"/>
<libc stdout="/dev/log" stderr="/dev/log"> <vfs>
<vfs> <dir name="dev"> <log/> </dir>
<dir name="dev"> <log/> </dir> <inline name="hello.py">
<inline name="hello.py">
print " \r\n\r"; print " \r\n\r";
print " -============================-"; print " -============================-";
print " || ||"; print " || ||";
@ -54,9 +53,9 @@ print " -============================-";
print " \r"; print " \r";
print " 2011 by Genode Labs www.genode-labs.com"; print " 2011 by Genode Labs www.genode-labs.com";
print " \r\n\r"; print " \r\n\r";
</inline> </inline>
</vfs> </vfs>
</libc> <libc stdout="/dev/log" stderr="/dev/log"/>
</config> </config>
</start> </start>
</config> </config>

View File

@ -53,12 +53,11 @@ append config {
<start name="qt_avplay"> <start name="qt_avplay">
<resource name="RAM" quantum="2G"/> <resource name="RAM" quantum="2G"/>
<config> <config>
<libc stdout="/dev/log" stderr="/dev/log"> <vfs>
<vfs> <dir name="dev"> <log/> </dir>
<dir name="dev"> <log/> </dir> <tar name="qt5_fs_qt_avplay.tar"/>
<tar name="qt5_fs_qt_avplay.tar"/> </vfs>
</vfs> <libc stdout="/dev/log" stderr="/dev/log"/>
</libc>
<mediafile name="mediafile"/> <mediafile name="mediafile"/>
</config> </config>
</start> </start>

View File

@ -41,12 +41,11 @@ append config {
<start name="calculatorform"> <start name="calculatorform">
<resource name="RAM" quantum="80M"/> <resource name="RAM" quantum="80M"/>
<config> <config>
<libc stdout="/dev/log" stderr="/dev/log"> <vfs>
<vfs> <dir name="dev"> <log/> </dir>
<dir name="dev"> <log/> </dir> <tar name="qt5_fs_calculatorform.tar"/>
<tar name="qt5_fs_calculatorform.tar"/> </vfs>
</vfs> <libc stdout="/dev/log" stderr="/dev/log"/>
</libc>
</config> </config>
</start> </start>
</config> </config>

View File

@ -40,12 +40,11 @@ append config {
<start name="openglwindow"> <start name="openglwindow">
<resource name="RAM" quantum="80M"/> <resource name="RAM" quantum="80M"/>
<config> <config>
<libc stdout="/dev/log" stderr="/dev/log"> <vfs>
<vfs> <dir name="dev"> <log/> </dir>
<dir name="dev"> <log/> </dir> <tar name="qt5_fs_openglwindow.tar"/>
<tar name="qt5_fs_openglwindow.tar"/> </vfs>
</vfs> <libc stdout="/dev/log" stderr="/dev/log"/>
</libc>
</config> </config>
</start> </start>
</config> </config>

View File

@ -40,12 +40,11 @@ append config {
<start name="previewer"> <start name="previewer">
<resource name="RAM" quantum="2G"/> <resource name="RAM" quantum="2G"/>
<config> <config>
<libc stdout="/dev/log" stderr="/dev/log"> <vfs>
<vfs> <dir name="dev"> <log/> </dir>
<dir name="dev"> <log/> </dir> <tar name="qt5_fs_previewer.tar"/>
<tar name="qt5_fs_previewer.tar"/> </vfs>
</vfs> <libc stdout="/dev/log" stderr="/dev/log"/>
</libc>
</config> </config>
</start> </start>
</config> </config>

View File

@ -47,12 +47,11 @@ append config {
<start name="test-qpluginwidget"> <start name="test-qpluginwidget">
<resource name="RAM" quantum="30M"/> <resource name="RAM" quantum="30M"/>
<config> <config>
<libc stdout="/dev/log" stderr="/dev/log"> <vfs>
<vfs> <dir name="dev"> <log/> </dir>
<dir name="dev"> <log/> </dir> <tar name="qt5_fs_test-qpluginwidget.tar"/>
<tar name="qt5_fs_test-qpluginwidget.tar"/> </vfs>
</vfs> <libc stdout="/dev/log" stderr="/dev/log"/>
</libc>
</config> </config>
</start> </start>
</config> </config>

View File

@ -41,12 +41,11 @@ append config {
<start name="qt_quicktest"> <start name="qt_quicktest">
<resource name="RAM" quantum="80M"/> <resource name="RAM" quantum="80M"/>
<config> <config>
<libc stdout="/dev/log" stderr="/dev/log"> <vfs>
<vfs> <dir name="dev"> <log/> </dir>
<dir name="dev"> <log/> </dir> <tar name="qt5_fs_qt_quicktest.tar" />
<tar name="qt5_fs_qt_quicktest.tar" /> </vfs>
</vfs> <libc stdout="/dev/log" stderr="/dev/log"/>
</libc>
</config> </config>
</start> </start>
</config> </config>

View File

@ -41,12 +41,11 @@ append config {
<start name="samegame"> <start name="samegame">
<resource name="RAM" quantum="128M"/> <resource name="RAM" quantum="128M"/>
<config> <config>
<libc stdout="/dev/log" stderr="/dev/log"> <vfs>
<vfs> <dir name="dev"> <log/> </dir>
<dir name="dev"> <log/> </dir> <tar name="qt5_fs_samegame.tar" />
<tar name="qt5_fs_samegame.tar" /> </vfs>
</vfs> <libc stdout="/dev/log" stderr="/dev/log"/>
</libc>
</config> </config>
</start> </start>
</config> </config>

View File

@ -40,12 +40,11 @@ append config {
<start name="tetrix"> <start name="tetrix">
<resource name="RAM" quantum="80M"/> <resource name="RAM" quantum="80M"/>
<config> <config>
<libc stdout="/dev/log" stderr="/dev/log"> <vfs>
<vfs> <dir name="dev"> <log/> </dir>
<dir name="dev"> <log/> </dir> <tar name="qt5_fs_tetrix.tar"/>
<tar name="qt5_fs_tetrix.tar"/> </vfs>
</vfs> <libc stdout="/dev/log" stderr="/dev/log"/>
</libc>
</config> </config>
</start> </start>
</config> </config>

View File

@ -68,9 +68,8 @@ append config {
<start name="test-sdl"> <start name="test-sdl">
<resource name="RAM" quantum="32M"/> <resource name="RAM" quantum="32M"/>
<config> <config>
<libc stdout="/dev/log"> <vfs> <dir name="dev"> <log/> </dir> </vfs>
<vfs> <dir name="dev"> <log/> </dir> </vfs> <libc stdout="/dev/log"/>
</libc>
</config> </config>
</start> </start>
</config>} </config>}

View File

@ -86,19 +86,18 @@ append config {
<start name="test-smartcard"> <start name="test-smartcard">
<resource name="RAM" quantum="4M"/> <resource name="RAM" quantum="4M"/>
<config> <config>
<libc stdout="/dev/log" stderr="/dev/log"> <vfs>
<vfs> <dir name="dev"> <log/> </dir>
<dir name="dev"> <log/> </dir> <dir name="ifd-ccid.bundle">
<dir name="ifd-ccid.bundle"> <dir name="Contents">
<dir name="Contents"> <rom name="Info.plist"/>
<rom name="Info.plist"/>
</dir>
</dir> </dir>
<inline name="config.pcsc-lite"> </dir>
<config vendor_id="0x04e6" product_id="0x5116"/> <inline name="config.pcsc-lite">
</inline> <config vendor_id="0x04e6" product_id="0x5116"/>
</vfs> </inline>
</libc> </vfs>
<libc stdout="/dev/log" stderr="/dev/log"/>
</config> </config>
</start> </start>
</config>} </config>}

View File

@ -19,9 +19,8 @@ install_config {
<start name="test-stdcxx"> <start name="test-stdcxx">
<resource name="RAM" quantum="10M"/> <resource name="RAM" quantum="10M"/>
<config> <config>
<libc stdout="/dev/log"> <vfs> <dir name="dev"> <log/> </dir> </vfs>
<vfs> <dir name="dev"> <log/> </dir> </vfs> <libc stdout="/dev/log"/>
</libc>
</config> </config>
</start> </start>
</config> </config>

View File

@ -113,9 +113,8 @@ append config "
<arg value=\"$ip_addr\"/>" <arg value=\"$ip_addr\"/>"
append config { append config {
<argv verbose="0" listenip="0.0.0.0" /> <argv verbose="0" listenip="0.0.0.0" />
<libc stdout="/dev/log" stderr="/dev/log"> <vfs> <dir name="dev"> <log/> </dir> </vfs>
<vfs> <dir name="dev"> <log/> </dir> </vfs> <libc stdout="/dev/log" stderr="/dev/log"/>
</libc>
</config> </config>
</start>} </start>}

View File

@ -61,9 +61,8 @@ set config {
<resource name="RAM" quantum="16M"/> <resource name="RAM" quantum="16M"/>
<config> <config>
<argv verbose="0" listenip="0.0.0.0" /> <argv verbose="0" listenip="0.0.0.0" />
<libc stdout="/dev/log" stderr="/dev/log"> <vfs> <dir name="dev"> <log/> </dir> </vfs>
<vfs> <dir name="dev"> <log/> </dir> </vfs> <libc stdout="/dev/log" stderr="/dev/log"/>
</libc>
</config> </config>
</start> } </start> }

View File

@ -152,6 +152,7 @@ struct Transform::Main {
_dispatch_acpi_ec(env.ep(), *this, &Main::check_acpi_ec), _dispatch_acpi_ec(env.ep(), *this, &Main::check_acpi_ec),
_dispatch_acpi_fixed(env.ep(), *this, &Main::check_acpi_fixed), _dispatch_acpi_fixed(env.ep(), *this, &Main::check_acpi_fixed),
_dispatch_acpi_lid(env.ep(), *this, &Main::check_acpi_lid), _dispatch_acpi_lid(env.ep(), *this, &Main::check_acpi_lid),
_session(env, env.ram()),
_root(env.ep().rpc_ep(), _session) _root(env.ep().rpc_ep(), _session)
{ {
Xml_node config(_config.local_addr<char>(), _config.size()); Xml_node config(_config.local_addr<char>(), _config.size());

View File

@ -21,6 +21,8 @@
#include <os/config.h> #include <os/config.h>
#include <base/sleep.h> #include <base/sleep.h>
#include <libc/component.h>
extern "C" { extern "C" {
#include <lwip/sockets.h> #include <lwip/sockets.h>
#include <lwip/api.h> #include <lwip/api.h>
@ -75,11 +77,11 @@ bool static_ip_config(uint32_t & ip, uint32_t & nm, uint32_t & gw)
* and sends as much 'http get' requests as possible, * and sends as much 'http get' requests as possible,
* printing out the response. * printing out the response.
*/ */
int main() void Libc::Component::construct(Libc::Env &env)
{ {
enum { BUF_SIZE = Nic::Packet_allocator::DEFAULT_PACKET_SIZE * 128 }; enum { BUF_SIZE = Nic::Packet_allocator::DEFAULT_PACKET_SIZE * 128 };
static Timer::Connection _timer; static Timer::Connection _timer(env);
_timer.msleep(2000); _timer.msleep(2000);
lwip_tcpip_init(); lwip_tcpip_init();
@ -100,13 +102,13 @@ int main()
if (static_ip) { if (static_ip) {
if (lwip_nic_init(ip, nm, gw, BUF_SIZE, BUF_SIZE)) { if (lwip_nic_init(ip, nm, gw, BUF_SIZE, BUF_SIZE)) {
error("We got no IP address!"); error("We got no IP address!");
return 0; exit(1);
} }
} else { } else {
if( lwip_nic_init(0, 0, 0, BUF_SIZE, BUF_SIZE)) if( lwip_nic_init(0, 0, 0, BUF_SIZE, BUF_SIZE))
{ {
error("got no IP address!"); error("got no IP address!");
return 0; exit(1);
} }
} }
@ -167,13 +169,4 @@ int main()
} }
log("Test done"); log("Test done");
/*
* FIXME Cleaning up LWIP when returning from the main function
* sporadically leads to endless errors "Error: sys_arch_mbox_fetch:
* unknown exception occured!". We let the client sleep here to
* prevent tests from failing due to a flooded log.
*/
sleep_forever();
return 0;
} }

View File

@ -1,5 +1,5 @@
TARGET = test-http_clnt TARGET = test-http_clnt
LIBS = lwip posix LIBS = lwip libc
SRC_CC = main.cc SRC_CC = main.cc
INC_DIR += $(REP_DIR)/src/lib/lwip/include INC_DIR += $(REP_DIR)/src/lib/lwip/include

View File

@ -69,6 +69,8 @@ class Worker : public Genode::Thread_deprecated<0x4000>
{ {
protected: protected:
Timer::Connection _timer;
char _name[128]; char _name[128];
unsigned _id; unsigned _id;
int _sd; int _sd;
@ -82,24 +84,23 @@ class Worker : public Genode::Thread_deprecated<0x4000>
public: public:
Worker(char const *type, unsigned id, int sd) Worker(Genode::Env &env, char const *type, unsigned id, int sd)
: :
Genode::Thread_deprecated<0x4000>(_init_name(type, id)), Genode::Thread_deprecated<0x4000>(_init_name(type, id)),
_id(id), _sd(sd) _timer(env), _id(id), _sd(sd)
{ } { }
}; };
struct Reader : Worker struct Reader : Worker
{ {
Reader(unsigned id, int sd) : Worker("reader", id, sd) { } Reader(Genode::Env &env, unsigned id, int sd)
: Worker(env, "reader", id, sd) { }
void entry() override void entry() override
{ {
Timer::Connection timer;
while (true) { while (true) {
// timer.msleep(100); // _timer.msleep(100);
int const ret = ::read(_sd, _buf, sizeof(_buf)); int const ret = ::read(_sd, _buf, sizeof(_buf));
@ -114,12 +115,11 @@ struct Reader : Worker
struct Writer : Worker struct Writer : Worker
{ {
Writer(unsigned id, int sd) : Worker("writer", id, sd) { } Writer(Genode::Env &env, unsigned id, int sd)
: Worker(env, "writer", id, sd) { }
void entry() override void entry() override
{ {
Timer::Connection timer;
size_t size = 0; size_t size = 0;
if (0) { if (0) {
@ -132,7 +132,7 @@ struct Writer : Worker
_buf[size - 1] = '\n'; _buf[size - 1] = '\n';
while (true) { while (true) {
// timer.msleep(10 + _id*5); // _timer.msleep(10 + _id*5);
int const ret = ::write(_sd, _buf, size); int const ret = ::write(_sd, _buf, size);
@ -145,14 +145,14 @@ struct Writer : Worker
}; };
static void test_reader_writer(int cd) static void test_reader_writer(Genode::Env &env, int cd)
{ {
static Reader r0(0, cd); static Reader r0(env, 0, cd);
static Reader r1(1, cd); static Reader r1(env, 1, cd);
static Reader r2(2, cd); static Reader r2(env, 2, cd);
static Writer w0(0, cd); static Writer w0(env, 0, cd);
static Writer w1(1, cd); static Writer w1(env, 1, cd);
static Writer w2(2, cd); static Writer w2(env, 2, cd);
r0.start(); r0.start();
r1.start(); r1.start();
@ -225,7 +225,7 @@ static void test_getnames(int sd)
} }
static void server(Genode::Xml_node const config) static void server(Genode::Env &env, Genode::Xml_node const config)
{ {
int ret = 0; int ret = 0;
@ -267,7 +267,7 @@ static void server(Genode::Xml_node const config)
test_getnames(cd); test_getnames(cd);
if (0) { if (0) {
test_reader_writer(cd); test_reader_writer(env, cd);
} else { } else {
size_t const count = test_traditional(cd, use_read_write); size_t const count = test_traditional(cd, use_read_write);
Genode::log("echoed ", count, " bytes"); Genode::log("echoed ", count, " bytes");
@ -348,7 +348,7 @@ struct Main
mode = config.attribute_value("mode", mode); mode = config.attribute_value("mode", mode);
if (mode == "server") { if (mode == "server") {
server(config); server(env, config);
} else if (mode == "client") { } else if (mode == "client") {
client(config); client(config);
} else { } else {

View File

@ -192,7 +192,7 @@ struct Framebuffer::Main
void * _lcd_base { _env.rm().attach(_lcd_io_mem.dataspace()) }; void * _lcd_base { _env.rm().attach(_lcd_io_mem.dataspace()) };
/* locally map system control registers */ /* locally map system control registers */
Io_mem_connection _sys_mem { SP810_PHYS, SP810_SIZE }; Io_mem_connection _sys_mem { _env, SP810_PHYS, SP810_SIZE };
void * _sys_base { _env.rm().attach(_sys_mem.dataspace()) }; void * _sys_base { _env.rm().attach(_sys_mem.dataspace()) };
Dataspace_capability _fb_ds_cap { _env.ram().alloc(Framebuffer::FRAMEBUFFER_SIZE) }; Dataspace_capability _fb_ds_cap { _env.ram().alloc(Framebuffer::FRAMEBUFFER_SIZE) };

View File

@ -15,8 +15,9 @@
#define _IRQ_HANDLER_H_ #define _IRQ_HANDLER_H_
/* Genode includes */ /* Genode includes */
#include <base/env.h>
#include <base/signal.h>
#include <irq_session/connection.h> #include <irq_session/connection.h>
#include <os/server.h>
/* local includes */ /* local includes */
#include "input_driver.h" #include "input_driver.h"
@ -26,11 +27,11 @@ class Irq_handler
{ {
private: private:
Genode::Irq_connection _irq; Genode::Irq_connection _irq;
Genode::Signal_rpc_member<Irq_handler> _dispatcher; Genode::Signal_handler<Irq_handler> _dispatcher;
Input_driver &_input_driver; Input_driver &_input_driver;
void _handle(unsigned) void _handle()
{ {
_irq.ack_irq(); _irq.ack_irq();
@ -41,11 +42,11 @@ class Irq_handler
public: public:
Irq_handler(Server::Entrypoint &ep, int irq_number, Irq_handler(Genode::Env &env, int irq_number,
Serial_interface &, Input_driver &input_driver) Serial_interface &, Input_driver &input_driver)
: :
_irq(irq_number), _irq(env, irq_number),
_dispatcher(ep, *this, &Irq_handler::_handle), _dispatcher(env.ep(), *this, &Irq_handler::_handle),
_input_driver(input_driver) _input_driver(input_driver)
{ {
_irq.sigh(_dispatcher); _irq.sigh(_dispatcher);

View File

@ -30,8 +30,8 @@ struct Ps2::Main
{ {
Genode::Env &_env; Genode::Env &_env;
Pl050 _pl050; Pl050 _pl050 { _env };
Input::Session_component _session; Input::Session_component _session { _env, _env.ram() };
Input::Root_component _root { _env.ep().rpc_ep(), _session }; Input::Root_component _root { _env.ep().rpc_ep(), _session };
Genode::Attached_rom_dataspace _config { _env, "config" }; Genode::Attached_rom_dataspace _config { _env, "config" };
@ -41,8 +41,8 @@ struct Ps2::Main
Mouse _mouse { _pl050.aux_interface(), _session.event_queue(), _verbose }; Mouse _mouse { _pl050.aux_interface(), _session.event_queue(), _verbose };
Keyboard _keyboard { _pl050.kbd_interface(), _session.event_queue(), true, _verbose }; Keyboard _keyboard { _pl050.kbd_interface(), _session.event_queue(), true, _verbose };
Irq_handler _mouse_irq { _env.ep(), PL050_MOUSE_IRQ, _pl050.aux_interface(), _mouse }; Irq_handler _mouse_irq { _env, PL050_MOUSE_IRQ, _pl050.aux_interface(), _mouse };
Irq_handler _keyboard_irq { _env.ep(), PL050_KEYBD_IRQ, _pl050.kbd_interface(), _keyboard }; Irq_handler _keyboard_irq { _env, PL050_KEYBD_IRQ, _pl050.kbd_interface(), _keyboard };
Main(Genode::Env &env) : _env(env) Main(Genode::Env &env) : _env(env)
{ {

View File

@ -19,7 +19,7 @@
/* Genode includes */ /* Genode includes */
#include <os/ring_buffer.h> #include <os/ring_buffer.h>
#include <io_mem_session/connection.h> #include <base/attached_io_mem_dataspace.h>
/* local includes */ /* local includes */
#include "serial_interface.h" #include "serial_interface.h"
@ -63,19 +63,9 @@ class Pl050
{ {
private: private:
Genode::Lock _lock; Genode::Lock _lock;
Genode::Io_mem_connection _io_mem; Genode::Attached_io_mem_dataspace _io_mem;
volatile Genode::uint32_t *_reg_base; volatile Genode::uint32_t *_reg_base;
/**
* Attach memory-mapped PL050 registers to local address space
*
* \return local base address of memory-mapped I/O registers
*/
Genode::uint32_t *_attach(Genode::Io_mem_session &ios)
{
return Genode::env()->rm_session()->attach(ios.dataspace());
}
/** /**
* Return true if input is available * Return true if input is available
@ -91,9 +81,11 @@ class Pl050
* \param phys_base local address of the channel's device * \param phys_base local address of the channel's device
* registers * registers
*/ */
_Channel(Genode::addr_t phys_base, Genode::size_t phys_size) _Channel(Genode::Env &env,
Genode::addr_t phys_base, Genode::size_t phys_size)
: :
_io_mem(phys_base, phys_size), _reg_base(_attach(_io_mem)) _io_mem(env, phys_base, phys_size),
_reg_base(_io_mem.local_addr<Genode::uint32_t>())
{ } { }
/** /**
@ -137,9 +129,9 @@ class Pl050
/** /**
* Constructor * Constructor
*/ */
Pl050() : Pl050(Genode::Env &env) :
_kbd(PL050_KEYBD_PHYS, PL050_KEYBD_SIZE), _kbd(env, PL050_KEYBD_PHYS, PL050_KEYBD_SIZE),
_aux(PL050_MOUSE_PHYS, PL050_MOUSE_SIZE) _aux(env, PL050_MOUSE_PHYS, PL050_MOUSE_SIZE)
{ {
_kbd.enable_irq(); _kbd.enable_irq();
_aux.enable_irq(); _aux.enable_irq();

View File

@ -15,7 +15,6 @@
#include <block_session/connection.h> #include <block_session/connection.h>
#include <block/component.h> #include <block/component.h>
#include <os/packet_allocator.h> #include <os/packet_allocator.h>
#include <os/server.h>
#include "chunk.h" #include "chunk.h"