diff --git a/repos/os/include/rtc_session/client.h b/repos/os/include/rtc_session/client.h index 8aaadf0313..14de7645e8 100644 --- a/repos/os/include/rtc_session/client.h +++ b/repos/os/include/rtc_session/client.h @@ -35,6 +35,9 @@ struct Rtc::Session_client : Genode::Rpc_client ** Session interface ** ***********************/ + void set_sigh(Genode::Signal_context_capability sigh) override { + call(sigh); } + Timestamp current_time() override { return call(); } }; diff --git a/repos/os/include/rtc_session/rtc_session.h b/repos/os/include/rtc_session/rtc_session.h index cc50009223..64e096a3c4 100644 --- a/repos/os/include/rtc_session/rtc_session.h +++ b/repos/os/include/rtc_session/rtc_session.h @@ -19,6 +19,7 @@ #include #include #include +#include namespace Rtc { struct Timestamp; @@ -60,6 +61,14 @@ struct Rtc::Session : Genode::Session ** Session interface ** ***********************/ + /** + * Register set signal handler + * + * \param sigh signal handler that is called when the RTC has + * been set + */ + virtual void set_sigh(Genode::Signal_context_capability sigh) = 0; + /** * Query current time * @@ -71,8 +80,10 @@ struct Rtc::Session : Genode::Session ** RPC interface ** *******************/ + GENODE_RPC(Rpc_set_sigh, void, set_sigh, + Genode::Signal_context_capability); GENODE_RPC(Rpc_current_time, Timestamp, current_time); - GENODE_RPC_INTERFACE(Rpc_current_time); + GENODE_RPC_INTERFACE(Rpc_set_sigh, Rpc_current_time); }; #endif /* _INCLUDE__RTC_SESSION__RTC_SESSION_H_ */ diff --git a/repos/os/src/drivers/rtc/main.cc b/repos/os/src/drivers/rtc/main.cc index 86fae8875c..1ac746bd87 100644 --- a/repos/os/src/drivers/rtc/main.cc +++ b/repos/os/src/drivers/rtc/main.cc @@ -33,6 +33,13 @@ struct Rtc::Session_component : public Genode::Rpc_object { Env &_env; + Signal_context_capability _set_sig_cap { }; + + void set_sigh(Signal_context_capability sigh) override + { + _set_sig_cap = sigh; + } + Timestamp current_time() override { Timestamp ret = Rtc::get_time(_env);