mirror of
https://github.com/genodelabs/genode.git
synced 2025-03-10 22:44:30 +00:00
parent
85b1563e57
commit
86cacd23bb
@ -23,9 +23,18 @@ namespace Rtc { struct Session_client; }
|
||||
|
||||
struct Rtc::Session_client : Genode::Rpc_client<Session>
|
||||
{
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* \param session session capability
|
||||
*/
|
||||
Session_client(Genode::Capability<Session> cap)
|
||||
: Genode::Rpc_client<Session>(cap) {}
|
||||
|
||||
/***********************
|
||||
** Session interface **
|
||||
***********************/
|
||||
|
||||
Timestamp current_time() override { return call<Rpc_current_time>(); }
|
||||
};
|
||||
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
/*
|
||||
* Copyright (C) 2012 Intel Corporation
|
||||
* Copyright (C) 2013-2017 Genode Labs GmbH
|
||||
* Copyright (C) 2013-2019 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.
|
||||
@ -26,6 +26,9 @@ namespace Rtc {
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* RTC value
|
||||
*/
|
||||
struct Rtc::Timestamp
|
||||
{
|
||||
unsigned microsecond;
|
||||
@ -53,8 +56,21 @@ struct Rtc::Session : Genode::Session
|
||||
|
||||
enum { CAP_QUOTA = 2 };
|
||||
|
||||
/***********************
|
||||
** Session interface **
|
||||
***********************/
|
||||
|
||||
/**
|
||||
* Query current time
|
||||
*
|
||||
* \return RTC value as structed timestamp
|
||||
*/
|
||||
virtual Timestamp current_time() = 0;
|
||||
|
||||
/*******************
|
||||
** RPC interface **
|
||||
*******************/
|
||||
|
||||
GENODE_RPC(Rpc_current_time, Timestamp, current_time);
|
||||
GENODE_RPC_INTERFACE(Rpc_current_time);
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user