Move server API concept to base framework

This commit introduces the new `Component` interface in the form of the
headers base/component.h and base/entrypoint.h. The os/server.h API
has become merely a compatibilty wrapper and will eventually be removed.
The same holds true for os/signal_rpc_dispatcher.h. The mechanism has
moved to base/signal.h and is now called 'Signal_handler'.

Since the patch shuffles headers around, please do a 'make clean' in the
build directory.

Issue #1832
This commit is contained in:
Norman Feske
2015-12-23 15:22:33 +01:00
committed by Christian Helmuth
parent 4ac7127f89
commit 051e84c4b4
74 changed files with 1730 additions and 638 deletions

View File

@ -43,22 +43,6 @@ namespace Genode {
*/
Native_capability _sem;
/**
* Request NOVA semaphore from signal-source server
*/
void _init_sem()
{
/* initialize semaphore only once */
if (_sem.valid()) return;
/* request mapping of semaphore capability selector */
Thread_base * myself = Thread_base::myself();
request_signal_sm_cap(Native_capability(myself->native_thread().ec_sel + 1),
myself->native_thread().exc_pt_sel + Nova::PT_SEL_STARTUP);
_sem = Native_capability(myself->native_thread().exc_pt_sel + Nova::PT_SEL_STARTUP);
call<Rpc_register_semaphore>(_sem);
}
public:
/**
@ -67,11 +51,17 @@ namespace Genode {
Signal_source_client(Capability<Signal_source> cap)
: Rpc_client<Nova_signal_source>(static_cap_cast<Nova_signal_source>(cap))
{
/*
* Make sure that we have acquired the
* semaphore from the server
*/
_init_sem();
/* request mapping of semaphore capability selector */
Thread_base * myself = Thread_base::myself();
request_signal_sm_cap(Native_capability(myself->native_thread().ec_sel + 1),
myself->native_thread().exc_pt_sel + Nova::PT_SEL_STARTUP);
_sem = Native_capability(myself->native_thread().exc_pt_sel + Nova::PT_SEL_STARTUP);
call<Rpc_register_semaphore>(_sem);
}
~Signal_source_client()
{
Nova::revoke(Nova::Obj_crd(_sem.local_name(), 0));
}