lwip: remove use of global constructor

Related to issue #3487
This commit is contained in:
Norman Feske 2019-09-23 10:37:28 +02:00 committed by Christian Helmuth
parent e0ee56275e
commit 9500e8b6e1
1 changed files with 6 additions and 3 deletions

View File

@ -48,7 +48,7 @@ namespace Lwip {
Sys_timer(Genode::Timeout_scheduler &timer) : timer(timer) { }
};
static Genode::Constructible<Sys_timer> _sys_timer;
static Sys_timer *sys_timer_ptr;
void genode_init(Genode::Allocator &heap, Genode::Timeout_scheduler &timer)
{
@ -56,7 +56,10 @@ namespace Lwip {
!heap.need_size_for_free());
_heap = &heap;
_sys_timer.construct(timer);
static Sys_timer sys_timer(timer);
sys_timer_ptr = &sys_timer;
lwip_init();
}
}
@ -93,7 +96,7 @@ extern "C" {
}
u32_t sys_now(void) {
return Lwip::_sys_timer->timer.curr_time().trunc_to_plain_ms().value; }
return Lwip::sys_timer_ptr->timer.curr_time().trunc_to_plain_ms().value; }
void genode_memcpy(void *dst, const void *src, size_t len) {
Genode::memcpy(dst, src, len); }