base: restructure signal-submit initialization

This patch allows core's 'Signal_transmitter' implementation to sidestep
the 'Env::Pd' interface and thereby adhere to a stricter layering within
core. The 'Signal_transmitter' now uses - on kernels that depend on it -
a dedicated (and fairly freestanding) RPC proxy mechanism for signal
deliver, instead of channeling signals through the 'Pd_session::submit'
RPC function.
This commit is contained in:
Norman Feske
2017-05-10 20:11:38 +02:00
committed by Christian Helmuth
parent 71efb59873
commit a1df4fee44
38 changed files with 372 additions and 64 deletions

View File

@ -272,6 +272,7 @@ namespace {
Genode::inhibit_tracing = false;
Genode::call_global_static_constructors();
Genode::init_signal_transmitter(env);
Component::construct(env);
}
@ -282,11 +283,11 @@ namespace {
Entrypoint::Entrypoint(Env &env)
:
_env(env),
_rpc_ep(&env.pd(), Component::stack_size(), initial_ep_name())
{
/* initialize signalling after initializing but before calling the entrypoint */
init_signal_thread(_env);
_rpc_ep(&env.pd(), Component::stack_size(), initial_ep_name()),
/* initialize signalling before creating the first signal receiver */
_signalling_initialized((init_signal_thread(env), true))
{
/* initialize emulation of the original synchronous root interface */
init_root_proxy(_env);
@ -317,7 +318,7 @@ Entrypoint::Entrypoint(Env &env)
Entrypoint::Entrypoint(Env &env, size_t stack_size, char const *name)
:
_env(env),
_rpc_ep(&env.pd(), stack_size, name)
_rpc_ep(&env.pd(), stack_size, name), _signalling_initialized(true)
{
_signal_proxy_thread.construct(env, *this);
}

View File

@ -2,30 +2,40 @@
* \brief Generic implementation parts of the signaling framework
* \author Norman Feske
* \author Alexander Boettcher
* \date 2015-03-17
*/
/*
* Copyright (C) 2008-2017 Genode Labs GmbH
* Copyright (C) 2015-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.
*/
/* Genode includes */
#include <base/env.h>
#include <base/trace/events.h>
#include <base/signal.h>
/* base-internal includes */
#include <base/internal/globals.h>
using namespace Genode;
static Pd_session *_pd;
void Genode::init_signal_transmitter(Env &env) { _pd = &env.pd(); }
/************************
** Signal transmitter **
************************/
void Signal_transmitter::submit(unsigned cnt)
{
{
Trace::Signal_submit trace_event(cnt);
}
env_deprecated()->pd_session()->submit(_context, cnt);
if (_pd)
_pd->submit(_context, cnt);
else
warning("missing call of 'init_signal_submit'");
}