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
repos
base-linux/src/test
lx_hybrid_ctors
lx_hybrid_errno
lx_hybrid_exception
lx_hybrid_pthread_ipc
base
include/base
src
libports/src/lib/libc
os/src
drivers/framebuffer/spec/sdl
lib/server

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

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

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

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

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

@ -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)
{
Signal_dispatcher_base *dispatcher = 0;
@ -79,7 +85,7 @@ void Entrypoint::_process_incoming_signals()
_suspended_callback();
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);
_sig_rec.construct();
@ -154,7 +160,7 @@ namespace {
Entrypoint::Entrypoint(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 */
init_signal_thread(_env);

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

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

@ -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); }

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

@ -215,5 +215,4 @@ struct Main
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); }

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