Replace 'Env' interface with modern one

The original 'Env' interface as returned by 'Genode::env()' has been
renamed to 'Env_deprecated' and moved to deprecated/env.h. The new version
of base/env.h contains the interface passed to modern components that
use the component API via base/component.h.

Issue #1832
This commit is contained in:
Norman Feske
2016-04-27 22:11:38 +02:00
committed by Christian Helmuth
parent 7274ca997d
commit 4f69772ecc
24 changed files with 227 additions and 188 deletions

View File

@ -357,7 +357,7 @@ struct Linker::Binary : Root_object, Elf_object
return 0;
}
void call_entry_point(Genode::Environment &env)
void call_entry_point(Genode::Env &env)
{
/* call static construtors and register destructors */
Func * const ctors_start = (Func *)lookup_symbol("_ctors_start");
@ -371,7 +371,7 @@ struct Linker::Binary : Root_object, Elf_object
/* call component entry point */
/* XXX the function type for call_component_construct() is a candidate
* for a base-internal header */
typedef void (*Entry)(Genode::Environment &);
typedef void (*Entry)(Genode::Env &);
Entry const entry = reinterpret_cast<Entry>(_file->entry);
entry(env);
@ -543,7 +543,7 @@ char const * Component::name() { return "ep"; }
struct Failed_to_load_program { };
void Component::construct(Genode::Environment &env)
void Component::construct(Genode::Env &env)
{
/* load program headers of linker now */
if (!Ld::linker()->file())

View File

@ -34,15 +34,15 @@ namespace Genode {
* component's entrypoint is activated.
*/
extern void (*call_component_construct)(Genode::Environment &) __attribute__((weak));
extern void (*call_component_construct)(Genode::Env &) __attribute__((weak));
}
static void default_component_construct(Genode::Environment &env)
static void default_component_construct(Genode::Env &env)
{
Component::construct(env);
}
void (*Genode::call_component_construct)(Genode::Environment &) = &default_component_construct;
void (*Genode::call_component_construct)(Genode::Env &) = &default_component_construct;
/****************************************************
@ -71,8 +71,8 @@ extern char **genode_envp;
extern int main(int argc, char **argv, char **envp);
void Component::construct(Genode::Environment &env) __attribute__((weak));
void Component::construct(Genode::Environment &env)
void Component::construct(Genode::Env &env) __attribute__((weak));
void Component::construct(Genode::Env &env)
{
/* call real main function */
exit_status = main(genode_argc, genode_argv, genode_envp);

View File

@ -20,12 +20,12 @@
/* FIXME move to base-internal header */
namespace Genode {
extern void (*call_component_construct)(Environment &);
extern void (*call_component_construct)(Env &);
}
namespace Genode {
void component_entry_point(Genode::Environment &env)
void component_entry_point(Genode::Env &env)
{
call_component_construct(env);
}