mirror of
https://github.com/genodelabs/genode.git
synced 2025-04-11 13:22:33 +00:00
noux: add generic construction function
This function ('noux_construct') is called from each back-end's construct method (libc or Genode component). fixes #2291
This commit is contained in:
parent
9067768d25
commit
2000b7c0e6
repos/ports/src/noux
21
repos/ports/src/noux/construct.h
Normal file
21
repos/ports/src/noux/construct.h
Normal file
@ -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);
|
||||
}
|
||||
|
20
repos/ports/src/noux/minimal/construct.cc
Normal file
20
repos/ports/src/noux/minimal/construct.cc
Normal file
@ -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)/../
|
||||
|
||||
|
20
repos/ports/src/noux/net/construct.cc
Normal file
20
repos/ports/src/noux/net/construct.cc
Normal file
@ -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)/../
|
||||
|
Loading…
x
Reference in New Issue
Block a user