mirror of
https://github.com/genodelabs/genode.git
synced 2025-06-14 21:28:16 +00:00
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:
committed by
Christian Helmuth
parent
4ac7127f89
commit
051e84c4b4
@ -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));
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user