noux: add generic construction function

This function ('noux_construct') is called from each back-end's
construct method (libc or Genode component).

fixes 
This commit is contained in:
Sebastian Sumpf 2017-02-24 14:50:21 +01:00 committed by Christian Helmuth
parent 9067768d25
commit 2000b7c0e6
6 changed files with 68 additions and 9 deletions

@ -0,0 +1,21 @@
/**
* \brief Noux initialization
* \author Sebastian Sumpf
* \date 2017-02-24
*/
/*
* Copyright (C) 2017 Genode Labs GmbH
*
* This file is part of the Genode OS framework, which is distributed
* under the terms of the GNU Affero General Public License version 3.
*/
#ifndef __NOUX_CONSTRUCT_H_
#define __NOUX_CONSTRUCT_H_
namespace Genode { class Env; }
void noux_construct(Genode::Env &env);
#endif /* __NOUX_CONSTRUCT_H_ */

@ -18,6 +18,7 @@
/* Noux includes */
#include <child.h>
#include <construct.h>
#include <noux_session/sysio.h>
#include <vfs_io_channel.h>
#include <terminal_io_channel.h>
@ -307,10 +308,7 @@ struct Noux::Main
};
void Component::construct(Genode::Env &env) { static Noux::Main main(env); }
/**
* Support for the noux/net version
*/
void Libc::Component::construct(Libc::Env &env) { Component::construct(env); }
void noux_construct(Genode::Env &env)
{
static Noux::Main main(env);
}

@ -0,0 +1,20 @@
/**
* \brief Noux initialization
* \author Sebastian Sumpf
* \date 2017-02-24
*/
/*
* Copyright (C) 2017 Genode Labs GmbH
*
* This file is part of the Genode OS framework, which is distributed
* under the terms of the GNU Affero General Public License version 3.
*/
#include <base/component.h>
#include <construct.h>
void Component::construct(Genode::Env &env)
{
noux_construct(env);
}

@ -1,6 +1,6 @@
TARGET = noux
LIBS = alarm vfs
SRC_CC = main.cc syscall.cc dummy_net.cc
SRC_CC = main.cc syscall.cc dummy_net.cc construct.cc
INC_DIR += $(PRG_DIR)
INC_DIR += $(PRG_DIR)/../

@ -0,0 +1,20 @@
/**
* \brief Noux initialization
* \author Sebastian Sumpf
* \date 2017-02-24
*/
/*
* Copyright (C) 2017 Genode Labs GmbH
*
* This file is part of the Genode OS framework, which is distributed
* under the terms of the GNU Affero General Public License version 3.
*/
#include <libc/component.h>
#include <construct.h>
void Libc::Component::construct(Libc::Env &env)
{
noux_construct(env);
}

@ -1,6 +1,6 @@
TARGET = noux_net
LIBS += alarm libc libc_lwip_nic_dhcp vfs
SRC_CC = main.cc syscall.cc net.cc
SRC_CC = main.cc syscall.cc net.cc construct.cc
INC_DIR += $(PRG_DIR)
INC_DIR += $(PRG_DIR)/../