base: make Entrypoint placeable on specific cpu

Fixes #3008
This commit is contained in:
Alexander Boettcher 2018-10-02 16:27:35 +02:00 committed by Christian Helmuth
parent b112b7b4ce
commit 5446c52c43
12 changed files with 30 additions and 19 deletions

View File

@ -57,9 +57,11 @@ class Genode::Entrypoint : Noncopyable
{
enum { STACK_SIZE = 2*1024*sizeof(long) };
Entrypoint &ep;
Signal_proxy_thread(Env &env, Entrypoint &ep)
Signal_proxy_thread(Env &env, Entrypoint &ep, Location location,
Weight weight, Cpu_session &cpu_session)
:
Thread(env, "signal_proxy", STACK_SIZE),
Thread(env, "signal_proxy", STACK_SIZE, location,
weight, cpu_session),
ep(ep)
{ start(); }
@ -136,7 +138,8 @@ class Genode::Entrypoint : Noncopyable
public:
Entrypoint(Env &env, size_t stack_size, char const *name);
Entrypoint(Env &env, size_t stack_size, char const *name,
Affinity::Location);
~Entrypoint()
{

View File

@ -64,8 +64,8 @@ _ZN6Genode10Entrypoint6manageERNS_22Signal_dispatcher_baseE T
_ZN6Genode10Entrypoint8dissolveERNS_22Signal_dispatcher_baseE T
_ZN6Genode10EntrypointC1ERNS_3EnvE T
_ZN6Genode10EntrypointC1ERNS_3EnvEmPKc T
_ZN6Genode10EntrypointC2ERNS_3EnvE T
_ZN6Genode10EntrypointC2ERNS_3EnvEmPKc T
_ZN6Genode10EntrypointC1ERNS_3EnvEmPKcNS_8Affinity8LocationE T
_ZN6Genode10EntrypointC2ERNS_3EnvEmPKcNS_8Affinity8LocationE T
_ZN6Genode10Ipc_serverC1Ev T
_ZN6Genode10Ipc_serverC2Ev T
_ZN6Genode10Ipc_serverD1Ev T

View File

@ -329,12 +329,14 @@ Entrypoint::Entrypoint(Env &env)
_process_incoming_signals();
}
Entrypoint::Entrypoint(Env &env, size_t stack_size, char const *name)
Entrypoint::Entrypoint(Env &env, size_t stack_size, char const *name,
Affinity::Location location)
:
_env(env),
_rpc_ep(&env.pd(), stack_size, name), _signalling_initialized(true)
_rpc_ep(&env.pd(), stack_size, name, true, location),
_signalling_initialized(true)
{
_signal_proxy_thread.construct(env, *this);
_signal_proxy_thread.construct(env, *this, location,
Thread::Weight(), env.cpu());
}

View File

@ -116,7 +116,7 @@ namespace {
Id_space<Parent::Server> _id_space { };
Entrypoint _ep { _env, 2*1024*sizeof(long), "root" };
Entrypoint _ep { _env, 2*1024*sizeof(long), "root", Affinity::Location() };
Attached_rom_dataspace _session_requests { _env, "session_requests" };

View File

@ -66,7 +66,8 @@ class Local_fault_handler : public Entrypoint
public:
Local_fault_handler(Genode::Env & env, Region_map &region_map)
: Entrypoint(env, sizeof(addr_t)*2048, "local_fault_handler"),
: Entrypoint(env, sizeof(addr_t)*2048, "local_fault_handler",
Affinity::Location()),
_env(env),
_region_map(region_map),
_handler(*this, *this, &Local_fault_handler::_handle_fault)

View File

@ -410,7 +410,8 @@ class Net::Socketcall : public Lxip::Socketcall,
Socketcall(Genode::Env &env)
:
Entrypoint(env, 64 * 1024 * sizeof(long), "socketcall")
Entrypoint(env, 64 * 1024 * sizeof(long), "socketcall",
Genode::Affinity::Location())
{ }
/**************************

View File

@ -26,7 +26,8 @@ struct Qt_launchpad_namespace::Local_env : Genode::Env
Genode::Entrypoint local_ep { genode_env,
2*1024*sizeof(addr_t),
"qt_launchpad_ep" };
"qt_launchpad_ep",
Affinity::Location() };
Local_env(Env &genode_env) : genode_env(genode_env) { }

View File

@ -173,6 +173,7 @@ extern "C" int eglut_main(int argc, char *argv[]);
void Libc::Component::construct(Libc::Env &env)
{
genode_env = &env;
signal_ep.construct(env, 1024*sizeof(long), "eglut_signal_ep");
signal_ep.construct(env, 1024*sizeof(long), "eglut_signal_ep",
Genode::Affinity::Location());
Libc::with_libc([] () { eglut_main(1, nullptr); });
}

View File

@ -145,7 +145,8 @@ class Test::Input_to_filter
*/
enum { STACK_SIZE = 4*1024*sizeof(long) };
Entrypoint _ep { _env, STACK_SIZE, "input_server_ep" };
Entrypoint _ep { _env, STACK_SIZE, "input_server_ep",
Affinity::Location() };
/*
* Input supplied to the input_filter

View File

@ -456,7 +456,7 @@ struct Nested_test : Signal_test
};
Env &env;
Entrypoint ep { env, 2048 * sizeof(long), "wait_dispatch_ep" };
Entrypoint ep { env, 2048 * sizeof(long), "wait_dispatch_ep", Affinity::Location() };
Signal_handler<Nested_test> app_handler { ep, *this, &Nested_test::handle_app };
Signal_handler<Nested_test> nop_handler { ep, *this, &Nested_test::handle_nop };
@ -559,7 +559,8 @@ struct Nested_stress_test : Signal_test
Io_signal_handler<Receiver> handler { ep, *this, &Receiver::handle };
Receiver(Env &env, char const *name)
: ep(env, 3 * 1024 * sizeof(long), name), name(name) { }
: ep(env, 3 * 1024 * sizeof(long), name, Affinity::Location()),
name(name) { }
void handle()
{

View File

@ -804,7 +804,7 @@ struct Fast_polling : Test
unsigned id)
:
Test(env, error_cnt, done, id, brief),
main_ep(env, STACK_SIZE, "fast_polling_ep"),
main_ep(env, STACK_SIZE, "fast_polling_ep", Affinity::Location()),
main_handler(main_ep, *this, &Fast_polling::main)
{
if (precise_time(config.xml())) {

View File

@ -58,7 +58,7 @@ class Gdb_monitor::App_child : public Child_policy,
Genode::Env &genode_env;
Genode::Entrypoint local_ep {
genode_env, 4*1024*sizeof(addr_t), "target_ep" };
genode_env, 4*1024*sizeof(addr_t), "target_ep", Affinity::Location() };
Local_env(Env &genode_env) : genode_env(genode_env) { }