base: remove Component::name from API

It turns out that the name function does not have much use in practice
except for naming the thread of the component's initial entrypoint. For
dynamically linked components, this thread is created by the dynamic
linker. It is named "ep" in these cases. Considering that we will
eventually turn all regular components into dynamically linked
executables, the additional information provided by the
Component::name() function remains unused. So it is better to not bother
the component developers with adding boilerplate code.
This commit is contained in:
Norman Feske 2016-05-09 15:04:37 +02:00 committed by Christian Helmuth
parent 1e95af5bab
commit f6dec901bb
12 changed files with 14 additions and 31 deletions

View File

@ -45,7 +45,6 @@ static void exit_on_suspended() { exit(exit_status); }
Genode::size_t Component::stack_size() { return 16*1024*sizeof(long); } Genode::size_t Component::stack_size() { return 16*1024*sizeof(long); }
char const * Component::name() { return "lx_hybrid_ctors"; }
/* /*

View File

@ -47,7 +47,6 @@ static void exit_on_suspended() { exit(exit_status); }
Genode::size_t Component::stack_size() { return 16*1024*sizeof(long); } Genode::size_t Component::stack_size() { return 16*1024*sizeof(long); }
char const * Component::name() { return "lx_hybrid_errno"; }
struct Unexpected_errno_change { }; struct Unexpected_errno_change { };

View File

@ -28,7 +28,6 @@ static void exit_on_suspended() { exit(exit_status); }
Genode::size_t Component::stack_size() { return 16*1024*sizeof(long); } Genode::size_t Component::stack_size() { return 16*1024*sizeof(long); }
char const * Component::name() { return "lx_hybrid_exception"; }
/* /*

View File

@ -54,7 +54,6 @@ static void exit_on_suspended() { exit(exit_status); }
Genode::size_t Component::stack_size() { return 16*1024*sizeof(long); } Genode::size_t Component::stack_size() { return 16*1024*sizeof(long); }
char const * Component::name() { return "lx_hybrid_pthread_ipc"; }
/* /*

View File

@ -30,11 +30,6 @@ namespace Component
*/ */
Genode::size_t stack_size(); Genode::size_t stack_size();
/**
* Return component name
*/
char const *name();
/** /**
* Construct component * Construct component
* *

View File

@ -36,6 +36,12 @@ namespace Genode {
} }
/**
* Return thread name used for the component's initial entrypoint
*/
static char const *initial_ep_name() { return "ep"; }
void Entrypoint::_dispatch_signal(Signal &sig) void Entrypoint::_dispatch_signal(Signal &sig)
{ {
Signal_dispatcher_base *dispatcher = 0; Signal_dispatcher_base *dispatcher = 0;
@ -79,7 +85,7 @@ void Entrypoint::_process_incoming_signals()
_suspended_callback(); _suspended_callback();
init_signal_thread(_env); init_signal_thread(_env);
_rpc_ep.construct(&_env.pd(), Component::stack_size(), Component::name()); _rpc_ep.construct(&_env.pd(), Component::stack_size(), initial_ep_name());
_signal_proxy_cap = manage(_signal_proxy); _signal_proxy_cap = manage(_signal_proxy);
_sig_rec.construct(); _sig_rec.construct();
@ -154,7 +160,7 @@ namespace {
Entrypoint::Entrypoint(Env &env) Entrypoint::Entrypoint(Env &env)
: :
_env(env), _env(env),
_rpc_ep(&env.pd(), Component::stack_size(), Component::name()) _rpc_ep(&env.pd(), Component::stack_size(), initial_ep_name())
{ {
/* initialize signalling after initializing but before calling the entrypoint */ /* initialize signalling after initializing but before calling the entrypoint */
init_signal_thread(_env); init_signal_thread(_env);

View File

@ -539,10 +539,11 @@ extern "C" void init_rtld()
Genode::size_t Component::stack_size() { return 16*1024*sizeof(long); } Genode::size_t Component::stack_size() { return 16*1024*sizeof(long); }
char const * Component::name() { return "ep"; }
struct Failed_to_load_program { }; struct Failed_to_load_program { };
void Component::construct(Genode::Env &env) void Component::construct(Genode::Env &env)
{ {
/* load program headers of linker now */ /* load program headers of linker now */

View File

@ -89,10 +89,3 @@ Genode::size_t Component::stack_size()
{ {
return 16UL * 1024 * sizeof(Genode::addr_t); return 16UL * 1024 * sizeof(Genode::addr_t);
} }
char const *Component::name() __attribute__((weak));
char const *Component::name()
{
return "ep";
}

View File

@ -333,9 +333,6 @@ static void test_create_as_many_threads(Env &env)
} }
char const *Component::name() { return "test-thread"; }
size_t Component::stack_size() { return 16*1024*sizeof(long); } size_t Component::stack_size() { return 16*1024*sizeof(long); }

View File

@ -72,9 +72,11 @@ class Libc::Task : public Genode::Rpc_object<Task_resume, Libc::Task>
bool _app_runnable = true; bool _app_runnable = true;
jmp_buf _app_task; jmp_buf _app_task;
Genode::Thread &_myself = *Genode::Thread::myself();
void *_app_stack = { void *_app_stack = {
Genode::Thread::myself()->alloc_secondary_stack(Component::name(), _myself.alloc_secondary_stack(_myself.name().string(),
Component::stack_size()) }; Component::stack_size()) };
/** /**
* Libc context * Libc context

View File

@ -215,5 +215,4 @@ struct Main
Genode::size_t Component::stack_size() { return 4*1024*sizeof(long); } Genode::size_t Component::stack_size() { return 4*1024*sizeof(long); }
char const * Component::name() { return "fb_sdl"; }
void Component::construct(Genode::Env &env) { static Main inst(env); } void Component::construct(Genode::Env &env) { static Main inst(env); }

View File

@ -21,12 +21,6 @@ Genode::size_t Component::stack_size()
} }
char const *Component::name()
{
return Server::name();
}
static Genode::Env *_env; static Genode::Env *_env;